From c5c52684eb30d924cb75a632b526a0f879d5a33c Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Sun, 18 Sep 2016 17:38:12 +0300 Subject: Format Java files using Eclipse Neon and Vaadin settings Using the same formatting in the 7.7 branch and the master branch eases porting of fixes Change-Id: I51b4693f2f120447702cf322ce4505608ad92987 --- .../buildhelpers/FetchReleaseNotesAuthors.java | 25 +- .../buildhelpers/FetchReleaseNotesTickets.java | 12 +- .../java/com/vaadin/buildhelpers/CompileTheme.java | 30 +- .../buildhelpers/GeneratePackageExports.java | 29 +- .../com/vaadin/buildhelpers/ManifestWriter.java | 36 +- .../java/com/vaadin/sass/linker/SassLinker.java | 37 +- .../AcceptCriteriaFactoryGenerator.java | 29 +- .../ConnectorBundleLoaderFactory.java | 82 +- .../widgetsetutils/metadata/ArraySerializer.java | 6 +- .../widgetsetutils/metadata/ClientRpcVisitor.java | 21 +- .../widgetsetutils/metadata/ConnectorBundle.java | 53 +- .../metadata/ConnectorInitVisitor.java | 6 +- .../widgetsetutils/metadata/CustomSerializer.java | 6 +- .../widgetsetutils/metadata/EnumSerializer.java | 6 +- .../widgetsetutils/metadata/FieldProperty.java | 15 +- .../metadata/GeneratedSerializer.java | 6 +- .../widgetsetutils/metadata/JsonSerializer.java | 10 +- .../widgetsetutils/metadata/MethodProperty.java | 34 +- .../metadata/OnStateChangeVisitor.java | 8 +- .../server/widgetsetutils/metadata/Property.java | 18 +- .../widgetsetutils/metadata/RendererVisitor.java | 47 +- .../widgetsetutils/metadata/ServerRpcVisitor.java | 9 +- .../widgetsetutils/metadata/StateInitVisitor.java | 10 +- .../widgetsetutils/metadata/TypeVisitor.java | 6 +- .../widgetsetutils/metadata/WidgetInitVisitor.java | 23 +- .../java/com/vaadin/tools/CvalAddonsChecker.java | 33 +- .../main/java/com/vaadin/tools/CvalChecker.java | 24 +- .../java/com/vaadin/tools/WidgetsetCompiler.java | 26 +- .../com/vaadin/tools/CvalAddonsCheckerTest.java | 4 +- .../tools/CvalAddonstCheckerUseCasesTest.java | 17 +- .../java/com/vaadin/tools/CvalCheckerTest.java | 88 +- .../main/java/com/vaadin/client/AnimationUtil.java | 20 +- .../vaadin/client/ApplicationConfiguration.java | 94 +- .../com/vaadin/client/ApplicationConnection.java | 218 ++-- .../main/java/com/vaadin/client/BrowserInfo.java | 52 +- .../src/main/java/com/vaadin/client/CSSRule.java | 10 +- .../java/com/vaadin/client/ComponentConnector.java | 30 +- .../java/com/vaadin/client/ComponentDetail.java | 8 +- .../java/com/vaadin/client/ComponentDetailMap.java | 6 +- .../main/java/com/vaadin/client/ComputedStyle.java | 68 +- .../client/ConnectorHierarchyChangeEvent.java | 26 +- .../main/java/com/vaadin/client/ConnectorMap.java | 33 +- .../vaadin/client/ContainerResizedListener.java | 12 +- .../java/com/vaadin/client/DateTimeService.java | 56 +- .../java/com/vaadin/client/DeferredWorker.java | 4 +- .../vaadin/client/DirectionalManagedLayout.java | 6 +- .../main/java/com/vaadin/client/EventHelper.java | 33 +- .../main/java/com/vaadin/client/FastStringMap.java | 6 +- .../main/java/com/vaadin/client/FastStringSet.java | 6 +- .../src/main/java/com/vaadin/client/Focusable.java | 8 +- .../client/HasChildMeasurementHintConnector.java | 16 +- .../com/vaadin/client/HasComponentsConnector.java | 16 +- .../vaadin/client/JavaScriptConnectorHelper.java | 70 +- .../com/vaadin/client/JavaScriptExtension.java | 6 +- .../main/java/com/vaadin/client/JsArrayObject.java | 6 +- .../main/java/com/vaadin/client/LayoutManager.java | 363 ++++--- .../java/com/vaadin/client/LayoutManagerIE8.java | 10 +- .../vaadin/client/LocaleNotLoadedException.java | 6 +- .../main/java/com/vaadin/client/LocaleService.java | 10 +- .../main/java/com/vaadin/client/MeasuredSize.java | 14 +- .../vaadin/client/MouseEventDetailsBuilder.java | 14 +- .../src/main/java/com/vaadin/client/Paintable.java | 8 +- .../src/main/java/com/vaadin/client/Profiler.java | 73 +- .../java/com/vaadin/client/RenderInformation.java | 20 +- .../main/java/com/vaadin/client/RenderSpace.java | 6 +- .../java/com/vaadin/client/ResourceLoader.java | 48 +- .../java/com/vaadin/client/ServerConnector.java | 45 +- .../main/java/com/vaadin/client/SimpleTree.java | 29 +- .../java/com/vaadin/client/StyleConstants.java | 6 +- .../main/java/com/vaadin/client/SuperDevMode.java | 43 +- .../main/java/com/vaadin/client/TooltipInfo.java | 11 +- client/src/main/java/com/vaadin/client/UIDL.java | 83 +- client/src/main/java/com/vaadin/client/Util.java | 219 ++-- .../src/main/java/com/vaadin/client/VCaption.java | 60 +- .../java/com/vaadin/client/VCaptionWrapper.java | 8 +- .../src/main/java/com/vaadin/client/VConsole.java | 10 +- .../main/java/com/vaadin/client/VErrorMessage.java | 20 +- .../java/com/vaadin/client/VLoadingIndicator.java | 30 +- .../java/com/vaadin/client/VSchedulerImpl.java | 6 +- .../src/main/java/com/vaadin/client/VTooltip.java | 122 +-- .../main/java/com/vaadin/client/VUIDLBrowser.java | 19 +- .../src/main/java/com/vaadin/client/ValueMap.java | 8 +- .../java/com/vaadin/client/WidgetInstantiator.java | 6 +- .../main/java/com/vaadin/client/WidgetLoader.java | 10 +- .../src/main/java/com/vaadin/client/WidgetMap.java | 16 +- .../src/main/java/com/vaadin/client/WidgetSet.java | 26 +- .../main/java/com/vaadin/client/WidgetUtil.java | 212 ++-- .../vaadin/client/annotations/OnStateChange.java | 10 +- .../AbstractServerConnectorEvent.java | 8 +- .../communication/AtmospherePushConnection.java | 41 +- .../communication/ConnectionStateHandler.java | 40 +- .../client/communication/Date_Serializer.java | 8 +- .../DefaultConnectionStateHandler.java | 74 +- .../communication/DefaultReconnectDialog.java | 11 +- .../client/communication/DiffJSONSerializer.java | 8 +- .../HasJavaScriptConnectorHelper.java | 6 +- .../com/vaadin/client/communication/Heartbeat.java | 23 +- .../client/communication/JSONSerializer.java | 14 +- .../communication/JavaScriptMethodInvocation.java | 8 +- .../vaadin/client/communication/JsonDecoder.java | 38 +- .../vaadin/client/communication/JsonEncoder.java | 49 +- .../client/communication/MessageHandler.java | 397 +++---- .../vaadin/client/communication/MessageSender.java | 50 +- .../client/communication/PushConnection.java | 28 +- .../client/communication/ReconnectDialog.java | 20 +- .../vaadin/client/communication/RpcManager.java | 39 +- .../com/vaadin/client/communication/RpcProxy.java | 22 +- .../client/communication/ServerRpcQueue.java | 53 +- .../client/communication/StateChangeEvent.java | 50 +- .../vaadin/client/communication/XhrConnection.java | 31 +- .../client/communication/XhrConnectionError.java | 20 +- .../client/componentlocator/ComponentLocator.java | 41 +- .../componentlocator/LegacyLocatorStrategy.java | 62 +- .../client/componentlocator/LocatorStrategy.java | 28 +- .../client/componentlocator/LocatorUtil.java | 16 +- .../client/componentlocator/SelectorPredicate.java | 24 +- .../VaadinFinderLocatorStrategy.java | 79 +- .../connectors/AbstractRendererConnector.java | 49 +- .../AbstractSelectionModelConnector.java | 12 +- .../client/connectors/ButtonRendererConnector.java | 11 +- .../connectors/ClickableRendererConnector.java | 35 +- .../client/connectors/DateRendererConnector.java | 8 +- .../DetailComponentManagerConnector.java | 11 +- .../vaadin/client/connectors/GridConnector.java | 98 +- .../client/connectors/ImageRendererConnector.java | 8 +- .../connectors/JavaScriptRendererConnector.java | 40 +- .../connectors/MultiSelectionModelConnector.java | 50 +- .../connectors/NoSelectionModelConnector.java | 12 +- .../client/connectors/NumberRendererConnector.java | 13 +- .../connectors/ProgressBarRendererConnector.java | 12 +- .../client/connectors/RpcDataSourceConnector.java | 24 +- .../connectors/SingleSelectionModelConnector.java | 20 +- .../client/connectors/TextRendererConnector.java | 8 +- .../connectors/UnsafeHtmlRendererConnector.java | 12 +- .../client/data/AbstractRemoteDataSource.java | 75 +- .../java/com/vaadin/client/data/CacheStrategy.java | 36 +- .../com/vaadin/client/data/DataChangeHandler.java | 18 +- .../java/com/vaadin/client/data/DataSource.java | 32 +- .../client/debug/internal/AnalyzeLayoutsPanel.java | 37 +- .../client/debug/internal/ConnectorInfoPanel.java | 18 +- .../vaadin/client/debug/internal/DebugButton.java | 20 +- .../debug/internal/ErrorNotificationHandler.java | 12 +- .../client/debug/internal/HierarchyPanel.java | 12 +- .../client/debug/internal/HierarchySection.java | 32 +- .../vaadin/client/debug/internal/Highlight.java | 30 +- .../com/vaadin/client/debug/internal/Icon.java | 6 +- .../vaadin/client/debug/internal/InfoSection.java | 48 +- .../vaadin/client/debug/internal/LogSection.java | 27 +- .../client/debug/internal/NetworkSection.java | 14 +- .../debug/internal/OptimizedWidgetsetPanel.java | 12 +- .../client/debug/internal/ProfilerSection.java | 26 +- .../com/vaadin/client/debug/internal/Section.java | 17 +- .../debug/internal/SelectConnectorListener.java | 10 +- .../vaadin/client/debug/internal/SelectorPath.java | 24 +- .../client/debug/internal/TestBenchSection.java | 38 +- .../vaadin/client/debug/internal/VDebugWindow.java | 92 +- .../debug/internal/theme/DebugWindowStyles.java | 6 +- .../vaadin/client/event/PointerCancelEvent.java | 10 +- .../vaadin/client/event/PointerCancelHandler.java | 10 +- .../com/vaadin/client/event/PointerDownEvent.java | 10 +- .../vaadin/client/event/PointerDownHandler.java | 10 +- .../java/com/vaadin/client/event/PointerEvent.java | 32 +- .../vaadin/client/event/PointerEventSupport.java | 8 +- .../client/event/PointerEventSupportImpl.java | 8 +- .../client/event/PointerEventSupportImplIE10.java | 12 +- .../event/PointerEventSupportImplModernIE.java | 12 +- .../com/vaadin/client/event/PointerMoveEvent.java | 10 +- .../vaadin/client/event/PointerMoveHandler.java | 10 +- .../com/vaadin/client/event/PointerUpEvent.java | 10 +- .../com/vaadin/client/event/PointerUpHandler.java | 10 +- .../extensions/AbstractExtensionConnector.java | 8 +- .../extensions/BrowserWindowOpenerConnector.java | 11 +- .../client/extensions/FileDownloaderConnector.java | 6 +- .../client/extensions/ResponsiveConnector.java | 30 +- .../JavaScriptManagerConnector.java | 12 +- .../vaadin/client/metadata/AsyncBundleLoader.java | 6 +- .../vaadin/client/metadata/BundleLoadCallback.java | 6 +- .../client/metadata/ConnectorBundleLoader.java | 4 +- .../vaadin/client/metadata/InvokationHandler.java | 6 +- .../java/com/vaadin/client/metadata/Invoker.java | 6 +- .../com/vaadin/client/metadata/JsniInvoker.java | 10 +- .../java/com/vaadin/client/metadata/Method.java | 16 +- .../vaadin/client/metadata/NoDataException.java | 6 +- .../client/metadata/OnStateChangeMethod.java | 26 +- .../java/com/vaadin/client/metadata/Property.java | 22 +- .../com/vaadin/client/metadata/ProxyHandler.java | 6 +- .../main/java/com/vaadin/client/metadata/Type.java | 3 +- .../java/com/vaadin/client/metadata/TypeData.java | 6 +- .../com/vaadin/client/metadata/TypeDataStore.java | 103 +- .../vaadin/client/renderers/ButtonRenderer.java | 8 +- .../vaadin/client/renderers/ClickableRenderer.java | 39 +- .../vaadin/client/renderers/ComplexRenderer.java | 28 +- .../com/vaadin/client/renderers/DateRenderer.java | 28 +- .../com/vaadin/client/renderers/HtmlRenderer.java | 12 +- .../com/vaadin/client/renderers/ImageRenderer.java | 8 +- .../vaadin/client/renderers/NumberRenderer.java | 12 +- .../client/renderers/ProgressBarRenderer.java | 8 +- .../java/com/vaadin/client/renderers/Renderer.java | 14 +- .../com/vaadin/client/renderers/TextRenderer.java | 8 +- .../vaadin/client/renderers/WidgetRenderer.java | 27 +- .../client/ui/AbstractClickEventHandler.java | 26 +- .../client/ui/AbstractComponentConnector.java | 135 ++- .../ui/AbstractComponentContainerConnector.java | 12 +- .../com/vaadin/client/ui/AbstractConnector.java | 69 +- .../vaadin/client/ui/AbstractFieldConnector.java | 13 +- .../client/ui/AbstractHasComponentsConnector.java | 20 +- .../vaadin/client/ui/AbstractLayoutConnector.java | 10 +- .../AbstractSingleComponentContainerConnector.java | 16 +- .../src/main/java/com/vaadin/client/ui/Action.java | 10 +- .../java/com/vaadin/client/ui/ActionOwner.java | 6 +- .../java/com/vaadin/client/ui/CalendarEntry.java | 6 +- .../com/vaadin/client/ui/ClickEventHandler.java | 12 +- .../client/ui/ConnectorFocusAndBlurHandler.java | 12 +- .../src/main/java/com/vaadin/client/ui/Field.java | 10 +- .../com/vaadin/client/ui/FocusElementPanel.java | 6 +- .../main/java/com/vaadin/client/ui/FocusUtil.java | 32 +- .../com/vaadin/client/ui/FocusableFlexTable.java | 18 +- .../com/vaadin/client/ui/FocusableFlowPanel.java | 16 +- .../com/vaadin/client/ui/FocusableScrollPanel.java | 24 +- .../main/java/com/vaadin/client/ui/FontIcon.java | 33 +- .../src/main/java/com/vaadin/client/ui/Icon.java | 14 +- .../main/java/com/vaadin/client/ui/ImageIcon.java | 8 +- .../client/ui/JavaScriptComponentConnector.java | 6 +- .../com/vaadin/client/ui/JavaScriptWidget.java | 6 +- .../vaadin/client/ui/JsniMousewheelHandler.java | 14 +- .../vaadin/client/ui/LayoutClickEventHandler.java | 9 +- .../java/com/vaadin/client/ui/LegacyConnector.java | 6 +- .../java/com/vaadin/client/ui/ManagedLayout.java | 6 +- .../com/vaadin/client/ui/MediaBaseConnector.java | 6 +- .../com/vaadin/client/ui/PostLayoutListener.java | 8 +- .../vaadin/client/ui/ShortcutActionHandler.java | 22 +- .../com/vaadin/client/ui/SimpleFocusablePanel.java | 10 +- .../com/vaadin/client/ui/SimpleManagedLayout.java | 6 +- .../java/com/vaadin/client/ui/SubPartAware.java | 12 +- .../com/vaadin/client/ui/TouchScrollDelegate.java | 54 +- .../main/java/com/vaadin/client/ui/TreeAction.java | 10 +- .../client/ui/UnknownComponentConnector.java | 26 +- .../java/com/vaadin/client/ui/VAbsoluteLayout.java | 57 +- .../com/vaadin/client/ui/VAbstractSplitPanel.java | 61 +- .../main/java/com/vaadin/client/ui/VAccordion.java | 28 +- .../src/main/java/com/vaadin/client/ui/VAudio.java | 6 +- .../java/com/vaadin/client/ui/VBrowserFrame.java | 10 +- .../main/java/com/vaadin/client/ui/VButton.java | 32 +- .../main/java/com/vaadin/client/ui/VCalendar.java | 196 ++-- .../java/com/vaadin/client/ui/VCalendarPanel.java | 222 ++-- .../main/java/com/vaadin/client/ui/VCheckBox.java | 12 +- .../java/com/vaadin/client/ui/VColorPicker.java | 14 +- .../com/vaadin/client/ui/VColorPickerArea.java | 33 +- .../java/com/vaadin/client/ui/VContextMenu.java | 38 +- .../main/java/com/vaadin/client/ui/VCssLayout.java | 6 +- .../com/vaadin/client/ui/VCustomComponent.java | 6 +- .../java/com/vaadin/client/ui/VCustomLayout.java | 40 +- .../main/java/com/vaadin/client/ui/VDateField.java | 12 +- .../com/vaadin/client/ui/VDateFieldCalendar.java | 32 +- .../com/vaadin/client/ui/VDragAndDropWrapper.java | 72 +- .../vaadin/client/ui/VDragAndDropWrapperIE.java | 6 +- .../main/java/com/vaadin/client/ui/VEmbedded.java | 66 +- .../java/com/vaadin/client/ui/VFilterSelect.java | 277 +++-- .../src/main/java/com/vaadin/client/ui/VFlash.java | 31 +- .../src/main/java/com/vaadin/client/ui/VForm.java | 6 +- .../java/com/vaadin/client/ui/VFormLayout.java | 36 +- .../java/com/vaadin/client/ui/VGridLayout.java | 31 +- .../com/vaadin/client/ui/VHorizontalLayout.java | 6 +- .../src/main/java/com/vaadin/client/ui/VImage.java | 6 +- .../src/main/java/com/vaadin/client/ui/VLabel.java | 6 +- .../java/com/vaadin/client/ui/VLazyExecutor.java | 8 +- .../src/main/java/com/vaadin/client/ui/VLink.java | 6 +- .../java/com/vaadin/client/ui/VListSelect.java | 6 +- .../main/java/com/vaadin/client/ui/VMediaBase.java | 8 +- .../main/java/com/vaadin/client/ui/VMenuBar.java | 148 +-- .../java/com/vaadin/client/ui/VNativeButton.java | 8 +- .../java/com/vaadin/client/ui/VNativeSelect.java | 14 +- .../java/com/vaadin/client/ui/VNotification.java | 82 +- .../java/com/vaadin/client/ui/VOptionGroup.java | 17 +- .../com/vaadin/client/ui/VOptionGroupBase.java | 14 +- .../main/java/com/vaadin/client/ui/VOverlay.java | 17 +- .../src/main/java/com/vaadin/client/ui/VPanel.java | 18 +- .../java/com/vaadin/client/ui/VPasswordField.java | 10 +- .../java/com/vaadin/client/ui/VPopupCalendar.java | 87 +- .../main/java/com/vaadin/client/ui/VPopupView.java | 26 +- .../java/com/vaadin/client/ui/VProgressBar.java | 10 +- .../com/vaadin/client/ui/VProgressIndicator.java | 10 +- .../java/com/vaadin/client/ui/VRichTextArea.java | 31 +- .../java/com/vaadin/client/ui/VScrollTable.java | 861 +++++++-------- .../main/java/com/vaadin/client/ui/VSlider.java | 41 +- .../vaadin/client/ui/VSplitPanelHorizontal.java | 6 +- .../com/vaadin/client/ui/VSplitPanelVertical.java | 9 +- .../main/java/com/vaadin/client/ui/VTabsheet.java | 90 +- .../java/com/vaadin/client/ui/VTabsheetBase.java | 20 +- .../java/com/vaadin/client/ui/VTabsheetPanel.java | 20 +- .../main/java/com/vaadin/client/ui/VTextArea.java | 12 +- .../main/java/com/vaadin/client/ui/VTextField.java | 16 +- .../java/com/vaadin/client/ui/VTextualDate.java | 54 +- .../src/main/java/com/vaadin/client/ui/VTree.java | 221 ++-- .../main/java/com/vaadin/client/ui/VTreeTable.java | 63 +- .../java/com/vaadin/client/ui/VTwinColSelect.java | 51 +- client/src/main/java/com/vaadin/client/ui/VUI.java | 48 +- .../com/vaadin/client/ui/VUnknownComponent.java | 6 +- .../main/java/com/vaadin/client/ui/VUpload.java | 20 +- .../java/com/vaadin/client/ui/VVerticalLayout.java | 6 +- .../src/main/java/com/vaadin/client/ui/VVideo.java | 10 +- .../main/java/com/vaadin/client/ui/VWindow.java | 115 +- .../ui/absolutelayout/AbsoluteLayoutConnector.java | 46 +- .../client/ui/accordion/AccordionConnector.java | 24 +- .../java/com/vaadin/client/ui/aria/AriaHelper.java | 33 +- .../vaadin/client/ui/aria/HandlesAriaCaption.java | 10 +- .../vaadin/client/ui/aria/HandlesAriaInvalid.java | 8 +- .../vaadin/client/ui/aria/HandlesAriaRequired.java | 8 +- .../com/vaadin/client/ui/audio/AudioConnector.java | 6 +- .../ui/browserframe/BrowserFrameConnector.java | 6 +- .../vaadin/client/ui/button/ButtonConnector.java | 14 +- .../client/ui/calendar/CalendarConnector.java | 104 +- .../vaadin/client/ui/calendar/VCalendarAction.java | 22 +- .../client/ui/calendar/schedule/CalendarDay.java | 8 +- .../client/ui/calendar/schedule/CalendarEvent.java | 57 +- .../client/ui/calendar/schedule/DateCell.java | 87 +- .../ui/calendar/schedule/DateCellContainer.java | 12 +- .../ui/calendar/schedule/DateCellDayEvent.java | 41 +- .../client/ui/calendar/schedule/DateCellGroup.java | 8 +- .../client/ui/calendar/schedule/DateUtil.java | 12 +- .../client/ui/calendar/schedule/DayToolbar.java | 14 +- .../calendar/schedule/FocusableComplexPanel.java | 24 +- .../client/ui/calendar/schedule/FocusableGrid.java | 20 +- .../client/ui/calendar/schedule/FocusableHTML.java | 20 +- .../client/ui/calendar/schedule/HasTooltipKey.java | 12 +- .../ui/calendar/schedule/MonthEventLabel.java | 22 +- .../client/ui/calendar/schedule/MonthGrid.java | 10 +- .../client/ui/calendar/schedule/SimpleDayCell.java | 30 +- .../ui/calendar/schedule/SimpleDayToolbar.java | 10 +- .../ui/calendar/schedule/SimpleWeekToolbar.java | 14 +- .../client/ui/calendar/schedule/WeekGrid.java | 56 +- .../calendar/schedule/WeekGridMinuteTimeRange.java | 10 +- .../client/ui/calendar/schedule/WeekLabel.java | 8 +- .../ui/calendar/schedule/WeeklyLongEvents.java | 18 +- .../schedule/WeeklyLongEventsDateCell.java | 8 +- .../calendar/schedule/dd/CalendarDropHandler.java | 21 +- .../schedule/dd/CalendarMonthDropHandler.java | 22 +- .../schedule/dd/CalendarWeekDropHandler.java | 25 +- .../client/ui/checkbox/CheckBoxConnector.java | 18 +- .../colorpicker/AbstractColorPickerConnector.java | 25 +- .../ui/colorpicker/ColorPickerAreaConnector.java | 12 +- .../ui/colorpicker/ColorPickerConnector.java | 12 +- .../colorpicker/ColorPickerGradientConnector.java | 12 +- .../ui/colorpicker/ColorPickerGridConnector.java | 12 +- .../ui/colorpicker/VColorPickerGradient.java | 20 +- .../client/ui/colorpicker/VColorPickerGrid.java | 20 +- .../client/ui/combobox/ComboBoxConnector.java | 31 +- .../client/ui/csslayout/CssLayoutConnector.java | 33 +- .../customcomponent/CustomComponentConnector.java | 9 +- .../ui/customfield/CustomFieldConnector.java | 25 +- .../ui/customlayout/CustomLayoutConnector.java | 35 +- .../ui/datefield/AbstractDateFieldConnector.java | 25 +- .../client/ui/datefield/DateFieldConnector.java | 61 +- .../ui/datefield/InlineDateFieldConnector.java | 29 +- .../client/ui/datefield/TextualDateConnector.java | 6 +- .../vaadin/client/ui/dd/DDEventHandleStrategy.java | 57 +- .../main/java/com/vaadin/client/ui/dd/DDUtil.java | 6 +- .../vaadin/client/ui/dd/DragAndDropHandler.java | 31 +- .../java/com/vaadin/client/ui/dd/DragHandle.java | 16 +- .../com/vaadin/client/ui/dd/DragImageModifier.java | 10 +- .../vaadin/client/ui/dd/VAbstractDropHandler.java | 14 +- .../java/com/vaadin/client/ui/dd/VAcceptAll.java | 8 +- .../com/vaadin/client/ui/dd/VAcceptCallback.java | 6 +- .../com/vaadin/client/ui/dd/VAcceptCriteria.java | 6 +- .../com/vaadin/client/ui/dd/VAcceptCriterion.java | 8 +- .../client/ui/dd/VAcceptCriterionFactory.java | 6 +- .../main/java/com/vaadin/client/ui/dd/VAnd.java | 8 +- .../vaadin/client/ui/dd/VContainsDataFlavor.java | 8 +- .../vaadin/client/ui/dd/VDragAndDropManager.java | 118 ++- .../java/com/vaadin/client/ui/dd/VDragEvent.java | 47 +- .../client/ui/dd/VDragEventServerCallback.java | 6 +- .../com/vaadin/client/ui/dd/VDragSourceIs.java | 8 +- .../java/com/vaadin/client/ui/dd/VDropHandler.java | 20 +- .../com/vaadin/client/ui/dd/VHasDropHandler.java | 10 +- .../com/vaadin/client/ui/dd/VHtml5DragEvent.java | 10 +- .../java/com/vaadin/client/ui/dd/VHtml5File.java | 6 +- .../java/com/vaadin/client/ui/dd/VIsOverId.java | 8 +- .../java/com/vaadin/client/ui/dd/VItemIdIs.java | 8 +- .../client/ui/dd/VLazyInitItemIdentifiers.java | 18 +- .../main/java/com/vaadin/client/ui/dd/VNot.java | 10 +- .../src/main/java/com/vaadin/client/ui/dd/VOr.java | 10 +- .../com/vaadin/client/ui/dd/VOverTreeNode.java | 12 +- .../com/vaadin/client/ui/dd/VServerAccept.java | 8 +- .../com/vaadin/client/ui/dd/VSourceIsTarget.java | 8 +- .../com/vaadin/client/ui/dd/VTargetDetailIs.java | 12 +- .../com/vaadin/client/ui/dd/VTargetInSubtree.java | 12 +- .../com/vaadin/client/ui/dd/VTransferable.java | 14 +- .../DragAndDropWrapperConnector.java | 33 +- .../client/ui/embedded/EmbeddedConnector.java | 28 +- .../com/vaadin/client/ui/flash/FlashConnector.java | 6 +- .../com/vaadin/client/ui/form/FormConnector.java | 10 +- .../client/ui/formlayout/FormLayoutConnector.java | 28 +- .../client/ui/gridlayout/GridLayoutConnector.java | 6 +- .../com/vaadin/client/ui/image/ImageConnector.java | 6 +- .../com/vaadin/client/ui/label/LabelConnector.java | 6 +- .../ui/layout/ComponentConnectorLayoutSlot.java | 14 +- .../client/ui/layout/ElementResizeEvent.java | 6 +- .../client/ui/layout/ElementResizeListener.java | 6 +- .../client/ui/layout/LayoutDependencyTree.java | 121 ++- .../java/com/vaadin/client/ui/layout/Margins.java | 6 +- .../vaadin/client/ui/layout/MayScrollChildren.java | 6 +- .../com/vaadin/client/ui/layout/VLayoutSlot.java | 16 +- .../com/vaadin/client/ui/link/LinkConnector.java | 10 +- .../client/ui/listselect/ListSelectConnector.java | 6 +- .../client/ui/loginform/LoginFormConnector.java | 40 +- .../com/vaadin/client/ui/loginform/VLoginForm.java | 6 +- .../java/com/vaadin/client/ui/menubar/MenuBar.java | 67 +- .../vaadin/client/ui/menubar/MenuBarConnector.java | 30 +- .../com/vaadin/client/ui/menubar/MenuItem.java | 32 +- .../ui/nativebutton/NativeButtonConnector.java | 10 +- .../ui/nativeselect/NativeSelectConnector.java | 6 +- .../ui/optiongroup/OptionGroupBaseConnector.java | 22 +- .../ui/optiongroup/OptionGroupConnector.java | 14 +- .../AbstractOrderedLayoutConnector.java | 94 +- .../client/ui/orderedlayout/CaptionPosition.java | 6 +- .../orderedlayout/HorizontalLayoutConnector.java | 13 +- .../com/vaadin/client/ui/orderedlayout/Slot.java | 87 +- .../ui/orderedlayout/VAbstractOrderedLayout.java | 127 +-- .../ui/orderedlayout/VerticalLayoutConnector.java | 13 +- .../com/vaadin/client/ui/panel/PanelConnector.java | 21 +- .../ui/passwordfield/PasswordFieldConnector.java | 6 +- .../client/ui/popupview/PopupViewConnector.java | 14 +- .../client/ui/popupview/VisibilityChangeEvent.java | 6 +- .../ui/popupview/VisibilityChangeHandler.java | 6 +- .../ui/progressindicator/ProgressBarConnector.java | 8 +- .../ProgressIndicatorConnector.java | 8 +- .../ui/richtextarea/RichTextAreaConnector.java | 18 +- .../client/ui/richtextarea/VRichTextToolbar.java | 32 +- .../vaadin/client/ui/slider/SliderConnector.java | 18 +- .../ui/splitpanel/AbstractSplitPanelConnector.java | 33 +- .../splitpanel/HorizontalSplitPanelConnector.java | 6 +- .../ui/splitpanel/VerticalSplitPanelConnector.java | 6 +- .../com/vaadin/client/ui/table/TableConnector.java | 66 +- .../client/ui/tabsheet/TabsheetBaseConnector.java | 18 +- .../client/ui/tabsheet/TabsheetConnector.java | 12 +- .../client/ui/textarea/TextAreaConnector.java | 7 +- .../client/ui/textfield/TextFieldConnector.java | 21 +- .../com/vaadin/client/ui/tree/TreeConnector.java | 49 +- .../client/ui/treetable/TreeTableConnector.java | 28 +- .../ui/twincolselect/TwinColSelectConnector.java | 10 +- .../java/com/vaadin/client/ui/ui/UIConnector.java | 145 ++- .../vaadin/client/ui/upload/UploadConnector.java | 22 +- .../ui/upload/UploadIFrameOnloadStrategy.java | 6 +- .../ui/upload/UploadIFrameOnloadStrategyIE.java | 8 +- .../com/vaadin/client/ui/video/VideoConnector.java | 6 +- .../vaadin/client/ui/window/WindowConnector.java | 62 +- .../vaadin/client/ui/window/WindowMoveEvent.java | 16 +- .../vaadin/client/ui/window/WindowMoveHandler.java | 10 +- .../com/vaadin/client/widget/escalator/Cell.java | 18 +- .../widget/escalator/ColumnConfiguration.java | 32 +- .../client/widget/escalator/EscalatorUpdater.java | 26 +- .../client/widget/escalator/FlyweightCell.java | 22 +- .../client/widget/escalator/FlyweightRow.java | 51 +- .../client/widget/escalator/PositionFunction.java | 12 +- .../com/vaadin/client/widget/escalator/Row.java | 12 +- .../client/widget/escalator/RowContainer.java | 42 +- .../widget/escalator/RowVisibilityChangeEvent.java | 24 +- .../escalator/RowVisibilityChangeHandler.java | 10 +- .../client/widget/escalator/ScrollbarBundle.java | 104 +- .../com/vaadin/client/widget/escalator/Spacer.java | 12 +- .../client/widget/escalator/SpacerUpdater.java | 12 +- .../escalator/events/RowHeightChangedHandler.java | 3 +- .../vaadin/client/widget/grid/AutoScroller.java | 36 +- .../vaadin/client/widget/grid/CellReference.java | 28 +- .../client/widget/grid/CellStyleGenerator.java | 10 +- .../client/widget/grid/DataAvailableEvent.java | 10 +- .../client/widget/grid/DataAvailableHandler.java | 10 +- .../widget/grid/DefaultEditorEventHandler.java | 44 +- .../client/widget/grid/DetailsGenerator.java | 10 +- .../vaadin/client/widget/grid/EditorHandler.java | 40 +- .../client/widget/grid/EventCellReference.java | 18 +- .../widget/grid/HeightAwareDetailsGenerator.java | 12 +- .../client/widget/grid/RendererCellReference.java | 18 +- .../vaadin/client/widget/grid/RowReference.java | 20 +- .../client/widget/grid/RowStyleGenerator.java | 10 +- .../widget/grid/datasources/ListDataSource.java | 26 +- .../client/widget/grid/datasources/ListSorter.java | 23 +- .../grid/events/AbstractGridKeyEventHandler.java | 20 +- .../grid/events/AbstractGridMouseEventHandler.java | 16 +- .../widget/grid/events/BodyClickHandler.java | 8 +- .../widget/grid/events/BodyDoubleClickHandler.java | 8 +- .../widget/grid/events/BodyKeyDownHandler.java | 8 +- .../widget/grid/events/BodyKeyPressHandler.java | 8 +- .../widget/grid/events/BodyKeyUpHandler.java | 8 +- .../widget/grid/events/ColumnReorderEvent.java | 8 +- .../widget/grid/events/ColumnReorderHandler.java | 10 +- .../widget/grid/events/ColumnResizeEvent.java | 8 +- .../widget/grid/events/ColumnResizeHandler.java | 10 +- .../grid/events/ColumnVisibilityChangeEvent.java | 18 +- .../grid/events/ColumnVisibilityChangeHandler.java | 16 +- .../widget/grid/events/FooterClickHandler.java | 8 +- .../grid/events/FooterDoubleClickHandler.java | 8 +- .../widget/grid/events/FooterKeyDownHandler.java | 8 +- .../widget/grid/events/FooterKeyPressHandler.java | 8 +- .../widget/grid/events/FooterKeyUpHandler.java | 8 +- .../client/widget/grid/events/GridClickEvent.java | 14 +- .../widget/grid/events/GridDoubleClickEvent.java | 21 +- .../widget/grid/events/GridKeyDownEvent.java | 26 +- .../widget/grid/events/GridKeyPressEvent.java | 22 +- .../client/widget/grid/events/GridKeyUpEvent.java | 26 +- .../widget/grid/events/HeaderClickHandler.java | 8 +- .../grid/events/HeaderDoubleClickHandler.java | 8 +- .../widget/grid/events/HeaderKeyDownHandler.java | 8 +- .../widget/grid/events/HeaderKeyPressHandler.java | 8 +- .../widget/grid/events/HeaderKeyUpHandler.java | 8 +- .../client/widget/grid/events/ScrollEvent.java | 8 +- .../client/widget/grid/events/ScrollHandler.java | 10 +- .../client/widget/grid/events/SelectAllEvent.java | 8 +- .../widget/grid/events/SelectAllHandler.java | 10 +- .../selection/AbstractRowHandleSelectionModel.java | 16 +- .../widget/grid/selection/ClickSelectHandler.java | 12 +- .../grid/selection/HasSelectionHandlers.java | 4 +- .../grid/selection/MultiSelectionRenderer.java | 53 +- .../widget/grid/selection/SelectionEvent.java | 18 +- .../widget/grid/selection/SelectionHandler.java | 4 +- .../widget/grid/selection/SelectionModel.java | 44 +- .../widget/grid/selection/SelectionModelMulti.java | 2 +- .../widget/grid/selection/SelectionModelNone.java | 10 +- .../grid/selection/SelectionModelSingle.java | 2 +- .../widget/grid/selection/SpaceSelectHandler.java | 16 +- .../com/vaadin/client/widget/grid/sort/Sort.java | 16 +- .../vaadin/client/widget/grid/sort/SortEvent.java | 17 +- .../client/widget/grid/sort/SortHandler.java | 4 +- .../vaadin/client/widget/grid/sort/SortOrder.java | 12 +- .../java/com/vaadin/client/widgets/Escalator.java | 893 ++++++++-------- .../main/java/com/vaadin/client/widgets/Grid.java | 1118 ++++++++++---------- .../java/com/vaadin/client/widgets/Overlay.java | 161 +-- .../ApplicationConnectionURLGenerationTest.java | 21 +- .../com/vaadin/client/DateTimeServiceTest.java | 11 +- .../java/com/vaadin/client/LocatorUtilTest.java | 6 +- .../client/VBrowserDetailsUserAgentParserTest.java | 7 +- .../communication/ServerMessageHandlerTest.java | 8 +- .../vaadin/client/ui/grid/ListDataSourceTest.java | 4 +- .../vaadin/client/ui/grid/PartitioningTest.java | 6 +- .../java/com/vaadin/annotations/AutoGenerated.java | 10 +- .../java/com/vaadin/annotations/DesignRoot.java | 8 +- .../java/com/vaadin/annotations/JavaScript.java | 10 +- .../com/vaadin/annotations/PreserveOnRefresh.java | 8 +- .../src/main/java/com/vaadin/annotations/Push.java | 14 +- .../java/com/vaadin/annotations/StyleSheet.java | 10 +- .../main/java/com/vaadin/annotations/Theme.java | 6 +- .../main/java/com/vaadin/annotations/Title.java | 8 +- .../annotations/VaadinServletConfiguration.java | 36 +- .../main/java/com/vaadin/annotations/Viewport.java | 12 +- .../vaadin/annotations/ViewportGeneratorClass.java | 14 +- .../java/com/vaadin/annotations/Widgetset.java | 6 +- server/src/main/java/com/vaadin/data/Buffered.java | 38 +- .../java/com/vaadin/data/BufferedValidatable.java | 12 +- .../src/main/java/com/vaadin/data/Collapsible.java | 16 +- .../src/main/java/com/vaadin/data/Container.java | 206 ++-- .../java/com/vaadin/data/ContainerHelpers.java | 13 +- server/src/main/java/com/vaadin/data/Item.java | 32 +- server/src/main/java/com/vaadin/data/Property.java | 81 +- .../src/main/java/com/vaadin/data/Validatable.java | 24 +- .../src/main/java/com/vaadin/data/Validator.java | 28 +- .../com/vaadin/data/fieldgroup/BeanFieldGroup.java | 25 +- .../java/com/vaadin/data/fieldgroup/Caption.java | 6 +- .../fieldgroup/DefaultFieldGroupFieldFactory.java | 33 +- .../com/vaadin/data/fieldgroup/FieldGroup.java | 186 ++-- .../data/fieldgroup/FieldGroupFieldFactory.java | 10 +- .../com/vaadin/data/fieldgroup/PropertyId.java | 12 +- .../src/main/java/com/vaadin/data/sort/Sort.java | 16 +- .../main/java/com/vaadin/data/sort/SortOrder.java | 8 +- .../vaadin/data/util/AbstractBeanContainer.java | 166 +-- .../com/vaadin/data/util/AbstractContainer.java | 48 +- .../data/util/AbstractInMemoryContainer.java | 162 +-- .../com/vaadin/data/util/AbstractProperty.java | 33 +- .../java/com/vaadin/data/util/BeanContainer.java | 40 +- .../main/java/com/vaadin/data/util/BeanItem.java | 50 +- .../com/vaadin/data/util/BeanItemContainer.java | 64 +- .../main/java/com/vaadin/data/util/BeanUtil.java | 34 +- .../data/util/ContainerHierarchicalWrapper.java | 62 +- .../vaadin/data/util/ContainerOrderedWrapper.java | 51 +- .../com/vaadin/data/util/DefaultItemSorter.java | 33 +- .../com/vaadin/data/util/FilesystemContainer.java | 86 +- .../data/util/GeneratedPropertyContainer.java | 71 +- .../vaadin/data/util/HierarchicalContainer.java | 65 +- .../util/HierarchicalContainerOrderedWrapper.java | 12 +- .../com/vaadin/data/util/IndexedContainer.java | 220 ++-- .../main/java/com/vaadin/data/util/ItemSorter.java | 13 +- .../com/vaadin/data/util/LegacyPropertyHelper.java | 12 +- .../main/java/com/vaadin/data/util/ListSet.java | 12 +- .../java/com/vaadin/data/util/MethodProperty.java | 116 +- .../vaadin/data/util/MethodPropertyDescriptor.java | 23 +- .../com/vaadin/data/util/NestedMethodProperty.java | 45 +- .../vaadin/data/util/NestedPropertyDescriptor.java | 18 +- .../java/com/vaadin/data/util/ObjectProperty.java | 30 +- .../com/vaadin/data/util/PropertyFormatter.java | 40 +- .../vaadin/data/util/PropertyValueGenerator.java | 25 +- .../java/com/vaadin/data/util/PropertysetItem.java | 64 +- .../com/vaadin/data/util/TextFileProperty.java | 33 +- .../data/util/TransactionalPropertyWrapper.java | 18 +- .../vaadin/data/util/VaadinPropertyDescriptor.java | 18 +- .../converter/AbstractStringToNumberConverter.java | 20 +- .../com/vaadin/data/util/converter/Converter.java | 28 +- .../data/util/converter/ConverterFactory.java | 10 +- .../vaadin/data/util/converter/ConverterUtil.java | 28 +- .../data/util/converter/DateToLongConverter.java | 22 +- .../util/converter/DateToSqlDateConverter.java | 22 +- .../util/converter/DefaultConverterFactory.java | 17 +- .../data/util/converter/ReverseConverter.java | 24 +- .../converter/StringToBigDecimalConverter.java | 12 +- .../converter/StringToBigIntegerConverter.java | 12 +- .../util/converter/StringToBooleanConverter.java | 49 +- .../data/util/converter/StringToByteConverter.java | 18 +- .../converter/StringToCollectionConverter.java | 31 +- .../data/util/converter/StringToDateConverter.java | 24 +- .../util/converter/StringToDoubleConverter.java | 16 +- .../data/util/converter/StringToEnumConverter.java | 20 +- .../util/converter/StringToFloatConverter.java | 21 +- .../util/converter/StringToIntegerConverter.java | 18 +- .../data/util/converter/StringToLongConverter.java | 18 +- .../util/converter/StringToShortConverter.java | 23 +- .../data/util/filter/AbstractJunctionFilter.java | 18 +- .../main/java/com/vaadin/data/util/filter/And.java | 16 +- .../java/com/vaadin/data/util/filter/Between.java | 6 +- .../java/com/vaadin/data/util/filter/Compare.java | 77 +- .../java/com/vaadin/data/util/filter/IsNull.java | 21 +- .../java/com/vaadin/data/util/filter/Like.java | 15 +- .../main/java/com/vaadin/data/util/filter/Not.java | 16 +- .../main/java/com/vaadin/data/util/filter/Or.java | 18 +- .../data/util/filter/SimpleStringFilter.java | 32 +- .../util/filter/UnsupportedFilterException.java | 14 +- .../data/util/sqlcontainer/CacheFlushNotifier.java | 17 +- .../vaadin/data/util/sqlcontainer/CacheMap.java | 6 +- .../data/util/sqlcontainer/ColumnProperty.java | 36 +- .../util/sqlcontainer/OptimisticLockException.java | 12 +- .../data/util/sqlcontainer/ReadOnlyRowId.java | 6 +- .../vaadin/data/util/sqlcontainer/Reference.java | 6 +- .../com/vaadin/data/util/sqlcontainer/RowId.java | 11 +- .../com/vaadin/data/util/sqlcontainer/RowItem.java | 8 +- .../data/util/sqlcontainer/SQLContainer.java | 195 ++-- .../com/vaadin/data/util/sqlcontainer/SQLUtil.java | 21 +- .../data/util/sqlcontainer/TemporaryRowId.java | 6 +- .../connection/J2EEConnectionPool.java | 10 +- .../connection/JDBCConnectionPool.java | 14 +- .../connection/SimpleJDBCConnectionPool.java | 9 +- .../query/AbstractTransactionalQuery.java | 30 +- .../util/sqlcontainer/query/FreeformQuery.java | 62 +- .../sqlcontainer/query/FreeformQueryDelegate.java | 20 +- .../query/FreeformStatementDelegate.java | 12 +- .../data/util/sqlcontainer/query/OrderBy.java | 8 +- .../util/sqlcontainer/query/QueryDelegate.java | 52 +- .../data/util/sqlcontainer/query/TableQuery.java | 119 +-- .../query/generator/DefaultSQLGenerator.java | 70 +- .../query/generator/MSSQLGenerator.java | 16 +- .../query/generator/OracleGenerator.java | 25 +- .../sqlcontainer/query/generator/SQLGenerator.java | 16 +- .../query/generator/StatementHelper.java | 44 +- .../query/generator/filter/AndTranslator.java | 10 +- .../query/generator/filter/BetweenTranslator.java | 6 +- .../query/generator/filter/CompareTranslator.java | 6 +- .../query/generator/filter/FilterTranslator.java | 6 +- .../query/generator/filter/IsNullTranslator.java | 6 +- .../query/generator/filter/LikeTranslator.java | 6 +- .../query/generator/filter/NotTranslator.java | 6 +- .../query/generator/filter/OrTranslator.java | 10 +- .../query/generator/filter/QueryBuilder.java | 10 +- .../generator/filter/SimpleStringTranslator.java | 6 +- .../query/generator/filter/StringDecorator.java | 16 +- .../data/validator/AbstractStringValidator.java | 17 +- .../vaadin/data/validator/AbstractValidator.java | 22 +- .../com/vaadin/data/validator/BeanValidator.java | 39 +- .../data/validator/BigDecimalRangeValidator.java | 14 +- .../data/validator/BigIntegerRangeValidator.java | 14 +- .../vaadin/data/validator/ByteRangeValidator.java | 17 +- .../vaadin/data/validator/CompositeValidator.java | 32 +- .../vaadin/data/validator/DateRangeValidator.java | 16 +- .../data/validator/DoubleRangeValidator.java | 14 +- .../com/vaadin/data/validator/DoubleValidator.java | 10 +- .../com/vaadin/data/validator/EmailValidator.java | 17 +- .../vaadin/data/validator/FloatRangeValidator.java | 14 +- .../data/validator/IntegerRangeValidator.java | 14 +- .../vaadin/data/validator/IntegerValidator.java | 10 +- .../vaadin/data/validator/LongRangeValidator.java | 17 +- .../com/vaadin/data/validator/NullValidator.java | 18 +- .../com/vaadin/data/validator/RangeValidator.java | 32 +- .../com/vaadin/data/validator/RegexpValidator.java | 21 +- .../vaadin/data/validator/ShortRangeValidator.java | 14 +- .../data/validator/StringLengthValidator.java | 24 +- server/src/main/java/com/vaadin/event/Action.java | 36 +- .../main/java/com/vaadin/event/ActionManager.java | 20 +- .../com/vaadin/event/ConnectorActionManager.java | 19 +- .../main/java/com/vaadin/event/ConnectorEvent.java | 6 +- .../com/vaadin/event/ConnectorEventListener.java | 6 +- .../java/com/vaadin/event/ContextClickEvent.java | 20 +- .../com/vaadin/event/DataBoundTransferable.java | 22 +- .../main/java/com/vaadin/event/EventRouter.java | 22 +- .../main/java/com/vaadin/event/FieldEvents.java | 48 +- .../main/java/com/vaadin/event/ItemClickEvent.java | 24 +- .../main/java/com/vaadin/event/LayoutEvents.java | 30 +- .../main/java/com/vaadin/event/ListenerMethod.java | 151 +-- .../java/com/vaadin/event/MethodEventSource.java | 40 +- .../main/java/com/vaadin/event/MouseEvents.java | 51 +- .../main/java/com/vaadin/event/SelectionEvent.java | 24 +- .../main/java/com/vaadin/event/ShortcutAction.java | 56 +- .../java/com/vaadin/event/ShortcutListener.java | 10 +- .../src/main/java/com/vaadin/event/SortEvent.java | 22 +- .../main/java/com/vaadin/event/Transferable.java | 12 +- .../java/com/vaadin/event/TransferableImpl.java | 8 +- .../src/main/java/com/vaadin/event/UIEvents.java | 26 +- .../java/com/vaadin/event/dd/DragAndDropEvent.java | 10 +- .../main/java/com/vaadin/event/dd/DragSource.java | 14 +- .../main/java/com/vaadin/event/dd/DropHandler.java | 14 +- .../main/java/com/vaadin/event/dd/DropTarget.java | 12 +- .../java/com/vaadin/event/dd/TargetDetails.java | 12 +- .../com/vaadin/event/dd/TargetDetailsImpl.java | 10 +- .../vaadin/event/dd/acceptcriteria/AcceptAll.java | 14 +- .../event/dd/acceptcriteria/AcceptCriterion.java | 24 +- .../com/vaadin/event/dd/acceptcriteria/And.java | 16 +- .../dd/acceptcriteria/ClientSideCriterion.java | 18 +- .../dd/acceptcriteria/ContainsDataFlavor.java | 12 +- .../com/vaadin/event/dd/acceptcriteria/Not.java | 12 +- .../com/vaadin/event/dd/acceptcriteria/Or.java | 14 +- .../dd/acceptcriteria/ServerSideCriterion.java | 14 +- .../vaadin/event/dd/acceptcriteria/SourceIs.java | 19 +- .../event/dd/acceptcriteria/SourceIsTarget.java | 14 +- .../event/dd/acceptcriteria/TargetDetailIs.java | 16 +- .../vaadin/navigator/NavigationStateManager.java | 12 +- .../main/java/com/vaadin/navigator/Navigator.java | 131 +-- .../src/main/java/com/vaadin/navigator/View.java | 16 +- .../com/vaadin/navigator/ViewChangeListener.java | 26 +- .../java/com/vaadin/navigator/ViewDisplay.java | 14 +- .../java/com/vaadin/navigator/ViewProvider.java | 16 +- .../com/vaadin/server/AbstractClientConnector.java | 165 +-- .../server/AbstractDeploymentConfiguration.java | 14 +- .../com/vaadin/server/AbstractErrorMessage.java | 12 +- .../java/com/vaadin/server/AbstractExtension.java | 18 +- .../vaadin/server/AbstractJavaScriptExtension.java | 32 +- .../vaadin/server/BootstrapFragmentResponse.java | 14 +- .../java/com/vaadin/server/BootstrapHandler.java | 77 +- .../java/com/vaadin/server/BootstrapListener.java | 12 +- .../com/vaadin/server/BootstrapPageResponse.java | 22 +- .../java/com/vaadin/server/BootstrapResponse.java | 20 +- .../com/vaadin/server/BrowserWindowOpener.java | 69 +- .../main/java/com/vaadin/server/ClassResource.java | 42 +- .../java/com/vaadin/server/ClientConnector.java | 76 +- .../com/vaadin/server/ClientMethodInvocation.java | 16 +- .../com/vaadin/server/ComponentSizeValidator.java | 48 +- .../com/vaadin/server/CompositeErrorMessage.java | 18 +- .../java/com/vaadin/server/ConnectorResource.java | 14 +- .../vaadin/server/ConnectorResourceHandler.java | 27 +- .../src/main/java/com/vaadin/server/Constants.java | 29 +- .../vaadin/server/CustomizedSystemMessages.java | 56 +- .../server/DefaultDeploymentConfiguration.java | 57 +- .../com/vaadin/server/DefaultErrorHandler.java | 21 +- .../server/DefaultSystemMessagesProvider.java | 10 +- .../java/com/vaadin/server/DefaultUIProvider.java | 11 +- .../com/vaadin/server/DeploymentConfiguration.java | 54 +- .../java/com/vaadin/server/DownloadStream.java | 53 +- .../java/com/vaadin/server/DragAndDropService.java | 39 +- .../main/java/com/vaadin/server/EncodeResult.java | 6 +- .../main/java/com/vaadin/server/ErrorEvent.java | 16 +- .../main/java/com/vaadin/server/ErrorHandler.java | 8 +- .../com/vaadin/server/ErrorHandlingRunnable.java | 10 +- .../main/java/com/vaadin/server/ErrorMessage.java | 20 +- .../src/main/java/com/vaadin/server/Extension.java | 12 +- .../java/com/vaadin/server/ExternalResource.java | 20 +- .../java/com/vaadin/server/FileDownloader.java | 25 +- .../main/java/com/vaadin/server/FileResource.java | 33 +- .../main/java/com/vaadin/server/FontAwesome.java | 18 +- .../src/main/java/com/vaadin/server/FontIcon.java | 16 +- .../java/com/vaadin/server/GAEVaadinServlet.java | 129 +-- .../java/com/vaadin/server/GenericFontIcon.java | 24 +- .../com/vaadin/server/GlobalResourceHandler.java | 39 +- .../vaadin/server/JavaScriptCallbackHelper.java | 19 +- .../src/main/java/com/vaadin/server/JsonCodec.java | 51 +- .../java/com/vaadin/server/JsonPaintTarget.java | 98 +- .../src/main/java/com/vaadin/server/KeyMapper.java | 18 +- .../java/com/vaadin/server/LegacyApplication.java | 38 +- .../vaadin/server/LegacyApplicationUIProvider.java | 16 +- .../vaadin/server/LegacyCommunicationManager.java | 61 +- .../main/java/com/vaadin/server/LegacyPaint.java | 16 +- .../com/vaadin/server/LegacyVaadinPortlet.java | 6 +- .../com/vaadin/server/LegacyVaadinServlet.java | 6 +- .../main/java/com/vaadin/server/LocaleService.java | 31 +- .../com/vaadin/server/NoInputStreamException.java | 6 +- .../com/vaadin/server/NoOutputStreamException.java | 6 +- server/src/main/java/com/vaadin/server/Page.java | 156 ++- .../java/com/vaadin/server/PaintException.java | 14 +- .../main/java/com/vaadin/server/PaintTarget.java | 108 +- .../java/com/vaadin/server/RequestHandler.java | 8 +- .../src/main/java/com/vaadin/server/Resource.java | 10 +- .../java/com/vaadin/server/ResourceReference.java | 10 +- .../main/java/com/vaadin/server/Responsive.java | 34 +- .../vaadin/server/RestrictedRenderResponse.java | 11 +- .../main/java/com/vaadin/server/Scrollable.java | 26 +- .../java/com/vaadin/server/ServerRpcManager.java | 47 +- .../vaadin/server/ServerRpcMethodInvocation.java | 10 +- .../com/vaadin/server/ServiceDestroyEvent.java | 12 +- .../com/vaadin/server/ServiceDestroyListener.java | 12 +- .../java/com/vaadin/server/ServiceException.java | 6 +- .../com/vaadin/server/ServletPortletHelper.java | 56 +- .../com/vaadin/server/SessionDestroyEvent.java | 16 +- .../com/vaadin/server/SessionDestroyListener.java | 12 +- .../com/vaadin/server/SessionExpiredException.java | 6 +- .../com/vaadin/server/SessionExpiredHandler.java | 10 +- .../java/com/vaadin/server/SessionInitEvent.java | 18 +- .../com/vaadin/server/SessionInitListener.java | 12 +- .../main/java/com/vaadin/server/SizeWithUnit.java | 18 +- .../src/main/java/com/vaadin/server/Sizeable.java | 48 +- .../java/com/vaadin/server/StreamResource.java | 36 +- .../java/com/vaadin/server/StreamVariable.java | 14 +- .../vaadin/server/SynchronizedRequestHandler.java | 14 +- .../main/java/com/vaadin/server/SystemError.java | 18 +- .../com/vaadin/server/SystemMessageException.java | 12 +- .../java/com/vaadin/server/SystemMessages.java | 55 +- .../java/com/vaadin/server/SystemMessagesInfo.java | 12 +- .../com/vaadin/server/SystemMessagesProvider.java | 10 +- .../main/java/com/vaadin/server/ThemeResource.java | 14 +- .../com/vaadin/server/UIClassSelectionEvent.java | 10 +- .../main/java/com/vaadin/server/UICreateEvent.java | 16 +- .../main/java/com/vaadin/server/UIProvider.java | 17 +- .../java/com/vaadin/server/UIProviderEvent.java | 16 +- .../vaadin/server/UnsupportedBrowserHandler.java | 57 +- .../java/com/vaadin/server/UploadException.java | 6 +- .../src/main/java/com/vaadin/server/UserError.java | 12 +- .../main/java/com/vaadin/server/VaadinPortlet.java | 95 +- .../com/vaadin/server/VaadinPortletRequest.java | 28 +- .../com/vaadin/server/VaadinPortletResponse.java | 17 +- .../com/vaadin/server/VaadinPortletService.java | 51 +- .../com/vaadin/server/VaadinPortletSession.java | 62 +- .../main/java/com/vaadin/server/VaadinRequest.java | 140 +-- .../java/com/vaadin/server/VaadinResponse.java | 46 +- .../main/java/com/vaadin/server/VaadinService.java | 106 +- .../server/VaadinServiceClassLoaderUtil.java | 18 +- .../main/java/com/vaadin/server/VaadinServlet.java | 241 +++-- .../com/vaadin/server/VaadinServletRequest.java | 18 +- .../com/vaadin/server/VaadinServletResponse.java | 26 +- .../com/vaadin/server/VaadinServletService.java | 40 +- .../main/java/com/vaadin/server/VaadinSession.java | 50 +- .../main/java/com/vaadin/server/VariableOwner.java | 16 +- .../java/com/vaadin/server/ViewportGenerator.java | 14 +- .../main/java/com/vaadin/server/WebBrowser.java | 79 +- .../java/com/vaadin/server/WidgetsetInfoImpl.java | 4 +- .../java/com/vaadin/server/WrappedHttpSession.java | 12 +- .../com/vaadin/server/WrappedPortletSession.java | 34 +- .../java/com/vaadin/server/WrappedSession.java | 48 +- .../communication/AbstractStreamingEvent.java | 6 +- .../communication/AtmospherePushConnection.java | 50 +- .../server/communication/ClientRpcWriter.java | 39 +- .../communication/ConnectorHierarchyWriter.java | 18 +- .../server/communication/ConnectorTypeWriter.java | 13 +- .../server/communication/DateSerializer.java | 8 +- .../server/communication/FileUploadHandler.java | 58 +- .../server/communication/HeartbeatHandler.java | 17 +- .../server/communication/JSONSerializer.java | 10 +- .../communication/JSR356WebsocketInitializer.java | 36 +- .../server/communication/LegacyUidlWriter.java | 6 +- .../server/communication/MetadataWriter.java | 16 +- .../communication/PortletBootstrapHandler.java | 9 +- .../communication/PortletDummyRequestHandler.java | 12 +- .../communication/PortletListenerNotifier.java | 8 +- .../PortletStateAwareRequestHandler.java | 10 +- .../server/communication/PortletUIInitHandler.java | 12 +- .../server/communication/PublishedFileHandler.java | 26 +- .../communication/PushAtmosphereHandler.java | 19 +- .../server/communication/PushConnection.java | 8 +- .../vaadin/server/communication/PushHandler.java | 107 +- .../server/communication/PushRequestHandler.java | 40 +- .../server/communication/ResourceWriter.java | 18 +- .../server/communication/ServerRpcHandler.java | 66 +- .../communication/ServletBootstrapHandler.java | 10 +- .../server/communication/ServletUIInitHandler.java | 11 +- .../communication/SessionRequestHandler.java | 10 +- .../server/communication/SharedStateWriter.java | 13 +- .../communication/StreamingEndEventImpl.java | 13 +- .../communication/StreamingErrorEventImpl.java | 10 +- .../communication/StreamingProgressEventImpl.java | 10 +- .../communication/StreamingStartEventImpl.java | 10 +- .../vaadin/server/communication/UIInitHandler.java | 43 +- .../server/communication/UidlRequestHandler.java | 26 +- .../vaadin/server/communication/UidlWriter.java | 55 +- .../server/communication/data/DataGenerator.java | 12 +- .../data/RpcDataProviderExtension.java | 55 +- .../themeutils/SASSAddonImportFileCreator.java | 25 +- .../server/widgetsetutils/ClassPathExplorer.java | 88 +- .../server/widgetsetutils/WidgetSetBuilder.java | 59 +- .../main/java/com/vaadin/ui/AbsoluteLayout.java | 127 +-- .../java/com/vaadin/ui/AbstractColorPicker.java | 77 +- .../main/java/com/vaadin/ui/AbstractComponent.java | 184 ++-- .../com/vaadin/ui/AbstractComponentContainer.java | 64 +- .../main/java/com/vaadin/ui/AbstractEmbedded.java | 19 +- .../src/main/java/com/vaadin/ui/AbstractField.java | 257 ++--- .../main/java/com/vaadin/ui/AbstractFocusable.java | 12 +- .../com/vaadin/ui/AbstractJavaScriptComponent.java | 26 +- .../main/java/com/vaadin/ui/AbstractLayout.java | 32 +- .../src/main/java/com/vaadin/ui/AbstractMedia.java | 40 +- .../java/com/vaadin/ui/AbstractOrderedLayout.java | 72 +- .../main/java/com/vaadin/ui/AbstractSelect.java | 306 +++--- .../ui/AbstractSingleComponentContainer.java | 61 +- .../java/com/vaadin/ui/AbstractSplitPanel.java | 108 +- .../main/java/com/vaadin/ui/AbstractTextField.java | 99 +- server/src/main/java/com/vaadin/ui/Accordion.java | 16 +- server/src/main/java/com/vaadin/ui/Alignment.java | 42 +- server/src/main/java/com/vaadin/ui/Audio.java | 16 +- .../src/main/java/com/vaadin/ui/BrowserFrame.java | 15 +- server/src/main/java/com/vaadin/ui/Button.java | 102 +- server/src/main/java/com/vaadin/ui/Calendar.java | 283 ++--- server/src/main/java/com/vaadin/ui/CheckBox.java | 34 +- .../src/main/java/com/vaadin/ui/ColorPicker.java | 16 +- .../main/java/com/vaadin/ui/ColorPickerArea.java | 16 +- server/src/main/java/com/vaadin/ui/ComboBox.java | 102 +- server/src/main/java/com/vaadin/ui/Component.java | 328 +++--- .../java/com/vaadin/ui/ComponentContainer.java | 33 +- .../main/java/com/vaadin/ui/ConnectorTracker.java | 104 +- server/src/main/java/com/vaadin/ui/CssLayout.java | 52 +- .../main/java/com/vaadin/ui/CustomComponent.java | 31 +- .../src/main/java/com/vaadin/ui/CustomField.java | 34 +- .../src/main/java/com/vaadin/ui/CustomLayout.java | 46 +- server/src/main/java/com/vaadin/ui/DateField.java | 148 +-- .../java/com/vaadin/ui/DefaultFieldFactory.java | 19 +- .../java/com/vaadin/ui/DragAndDropWrapper.java | 47 +- server/src/main/java/com/vaadin/ui/Embedded.java | 68 +- server/src/main/java/com/vaadin/ui/Field.java | 10 +- server/src/main/java/com/vaadin/ui/Flash.java | 55 +- server/src/main/java/com/vaadin/ui/Form.java | 197 ++-- .../main/java/com/vaadin/ui/FormFieldFactory.java | 12 +- server/src/main/java/com/vaadin/ui/FormLayout.java | 16 +- server/src/main/java/com/vaadin/ui/Grid.java | 1049 +++++++++--------- server/src/main/java/com/vaadin/ui/GridLayout.java | 208 ++-- .../com/vaadin/ui/HasChildMeasurementHint.java | 12 +- .../src/main/java/com/vaadin/ui/HasComponents.java | 44 +- .../main/java/com/vaadin/ui/HorizontalLayout.java | 14 +- .../java/com/vaadin/ui/HorizontalSplitPanel.java | 16 +- server/src/main/java/com/vaadin/ui/Html5File.java | 8 +- server/src/main/java/com/vaadin/ui/Image.java | 21 +- .../main/java/com/vaadin/ui/InlineDateField.java | 13 +- server/src/main/java/com/vaadin/ui/JavaScript.java | 28 +- .../java/com/vaadin/ui/JavaScriptFunction.java | 12 +- server/src/main/java/com/vaadin/ui/Label.java | 101 +- server/src/main/java/com/vaadin/ui/Layout.java | 38 +- .../main/java/com/vaadin/ui/LegacyComponent.java | 20 +- .../src/main/java/com/vaadin/ui/LegacyWindow.java | 67 +- server/src/main/java/com/vaadin/ui/Link.java | 36 +- server/src/main/java/com/vaadin/ui/ListSelect.java | 12 +- .../vaadin/ui/LoadingIndicatorConfiguration.java | 36 +- server/src/main/java/com/vaadin/ui/LoginForm.java | 50 +- server/src/main/java/com/vaadin/ui/MenuBar.java | 142 +-- .../src/main/java/com/vaadin/ui/NativeButton.java | 6 +- .../src/main/java/com/vaadin/ui/NativeSelect.java | 20 +- .../src/main/java/com/vaadin/ui/Notification.java | 80 +- .../com/vaadin/ui/NotificationConfiguration.java | 16 +- .../src/main/java/com/vaadin/ui/OptionGroup.java | 26 +- server/src/main/java/com/vaadin/ui/Panel.java | 42 +- .../src/main/java/com/vaadin/ui/PasswordField.java | 18 +- .../main/java/com/vaadin/ui/PopupDateField.java | 26 +- server/src/main/java/com/vaadin/ui/PopupView.java | 67 +- .../src/main/java/com/vaadin/ui/ProgressBar.java | 31 +- .../main/java/com/vaadin/ui/ProgressIndicator.java | 16 +- .../main/java/com/vaadin/ui/PushConfiguration.java | 68 +- .../vaadin/ui/ReconnectDialogConfiguration.java | 39 +- .../src/main/java/com/vaadin/ui/RichTextArea.java | 51 +- server/src/main/java/com/vaadin/ui/Select.java | 10 +- .../main/java/com/vaadin/ui/SelectiveRenderer.java | 12 +- .../com/vaadin/ui/SingleComponentContainer.java | 24 +- server/src/main/java/com/vaadin/ui/Slider.java | 60 +- server/src/main/java/com/vaadin/ui/TabSheet.java | 271 ++--- server/src/main/java/com/vaadin/ui/Table.java | 680 ++++++------ .../main/java/com/vaadin/ui/TableFieldFactory.java | 12 +- server/src/main/java/com/vaadin/ui/TextArea.java | 26 +- server/src/main/java/com/vaadin/ui/TextField.java | 28 +- .../java/com/vaadin/ui/TooltipConfiguration.java | 48 +- server/src/main/java/com/vaadin/ui/Tree.java | 201 ++-- server/src/main/java/com/vaadin/ui/TreeTable.java | 60 +- .../src/main/java/com/vaadin/ui/TwinColSelect.java | 24 +- server/src/main/java/com/vaadin/ui/UI.java | 258 +++-- .../java/com/vaadin/ui/UIDetachedException.java | 8 +- .../java/com/vaadin/ui/UniqueSerializable.java | 10 +- server/src/main/java/com/vaadin/ui/Upload.java | 17 +- .../main/java/com/vaadin/ui/VerticalLayout.java | 14 +- .../java/com/vaadin/ui/VerticalSplitPanel.java | 12 +- server/src/main/java/com/vaadin/ui/Video.java | 18 +- server/src/main/java/com/vaadin/ui/Window.java | 255 ++--- .../calendar/CalendarComponentEvent.java | 16 +- .../calendar/CalendarComponentEvents.java | 92 +- .../ui/components/calendar/CalendarDateRange.java | 20 +- .../components/calendar/CalendarTargetDetails.java | 10 +- .../calendar/ContainerEventProvider.java | 119 +-- .../ui/components/calendar/event/BasicEvent.java | 46 +- .../calendar/event/BasicEventProvider.java | 42 +- .../event/CalendarEditableEventProvider.java | 12 +- .../components/calendar/event/CalendarEvent.java | 33 +- .../calendar/event/CalendarEventProvider.java | 18 +- .../calendar/event/EditableCalendarEvent.java | 24 +- .../calendar/handler/BasicBackwardHandler.java | 15 +- .../calendar/handler/BasicDateClickHandler.java | 12 +- .../calendar/handler/BasicEventMoveHandler.java | 16 +- .../calendar/handler/BasicEventResizeHandler.java | 12 +- .../calendar/handler/BasicForwardHandler.java | 19 +- .../calendar/handler/BasicWeekClickHandler.java | 12 +- .../components/colorpicker/ColorChangeEvent.java | 8 +- .../colorpicker/ColorChangeListener.java | 12 +- .../colorpicker/ColorPickerGradient.java | 18 +- .../ui/components/colorpicker/ColorPickerGrid.java | 27 +- .../components/colorpicker/ColorPickerHistory.java | 26 +- .../components/colorpicker/ColorPickerPopup.java | 111 +- .../components/colorpicker/ColorPickerPreview.java | 25 +- .../components/colorpicker/ColorPickerSelect.java | 46 +- .../ui/components/colorpicker/ColorSelector.java | 12 +- .../colorpicker/HasColorChangeListener.java | 10 +- .../java/com/vaadin/ui/declarative/Design.java | 142 +-- .../ui/declarative/DesignAttributeHandler.java | 106 +- .../com/vaadin/ui/declarative/DesignContext.java | 123 +-- .../com/vaadin/ui/declarative/DesignException.java | 10 +- .../com/vaadin/ui/declarative/DesignFormatter.java | 47 +- .../com/vaadin/ui/declarative/FieldBinder.java | 49 +- .../ui/declarative/FieldBindingException.java | 8 +- .../ui/declarative/ShouldWriteDataDelegate.java | 12 +- .../converters/DesignDateConverter.java | 8 +- .../converters/DesignEnumConverter.java | 8 +- .../converters/DesignObjectConverter.java | 8 +- .../converters/DesignResourceConverter.java | 29 +- .../converters/DesignShortcutActionConverter.java | 23 +- .../converters/DesignTimeZoneConverter.java | 8 +- .../converters/DesignToStringConverter.java | 17 +- .../declarative/converters/ShortcutKeyMapper.java | 12 +- .../ui/renderers/AbstractJavaScriptRenderer.java | 22 +- .../com/vaadin/ui/renderers/ButtonRenderer.java | 10 +- .../com/vaadin/ui/renderers/ClickableRenderer.java | 24 +- .../java/com/vaadin/ui/renderers/DateRenderer.java | 32 +- .../java/com/vaadin/ui/renderers/HtmlRenderer.java | 6 +- .../com/vaadin/ui/renderers/ImageRenderer.java | 13 +- .../com/vaadin/ui/renderers/NumberRenderer.java | 20 +- .../vaadin/ui/renderers/ProgressBarRenderer.java | 6 +- .../java/com/vaadin/ui/renderers/Renderer.java | 14 +- .../java/com/vaadin/ui/renderers/TextRenderer.java | 10 +- .../main/java/com/vaadin/ui/themes/BaseTheme.java | 10 +- .../java/com/vaadin/ui/themes/ChameleonTheme.java | 20 +- .../java/com/vaadin/ui/themes/LiferayTheme.java | 14 +- .../main/java/com/vaadin/ui/themes/Reindeer.java | 52 +- .../src/main/java/com/vaadin/ui/themes/Runo.java | 50 +- .../main/java/com/vaadin/ui/themes/ValoTheme.java | 160 +-- .../main/java/com/vaadin/util/ConnectorHelper.java | 12 +- .../main/java/com/vaadin/util/CurrentInstance.java | 17 +- .../java/com/vaadin/util/FileTypeResolver.java | 24 +- .../main/java/com/vaadin/util/ReflectTools.java | 16 +- .../java/com/vaadin/util/SerializerHelper.java | 22 +- server/src/test/java/ClassInDefaultPackage.java | 10 +- .../vaadin/benchmarks/PerformanceTester8759.java | 10 +- .../data/DefaultFieldGroupFieldFactoryTest.java | 14 +- .../vaadin/data/fieldgroup/FieldGroupDateTest.java | 6 +- .../data/fieldgroup/FieldGroupExceptionTest.java | 6 +- .../com/vaadin/data/fieldgroup/FieldGroupTest.java | 9 +- .../data/util/AbstractBeanContainerTestBase.java | 6 +- .../data/util/AbstractContainerTestBase.java | 85 +- .../AbstractHierarchicalContainerTestBase.java | 36 +- .../util/AbstractInMemoryContainerTestBase.java | 4 +- .../com/vaadin/data/util/BeanContainerTest.java | 25 +- .../vaadin/data/util/BeanItemContainerTest.java | 105 +- .../java/com/vaadin/data/util/BeanItemTest.java | 42 +- .../util/ContainerHierarchicalWrapperTest.java | 16 +- .../data/util/ContainerOrderedWrapperTest.java | 11 +- .../vaadin/data/util/ContainerSizeAssertTest.java | 6 +- .../com/vaadin/data/util/ContainerSortingTest.java | 25 +- .../vaadin/data/util/FileSystemContainerTest.java | 4 +- .../util/GeneratedPropertyContainerBasicTest.java | 25 +- .../data/util/GeneratedPropertyContainerTest.java | 30 +- .../HierarchicalContainerOrderedWrapperTest.java | 4 +- .../data/util/HierarchicalContainerTest.java | 19 +- .../com/vaadin/data/util/IndexedContainerTest.java | 13 +- .../util/MethodPropertyMemoryConsumptionTest.java | 41 +- .../vaadin/data/util/NestedMethodPropertyTest.java | 4 +- .../util/PerformanceTestIndexedContainerTest.java | 4 +- .../vaadin/data/util/PropertyDescriptorTest.java | 4 +- .../com/vaadin/data/util/PropertySetItemTest.java | 13 +- .../data/util/ReflectToolsGetSuperFieldTest.java | 4 +- .../util/TransactionalPropertyWrapperTest.java | 18 +- .../data/util/filter/AbstractFilterTestBase.java | 4 +- .../vaadin/data/util/filter/AndOrFilterTest.java | 44 +- .../data/util/filter/CompareFilterDateTest.java | 71 +- .../vaadin/data/util/filter/CompareFilterTest.java | 60 +- .../vaadin/data/util/filter/IsNullFilterTest.java | 8 +- .../vaadin/data/util/filter/LikeFilterTest.java | 10 +- .../data/util/filter/SimpleStringFilterTest.java | 8 +- .../data/util/sqlcontainer/ColumnPropertyTest.java | 49 +- .../data/util/sqlcontainer/DataGenerator.java | 34 +- .../data/util/sqlcontainer/FreeformQueryUtil.java | 9 +- .../vaadin/data/util/sqlcontainer/RowIdTest.java | 4 +- .../sqlcontainer/SQLContainerTableQueryTest.java | 200 ++-- .../data/util/sqlcontainer/SQLContainerTest.java | 432 ++++---- .../data/util/sqlcontainer/SQLTestsConstants.java | 6 +- .../vaadin/data/util/sqlcontainer/TicketTest.java | 27 +- .../connection/SimpleJDBCConnectionPoolTest.java | 18 +- .../util/sqlcontainer/filters/BetweenTest.java | 16 +- .../util/sqlcontainer/filters/CompareTest.java | 6 +- .../sqlcontainer/generator/SQLGeneratorsTest.java | 25 +- .../generator/StatementHelperTest.java | 12 +- .../util/sqlcontainer/query/FreeformQueryTest.java | 129 ++- .../util/sqlcontainer/query/QueryBuilderTest.java | 19 +- .../util/sqlcontainer/query/TableQueryTest.java | 57 +- .../query/ValidatingSimpleJDBCConnectionPool.java | 21 +- .../AbstractClientConnectorProxyHandlingTest.java | 15 +- .../vaadin/server/AbstractClientConnectorTest.java | 15 +- .../AbstractDeploymentConfigurationTest.java | 15 +- .../com/vaadin/server/BrowserWindowOpenerTest.java | 14 +- .../server/ConnectorResourceHandlerTest.java | 10 +- .../server/DefaultDeploymentConfigurationTest.java | 14 +- .../java/com/vaadin/server/DownloadStreamTest.java | 8 +- .../com/vaadin/server/DragAndDropServiceTest.java | 20 +- .../java/com/vaadin/server/JSONSerializerTest.java | 31 +- .../java/com/vaadin/server/JsonEqualsTest.java | 6 +- .../java/com/vaadin/server/MockServletContext.java | 12 +- .../java/com/vaadin/server/MockVaadinSession.java | 8 +- .../src/test/java/com/vaadin/server/PageTest.java | 14 +- ...tractApplicationServletStaticFilesLocation.java | 19 +- .../java/com/vaadin/server/UIProviderTest.java | 23 +- .../com/vaadin/server/VaadinGateInRequestTest.java | 10 +- .../VaadinHttpAndPortletRequestTestBase.java | 6 +- .../vaadin/server/VaadinLiferayRequestTest.java | 10 +- .../vaadin/server/VaadinPortletServiceTest.java | 30 +- .../java/com/vaadin/server/VaadinPortletTest.java | 6 +- .../java/com/vaadin/server/VaadinServiceTest.java | 19 +- .../server/VaadinServletConfigurationTest.java | 20 +- .../java/com/vaadin/server/VaadinServletTest.java | 6 +- .../java/com/vaadin/server/VaadinSessionTest.java | 45 +- .../server/VaadinWebSpherePortalRequestTest.java | 6 +- .../AtmospherePushConnectionTest.java | 6 +- .../communication/FileUploadHandlerTest.java | 62 +- .../server/communication/MetadataWriterTest.java | 18 +- .../tests/CompileTransitionPropertyTest.java | 6 +- .../test/java/com/vaadin/tests/VaadinClasses.java | 11 +- .../DragAndDropWrapperDeclarativeTest.java | 14 +- .../components/menubar/MenuBarDeclarativeTest.java | 32 +- .../java/com/vaadin/tests/data/bean/Country.java | 4 +- .../java/com/vaadin/tests/data/bean/Person.java | 4 +- .../converter/AnyEnumToStringConverterTest.java | 17 +- .../tests/data/converter/ConverterFactoryTest.java | 6 +- .../data/converter/DateToLongConverterTest.java | 3 +- .../converter/DefaultConverterFactoryTest.java | 36 +- .../SpecificEnumToStringConverterTest.java | 20 +- .../converter/StringToBigDecimalConverterTest.java | 6 +- .../converter/StringToBigIntegerConverterTest.java | 6 +- .../converter/StringToBooleanConverterTest.java | 33 +- .../data/converter/StringToByteConverterTest.java | 3 +- .../converter/StringToCollectionConverterTest.java | 12 +- .../data/converter/StringToEnumConverterTest.java | 24 +- .../data/converter/StringToShortConverterTest.java | 6 +- .../data/validator/ByteRangeValidatorTest.java | 6 +- .../data/validator/FloatRangeValidatorTest.java | 6 +- .../data/validator/ShortRangeValidatorTest.java | 3 +- .../data/validator/StringLengthValidatorTest.java | 13 +- .../design/AbstractComponentSetResponsiveTest.java | 10 +- .../vaadin/tests/design/ComponentFactoryTest.java | 17 +- .../vaadin/tests/design/ComponentMapperTest.java | 22 +- .../vaadin/tests/design/DeclarativeTestBase.java | 37 +- .../tests/design/DeclarativeTestBaseBase.java | 20 +- .../tests/design/DesignContextLocalIdTest.java | 8 +- .../vaadin/tests/design/DesignFormatterTest.java | 55 +- .../tests/design/DesignReadInConstructor.java | 6 +- .../tests/design/DesignReadInConstructorTest.java | 10 +- .../java/com/vaadin/tests/design/DesignTest.java | 6 +- .../com/vaadin/tests/design/EmbeddedsTest.java | 12 +- .../FieldNameWhichConflictsWithGettersTest.java | 6 +- .../vaadin/tests/design/InvalidLayoutTemplate.java | 8 +- .../vaadin/tests/design/InvalidTagNamesTest.java | 10 +- .../com/vaadin/tests/design/LayoutTemplate.java | 8 +- .../java/com/vaadin/tests/design/LocaleTest.java | 17 +- .../design/ParseAllSupportedComponentsTest.java | 8 +- .../com/vaadin/tests/design/ParseLayoutTest.java | 8 +- .../vaadin/tests/design/ParseLegacyPrefixTest.java | 6 +- .../design/ParseMixedLegacyAndNewPrefixTest.java | 6 +- .../vaadin/tests/design/WriteLegacyDesignTest.java | 6 +- .../tests/design/designroot/DesignRootTest.java | 6 +- .../design/designroot/DesignWithAnnotation.java | 6 +- .../designroot/DesignWithEmptyAnnotation.java | 6 +- .../designroot/ExtendedDesignWithAnnotation.java | 6 +- .../ExtendedDesignWithEmptyAnnotation.java | 10 +- .../ExtendedDesignWithEmptyAnnotationUI.java | 6 +- .../vaadin/tests/design/nested/MyChildDesign.java | 8 +- .../nested/MyChildDesignCustomComponent.java | 6 +- .../vaadin/tests/design/nested/MyDesignRoot.java | 8 +- .../tests/design/nested/MyExtendedChildDesign.java | 6 +- .../design/nested/NestedCustomLayoutsTest.java | 8 +- .../design/nested/ReadNestedTemplatesTest.java | 8 +- .../design/nested/WriteNestedTemplatesTest.java | 14 +- .../nested/customlayouts/CustomAbsoluteLayout.java | 6 +- .../nested/customlayouts/CustomAccordion.java | 6 +- .../nested/customlayouts/CustomCssLayout.java | 6 +- .../nested/customlayouts/CustomFormLayout.java | 6 +- .../nested/customlayouts/CustomGridLayout.java | 6 +- .../customlayouts/CustomHorizontalLayout.java | 6 +- .../customlayouts/CustomHorizontalSplitPanel.java | 6 +- .../design/nested/customlayouts/CustomPanel.java | 6 +- .../nested/customlayouts/CustomTabSheet.java | 6 +- .../nested/customlayouts/CustomVerticalLayout.java | 6 +- .../customlayouts/CustomVerticalSplitPanel.java | 6 +- .../com/vaadin/tests/event/EventRouterTest.java | 18 +- .../com/vaadin/tests/event/ShortcutActionTest.java | 15 +- .../server/AbstractBeanContainerListenersTest.java | 4 +- .../server/AbstractContainerListenersTest.java | 4 +- .../AbstractInMemoryContainerListenersTest.java | 4 +- .../server/AbstractPropertyListenersTest.java | 16 +- .../vaadin/tests/server/AssertionsEnabledTest.java | 6 +- .../tests/server/ClassesSerializableTest.java | 26 +- .../server/ClientMethodSerializationTest.java | 40 +- .../tests/server/ContextClickListenerTest.java | 10 +- .../vaadin/tests/server/CsrfTokenMissingTest.java | 12 +- .../com/vaadin/tests/server/ExtensionTest.java | 6 +- .../com/vaadin/tests/server/FileResourceTest.java | 6 +- .../vaadin/tests/server/FileTypeResolverTest.java | 36 +- .../server/IndexedContainerListenersTest.java | 8 +- .../vaadin/tests/server/PropertyFormatterTest.java | 18 +- .../tests/server/PropertysetItemListenersTest.java | 4 +- .../com/vaadin/tests/server/SerializationTest.java | 8 +- .../server/SimpleMultiPartInputStreamTest.java | 16 +- .../vaadin/tests/server/StreamResourceTest.java | 8 +- .../tests/server/StreamVariableMappingTest.java | 8 +- .../clientconnector/AttachDetachListenersTest.java | 4 +- .../component/AbstractListenerMethodsTestBase.java | 25 +- .../server/component/ComponentSizeParseTest.java | 6 +- .../component/DeclarativeMarginTestBase.java | 13 +- .../server/component/FieldDefaultValuesTest.java | 21 +- .../server/component/ReadEmptyDesignTest.java | 9 +- .../component/StateGetDoesNotMarkDirtyTest.java | 4 +- .../server/component/WriteEmptyDesignTest.java | 10 +- .../AbsoluteLayoutDeclarativeTest.java | 12 +- .../AbsoluteLayoutListenersTest.java | 4 +- .../absolutelayout/AddComponentsTest.java | 8 +- .../absolutelayout/ComponentPositionTest.java | 14 +- .../AbstractComponentDeclarativeTest.java | 24 +- .../AbstractComponentContainerListenersTest.java | 4 +- .../AddParentAsChildTest.java | 8 +- .../abstractfield/AbsFieldValidatorsTest.java | 6 +- .../AbsFieldValueConversionErrorTest.java | 4 +- .../AbsFieldValueConversionsTest.java | 15 +- .../AbstractFieldDeclarativeTest.java | 12 +- .../abstractfield/AbstractFieldListenersTest.java | 6 +- .../abstractfield/AbstractFieldReadOnlyTest.java | 12 +- .../abstractfield/DefaultConverterFactoryTest.java | 20 +- .../abstractfield/RemoveListenersOnDetachTest.java | 4 +- .../AbstractOrderedLayoutDeclarativeTest.java | 20 +- .../AbstractOrderedLayoutListenersTest.java | 4 +- .../LayoutSettingsOnReplaceTest.java | 22 +- .../AbstractSelectDeclarativeTest.java | 39 +- .../AbstractSelectListenersTest.java | 4 +- .../abstractselect/AbstractSelectStateTest.java | 12 +- .../abstractselect/OptionGroupDeclarativeTest.java | 10 +- .../RemoveFromParentLockingTest.java | 9 +- .../SetParentAsContentTest.java | 10 +- .../AbstractSplitPanelDeclarativeTest.java | 12 +- .../AbstractSplitPanelListenersTest.java | 4 +- .../AbstractTextFieldDeclarativeTest.java | 12 +- .../AbstractTextFieldListenersTest.java | 4 +- .../component/audio/AudioDeclarativeTest.java | 12 +- .../server/component/audio/AudioStateTest.java | 8 +- .../component/audio/VideoDeclarativeTest.java | 10 +- .../browserframe/BrowserFrameDeclarativeTest.java | 12 +- .../component/button/ButtonDeclarativeTest.java | 15 +- .../component/calendar/CalendarBasicsTest.java | 26 +- .../calendar/CalendarDeclarativeTest.java | 9 +- .../calendar/ContainerDataSourceTest.java | 30 +- .../calendar/ContainerEventProviderTest.java | 8 +- .../checkbox/CheckboxDeclarativeTest.java | 8 +- .../AbstractColorPickerDeclarativeTest.java | 10 +- .../colorpicker/ColorConversionsTest.java | 6 +- .../combobox/ComboBoxDeclarativeTest.java | 6 +- .../component/combobox/ComboBoxStateTest.java | 8 +- .../component/csslayout/AddComponentsTest.java | 3 +- .../csslayout/CssLayoutDeclarativeTest.java | 8 +- .../customlayout/CustomLayoutDeclarativeTest.java | 12 +- .../component/customlayout/CustomLayoutTest.java | 15 +- .../datefield/DateFieldConverterTest.java | 6 +- .../datefield/DateFieldDeclarativeTest.java | 22 +- .../datefield/InlineDateFieldDeclarativeTest.java | 20 +- .../datefield/PopupDateFieldDeclarativeTest.java | 12 +- .../component/fieldgroup/BeanFieldGroupTest.java | 4 +- .../fieldgroup/CaseInsensitiveBindingTest.java | 4 +- .../component/fieldgroup/FieldGroupTest.java | 17 +- .../fieldgroup/FieldNamedDescriptionTest.java | 4 +- .../component/flash/FlashDeclarativeTest.java | 8 +- .../tests/server/component/form/FormTest.java | 8 +- .../grid/GridAddRowBuiltinContainerTest.java | 46 +- .../server/component/grid/GridChildrenTest.java | 10 +- .../grid/GridColumnAddingAndRemovingTest.java | 22 +- .../server/component/grid/GridColumnsTest.java | 27 +- .../grid/GridContainerNotSortableTest.java | 6 +- .../server/component/grid/GridContainerTest.java | 23 +- .../server/component/grid/GridEditorTest.java | 21 +- .../server/component/grid/GridExtensionTest.java | 10 +- .../server/component/grid/GridSelectionTest.java | 35 +- .../tests/server/component/grid/GridStateTest.java | 8 +- .../component/grid/GridStaticSectionTest.java | 10 +- .../component/grid/MultiSelectionModelTest.java | 14 +- .../component/grid/SingleSelectionModelTest.java | 23 +- .../tests/server/component/grid/TestGrid.java | 8 +- .../declarative/GridColumnDeclarativeTest.java | 9 +- .../declarative/GridDeclarativeAttributeTest.java | 20 +- .../grid/declarative/GridDeclarativeTestBase.java | 9 +- .../GridHeaderFooterDeclarativeTest.java | 22 +- .../declarative/GridInlineDataDeclarativeTest.java | 22 +- .../declarative/GridStructureDeclarativeTest.java | 6 +- .../tests/server/component/grid/sort/SortTest.java | 40 +- .../gridlayout/GridLayoutDeclarativeTest.java | 13 +- .../component/image/ImageDeclarativeTest.java | 8 +- .../component/label/LabelConvertersTest.java | 6 +- .../component/label/LabelDeclarativeTest.java | 8 +- .../server/component/label/LabelListenersTest.java | 20 +- .../server/component/link/LinkDeclarativeTest.java | 8 +- .../listselect/ListSelectDeclarativeTest.java | 13 +- .../component/listselect/ListSelectStateTest.java | 12 +- .../nativeselect/NativeSelectDeclarativeTest.java | 12 +- .../optiongroup/OptionGroupStateTest.java | 8 +- .../component/panel/PanelDeclarativeTest.java | 8 +- .../PasswordFieldDeclarativeTest.java | 12 +- .../popupview/PopupViewDeclarativeTest.java | 12 +- .../progressbar/ProgressBarDeclarativeTest.java | 12 +- .../richtextarea/RichTextAreaDeclarativeTest.java | 10 +- .../richtextarea/RichTextAreaStateTest.java | 8 +- .../component/slider/SliderDeclarativeTest.java | 8 +- .../tests/server/component/slider/SliderTest.java | 4 +- .../table/CacheUpdateExceptionCausesTest.java | 10 +- .../tests/server/component/table/FooterTest.java | 4 +- .../component/table/MultipleSelectionTest.java | 6 +- .../component/table/TableColumnAlignmentsTest.java | 18 +- .../component/table/TableContextClickTest.java | 6 +- .../component/table/TableDeclarativeTest.java | 59 +- .../component/table/TableDeclarativeTestBase.java | 14 +- .../server/component/table/TableGeneratorTest.java | 4 +- .../table/TablePropertyValueConverterTest.java | 21 +- .../component/table/TableSelectableTest.java | 16 +- .../server/component/table/TableStateTest.java | 8 +- .../component/table/TableVisibleColumnsTest.java | 10 +- .../tabsheet/TabSheetDeclarativeTest.java | 12 +- .../server/component/tabsheet/TabSheetTest.java | 2 +- .../textarea/TextAreaDeclarativeTest.java | 8 +- .../textfield/TextFieldDeclarativeTest.java | 8 +- .../textfield/TextFieldWithValidatorTest.java | 4 +- .../tests/server/component/tree/ListenersTest.java | 8 +- .../server/component/tree/TreeDeclarativeTest.java | 12 +- .../tests/server/component/tree/TreeTest.java | 28 +- .../treetable/TreeTableDeclarativeTest.java | 8 +- .../server/component/treetable/TreeTableTest.java | 13 +- .../TwinColSelectDeclarativeTest.java | 12 +- .../twincolselect/TwinColSelectStateTest.java | 12 +- .../component/ui/CustomUIClassLoaderTest.java | 12 +- .../component/upload/UploadDeclarativeTest.java | 8 +- .../tests/server/component/upload/UploadTest.java | 11 +- .../component/window/AttachDetachWindowTest.java | 13 +- .../component/window/WindowDeclarativeTest.java | 24 +- .../tests/server/component/window/WindowTest.java | 6 +- .../componentcontainer/AddRemoveComponentTest.java | 5 +- .../AbstractFieldValueChangeTestBase.java | 10 +- .../server/components/ComboBoxValueChangeTest.java | 6 +- .../components/TextFieldValueChangeTest.java | 12 +- .../navigator/ClassBasedViewProviderTest.java | 9 +- .../tests/server/navigator/NavigatorTest.java | 59 +- .../server/navigator/UriFragmentManagerTest.java | 6 +- .../tests/server/renderer/ImageRendererTest.java | 10 +- .../vaadin/tests/server/renderer/RendererTest.java | 42 +- .../server/validation/BeanValidationTest.java | 6 +- .../tests/util/GraphVizClassHierarchyCreator.java | 6 +- .../tests/util/MockDeploymentConfiguration.java | 4 +- .../test/java/com/vaadin/tests/util/MockUI.java | 6 +- .../test/java/com/vaadin/tests/util/TestUtil.java | 11 +- .../vaadin/tests/util/UniqueSerializableTest.java | 6 +- .../src/test/java/com/vaadin/ui/AbsSelectTest.java | 22 +- .../src/test/java/com/vaadin/ui/CheckBoxTest.java | 6 +- .../com/vaadin/ui/GridLayoutExpandRatioTest.java | 6 +- .../com/vaadin/ui/HorizontalSplitPanelTest.java | 6 +- .../test/java/com/vaadin/ui/NativeSelectTest.java | 22 +- .../vaadin/ui/PushConfigurationTransportTest.java | 12 +- .../test/java/com/vaadin/ui/RichTextAreaTest.java | 6 +- .../vaadin/ui/SplitPositionChangeListenerTest.java | 15 +- server/src/test/java/com/vaadin/ui/TableTest.java | 14 +- .../src/test/java/com/vaadin/ui/TextAreaTest.java | 6 +- .../src/test/java/com/vaadin/ui/TextFieldTest.java | 6 +- .../test/java/com/vaadin/ui/UIInitRefreshTest.java | 18 +- .../java/com/vaadin/ui/UIThemeEscapingTest.java | 6 +- .../java/com/vaadin/ui/VerticalSplitPanelTest.java | 6 +- .../java/com/vaadin/ui/declarative/DesignTest.java | 36 +- .../java/com/vaadin/util/CurrentInstanceTest.java | 14 +- .../util/ReflectToolsGetFieldValueByTypeTest.java | 4 +- .../ReflectToolsGetPrimitiveFieldValueTest.java | 4 +- .../java-templates/com/vaadin/shared/Version.java | 6 +- .../com/vaadin/shared/AbstractComponentState.java | 10 +- .../java/com/vaadin/shared/AbstractFieldState.java | 10 +- .../com/vaadin/shared/ApplicationConstants.java | 6 +- .../java/com/vaadin/shared/ComponentConstants.java | 6 +- .../src/main/java/com/vaadin/shared/Connector.java | 12 +- .../java/com/vaadin/shared/ContextClickRpc.java | 8 +- .../src/main/java/com/vaadin/shared/EventId.java | 6 +- .../vaadin/shared/JavaScriptConnectorState.java | 6 +- .../vaadin/shared/JavaScriptExtensionState.java | 10 +- .../main/java/com/vaadin/shared/JsonConstants.java | 6 +- .../java/com/vaadin/shared/MouseEventDetails.java | 12 +- .../src/main/java/com/vaadin/shared/Position.java | 6 +- .../java/com/vaadin/shared/VBrowserDetails.java | 95 +- .../java/com/vaadin/shared/VaadinUriResolver.java | 32 +- .../com/vaadin/shared/annotations/Delayed.java | 14 +- .../shared/annotations/DelegateToWidget.java | 20 +- .../com/vaadin/shared/annotations/NoLayout.java | 10 +- .../shared/annotations/NoLoadingIndicator.java | 8 +- .../com/vaadin/shared/communication/ClientRpc.java | 12 +- .../com/vaadin/shared/communication/FieldRpc.java | 10 +- .../LegacyChangeVariablesInvocation.java | 13 +- .../shared/communication/MethodInvocation.java | 10 +- .../vaadin/shared/communication/PushConstants.java | 11 +- .../com/vaadin/shared/communication/PushMode.java | 12 +- .../com/vaadin/shared/communication/ServerRpc.java | 8 +- .../vaadin/shared/communication/SharedState.java | 20 +- .../vaadin/shared/communication/URLReference.java | 10 +- .../com/vaadin/shared/communication/UidlValue.java | 6 +- .../com/vaadin/shared/data/DataProviderRpc.java | 22 +- .../com/vaadin/shared/data/DataRequestRpc.java | 12 +- .../com/vaadin/shared/data/sort/SortDirection.java | 4 +- .../javascriptmanager/ExecuteJavaScriptRpc.java | 6 +- .../javascriptmanager/JavaScriptManagerState.java | 6 +- .../vaadin/shared/ui/AbstractEmbeddedState.java | 6 +- .../com/vaadin/shared/ui/AbstractLayoutState.java | 6 +- .../com/vaadin/shared/ui/AbstractMediaState.java | 6 +- .../java/com/vaadin/shared/ui/AlignmentInfo.java | 12 +- .../java/com/vaadin/shared/ui/BorderStyle.java | 10 +- .../vaadin/shared/ui/BrowserWindowOpenerState.java | 6 +- .../main/java/com/vaadin/shared/ui/ClickRpc.java | 8 +- .../com/vaadin/shared/ui/ComponentStateUtil.java | 13 +- .../main/java/com/vaadin/shared/ui/Connect.java | 12 +- .../vaadin/shared/ui/JavaScriptComponentState.java | 10 +- .../java/com/vaadin/shared/ui/LayoutClickRpc.java | 8 +- .../main/java/com/vaadin/shared/ui/MarginInfo.java | 46 +- .../java/com/vaadin/shared/ui/MediaControl.java | 8 +- .../java/com/vaadin/shared/ui/MultiSelectMode.java | 6 +- .../java/com/vaadin/shared/ui/Orientation.java | 6 +- .../com/vaadin/shared/ui/ShortCutConstants.java | 6 +- .../java/com/vaadin/shared/ui/TabIndexState.java | 10 +- .../ui/absolutelayout/AbsoluteLayoutServerRpc.java | 6 +- .../ui/absolutelayout/AbsoluteLayoutState.java | 6 +- .../vaadin/shared/ui/accordion/AccordionState.java | 6 +- .../com/vaadin/shared/ui/audio/AudioState.java | 8 +- .../shared/ui/browserframe/BrowserFrameState.java | 6 +- .../vaadin/shared/ui/button/ButtonServerRpc.java | 10 +- .../com/vaadin/shared/ui/button/ButtonState.java | 10 +- .../vaadin/shared/ui/button/NativeButtonState.java | 6 +- .../shared/ui/calendar/CalendarClientRpc.java | 10 +- .../vaadin/shared/ui/calendar/CalendarEventId.java | 8 +- .../shared/ui/calendar/CalendarServerRpc.java | 6 +- .../vaadin/shared/ui/calendar/CalendarState.java | 6 +- .../vaadin/shared/ui/calendar/DateConstants.java | 10 +- .../shared/ui/checkbox/CheckBoxServerRpc.java | 9 +- .../vaadin/shared/ui/checkbox/CheckBoxState.java | 6 +- .../com/vaadin/shared/ui/colorpicker/Color.java | 65 +- .../colorpicker/ColorPickerGradientServerRpc.java | 12 +- .../ui/colorpicker/ColorPickerGradientState.java | 8 +- .../ui/colorpicker/ColorPickerGridServerRpc.java | 12 +- .../ui/colorpicker/ColorPickerGridState.java | 8 +- .../ui/colorpicker/ColorPickerServerRpc.java | 14 +- .../shared/ui/colorpicker/ColorPickerState.java | 8 +- .../shared/ui/combobox/ComboBoxConstants.java | 6 +- .../vaadin/shared/ui/combobox/ComboBoxState.java | 8 +- .../vaadin/shared/ui/combobox/FilteringMode.java | 6 +- .../shared/ui/csslayout/CssLayoutServerRpc.java | 6 +- .../vaadin/shared/ui/csslayout/CssLayoutState.java | 6 +- .../shared/ui/customlayout/CustomLayoutState.java | 6 +- .../shared/ui/datefield/DateFieldConstants.java | 6 +- .../shared/ui/datefield/InlineDateFieldState.java | 6 +- .../shared/ui/datefield/PopupDateFieldState.java | 6 +- .../com/vaadin/shared/ui/datefield/Resolution.java | 14 +- .../shared/ui/datefield/TextualDateFieldState.java | 6 +- .../com/vaadin/shared/ui/dd/AcceptCriterion.java | 10 +- .../com/vaadin/shared/ui/dd/DragEventType.java | 6 +- .../shared/ui/dd/HorizontalDropLocation.java | 6 +- .../vaadin/shared/ui/dd/VerticalDropLocation.java | 6 +- .../DragAndDropWrapperConstants.java | 6 +- .../DragAndDropWrapperServerRpc.java | 8 +- .../shared/ui/embedded/EmbeddedConstants.java | 6 +- .../shared/ui/embedded/EmbeddedServerRpc.java | 6 +- .../vaadin/shared/ui/embedded/EmbeddedState.java | 6 +- .../com/vaadin/shared/ui/flash/FlashState.java | 6 +- .../java/com/vaadin/shared/ui/form/FormState.java | 6 +- .../vaadin/shared/ui/grid/ColumnGroupState.java | 8 +- .../shared/ui/grid/DetailsConnectorChange.java | 37 +- .../com/vaadin/shared/ui/grid/EditorClientRpc.java | 16 +- .../com/vaadin/shared/ui/grid/EditorServerRpc.java | 14 +- .../com/vaadin/shared/ui/grid/GridClientRpc.java | 10 +- .../com/vaadin/shared/ui/grid/GridColumnState.java | 8 +- .../com/vaadin/shared/ui/grid/GridConstants.java | 10 +- .../com/vaadin/shared/ui/grid/GridServerRpc.java | 18 +- .../java/com/vaadin/shared/ui/grid/GridState.java | 40 +- .../vaadin/shared/ui/grid/GridStaticCellType.java | 8 +- .../shared/ui/grid/GridStaticSectionState.java | 8 +- .../java/com/vaadin/shared/ui/grid/HeightMode.java | 8 +- .../main/java/com/vaadin/shared/ui/grid/Range.java | 64 +- .../vaadin/shared/ui/grid/ScrollDestination.java | 8 +- .../shared/ui/grid/renderers/RendererClickRpc.java | 8 +- .../selection/MultiSelectionModelServerRpc.java | 12 +- .../grid/selection/MultiSelectionModelState.java | 8 +- .../selection/SingleSelectionModelServerRpc.java | 10 +- .../grid/selection/SingleSelectionModelState.java | 8 +- .../shared/ui/gridlayout/GridLayoutServerRpc.java | 6 +- .../com/vaadin/shared/ui/image/ImageServerRpc.java | 6 +- .../com/vaadin/shared/ui/image/ImageState.java | 6 +- .../com/vaadin/shared/ui/label/ContentMode.java | 12 +- .../com/vaadin/shared/ui/label/LabelState.java | 6 +- .../com/vaadin/shared/ui/link/LinkConstants.java | 6 +- .../java/com/vaadin/shared/ui/link/LinkState.java | 6 +- .../shared/ui/loginform/LoginFormConstants.java | 9 +- .../vaadin/shared/ui/loginform/LoginFormRpc.java | 6 +- .../vaadin/shared/ui/loginform/LoginFormState.java | 6 +- .../vaadin/shared/ui/menubar/MenuBarConstants.java | 6 +- .../com/vaadin/shared/ui/menubar/MenuBarState.java | 6 +- .../ui/optiongroup/OptionGroupConstants.java | 6 +- .../shared/ui/optiongroup/OptionGroupState.java | 8 +- .../AbstractOrderedLayoutServerRpc.java | 10 +- .../orderedlayout/AbstractOrderedLayoutState.java | 6 +- .../shared/ui/orderedlayout/FormLayoutState.java | 8 +- .../ui/orderedlayout/HorizontalLayoutState.java | 6 +- .../ui/orderedlayout/VerticalLayoutState.java | 6 +- .../com/vaadin/shared/ui/panel/PanelServerRpc.java | 6 +- .../com/vaadin/shared/ui/panel/PanelState.java | 6 +- .../shared/ui/popupview/PopupViewServerRpc.java | 6 +- .../vaadin/shared/ui/popupview/PopupViewState.java | 6 +- .../ui/progressindicator/ProgressBarState.java | 8 +- .../ProgressIndicatorServerRpc.java | 6 +- .../progressindicator/ProgressIndicatorState.java | 6 +- .../shared/ui/select/AbstractSelectState.java | 8 +- .../vaadin/shared/ui/slider/SliderOrientation.java | 6 +- .../vaadin/shared/ui/slider/SliderServerRpc.java | 8 +- .../com/vaadin/shared/ui/slider/SliderState.java | 6 +- .../ui/splitpanel/AbstractSplitPanelRpc.java | 10 +- .../ui/splitpanel/AbstractSplitPanelState.java | 6 +- .../ui/splitpanel/HorizontalSplitPanelState.java | 6 +- .../ui/splitpanel/VerticalSplitPanelState.java | 6 +- .../shared/ui/table/CollapseMenuContent.java | 4 +- .../com/vaadin/shared/ui/table/TableConstants.java | 10 +- .../com/vaadin/shared/ui/table/TableServerRpc.java | 8 +- .../com/vaadin/shared/ui/table/TableState.java | 8 +- .../com/vaadin/shared/ui/tabsheet/TabState.java | 8 +- .../shared/ui/tabsheet/TabsheetBaseConstants.java | 6 +- .../shared/ui/tabsheet/TabsheetClientRpc.java | 10 +- .../shared/ui/tabsheet/TabsheetConstants.java | 6 +- .../shared/ui/tabsheet/TabsheetServerRpc.java | 12 +- .../vaadin/shared/ui/tabsheet/TabsheetState.java | 6 +- .../shared/ui/textarea/RichTextAreaState.java | 10 +- .../vaadin/shared/ui/textarea/TextAreaState.java | 6 +- .../ui/textfield/AbstractTextFieldState.java | 6 +- .../shared/ui/textfield/TextFieldConstants.java | 6 +- .../com/vaadin/shared/ui/tree/TreeConstants.java | 6 +- .../com/vaadin/shared/ui/tree/TreeServerRpc.java | 8 +- .../java/com/vaadin/shared/ui/tree/TreeState.java | 8 +- .../shared/ui/treetable/TreeTableConstants.java | 6 +- .../vaadin/shared/ui/treetable/TreeTableState.java | 6 +- .../ui/twincolselect/TwinColSelectConstants.java | 6 +- .../ui/twincolselect/TwinColSelectState.java | 8 +- .../vaadin/shared/ui/ui/DebugWindowClientRpc.java | 10 +- .../vaadin/shared/ui/ui/DebugWindowServerRpc.java | 16 +- .../com/vaadin/shared/ui/ui/NotificationRole.java | 6 +- .../com/vaadin/shared/ui/ui/PageClientRpc.java | 6 +- .../java/com/vaadin/shared/ui/ui/PageState.java | 10 +- .../com/vaadin/shared/ui/ui/ScrollClientRpc.java | 6 +- .../java/com/vaadin/shared/ui/ui/Transport.java | 4 +- .../java/com/vaadin/shared/ui/ui/UIClientRpc.java | 10 +- .../java/com/vaadin/shared/ui/ui/UIConstants.java | 6 +- .../java/com/vaadin/shared/ui/ui/UIServerRpc.java | 6 +- .../main/java/com/vaadin/shared/ui/ui/UIState.java | 20 +- .../vaadin/shared/ui/upload/UploadClientRpc.java | 6 +- .../vaadin/shared/ui/upload/UploadServerRpc.java | 10 +- .../com/vaadin/shared/ui/upload/UploadState.java | 8 +- .../com/vaadin/shared/ui/video/VideoConstants.java | 6 +- .../com/vaadin/shared/ui/video/VideoState.java | 6 +- .../com/vaadin/shared/ui/window/WindowMode.java | 10 +- .../com/vaadin/shared/ui/window/WindowRole.java | 6 +- .../vaadin/shared/ui/window/WindowServerRpc.java | 6 +- .../com/vaadin/shared/ui/window/WindowState.java | 6 +- .../java/com/vaadin/shared/util/SharedUtil.java | 15 +- .../java/com/vaadin/shared/ui/grid/RangeTest.java | 47 +- .../data/util/sqlcontainer/SQLTestsConstants.java | 6 +- .../vaadin/launcher/ApplicationRunnerServlet.java | 76 +- .../launcher/CustomDeploymentConfiguration.java | 6 +- .../vaadin/launcher/DevelopmentServerLauncher.java | 56 +- .../com/vaadin/launcher/util/BrowserLauncher.java | 10 +- .../screenshotbrowser/ScreenshotBrowser.java | 52 +- .../src/main/java/com/vaadin/tests/Components.java | 19 +- .../java/com/vaadin/tests/CurrentTimeMillis.java | 8 +- .../java/com/vaadin/tests/CustomLayoutDemo.java | 23 +- .../java/com/vaadin/tests/FocusingComponents.java | 2 +- .../src/main/java/com/vaadin/tests/LayoutDemo.java | 27 +- .../main/java/com/vaadin/tests/ListenerOrder.java | 3 +- .../main/java/com/vaadin/tests/ModalWindow.java | 12 +- .../java/com/vaadin/tests/NativeWindowing.java | 46 +- .../vaadin/tests/OrderedLayoutSwapComponents.java | 10 +- .../src/main/java/com/vaadin/tests/Parameters.java | 24 +- .../PerformanceTestBasicComponentRendering.java | 6 +- .../PerformanceTestLabelsAndOrderedLayouts.java | 26 +- .../tests/PerformanceTestSubTreeCaching.java | 14 +- .../java/com/vaadin/tests/RandomLayoutStress.java | 29 +- .../com/vaadin/tests/StressComponentsInTable.java | 14 +- .../com/vaadin/tests/TableChangingDatasource.java | 30 +- .../java/com/vaadin/tests/TableSelectTest.java | 10 +- .../src/main/java/com/vaadin/tests/TestBench.java | 58 +- .../java/com/vaadin/tests/TestCaptionWrapper.java | 34 +- .../vaadin/tests/TestComponentAddAndRecursion.java | 20 +- .../com/vaadin/tests/TestContainerChanges.java | 8 +- .../main/java/com/vaadin/tests/TestDateField.java | 8 +- .../java/com/vaadin/tests/TestForAlignments.java | 6 +- ...ApplicationLayoutThatUsesWholeBrosersSpace.java | 10 +- .../tests/TestForBasicApplicationLayout.java | 6 +- .../tests/TestForChildComponentRendering.java | 10 +- .../vaadin/tests/TestForContainerFilterable.java | 14 +- .../TestForGridLayoutChildComponentRendering.java | 10 +- .../vaadin/tests/TestForMultipleStyleNames.java | 19 +- .../com/vaadin/tests/TestForNativeWindowing.java | 46 +- .../tests/TestForPreconfiguredComponents.java | 24 +- .../com/vaadin/tests/TestForRichTextEditor.java | 12 +- .../java/com/vaadin/tests/TestForStyledUpload.java | 52 +- .../java/com/vaadin/tests/TestForTabSheet.java | 4 +- ...tForTablesInitialColumnWidthLogicRendering.java | 31 +- .../main/java/com/vaadin/tests/TestForTrees.java | 22 +- .../main/java/com/vaadin/tests/TestForUpload.java | 55 +- .../java/com/vaadin/tests/TestForWindowOpen.java | 18 +- .../java/com/vaadin/tests/TestForWindowing.java | 10 +- .../main/java/com/vaadin/tests/TestIFrames.java | 6 +- .../tests/TestSelectAndDatefieldInDeepLayouts.java | 10 +- .../com/vaadin/tests/TestSetVisibleAndCaching.java | 35 +- .../com/vaadin/tests/TestSizeableIncomponents.java | 25 +- .../main/java/com/vaadin/tests/TestSplitPanel.java | 6 +- .../main/java/com/vaadin/tests/TreeFilesystem.java | 16 +- .../com/vaadin/tests/TreeFilesystemContainer.java | 24 +- .../tests/UsingCustomNewItemHandlerInSelect.java | 15 +- .../com/vaadin/tests/UsingObjectsInSelect.java | 15 +- .../main/java/com/vaadin/tests/VaadinClasses.java | 9 +- .../com/vaadin/tests/VerifyAssertionsEnabled.java | 6 +- .../com/vaadin/tests/VerifyBrowserVersion.java | 4 +- .../java/com/vaadin/tests/VerifyJreVersion.java | 8 +- .../tests/accessibility/WindowWaiAriaRoles.java | 6 +- .../actions/ActionsOnInvisibleComponents.java | 4 +- .../tests/actions/ActionsWithoutKeyCode.java | 6 +- .../com/vaadin/tests/appengine/GAESyncTest.java | 14 +- .../tests/application/ApplicationCloseTest.java | 12 +- .../application/CommErrorEmulatorServlet.java | 12 +- .../tests/application/CommErrorEmulatorUI.java | 42 +- .../tests/application/ConfirmBrowserTabClose.java | 10 +- .../tests/application/CriticalNotifications.java | 16 +- .../tests/application/DeploymentConfiguration.java | 4 +- .../tests/application/DetachOldUIOnReload.java | 10 +- .../application/MissingHierarchyDetection.java | 17 +- .../tests/application/NavigateWithOngoingXHR.java | 14 +- .../application/PreserveWithExpiredHeartbeat.java | 9 +- .../tests/application/ReconnectDialogUI.java | 12 +- .../tests/application/RefreshStatePreserve.java | 3 +- .../ResynchronizeAfterAsyncRemoval.java | 8 +- .../vaadin/tests/application/ResynchronizeUI.java | 6 +- .../application/TerminalErrorNotification.java | 6 +- .../tests/application/TimingInfoReported.java | 6 +- .../tests/application/VaadinSessionAttribute.java | 17 +- .../tests/application/WebBrowserTimeZone.java | 14 +- .../vaadin/tests/application/calculator/Calc.java | 6 +- .../tests/applicationcontext/ChangeSessionId.java | 8 +- .../tests/applicationcontext/CleanupBrokenUI.java | 8 +- .../tests/applicationcontext/CloseSession.java | 54 +- .../vaadin/tests/applicationcontext/CloseUI.java | 13 +- .../applicationservlet/CustomDeploymentConf.java | 11 +- .../DisableSendUrlAsParameters.java | 9 +- .../applicationservlet/InitParamUIProvider.java | 6 +- .../applicationservlet/SessionExpiration.java | 6 +- .../tests/browserfeatures/WebkitScrollbarTest.java | 6 +- .../components/AbstractComponentContainerTest.java | 23 +- .../tests/components/AbstractComponentTest.java | 92 +- .../components/AbstractComponentTestCase.java | 30 +- .../tests/components/AbstractLayoutTest.java | 4 +- .../components/AbstractOrderedLayoutTest.java | 3 +- .../AbstractOrderedLayoutWithCaptions.java | 12 +- .../vaadin/tests/components/AbstractTestUI.java | 14 +- .../tests/components/AbstractTestUIWithLog.java | 6 +- .../components/AddRemoveSetStyleNamesTest.java | 5 +- .../vaadin/tests/components/ComponentTestCase.java | 8 +- .../vaadin/tests/components/DeclarativeTestUI.java | 14 +- .../tests/components/DisableEnableCascade.java | 8 +- .../components/DisableEnableCascadeStyles.java | 22 +- .../vaadin/tests/components/FileDownloaderUI.java | 54 +- .../tests/components/FocusFromShortcutAction.java | 4 +- .../tests/components/LayoutAttachListenerInfo.java | 25 +- .../components/NoLayoutUpdateWhichNeedsLayout.java | 4 +- .../java/com/vaadin/tests/components/TestBase.java | 2 +- .../com/vaadin/tests/components/TooltipDelay.java | 12 +- .../vaadin/tests/components/TooltipPosition.java | 8 +- .../components/TooltipsOnScrollingWindow.java | 12 +- .../tests/components/TouchDevicesTooltip.java | 4 +- .../vaadin/tests/components/TouchScrollables.java | 28 +- .../components/UnknownComponentConnector.java | 6 +- .../AbsoluteLayoutHideComponent.java | 4 +- .../AbsoluteLayoutRelativeSizeContent.java | 22 +- .../absolutelayout/AbsoluteLayoutResizing.java | 6 +- .../abstractcomponent/AllComponentTooltipTest.java | 6 +- .../ChangeHierarchyBeforeResponse.java | 6 +- .../abstractcomponent/ContextClickUI.java | 6 +- .../components/abstractcomponent/PrimaryStyle.java | 6 +- .../abstractcomponent/RemSizeUnitTest.java | 6 +- .../ResponseWritingErrorHandling.java | 6 +- .../abstractcomponent/UseStateFromHierachy.java | 6 +- .../AbstractComponentDataBindingTest.java | 8 +- .../AbstractFieldCommitWithInvalidValues.java | 3 +- .../abstractfield/AbstractFieldTest.java | 23 +- .../abstractfield/AbstractTextFieldTest.java | 3 +- .../abstractfield/DateFieldBackedByString.java | 5 +- .../abstractfield/DoubleInTextField.java | 8 +- .../abstractfield/FieldFocusOnClick.java | 4 +- .../RequiredIndicatorForFieldsWithoutCaption.java | 4 +- .../abstractfield/ShortcutWhenBodyFocused.java | 6 +- .../Vaadin6ImplicitDoubleConverter.java | 4 +- .../components/accordion/AccordionAddTab.java | 8 +- .../accordion/AccordionPrimaryStylenames.java | 4 +- .../accordion/AccordionRemoveComponent.java | 8 +- .../components/accordion/AccordionRemoveTab.java | 8 +- .../BeanItemContainerNullValues.java | 4 +- .../browserframe/BrowserFrameIsVisible.java | 4 +- .../tests/components/button/ButtonClick.java | 6 +- .../button/ButtonEnterWithWindowShortcut.java | 3 +- .../vaadin/tests/components/button/ButtonHtml.java | 4 +- .../tests/components/button/ButtonIOSDragTest.java | 6 +- .../components/button/ButtonKeyboardClick.java | 8 +- .../tests/components/button/ButtonTabIndex.java | 6 +- .../tests/components/button/ButtonToggleIcons.java | 3 +- .../components/button/ButtonUpdateAltText.java | 16 +- .../vaadin/tests/components/button/Buttons.java | 3 +- .../vaadin/tests/components/button/Buttons3.java | 4 +- .../button/ShortCutListenerModification.java | 4 +- .../calendar/BeanItemContainerTestUI.java | 15 +- .../calendar/CalendarActionEventSource.java | 22 +- .../calendar/CalendarActionsMenuTest.java | 17 +- .../components/calendar/CalendarActionsUI.java | 11 +- .../calendar/CalendarBackwardForward.java | 45 +- .../components/calendar/CalendarDragAndDrop.java | 14 +- .../components/calendar/CalendarHtmlInEvents.java | 6 +- .../calendar/CalendarMonthViewDndEvent.java | 12 +- .../components/calendar/CalendarNotifications.java | 10 +- .../components/calendar/CalendarReadOnly.java | 16 +- .../calendar/CalendarRescheduleEvent.java | 12 +- .../calendar/CalendarResizeOverlappingEvents.java | 14 +- ...darShownNotCorrectlyWhenPartiallyOutOfView.java | 36 +- .../tests/components/calendar/CalendarTest.java | 33 +- .../components/calendar/CalendarTestEvent.java | 8 +- .../components/calendar/CalendarVisibleHours.java | 47 +- .../components/calendar/CalendarWeekSelection.java | 8 +- .../calendar/DndCalendarTargetDetails.java | 8 +- .../components/calendar/HiddenFwdBackButtons.java | 6 +- .../components/calendar/NotificationTestUI.java | 14 +- .../components/calendar/NullEventMoveHandler.java | 8 +- .../calendar/SetFirstVisibleHourOfDay.java | 22 +- .../tests/components/caption/IconsInCaption.java | 4 +- .../components/checkbox/CheckBoxImmediate.java | 6 +- .../components/checkbox/CheckBoxNullValue.java | 3 +- .../checkbox/CheckBoxRevertValueChange.java | 6 +- .../components/checkbox/CheckBoxRpcCount.java | 6 +- .../tests/components/checkbox/CheckBoxes2.java | 4 +- .../checkbox/CheckboxCaptionWrapping.java | 4 +- .../components/checkbox/CheckboxContextClick.java | 19 +- .../components/colorpicker/ColorPickerTestUI.java | 31 +- .../colorpicker/DefaultCaptionWidth.java | 8 +- .../tests/components/combobox/ComboBoxBorder.java | 4 +- .../components/combobox/ComboBoxClickIcon.java | 8 +- .../combobox/ComboBoxCursorPositionReset.java | 6 +- .../combobox/ComboBoxDataSourceChange.java | 4 +- .../components/combobox/ComboBoxInputPrompt.java | 6 +- .../ComboBoxItemAddingWithFocusListener.java | 8 +- .../components/combobox/ComboBoxLargeIcons.java | 6 +- .../combobox/ComboBoxMouseSelectEnter.java | 6 +- .../components/combobox/ComboBoxMousewheel.java | 8 +- .../components/combobox/ComboBoxNoTextInput.java | 6 +- .../components/combobox/ComboBoxOnSmallScreen.java | 5 +- .../components/combobox/ComboBoxPageLength.java | 5 +- .../components/combobox/ComboBoxParentDisable.java | 3 +- .../combobox/ComboBoxPopupWhenBodyScrolls.java | 19 +- .../combobox/ComboBoxReapperingOldValue.java | 4 +- .../ComboBoxSQLContainerFilteredValueChange.java | 8 +- .../combobox/ComboBoxScrollingToPageDisabled.java | 4 +- .../combobox/ComboBoxScrollingWithArrows.java | 6 +- .../ComboBoxSelectingWithNewItemsAllowed.java | 10 +- .../ComboBoxSetNullWhenNewItemsAllowed.java | 6 +- .../components/combobox/ComboBoxSlowInFF.java | 4 +- .../combobox/ComboBoxSuggestionOnDetach.java | 4 +- .../combobox/ComboBoxSuggestionPageLength.java | 6 +- .../combobox/ComboBoxSuggestionPopupWidth.java | 19 +- .../ComboBoxSuggestionPopupWidthLegacy.java | 16 +- .../ComboBoxSuggestionPopupWidthPercentage.java | 16 +- .../ComboBoxSuggestionPopupWidthPixels.java | 16 +- .../combobox/ComboBoxTextFieldEventOrder.java | 4 +- .../combobox/ComboBoxUndefinedWidthAndIcon.java | 4 +- .../combobox/ComboBoxValoDoubleClick.java | 6 +- .../components/combobox/ComboBoxValueInput.java | 3 +- .../tests/components/combobox/ComboPushTiming.java | 3 +- ...mboSelectedValueBeyondTheFirstDropdownPage.java | 7 +- .../combobox/ComboboxInPopupViewWithItems.java | 4 +- .../combobox/ComboboxMenuBarAutoopen.java | 8 +- .../combobox/ComboboxPageLengthZeroScroll.java | 8 +- .../combobox/ComboboxPrimaryStyleNames.java | 4 +- .../combobox/ComboboxStyleChangeWidth.java | 11 +- .../tests/components/combobox/Comboboxes.java | 4 +- .../combobox/FilteringTurkishLocale.java | 14 +- .../tests/components/combobox/PopUpWidth.java | 7 +- .../CustomComponentChildVisibility.java | 4 +- .../CustomComponentHideContent.java | 6 +- .../customcomponent/EmbeddedInCustomComponent.java | 4 +- .../customfield/AbstractNestedFormExample.java | 13 +- .../tests/components/customfield/AddressField.java | 3 +- .../components/customfield/AddressFormExample.java | 6 +- .../components/customfield/CustomFieldSize.java | 8 +- .../tests/components/customfield/EmbeddedForm.java | 6 +- .../components/customfield/NestedPersonForm.java | 8 +- .../customlayout/CustomLayoutUsingTemplate.java | 12 +- .../customlayout/CustomLayoutUsingTheme.java | 5 +- .../customlayout/CustomLayoutWithMissingSlot.java | 18 +- .../customlayout/CustomLayoutWithNullTemplate.java | 6 +- .../customlayout/CustomLayoutWithoutTemplate.java | 6 +- .../tests/components/datefield/AriaDisabled.java | 6 +- .../tests/components/datefield/CommitInvalid.java | 3 +- .../components/datefield/CustomDateFormatEEE.java | 6 +- .../components/datefield/CustomDateFormats.java | 4 +- .../datefield/DateFieldChangeResolution.java | 6 +- .../tests/components/datefield/DateFieldClose.java | 6 +- .../datefield/DateFieldDiscardValue.java | 14 +- .../datefield/DateFieldExtendedRange.java | 3 +- .../components/datefield/DateFieldFastForward.java | 6 +- .../components/datefield/DateFieldInSubWindow.java | 4 +- .../datefield/DateFieldKeyboardInput.java | 6 +- .../datefield/DateFieldPopupClosing.java | 6 +- .../datefield/DateFieldPopupClosingOnDetach.java | 6 +- .../datefield/DateFieldPopupOffScreen.java | 3 +- .../datefield/DateFieldPopupPosition.java | 8 +- .../datefield/DateFieldPrimaryStyleNames.java | 4 +- .../datefield/DateFieldRangeValidation.java | 56 +- .../components/datefield/DateFieldRanges.java | 13 +- .../tests/components/datefield/DateFieldTest.java | 3 +- ...ateFieldWhenChangingValueAndEnablingParent.java | 7 +- .../components/datefield/DateRangeWithSqlDate.java | 6 +- .../datefield/DefaultDateFieldPopupPosition.java | 10 +- .../DefaultHandleUnparsableDateField.java | 7 +- .../datefield/DisabledDateFieldPopup.java | 6 +- .../datefield/DisabledInlineDateField.java | 6 +- .../components/datefield/DisabledParentLayout.java | 8 +- .../datefield/DynamicallyChangeDateRange.java | 12 +- .../components/datefield/InlineDateFields.java | 4 +- .../tests/components/datefield/LenientMode.java | 4 +- .../tests/components/datefield/LocaleChange.java | 6 +- .../tests/components/datefield/LowResolution.java | 12 +- .../components/datefield/PopupClosingWithEsc.java | 6 +- .../datefield/PopupDateFieldInputPrompt.java | 8 +- .../datefield/PopupDateFieldTextEnabled.java | 4 +- .../datefield/PopupDateFieldValueChangeEvents.java | 16 +- .../components/datefield/PopupDateFields.java | 4 +- .../datefield/ValoDateFieldPopupPosition.java | 10 +- .../draganddropwrapper/DragAndDropBatchUpload.java | 6 +- .../draganddropwrapper/DragAndDropFocusObtain.java | 8 +- .../DragAndDropRelativeWidth.java | 8 +- .../draganddropwrapper/DragAndDropTextArea.java | 8 +- .../draganddropwrapper/DragStartModes.java | 5 +- .../SingleUseDragAndDropUpload.java | 14 +- .../tests/components/embedded/EmbeddedAltText.java | 4 +- .../EmbeddedClickListenerRelativeCoordinates.java | 4 +- .../components/embedded/EmbeddedImageRefresh.java | 8 +- .../components/embedded/EmbeddedThemeResource.java | 8 +- .../tests/components/embedded/EmbeddedTooltip.java | 7 +- .../form/FormClearDatasourceRepaint.java | 8 +- .../form/FormCommitWithInvalidValues.java | 3 +- .../tests/components/form/FormDescription.java | 4 +- .../tests/components/form/FormErrorVisible.java | 9 +- .../tests/components/form/FormFieldCaptions.java | 3 +- .../components/form/FormNotGettingSmaller.java | 11 +- .../components/form/FormPrimaryStyleName.java | 4 +- .../com/vaadin/tests/components/form/FormTest.java | 22 +- .../vaadin/tests/components/form/FormTooltips.java | 7 +- .../form/FormWithPropertyFormatterConnected.java | 3 +- .../formlayout/FormLayoutClickListener.java | 18 +- .../formlayout/FormLayoutErrorHover.java | 6 +- .../formlayout/FormLayoutInVerticalLayout.java | 8 +- .../components/formlayout/FormLayoutResizing.java | 6 +- .../tests/components/formlayout/FormLayouts.java | 6 +- .../formlayout/HtmlCaptionInFormLayout.java | 6 +- .../tests/components/formlayout/StylePrefix.java | 8 +- .../vaadin/tests/components/grid/BeanRenderer.java | 6 +- .../tests/components/grid/CustomRenderer.java | 10 +- .../grid/GridAddAndRemoveDataOnInit.java | 6 +- .../vaadin/tests/components/grid/GridAddRow.java | 6 +- .../components/grid/GridCellFocusOnResetSize.java | 10 +- .../tests/components/grid/GridCheckBoxDisplay.java | 6 +- .../grid/GridClientDataChangeHandler.java | 9 +- .../vaadin/tests/components/grid/GridColspans.java | 14 +- .../components/grid/GridColumnAutoExpand.java | 6 +- .../tests/components/grid/GridColumnAutoWidth.java | 6 +- .../components/grid/GridColumnAutoWidthClient.java | 10 +- .../tests/components/grid/GridColumnExpand.java | 9 +- .../grid/GridColumnWidthRecalculation.java | 6 +- .../grid/GridColumnWidthsWithoutData.java | 14 +- .../components/grid/GridCustomSelectionModel.java | 6 +- .../tests/components/grid/GridDataSourceReset.java | 6 +- .../components/grid/GridDefaultSelectionMode.java | 6 +- .../tests/components/grid/GridDetailsDetach.java | 14 +- .../components/grid/GridDetailsLayoutExpand.java | 8 +- .../tests/components/grid/GridDetailsLocation.java | 18 +- .../tests/components/grid/GridDetailsWidth.java | 6 +- .../tests/components/grid/GridDragAndDrop.java | 6 +- .../grid/GridDragSelectionWhileScrolled.java | 6 +- .../grid/GridEditingWithNoScrollBars.java | 6 +- .../grid/GridEditorConverterNotFound.java | 6 +- .../components/grid/GridEditorCustomField.java | 6 +- .../components/grid/GridEditorFrozenColumnsUI.java | 6 +- .../vaadin/tests/components/grid/GridEditorUI.java | 6 +- .../grid/GridExtensionCommunication.java | 6 +- .../tests/components/grid/GridFastAsyncUpdate.java | 15 +- .../components/grid/GridGeneratedProperties.java | 6 +- .../grid/GridHeaderFooterComponents.java | 14 +- .../components/grid/GridHeaderFormatChange.java | 14 +- .../components/grid/GridHeaderStyleNames.java | 30 +- .../tests/components/grid/GridInGridLayout.java | 6 +- .../tests/components/grid/GridInTabSheet.java | 17 +- .../tests/components/grid/GridInWindowResize.java | 6 +- .../grid/GridInitiallyHiddenColumns.java | 6 +- .../tests/components/grid/GridItemSetChange.java | 6 +- .../components/grid/GridLayoutDetailsRow.java | 8 +- .../components/grid/GridMultiSelectionOnInit.java | 10 +- .../grid/GridMultiSelectionScrollBar.java | 6 +- .../tests/components/grid/GridRendererChange.java | 6 +- .../components/grid/GridReplaceContainer.java | 6 +- .../tests/components/grid/GridResizeAndScroll.java | 6 +- .../components/grid/GridResizeHiddenColumn.java | 6 +- .../tests/components/grid/GridResizeTerror.java | 6 +- .../tests/components/grid/GridRowHeightChange.java | 4 +- .../grid/GridScrollToLineWhileResizing.java | 6 +- .../tests/components/grid/GridScrolling.java | 10 +- .../tests/components/grid/GridSidebarPosition.java | 9 +- .../tests/components/grid/GridSingleColumn.java | 6 +- .../tests/components/grid/GridSortIndicator.java | 19 +- .../grid/GridSubPixelProblemWrapping.java | 6 +- .../tests/components/grid/GridSwitchRenderers.java | 8 +- .../tests/components/grid/GridThemeChange.java | 6 +- .../vaadin/tests/components/grid/GridThemeUI.java | 16 +- .../components/grid/GridWidgetRendererChange.java | 6 +- .../tests/components/grid/GridWidthIncrease.java | 10 +- .../components/grid/GridWithBrokenRenderer.java | 6 +- .../tests/components/grid/GridWithLabelEditor.java | 6 +- .../tests/components/grid/GridWithoutRenderer.java | 6 +- .../components/grid/InitialFrozenColumns.java | 6 +- .../tests/components/grid/IntArrayRenderer.java | 6 +- .../tests/components/grid/JavaScriptRenderers.java | 10 +- .../components/grid/JavaScriptStringRenderer.java | 10 +- .../tests/components/grid/MyBeanJSRenderer.java | 8 +- .../vaadin/tests/components/grid/NullHeaders.java | 6 +- .../tests/components/grid/NullRenderers.java | 62 +- .../tests/components/grid/PersonTestGrid.java | 6 +- .../tests/components/grid/RowAwareRenderer.java | 6 +- .../tests/components/grid/SelectDuringInit.java | 6 +- .../components/grid/SortableHeaderStyles.java | 19 +- .../tests/components/grid/WidgetRenderers.java | 41 +- .../EscalatorBasicClientFeatures.java | 6 +- .../grid/basicfeatures/EscalatorUpdaterUi.java | 6 +- .../basicfeatures/GridBasicClientFeatures.java | 5 +- .../grid/basicfeatures/GridBasicFeatures.java | 218 ++-- .../grid/basicfeatures/GridBasicFeaturesValo.java | 6 +- .../grid/basicfeatures/GridClientDataSources.java | 6 +- .../basicfeatures/GridDefaultTextRenderer.java | 9 +- .../grid/basicfeatures/GridHeightByRowOnInit.java | 6 +- .../grid/basicfeatures/GridSidebarFeatures.java | 6 +- .../grid/basicfeatures/GridSortingIndicators.java | 6 +- .../basicfeatures/server/GridClearContainer.java | 8 +- .../declarative/GridDeclarativeBasicFeatures.java | 6 +- .../declarative/GridDeclarativeMultiSelect.java | 6 +- .../grid/declarative/GridItemEditor.java | 6 +- .../components/gridlayout/ComponentAlignments.java | 8 +- .../gridlayout/GridLayoutAlignments.java | 19 +- .../gridlayout/GridLayoutCaptionAlignment.java | 6 +- .../gridlayout/GridLayoutExtraSpacing.java | 15 +- .../GridLayoutFocusOrderAfterShowChild.java | 6 +- .../GridLayoutFractionalSizeAndAlignment.java | 9 +- .../gridlayout/GridLayoutHideMiddleCells.java | 40 +- .../components/gridlayout/GridLayoutInForm.java | 20 +- .../GridLayoutRequiredIndicatorLocation.java | 10 +- .../gridlayout/GridLayoutScrollPosition.java | 10 +- .../gridlayout/GridLayoutWithNonIntegerWidth.java | 4 +- .../components/gridlayout/InsertRowInMiddle.java | 6 +- .../gridlayout/LayoutAfterHidingError.java | 6 +- .../components/gridlayout/UniformGridLayoutUI.java | 3 +- .../tests/components/image/ImageAltText.java | 4 +- .../vaadin/tests/components/image/ImageClicks.java | 8 +- .../BasicJavaScriptComponent.java | 16 +- .../JavaScriptNoLayoutHandlingUI.java | 6 +- .../javascriptcomponent/JavaScriptPreloading.java | 6 +- .../JavaScriptResizeListener.java | 14 +- .../vaadin/tests/components/label/LabelModes.java | 15 +- .../vaadin/tests/components/label/LabelTest.java | 10 +- .../com/vaadin/tests/components/label/Labels.java | 10 +- .../tests/components/label/MarginsInLabels.java | 7 +- .../EmptySpaceOnPageAfterExpandedComponent.java | 6 +- .../com/vaadin/tests/components/link/LinkIcon.java | 4 +- .../tests/components/link/LinkTargetSize.java | 4 +- .../com/vaadin/tests/components/link/LinkTest.java | 8 +- .../listselect/ListSelectAddRemoveItems.java | 9 +- .../listselect/ListSelectAllowNewItem.java | 4 +- .../listselect/ListSelectPrimaryStylename.java | 4 +- .../listselect/ListSelectPushSelectionChanges.java | 10 +- .../tests/components/loginform/LoginFormTest.java | 6 +- .../loginform/LoginFormUIInLoginHandler.java | 12 +- .../vaadin/tests/components/media/AudioTest.java | 14 +- .../com/vaadin/tests/components/media/Media.java | 6 +- .../components/menubar/MenuBarClickOpenedMenu.java | 8 +- .../tests/components/menubar/MenuBarFocus.java | 10 +- .../components/menubar/MenuBarNavigation.java | 3 +- .../menubar/MenuBarRunsOutOfBrowser.java | 3 +- .../menubar/MenuBarSubmenusClosingValo.java | 8 +- .../tests/components/menubar/MenuBarTest.java | 8 +- .../menubar/MenuBarTooltipsNearEdge.java | 14 +- .../components/menubar/MenuBarsWithNesting.java | 6 +- .../components/menubar/MenuItemStyleRemoved.java | 4 +- .../tests/components/menubar/MenuTooltip.java | 14 +- .../components/menubar/SpaceMenuBarNavigation.java | 8 +- .../components/nativebutton/NativeButtonClick.java | 22 +- .../components/nativebutton/NativeButtonHtml.java | 4 +- .../nativebutton/NativeButtonIconAndText.java | 31 +- .../notification/MiddleNotificationPosition.java | 8 +- .../components/notification/NotificationDelay.java | 8 +- .../components/notification/Notifications.java | 7 +- .../notification/NotificationsHtmlAllowed.java | 3 +- .../optiongroup/DisabledOptionGroupItems.java | 6 +- .../optiongroup/OptionGroupDisabled.java | 6 +- .../OptionGroupMultipleValueChange.java | 3 +- .../OptionGroupRetainFocusKeyboardValueChange.java | 8 +- .../tests/components/optiongroup/OptionGroups.java | 4 +- .../optiongroup/ReadOnlyOptionGroup.java | 8 +- .../components/orderedlayout/BoxLayoutTest.java | 59 +- .../components/orderedlayout/CaptionLeak.java | 8 +- .../components/orderedlayout/ErrorIndicator.java | 14 +- .../orderedlayout/ExpandChangeReattach.java | 10 +- ...orizontalLayoutFullsizeContentWithErrorMsg.java | 11 +- .../orderedlayout/HorizontalLayoutTest.java | 4 +- .../HorizontalRelativeSizeWithoutExpand.java | 3 +- .../orderedlayout/LayoutClickListenerTest.java | 4 +- .../orderedlayout/LayoutRenderTimeTest.java | 10 +- .../components/orderedlayout/LayoutResizeTest.java | 27 +- .../orderedlayout/NestedLayoutCaptionHover.java | 12 +- .../orderedlayout/OrderedLayoutCases.java | 84 +- .../OrderedLayoutComponentOrdering.java | 3 +- .../OrderedLayoutInfiniteLayoutPasses.java | 3 +- .../RelativeChildrenWithoutExpand.java | 4 +- .../components/orderedlayout/SpacingLeak.java | 2 +- .../orderedlayout/TooltipOnRequiredIndicator.java | 14 +- .../orderedlayout/VaadinTunesLayout.java | 21 +- .../VerticalLayoutFocusWithDOMChanges.java | 10 +- .../orderedlayout/VerticalLayoutTest.java | 4 +- .../VerticalRelativeSizeWithoutExpand.java | 3 +- .../vaadin/tests/components/page/PageTitle.java | 6 +- .../tests/components/panel/BasicPanelTest.java | 3 +- .../components/panel/PanelChangeContents.java | 10 +- .../PanelClickListenerRelativeCoordinates.java | 6 +- .../PanelConcurrentModificationException.java | 8 +- .../panel/PanelRemoveShortcutListener.java | 8 +- .../panel/PanelShouldRemoveActionHandler.java | 13 +- .../components/panel/UndefinedSizeScrollbars.java | 6 +- .../components/panel/WebkitScrollbarTest.java | 6 +- .../components/popupview/DisabledPopupView.java | 3 +- .../components/popupview/PopupViewAndFragment.java | 6 +- .../components/popupview/PopupViewCaption.java | 8 +- .../popupview/PopupViewClickShortcut.java | 25 +- .../popupview/PopupViewInEmbeddedApplication.java | 4 +- .../popupview/PopupViewLabelResized.java | 8 +- .../components/popupview/PopupViewNullValues.java | 36 +- .../popupview/PopupViewResizeWhileOpen.java | 8 +- .../popupview/PopupViewShortcutActionHandler.java | 8 +- .../popupview/PopupViewWithExtension.java | 8 +- .../components/popupview/ReopenPopupView.java | 10 +- .../ProgressBarStaticReindeer.java | 6 +- .../progressindicator/ProgressBarStaticRuno.java | 6 +- .../progressindicator/ProgressBarTest.java | 10 +- .../ProgressIndicatorInvisible.java | 16 +- .../progressindicator/ProgressIndicatorTest.java | 3 +- .../RichTextAreaPreventsTextFieldAccess.java | 15 +- .../RichTextAreaRelativeHeightResize.java | 6 +- .../components/select/AbstractSelectTestCase.java | 11 +- .../select/ComboBoxAddWhileFiltering.java | 2 +- .../vaadin/tests/components/select/EnumSelect.java | 6 +- .../components/select/OptionGroupBaseSelects.java | 38 +- .../components/select/SelectDisplaysOldValue.java | 18 +- .../components/select/SelectIconPlacement.java | 4 +- .../select/SelectItemCaptionRefresh.java | 12 +- .../components/select/SelectWithIntegers.java | 6 +- .../components/select/StylingPopupOpener.java | 6 +- .../components/slider/HiddenSliderHandle.java | 6 +- .../tests/components/slider/SliderDisable.java | 6 +- .../tests/components/slider/SliderFeedback.java | 6 +- .../components/slider/SliderPrimaryStyleName.java | 4 +- .../tests/components/slider/SliderResize.java | 6 +- .../slider/SliderUpdateFromValueChange.java | 10 +- .../splitpanel/AbstractSplitPanelTest.java | 10 +- .../splitpanel/HorizontalSplitPanelHeight.java | 20 +- .../splitpanel/HorizontalSplitPanels.java | 4 +- .../RetainSplitterPositionWhenOutOfBounds.java | 6 +- .../splitpanel/SplitPanelDuplicateStyleName.java | 8 +- .../splitpanel/SplitPanelExtraScrollbars.java | 4 +- .../splitpanel/SplitPanelMoveComponent.java | 6 +- .../splitpanel/SplitPanelSplitterWidth.java | 4 +- .../components/splitpanel/SplitPanelStyleLeak.java | 6 +- .../SplitPanelWithMinimumAndMaximum.java | 126 ++- .../components/splitpanel/SplitPositionChange.java | 12 +- .../components/splitpanel/VerticalSplitPanels.java | 4 +- .../table/AddSelectionToRemovedRange.java | 11 +- .../tests/components/table/AsyncPushUpdates.java | 17 +- .../components/table/CellStyleGeneratorTest.java | 5 +- .../table/ColumnCollapsingAndColumnExpansion.java | 3 +- .../tests/components/table/ColumnResizeEvent.java | 21 +- ...nWidthsAfterChangeTableColumnsCountOrOrder.java | 11 +- .../table/ContainerSizeChangeDuringTablePaint.java | 10 +- .../tests/components/table/ContextMenuSize.java | 11 +- .../components/table/DelayedColumnLayouting.java | 10 +- .../tests/components/table/DndEmptyTable.java | 8 +- .../components/table/DndTableTargetDetails.java | 16 +- .../tests/components/table/EditableModeChange.java | 3 +- .../components/table/EmptyRowsWhenScrolling.java | 33 +- .../vaadin/tests/components/table/EmptyTable.java | 12 +- .../tests/components/table/ExpandingContainer.java | 10 +- .../components/table/FocusOnSelectedItem.java | 14 +- .../com/vaadin/tests/components/table/Footer.java | 15 +- .../vaadin/tests/components/table/FooterClick.java | 8 +- .../vaadin/tests/components/table/HeaderClick.java | 12 +- .../table/HeaderFooterClickLeftRightMiddle.java | 10 +- .../table/HeaderPositionWhenSorting.java | 10 +- .../table/HeaderRightClickAfterDrag.java | 13 +- .../components/table/HeaderUpdateWhenNoRows.java | 3 +- .../table/HiddenColumnsExpandRatios.java | 4 +- .../components/table/HiddenComponentCells.java | 10 +- .../tests/components/table/ItemClickEvents.java | 19 +- .../vaadin/tests/components/table/KeyControl.java | 3 +- .../KeyboardNavigationWithChangingContent.java | 35 +- .../table/LabelEmbeddedClickThroughForTable.java | 22 +- .../components/table/LargeSelectionCausesNPE.java | 4 +- .../tests/components/table/LastColumnNegative.java | 7 +- .../components/table/LeftColumnAlignment.java | 8 +- .../tests/components/table/LongMultiselect.java | 4 +- .../components/table/ModifyContainerProperty.java | 6 +- .../table/MultiSelectWithRemovedRow.java | 9 +- .../tests/components/table/OddEvenRowStyling.java | 8 +- .../tests/components/table/PopupViewInTable.java | 4 +- .../components/table/PropertyValueChange.java | 9 +- .../table/RefreshRenderedCellsOnlyIfAttached.java | 18 +- .../tests/components/table/ReloadWidgets.java | 4 +- .../tests/components/table/RowAdditionTest.java | 8 +- .../table/RowUpdateShouldRetainContextMenu.java | 3 +- .../table/SelectAllConstantViewport.java | 14 +- .../tests/components/table/SelectAllRows.java | 6 +- .../components/table/SelectAllRowsShiftFirst.java | 6 +- .../table/SetCurrentPageFirstItemIndex.java | 19 +- .../table/SetPageFirstItemLoadsNeededRowsOnly.java | 14 +- .../tests/components/table/ShowLastItem.java | 9 +- .../tests/components/table/SortLabelsInTable.java | 6 +- .../components/table/SortableHeaderStyles.java | 14 +- .../table/TableAfterRemovingExpandRatios.java | 8 +- .../table/TableAndBrowserContextMenu.java | 7 +- .../tests/components/table/TableBlurFocus.java | 12 +- .../table/TableChildMeasurementHint.java | 19 +- .../TableClickAndDragOnIconAndComponents.java | 16 +- .../table/TableClickValueChangeInteraction.java | 4 +- .../components/table/TableColumnAddAndResize.java | 18 +- .../table/TableColumnWidthsAndSorting.java | 6 +- .../tests/components/table/TableContextMenu.java | 3 +- .../components/table/TableContextMenuOnField.java | 3 +- .../components/table/TableContextMenuTouch.java | 3 +- .../components/table/TableExtraScrollbars.java | 4 +- .../table/TableHeightWhenHidingHeaders.java | 5 +- .../table/TableItemDescriptionGeneratorUI.java | 4 +- .../vaadin/tests/components/table/TableJumpUI.java | 10 +- .../table/TableMatchesMouseDownMouseUpElement.java | 11 +- .../table/TableMoveFocusWithSelection.java | 17 +- .../components/table/TableMultiSelectSimple.java | 4 +- .../components/table/TableNavigationPageDown.java | 6 +- .../table/TableParentEnabledStateChange.java | 10 +- .../components/table/TableReduceContainerSize.java | 8 +- .../TableRemovedQuicklySendsInvalidRpcCalls.java | 15 +- ...ableRepairsScrollPositionOnReAddingAllRows.java | 9 +- .../components/table/TableRequiredIndicator.java | 6 +- .../tests/components/table/TableRowHeight.java | 7 +- .../tests/components/table/TableRowHeight2.java | 3 +- .../tests/components/table/TableRowHeight3.java | 3 +- .../components/table/TableRowScrolledBottom.java | 10 +- .../components/table/TableScrollAfterAddRow.java | 26 +- .../components/table/TableScrollUpOnSelect.java | 8 +- .../table/TableScrollingWithSQLContainer.java | 4 +- .../components/table/TableSelectPagingOff.java | 7 +- .../components/table/TableSetUndefinedSize.java | 28 +- .../table/TableShouldNotEatValueChanges.java | 3 +- .../components/table/TableSizeInTabsheet.java | 6 +- .../tests/components/table/TableSorting.java | 4 +- .../components/table/TableSortingIndicator.java | 14 +- .../tests/components/table/TableSqlContainer.java | 24 +- .../table/TableToggleColumnVisibility.java | 6 +- .../table/TableToggleColumnVisibilityWidth.java | 9 +- .../components/table/TableToggleVisibility.java | 6 +- .../components/table/TableTooManyColumns.java | 10 +- .../tests/components/table/TableUndefinedSize.java | 20 +- .../components/table/TableUnregisterComponent.java | 9 +- .../components/table/TableWidthItemRemove.java | 17 +- .../TableWithBrokenGeneratorAndContainer.java | 27 +- .../components/table/TableWithChildComponents.java | 10 +- ...TableWithContainerRequiringEqualsForItemId.java | 30 +- .../table/TableWithCustomConverterFactory.java | 7 +- .../table/TableWithNoncollapsibleColumns.java | 28 +- .../tests/components/table/TableWithPolling.java | 11 +- .../com/vaadin/tests/components/table/Tables.java | 88 +- .../tests/components/table/TabletContextMenu.java | 9 +- .../components/table/TestCurrentPageFirstItem.java | 8 +- .../table/UnnecessaryScrollbarWhenZooming.java | 6 +- .../table/ValueAfterClearingContainer.java | 4 +- .../tabsheet/FirstTabNotVisibleInTabsheet.java | 4 +- .../components/tabsheet/HtmlInTabCaption.java | 8 +- .../tabsheet/NewSelectionAfterTabRemove.java | 10 +- .../components/tabsheet/PreventTabChange.java | 4 +- .../tests/components/tabsheet/TabBarWidth.java | 13 +- .../tabsheet/TabGetAndReplaceComponent.java | 4 +- .../components/tabsheet/TabKeyboardNavigation.java | 4 +- .../tabsheet/TabSelectionRevertedByServer.java | 4 +- .../components/tabsheet/TabSheetCaptions.java | 9 +- .../tests/components/tabsheet/TabSheetClose.java | 14 +- .../components/tabsheet/TabSheetErrorTooltip.java | 6 +- .../components/tabsheet/TabSheetFocusing.java | 6 +- .../tabsheet/TabSheetHotKeysWithModifiers.java | 8 +- .../tabsheet/TabSheetInDisabledParent.java | 8 +- .../components/tabsheet/TabSheetInSplitPanel.java | 6 +- .../tabsheet/TabSheetIndexOperations.java | 5 +- .../tabsheet/TabSheetScrollOnTabClose.java | 14 +- .../components/tabsheet/TabSheetTabStyleNames.java | 4 +- .../components/tabsheet/TabSheetTabTheming.java | 3 +- .../tests/components/tabsheet/TabSheetTest.java | 4 +- .../tabsheet/TabSheetWithHasComponent.java | 4 +- .../components/tabsheet/TabSheetWithTabIds.java | 8 +- .../components/tabsheet/TabSpaceNotScroll.java | 8 +- .../tabsheet/TabsheetNotEnoughHorizontalSpace.java | 14 +- .../components/tabsheet/TabsheetScrolling.java | 3 +- .../tabsheet/TabsheetShouldUpdateHeight.java | 3 +- .../tabsheet/VerticalScrollbarPosition.java | 3 +- .../tests/components/tabsheet/VetoTabChange.java | 6 +- .../tests/components/textarea/ScrollCursor.java | 12 +- .../textarea/TextAreaCursorPosition.java | 4 +- .../components/textarea/TextAreaSizeResetted.java | 4 +- .../components/textfield/AutomaticImmediate.java | 24 +- .../components/textfield/BigDecimalTextField.java | 10 +- .../EnterShortcutMaySendInputPromptAsValue.java | 3 +- .../tests/components/textfield/EnumTextField.java | 6 +- .../textfield/InputPromptAndCursorPosition.java | 19 +- .../components/textfield/InputPromptGetText.java | 32 +- .../OutOfSyncIssueWithKeyboardShortcut.java | 5 +- .../components/textfield/RequiredTextField.java | 8 +- .../textfield/SelectionAndCursorPosition.java | 8 +- .../tests/components/textfield/SetTabIndex.java | 4 +- .../components/textfield/TextChangeEvents.java | 11 +- .../components/textfield/TextChangeEvents2.java | 4 +- ...extChangeListenerChangingNonTextProperties.java | 7 +- .../textfield/TextFieldEmptyingPrompt.java | 6 +- .../textfield/TextFieldFocusAndBlurListeners.java | 4 +- .../textfield/TextFieldInLayoutInTable.java | 4 +- .../tests/components/textfield/TextFieldTest.java | 4 +- ...extFieldTruncatesUnderscoresInModalDialogs.java | 13 +- .../components/tree/DndTreeTargetDetails.java | 8 +- .../tests/components/tree/TreeConnectors.java | 20 +- .../tests/components/tree/TreeFiltering.java | 4 +- .../components/tree/TreeHtmlContentAllowed.java | 6 +- .../tree/TreeKeyboardNavigationScrolls.java | 6 +- .../tree/TreeKeyboardNavigationToNone.java | 8 +- .../components/tree/TreeNodeCaptionWrapping.java | 4 +- .../vaadin/tests/components/tree/TreeToolTips.java | 15 +- .../com/vaadin/tests/components/tree/Trees.java | 15 +- .../treetable/ChangeDataSourcePageLengthZero.java | 12 +- .../treetable/DisappearingComponents.java | 3 +- .../components/treetable/DynamicallyModified.java | 36 +- .../treetable/ExpandAnimationsInChameleon.java | 15 +- .../components/treetable/KeepAllItemsVisible.java | 4 +- .../components/treetable/MinimalWidthColumns.java | 2 +- .../components/treetable/ProgrammaticCollapse.java | 17 +- .../components/treetable/ProgrammaticSelect.java | 4 +- .../treetable/RemoveAllItemsRefresh.java | 14 +- .../treetable/TreeTableCacheOnPartialUpdates.java | 4 +- .../treetable/TreeTableExtraScrollbar.java | 6 +- .../TreeTableExtraScrollbarWithChildren.java | 6 +- .../TreeTableItemDescriptionGeneratorUI.java | 4 +- .../treetable/TreeTableModifyAndSetCollapsed.java | 4 +- .../components/treetable/TreeTableOutOfSync.java | 6 +- .../treetable/TreeTablePartialUpdates.java | 3 +- .../TreeTablePartialUpdatesPageLength0.java | 3 +- .../treetable/TreeTableRowGenerator.java | 6 +- .../treetable/TreeTableRowHeaderMode.java | 2 +- .../components/treetable/TreeTableRowIcons.java | 4 +- .../treetable/TreeTableScrollOnExpand.java | 6 +- .../tests/components/treetable/TreeTableTest.java | 4 +- .../components/ui/ComboboxSelectedItemText.java | 6 +- .../tests/components/ui/CurrentUiRetained.java | 6 +- .../vaadin/tests/components/ui/CustomUITest.java | 6 +- .../tests/components/ui/DynamicViewport.java | 6 +- .../tests/components/ui/InvalidViewport.java | 6 +- .../vaadin/tests/components/ui/LazyInitUIs.java | 3 +- .../tests/components/ui/MultiFileUploadTest.java | 13 +- .../tests/components/ui/MultipleUIUploadTest.java | 8 +- .../vaadin/tests/components/ui/PollListening.java | 10 +- .../vaadin/tests/components/ui/StaticViewport.java | 6 +- .../components/ui/TextAreaEventPropagation.java | 8 +- .../ui/TimeoutRedirectResetsOnActivity.java | 10 +- .../com/vaadin/tests/components/ui/UIAccess.java | 66 +- .../components/ui/UIAccessExceptionHandling.java | 55 +- .../components/ui/UIAutoGeneratedStyleName.java | 8 +- .../com/vaadin/tests/components/ui/UIInitTest.java | 6 +- .../com/vaadin/tests/components/ui/UIPolling.java | 6 +- .../com/vaadin/tests/components/ui/UIRefresh.java | 6 +- .../tests/components/ui/UISerialization.java | 8 +- .../tests/components/ui/UiDependenciesInHtml.java | 6 +- .../ui/UnnecessaryPaddingInResponsiveUI.java | 8 +- .../vaadin/tests/components/ui/UriFragment.java | 3 +- .../tests/components/ui/WindowAndUIShortcuts.java | 15 +- .../tests/components/uitest/BackButtonTest.java | 3 +- .../tests/components/uitest/TestSampler.java | 5 +- .../uitest/components/EmbeddedCssTest.java | 4 +- .../uitest/components/LayoutsCssTest.java | 4 +- .../uitest/components/SelectsCssTest.java | 3 +- .../uitest/components/TabSheetsCssTest.java | 4 +- .../uitest/components/TablesCssTest.java | 7 +- .../uitest/components/TextFieldsCssTest.java | 4 +- .../components/uitest/components/TreeCssTest.java | 3 +- .../uitest/components/WindowsCssTest.java | 2 +- .../tests/components/upload/TestFileUpload.java | 3 +- .../components/upload/TestFileUploadSize.java | 3 +- .../upload/TestImmediateUploadInFormLayout.java | 4 +- .../upload/UploadImmediateButtonWidth.java | 6 +- .../tests/components/upload/UploadNoSelection.java | 10 +- .../components/upload/UploadTitleWithTooltip.java | 8 +- .../window/BackspaceKeyWithModalOpened.java | 6 +- .../window/BottomComponentScrollsUp.java | 2 +- .../window/CenteredInVisualViewport.java | 12 +- .../components/window/CloseModalSubWindow.java | 6 +- .../window/ComboboxScrollableWindow.java | 8 +- .../tests/components/window/DownloadAndUpdate.java | 4 +- .../tests/components/window/ExtraWindowShown.java | 4 +- .../components/window/ExtraWindowShownWaiAria.java | 20 +- .../tests/components/window/GridInWindow.java | 6 +- .../components/window/LegacyWindowOpenTest.java | 6 +- .../tests/components/window/LongNotifications.java | 13 +- .../MaximizeRestoreWindowWithManagedLayout.java | 6 +- .../components/window/MaximizedWindowOrder.java | 4 +- .../tests/components/window/ModalWindowFocus.java | 6 +- .../window/ModalWindowInitialLocation.java | 6 +- .../vaadin/tests/components/window/MoveToTop.java | 8 +- .../window/OpenModalWindowAndFocusField.java | 6 +- .../tests/components/window/PageOpenTest.java | 12 +- .../ScrollingBodyElementWithModalOpened.java | 8 +- .../tests/components/window/SubWindowFocus.java | 4 +- .../window/SubWindowFocusAndBlurListeners.java | 3 +- .../window/SubWindowWithUndefinedHeight.java | 3 +- .../window/TestTooSmallSubwindowSize.java | 48 +- .../tests/components/window/ToolTipInWindow.java | 8 +- .../window/UncloseableWindowCloseShortcut.java | 6 +- .../tests/components/window/WindowCaption.java | 9 +- .../components/window/WindowCloseShortcuts.java | 6 +- .../components/window/WindowInUiWithNoContent.java | 8 +- .../window/WindowMaximizeRestoreTest.java | 4 +- .../components/window/WindowMoveListener.java | 6 +- .../window/WindowScrollingComponentIntoView.java | 8 +- .../window/WindowShouldRemoveActionHandler.java | 10 +- .../tests/components/window/WindowThemes.java | 8 +- .../containers/BeanItemContainerFilteringTest.java | 30 +- .../tests/containers/BeanItemContainerTest.java | 6 +- .../containers/IndexedContainerFilteringTest.java | 22 +- .../containers/TableWithFileSystemContainer.java | 4 +- .../vaadin/tests/containers/TestItemSorter.java | 8 +- .../FileSystemContainerInTreeTable.java | 12 +- .../sqlcontainer/CheckboxUpdateProblem.java | 15 +- .../containers/sqlcontainer/DatabaseHelper.java | 36 +- .../sqlcontainer/MassInsertMemoryLeakTestApp.java | 12 +- .../TableQueryWithNonUniqueFirstPrimaryKey.java | 15 +- .../tests/contextclick/AbstractContextClickUI.java | 12 +- .../BrowserContextMenuInSubComponent.java | 6 +- .../tests/contextclick/GridContextClick.java | 14 +- .../tests/contextclick/TableContextClick.java | 14 +- .../tests/contextclick/TreeContextClick.java | 10 +- .../tests/contextclick/TreeTableContextClick.java | 14 +- .../converter/ConverterThatEnforcesAFormat.java | 9 +- ...ngToDoubleConverterWithThreeFractionDigits.java | 4 +- .../java/com/vaadin/tests/data/bean/Country.java | 4 +- .../java/com/vaadin/tests/data/bean/Person.java | 4 +- .../com/vaadin/tests/dd/AcceptAnythingWindow.java | 4 +- .../com/vaadin/tests/dd/AcceptFromComponent.java | 9 +- .../vaadin/tests/dd/ActiveDragSourceClassName.java | 4 +- .../vaadin/tests/dd/CustomDDImplementation.java | 14 +- .../main/java/com/vaadin/tests/dd/DDInterrupt.java | 5 +- .../src/main/java/com/vaadin/tests/dd/DDTest1.java | 27 +- .../src/main/java/com/vaadin/tests/dd/DDTest2.java | 6 +- .../src/main/java/com/vaadin/tests/dd/DDTest4.java | 23 +- .../src/main/java/com/vaadin/tests/dd/DDTest5.java | 24 +- .../src/main/java/com/vaadin/tests/dd/DDTest6.java | 51 +- .../src/main/java/com/vaadin/tests/dd/DDTest7.java | 32 +- .../src/main/java/com/vaadin/tests/dd/DDTest8.java | 21 +- .../java/com/vaadin/tests/dd/DragAndDropFiles.java | 27 +- .../java/com/vaadin/tests/dd/DragDropPane.java | 19 +- .../dd/HorizontalLayoutSortableWithWrappers.java | 16 +- .../HorizontalSortableCssLayoutWithWrappers.java | 7 +- .../com/vaadin/tests/dd/MyDragSourceConnector.java | 10 +- .../com/vaadin/tests/dd/MyDropTargetConnector.java | 10 +- .../vaadin/tests/dd/NotPaintedAcceptSource.java | 8 +- .../tests/dd/NotPaintedAcceptSourceInTabSheet.java | 8 +- .../java/com/vaadin/tests/dd/StartHtml5Drag.java | 17 +- .../java/com/vaadin/tests/dd/TreeDragStart.java | 17 +- .../java/com/vaadin/tests/dd/VMyDragSource.java | 4 +- .../java/com/vaadin/tests/dd/VMyDropTarget.java | 4 +- .../tests/debug/HierarchyAfterAnalyzeLayouts.java | 6 +- .../debug/PreserveCustomDebugSectionOpen.java | 6 +- .../vaadin/tests/debug/ProfilerZeroOverhead.java | 6 +- .../com/vaadin/tests/debug/PushVersionInfo.java | 8 +- .../tests/declarative/DeclarativeEditor.java | 10 +- .../java/com/vaadin/tests/declarative/Potus.java | 8 +- .../com/vaadin/tests/declarative/PotusCrud.java | 6 +- .../com/vaadin/tests/declarative/PotusCrudUI.java | 8 +- .../com/vaadin/tests/declarative/PotusForm.java | 6 +- .../vaadin/tests/errorhandler/ErrorHandlers.java | 16 +- .../vaadin/tests/extensions/BasicExtension.java | 6 +- .../tests/extensions/BasicExtensionTest.java | 6 +- .../extensions/BrowserPopupExtensionTest.java | 6 +- .../tests/extensions/HelloWorldExtension.java | 6 +- .../tests/extensions/HelloWorldExtensionTest.java | 6 +- .../tests/extensions/IframeIsOpenedInNonIOS.java | 4 +- .../tests/extensions/JavascriptManagerTest.java | 6 +- .../extensions/LayoutMemoryUsageIE8Extension.java | 10 +- .../com/vaadin/tests/extensions/ResponsiveUI.java | 3 +- .../ResponsiveWithCrossDomainStyles.java | 6 +- .../extensions/SetThemeAndResponsiveLayout.java | 11 +- .../extensions/SimpleJavaScriptExtensionTest.java | 30 +- .../vaadin/tests/fieldgroup/AbstractBasicCrud.java | 14 +- .../com/vaadin/tests/fieldgroup/BasicCrudGrid.java | 10 +- .../tests/fieldgroup/BasicCrudGridEditorRow.java | 22 +- .../vaadin/tests/fieldgroup/BasicCrudTable.java | 10 +- .../vaadin/tests/fieldgroup/BasicPersonForm.java | 4 +- .../vaadin/tests/fieldgroup/ComplexAddress.java | 6 +- .../com/vaadin/tests/fieldgroup/ComplexPerson.java | 4 +- .../java/com/vaadin/tests/fieldgroup/Country.java | 6 +- .../java/com/vaadin/tests/fieldgroup/DateForm.java | 4 +- .../fieldgroup/FieldBinderWithBeanValidation.java | 9 +- .../FormBuilderWithNestedProperties.java | 4 +- .../tests/fieldgroup/FormWithNestedProperties.java | 7 +- .../java/com/vaadin/tests/fieldgroup/Gender.java | 6 +- .../tests/fieldgroup/MultipleValidationErrors.java | 4 +- .../java/com/vaadin/tests/fonticon/FontIcons.java | 24 +- .../vaadin/tests/integration/FlagSeResource.java | 8 +- .../vaadin/tests/integration/JSR286Portlet.java | 31 +- .../vaadin/tests/integration/LiferayThemeDemo.java | 44 +- ...tletSizeInLiferayFreeformLayoutApplication.java | 6 +- .../com/vaadin/tests/integration/ProxyTest.java | 20 +- .../ServletIntegrationDefaultPushUI.java | 8 +- .../ServletIntegrationLongPollingUI.java | 8 +- .../integration/ServletIntegrationStreamingUI.java | 8 +- .../integration/ServletIntegrationWebsocketUI.java | 10 +- .../layoutmanager/LayoutDuringStateUpdate.java | 6 +- .../vaadin/tests/layouts/CaptionsInLayouts.java | 13 +- .../tests/layouts/CaptionsInLayoutsWaiAria.java | 13 +- .../vaadin/tests/layouts/CssLayoutAbsoluteUrl.java | 6 +- .../vaadin/tests/layouts/GridLayoutCaptions.java | 14 +- .../layouts/GridLayoutExpandRatioModification.java | 4 +- .../tests/layouts/GridLayoutInsidePanel.java | 8 +- .../tests/layouts/GridLayoutSpanExpansion.java | 10 +- .../tests/layouts/HiddenHorizontalLayout.java | 13 +- .../layouts/HorizontalLayoutAndCaretPosition.java | 12 +- .../HorizontalLayoutWithLabelAndButton.java | 6 +- .../com/vaadin/tests/layouts/HtmlInCaption.java | 8 +- .../tests/layouts/IE8MeasuredSizeMemoryLeak.java | 12 +- .../tests/layouts/LayoutPerformanceTests.java | 25 +- .../tests/layouts/MarginWithExpandRatio.java | 6 +- .../MovingComponentsWhileOldParentInvisible.java | 13 +- .../vaadin/tests/layouts/OrderedLayoutBasics.java | 110 +- .../layouts/RelativeSizeInUndefinedCssLayout.java | 6 +- .../vaadin/tests/layouts/TestAbsoluteLayout.java | 21 +- .../tests/layouts/TestLayoutClickListeners.java | 14 +- .../VerticalLayoutExpandRatioModification.java | 4 +- ...tWithRelativeSizeComponentsInitiallyHidden.java | 4 +- .../DefaultLocationInCustomLayout.java | 6 +- .../gridlayout/GridLayoutMoveComponent.java | 8 +- .../layouts/gridlayout/GridSpanEmptyColumns.java | 8 +- .../layouts/layouttester/BaseAddReplaceMove.java | 6 +- .../layouts/layouttester/BaseLayoutTestUI.java | 6 +- .../GridLayout/GridAddReplaceMove.java | 8 +- .../broadcastingmessages/Broadcaster.java | 6 +- .../tests/minitutorials/v70/CookieMonsterUI.java | 8 +- .../tests/minitutorials/v70/SimpleLoginUI.java | 3 +- .../tests/minitutorials/v70/SimpleLoginView.java | 15 +- .../v71beta/CSSInjectWithColorpicker.java | 47 +- .../tests/minitutorials/v7_3/ThemeChangeUI.java | 6 +- .../v7_4/ConfiguringColumnWidths.java | 6 +- .../v7_4/ConfiguringGridHeadersAndFooters.java | 6 +- .../minitutorials/v7_4/FormattingDataInGrid.java | 13 +- .../tests/minitutorials/v7_4/GridExampleBean.java | 6 +- .../minitutorials/v7_4/GridExampleHelper.java | 6 +- .../v7_4/ShowingInlineDataInGrid.java | 6 +- .../v7_4/UsingGridWithAContainer.java | 6 +- .../v7_5/ShowingExtraDataForRows.java | 13 +- .../minitutorials/v7a1/AutoGeneratingForm.java | 12 +- .../tests/minitutorials/v7a1/BasicApplication.java | 8 +- .../minitutorials/v7a1/CreatingPreserveState.java | 12 +- .../tests/minitutorials/v7a1/DefineUITheme.java | 8 +- .../v7a1/DifferentFeaturesForDifferentClients.java | 12 +- .../tests/minitutorials/v7a1/DynamicImageUI.java | 4 +- .../tests/minitutorials/v7a1/FindCurrentUI.java | 8 +- .../v7a1/FormUsingExistingLayout.java | 4 +- .../v7a1/IntegerTextFieldDataSource.java | 6 +- .../minitutorials/v7a1/MultiTabApplication.java | 16 +- .../minitutorials/v7a1/StringMyTypeConverter.java | 4 +- .../minitutorials/v7a1/UsingBeanValidation.java | 8 +- .../minitutorials/v7a1/UsingUriFragments.java | 16 +- .../v7a1/UsingXyzWhenInitializing.java | 16 +- .../v7a2/ComponentInStateComponent.java | 6 +- .../minitutorials/v7a2/ComponentInStateUI.java | 2 +- .../tests/minitutorials/v7a2/MyComponent.java | 10 +- .../tests/minitutorials/v7a2/MyComponentUI.java | 8 +- .../minitutorials/v7a2/MyPickerConnector.java | 12 +- .../v7a2/ResourceInStateComponent.java | 6 +- .../minitutorials/v7a2/ResourceInStateUI.java | 8 +- .../tests/minitutorials/v7a2/WidgetContainer.java | 3 +- .../vaadin/tests/minitutorials/v7a3/Analytics.java | 6 +- .../tests/minitutorials/v7a3/AnalyticsUI.java | 6 +- .../tests/minitutorials/v7a3/CapsLockWarning.java | 6 +- .../minitutorials/v7a3/CapsLockWarningUI.java | 6 +- .../tests/minitutorials/v7a3/ComplexTypesBean.java | 6 +- .../minitutorials/v7a3/ComplexTypesComponent.java | 6 +- .../tests/minitutorials/v7a3/ComplexTypesRpc.java | 6 +- .../tests/minitutorials/v7a3/ComplexTypesUI.java | 6 +- .../com/vaadin/tests/minitutorials/v7a3/Flot.java | 14 +- .../tests/minitutorials/v7a3/FlotHighlightRpc.java | 6 +- .../tests/minitutorials/v7a3/FlotJavaScriptUI.java | 10 +- .../vaadin/tests/minitutorials/v7a3/JSAPIUI.java | 6 +- .../vaadin/tests/minitutorials/v7a3/RedButton.java | 6 +- .../tests/minitutorials/v7a3/RedButtonUI.java | 6 +- .../tests/minitutorials/v7a3/RefresherTestUI.java | 6 +- .../vaadin/tests/minitutorials/v7b1/Addition.java | 6 +- .../v7b1/AxessingWebPageAndBrowserInfoUI.java | 6 +- .../minitutorials/v7b1/BootstrapListenerCode.java | 17 +- .../minitutorials/v7b1/CapsLockWarningWithRpc.java | 6 +- .../minitutorials/v7b1/ReducingRoundTrips.java | 6 +- .../vaadin/tests/minitutorials/v7b2/CleanupUI.java | 6 +- .../tests/minitutorials/v7b5/HandlingLogout.java | 6 +- .../v7b5/SettingReadingSessionAttributesUI.java | 26 +- .../v7b6/LettingUserDownloadFile.java | 10 +- .../vaadin/tests/minitutorials/v7b6/MyPopupUI.java | 6 +- .../tests/minitutorials/v7b6/OpeningUIInPopup.java | 6 +- .../vaadin/tests/minitutorials/v7b9/LoginView.java | 4 +- .../vaadin/tests/minitutorials/v7b9/MainView.java | 16 +- .../minitutorials/v7b9/MainViewEarlierExample.java | 16 +- .../v7b9/MainView__LastNavigatorExample.java | 4 +- .../tests/minitutorials/v7b9/NavigationtestUI.java | 18 +- .../com/vaadin/tests/navigator/NavigatorTest.java | 15 +- .../NavigatorViewBlocksBackButtonAction.java | 16 +- .../tests/overlays/OverlayTouchScrolling.java | 4 +- .../tests/performance/BasicPerformanceTest.java | 16 +- .../main/java/com/vaadin/tests/push/BarInUIDL.java | 12 +- .../main/java/com/vaadin/tests/push/BasicPush.java | 9 +- .../vaadin/tests/push/BasicPushLongPolling.java | 6 +- .../com/vaadin/tests/push/BasicPushStreaming.java | 6 +- .../com/vaadin/tests/push/BasicPushWebsocket.java | 6 +- .../vaadin/tests/push/BasicPushWebsocketXhr.java | 6 +- .../com/vaadin/tests/push/EnableDisablePush.java | 29 +- .../vaadin/tests/push/ExtremelyLongPushTime.java | 8 +- .../push/ExtremelyLongPushTimeLongPolling.java | 6 +- .../tests/push/ExtremelyLongPushTimeStreaming.java | 6 +- .../tests/push/ExtremelyLongPushTimeWebsocket.java | 6 +- .../vaadin/tests/push/ManualLongPollingPushUI.java | 6 +- .../com/vaadin/tests/push/PushConfiguration.java | 6 +- .../com/vaadin/tests/push/PushConfigurator.java | 14 +- .../com/vaadin/tests/push/PushErrorHandling.java | 12 +- .../java/com/vaadin/tests/push/PushFromInit.java | 6 +- .../java/com/vaadin/tests/push/PushLargeData.java | 11 +- .../tests/push/PushLargeDataLongPolling.java | 6 +- .../vaadin/tests/push/PushLargeDataStreaming.java | 6 +- .../vaadin/tests/push/PushLargeDataWebsocket.java | 6 +- .../com/vaadin/tests/push/PushWithRequireJS.java | 6 +- .../vaadin/tests/push/RefreshCloseConnection.java | 6 +- .../java/com/vaadin/tests/push/RoundTripTest.java | 6 +- .../tests/push/StreamingReconnectWhilePushing.java | 6 +- .../com/vaadin/tests/push/TablePushStreaming.java | 16 +- .../java/com/vaadin/tests/push/TogglePush.java | 23 +- .../com/vaadin/tests/push/TrackMessageSizeUI.java | 10 +- .../tests/requesthandlers/AppResource404.java | 4 +- .../tests/requesthandlers/CommunicationError.java | 8 +- .../resources/CachingJavaScriptComponent.java | 6 +- .../tests/resources/DownloadLargeFileResource.java | 7 +- .../vaadin/tests/resources/DownloadWithPush.java | 1 - .../tests/resources/NonExistingFileResource.java | 5 +- .../resources/PublishedFileHandlerCaching.java | 18 +- .../vaadin/tests/resources/ResourceDownload.java | 4 +- .../tests/rpclogger/LoggingServerRpcHandler.java | 6 +- .../tests/rpclogger/LoggingUidlRequestHandler.java | 6 +- .../vaadin/tests/rpclogger/RPCLoggerService.java | 6 +- .../vaadin/tests/rpclogger/RPCLoggerServlet.java | 6 +- .../com/vaadin/tests/rpclogger/RPCLoggerUI.java | 21 +- .../serialization/ChangeStateWhenReattaching.java | 6 +- .../tests/serialization/DelegateToWidgetTest.java | 6 +- .../DelegateWithoutStateClassTest.java | 6 +- .../tests/serialization/EncodeResultDisplay.java | 9 +- .../tests/serialization/GenericWidgetHandling.java | 6 +- .../tests/serialization/LegacySerializerUI.java | 13 +- .../com/vaadin/tests/serialization/NoLayout.java | 10 +- .../serialization/SerializerNamespaceTest.java | 6 +- .../vaadin/tests/serialization/SerializerTest.java | 118 ++- .../com/vaadin/tests/themes/CSSInjectTest.java | 8 +- .../tests/themes/LegacyComponentThemeChange.java | 3 +- .../vaadin/tests/themes/ThemeChangeFavicon.java | 6 +- .../vaadin/tests/themes/ThemeChangeOnTheFly.java | 12 +- .../tests/themes/valo/AlignTopIconInButton.java | 8 +- .../vaadin/tests/themes/valo/ButtonsAndLinks.java | 20 +- .../com/vaadin/tests/themes/valo/CalendarTest.java | 33 +- .../com/vaadin/tests/themes/valo/CheckBoxes.java | 14 +- .../tests/themes/valo/CollapsibleTableColumn.java | 8 +- .../com/vaadin/tests/themes/valo/ColorPickers.java | 6 +- .../com/vaadin/tests/themes/valo/ComboBoxes.java | 6 +- .../com/vaadin/tests/themes/valo/CommonParts.java | 86 +- .../tests/themes/valo/ContrastFontColor.java | 8 +- .../com/vaadin/tests/themes/valo/DateFields.java | 13 +- .../vaadin/tests/themes/valo/DisabledLabel.java | 8 +- .../com/vaadin/tests/themes/valo/Dragging.java | 42 +- .../tests/themes/valo/FormLayoutInsideTable.java | 6 +- .../java/com/vaadin/tests/themes/valo/Forms.java | 18 +- .../vaadin/tests/themes/valo/ImmediateUpload.java | 14 +- .../java/com/vaadin/tests/themes/valo/Labels.java | 8 +- .../com/vaadin/tests/themes/valo/MenuBars.java | 10 +- .../vaadin/tests/themes/valo/NativeSelects.java | 6 +- .../tests/themes/valo/NotificationStyle.java | 8 +- .../java/com/vaadin/tests/themes/valo/Panels.java | 6 +- .../com/vaadin/tests/themes/valo/PopupViews.java | 18 +- .../vaadin/tests/themes/valo/ResponsiveStyles.java | 6 +- .../tests/themes/valo/ResponsiveStylesDesign.java | 6 +- .../java/com/vaadin/tests/themes/valo/Sliders.java | 6 +- .../com/vaadin/tests/themes/valo/SplitPanels.java | 6 +- .../vaadin/tests/themes/valo/StringGenerator.java | 6 +- .../tests/themes/valo/TableWithEmptyCaption.java | 6 +- .../com/vaadin/tests/themes/valo/Tabsheets.java | 14 +- .../com/vaadin/tests/themes/valo/TestIcon.java | 3 +- .../vaadin/tests/themes/valo/TextFieldBevel.java | 8 +- .../com/vaadin/tests/themes/valo/TextFields.java | 6 +- .../java/com/vaadin/tests/themes/valo/Trees.java | 6 +- .../tests/themes/valo/ValoDefaultCaptionWidth.java | 8 +- .../vaadin/tests/themes/valo/ValoMenuLayout.java | 8 +- .../com/vaadin/tests/themes/valo/ValoThemeUI.java | 60 +- .../java/com/vaadin/tests/tickets/Ticket1230.java | 8 +- .../java/com/vaadin/tests/tickets/Ticket1245.java | 2 +- .../java/com/vaadin/tests/tickets/Ticket1365.java | 4 +- .../java/com/vaadin/tests/tickets/Ticket1397.java | 10 +- .../java/com/vaadin/tests/tickets/Ticket1435.java | 11 +- .../com/vaadin/tests/tickets/Ticket1506_Panel.java | 5 +- .../tests/tickets/Ticket1506_TestContainer.java | 16 +- .../tests/tickets/Ticket1506_TestContainer2.java | 8 +- .../java/com/vaadin/tests/tickets/Ticket1589.java | 2 +- .../java/com/vaadin/tests/tickets/Ticket1598.java | 12 +- .../java/com/vaadin/tests/tickets/Ticket1632.java | 3 +- .../java/com/vaadin/tests/tickets/Ticket1659.java | 11 +- .../java/com/vaadin/tests/tickets/Ticket1663.java | 7 +- .../java/com/vaadin/tests/tickets/Ticket1710.java | 61 +- .../java/com/vaadin/tests/tickets/Ticket1737.java | 7 +- .../java/com/vaadin/tests/tickets/Ticket1804.java | 23 +- .../java/com/vaadin/tests/tickets/Ticket1806.java | 8 +- .../tests/tickets/Ticket1834PanelScrolling.java | 10 +- .../java/com/vaadin/tests/tickets/Ticket1857.java | 9 +- .../java/com/vaadin/tests/tickets/Ticket1878.java | 12 +- .../java/com/vaadin/tests/tickets/Ticket1900.java | 16 +- .../java/com/vaadin/tests/tickets/Ticket1921.java | 4 +- .../java/com/vaadin/tests/tickets/Ticket1923.java | 6 +- .../java/com/vaadin/tests/tickets/Ticket1939.java | 4 +- .../java/com/vaadin/tests/tickets/Ticket1966.java | 6 +- .../java/com/vaadin/tests/tickets/Ticket1969.java | 3 +- .../java/com/vaadin/tests/tickets/Ticket1970.java | 18 +- .../java/com/vaadin/tests/tickets/Ticket1975.java | 4 +- .../java/com/vaadin/tests/tickets/Ticket1982.java | 4 +- .../java/com/vaadin/tests/tickets/Ticket1983.java | 35 +- .../java/com/vaadin/tests/tickets/Ticket1995.java | 8 +- .../java/com/vaadin/tests/tickets/Ticket20.java | 14 +- .../java/com/vaadin/tests/tickets/Ticket2009.java | 12 +- .../java/com/vaadin/tests/tickets/Ticket2014.java | 4 +- .../java/com/vaadin/tests/tickets/Ticket2021.java | 4 +- .../java/com/vaadin/tests/tickets/Ticket2023.java | 4 +- .../java/com/vaadin/tests/tickets/Ticket2024.java | 7 +- .../java/com/vaadin/tests/tickets/Ticket2038.java | 9 +- .../java/com/vaadin/tests/tickets/Ticket2048.java | 7 +- .../java/com/vaadin/tests/tickets/Ticket2053.java | 28 +- .../java/com/vaadin/tests/tickets/Ticket2061.java | 11 +- .../java/com/vaadin/tests/tickets/Ticket2061b.java | 11 +- .../java/com/vaadin/tests/tickets/Ticket2061c.java | 11 +- .../java/com/vaadin/tests/tickets/Ticket2083.java | 3 +- .../java/com/vaadin/tests/tickets/Ticket2095.java | 3 +- .../java/com/vaadin/tests/tickets/Ticket2103.java | 4 +- .../java/com/vaadin/tests/tickets/Ticket2104.java | 42 +- .../java/com/vaadin/tests/tickets/Ticket2106.java | 5 +- .../java/com/vaadin/tests/tickets/Ticket2107.java | 12 +- .../java/com/vaadin/tests/tickets/Ticket2117.java | 9 +- .../java/com/vaadin/tests/tickets/Ticket2119.java | 17 +- .../java/com/vaadin/tests/tickets/Ticket2125.java | 4 +- .../java/com/vaadin/tests/tickets/Ticket2126.java | 4 +- .../java/com/vaadin/tests/tickets/Ticket2179.java | 4 +- .../java/com/vaadin/tests/tickets/Ticket2181.java | 9 +- .../java/com/vaadin/tests/tickets/Ticket2186.java | 2 +- .../java/com/vaadin/tests/tickets/Ticket2232.java | 6 +- .../java/com/vaadin/tests/tickets/Ticket2242.java | 12 +- .../java/com/vaadin/tests/tickets/Ticket2244.java | 16 +- .../java/com/vaadin/tests/tickets/Ticket2292.java | 4 +- .../java/com/vaadin/tests/tickets/Ticket2297.java | 16 +- .../java/com/vaadin/tests/tickets/Ticket2303.java | 4 +- .../java/com/vaadin/tests/tickets/Ticket2339.java | 11 +- .../java/com/vaadin/tests/tickets/Ticket2344.java | 3 +- .../java/com/vaadin/tests/tickets/Ticket2365.java | 4 +- .../java/com/vaadin/tests/tickets/Ticket2411.java | 4 +- .../java/com/vaadin/tests/tickets/Ticket2426.java | 7 +- .../java/com/vaadin/tests/tickets/Ticket2431.java | 3 +- .../java/com/vaadin/tests/tickets/Ticket2742.java | 6 +- .../java/com/vaadin/tests/tickets/Ticket2998.java | 4 +- .../java/com/vaadin/tests/tickets/Ticket34.java | 4 +- .../java/com/vaadin/tests/tickets/Ticket5952.java | 12 +- .../java/com/vaadin/tests/tickets/Ticket6002.java | 4 +- .../java/com/vaadin/tests/tickets/Ticket677.java | 12 +- .../java/com/vaadin/tests/tickets/Ticket695.java | 3 +- .../java/com/vaadin/tests/tickets/Ticket736.java | 8 +- .../java/com/vaadin/tests/tickets/Ticket846.java | 4 +- .../tooltip/AdjacentElementsWithTooltips.java | 14 +- .../tests/tooltip/DragAndDropWrapperTooltips.java | 12 +- .../com/vaadin/tests/tooltip/MenuBarTooltip.java | 6 +- .../com/vaadin/tests/tooltip/SliderTooltip.java | 6 +- .../vaadin/tests/tooltip/TooltipConfiguration.java | 7 +- .../vaadin/tests/tooltip/TooltipWidthUpdating.java | 5 +- .../FragmentHandlingAndAsynchUIUpdate.java | 13 +- .../java/com/vaadin/tests/util/LargeContainer.java | 4 +- .../java/com/vaadin/tests/util/LogPrintWriter.java | 2 +- .../main/java/com/vaadin/tests/util/Person.java | 2 +- .../com/vaadin/tests/util/PersonContainer.java | 14 +- .../com/vaadin/tests/util/ResizeTerrorizer.java | 10 +- .../src/main/java/com/vaadin/tests/util/Role.java | 2 +- .../com/vaadin/tests/util/SampleDirectory.java | 19 +- .../com/vaadin/tests/util/TestDataGenerator.java | 10 +- .../main/java/com/vaadin/tests/util/TestUtils.java | 93 +- .../src/main/java/com/vaadin/tests/util/User.java | 4 +- .../tests/vaadincontext/BootstrapModifyUI.java | 9 +- .../validation/EmptyFieldErrorIndicators.java | 7 +- .../tests/validation/FieldErrorIndication.java | 6 +- .../vaadin/tests/validation/TestValidators.java | 20 +- .../vaadin/tests/widgetset/TestingWidgetSet.java | 6 +- .../client/AbstractSuperclassForBean.java | 6 +- .../client/BasicExtensionTestConnector.java | 6 +- .../client/BeanWithAbstractSuperclass.java | 6 +- .../widgetset/client/ClientRpcClassConnector.java | 6 +- .../widgetset/client/ClientRpcClassWidget.java | 6 +- .../tests/widgetset/client/ComplexTestBean.java | 12 +- .../tests/widgetset/client/CustomUIConnector.java | 6 +- .../widgetset/client/CustomUIConnectorRpc.java | 6 +- .../tests/widgetset/client/DelegateConnector.java | 6 +- .../tests/widgetset/client/DelegateState.java | 6 +- .../tests/widgetset/client/DelegateWidget.java | 6 +- .../client/DelegateWithoutStateClassConnector.java | 6 +- .../widgetset/client/DummyLabelConnector.java | 8 +- .../client/EncoderResultDisplayConnector.java | 14 +- .../tests/widgetset/client/GenericWidget.java | 6 +- .../widgetset/client/GenericWidgetConnector.java | 6 +- .../tests/widgetset/client/GenericWidgetState.java | 6 +- .../widgetset/client/IdTestLabelConnector.java | 2 +- .../client/IntermediateReplaceConnector.java | 11 +- .../vaadin/tests/widgetset/client/LabelState.java | 8 +- .../widgetset/client/LayoutDetectorConnector.java | 13 +- .../client/LayoutDuringStateUpdateConnector.java | 10 +- .../LayoutMemoryUsageIE8ExtensionConnector.java | 10 +- .../client/LegacySerializerConnector.java | 6 +- .../MissingFromDefaultWidgetsetConnector.java | 15 +- .../client/MockApplicationConnection.java | 15 +- .../client/MockServerCommunicationHandler.java | 6 +- .../widgetset/client/MockServerMessageHandler.java | 6 +- .../vaadin/tests/widgetset/client/NoLayoutRpc.java | 6 +- .../client/ProfilerCompilationCanary.java | 6 +- .../tests/widgetset/client/ReplacedConnector.java | 6 +- .../tests/widgetset/client/ReplacingConnector.java | 6 +- .../client/ResizeTerrorizerControlConnector.java | 26 +- .../widgetset/client/RoundTripTesterConnector.java | 6 +- .../tests/widgetset/client/RoundTripTesterRpc.java | 6 +- .../widgetset/client/RunOverflowFixConnector.java | 28 +- .../client/ScrollableGridLayoutConnector.java | 9 +- .../widgetset/client/SerializerTestConnector.java | 129 +-- .../tests/widgetset/client/SerializerTestRpc.java | 10 +- .../widgetset/client/SerializerTestState.java | 6 +- .../tests/widgetset/client/SimpleTestBean.java | 6 +- .../widgetset/client/TestWidgetConnector.java | 10 +- .../client/TestingWidgetsetEntryPoint.java | 6 +- .../UseStateFromHierachyChangeConnector.java | 10 +- .../UseStateFromHierachyChangeConnectorState.java | 10 +- .../tests/widgetset/client/VExtendedTextArea.java | 6 +- .../tests/widgetset/client/VIdTestLabel.java | 2 +- .../widgetset/client/WidgetUtilTestConnector.java | 6 +- .../widgetset/client/WidgetUtilTestWidget.java | 6 +- .../widgetset/client/csrf/CsrfButtonConnector.java | 4 +- .../client/dd/SpacebarPannerConnector.java | 4 +- .../BrowserContextMenuExtensionConnector.java | 10 +- .../grid/EscalatorBasicClientFeaturesWidget.java | 102 +- .../widgetset/client/grid/EscalatorProxy.java | 16 +- .../client/grid/GridBasicClientFeaturesWidget.java | 218 ++-- .../grid/GridCellFocusOnResetSizeWidget.java | 10 +- .../client/grid/GridClickExtensionConnector.java | 10 +- .../grid/GridClientColumnRendererConnector.java | 35 +- .../client/grid/GridClientDataSourcesWidget.java | 28 +- .../grid/GridColumnAutoWidthClientWidget.java | 10 +- .../client/grid/GridDataChangeHandlerWidget.java | 18 +- .../client/grid/GridDefaultTextRendererWidget.java | 10 +- .../client/grid/GridHeightByRowOnInitWidget.java | 4 +- .../client/grid/GridRendererChangeWidget.java | 10 +- .../client/grid/IntArrayRendererConnector.java | 9 +- .../client/grid/MySelectionModelConnector.java | 6 +- .../client/grid/PojoRendererConnector.java | 10 +- .../client/grid/PureGWTTestApplication.java | 32 +- .../client/grid/RowAwareRendererConnector.java | 9 +- .../client/gwtrpc/GwtRpcButtonConnector.java | 4 +- .../client/gwtrpc/GwtRpcServiceTestAsync.java | 3 +- .../client/helloworldfeature/GreetAgainRpc.java | 6 +- .../HelloWorldExtensionConnector.java | 6 +- .../client/helloworldfeature/HelloWorldRpc.java | 6 +- .../client/helloworldfeature/HelloWorldState.java | 6 +- .../minitutorials/v7a2/ComponentInStateState.java | 6 +- .../v7a2/ComponentInStateStateConnector.java | 11 +- .../minitutorials/v7a2/MyComponentConnector.java | 4 +- .../minitutorials/v7a2/MyComponentWidget.java | 6 +- .../v7a2/ResourceInStateConnector.java | 6 +- .../v7a2/WidgetContainerConnector.java | 7 +- .../minitutorials/v7a3/ClientSideModule.java | 6 +- .../minitutorials/v7b1/CapsLockWarningRpc.java | 6 +- .../v7b1/CapsLockWarningWithRpcConnector.java | 3 +- .../rebind/TestWidgetRegistryGenerator.java | 9 +- .../tests/widgetset/server/ClientRpcClass.java | 6 +- .../widgetset/server/ClientRpcClassComponent.java | 6 +- .../server/DelegateToWidgetComponent.java | 6 +- .../server/DelegateWithoutStateClassComponent.java | 6 +- .../vaadin/tests/widgetset/server/DummyLabel.java | 8 +- .../widgetset/server/GenericWidgetComponent.java | 6 +- .../vaadin/tests/widgetset/server/IdTestLabel.java | 2 +- .../tests/widgetset/server/LayoutDetector.java | 6 +- .../MissingFromDefaultWidgetsetComponent.java | 6 +- .../tests/widgetset/server/ReplaceComponent.java | 6 +- .../tests/widgetset/server/ReplaceComponentUI.java | 6 +- .../tests/widgetset/server/RoundTripTester.java | 6 +- .../widgetset/server/ScrollableGridLayout.java | 6 +- .../widgetset/server/SerializerTestExtension.java | 6 +- .../widgetset/server/TestWidgetComponent.java | 14 +- .../server/UseStateFromHierachyComponent.java | 10 +- .../tests/widgetset/server/WidgetUtilUI.java | 6 +- .../server/csrf/ui/AbstractCsrfTokenUI.java | 8 +- .../server/csrf/ui/CsrfTokenDisabled.java | 3 +- .../widgetset/server/csrf/ui/CsrfTokenEnabled.java | 3 +- .../server/grid/GridClientColumnRenderers.java | 4 +- .../widgetset/server/gwtrpc/GwtRpcServletTest.java | 4 +- .../com/vaadin/tests/CurrentTimeMillisTest.java | 22 +- .../com/vaadin/tests/VerifyBrowserVersionTest.java | 4 +- .../com/vaadin/tests/VerifyJreVersionTest.java | 6 +- .../accessibility/WindowWaiAriaRolesTest.java | 11 +- .../application/CriticalNotificationsTest.java | 6 +- .../application/DeploymentConfigurationTest.java | 6 +- .../tests/application/DetachOldUIOnReloadTest.java | 19 +- .../tests/application/ErrorInUnloadEventTest.java | 6 +- .../application/MissingHierarchyDetectionTest.java | 14 +- .../PreserveWithExpiredHeartbeatTest.java | 9 +- .../application/ReconnectDialogThemeTest.java | 19 +- .../tests/application/ReconnectDialogUITest.java | 12 +- .../application/RefreshStatePreserveTest.java | 3 +- .../ResynchronizeAfterAsyncRemovalTest.java | 6 +- .../tests/application/ResynchronizeUITest.java | 13 +- .../tests/application/TimingInfoReportedTest.java | 6 +- .../application/VaadinSessionAttributeTest.java | 6 +- .../applicationcontext/CleanupBrokenUITest.java | 10 +- .../tests/applicationcontext/CloseSessionTest.java | 4 +- .../applicationcontext/RpcForClosedUITest.java | 4 +- .../CustomDeploymentConfTest.java | 6 +- .../DisableSendUrlAsParametersTest.java | 6 +- .../MultipleServletConfigurationTest.java | 9 +- .../applicationservlet/NoApplicationClassTest.java | 10 +- .../applicationservlet/SystemMessagesTest.java | 3 +- .../UIProviderInitParameterTest.java | 6 +- .../AbstractOrderedLayoutWithCaptionsTest.java | 20 +- .../tests/components/FileDownloaderUITest.java | 6 +- .../NoLayoutUpdateWhichNeedsLayoutTest.java | 6 +- .../com/vaadin/tests/components/OutOfSyncTest.java | 6 +- .../vaadin/tests/components/SaneErrorsTest.java | 16 +- .../tests/components/TooltipPositionTest.java | 16 +- .../components/UnknownComponentConnectorTest.java | 16 +- .../AbsoluteLayoutRelativeSizeContentTest.java | 8 +- .../ChangeHierarchyBeforeResponseTest.java | 6 +- .../abstractcomponent/ContextClickUITest.java | 10 +- .../abstractcomponent/PrimaryStyleTest.java | 14 +- .../ResponseWritingErrorHandlingTest.java | 6 +- .../EmbeddedWithNullSourceTest.java | 6 +- .../AbstractComponentStyleNameTest.java | 6 +- .../abstractfield/ShortcutAddAndRemoveTest.java | 6 +- .../abstractfield/ShortcutWhenBodyFocusedTest.java | 6 +- .../components/accordion/AccordionAddTabTest.java | 14 +- .../accordion/AccordionRemoveComponentTest.java | 8 +- .../accordion/AccordionRemoveTabTest.java | 20 +- .../components/accordion/AccordionTabIdsTest.java | 8 +- .../tests/components/button/ButtonClickTest.java | 12 +- .../components/button/ButtonKeyboardClickTest.java | 36 +- .../button/ButtonUndefinedWidthTest.java | 14 +- .../calendar/BeanItemContainerLongEventTest.java | 14 +- .../calendar/CalendarActionEventSourceTest.java | 26 +- .../calendar/CalendarBackwardForwardTest.java | 40 +- .../components/calendar/CalendarDisabledTest.java | 4 +- .../calendar/CalendarHtmlInEventsTest.java | 25 +- .../calendar/CalendarMonthViewDndEventTest.java | 18 +- .../calendar/CalendarNotificationsTest.java | 8 +- .../calendar/CalendarNotificationsTestIE.java | 18 +- .../components/calendar/CalendarReadOnlyTest.java | 19 +- .../calendar/CalendarRescheduleEventTest.java | 16 +- .../CalendarResizeOverlappingEventsTest.java | 35 +- ...hownNotCorrectlyWhenPartiallyOutOfViewTest.java | 18 +- .../calendar/CalendarVisibleHoursTest.java | 14 +- .../calendar/CalendarWeekSelectionTest.java | 3 +- .../calendar/DndCalendarTargetDetailsTest.java | 8 +- .../calendar/SetFirstVisibleHourOfDayTest.java | 34 +- .../components/checkbox/CheckBoxImmediateTest.java | 6 +- .../components/checkbox/CheckBoxNullValueTest.java | 13 +- .../components/checkbox/CheckBoxRpcCountTest.java | 6 +- .../checkbox/CheckboxContextClickTest.java | 6 +- .../colorpicker/ColorPickerInputFormatsTest.java | 14 +- .../colorpicker/DefaultCaptionWidthTest.java | 8 +- .../components/combobox/ComboBoxBorderTest.java | 6 +- .../components/combobox/ComboBoxClickIconTest.java | 8 +- .../ComboBoxCombinedWithEnterShortcutTest.java | 6 +- .../ComboBoxEmptyItemsKeyboardNavigationTest.java | 4 +- .../combobox/ComboBoxIdenticalItemsTest.java | 2 +- .../combobox/ComboBoxInputPromptTest.java | 6 +- .../ComboBoxItemAddingWithFocusListenerTest.java | 14 +- .../combobox/ComboBoxItemStyleGeneratorTest.java | 10 +- .../combobox/ComboBoxLargeIconsTest.java | 16 +- .../combobox/ComboBoxMouseSelectEnterTest.java | 6 +- .../combobox/ComboBoxNoTextInputTest.java | 3 +- .../combobox/ComboBoxOnSmallScreenTest.java | 12 +- .../combobox/ComboBoxPopupWhenBodyScrollsTest.java | 6 +- .../combobox/ComboBoxResetValueTest.java | 18 +- .../combobox/ComboBoxScrollingWithArrowsTest.java | 4 +- .../ComboBoxSelectingWithNewItemsAllowedTest.java | 6 +- .../ComboBoxSetNullWhenNewItemsAllowedTest.java | 10 +- .../components/combobox/ComboBoxSlowTest.java | 52 +- .../combobox/ComboBoxSuggestionPageLengthTest.java | 10 +- .../combobox/ComboBoxSuggestionPopupCloseTest.java | 7 +- ...ComboBoxSuggestionPopupWidthPercentageTest.java | 4 +- .../combobox/ComboBoxSuggestionPopupWidthTest.java | 3 +- .../combobox/ComboBoxValueInputTest.java | 18 +- ...electedValueBeyondTheFirstDropdownPageTest.java | 10 +- .../combobox/ComboboxMenuBarAutoopenTest.java | 12 +- .../combobox/ComboboxPageLengthZeroScrollTest.java | 11 +- .../combobox/ComboboxPopupScrollingTest.java | 10 +- .../combobox/ComboboxStyleChangeWidthTest.java | 8 +- .../components/combobox/CustomComboBoxElement.java | 6 +- .../combobox/FilteringTurkishLocaleTest.java | 6 +- .../customfield/CustomFieldSizeTest.java | 8 +- .../CustomLayoutWithMissingSlotTest.java | 6 +- .../CustomLayoutWithNullTemplateTest.java | 13 +- .../CustomLayoutWithoutTemplateTest.java | 13 +- .../customlayout/OverflowAutoFixTest.java | 8 +- .../components/datefield/AriaDisabledTest.java | 11 +- .../datefield/CustomDateFormatEEETest.java | 11 +- .../datefield/DateFieldChangeResolutionTest.java | 48 +- .../components/datefield/DateFieldCloseTest.java | 18 +- .../DateFieldDayResolutionOffsetTest.java | 4 +- .../datefield/DateFieldDiscardValueTest.java | 42 +- .../datefield/DateFieldFastForwardTest.java | 15 +- .../components/datefield/DateFieldIsValidTest.java | 4 +- .../datefield/DateFieldKeyboardInputTest.java | 6 +- .../DateFieldPopupClosingOnDetachTest.java | 6 +- .../datefield/DateFieldPopupClosingTest.java | 4 +- .../datefield/DateFieldPopupPositionTest.java | 8 +- .../datefield/DateFieldReadOnlyTest.java | 8 +- .../components/datefield/DateFieldTestTest.java | 6 +- ...ieldWhenChangingValueAndEnablingParentTest.java | 41 +- .../datefield/DateRangeWithSqlDateTest.java | 13 +- .../DefaultDateFieldPopupPositionTest.java | 22 +- .../datefield/DisabledDateFieldPopupTest.java | 10 +- .../datefield/DisabledInlineDateFieldTest.java | 14 +- .../datefield/DisabledParentLayoutTest.java | 16 +- .../components/datefield/LocaleChangeTest.java | 11 +- .../datefield/PopupClosingWithEscTest.java | 10 +- .../datefield/PopupDateFieldExtendedRangeTest.java | 265 ++--- .../datefield/PopupDateFieldInputPromptTest.java | 8 +- .../datefield/PopupDateFieldStatesTest.java | 4 +- .../PopupDateFieldValueChangeEventsTest.java | 18 +- .../datefield/ValoDateFieldPopupPositionTest.java | 16 +- .../DragAndDropFocusObtainTest.java | 8 +- .../DragAndDropRelativeWidthTest.java | 12 +- .../DragAndDropTextAreaTest.java | 16 +- .../draganddropwrapper/DragStartModesTest.java | 9 +- .../components/embedded/EmbeddedAltTextTest.java | 10 +- ...beddedClickListenerRelativeCoordinatesTest.java | 10 +- .../embedded/EmbeddedThemeResourceTest.java | 16 +- .../components/embedded/FlashIsVisibleTest.java | 10 +- .../tests/components/form/FormTooltipsTest.java | 16 +- .../formlayout/FormLayoutClickListenerTest.java | 8 +- .../formlayout/FormLayoutInVerticalLayoutTest.java | 12 +- .../formlayout/FormLayoutResizingTest.java | 14 +- .../formlayout/HtmlCaptionInFormLayoutTest.java | 14 +- .../components/formlayout/StylePrefixTest.java | 8 +- .../grid/AbstractGridColumnAutoWidthTest.java | 14 +- .../tests/components/grid/CustomRendererTest.java | 14 +- .../grid/GridAddAndRemoveDataOnInitTest.java | 6 +- .../tests/components/grid/GridAddRowTest.java | 6 +- .../grid/GridCellFocusOnResetSizeTest.java | 18 +- .../components/grid/GridCheckBoxDisplayTest.java | 10 +- .../grid/GridClientDataChangeHandlerTest.java | 6 +- .../tests/components/grid/GridClientRenderers.java | 26 +- .../tests/components/grid/GridColspansTest.java | 26 +- .../components/grid/GridColumnAutoExpandTest.java | 10 +- .../grid/GridColumnAutoWidthClientTest.java | 10 +- .../grid/GridColumnAutoWidthServerTest.java | 10 +- .../grid/GridColumnWidthRecalculationTest.java | 12 +- .../grid/GridColumnWidthsWithoutDataTest.java | 6 +- .../grid/GridCustomSelectionModelTest.java | 10 +- .../components/grid/GridDataSourceResetTest.java | 18 +- .../grid/GridDefaultSelectionModeTest.java | 14 +- .../components/grid/GridDetailsDetachTest.java | 6 +- .../grid/GridDetailsLayoutExpandTest.java | 13 +- .../components/grid/GridDetailsLocationTest.java | 34 +- .../components/grid/GridDetailsWidthTest.java | 12 +- .../grid/GridDisabledMultiselectTest.java | 9 +- .../components/grid/GridDisabledSideBarTest.java | 7 +- .../grid/GridDragSelectionWhileScrolledTest.java | 16 +- .../grid/GridEditingWithNoScrollBarsTest.java | 10 +- .../grid/GridEditorConverterNotFoundTest.java | 6 +- .../components/grid/GridEditorCustomFieldTest.java | 6 +- .../grid/GridEditorFrozenColumnsUITest.java | 11 +- .../components/grid/GridEditorMultiselectTest.java | 15 +- .../tests/components/grid/GridEditorUITest.java | 6 +- .../grid/GridExtensionCommunicationTest.java | 6 +- .../grid/GridGeneratedPropertiesTest.java | 30 +- .../grid/GridHeaderFooterComponentsTest.java | 34 +- .../grid/GridHeaderFormatChangeTest.java | 43 +- .../components/grid/GridHeaderStyleNamesTest.java | 14 +- .../tests/components/grid/GridHeightTest.java | 21 +- .../tests/components/grid/GridInTabSheetTest.java | 10 +- .../components/grid/GridInWindowResizeTest.java | 10 +- .../grid/GridInitiallyHiddenColumnsTest.java | 21 +- .../components/grid/GridItemSetChangeTest.java | 14 +- .../components/grid/GridLayoutDetailsRowTest.java | 13 +- .../grid/GridMultiSelectionOnInitTest.java | 6 +- .../grid/GridMultiSelectionScrollBarTest.java | 9 +- .../components/grid/GridRendererChangeTest.java | 6 +- .../components/grid/GridReplaceContainerTest.java | 6 +- .../components/grid/GridResizeAndScrollTest.java | 6 +- .../grid/GridResizeHiddenColumnTest.java | 6 +- .../components/grid/GridRowHeightChangeTest.java | 8 +- .../grid/GridScrollToLineWhileResizingTest.java | 6 +- .../components/grid/GridSelectAllCellTest.java | 9 +- .../components/grid/GridSidebarPositionTest.java | 30 +- .../components/grid/GridSingleColumnTest.java | 10 +- .../components/grid/GridSortIndicatorTest.java | 6 +- .../components/grid/GridSpacerDecoClipTest.java | 6 +- .../grid/GridSubPixelProblemWrappingTest.java | 6 +- .../components/grid/GridSwitchRenderersTest.java | 6 +- .../tests/components/grid/GridThemeChangeTest.java | 6 +- .../tests/components/grid/GridThemeUITest.java | 6 +- .../grid/GridWidgetRendererChangeTest.java | 10 +- .../components/grid/GridWidthIncreaseTest.java | 10 +- .../grid/GridWithBrokenRendererTest.java | 6 +- .../components/grid/GridWithLabelEditorTest.java | 6 +- .../components/grid/GridWithoutRendererTest.java | 10 +- .../components/grid/InitialFrozenColumnsTest.java | 6 +- .../components/grid/JavaScriptRenderersTest.java | 10 +- .../tests/components/grid/NullHeadersTest.java | 9 +- .../tests/components/grid/NullRenderersTest.java | 6 +- .../grid/ProgrammaticEditorControlTest.java | 10 +- .../components/grid/SelectDuringInitTest.java | 6 +- .../components/grid/SortableHeaderStylesTest.java | 6 +- .../tests/components/grid/WidgetRenderersTest.java | 50 +- .../EscalatorBasicClientFeaturesTest.java | 21 +- .../basicfeatures/GridBasicClientFeaturesTest.java | 21 +- .../grid/basicfeatures/GridBasicFeaturesTest.java | 73 +- .../basicfeatures/GridClientDataSourcesTest.java | 31 +- .../GridClientHeightByRowOnInitTest.java | 5 +- .../grid/basicfeatures/GridColumnHidingTest.java | 124 +-- .../grid/basicfeatures/GridColumnReorderTest.java | 52 +- .../basicfeatures/GridDefaultTextRendererTest.java | 18 +- .../GridDescriptionGeneratorTest.java | 9 +- .../basicfeatures/GridHeightByRowOnInitTest.java | 5 +- .../basicfeatures/GridSortingIndicatorsTest.java | 6 +- .../client/DisabledGridClientTest.java | 6 +- .../client/GridCellStyleGeneratorTest.java | 48 +- .../client/GridClientColumnPropertiesTest.java | 29 +- .../client/GridClientContextMenuEventTest.java | 21 +- .../client/GridClientKeyEventsTest.java | 9 +- .../client/GridClientSelectionTest.java | 25 +- .../client/GridClientStructureTest.java | 10 +- .../client/GridDetailsClientTest.java | 26 +- .../basicfeatures/client/GridEditorClientTest.java | 49 +- .../grid/basicfeatures/client/GridFooterTest.java | 17 +- .../grid/basicfeatures/client/GridHeaderTest.java | 9 +- .../client/GridRowHandleRefreshTest.java | 18 +- .../client/GridSidebarContentTest.java | 18 +- .../client/GridStaticSectionTest.java | 17 +- .../grid/basicfeatures/client/GridStylingTest.java | 29 +- .../basicfeatures/element/CustomGridElement.java | 8 +- .../escalator/EscalatorBasicsTest.java | 6 +- .../escalator/EscalatorColspanTest.java | 6 +- .../escalator/EscalatorColumnFreezingTest.java | 14 +- .../escalator/EscalatorRemoveAndAddRowsTest.java | 10 +- .../escalator/EscalatorRowColumnTest.java | 6 +- .../escalator/EscalatorScrollTest.java | 8 +- .../escalator/EscalatorSpacerTest.java | 69 +- .../escalator/EscalatorUpdaterUiTest.java | 6 +- .../basicfeatures/server/DisabledGridTest.java | 6 +- .../server/GridCellFocusAdjustmentTest.java | 26 +- .../server/GridCellStyleGeneratorTest.java | 42 +- .../server/GridClearContainerTest.java | 20 +- .../server/GridColumnMaxWidthTest.java | 6 +- .../server/GridColumnReorderTest.java | 43 +- .../basicfeatures/server/GridColumnResizeTest.java | 14 +- .../server/GridColumnVisibilityTest.java | 41 +- .../server/GridDetailsServerTest.java | 42 +- .../server/GridEditorBufferedTest.java | 40 +- .../grid/basicfeatures/server/GridEditorTest.java | 12 +- .../server/GridEditorUnbufferedTest.java | 34 +- .../grid/basicfeatures/server/GridFocusTest.java | 12 +- .../basicfeatures/server/GridItemClickTest.java | 9 +- .../server/GridKeyboardNavigationTest.java | 80 +- .../basicfeatures/server/GridMultiSortingTest.java | 11 +- .../basicfeatures/server/GridRowAddRemoveTest.java | 6 +- .../grid/basicfeatures/server/GridScrollTest.java | 10 +- .../basicfeatures/server/GridSelectionTest.java | 106 +- .../basicfeatures/server/GridSidebarThemeTest.java | 6 +- .../grid/basicfeatures/server/GridSortingTest.java | 40 +- .../server/GridStaticSectionComponentTest.java | 10 +- .../basicfeatures/server/GridStructureTest.java | 64 +- .../basicfeatures/server/LoadingIndicatorTest.java | 14 +- .../gridlayout/ComponentAlignmentsTest.java | 8 +- .../gridlayout/GridLayoutAlignmentsTest.java | 6 +- .../components/gridlayout/GridLayoutBaseTest.java | 3 +- .../gridlayout/GridLayoutCaptionAlignmentTest.java | 6 +- .../gridlayout/GridLayoutCellSizesUITest.java | 6 +- .../GridLayoutExpandWithManyRowsTest.java | 4 +- .../gridlayout/GridLayoutExtraSpacingTest.java | 13 +- .../GridLayoutFocusOrderAfterShowChildTest.java | 6 +- .../GridLayoutFractionalSizeAndAlignmentTest.java | 6 +- .../gridlayout/GridLayoutScrollPositionTest.java | 6 +- ...eComponentsFromGridLayoutToInnerLayoutTest.java | 4 +- .../gridlayout/UniformGridLayoutUITest.java | 6 +- .../BasicJavaScriptComponentTest.java | 10 +- .../JavaScriptNoLayoutHandlingUITest.java | 6 +- .../JavaScriptPreloadingTest.java | 14 +- .../JavaScriptResizeListenerTest.java | 6 +- .../tests/components/label/LabelModesTest.java | 6 +- .../tests/components/label/LabelTooltipTest.java | 18 +- ...EmptySpaceOnPageAfterExpandedComponentTest.java | 24 +- .../listselect/ListSelectAddRemoveItemsTest.java | 10 +- .../listselect/ListSelectNoDomRebuildTest.java | 6 +- .../ListSelectPushSelectionChangesTest.java | 17 +- .../menubar/MenuBarClickOpenedMenuTest.java | 11 +- .../menubar/MenuBarNavigationMouseTest.java | 4 +- .../menubar/MenuBarSubmenusClosingValoTest.java | 4 +- .../menubar/MenuBarTooltipsNearEdgeTest.java | 12 +- .../menubar/MenuBarsWithNestingTest.java | 16 +- .../menubar/MenuItemStyleRemovedTest.java | 4 +- .../tests/components/menubar/MenuTooltipTest.java | 12 +- .../menubar/SpaceMenuBarNavigationTest.java | 4 +- .../nativebutton/NativeButtonClickTest.java | 10 +- .../nativebutton/NativeButtonIconAndTextTest.java | 8 +- ...tiveSelectsAndChromeKeyboardNavigationTest.java | 10 +- .../NativeSelectsFocusAndBlurListenerTests.java | 6 +- .../MiddleNotificationPositionTest.java | 24 +- .../notification/NotificationDelayTest.java | 8 +- .../notification/NotificationsWaiAriaTest.java | 39 +- .../optiongroup/ReadOnlyOptionGroupTest.java | 13 +- .../components/orderedlayout/CaptionLeakTest.java | 11 +- .../orderedlayout/ErrorIndicatorTest.java | 6 +- ...ontalLayoutFullsizeContentWithErrorMsgTest.java | 10 +- .../NestedLayoutCaptionHoverTest.java | 10 +- .../OrderedLayoutInfiniteLayoutPassesTest.java | 6 +- .../components/orderedlayout/SpacingLeakTest.java | 11 +- .../TooltipOnRequiredIndicatorTest.java | 14 +- .../VerticalLayoutFocusWithDOMChangesTest.java | 14 +- .../tests/components/page/PageTitleTest.java | 6 +- .../components/panel/PanelChangeContentsTest.java | 25 +- .../panel/PanelRemoveShortcutListenerTest.java | 13 +- .../panel/UndefinedSizeScrollbarsTest.java | 6 +- .../popupview/PopupViewAndFragmentTest.java | 6 +- .../components/popupview/PopupViewCaptionTest.java | 8 +- .../popupview/PopupViewResizeWhileOpenTest.java | 8 +- .../PopupViewShortcutActionHandlerTest.java | 12 +- .../popupview/PopupViewWithExtensionTest.java | 8 +- .../ProgressBarStaticReindeerTest.java | 6 +- .../ProgressBarStaticRunoTest.java | 6 +- .../RichTextAreaRelativeHeightResizeTest.java | 18 +- .../tests/components/select/EnumSelectTest.java | 10 +- .../components/select/SelectWithIntegersTest.java | 14 +- .../components/slider/HiddenSliderHandleTest.java | 6 +- .../tests/components/slider/SliderDisableTest.java | 9 +- .../components/slider/SliderFeedbackTest.java | 10 +- .../tests/components/slider/SliderResizeTest.java | 6 +- .../splitpanel/GridLayoutWithCheckboxTest.java | 6 +- .../splitpanel/HorizontalSplitPanelHeightTest.java | 19 +- .../SplitPanelDuplicateStyleNameTest.java | 8 +- .../splitpanel/SplitPanelMoveComponentTest.java | 24 +- .../splitpanel/SplitPanelStyleLeakTest.java | 6 +- .../SplitPanelWithMinimumAndMaximumTest.java | 69 +- .../splitpanel/SplitPositionChangeTest.java | 23 +- .../table/AddSelectionToRemovedRangeTest.java | 14 +- .../components/table/AsyncPushUpdatesTest.java | 8 +- .../ColumnCollapsingAndColumnExpansionTest.java | 6 +- .../table/ColumnReorderingWithManyColumnsTest.java | 4 +- ...thsAfterChangeTableColumnsCountOrOrderTest.java | 17 +- .../components/table/ContainerSizeChangeTest.java | 8 +- .../components/table/ContextMenuSizeTest.java | 8 +- .../components/table/CtrlShiftMultiselectTest.java | 9 +- .../tests/components/table/CustomTableElement.java | 18 +- .../components/table/DisabledSortingTableTest.java | 4 +- .../tests/components/table/DndEmptyTableTest.java | 8 +- .../table/DndTableTargetDetailsTest.java | 12 +- .../components/table/EditableModeChangeTest.java | 22 +- .../tests/components/table/EmptyTableTest.java | 6 +- ...andingContainerVisibleRowRaceConditionTest.java | 18 +- .../components/table/FocusOnSelectedItemTest.java | 14 +- .../tests/components/table/FooterClickTest.java | 8 +- .../vaadin/tests/components/table/FooterTest.java | 12 +- .../tests/components/table/HeaderClickTest.java | 8 +- .../HeaderFooterClickLeftRightMiddleTest.java | 8 +- .../table/HeaderPositionWhenSortingTest.java | 8 +- .../table/HeaderRightClickAfterDragTest.java | 8 +- .../components/table/HeaderSyncOnScrollTest.java | 8 +- .../table/HeaderUpdateWhenNoRowsTest.java | 8 +- .../components/table/ItemClickEventsTest.java | 6 +- .../table/ItemClickEventsTestWithShiftOrCtrl.java | 6 +- .../LabelEmbeddedClickThroughForTableTest.java | 14 +- .../components/table/LeftColumnAlignmentTest.java | 20 +- .../components/table/LongMultiselectTest.java | 4 +- .../components/table/MemoryLeakTableTest.java | 8 +- .../components/table/OnlyCollapsibleInMenu.java | 6 +- .../tests/components/table/ReloadWidgetsTest.java | 4 +- .../table/SelectAllConstantViewportTest.java | 10 +- .../table/SelectAllRowsShiftFirstTest.java | 8 +- .../tests/components/table/SelectAllRowsTest.java | 8 +- .../table/SetCurrentPageFirstItemIndexTest.java | 8 +- .../SetPageFirstItemLoadsNeededRowsOnlyTest.java | 12 +- .../components/table/SortLabelsInTableTest.java | 8 +- .../components/table/SortableHeaderStylesTest.java | 6 +- .../table/TableAfterRemovingExpandRatiosTest.java | 28 +- .../tests/components/table/TableBlurFocusTest.java | 6 +- .../table/TableCacheMinimizingOnFetchRowsTest.java | 6 +- .../table/TableChildMeasurementHintTest.java | 6 +- .../TableClickAndDragOnIconAndComponentsTest.java | 12 +- .../table/TableColumnAddAndResizeTest.java | 10 +- .../table/TableColumnResizeContentsWidthTest.java | 16 +- .../table/TableColumnWidthsAndSortingTest.java | 6 +- .../components/table/TableDragColumnTest.java | 31 +- .../table/TableDropIndicatorValoTest.java | 6 +- .../table/TableInIframeRowClickScrollJumpTest.java | 17 +- .../table/TableItemDescriptionGeneratorUITest.java | 8 +- .../TableMatchesMouseDownMouseUpElementTest.java | 12 +- .../table/TableMoveFocusWithSelectionTest.java | 20 +- .../table/TableNavigationPageDownTest.java | 20 +- .../table/TableParentEnabledStateChangeTest.java | 6 +- ...ableRemovedQuicklySendsInvalidRpcCallsTest.java | 22 +- ...RepairsScrollPositionOnReAddingAllRowsTest.java | 12 +- .../table/TableRequiredIndicatorTest.java | 12 +- .../components/table/TableRowHeight2Test.java | 8 +- .../table/TableRowScrolledBottomTest.java | 12 +- .../table/TableScrollAfterAddRowTest.java | 10 +- .../table/TableScrollUpOnSelectTest.java | 12 +- .../table/TableScrollingWithSQLContainerTest.java | 6 +- .../components/table/TableSizeInTabsheetTest.java | 10 +- .../table/TableSortingIndicatorTest.java | 8 +- .../table/TableToggleColumnVisibilityTest.java | 32 +- .../TableToggleColumnVisibilityWidthTest.java | 12 +- .../components/table/TableTooManyColumnsTest.java | 10 +- .../table/TableVisibleColumnsUpdateTest.java | 8 +- .../components/table/TableWidthItemRemoveTest.java | 20 +- ...eWithContainerRequiringEqualsForItemIdTest.java | 16 +- .../components/table/TableWithPollingTest.java | 10 +- .../table/TextFieldRelativeWidthTest.java | 8 +- .../table/TextFieldValueGoesMissingTest.java | 8 +- .../table/UnnecessaryScrollbarWhenZoomingTest.java | 19 +- .../table/UpdateTableWhenUnfocusedTest.java | 6 +- .../components/tabsheet/EmptyTabSheetTest.java | 10 +- .../tabsheet/FirstTabNotVisibleInTabsheetTest.java | 4 +- ...rstTabNotVisibleWhenTabsheetNotClippedTest.java | 32 +- .../components/tabsheet/HtmlInTabCaptionTest.java | 6 +- .../tabsheet/NewSelectionAfterTabRemoveTest.java | 24 +- .../components/tabsheet/PreventTabChangeTest.java | 20 +- .../tests/components/tabsheet/TabBarWidthTest.java | 6 +- .../tabsheet/TabKeyboardNavigationTest.java | 4 +- .../tabsheet/TabSelectionRevertedByServerTest.java | 8 +- .../components/tabsheet/TabSheetCloseTest.java | 8 +- .../tabsheet/TabSheetErrorTooltipTest.java | 19 +- .../tabsheet/TabSheetFocusedTabTest.java | 13 +- .../components/tabsheet/TabSheetFocusingTest.java | 11 +- .../tabsheet/TabSheetInDisabledParentTest.java | 16 +- .../tabsheet/TabSheetInSplitPanelTest.java | 10 +- .../tabsheet/TabSheetScrollOnTabCloseTest.java | 22 +- .../components/tabsheet/TabSpaceNotScrollTest.java | 12 +- .../TabsheetNotEnoughHorizontalSpaceTest.java | 10 +- .../tabsheet/TabsheetScrollIntoViewTest.java | 6 +- .../components/tabsheet/TabsheetScrollingTest.java | 13 +- .../components/tabsheet/VetoTabChangeTest.java | 6 +- .../textarea/TextAreaSizeResettedTest.java | 5 +- .../textfield/AutomaticImmediateTest.java | 24 +- .../components/textfield/EnumTextFieldTest.java | 6 +- .../textfield/InputPromptGetTextTest.java | 18 +- .../textfield/RequiredTextFieldTest.java | 8 +- .../textfield/TextFieldEmptyingPromptTest.java | 6 +- ...ieldTruncatesUnderscoresInModalDialogsTest.java | 4 +- .../components/tree/DndTreeTargetDetailsTest.java | 8 +- .../tree/TreeContextMenuAndIconsTest.java | 10 +- .../tree/TreeHtmlContentAllowedTest.java | 10 +- .../tree/TreeItemClickListeningTest.java | 13 +- .../components/tree/TreeItemDoubleClickTest.java | 13 +- .../TreeItemSelectionWithoutImmediateTest.java | 19 +- .../tree/TreeKeyboardNavigationToNoneTest.java | 8 +- .../tree/TreeScrollingOnRightClickTest.java | 16 +- .../treetable/DisappearingComponentsTest.java | 12 +- .../treetable/MinimalWidthColumnsTest.java | 6 +- .../TreeTableContainerHierarchicalWrapperTest.java | 19 +- .../TreeTableItemDescriptionGeneratorUITest.java | 8 +- .../treetable/TreeTableOutOfSyncTest.java | 21 +- .../TreeTablePartialUpdatesPageLength0Test.java | 37 +- .../treetable/TreeTablePartialUpdatesTest.java | 86 +- .../treetable/TreeTableRowGeneratorTest.java | 6 +- .../treetable/TreeTableRowHeaderModeTest.java | 11 +- .../treetable/TreeTableRowIconsTest.java | 6 +- .../treetable/TreeTableScrollOnExpandTest.java | 10 +- .../ui/ComboboxSelectedItemTextTest.java | 28 +- .../ui/ComponentIncludedInCustomWidgetsetTest.java | 8 +- .../ComponentMissingFromDefaultWidgetsetTest.java | 14 +- .../components/ui/DynamicViewportEmptyTest.java | 10 +- .../tests/components/ui/DynamicViewportTest.java | 14 +- .../components/ui/InitialFragmentEventTest.java | 6 +- .../tests/components/ui/InvalidViewportTest.java | 6 +- .../ui/RpcInvocationHandlerToStringTest.java | 4 +- .../tests/components/ui/StaticViewportTest.java | 10 +- .../TextAreaEventPropagationModifierKeysTest.java | 9 +- .../ui/TextAreaEventPropagationTest.java | 8 +- .../ui/TimeoutRedirectResetsOnActivityTest.java | 10 +- .../vaadin/tests/components/ui/UIAccessTest.java | 39 +- .../ui/UIAutoGeneratedStyleNameTest.java | 8 +- .../components/ui/UIInitBrowserDetailsTest.java | 5 +- .../tests/components/ui/UIInitExceptionTest.java | 4 +- .../vaadin/tests/components/ui/UIPollingTest.java | 8 +- .../vaadin/tests/components/ui/UIRefreshTest.java | 6 +- .../tests/components/ui/UISerializationTest.java | 6 +- .../components/ui/UiDependenciesInHtmlTest.java | 6 +- .../ui/UnnecessaryPaddingInResponsiveUITest.java | 12 +- .../ui/VaadinFinderLocatorUISearchTest.java | 8 +- .../components/ui/WindowAndUIShortcutsTest.java | 9 +- .../tests/components/uitest/BaseThemeTest.java | 6 +- .../components/uitest/ChameleonThemeTest.java | 6 +- .../tests/components/uitest/LiferayThemeTest.java | 6 +- .../tests/components/uitest/ReindeerThemeTest.java | 6 +- .../tests/components/uitest/RunoThemeTest.java | 6 +- .../vaadin/tests/components/uitest/ThemeTest.java | 15 +- .../tests/components/uitest/UIScrollingTest.java | 8 +- .../components/upload/TestFileUploadTest.java | 10 +- .../UploadImmediateButtonWidthChameleonTest.java | 10 +- .../UploadImmediateButtonWidthReindeerTest.java | 10 +- .../upload/UploadImmediateButtonWidthRunoTest.java | 10 +- .../upload/UploadImmediateButtonWidthTest.java | 6 +- .../upload/UploadImmediateButtonWidthValoTest.java | 10 +- .../components/upload/UploadNoSelectionTest.java | 10 +- .../upload/UploadTitleWithTooltipTest.java | 8 +- .../window/BackspaceKeyWithModalOpenedTest.java | 10 +- .../window/BottomComponentScrollsUpTest.java | 18 +- .../components/window/CloseModalSubWindowTest.java | 34 +- .../window/ComboboxScrollableWindowTest.java | 15 +- .../window/ExtraWindowShownWaiAriaTest.java | 21 +- .../tests/components/window/GridInWindowTest.java | 6 +- ...MaximizeRestoreWindowWithManagedLayoutTest.java | 10 +- .../components/window/ModalWindowFocusTest.java | 8 +- .../tests/components/window/MoveToTopTest.java | 20 +- .../window/OpenModalWindowAndFocusFieldTest.java | 10 +- .../ScrollingBodyElementWithModalOpenedTest.java | 12 +- .../window/SubWindowWithUndefinedHeightTest.java | 6 +- .../window/SubWindowsTextSelectionTest.java | 19 +- .../window/TestTooSmallSubwindowSizeTest.java | 8 +- .../components/window/ToolTipInWindowTest.java | 24 +- .../window/UncloseableWindowCloseShortcutTest.java | 6 +- .../window/WindowBGColorChameleonIE8Test.java | 2 +- .../tests/components/window/WindowCaptionTest.java | 6 +- .../window/WindowInUiWithNoContentTest.java | 8 +- .../components/window/WindowMaxHeightTest.java | 6 +- .../components/window/WindowMoveListenerTest.java | 4 +- .../tests/components/window/WindowShadowTest.java | 4 +- .../WindowShouldRemoveActionHandlerTest.java | 3 +- .../tests/components/window/WindowZIndexTest.java | 18 +- ...TableQueryWithNonUniqueFirstPrimaryKeyTest.java | 8 +- .../contextclick/AbstractContextClickTest.java | 17 +- .../tests/contextclick/GridContextClickTest.java | 10 +- .../contextclick/ListenerAddAndRemoveTest.java | 6 +- .../tests/contextclick/TableContextClickTest.java | 6 +- .../contextclick/TableContextClickTestBase.java | 10 +- .../tests/contextclick/TreeContextClickTest.java | 18 +- .../contextclick/TreeTableContextClickTest.java | 7 +- .../ConverterThatEnforcesAFormatTest.java | 5 +- .../customelements/CustomProgressBarElement.java | 10 +- .../java/com/vaadin/tests/dd/DDInterruptTest.java | 8 +- .../debug/HierarchyAfterAnalyzeLayoutsTest.java | 17 +- .../debug/PreserveCustomDebugSectionOpenTest.java | 16 +- .../tests/debug/ProfilerZeroOverheadTest.java | 10 +- .../vaadin/tests/debug/PushVersionInfoTest.java | 15 +- .../extensions/IframeIsOpenedInNonIOSTest.java | 5 +- .../vaadin/tests/extensions/ResponsiveUITest.java | 6 +- .../extensions/ResponsiveWidthAndHeightTest.java | 6 +- .../ResponsiveWithCrossDomainStylesTest.java | 6 +- .../SetThemeAndResponsiveLayoutTest.java | 12 +- .../fieldgroup/BasicCrudGridEditorRowTest.java | 9 +- .../vaadin/tests/fieldgroup/BasicCrudGridTest.java | 14 +- .../tests/fieldgroup/BasicCrudTableTest.java | 14 +- .../tests/fieldgroup/BasicPersonFormTest.java | 10 +- .../CommitWithValidationOrConversionErrorTest.java | 4 +- .../com/vaadin/tests/fieldgroup/DateFormTest.java | 12 +- .../fieldgroup/MultipleValidationErrorsTest.java | 10 +- .../com/vaadin/tests/fonticon/FontIconsTest.java | 6 +- .../tests/integration/AbstractIntegrationTest.java | 8 +- .../AbstractServletIntegrationTest.java | 12 +- .../tests/integration/JSPIntegrationTest.java | 10 +- .../integration/LongPollingProxyServerTest.java | 10 +- .../tests/integration/ParameterizedTB3Runner.java | 36 +- .../ServletIntegrationDefaultPushUITest.java | 10 +- .../ServletIntegrationJSR356WebsocketUITest.java | 14 +- .../ServletIntegrationLongPollingUITest.java | 10 +- .../ServletIntegrationStreamingUITest.java | 10 +- .../integration/ServletIntegrationUITest.java | 6 +- .../ServletIntegrationWebsocketUITest.java | 10 +- .../WebSpherePortalIntegrationTest.java | 18 +- .../layoutmanager/LayoutDuringStateUpdateTest.java | 6 +- .../tests/layouts/CssLayoutAbsoluteUrlTest.java | 6 +- .../HorizontalLayoutAndCaretPositionTest.java | 6 +- .../layouts/IE8MeasuredSizeMemoryLeakTest.java | 6 +- .../RelativeSizeInUndefinedCssLayoutTest.java | 10 +- .../layouts/TestLayoutClickListenersTest.java | 8 +- .../DefaultLocationInCustomLayoutTest.java | 6 +- .../gridlayout/GridLayoutWidthChangeTest.java | 4 +- .../gridlayout/GridSpanEmptyColumnsTest.java | 8 +- .../com/vaadin/tests/navigator/NavigationTest.java | 4 +- .../NavigatorListenerModifiesListenersTest.java | 20 +- .../NavigatorViewBlocksBackButtonActionTest.java | 19 +- .../java/com/vaadin/tests/push/BarInUIDLTest.java | 19 +- .../tests/push/BasicPushLongPollingTest.java | 11 +- .../vaadin/tests/push/BasicPushStreamingTest.java | 6 +- .../java/com/vaadin/tests/push/BasicPushTest.java | 20 +- .../vaadin/tests/push/BasicPushWebsocketTest.java | 6 +- .../tests/push/BasicPushWebsocketXhrTest.java | 6 +- .../vaadin/tests/push/EnableDisablePushTest.java | 21 +- .../push/ExtremelyLongPushTimeLongPollingTest.java | 10 +- .../push/ExtremelyLongPushTimeStreamingTest.java | 10 +- .../tests/push/ExtremelyLongPushTimeTest.java | 6 +- .../push/ExtremelyLongPushTimeWebsocketTest.java | 10 +- .../tests/push/IdlePushChannelLongPollingTest.java | 6 +- .../tests/push/IdlePushChannelStreamingTest.java | 6 +- .../com/vaadin/tests/push/IdlePushChannelTest.java | 6 +- .../tests/push/IdlePushChannelWebsocketTest.java | 6 +- .../tests/push/ManualLongPollingPushUITest.java | 9 +- .../push/PushConfigurationLongPollingTest.java | 6 +- .../tests/push/PushConfigurationStreamingTest.java | 6 +- .../vaadin/tests/push/PushConfigurationTest.java | 9 +- .../tests/push/PushConfigurationWebSocketTest.java | 11 +- .../vaadin/tests/push/PushErrorHandlingTest.java | 10 +- .../com/vaadin/tests/push/PushFromInitTest.java | 6 +- .../tests/push/PushLargeDataLongPollingTest.java | 6 +- .../tests/push/PushLargeDataStreamingTest.java | 6 +- .../tests/push/PushLargeDataWebsocketTest.java | 6 +- .../tests/push/PushRemoveConnectorsTest.java | 6 +- .../vaadin/tests/push/PushWithRequireJSTest.java | 6 +- .../tests/push/ReconnectLongPollingTest.java | 6 +- .../vaadin/tests/push/ReconnectStreamingTest.java | 6 +- .../java/com/vaadin/tests/push/ReconnectTest.java | 12 +- .../vaadin/tests/push/ReconnectWebsocketTest.java | 6 +- .../tests/push/RefreshCloseConnectionTest.java | 6 +- .../SendMultibyteCharactersLongPollingTest.java | 4 +- .../push/SendMultibyteCharactersStreamingTest.java | 4 +- .../push/SendMultibyteCharactersWebSocketTest.java | 4 +- .../java/com/vaadin/tests/push/TogglePushTest.java | 17 +- .../vaadin/tests/push/TrackMessageSizeUITest.java | 10 +- .../tests/requesthandlers/AppResource404Test.java | 19 +- .../requesthandlers/CommunicationErrorTest.java | 8 +- .../UnsupportedBrowserHandlerUserAgents.java | 15 +- .../resources/SpecialCharsInThemeResources.java | 9 +- .../serialization/EncodeResultDisplayTest.java | 6 +- .../serialization/GenericWidgetHandlingTest.java | 6 +- .../serialization/LegacySerializerUITest.java | 6 +- .../vaadin/tests/serialization/NoLayoutTest.java | 6 +- .../tests/serialization/SerializerTestTest.java | 23 +- .../java/com/vaadin/tests/tb3/AbstractTB3Test.java | 191 ++-- .../vaadin/tests/tb3/AffectedTB3TestLocator.java | 6 +- .../com/vaadin/tests/tb3/AffectedTB3Tests.java | 6 +- .../java/com/vaadin/tests/tb3/AllTB3Tests.java | 12 +- .../vaadin/tests/tb3/ChangedTB3TestLocator.java | 11 +- .../java/com/vaadin/tests/tb3/ChangedTB3Tests.java | 12 +- .../tests/tb3/CustomTestBenchCommandExecutor.java | 39 +- .../java/com/vaadin/tests/tb3/DndActionsTest.java | 8 +- .../com/vaadin/tests/tb3/ExcludeFromSuite.java | 8 +- .../com/vaadin/tests/tb3/IncludeIfProperty.java | 8 +- .../com/vaadin/tests/tb3/MultiBrowserTest.java | 12 +- .../tests/tb3/MultiBrowserTestWithProxy.java | 6 +- .../vaadin/tests/tb3/MultiBrowserThemeTest.java | 6 +- .../tests/tb3/MultiBrowserThemeTestWithProxy.java | 10 +- .../com/vaadin/tests/tb3/ParallelScheduler.java | 10 +- .../vaadin/tests/tb3/PrivateTB3Configuration.java | 36 +- .../java/com/vaadin/tests/tb3/RetryOnFail.java | 14 +- .../com/vaadin/tests/tb3/ScreenshotTB3Test.java | 52 +- .../vaadin/tests/tb3/ServletIntegrationTests.java | 6 +- .../com/vaadin/tests/tb3/SingleBrowserTest.java | 4 +- .../tests/tb3/SingleBrowserTestPhantomJS2.java | 4 +- .../test/java/com/vaadin/tests/tb3/TB3Runner.java | 5 +- .../java/com/vaadin/tests/tb3/TB3TestLocator.java | 27 +- .../java/com/vaadin/tests/tb3/TB3TestSuite.java | 13 +- .../java/com/vaadin/tests/tb3/TooltipTest.java | 29 +- .../com/vaadin/tests/tb3/VaadinBrowserFactory.java | 5 +- .../java/com/vaadin/tests/tb3/WebsocketTest.java | 10 +- .../tests/tb3/newelements/CalendarElement.java | 4 +- .../tests/tb3/newelements/ComboBoxElement.java | 6 +- .../tb3/newelements/FixedNotificationElement.java | 5 +- .../themes/LegacyComponentThemeChangeTest.java | 33 +- .../tests/themes/ThemeChangeFaviconTest.java | 19 +- .../tests/themes/ThemeChangeOnTheFlyTest.java | 4 +- .../tests/themes/base/DisabledMenuBarItemTest.java | 12 +- .../themes/valo/AlignTopIconInButtonTest.java | 8 +- .../themes/valo/CollapsibleTableColumnTest.java | 15 +- .../tests/themes/valo/ContrastFontColorTest.java | 11 +- .../tests/themes/valo/DisabledLabelTest.java | 8 +- .../themes/valo/FormLayoutInsideTableTest.java | 3 +- .../tests/themes/valo/ImmediateUploadTest.java | 8 +- .../vaadin/tests/themes/valo/ModalWindowTest.java | 4 +- .../tests/themes/valo/NotificationStyleTest.java | 29 +- .../tests/themes/valo/ResponsiveStylesTest.java | 12 +- .../themes/valo/TableWithEmptyCaptionTest.java | 10 +- .../tests/themes/valo/TextFieldBevelTest.java | 16 +- .../themes/valo/ValoDefaultCaptionWidthTest.java | 14 +- .../vaadin/tests/themes/valo/ValoThemeUITest.java | 5 +- .../tooltip/AdjacentElementsWithTooltipsTest.java | 8 +- .../tooltip/DragAndDropWrapperTooltipsTest.java | 10 +- .../com/vaadin/tests/tooltip/LongTooltipTest.java | 8 +- .../vaadin/tests/tooltip/MenuBarTooltipTest.java | 18 +- .../vaadin/tests/tooltip/SliderTooltipTest.java | 8 +- .../tests/tooltip/TooltipAndJavascriptTest.java | 8 +- .../tests/tooltip/TooltipConfigurationTest.java | 6 +- .../vaadin/tests/tooltip/TooltipInWindowTest.java | 3 +- .../tests/tooltip/TooltipWidthUpdatingTest.java | 9 +- .../tests/tooltip/ValidatorCaptionTooltipTest.java | 2 +- .../FragmentHandlingAndAsynchUIUpdateTest.java | 19 +- .../urifragments/SettingNullFragmentTest.java | 8 +- .../java/com/vaadin/tests/util/WidgetUtilTest.java | 26 +- .../tests/widgetset/server/ClientRpcClassTest.java | 10 +- .../server/csrf/ui/AbstractCsrfTokenUITest.java | 10 +- .../server/csrf/ui/CsrfTokenDisabledTest.java | 8 +- .../server/csrf/ui/CsrfTokenEnabledTest.java | 11 +- .../com/vaadin/themes/valoutil/BodyStyleName.java | 6 +- 3528 files changed, 34552 insertions(+), 33512 deletions(-) diff --git a/all/src/main/java/com/vaadin/buildhelpers/FetchReleaseNotesAuthors.java b/all/src/main/java/com/vaadin/buildhelpers/FetchReleaseNotesAuthors.java index cd85ca6a3f..85dc87e756 100644 --- a/all/src/main/java/com/vaadin/buildhelpers/FetchReleaseNotesAuthors.java +++ b/all/src/main/java/com/vaadin/buildhelpers/FetchReleaseNotesAuthors.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -27,18 +27,17 @@ import java.util.Properties; public class FetchReleaseNotesAuthors { private static final String template = "
  • @author@
  • "; - public static void main(String[] args) throws IOException, - InterruptedException { + public static void main(String[] args) + throws IOException, InterruptedException { Properties authorMap = new Properties(); String authorsFilename = FetchReleaseNotesAuthors.class.getPackage() - .getName().replace(".", "/") - + "/authormap.properties"; + .getName().replace(".", "/") + "/authormap.properties"; InputStream s = FetchReleaseNotesAuthors.class.getClassLoader() .getResourceAsStream(authorsFilename); if (s == null) { - System.err.println("Author mapping file " + authorsFilename - + " not found!"); + System.err.println( + "Author mapping file " + authorsFilename + " not found!"); } authorMap.load(s); @@ -53,8 +52,8 @@ public class FetchReleaseNotesAuthors { if (p.exitValue() != 0) { System.err.println("Exit code: " + p.exitValue()); } - BufferedReader b = new BufferedReader(new InputStreamReader( - p.getInputStream())); + BufferedReader b = new BufferedReader( + new InputStreamReader(p.getInputStream())); String line = ""; List authors = new ArrayList(); @@ -77,8 +76,8 @@ public class FetchReleaseNotesAuthors { private static String getPreviousVersion(String version) { String[] versionNumbers = version.split("\\."); if (versionNumbers.length > 4 || versionNumbers.length < 3) { - throw new IllegalArgumentException("Cannot parse version: " - + version); + throw new IllegalArgumentException( + "Cannot parse version: " + version); } int major = Integer.parseInt(versionNumbers[0]); int minor = Integer.parseInt(versionNumbers[1]); diff --git a/all/src/main/java/com/vaadin/buildhelpers/FetchReleaseNotesTickets.java b/all/src/main/java/com/vaadin/buildhelpers/FetchReleaseNotesTickets.java index 0cd06890eb..a763934464 100644 --- a/all/src/main/java/com/vaadin/buildhelpers/FetchReleaseNotesTickets.java +++ b/all/src/main/java/com/vaadin/buildhelpers/FetchReleaseNotesTickets.java @@ -27,8 +27,7 @@ import org.apache.commons.io.IOUtils; public class FetchReleaseNotesTickets { private static final String queryURL = "https://dev.vaadin.com/query?status=pending-release&status=released&@milestone@&resolution=fixed&col=id&col=summary&col=owner&col=type&col=priority&col=component&col=version&col=bfptime&col=fv&format=tab&order=id"; - private static final String ticketTemplate = "" - + "@badge@" // + private static final String ticketTemplate = "" + "@badge@" // + "#@ticket@" // + "@description@" // + ""; // @@ -105,7 +104,8 @@ public class FetchReleaseNotesTickets { String badge = ""; if (fields.length >= 8 && !fields[7].equals("")) { badge = "Priority"; - } else if (fields.length >= 9 && fields[8].equalsIgnoreCase("true")) { + } else if (fields.length >= 9 + && fields[8].equalsIgnoreCase("true")) { badge = "Vote"; } @@ -163,9 +163,9 @@ public class FetchReleaseNotesTickets { } private static void usage() { - System.err.println("Usage: " - + FetchReleaseNotesTickets.class.getSimpleName() - + " -Dvaadin.version="); + System.err.println( + "Usage: " + FetchReleaseNotesTickets.class.getSimpleName() + + " -Dvaadin.version="); System.exit(1); } } diff --git a/buildhelpers/src/main/java/com/vaadin/buildhelpers/CompileTheme.java b/buildhelpers/src/main/java/com/vaadin/buildhelpers/CompileTheme.java index d97025bdb6..edd4fd9b88 100644 --- a/buildhelpers/src/main/java/com/vaadin/buildhelpers/CompileTheme.java +++ b/buildhelpers/src/main/java/com/vaadin/buildhelpers/CompileTheme.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -64,11 +64,11 @@ public class CompileTheme { // Regular theme try { processSassTheme(themeFolder, themeName, "styles", version); - System.out.println("Compiling theme " + themeName - + " styles successful"); + System.out.println( + "Compiling theme " + themeName + " styles successful"); } catch (Exception e) { - System.err.println("Compiling theme " + themeName - + " styles failed"); + System.err + .println("Compiling theme " + themeName + " styles failed"); e.printStackTrace(); } // Legacy theme w/o .themename{} wrapping @@ -82,8 +82,8 @@ public class CompileTheme { + " legacy-styles successful"); } } catch (Exception e) { - System.err.println("Compiling theme " + themeName - + " legacy-styles failed"); + System.err.println( + "Compiling theme " + themeName + " legacy-styles failed"); e.printStackTrace(); } } @@ -103,8 +103,8 @@ public class CompileTheme { ScssStylesheet scss = ScssStylesheet.get(sassFile); if (scss == null) { - throw new IllegalArgumentException("SASS file: " + sassFile - + " not found"); + throw new IllegalArgumentException( + "SASS file: " + sassFile + " not found"); } scss.compile(); String filteredScss = scss.printState().replace("@version@", version); @@ -128,8 +128,8 @@ public class CompileTheme { boolean ok = newCss.renameTo(oldCss); if (!ok) { - throw new RuntimeException("Rename " + newCss + " -> " + oldCss - + " failed"); + throw new RuntimeException( + "Rename " + newCss + " -> " + oldCss + " failed"); } } @@ -142,8 +142,8 @@ public class CompileTheme { // hiding other classpath issues Class smartSpritesClass = org.carrot2.labs.smartsprites.SmartSprites.class; } catch (NoClassDefFoundError e) { - System.err - .println("Could not find smartsprites. No sprites were generated. The theme should still work."); + System.err.println( + "Could not find smartsprites. No sprites were generated. The theme should still work."); return; } diff --git a/buildhelpers/src/main/java/com/vaadin/buildhelpers/GeneratePackageExports.java b/buildhelpers/src/main/java/com/vaadin/buildhelpers/GeneratePackageExports.java index d4ad3f838c..a27bed1dba 100644 --- a/buildhelpers/src/main/java/com/vaadin/buildhelpers/GeneratePackageExports.java +++ b/buildhelpers/src/main/java/com/vaadin/buildhelpers/GeneratePackageExports.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -35,7 +35,7 @@ import java.util.regex.Pattern; * Export-Package attribute, and appends it to the jar's MANIFEST.MF. *

    * See #3521 for details. - * + * * @author magi */ public class GeneratePackageExports { @@ -44,11 +44,10 @@ public class GeneratePackageExports { public static void main(String[] args) { if (args.length < 2) { - System.err - .println("Invalid number of parameters\n" - + "Usage: java -cp .. GenerateManifest \n" - + "Use -Dvaadin.version to specify the version to be used for the packages\n" - + "Use -DincludeNumberPackages=1 to include package names which start with a number (not 100% OSGi compatible)"); + System.err.println("Invalid number of parameters\n" + + "Usage: java -cp .. GenerateManifest \n" + + "Use -Dvaadin.version to specify the version to be used for the packages\n" + + "Use -DincludeNumberPackages=1 to include package names which start with a number (not 100% OSGi compatible)"); System.exit(1); } @@ -149,7 +148,7 @@ public class GeneratePackageExports { * version.. Searches for the packge and then its parents * recursively. Falls back to the "vaadin.version" system property if no * other properties are found. - * + * * @param javaPackage * The package to determine a version for * @return A version or null if no version has been defined @@ -178,7 +177,8 @@ public class GeneratePackageExports { } private static HashSet getPackages(JarFile jar, - List acceptedPackagePrefixes, boolean includeNumberPackages) { + List acceptedPackagePrefixes, + boolean includeNumberPackages) { HashSet packages = new HashSet(); Pattern startsWithNumber = Pattern.compile("\\.\\d"); @@ -198,10 +198,11 @@ public class GeneratePackageExports { } int lastSlash = entry.getName().lastIndexOf('/'); - String pkg = entry.getName().substring(0, lastSlash) - .replace('/', '.'); + String pkg = entry.getName().substring(0, lastSlash).replace('/', + '.'); - if (!includeNumberPackages && startsWithNumber.matcher(pkg).find()) { + if (!includeNumberPackages + && startsWithNumber.matcher(pkg).find()) { continue; } diff --git a/buildhelpers/src/main/java/com/vaadin/buildhelpers/ManifestWriter.java b/buildhelpers/src/main/java/com/vaadin/buildhelpers/ManifestWriter.java index 9e9b29c4a1..bb8cb27e38 100644 --- a/buildhelpers/src/main/java/com/vaadin/buildhelpers/ManifestWriter.java +++ b/buildhelpers/src/main/java/com/vaadin/buildhelpers/ManifestWriter.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -33,7 +33,7 @@ public class ManifestWriter { /** * Writes a manifest attribute to a temporary buffer. - * + * * @param name * Attribute name * @param value @@ -56,10 +56,10 @@ public class ManifestWriter { /** * Writes the manifest to given JAR file. - * + * * The manifest must be created with {@code #writeAttribute(String, String)} * before calling this write. - * + * * @param jarFilename * File name of the JAR in which the manifest is written * @return 0 on success, nonzero value on error @@ -85,9 +85,9 @@ public class ManifestWriter { fos.write(getBytes()); fos.close(); } catch (IOException e) { - System.err.println("Writing to file '" - + newMfFile.getAbsolutePath() + "' failed because: " - + e.getMessage()); + System.err.println( + "Writing to file '" + newMfFile.getAbsolutePath() + + "' failed because: " + e.getMessage()); status = 1; } } @@ -100,9 +100,9 @@ public class ManifestWriter { is = new FileInputStream(newMfFile); checkMf.read(is); } catch (IOException e) { - System.err.println("Reading from file '" - + newMfFile.getAbsolutePath() + "' failed because: " - + e.getMessage()); + System.err.println( + "Reading from file '" + newMfFile.getAbsolutePath() + + "' failed because: " + e.getMessage()); status = 1; } } @@ -112,8 +112,8 @@ public class ManifestWriter { System.out.println("Updating manifest in JAR " + jarFilename); try { // The "mf" order must correspond with manifest-jarfile order - Process process = Runtime.getRuntime().exec( - new String[] { "jar", "umf", + Process process = Runtime.getRuntime() + .exec(new String[] { "jar", "umf", newMfFile.getAbsolutePath(), jarFilename }); int exitValue = process.waitFor(); if (exitValue != 0) { @@ -123,14 +123,14 @@ public class ManifestWriter { while (reader.ready()) { System.err.println("jar: " + reader.readLine()); } - System.err - .println("The 'jar' command returned with exit value " + System.err.println( + "The 'jar' command returned with exit value " + exitValue); status = 1; } } catch (IOException e) { - System.err.println("Failed to execute 'jar' command. " - + e.getMessage()); + System.err.println( + "Failed to execute 'jar' command. " + e.getMessage()); status = 1; } catch (InterruptedException e) { System.err diff --git a/client-compiler/src/main/java/com/vaadin/sass/linker/SassLinker.java b/client-compiler/src/main/java/com/vaadin/sass/linker/SassLinker.java index dda6733384..aaea3b60c1 100644 --- a/client-compiler/src/main/java/com/vaadin/sass/linker/SassLinker.java +++ b/client-compiler/src/main/java/com/vaadin/sass/linker/SassLinker.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -42,7 +42,7 @@ import com.vaadin.sass.internal.ScssStylesheet; * Pre-linker that checks for the existence of SASS files in public folders, * compiles them to CSS files with the SassCompiler from Vaadin and adds the CSS * back into the artifact. - * + * */ @LinkerOrder(Order.PRE) @Shardable @@ -109,30 +109,31 @@ public class SassLinker extends AbstractLinker { // Store the file info for the compilation scssFiles.add(new FileInfo(tempfile, partialPath)); } else { - logger.log(TreeLogger.WARN, "Duplicate file " - + tempfile.getPath()); + logger.log(TreeLogger.WARN, + "Duplicate file " + tempfile.getPath()); } } catch (IOException e) { logger.log(TreeLogger.ERROR, - "Could not write temporary file " + fileName, e); + "Could not write temporary file " + fileName, + e); } } } // Compile the files and store them in the artifact - logger.log(TreeLogger.INFO, "Processing " + scssFiles.size() - + " Sass file(s)"); + logger.log(TreeLogger.INFO, + "Processing " + scssFiles.size() + " Sass file(s)"); for (FileInfo fileInfo : scssFiles) { logger.log(TreeLogger.INFO, " " + fileInfo.originalScssPath + " -> " + fileInfo.getOriginalCssPath()); try { - ScssStylesheet scss = ScssStylesheet.get(fileInfo - .getAbsolutePath()); + ScssStylesheet scss = ScssStylesheet + .get(fileInfo.getAbsolutePath()); if (!fileInfo.isMixin()) { scss.compile(); - InputStream is = new ByteArrayInputStream(scss - .printState().getBytes()); + InputStream is = new ByteArrayInputStream( + scss.printState().getBytes()); toReturn.add(this.emitInputStream(logger, is, fileInfo.getOriginalCssPath())); @@ -143,10 +144,8 @@ public class SassLinker extends AbstractLinker { logger.log(TreeLogger.ERROR, "SCSS compilation failed for " + fileInfo.getOriginalCssPath(), e); } catch (IOException e) { - logger.log( - TreeLogger.ERROR, - "Could not write CSS file for " - + fileInfo.getOriginalCssPath(), e); + logger.log(TreeLogger.ERROR, "Could not write CSS file for " + + fileInfo.getOriginalCssPath(), e); } catch (Exception e) { logger.log(TreeLogger.ERROR, "SCSS compilation failed for " + fileInfo.getOriginalCssPath(), e); @@ -161,7 +160,7 @@ public class SassLinker extends AbstractLinker { /** * Writes the contents of an InputStream out to a file. - * + * * @param contents * @param tempfile * @throws IOException @@ -185,7 +184,7 @@ public class SassLinker extends AbstractLinker { /** * Create folder in temporary space on disk. - * + * * @param partialPath * @return */ diff --git a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/AcceptCriteriaFactoryGenerator.java b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/AcceptCriteriaFactoryGenerator.java index 2d08329e9a..813f182b75 100644 --- a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/AcceptCriteriaFactoryGenerator.java +++ b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/AcceptCriteriaFactoryGenerator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -37,7 +37,7 @@ import com.vaadin.shared.ui.dd.AcceptCriterion; * GWT generator to build {@link VAcceptCriterionFactory} implementation * dynamically based on {@link AcceptCriterion} annotations available in * classpath. - * + * */ public class AcceptCriteriaFactoryGenerator extends Generator { @@ -67,7 +67,7 @@ public class AcceptCriteriaFactoryGenerator extends Generator { /** * Generate source code for WidgetMapImpl - * + * * @param logger * Logger object * @param context @@ -89,7 +89,8 @@ public class AcceptCriteriaFactoryGenerator extends Generator { ClassSourceFileComposerFactory composer = null; composer = new ClassSourceFileComposerFactory(packageName, className); composer.addImport("com.google.gwt.core.client.GWT"); - composer.setSuperclass("com.vaadin.client.ui.dd.VAcceptCriterionFactory"); + composer.setSuperclass( + "com.vaadin.client.ui.dd.VAcceptCriterionFactory"); SourceWriter sourceWriter = composer.createSourceWriter(context, printWriter); @@ -100,9 +101,8 @@ public class AcceptCriteriaFactoryGenerator extends Generator { sourceWriter.println("}"); // commit generated class context.commit(logger, printWriter); - logger.log(Type.INFO, - "Done. (" + (new Date().getTime() - date.getTime()) / 1000 - + "seconds)"); + logger.log(Type.INFO, "Done. (" + + (new Date().getTime() - date.getTime()) / 1000 + "seconds)"); } @@ -114,8 +114,8 @@ public class AcceptCriteriaFactoryGenerator extends Generator { sourceWriter.println("name = name.intern();"); - JClassType criteriaType = context.getTypeOracle().findType( - VAcceptCriterion.class.getName()); + JClassType criteriaType = context.getTypeOracle() + .findType(VAcceptCriterion.class.getName()); JClassType[] subtypes = criteriaType.getSubtypes(); Arrays.sort(subtypes, ConnectorBundle.jClassComparator); for (JClassType clientClass : subtypes) { @@ -123,10 +123,11 @@ public class AcceptCriteriaFactoryGenerator extends Generator { .getAnnotation(AcceptCriterion.class); if (annotation != null) { String clientClassName = clientClass.getQualifiedSourceName(); - Class serverClass = clientClass.getAnnotation( - AcceptCriterion.class).value(); + Class serverClass = clientClass + .getAnnotation(AcceptCriterion.class).value(); String serverClassName = serverClass.getCanonicalName(); - logger.log(Type.INFO, "creating mapping for " + serverClassName); + logger.log(Type.INFO, + "creating mapping for " + serverClassName); sourceWriter.print("if (\""); sourceWriter.print(serverClassName); sourceWriter.print("\" == name) return GWT.create("); diff --git a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/ConnectorBundleLoaderFactory.java b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/ConnectorBundleLoaderFactory.java index 2b8ccc87d0..510401e739 100644 --- a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/ConnectorBundleLoaderFactory.java +++ b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/ConnectorBundleLoaderFactory.java @@ -440,9 +440,10 @@ public class ConnectorBundleLoaderFactory extends Generator { throw new UnableToCompleteException(); } if (!property.hasAccessorMethods()) { - logger.log(Type.ERROR, beanType.getQualifiedSourceName() - + " has the property '" + name - + "' without getter defined."); + logger.log(Type.ERROR, + beanType.getQualifiedSourceName() + + " has the property '" + name + + "' without getter defined."); throw new UnableToCompleteException(); } } @@ -480,8 +481,9 @@ public class ConnectorBundleLoaderFactory extends Generator { writer.print( "store.@%s::setPropertyData(Ljava/lang/Class;Ljava/lang/String;Lcom/google/gwt/core/client/JavaScriptObject;)", TypeDataStore.class.getName()); - writer.println("(@%s::class, '%s', data);", property.getBeanType() - .getQualifiedSourceName(), property.getName()); + writer.println("(@%s::class, '%s', data);", + property.getBeanType().getQualifiedSourceName(), + property.getName()); writer.println(); writer.splitIfNeeded(true, String.format("%s store", TypeDataStore.class.getName())); @@ -525,8 +527,7 @@ public class ConnectorBundleLoaderFactory extends Generator { .entrySet()) { JClassType connector = entry.getKey(); - TreeLogger typeLogger = logger.branch( - Type.DEBUG, + TreeLogger typeLogger = logger.branch(Type.DEBUG, "Generating @OnStateChange support for " + connector.getName()); @@ -544,9 +545,8 @@ public class ConnectorBundleLoaderFactory extends Generator { "Processing method " + method.getName()); if (method.isPublic() || method.isProtected()) { - methodLogger - .log(Type.ERROR, - "@OnStateChange is only supported for methods with private or default visibility."); + methodLogger.log(Type.ERROR, + "@OnStateChange is only supported for methods with private or default visibility."); throw new UnableToCompleteException(); } @@ -654,9 +654,8 @@ public class ConnectorBundleLoaderFactory extends Generator { .entrySet()) { JClassType beanType = entry.getKey(); for (Property property : entry.getValue()) { - w.println( - "store.setDelegateToWidget(%s, \"%s\", \"%s\");", - getClassLiteralString(beanType),// property.getBeanType()), + w.println("store.setDelegateToWidget(%s, \"%s\", \"%s\");", + getClassLiteralString(beanType), // property.getBeanType()), property.getName(), property.getAnnotation(DelegateToWidget.class).value()); } @@ -820,10 +819,12 @@ public class ConnectorBundleLoaderFactory extends Generator { } } - private void writeParamTypes(SplittingSourceWriter w, ConnectorBundle bundle) { + private void writeParamTypes(SplittingSourceWriter w, + ConnectorBundle bundle) { Map> needsParamTypes = bundle .getNeedsParamTypes(); - for (Entry> entry : needsParamTypes.entrySet()) { + for (Entry> entry : needsParamTypes + .entrySet()) { JClassType type = entry.getKey(); Set methods = entry.getValue(); @@ -864,8 +865,8 @@ public class ConnectorBundleLoaderFactory extends Generator { w.print("\","); if (method.isPublic()) { - typeLogger.log(Type.DEBUG, "Invoking " + method.getName() - + " using java"); + typeLogger.log(Type.DEBUG, + "Invoking " + method.getName() + " using java"); writeJavaInvoker(w, type, method); } else { @@ -893,8 +894,8 @@ public class ConnectorBundleLoaderFactory extends Generator { w.indent(); JType returnType = method.getReturnType(); - boolean hasReturnType = !"void".equals(returnType - .getQualifiedSourceName()); + boolean hasReturnType = !"void" + .equals(returnType.getQualifiedSourceName()); // Note that void is also a primitive type boolean hasPrimitiveReturnType = hasReturnType @@ -905,9 +906,9 @@ public class ConnectorBundleLoaderFactory extends Generator { if (hasPrimitiveReturnType) { // Integer.valueOf(expression); - w.print("@%s::valueOf(%s)(", returnType.isPrimitive() - .getQualifiedBoxedSourceName(), returnType - .getJNISignature()); + w.print("@%s::valueOf(%s)(", + returnType.isPrimitive().getQualifiedBoxedSourceName(), + returnType.getJNISignature()); // Implementation tested briefly, but I don't dare leave it // enabled since we are not using it in the framework and we @@ -923,8 +924,8 @@ public class ConnectorBundleLoaderFactory extends Generator { JType[] parameterTypes = method.getParameterTypes(); - w.print("target.@%s::" + method.getName() + "(*)(", method - .getEnclosingType().getQualifiedSourceName()); + w.print("target.@%s::" + method.getName() + "(*)(", + method.getEnclosingType().getQualifiedSourceName()); for (int i = 0; i < parameterTypes.length; i++) { if (i != 0) { w.print(", "); @@ -968,8 +969,8 @@ public class ConnectorBundleLoaderFactory extends Generator { w.indent(); JType returnType = method.getReturnType(); - boolean hasReturnType = !"void".equals(returnType - .getQualifiedSourceName()); + boolean hasReturnType = !"void" + .equals(returnType.getQualifiedSourceName()); if (hasReturnType) { w.print("return "); } @@ -989,8 +990,8 @@ public class ConnectorBundleLoaderFactory extends Generator { // Need to pass through native method to allow casting Object to // JSO if the value is a string w.print("%s.<%s>obj2jso(params[%d])", - JsonDecoder.class.getCanonicalName(), - parameterTypeName, i); + JsonDecoder.class.getCanonicalName(), parameterTypeName, + i); } else { w.print("(" + parameterTypeName + ") params[" + i + "]"); } @@ -1088,8 +1089,8 @@ public class ConnectorBundleLoaderFactory extends Generator { } private List buildBundles(TreeLogger logger, - TypeOracle typeOracle) throws NotFoundException, - UnableToCompleteException { + TypeOracle typeOracle) + throws NotFoundException, UnableToCompleteException { Map> connectorsByLoadStyle = new HashMap>(); for (LoadStyle loadStyle : LoadStyle.values()) { @@ -1097,8 +1098,8 @@ public class ConnectorBundleLoaderFactory extends Generator { } // Find all types with a valid mapping - Collection selectedTypes = getConnectorsForWidgetset( - logger, typeOracle); + Collection selectedTypes = getConnectorsForWidgetset(logger, + typeOracle); // Group by load style for (JClassType connectorSubtype : selectedTypes) { @@ -1142,8 +1143,8 @@ public class ConnectorBundleLoaderFactory extends Generator { for (JClassType type : lazy) { ConnectorBundle bundle = new ConnectorBundle(type.getName(), eagerBundle); - TreeLogger subLogger = logger.branch(Type.TRACE, "Populating " - + type.getName() + " bundle"); + TreeLogger subLogger = logger.branch(Type.TRACE, + "Populating " + type.getName() + " bundle"); bundle.processType(subLogger, type); bundles.add(bundle); @@ -1176,8 +1177,8 @@ public class ConnectorBundleLoaderFactory extends Generator { throws UnableToCompleteException { JClassType serverConnectorType; try { - serverConnectorType = typeOracle.getType(ServerConnector.class - .getName()); + serverConnectorType = typeOracle + .getType(ServerConnector.class.getName()); } catch (NotFoundException e) { logger.log(Type.ERROR, "Can't find " + ServerConnector.class.getName()); @@ -1213,13 +1214,10 @@ public class ConnectorBundleLoaderFactory extends Generator { superclass = type; } else { // Neither inherits from the other - this is a conflict - logger.log( - Type.ERROR, + logger.log(Type.ERROR, "Conflicting @Connect mappings detected for " - + identifier - + ": " - + type.getQualifiedSourceName() - + " and " + + identifier + ": " + + type.getQualifiedSourceName() + " and " + previousMapping.getQualifiedSourceName() + ". There can only be multiple @Connect mappings for the same server-side type if one is the subclass of the other."); throw new UnableToCompleteException(); diff --git a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/ArraySerializer.java b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/ArraySerializer.java index 0049ae9b50..b2a30a02c4 100644 --- a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/ArraySerializer.java +++ b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/ArraySerializer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/ClientRpcVisitor.java b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/ClientRpcVisitor.java index 992a012005..688d1fb0cc 100644 --- a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/ClientRpcVisitor.java +++ b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/ClientRpcVisitor.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -68,16 +68,11 @@ public class ClientRpcVisitor extends TypeVisitor { public static void checkReturnType(TreeLogger logger, JMethod method) throws UnableToCompleteException { if (!method.getReturnType().getQualifiedSourceName().equals("void")) { - logger.log( - Type.ERROR, - "The method " - + method.getEnclosingType() - .getQualifiedSourceName() - + "." - + method.getName() - + " returns " - + method.getReturnType().getQualifiedSourceName() - + " but only void is supported for methods in RPC interfaces."); + logger.log(Type.ERROR, "The method " + + method.getEnclosingType().getQualifiedSourceName() + "." + + method.getName() + " returns " + + method.getReturnType().getQualifiedSourceName() + + " but only void is supported for methods in RPC interfaces."); throw new UnableToCompleteException(); } } diff --git a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/ConnectorBundle.java b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/ConnectorBundle.java index b4531eb08e..d390ee0338 100644 --- a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/ConnectorBundle.java +++ b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/ConnectorBundle.java @@ -60,16 +60,16 @@ public class ConnectorBundle { public static final Comparator jClassComparator = new Comparator() { @Override public int compare(JClassType o1, JClassType o2) { - return o1.getQualifiedSourceName().compareTo( - o2.getQualifiedSourceName()); + return o1.getQualifiedSourceName() + .compareTo(o2.getQualifiedSourceName()); } }; public static final Comparator jMethodComparator = new Comparator() { @Override public int compare(JMethod o1, JMethod o2) { - return o1.getReadableDeclaration().compareTo( - o2.getReadableDeclaration()); + return o1.getReadableDeclaration() + .compareTo(o2.getReadableDeclaration()); } }; @@ -140,10 +140,11 @@ public class ConnectorBundle { TypeOracle oracle) throws NotFoundException { Map serializers = new HashMap(); - JClassType serializerInterface = oracle.findType(JSONSerializer.class - .getName()); + JClassType serializerInterface = oracle + .findType(JSONSerializer.class.getName()); JType[] deserializeParamTypes = new JType[] { - oracle.findType(com.vaadin.client.metadata.Type.class.getName()), + oracle.findType( + com.vaadin.client.metadata.Type.class.getName()), oracle.findType(JsonValue.class.getName()), oracle.findType(ApplicationConnection.class.getName()) }; String deserializeMethodName = "deserialize"; @@ -152,8 +153,8 @@ public class ConnectorBundle { deserializeParamTypes); for (JClassType serializer : serializerInterface.getSubtypes()) { - JMethod deserializeMethod = serializer.findMethod( - deserializeMethodName, deserializeParamTypes); + JMethod deserializeMethod = serializer + .findMethod(deserializeMethodName, deserializeParamTypes); if (deserializeMethod == null) { continue; } @@ -309,21 +310,18 @@ public class ConnectorBundle { private void checkSerializable(TreeLogger logger, JClassType type) throws UnableToCompleteException { - JClassType javaSerializable = type.getOracle().findType( - Serializable.class.getName()); + JClassType javaSerializable = type.getOracle() + .findType(Serializable.class.getName()); boolean serializable = type.isAssignableTo(javaSerializable); if (!serializable) { - boolean abortCompile = "true".equals(System - .getProperty(FAIL_IF_NOT_SERIALIZABLE)); - logger.log( - abortCompile ? Type.ERROR : Type.WARN, - type - + " is used in RPC or shared state but does not implement " - + Serializable.class.getName() - + ". Communication will work but the Application on server side cannot be serialized if it refers to objects of this type. " - + "If the system property " - + FAIL_IF_NOT_SERIALIZABLE - + " is set to \"true\", this causes the compilation to fail instead of just emitting a warning."); + boolean abortCompile = "true" + .equals(System.getProperty(FAIL_IF_NOT_SERIALIZABLE)); + logger.log(abortCompile ? Type.ERROR : Type.WARN, type + + " is used in RPC or shared state but does not implement " + + Serializable.class.getName() + + ". Communication will work but the Application on server side cannot be serialized if it refers to objects of this type. " + + "If the system property " + FAIL_IF_NOT_SERIALIZABLE + + " is set to \"true\", this causes the compilation to fail instead of just emitting a warning."); if (abortCompile) { throw new UnableToCompleteException(); } @@ -509,7 +507,8 @@ public class ConnectorBundle { set.add(value); } - private void addMapping(Map> map, K key, JMethod value) { + private void addMapping(Map> map, K key, + JMethod value) { Set set = map.get(key); if (set == null) { set = new TreeSet(jMethodComparator); @@ -609,9 +608,8 @@ public class ConnectorBundle { if (typeData != null && hasMapping(typeData, method, methodAttribute)) { return true; } else { - return previousBundle != null - && previousBundle.hasMethodAttribute(type, method, - methodAttribute); + return previousBundle != null && previousBundle + .hasMethodAttribute(type, method, methodAttribute); } } @@ -699,7 +697,8 @@ public class ConnectorBundle { } } - private boolean isNeedsOnStateChangeHandler(JClassType type, JMethod method) { + private boolean isNeedsOnStateChangeHandler(JClassType type, + JMethod method) { if (hasMapping(needsOnStateChange, type, method)) { return true; } else { diff --git a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/ConnectorInitVisitor.java b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/ConnectorInitVisitor.java index ea3b097fa2..33766cfd72 100644 --- a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/ConnectorInitVisitor.java +++ b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/ConnectorInitVisitor.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/CustomSerializer.java b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/CustomSerializer.java index bb3dd4f61d..a93e5bd4a1 100644 --- a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/CustomSerializer.java +++ b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/CustomSerializer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/EnumSerializer.java b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/EnumSerializer.java index 9876baf946..f6581f20bc 100644 --- a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/EnumSerializer.java +++ b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/EnumSerializer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/FieldProperty.java b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/FieldProperty.java index a31dafe05c..0d5d831495 100644 --- a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/FieldProperty.java +++ b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/FieldProperty.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -45,15 +45,16 @@ public class FieldProperty extends Property { @Override public void writeSetterBody(TreeLogger logger, SourceWriter w, String beanVariable, String valueVariable) { - w.println("%s.@%s::%s = %s;", beanVariable, getBeanType() - .getQualifiedSourceName(), getName(), unboxValue(valueVariable)); + w.println("%s.@%s::%s = %s;", beanVariable, + getBeanType().getQualifiedSourceName(), getName(), + unboxValue(valueVariable)); } @Override public void writeGetterBody(TreeLogger logger, SourceWriter w, String beanVariable) { - String value = String.format("%s.@%s::%s", beanVariable, getBeanType() - .getQualifiedSourceName(), getName()); + String value = String.format("%s.@%s::%s", beanVariable, + getBeanType().getQualifiedSourceName(), getName()); w.print("return "); w.print(boxValue(value)); w.println(";"); diff --git a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/GeneratedSerializer.java b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/GeneratedSerializer.java index 6afb172ea2..623b320793 100644 --- a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/GeneratedSerializer.java +++ b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/GeneratedSerializer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/JsonSerializer.java b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/JsonSerializer.java index a7a6c568da..bdd5074ce1 100644 --- a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/JsonSerializer.java +++ b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/JsonSerializer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -56,8 +56,8 @@ public abstract class JsonSerializer implements GeneratedSerializer { + ApplicationConnection.class.getName() + " connection) {"); w.indent(); // MouseEventDetails castedValue = (MouseEventDetails) value; - w.println(qualifiedSourceName + " castedValue = (" - + qualifiedSourceName + ") value;"); + w.println(qualifiedSourceName + " castedValue = (" + qualifiedSourceName + + ") value;"); printSerializerBody(logger, w, "castedValue", "connection"); diff --git a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/MethodProperty.java b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/MethodProperty.java index 32aad92774..4773fd908e 100644 --- a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/MethodProperty.java +++ b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/MethodProperty.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -36,8 +36,8 @@ public class MethodProperty extends Property { private final String getter; private MethodProperty(JClassType beanType, JMethod setter, String getter) { - super(getTransportFieldName(setter), beanType, setter - .getParameterTypes()[0]); + super(getTransportFieldName(setter), beanType, + setter.getParameterTypes()[0]); this.setter = setter; this.getter = getter; } @@ -54,8 +54,8 @@ public class MethodProperty extends Property { List setters = getSetters(type, getters); for (JMethod setter : setters) { String getter = findGetter(type, setter); - properties.add(new MethodProperty(setter.getEnclosingType(), - setter, getters.contains(getter) ? getter : null)); + properties.add(new MethodProperty(setter.getEnclosingType(), setter, + getters.contains(getter) ? getter : null)); } return properties; @@ -63,7 +63,7 @@ public class MethodProperty extends Property { /** * Returns a list of all setters found in the beanType or its parent class - * + * * @param beanType * The type to check * @param getters @@ -74,9 +74,8 @@ public class MethodProperty extends Property { Set getters) { List setterMethods = new ArrayList(); - while (beanType != null - && !beanType.getQualifiedSourceName().equals( - Object.class.getName())) { + while (beanType != null && !beanType.getQualifiedSourceName() + .equals(Object.class.getName())) { for (JMethod method : beanType.getMethods()) { // Process all setters that have corresponding fields if (!method.isPublic() || method.isStatic()) { @@ -112,18 +111,19 @@ public class MethodProperty extends Property { @Override public void writeSetterBody(TreeLogger logger, SourceWriter w, String beanVariable, String valueVariable) { - w.println("%s.@%s::%s(%s)(%s);", beanVariable, getBeanType() - .getQualifiedSourceName(), setter.getName(), setter - .getParameterTypes()[0].getJNISignature(), + w.println("%s.@%s::%s(%s)(%s);", beanVariable, + getBeanType().getQualifiedSourceName(), setter.getName(), + setter.getParameterTypes()[0].getJNISignature(), unboxValue(valueVariable)); } - private static String findGetter(JClassType beanType, JMethod setterMethod) { + private static String findGetter(JClassType beanType, + JMethod setterMethod) { JType setterParameterType = setterMethod.getParameterTypes()[0]; String fieldName = setterMethod.getName().substring(3); - if (setterParameterType.getQualifiedSourceName().equals( - boolean.class.getName())) { + if (setterParameterType.getQualifiedSourceName() + .equals(boolean.class.getName())) { return "is" + fieldName; } else { return "get" + fieldName; diff --git a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/OnStateChangeVisitor.java b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/OnStateChangeVisitor.java index 1c0da9d9e8..e86dbe4858 100644 --- a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/OnStateChangeVisitor.java +++ b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/OnStateChangeVisitor.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,7 +25,7 @@ import com.vaadin.shared.ui.Connect; /** * Visits Connector classes and check for methods with @OnStateChange * annotations. - * + * * @since 7.2 * @author Vaadin Ltd */ diff --git a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/Property.java b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/Property.java index 0c849bead5..552543a880 100644 --- a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/Property.java +++ b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/Property.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -103,20 +103,20 @@ public abstract class Property implements Comparable { @Override public int hashCode() { - return getClass().hashCode() * 31 ^ 2 + getBeanType().hashCode() * 31 - + getName().hashCode(); + return getClass().hashCode() * 31 + ^ 2 + getBeanType().hashCode() * 31 + getName().hashCode(); } @Override public int compareTo(Property o) { int comp = getName().compareTo(o.getName()); if (comp == 0) { - comp = getBeanType().getQualifiedSourceName().compareTo( - o.getBeanType().getQualifiedSourceName()); + comp = getBeanType().getQualifiedSourceName() + .compareTo(o.getBeanType().getQualifiedSourceName()); } if (comp == 0) { - comp = getClass().getCanonicalName().compareTo( - o.getClass().getCanonicalName()); + comp = getClass().getCanonicalName() + .compareTo(o.getClass().getCanonicalName()); } return comp; } diff --git a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/RendererVisitor.java b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/RendererVisitor.java index 8b645aa492..6131674ee3 100644 --- a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/RendererVisitor.java +++ b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/RendererVisitor.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -37,9 +37,9 @@ import elemental.json.JsonValue; * {@link AbstractRendererConnector#decode(elemental.json.JsonValue) decode} * method to work without having to implement a "getPresentationType" method. * - * + * * @see WidgetInitVisitor - * + * * @since 7.4 * @author Vaadin Ltd */ @@ -57,17 +57,17 @@ public class RendererVisitor extends TypeVisitor { private static void doRendererType(TreeLogger logger, JClassType type, ConnectorBundle bundle) throws UnableToCompleteException { // The class in which createRenderer is implemented - JClassType createRendererClass = ConnectorBundle.findInheritedMethod( - type, "createRenderer").getEnclosingType(); + JClassType createRendererClass = ConnectorBundle + .findInheritedMethod(type, "createRenderer").getEnclosingType(); // Needs GWT constructor if createRenderer is not overridden - if (createRendererClass.getQualifiedSourceName().equals( - AbstractRendererConnector.class.getCanonicalName())) { + if (createRendererClass.getQualifiedSourceName() + .equals(AbstractRendererConnector.class.getCanonicalName())) { JMethod getRenderer = ConnectorBundle.findInheritedMethod(type, "getRenderer"); - if (getRenderer.getEnclosingType().getQualifiedSourceName() - .equals(AbstractRendererConnector.class.getCanonicalName())) { + if (getRenderer.getEnclosingType().getQualifiedSourceName().equals( + AbstractRendererConnector.class.getCanonicalName())) { logger.log(Type.ERROR, type.getQualifiedSourceName() + " must override either createRenderer or getRenderer"); throw new UnableToCompleteException(); @@ -79,8 +79,8 @@ public class RendererVisitor extends TypeVisitor { // Also needs renderer type to find the right GWT constructor bundle.setNeedsReturnType(type, getRenderer); - logger.log(Type.DEBUG, "Renderer type of " + type + " is " - + rendererType); + logger.log(Type.DEBUG, + "Renderer type of " + type + " is " + rendererType); } } @@ -93,8 +93,8 @@ public class RendererVisitor extends TypeVisitor { bundle.setNeedsSerialize(presentationType); } - logger.log(Type.DEBUG, "Presentation type of " + type + " is " - + presentationType); + logger.log(Type.DEBUG, + "Presentation type of " + type + " is " + presentationType); } private static boolean hasCustomDecodeMethod(JClassType type, @@ -110,8 +110,8 @@ public class RendererVisitor extends TypeVisitor { return !decodeMethod.getEnclosingType().getQualifiedSourceName() .equals(AbstractRendererConnector.class.getName()); } catch (NotFoundException e) { - logger.log(Type.ERROR, "Can't find decode method for renderer " - + type, e); + logger.log(Type.ERROR, + "Can't find decode method for renderer " + type, e); throw new UnableToCompleteException(); } } @@ -120,16 +120,13 @@ public class RendererVisitor extends TypeVisitor { throws UnableToCompleteException { JClassType originalType = type; while (type != null) { - if (type.getQualifiedBinaryName().equals( - AbstractRendererConnector.class.getName())) { + if (type.getQualifiedBinaryName() + .equals(AbstractRendererConnector.class.getName())) { JParameterizedType parameterized = type.isParameterized(); if (parameterized == null) { - logger.log( - Type.ERROR, - type.getQualifiedSourceName() - + " must define the generic parameter of the inherited " - + AbstractRendererConnector.class - .getSimpleName()); + logger.log(Type.ERROR, type.getQualifiedSourceName() + + " must define the generic parameter of the inherited " + + AbstractRendererConnector.class.getSimpleName()); throw new UnableToCompleteException(); } return parameterized.getTypeArgs()[0]; diff --git a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/ServerRpcVisitor.java b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/ServerRpcVisitor.java index 86ece28041..58bb8dd902 100644 --- a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/ServerRpcVisitor.java +++ b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/ServerRpcVisitor.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -52,7 +52,8 @@ public class ServerRpcVisitor extends TypeVisitor { } } - if (method.getAnnotation(NoLoadingIndicator.class) != null) { + if (method + .getAnnotation(NoLoadingIndicator.class) != null) { bundle.setMethodAttribute(type, method, MethodAttribute.NO_LOADING_INDICATOR); } diff --git a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/StateInitVisitor.java b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/StateInitVisitor.java index 046c5c4611..f726dcdf55 100644 --- a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/StateInitVisitor.java +++ b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/StateInitVisitor.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -24,8 +24,8 @@ public class StateInitVisitor extends TypeVisitor { @Override public void visitConnector(TreeLogger logger, JClassType type, ConnectorBundle bundle) { - JMethod getState = ConnectorBundle - .findInheritedMethod(type, "getState"); + JMethod getState = ConnectorBundle.findInheritedMethod(type, + "getState"); bundle.setNeedsReturnType(type, getState); bundle.setNeedsSerialize(getState.getReturnType()); diff --git a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/TypeVisitor.java b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/TypeVisitor.java index 028e4cc44d..441da12e38 100644 --- a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/TypeVisitor.java +++ b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/TypeVisitor.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/WidgetInitVisitor.java b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/WidgetInitVisitor.java index 9a9cac18ba..378ecca361 100644 --- a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/WidgetInitVisitor.java +++ b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/WidgetInitVisitor.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -32,8 +32,9 @@ public class WidgetInitVisitor extends TypeVisitor { ConnectorBundle bundle) throws UnableToCompleteException { if (ConnectorBundle.isConnectedComponentConnector(type)) { // The class in which createWidget is implemented - JClassType createWidgetClass = ConnectorBundle.findInheritedMethod( - type, "createWidget").getEnclosingType(); + JClassType createWidgetClass = ConnectorBundle + .findInheritedMethod(type, "createWidget") + .getEnclosingType(); JMethod getWidget = ConnectorBundle.findInheritedMethod(type, "getWidget"); @@ -42,9 +43,7 @@ public class WidgetInitVisitor extends TypeVisitor { // Needs GWT constructor if createWidget is not overridden if (createWidgetClass.getQualifiedSourceName().equals( AbstractComponentConnector.class.getCanonicalName())) { - if (getWidget - .getEnclosingType() - .getQualifiedSourceName() + if (getWidget.getEnclosingType().getQualifiedSourceName() .equals(AbstractComponentConnector.class .getCanonicalName())) { logger.log(Type.ERROR, type.getQualifiedSourceName() @@ -79,12 +78,8 @@ public class WidgetInitVisitor extends TypeVisitor { .findInheritedMethod(widgetType, methodName, property.getPropertyType()); if (delegatedSetter == null) { - logger.log( - Type.ERROR, - widgetType.getName() - + "." - + methodName - + "(" + logger.log(Type.ERROR, + widgetType.getName() + "." + methodName + "(" + property.getPropertyType() .getSimpleSourceName() + ") required by @DelegateToWidget for " diff --git a/client-compiler/src/main/java/com/vaadin/tools/CvalAddonsChecker.java b/client-compiler/src/main/java/com/vaadin/tools/CvalAddonsChecker.java index aab7231258..6dab674870 100644 --- a/client-compiler/src/main/java/com/vaadin/tools/CvalAddonsChecker.java +++ b/client-compiler/src/main/java/com/vaadin/tools/CvalAddonsChecker.java @@ -79,7 +79,7 @@ public final class CvalAddonsChecker { /** * Visit all MANIFEST.MF files in the classpath validating licenses. - * + * * Return a list of Cval licensed products in order to have enough info to * generate nag messages in the UI. */ @@ -108,14 +108,14 @@ public final class CvalAddonsChecker { Attributes attribs = manifest.getMainAttributes(); String license = attribs.getValue(VAADIN_ADDON_LICENSE); String name = attribs.getValue(VAADIN_ADDON_NAME); - String vers = attribs.getValue(VAADIN_ADDON_VERSION) == null ? "" - : attribs.getValue(VAADIN_ADDON_VERSION); - String title = attribs.getValue(VAADIN_ADDON_TITLE) == null ? name - : attribs.getValue(VAADIN_ADDON_TITLE); + String vers = attribs.getValue(VAADIN_ADDON_VERSION) == null + ? "" : attribs.getValue(VAADIN_ADDON_VERSION); + String title = attribs.getValue(VAADIN_ADDON_TITLE) == null + ? name : attribs.getValue(VAADIN_ADDON_TITLE); String widgetsets = attribs .getValue(VAADIN_ADDON_WIDGETSET) == null ? name - : attribs.getValue(VAADIN_ADDON_WIDGETSET); + : attribs.getValue(VAADIN_ADDON_WIDGETSET); if (name == null || license == null) { continue; @@ -131,14 +131,14 @@ public final class CvalAddonsChecker { title); printValidLicense(info, title, vers); } catch (UnreachableCvalServerException e) { - info = CvalChecker.parseJson("{'product':{'name':'" - + name + "'}}"); + info = CvalChecker.parseJson( + "{'product':{'name':'" + name + "'}}"); printServerUnreachable(title, vers); } for (String w : widgetsets.split("[, ]+")) { - ret.add(new CValUiInfo(title, String - .valueOf(computeMajorVersion(vers)), w, - info.getType())); + ret.add(new CValUiInfo(title, + String.valueOf(computeMajorVersion(vers)), + w, info.getType())); } } } catch (IOException ignored) { @@ -151,7 +151,7 @@ public final class CvalAddonsChecker { /** * Set the filter regexp of .jar names which we have to consider. - * + * * default is '.*touchkit.*' */ public CvalAddonsChecker setFilter(String regexp) { @@ -174,13 +174,12 @@ public final class CvalAddonsChecker { } private void printServerUnreachable(String name, String version) { - System.out.println(LINE - + "\n" - + getErrorMessage("unreachable", name, - computeMajorVersion(version)) + "\n" + LINE); + System.out.println(LINE + "\n" + getErrorMessage("unreachable", name, + computeMajorVersion(version)) + "\n" + LINE); } - private void printValidLicense(CvalInfo info, String title, String version) { + private void printValidLicense(CvalInfo info, String title, + String version) { String msg = info.getMessage(); if (msg == null) { String key = "evaluation".equals(info.getType()) ? "evaluation" diff --git a/client-compiler/src/main/java/com/vaadin/tools/CvalChecker.java b/client-compiler/src/main/java/com/vaadin/tools/CvalChecker.java index 9217781695..d8c04d9d23 100644 --- a/client-compiler/src/main/java/com/vaadin/tools/CvalChecker.java +++ b/client-compiler/src/main/java/com/vaadin/tools/CvalChecker.java @@ -52,10 +52,10 @@ public final class CvalChecker { /* * Class used for binding the JSON gotten from server. - * + * * It is not in a separate f le, so as it is easier to copy into any product * which does not depend on vaadin core. - * + * * We are using elemental.json in order not to use additional dependency * like auto-beans, gson, etc. */ @@ -153,8 +153,8 @@ public final class CvalChecker { public boolean isLicenseExpired() { return (getExpired() != null && getExpired()) - || (getExpiredEpoch() != null && getExpiredEpoch().before( - new Date())); + || (getExpiredEpoch() != null + && getExpiredEpoch().before(new Date())); } public boolean isValidVersion(int majorVersion) { @@ -248,8 +248,8 @@ public final class CvalChecker { } else if (info != null && info.getMessage() != null) { msg = info.getMessage().replace("\\n", "\n"); } else if (info != null && info.isLicenseExpired()) { - String type = "evaluation".equals(info.getType()) ? "Evaluation license" - : "License"; + String type = "evaluation".equals(info.getType()) + ? "Evaluation license" : "License"; msg = getErrorMessage("expired", title, majorVers, type); } else if (key == null) { msg = getErrorMessage("none", title, majorVers); @@ -359,8 +359,8 @@ public final class CvalChecker { * when we have license key but server is unreachable */ public CvalInfo validateProduct(String productName, String productVersion, - String productTitle) throws InvalidCvalException, - UnreachableCvalServerException { + String productTitle) + throws InvalidCvalException, UnreachableCvalServerException { String key = getDeveloperLicenseKey(productName, productVersion, productTitle); @@ -416,8 +416,8 @@ public final class CvalChecker { int timeout = validCache ? 2000 : 10000; try { - CvalInfo srvinfo = parseJson(provider.askServer(productName + "-" - + productVersion, productKey, timeout)); + CvalInfo srvinfo = parseJson(provider.askServer( + productName + "-" + productVersion, productKey, timeout)); if (srvinfo != null && srvinfo.isValidInfo(productName, productKey) && srvinfo.isValidVersion(majorVersion)) { // We always cache the info if it is valid although it is @@ -502,8 +502,8 @@ public final class CvalChecker { static String getErrorMessage(String key, Object... pars) { Locale loc = Locale.getDefault(); - ResourceBundle res = ResourceBundle.getBundle( - CvalChecker.class.getName(), loc); + ResourceBundle res = ResourceBundle + .getBundle(CvalChecker.class.getName(), loc); String msg = res.getString(key); return new MessageFormat(msg, loc).format(pars); } diff --git a/client-compiler/src/main/java/com/vaadin/tools/WidgetsetCompiler.java b/client-compiler/src/main/java/com/vaadin/tools/WidgetsetCompiler.java index 7c06e9d7af..f66e00d383 100755 --- a/client-compiler/src/main/java/com/vaadin/tools/WidgetsetCompiler.java +++ b/client-compiler/src/main/java/com/vaadin/tools/WidgetsetCompiler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -23,24 +23,24 @@ import com.vaadin.server.widgetsetutils.WidgetSetBuilder; /** * A wrapper for the GWT compiler that runs the compiler in a new thread after * updating the widgetset file. - * + * * This class originally existed to allow circumventing a J2SE 5.0 bug (6316197) * that prevents setting the stack size for the main thread. - * + * * This class takes the same command line arguments as the * com.google.gwt.dev.Compiler class. - * + * * A typical invocation would use e.g. the following arguments - * + * * "-war WebContent/VAADIN/widgetsets com.vaadin.DefaultWidgetSet" - * + * * In addition, larger memory usage settings for the VM should be used, e.g. - * + * * "-Xms256M -Xmx512M -Xss8M" - * + * * The source directory containing widgetset and related classes must be * included in the classpath, as well as other relevant JARs. - * + * * @deprecated with Java 6, can use com.google.gwt.dev.Compiler directly (also * in Eclipse plug-in etc.) */ @@ -71,8 +71,8 @@ public class WidgetsetCompiler { // TODO expecting this is launched via eclipse WTP // project - System.out - .println("Updating GWT module description file..."); + System.out.println( + "Updating GWT module description file..."); WidgetSetBuilder.updateWidgetSet(wsname); System.out.println("Done."); diff --git a/client-compiler/src/test/java/com/vaadin/tools/CvalAddonsCheckerTest.java b/client-compiler/src/test/java/com/vaadin/tools/CvalAddonsCheckerTest.java index c6200bc7e0..c706f0b9e0 100644 --- a/client-compiler/src/test/java/com/vaadin/tools/CvalAddonsCheckerTest.java +++ b/client-compiler/src/test/java/com/vaadin/tools/CvalAddonsCheckerTest.java @@ -54,8 +54,8 @@ public class CvalAddonsCheckerTest { @Before public void setup() { - addonChecker = new CvalAddonsChecker().setLicenseProvider( - validLicenseProvider).setFilter(".*test.*"); + addonChecker = new CvalAddonsChecker() + .setLicenseProvider(validLicenseProvider).setFilter(".*test.*"); licenseName = computeLicenseName(productNameCval); deleteCache(productNameCval); diff --git a/client-compiler/src/test/java/com/vaadin/tools/CvalAddonstCheckerUseCasesTest.java b/client-compiler/src/test/java/com/vaadin/tools/CvalAddonstCheckerUseCasesTest.java index 01cfe2087e..82962663f2 100644 --- a/client-compiler/src/test/java/com/vaadin/tools/CvalAddonstCheckerUseCasesTest.java +++ b/client-compiler/src/test/java/com/vaadin/tools/CvalAddonstCheckerUseCasesTest.java @@ -76,7 +76,7 @@ public class CvalAddonstCheckerUseCasesTest { enum Message { AGPL("AGPL"), VALID(">.* valid"), INVALID("not valid"), NO_LICENSE( "not found"), NO_VALIDATED("has not been validated"), EXPIRED( - "has expired"), EVALUATION("evaluation"); + "has expired"), EVALUATION("evaluation"); String msg; @@ -93,7 +93,7 @@ public class CvalAddonstCheckerUseCasesTest { } /* TODO: Use more descriptive test names */ - + @Test public void testUseCase1() throws Exception { useCase(1, License.NONE, Version.AGPL, Validated.NO, Network.OFF, @@ -219,8 +219,8 @@ public class CvalAddonstCheckerUseCasesTest { if (val == Validated.NO) { deleteCache(productNameCval); } else { - String type = lic == License.EVAL || lic == License.EVAL_EXPIRED ? "evaluation" - : null; + String type = lic == License.EVAL || lic == License.EVAL_EXPIRED + ? "evaluation" : null; Boolean expired = lic == License.EVAL_EXPIRED || lic == License.REAL_EXPIRED ? true : null; String key = val == Validated.OLD_KEY ? "oldkey" : null; @@ -253,17 +253,16 @@ public class CvalAddonstCheckerUseCasesTest { restoreSystemOut(); message = e.getMessage(); if (res == Compile.YES) { - Assert.fail(testNumber + "Unexpected Exception: " - + e.getMessage()); + Assert.fail( + testNumber + "Unexpected Exception: " + e.getMessage()); } } // System.err.println("\n> " + testNumber + " " + lic + " " + ver + " " // + val + " " + net + " " + res + " " + cached + "\n" + message); - Assert.assertTrue(testNumber + "Fail:\n" + message - + "\nDoes not match:" + msg.msg, - message.matches("(?s).*" + msg.msg + ".*")); + Assert.assertTrue(testNumber + "Fail:\n" + message + "\nDoes not match:" + + msg.msg, message.matches("(?s).*" + msg.msg + ".*")); String c = cachedPreferences(productNameCval); Assert.assertTrue(testNumber + "Fail: cacheExists != " diff --git a/client-compiler/src/test/java/com/vaadin/tools/CvalCheckerTest.java b/client-compiler/src/test/java/com/vaadin/tools/CvalCheckerTest.java index 6e1a8e57ed..8333449a78 100644 --- a/client-compiler/src/test/java/com/vaadin/tools/CvalCheckerTest.java +++ b/client-compiler/src/test/java/com/vaadin/tools/CvalCheckerTest.java @@ -96,9 +96,8 @@ public class CvalCheckerTest { static final CvalServer expiredLicenseProviderWithMessage = new CvalServer() { @Override String askServer(String productName, String productKey, int timeout) { - return responseJson - .replace("'expired", - "'message':'Custom\\\\nServer\\\\nMessage','expired':true,'expired"); + return responseJson.replace("'expired", + "'message':'Custom\\\\nServer\\\\nMessage','expired':true,'expired"); } }; // A provider returning an expired license with a server message @@ -205,15 +204,15 @@ public class CvalCheckerTest { // Success if license key and version are valid System.setProperty(licenseName, VALID_KEY); - licenseChecker - .validateProduct(productNameCval, "2.1", productTitleCval); + licenseChecker.validateProduct(productNameCval, "2.1", + productTitleCval); Assert.assertTrue(cacheExists(productNameCval)); // Success if license and cache file are valid, although the license // server is offline licenseChecker.setLicenseProvider(unreachableLicenseProvider); - licenseChecker - .validateProduct(productNameCval, "2.1", productTitleCval); + licenseChecker.validateProduct(productNameCval, "2.1", + productTitleCval); Assert.assertTrue(cacheExists(productNameCval)); // Fail if license key changes although cache file were validated @@ -262,8 +261,8 @@ public class CvalCheckerTest { // Check an unlimited license deleteCache(productNameCval); licenseChecker.setLicenseProvider(unlimitedLicenseProvider); - licenseChecker - .validateProduct(productNameCval, "2.1", productTitleCval); + licenseChecker.validateProduct(productNameCval, "2.1", + productTitleCval); Assert.assertTrue(cacheExists(productNameCval)); // Fail if expired flag does not come, but expired epoch is in the past @@ -281,8 +280,8 @@ public class CvalCheckerTest { deleteCache(productNameCval); licenseChecker.setLicenseProvider(nullVersionLicenseProvider); - licenseChecker - .validateProduct(productNameCval, "2.1", productTitleCval); + licenseChecker.validateProduct(productNameCval, "2.1", + productTitleCval); Assert.assertTrue(cacheExists(productNameCval)); } @@ -290,8 +289,8 @@ public class CvalCheckerTest { * Creates a new .jar file with a MANIFEST.MF with all vaadin license info * attributes set, and add the .jar to the classpath */ - static void addLicensedJarToClasspath(String productName, String licenseType) - throws Exception { + static void addLicensedJarToClasspath(String productName, + String licenseType) throws Exception { // Create a manifest with Vaadin CVAL license Manifest testManifest = new Manifest(); testManifest.getMainAttributes().putValue("Manifest-Version", "1.0"); @@ -306,8 +305,8 @@ public class CvalCheckerTest { // Create a temporary Jar File testJarFile = File.createTempFile("vaadin." + productName, ".jar"); testJarFile.deleteOnExit(); - JarOutputStream target = new JarOutputStream(new FileOutputStream( - testJarFile), testManifest); + JarOutputStream target = new JarOutputStream( + new FileOutputStream(testJarFile), testManifest); target.close(); // Add the new jar to our classpath (use reflection) @@ -362,7 +361,8 @@ public class CvalCheckerTest { } static void restoreSystemOut() { - System.setOut(new PrintStream(new FileOutputStream(FileDescriptor.out))); + System.setOut( + new PrintStream(new FileOutputStream(FileDescriptor.out))); } @Test(expected = FileNotFoundException.class) @@ -374,8 +374,8 @@ public class CvalCheckerTest { public void testReadKeyFromFile_LicenseFileEmpty() throws Exception { File tmpLicenseFile = File.createTempFile("license", "lic"); - assertNull(licenseChecker.readKeyFromFile(tmpLicenseFile.toURI() - .toURL(), 4)); + assertNull(licenseChecker + .readKeyFromFile(tmpLicenseFile.toURI().toURL(), 4)); tmpLicenseFile.delete(); } @@ -388,8 +388,8 @@ public class CvalCheckerTest { out.println("this-is-a-license"); out.close(); - assertEquals("this-is-a-license", licenseChecker.readKeyFromFile( - tmpLicenseFile.toURI().toURL(), 4)); + assertEquals("this-is-a-license", licenseChecker + .readKeyFromFile(tmpLicenseFile.toURI().toURL(), 4)); tmpLicenseFile.delete(); } @@ -402,8 +402,8 @@ public class CvalCheckerTest { out.println("4=this-is-a-license"); out.close(); - assertEquals("this-is-a-license", licenseChecker.readKeyFromFile( - tmpLicenseFile.toURI().toURL(), 4)); + assertEquals("this-is-a-license", licenseChecker + .readKeyFromFile(tmpLicenseFile.toURI().toURL(), 4)); tmpLicenseFile.delete(); } @@ -417,10 +417,10 @@ public class CvalCheckerTest { out.println("5=this-is-another-license"); out.close(); - assertEquals("this-is-a-license", licenseChecker.readKeyFromFile( - tmpLicenseFile.toURI().toURL(), 4)); - assertEquals("this-is-another-license", licenseChecker.readKeyFromFile( - tmpLicenseFile.toURI().toURL(), 5)); + assertEquals("this-is-a-license", licenseChecker + .readKeyFromFile(tmpLicenseFile.toURI().toURL(), 4)); + assertEquals("this-is-another-license", licenseChecker + .readKeyFromFile(tmpLicenseFile.toURI().toURL(), 5)); tmpLicenseFile.delete(); } @@ -434,10 +434,10 @@ public class CvalCheckerTest { out.println("5 = this-is-another-license"); out.close(); - assertEquals("this-is-a-license", licenseChecker.readKeyFromFile( - tmpLicenseFile.toURI().toURL(), 4)); - assertEquals("this-is-another-license", licenseChecker.readKeyFromFile( - tmpLicenseFile.toURI().toURL(), 5)); + assertEquals("this-is-a-license", licenseChecker + .readKeyFromFile(tmpLicenseFile.toURI().toURL(), 4)); + assertEquals("this-is-another-license", licenseChecker + .readKeyFromFile(tmpLicenseFile.toURI().toURL(), 5)); tmpLicenseFile.delete(); } @@ -450,8 +450,8 @@ public class CvalCheckerTest { out.println("5 = this-is-another-license"); out.close(); - assertNull(licenseChecker.readKeyFromFile(tmpLicenseFile.toURI() - .toURL(), 3)); + assertNull(licenseChecker + .readKeyFromFile(tmpLicenseFile.toURI().toURL(), 3)); tmpLicenseFile.delete(); } @@ -464,12 +464,12 @@ public class CvalCheckerTest { out.println("5 = this-is-another-license"); out.close(); - assertEquals("this-is-a-license", licenseChecker.readKeyFromFile( - tmpLicenseFile.toURI().toURL(), 3)); - assertEquals("this-is-a-license", licenseChecker.readKeyFromFile( - tmpLicenseFile.toURI().toURL(), 4)); - assertEquals("this-is-another-license", licenseChecker.readKeyFromFile( - tmpLicenseFile.toURI().toURL(), 5)); + assertEquals("this-is-a-license", licenseChecker + .readKeyFromFile(tmpLicenseFile.toURI().toURL(), 3)); + assertEquals("this-is-a-license", licenseChecker + .readKeyFromFile(tmpLicenseFile.toURI().toURL(), 4)); + assertEquals("this-is-another-license", licenseChecker + .readKeyFromFile(tmpLicenseFile.toURI().toURL(), 5)); tmpLicenseFile.delete(); } @@ -483,12 +483,12 @@ public class CvalCheckerTest { out.println("this-is-a-license"); out.close(); - assertEquals("this-is-a-license", licenseChecker.readKeyFromFile( - tmpLicenseFile.toURI().toURL(), 3)); - assertEquals("this-is-a-license", licenseChecker.readKeyFromFile( - tmpLicenseFile.toURI().toURL(), 4)); - assertEquals("this-is-another-license", licenseChecker.readKeyFromFile( - tmpLicenseFile.toURI().toURL(), 5)); + assertEquals("this-is-a-license", licenseChecker + .readKeyFromFile(tmpLicenseFile.toURI().toURL(), 3)); + assertEquals("this-is-a-license", licenseChecker + .readKeyFromFile(tmpLicenseFile.toURI().toURL(), 4)); + assertEquals("this-is-another-license", licenseChecker + .readKeyFromFile(tmpLicenseFile.toURI().toURL(), 5)); tmpLicenseFile.delete(); } diff --git a/client/src/main/java/com/vaadin/client/AnimationUtil.java b/client/src/main/java/com/vaadin/client/AnimationUtil.java index 780d2039e1..ee39b42ee3 100644 --- a/client/src/main/java/com/vaadin/client/AnimationUtil.java +++ b/client/src/main/java/com/vaadin/client/AnimationUtil.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -23,7 +23,7 @@ import com.vaadin.client.AnimationUtil.AnimationEndListener; /** * Utility methods for working with CSS transitions and animations. - * + * * @author Vaadin Ltd * @since 7.3 */ @@ -31,9 +31,9 @@ public class AnimationUtil { /** * For internal use only. May be removed or replaced in the future. - * + * * Set the animation-duration CSS property. - * + * * @param elem * the element whose animation-duration to set * @param duration @@ -46,9 +46,9 @@ public class AnimationUtil { /** * For internal use only. May be removed or replaced in the future. - * + * * Set the animation-delay CSS property. - * + * * @param elem * the element whose animation-delay to set * @param delay @@ -69,13 +69,13 @@ public class AnimationUtil { callbackFunc.listener = listener; elem.addEventListener(@com.vaadin.client.AnimationUtil::ANIMATION_END_EVENT_NAME, callbackFunc, false); - + // Store function reference for later removal if(!elem._vaadin_animationend_callbacks) { elem._vaadin_animationend_callbacks = []; } elem._vaadin_animationend_callbacks.push(callbackFunc); - + return callbackFunc; }-*/; diff --git a/client/src/main/java/com/vaadin/client/ApplicationConfiguration.java b/client/src/main/java/com/vaadin/client/ApplicationConfiguration.java index a9fd9803c3..6adb5968e7 100644 --- a/client/src/main/java/com/vaadin/client/ApplicationConfiguration.java +++ b/client/src/main/java/com/vaadin/client/ApplicationConfiguration.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -62,7 +62,7 @@ public class ApplicationConfiguration implements EntryPoint { /** * Helper class for reading configuration options from the bootstap * javascript - * + * * @since 7.0 */ private static class JsoConfiguration extends JavaScriptObject { @@ -74,7 +74,7 @@ public class ApplicationConfiguration implements EntryPoint { * Reads a configuration parameter as a string. Please note that the * javascript value of the parameter should also be a string, or else an * undefined exception may be thrown. - * + * * @param name * name of the configuration parameter * @return value of the configuration parameter, or null if @@ -94,7 +94,7 @@ public class ApplicationConfiguration implements EntryPoint { * Reads a configuration parameter as a boolean object. Please note that * the javascript value of the parameter should also be a boolean, or * else an undefined exception may be thrown. - * + * * @param name * name of the configuration parameter * @return boolean value of the configuration paramter, or @@ -115,7 +115,7 @@ public class ApplicationConfiguration implements EntryPoint { * Reads a configuration parameter as an integer object. Please note * that the javascript value of the parameter should also be an integer, * or else an undefined exception may be thrown. - * + * * @param name * name of the configuration parameter * @return integer value of the configuration paramter, or @@ -138,7 +138,7 @@ public class ApplicationConfiguration implements EntryPoint { * an object with appropriate fields, or else an undefined exception may * be thrown when calling this method or when calling methods on the * returned object. - * + * * @param name * name of the configuration parameter * @return error message with the given name, or null if no @@ -152,7 +152,7 @@ public class ApplicationConfiguration implements EntryPoint { /** * Returns a native javascript object containing version information * from the server. - * + * * @return a javascript object with the version information */ private native JavaScriptObject getVersionInfoJSObject() @@ -162,9 +162,9 @@ public class ApplicationConfiguration implements EntryPoint { /** * Gets the version of the Vaadin framework used on the server. - * + * * @return a string with the version - * + * * @see com.vaadin.server.VaadinServlet#VERSION */ private native String getVaadinVersion() @@ -174,9 +174,9 @@ public class ApplicationConfiguration implements EntryPoint { /** * Gets the version of the Atmosphere framework. - * + * * @return a string with the version - * + * * @see org.atmosphere.util#getRawVersion() */ private native String getAtmosphereVersion() @@ -186,7 +186,7 @@ public class ApplicationConfiguration implements EntryPoint { /** * Gets the JS version used in the Atmosphere framework. - * + * * @return a string with the version */ private native String getAtmosphereJSVersion() @@ -206,7 +206,7 @@ public class ApplicationConfiguration implements EntryPoint { /** * Wraps a native javascript object containing fields for an error message - * + * * @since 7.0 */ public static final class ErrorMessage extends JavaScriptObject { @@ -268,9 +268,9 @@ public class ApplicationConfiguration implements EntryPoint { * Checks whether path info in requests to the server-side service should be * in a request parameter (named v-resourcePath) or appended to * the end of the service URL. - * + * * @see #getServiceUrl() - * + * * @return true if path info should be a request parameter; * false if the path info goes after the service URL */ @@ -282,7 +282,7 @@ public class ApplicationConfiguration implements EntryPoint { * Return the name of the parameter used to to send data to the service url. * This method should only be called if {@link #useServiceUrlPathParam()} is * true. - * + * * @since 7.1.6 * @return The parameter name, by default v-resourcePath */ @@ -300,9 +300,9 @@ public class ApplicationConfiguration implements EntryPoint { * {@link #useServiceUrlPathParam()} return true, the requested * path info should be in the v-resourcePath query parameter; * else the path info should be appended to the end of the URL. - * + * * @see #useServiceUrlPathParam() - * + * * @return the URL to the server-side service as a string */ public String getServiceUrl() { @@ -321,7 +321,7 @@ public class ApplicationConfiguration implements EntryPoint { /** * Gets the URL of the VAADIN directory on the server. - * + * * @return the URL of the VAADIN directory */ public String getVaadinDirUrl() { @@ -335,7 +335,7 @@ public class ApplicationConfiguration implements EntryPoint { /** * Gets the initial UIDL from the DOM, if it was provided during the init * process. - * + * * @return */ public String getUIDL() { @@ -355,7 +355,7 @@ public class ApplicationConfiguration implements EntryPoint { * instance. The UI id should be included in every request originating from * this instance in order to associate the request with the right UI * instance on the server. - * + * * @return the UI id */ public int getUIId() { @@ -418,7 +418,8 @@ public class ApplicationConfiguration implements EntryPoint { .intValue(); // null -> false - standalone = jsoConfiguration.getConfigBoolean("standalone") == Boolean.TRUE; + standalone = jsoConfiguration + .getConfigBoolean("standalone") == Boolean.TRUE; heartbeatInterval = jsoConfiguration .getConfigInteger("heartbeatInterval"); @@ -431,7 +432,7 @@ public class ApplicationConfiguration implements EntryPoint { /** * Starts the application with a given id by reading the configuration * options stored by the bootstrap javascript. - * + * * @param applicationId * id of the application to load, this is also the id of the html * element into which the application should be rendered. @@ -442,7 +443,8 @@ public class ApplicationConfiguration implements EntryPoint { @Override public void execute() { Profiler.enter("ApplicationConfiguration.startApplication"); - ApplicationConfiguration appConf = getConfigFromDOM(applicationId); + ApplicationConfiguration appConf = getConfigFromDOM( + applicationId); ApplicationConnection a = GWT .create(ApplicationConnection.class); a.init(widgetSet, appConf); @@ -461,7 +463,7 @@ public class ApplicationConfiguration implements EntryPoint { /** * Gets the configuration object for a specific application from the * bootstrap javascript. - * + * * @param appId * the id of the application to get configuration data for * @return a native javascript object containing the configuration data @@ -484,9 +486,9 @@ public class ApplicationConfiguration implements EntryPoint { /** * Return Atmosphere version. - * + * * @since 7.4 - * + * * @return Atmosphere version. */ public String getAtmosphereVersion() { @@ -495,9 +497,9 @@ public class ApplicationConfiguration implements EntryPoint { /** * Return Atmosphere JS version. - * + * * @since 7.4 - * + * * @return Atmosphere JS version. */ public String getAtmosphereJSVersion() { @@ -511,7 +513,8 @@ public class ApplicationConfiguration implements EntryPoint { // Initialize if not already loaded Integer currentTag = Integer.valueOf(tag); while (type == null && currentTag != null) { - String serverSideClassNameForTag = getServerSideClassNameForTag(currentTag); + String serverSideClassNameForTag = getServerSideClassNameForTag( + currentTag); if (TypeData.hasIdentifier(serverSideClassNameForTag)) { try { type = (Class) TypeData @@ -562,7 +565,7 @@ public class ApplicationConfiguration implements EntryPoint { * Returns all tags for given class. Tags are used in * {@link ApplicationConfiguration} to keep track of different classes and * their hierarchy - * + * * @since 7.2 * @param classname * name of class which tags we want @@ -624,9 +627,8 @@ public class ApplicationConfiguration implements EntryPoint { cmd.execute(); } callbacks.clear(); - } else if (dependenciesLoading == 0 - && !ConnectorBundleLoader.get().isBundleLoaded( - ConnectorBundleLoader.DEFERRED_BUNDLE_NAME)) { + } else if (dependenciesLoading == 0 && !ConnectorBundleLoader.get() + .isBundleLoaded(ConnectorBundleLoader.DEFERRED_BUNDLE_NAME)) { ConnectorBundleLoader.get().loadBundle( ConnectorBundleLoader.DEFERRED_BUNDLE_NAME, new BundleLoadCallback() { @@ -655,9 +657,8 @@ public class ApplicationConfiguration implements EntryPoint { // Don't run twice if the module has been inherited several times, // and don't continue if vaadinBootstrap was not executed. if (moduleLoaded || !vaadinBootstrapLoaded()) { - getLogger() - .log(Level.WARNING, - "vaadinBootstrap.js was not loaded, skipping vaadin application configuration."); + getLogger().log(Level.WARNING, + "vaadinBootstrap.js was not loaded, skipping vaadin application configuration."); return; } moduleLoaded = true; @@ -714,7 +715,8 @@ public class ApplicationConfiguration implements EntryPoint { @Override public void onFailure(Throwable reason) { - Window.alert("Failed to load Vaadin debug window styles"); + Window.alert( + "Failed to load Vaadin debug window styles"); } }); @@ -794,7 +796,7 @@ public class ApplicationConfiguration implements EntryPoint { * Registers that callback that the bootstrap javascript uses to start * applications once the widgetset is loaded and all required information is * available - * + * * @param widgetsetName * the name of this widgetset */ @@ -809,9 +811,9 @@ public class ApplicationConfiguration implements EntryPoint { * adding ?debug parameter to URI. Please note that debug mode is always * disabled if production mode is enabled, but disabling production mode * does not automatically enable debug mode. - * + * * @see #isProductionMode() - * + * * @return true if client side is currently been debugged */ public static boolean isDebugMode() { @@ -823,7 +825,7 @@ public class ApplicationConfiguration implements EntryPoint { * Checks if production mode is enabled. When production mode is enabled, * client-side logging is disabled. There may also be other performance * optimizations. - * + * * @since 7.1.2 * @return true if production mode is enabled; otherwise * false. @@ -843,7 +845,7 @@ public class ApplicationConfiguration implements EntryPoint { /** * Checks whether debug logging should be quiet - * + * * @return true if debug logging should be quiet */ public static boolean isQuietDebugMode() { @@ -855,7 +857,7 @@ public class ApplicationConfiguration implements EntryPoint { /** * Checks whether the widget set version has been sent to the server. It is * sent in the first UIDL request. - * + * * @return true if browser information has already been sent */ public boolean isWidgetsetVersionSent() { diff --git a/client/src/main/java/com/vaadin/client/ApplicationConnection.java b/client/src/main/java/com/vaadin/client/ApplicationConnection.java index 97ddd14764..bdf34d229c 100644 --- a/client/src/main/java/com/vaadin/client/ApplicationConnection.java +++ b/client/src/main/java/com/vaadin/client/ApplicationConnection.java @@ -69,14 +69,14 @@ import com.vaadin.shared.util.SharedUtil; * This is the client side communication "engine", managing client-server * communication with its server side counterpart * com.vaadin.server.VaadinService. - * + * * Client-side connectors receive updates from the corresponding server-side * connector (typically component) as state updates or RPC calls. The connector * has the possibility to communicate back with its server side counter part * through RPC calls. - * + * * TODO document better - * + * * Entry point classes (widgetsets) define onModuleLoad(). */ public class ApplicationConnection implements HasHandlers { @@ -100,18 +100,17 @@ public class ApplicationConnection implements HasHandlers { * A string that, if found in a non-JSON response to a UIDL request, will * cause the browser to refresh the page. If followed by a colon, optional * whitespace, and a URI, causes the browser to synchronously load the URI. - * + * *

    * This allows, for instance, a servlet filter to redirect the application * to a custom login page when the session expires. For example: *

    - * + * *
          * if (sessionExpired) {
          *     response.setHeader("Content-Type", "text/html");
    -     *     response.getWriter().write(
    -     *             myLoginPageHtml + "<!-- Vaadin-Refresh: "
    -     *                     + request.getContextPath() + " -->");
    +     *     response.getWriter().write(myLoginPageHtml + "<!-- Vaadin-Refresh: "
    +     *             + request.getContextPath() + " -->");
          * }
          * 
    */ @@ -156,7 +155,8 @@ public class ApplicationConnection implements HasHandlers { void onResponseHandlingEnded(ResponseHandlingEndedEvent e); } - public static class RequestStartingEvent extends ApplicationConnectionEvent { + public static class RequestStartingEvent + extends ApplicationConnectionEvent { public static Type TYPE = new Type(); @@ -175,8 +175,8 @@ public class ApplicationConnection implements HasHandlers { } } - public static class ResponseHandlingEndedEvent extends - ApplicationConnectionEvent { + public static class ResponseHandlingEndedEvent + extends ApplicationConnectionEvent { public static Type TYPE = new Type(); @@ -195,8 +195,8 @@ public class ApplicationConnection implements HasHandlers { } } - public static abstract class ApplicationConnectionEvent extends - GwtEvent { + public static abstract class ApplicationConnectionEvent + extends GwtEvent { private ApplicationConnection connection; @@ -210,8 +210,8 @@ public class ApplicationConnection implements HasHandlers { } - public static class ResponseHandlingStartedEvent extends - ApplicationConnectionEvent { + public static class ResponseHandlingStartedEvent + extends ApplicationConnectionEvent { public ResponseHandlingStartedEvent(ApplicationConnection connection) { super(connection); @@ -233,17 +233,17 @@ public class ApplicationConnection implements HasHandlers { /** * Event triggered when a application is stopped by calling * {@link ApplicationConnection#setApplicationRunning(false)}. - * + * * To listen for the event add a {@link ApplicationStoppedHandler} by * invoking * {@link ApplicationConnection#addHandler(ApplicationConnection.ApplicationStoppedEvent.Type, ApplicationStoppedHandler)} * to the {@link ApplicationConnection} - * + * * @since 7.1.8 * @author Vaadin Ltd */ - public static class ApplicationStoppedEvent extends - GwtEvent { + public static class ApplicationStoppedEvent + extends GwtEvent { public static Type TYPE = new Type(); @@ -265,7 +265,7 @@ public class ApplicationConnection implements HasHandlers { /** * Called when a communication error has occurred. Returning * true from this method suppresses error handling. - * + * * @param details * A string describing the error. * @param statusCode @@ -280,7 +280,7 @@ public class ApplicationConnection implements HasHandlers { * A listener for listening to application stopped events. The listener can * be added to a {@link ApplicationConnection} by invoking * {@link ApplicationConnection#addHandler(ApplicationStoppedEvent.Type, ApplicationStoppedHandler)} - * + * * @since 7.1.8 * @author Vaadin Ltd */ @@ -290,7 +290,7 @@ public class ApplicationConnection implements HasHandlers { * Triggered when the {@link ApplicationConnection} marks a previously * running application as stopped by invoking * {@link ApplicationConnection#setApplicationRunning(false)} - * + * * @param event * the event triggered by the {@link ApplicationConnection} */ @@ -351,8 +351,8 @@ public class ApplicationConnection implements HasHandlers { public ApplicationConnection() { // Assuming UI data is eagerly loaded - ConnectorBundleLoader.get().loadBundle( - ConnectorBundleLoader.EAGER_BUNDLE_NAME, null); + ConnectorBundleLoader.get() + .loadBundle(ConnectorBundleLoader.EAGER_BUNDLE_NAME, null); uIConnector = GWT.create(UIConnector.class); rpcManager = GWT.create(RpcManager.class); layoutManager = GWT.create(LayoutManager.class); @@ -368,9 +368,8 @@ public class ApplicationConnection implements HasHandlers { getLogger().info("Starting application " + cnf.getRootPanelId()); getLogger().info("Using theme: " + cnf.getThemeName()); - getLogger().info( - "Vaadin application servlet version: " - + cnf.getServletVersion()); + getLogger().info("Vaadin application servlet version: " + + cnf.getServletVersion()); if (!cnf.getServletVersion().equals(Version.getFullVersion())) { getLogger() @@ -428,7 +427,7 @@ public class ApplicationConnection implements HasHandlers { * called once this application has started (first response received) or * failed to start. This ensures that the applications are started in order, * to avoid session-id problems. - * + * */ public void start() { String jsonText = configuration.getUIDL(); @@ -440,8 +439,8 @@ public class ApplicationConnection implements HasHandlers { // Hack to avoid logging an error in endRequest() getMessageSender().startRequest(); - getMessageHandler().handleMessage( - MessageHandler.parseJson(jsonText)); + getMessageHandler() + .handleMessage(MessageHandler.parseJson(jsonText)); } // Tooltip can't be created earlier because the @@ -460,7 +459,7 @@ public class ApplicationConnection implements HasHandlers { /** * Checks if there is some work to be done on the client side - * + * * @return true if the client has some work to be done, false otherwise */ private boolean isActive() { @@ -535,7 +534,7 @@ public class ApplicationConnection implements HasHandlers { *
  • vaadin.postRequestHooks is a map of functions which gets * called after each XHR made by vaadin application. Note, that it is * attaching js functions responsibility to create the variable like this: - * + * *
          * if(!vaadin.postRequestHooks) {vaadin.postRequestHooks = new Object();}
          * postRequestHooks.myHook = function(appId) {
    @@ -546,7 +545,7 @@ public class ApplicationConnection implements HasHandlers {
          * 
    First parameter passed to these functions is the identifier * of Vaadin application that made the request. * - * + * * TODO make this multi-app aware */ private native void initializeClientHooks() @@ -577,7 +576,7 @@ public class ApplicationConnection implements HasHandlers { /** * Requests an analyze of layouts, to find inconsistencies. Exclusively used * for debugging during development. - * + * * @deprecated as of 7.1. Replaced by {@link UIConnector#analyzeLayouts()} */ @Deprecated @@ -589,7 +588,7 @@ public class ApplicationConnection implements HasHandlers { * Sends a request to the server to print details to console that will help * the developer to locate the corresponding server-side connector in the * source code. - * + * * @param serverConnector * @deprecated as of 7.1. Replaced by * {@link UIConnector#showServerDebugInfo(ServerConnector)} @@ -619,10 +618,9 @@ public class ApplicationConnection implements HasHandlers { // Show this message just once if (cssWaits++ == 0) { - getLogger().warning( - "Assuming CSS loading is not complete, " - + "postponing render phase. " - + "(.v-loading-indicator height == 0)"); + getLogger().warning("Assuming CSS loading is not complete, " + + "postponing render phase. " + + "(.v-loading-indicator height == 0)"); } } else { cssLoaded = true; @@ -637,7 +635,7 @@ public class ApplicationConnection implements HasHandlers { /** * Checks whether or not the CSS is loaded. By default checks the size of * the loading indicator element. - * + * * @return */ protected boolean isCSSLoaded() { @@ -647,12 +645,12 @@ public class ApplicationConnection implements HasHandlers { /** * Shows the communication error notification. - * + * * @param details * Optional details. * @param statusCode * The status code returned for the request - * + * */ public void showCommunicationError(String details, int statusCode) { getLogger().severe("Communication error: " + details); @@ -661,7 +659,7 @@ public class ApplicationConnection implements HasHandlers { /** * Shows the authentication error notification. - * + * * @param details * Optional details. */ @@ -672,7 +670,7 @@ public class ApplicationConnection implements HasHandlers { /** * Shows the session expiration notification. - * + * * @param details * Optional details. */ @@ -683,7 +681,7 @@ public class ApplicationConnection implements HasHandlers { /** * Shows an error notification. - * + * * @param details * Optional details. * @param message @@ -731,7 +729,7 @@ public class ApplicationConnection implements HasHandlers { *

    * Used by the native "client.isActive" function. *

    - * + * * @return true if deferred commands are (potentially) being executed, false * otherwise */ @@ -746,7 +744,7 @@ public class ApplicationConnection implements HasHandlers { /** * Returns the loading indicator used by this ApplicationConnection - * + * * @return The loading indicator for this ApplicationConnection */ public VLoadingIndicator getLoadingIndicator() { @@ -755,7 +753,7 @@ public class ApplicationConnection implements HasHandlers { /** * Determines whether or not the loading indicator is showing. - * + * * @return true if the loading indicator is visible * @deprecated As of 7.1. Use {@link #getLoadingIndicator()} and * {@link VLoadingIndicator#isVisible()}.isVisible() instead. @@ -775,9 +773,8 @@ public class ApplicationConnection implements HasHandlers { @Override public void onError(ResourceLoadEvent event) { - getLogger() - .severe(event.getResourceUrl() - + " could not be loaded, or the load detection failed because the stylesheet is empty."); + getLogger().severe(event.getResourceUrl() + + " could not be loaded, or the load detection failed because the stylesheet is empty."); // The show must go on onLoad(event); } @@ -865,7 +862,7 @@ public class ApplicationConnection implements HasHandlers { * is true, the update is sent as soon as possible. If immediate is false, * the update will be sent along with the next immediate update. *

    - * + * * @param paintableId * the id of the paintable that owns the variable * @param variableName @@ -887,7 +884,7 @@ public class ApplicationConnection implements HasHandlers { * is true, the update is sent as soon as possible. If immediate is false, * the update will be sent along with the next immediate update. *

    - * + * * @param paintableId * the id of the paintable that owns the variable * @param variableName @@ -910,7 +907,7 @@ public class ApplicationConnection implements HasHandlers { * is true, the update is sent as soon as possible. If immediate is false, * the update will be sent along with the next immediate update. *

    - * + * * @param paintableId * the id of the paintable that owns the variable * @param variableName @@ -933,7 +930,7 @@ public class ApplicationConnection implements HasHandlers { * is true, the update is sent as soon as possible. If immediate is false, * the update will be sent along with the next immediate update. *

    - * + * * @param paintableId * the id of the paintable that owns the variable * @param variableName @@ -956,7 +953,7 @@ public class ApplicationConnection implements HasHandlers { * is true, the update is sent as soon as possible. If immediate is false, * the update will be sent along with the next immediate update. *

    - * + * * @param paintableId * the id of the paintable that owns the variable * @param variableName @@ -979,7 +976,7 @@ public class ApplicationConnection implements HasHandlers { * is true, the update is sent as soon as possible. If immediate is false, * the update will be sent along with the next immediate update. *

    - * + * * @param paintableId * the id of the paintable that owns the variable * @param variableName @@ -1002,7 +999,7 @@ public class ApplicationConnection implements HasHandlers { * is true, the update is sent as soon as possible. If immediate is false, * the update will be sent along with the next immediate update. *

    - * + * * @param paintableId * the id of the paintable that owns the variable * @param variableName @@ -1025,7 +1022,7 @@ public class ApplicationConnection implements HasHandlers { * is true, the update is sent as soon as possible. If immediate is false, * the update will be sent along with the next immediate update. *

    - * + * * @param paintableId * the id of the paintable that owns the variable * @param variableName @@ -1048,7 +1045,7 @@ public class ApplicationConnection implements HasHandlers { * the update will be sent along with the next immediate update. *

    * A null array is sent as an empty array. - * + * * @param paintableId * the id of the paintable that owns the variable * @param variableName @@ -1071,7 +1068,7 @@ public class ApplicationConnection implements HasHandlers { * the update will be sent along with the next immediate update. *

    * A null array is sent as an empty array. - * + * * @param paintableId * the id of the paintable that owns the variable * @param variableName @@ -1088,7 +1085,7 @@ public class ApplicationConnection implements HasHandlers { /** * Does absolutely nothing. Replaced by {@link LayoutManager}. - * + * * @param container * @deprecated As of 7.0, serves no purpose */ @@ -1110,7 +1107,7 @@ public class ApplicationConnection implements HasHandlers { /** * Returns false - * + * * @param paintable * @return false, always * @deprecated As of 7.0, serves no purpose @@ -1122,7 +1119,7 @@ public class ApplicationConnection implements HasHandlers { /** * Returns false - * + * * @param paintable * @return false, always * @deprecated As of 7.0, serves no purpose @@ -1143,16 +1140,16 @@ public class ApplicationConnection implements HasHandlers { /** * Get either an existing ComponentConnector or create a new * ComponentConnector with the given type and id. - * + * * If a ComponentConnector with the given id already exists, returns it. * Otherwise creates and registers a new ComponentConnector of the given * type. - * + * * @param connectorId * Id of the paintable * @param connectorType * Type of the connector, as passed from the server side - * + * * @return Either an existing ComponentConnector or a new ComponentConnector * of the given type */ @@ -1165,15 +1162,15 @@ public class ApplicationConnection implements HasHandlers { /** * Creates a new ServerConnector with the given type and id. - * + * * Creates and registers a new ServerConnector of the given type. Should * never be called with the connector id of an existing connector. - * + * * @param connectorId * Id of the new connector * @param connectorType * Type of the connector, as passed from the server side - * + * * @return A new ServerConnector of the given type */ private ServerConnector createAndRegisterConnector(String connectorId, @@ -1193,7 +1190,7 @@ public class ApplicationConnection implements HasHandlers { /** * Gets a resource that has been pre-loaded via UIDL, such as custom * layouts. - * + * * @param name * identifier of the resource to get * @return the resource @@ -1205,7 +1202,7 @@ public class ApplicationConnection implements HasHandlers { /** * Sets a resource that has been pre-loaded via UIDL, such as custom * layouts. - * + * * @since 7.6 * @param name * identifier of the resource to Set @@ -1218,7 +1215,7 @@ public class ApplicationConnection implements HasHandlers { /** * Singleton method to get instance of app's context menu. - * + * * @return VContextMenu object */ public VContextMenu getContextMenu() { @@ -1233,7 +1230,7 @@ public class ApplicationConnection implements HasHandlers { /** * Gets an {@link Icon} instance corresponding to a URI. - * + * * @since 7.2 * @param uri * @return Icon object @@ -1255,7 +1252,7 @@ public class ApplicationConnection implements HasHandlers { * Translates custom protocols in UIDL URI's to be recognizable by browser. * All uri's from UIDL should be routed via this method before giving them * to browser due URI's in UIDL may contain custom protocols like theme://. - * + * * @param uidlUri * Vaadin URI from uidl * @return translated URI ready for browser @@ -1267,7 +1264,7 @@ public class ApplicationConnection implements HasHandlers { /** * Gets the URI for the current theme. Can be used to reference theme * resources. - * + * * @return URI to the current theme */ public String getThemeUri() { @@ -1284,7 +1281,7 @@ public class ApplicationConnection implements HasHandlers { /** * Use to notify that the given component's caption has changed; layouts may * have to be recalculated. - * + * * @param component * the Paintable whose caption has changed * @deprecated As of 7.0.2, has not had any effect for a long time @@ -1296,7 +1293,7 @@ public class ApplicationConnection implements HasHandlers { /** * Gets the main view - * + * * @return the main view */ public UIConnector getUIConnector() { @@ -1305,7 +1302,7 @@ public class ApplicationConnection implements HasHandlers { /** * Gets the {@link ApplicationConfiguration} for the current application. - * + * * @see ApplicationConfiguration * @return the configuration for this application */ @@ -1318,7 +1315,7 @@ public class ApplicationConnection implements HasHandlers { * list of events which has server side listeners is updated automatically * before the component is updated so the value is correct if called from * updatedFromUIDL. - * + * * @param connector * The connector to register event listeners for * @param eventIdentifier @@ -1337,7 +1334,7 @@ public class ApplicationConnection implements HasHandlers { /** * Adds the get parameters to the uri and returns the new uri that contains * the parameters. - * + * * @param uri * The uri to which the parameters should be added. * @param extraParams @@ -1361,14 +1358,13 @@ public class ApplicationConnection implements HasHandlers { */ @Deprecated public void unregisterPaintable(ServerConnector p) { - getLogger().info( - "unregisterPaintable (unnecessarily) called for " - + Util.getConnectorString(p)); + getLogger().info("unregisterPaintable (unnecessarily) called for " + + Util.getConnectorString(p)); } /** * Get VTooltip instance related to application connection - * + * * @return VTooltip instance */ public VTooltip getVTooltip() { @@ -1380,7 +1376,7 @@ public class ApplicationConnection implements HasHandlers { * this method is now handled by the state change event handler in * AbstractComponentConnector. The only function this method has is to * return true if the UIDL is a "cached" update. - * + * * @param component * @param uidl * @param manageCaption @@ -1397,10 +1393,8 @@ public class ApplicationConnection implements HasHandlers { } if (!manageCaption) { - getLogger() - .warning( - Util.getConnectorString(connector) - + " called updateComponent with manageCaption=false. The parameter was ignored - override delegateCaption() to return false instead. It is however not recommended to use caption this way at all."); + getLogger().warning(Util.getConnectorString(connector) + + " called updateComponent with manageCaption=false. The parameter was ignored - override delegateCaption() to return false instead. It is however not recommended to use caption this way at all."); } return false; } @@ -1433,7 +1427,7 @@ public class ApplicationConnection implements HasHandlers { * Schedules a heartbeat request to occur after the configured heartbeat * interval elapses if the interval is a positive number. Otherwise, does * nothing. - * + * * @deprecated as of 7.2, use {@link Heartbeat#schedule()} instead */ @Deprecated @@ -1447,7 +1441,7 @@ public class ApplicationConnection implements HasHandlers { * Heartbeat requests are used to inform the server that the client-side is * still alive. If the client page is closed or the connection lost, the * server will eventually close the inactive UI. - * + * * @deprecated as of 7.2, use {@link Heartbeat#send()} instead */ @Deprecated @@ -1470,41 +1464,39 @@ public class ApplicationConnection implements HasHandlers { /** * Sets the delegate that is called whenever a communication error occurrs. - * + * * @param delegate * the delegate. */ - public void setCommunicationErrorDelegate(CommunicationErrorHandler delegate) { + public void setCommunicationErrorDelegate( + CommunicationErrorHandler delegate) { communicationErrorDelegate = delegate; } public void setApplicationRunning(boolean applicationRunning) { if (getApplicationState() == ApplicationState.TERMINATED) { if (applicationRunning) { - getLogger() - .severe("Tried to restart a terminated application. This is not supported"); + getLogger().severe( + "Tried to restart a terminated application. This is not supported"); } else { - getLogger() - .warning( - "Tried to stop a terminated application. This should not be done"); + getLogger().warning( + "Tried to stop a terminated application. This should not be done"); } return; } else if (getApplicationState() == ApplicationState.INITIALIZING) { if (applicationRunning) { applicationState = ApplicationState.RUNNING; } else { - getLogger() - .warning( - "Tried to stop the application before it has started. This should not be done"); + getLogger().warning( + "Tried to stop the application before it has started. This should not be done"); } } else if (getApplicationState() == ApplicationState.RUNNING) { if (!applicationRunning) { applicationState = ApplicationState.TERMINATED; eventBus.fireEvent(new ApplicationStoppedEvent()); } else { - getLogger() - .warning( - "Tried to start an already running application. This should not be done"); + getLogger().warning( + "Tried to start an already running application. This should not be done"); } } } @@ -1512,7 +1504,7 @@ public class ApplicationConnection implements HasHandlers { /** * Checks if the application is in the {@link ApplicationState#RUNNING} * state. - * + * * @since 7.6 * @return true if the application is in the running state, false otherwise */ @@ -1544,7 +1536,7 @@ public class ApplicationConnection implements HasHandlers { /** * Gets the active connector for focused element in browser. - * + * * @return Connector for focused element or null. */ private ComponentConnector getActiveConnector() { @@ -1572,7 +1564,7 @@ public class ApplicationConnection implements HasHandlers { * "initializing" to "running" to "stopped". There is no way for an * application to go back to a previous state, i.e. a stopped application * can never be re-started - * + * * @since 7.6 * @return the current state of this application */ @@ -1582,7 +1574,7 @@ public class ApplicationConnection implements HasHandlers { /** * Gets the server RPC queue for this application - * + * * @since 7.6 * @return the server RPC queue */ @@ -1592,7 +1584,7 @@ public class ApplicationConnection implements HasHandlers { /** * Gets the communication error handler for this application - * + * * @since 7.6 * @return the server RPC queue */ @@ -1602,7 +1594,7 @@ public class ApplicationConnection implements HasHandlers { /** * Gets the (server to client) message handler for this application - * + * * @since 7.6 * @return the message handler */ @@ -1612,7 +1604,7 @@ public class ApplicationConnection implements HasHandlers { /** * Gets the server rpc manager for this application - * + * * @since 7.6 * @return the server rpc manager */ @@ -1622,7 +1614,7 @@ public class ApplicationConnection implements HasHandlers { /** * Gets the (client to server) message sender for this application - * + * * @since 7.6 * @return the message sender */ diff --git a/client/src/main/java/com/vaadin/client/BrowserInfo.java b/client/src/main/java/com/vaadin/client/BrowserInfo.java index d1592c95f4..f037fba175 100644 --- a/client/src/main/java/com/vaadin/client/BrowserInfo.java +++ b/client/src/main/java/com/vaadin/client/BrowserInfo.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,10 +21,10 @@ import com.vaadin.shared.VBrowserDetails; /** * Class used to query information about web browser. - * + * * Browser details are detected only once and those are stored in this singleton * class. - * + * */ public class BrowserInfo { @@ -60,7 +60,7 @@ public class BrowserInfo { /** * Singleton method to get BrowserInfo object. - * + * * @return instance of BrowserInfo object */ public static BrowserInfo get() { @@ -122,19 +122,19 @@ public class BrowserInfo { * Returns a string representing the browser in use, for use in CSS * classnames. The classnames will be space separated abbreviations, * optionally with a version appended. - * + * * Abbreviations: Firefox: ff Internet Explorer: ie Safari: sa Opera: op - * + * * Browsers that CSS-wise behave like each other will get the same * abbreviation (this usually depends on the rendering engine). - * + * * This is quite simple at the moment, more heuristics will be added when * needed. - * + * * Examples: Internet Explorer 6: ".v-ie .v-ie6 .v-ie60", Firefox 3.0.4: * ".v-ff .v-ff3 .v-ff30", Opera 9.60: ".v-op .v-op9 .v-op960", Opera 10.10: * ".v-op .v-op10 .v-op1010" - * + * * @return */ public String getCSSClass() { @@ -284,7 +284,7 @@ public class BrowserInfo { /** * Returns the Gecko version if the browser is Gecko based. The Gecko * version for Firefox 2 is 1.8 and 1.9 for Firefox 3. - * + * * @return The Gecko version or -1 if the browser is not Gecko based */ public float getGeckoVersion() { @@ -298,7 +298,7 @@ public class BrowserInfo { /** * Returns the WebKit version if the browser is WebKit based. The WebKit * version returned is the major version e.g., 523. - * + * * @return The WebKit version or -1 if the browser is not WebKit based */ public float getWebkitVersion() { @@ -362,7 +362,7 @@ public class BrowserInfo { /** * Indicates whether the browser might require juggling to properly update * sizes inside elements with overflow: auto. - * + * * @return true if the browser requires the workaround, * otherwise false */ @@ -379,7 +379,7 @@ public class BrowserInfo { *

    * See https://bugs.webkit.org/show_bug.cgi?id=123958 and * http://code.google.com/p/chromium/issues/detail?id=316549 - * + * * @since 7.1.8 * @return true if the browser requires the workaround, * otherwise false @@ -391,7 +391,7 @@ public class BrowserInfo { /** * Checks if the browser is run on iOS - * + * * @return true if the browser is run on iOS, false otherwise */ public boolean isIOS() { @@ -400,7 +400,7 @@ public class BrowserInfo { /** * Checks if the browser is run on iOS 6. - * + * * @since 7.1.1 * @return true if the browser is run on iOS 6, false otherwise */ @@ -410,7 +410,7 @@ public class BrowserInfo { /** * Checks if the browser is run on Android - * + * * @return true if the browser is run on Android, false otherwise */ public boolean isAndroid() { @@ -420,7 +420,7 @@ public class BrowserInfo { /** * Checks if the browser is capable of handling scrolling natively or if a * touch scroll helper is needed for scrolling. - * + * * @return true if browser needs a touch scroll helper, false if the browser * can handle scrolling natively */ @@ -448,13 +448,13 @@ public class BrowserInfo { /** * Tests if this is an Android devices with a broken scrollTop * implementation - * + * * @return true if scrollTop cannot be trusted on this device, false * otherwise */ public boolean isAndroidWithBrokenScrollTop() { - return isAndroid() - && (getOperatingSystemMajorVersion() == 3 || getOperatingSystemMajorVersion() == 4); + return isAndroid() && (getOperatingSystemMajorVersion() == 3 + || getOperatingSystemMajorVersion() == 4); } public boolean isAndroid23() { @@ -477,7 +477,7 @@ public class BrowserInfo { * Note that Internet Explorer 8 and newer will return the document mode so * IE8 rendering as IE7 will return 7. *

    - * + * * @return The major version of the browser. */ public int getBrowserMajorVersion() { @@ -486,9 +486,9 @@ public class BrowserInfo { /** * Returns the browser minor version e.g., 5 for Firefox 3.5. - * + * * @see #getBrowserMajorVersion() - * + * * @return The minor version of the browser, or -1 if not known/parsed. */ public int getBrowserMinorVersion() { @@ -498,7 +498,7 @@ public class BrowserInfo { /** * Checks if the browser version is newer or equal to the given major+minor * version. - * + * * @param majorVersion * The major version to check for * @param minorVersion diff --git a/client/src/main/java/com/vaadin/client/CSSRule.java b/client/src/main/java/com/vaadin/client/CSSRule.java index a1ddce6d0a..2e75b6a58e 100644 --- a/client/src/main/java/com/vaadin/client/CSSRule.java +++ b/client/src/main/java/com/vaadin/client/CSSRule.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -26,7 +26,7 @@ public class CSSRule { private JavaScriptObject rules = null; /** - * + * * @param selector * the CSS selector to search for in the stylesheets * @param deep @@ -108,7 +108,7 @@ public class CSSRule { /** * Returns a specific property value from this CSS rule. - * + * * @param propertyName * camelCase CSS property name * @return the value of the property as a String diff --git a/client/src/main/java/com/vaadin/client/ComponentConnector.java b/client/src/main/java/com/vaadin/client/ComponentConnector.java index d0c943d553..f70f3cfc62 100644 --- a/client/src/main/java/com/vaadin/client/ComponentConnector.java +++ b/client/src/main/java/com/vaadin/client/ComponentConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -24,7 +24,7 @@ import com.vaadin.shared.AbstractComponentState; * An interface used by client-side widgets or paintable parts to receive * updates from the corresponding server-side components in the form of * {@link UIDL}. - * + * * Updates can be sent back to the server using the * {@link ApplicationConnection#updateVariable()} methods. */ @@ -32,7 +32,7 @@ public interface ComponentConnector extends ServerConnector { /* * (non-Javadoc) - * + * * @see com.vaadin.client.VPaintable#getState() */ @Override @@ -49,7 +49,7 @@ public interface ComponentConnector extends ServerConnector { * Returns true if the width of this paintable is currently * undefined. If the width is undefined, the actual width of the paintable * is defined by its contents. - * + * * @return true if the width is undefined, else * false */ @@ -59,7 +59,7 @@ public interface ComponentConnector extends ServerConnector { * Returns true if the height of this paintable is currently * undefined. If the height is undefined, the actual height of the paintable * is defined by its contents. - * + * * @return true if the height is undefined, else * false */ @@ -69,7 +69,7 @@ public interface ComponentConnector extends ServerConnector { * Returns true if the width of this paintable is currently * relative. If the width is relative, the actual width of the paintable is * a percentage of the size allocated to it by its parent. - * + * * @return true if the width is undefined, else * false */ @@ -79,7 +79,7 @@ public interface ComponentConnector extends ServerConnector { * Returns true if the height of this paintable is currently * relative. If the height is relative, the actual height of the paintable * is a percentage of the size allocated to it by its parent. - * + * * @return true if the width is undefined, else * false */ @@ -87,7 +87,7 @@ public interface ComponentConnector extends ServerConnector { /** * Checks if the connector is read only. - * + * * @deprecated This belongs in AbstractFieldConnector, see #8514 * @return true */ @@ -97,13 +97,13 @@ public interface ComponentConnector extends ServerConnector { /** * Return true if parent handles caption, false if the paintable handles the * caption itself. - * + * *

    * This should always return true and all components should let the parent * handle the caption and use other attributes for internal texts in the * component *

    - * + * * @return true if caption handling is delegated to the parent, false if * parent should not be allowed to render caption */ @@ -111,7 +111,7 @@ public interface ComponentConnector extends ServerConnector { /** * Sets the enabled state of the widget associated to this connector. - * + * * @param widgetEnabled * true if the widget should be enabled, false otherwise */ @@ -124,7 +124,7 @@ public interface ComponentConnector extends ServerConnector { * overridden to return true in all situations where this * method might return a non-empty result. *

    - * + * * @param element * The element to lookup a tooltip for * @return The tooltip for the element or null if no tooltip is defined for @@ -140,7 +140,7 @@ public interface ComponentConnector extends ServerConnector { * This is only done to optimize performance, so in cases where the status * is not known, it's safer to return true so that there will * be a tooltip handler even though it might not be needed in all cases. - * + * * @return true if some part of the component might have a * tooltip, otherwise false */ diff --git a/client/src/main/java/com/vaadin/client/ComponentDetail.java b/client/src/main/java/com/vaadin/client/ComponentDetail.java index 9e5e2a82a8..a6a1878407 100644 --- a/client/src/main/java/com/vaadin/client/ComponentDetail.java +++ b/client/src/main/java/com/vaadin/client/ComponentDetail.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -30,7 +30,7 @@ class ComponentDetail { /** * Returns a TooltipInfo assosiated with Component. If element is given, * returns an additional TooltipInfo. - * + * * @param key * @return the tooltipInfo */ diff --git a/client/src/main/java/com/vaadin/client/ComponentDetailMap.java b/client/src/main/java/com/vaadin/client/ComponentDetailMap.java index c99ebd2738..498e28c28b 100644 --- a/client/src/main/java/com/vaadin/client/ComponentDetailMap.java +++ b/client/src/main/java/com/vaadin/client/ComponentDetailMap.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ComputedStyle.java b/client/src/main/java/com/vaadin/client/ComputedStyle.java index 65a6e69019..f887dbb7d1 100644 --- a/client/src/main/java/com/vaadin/client/ComputedStyle.java +++ b/client/src/main/java/com/vaadin/client/ComputedStyle.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -29,7 +29,7 @@ public class ComputedStyle { *

    * Note that this method is expensive. Wherever possible, reuse the returned * object. - * + * * @param elem * the element * @return the computed style @@ -44,18 +44,18 @@ public class ComputedStyle { if(elem.nodeType != 1) { return {}; } - + if($wnd.document.defaultView && $wnd.document.defaultView.getComputedStyle) { return $wnd.document.defaultView.getComputedStyle(elem, null); } - + if(elem.currentStyle) { return elem.currentStyle; } }-*/; /** - * + * * @param name * name of the CSS property in camelCase * @return the value of the property, normalized for across browsers (each @@ -65,7 +65,7 @@ public class ComputedStyle { /*-{ var cs = this.@com.vaadin.client.ComputedStyle::computedStyle; var elem = this.@com.vaadin.client.ComputedStyle::elem; - + // Border values need to be checked separately. The width might have a // meaningful value even if the border style is "none". In that case the // value should be 0. @@ -80,13 +80,13 @@ public class ComputedStyle { } if(cs.getPropertyValue) { - + // Convert name to dashed format name = name.replace(/([A-Z])/g, "-$1").toLowerCase(); var ret = cs.getPropertyValue(name); - + } else { - + var ret = cs[name]; var style = elem.style; @@ -98,25 +98,25 @@ public class ComputedStyle { if ( !/^\d+(px)?$/i.test( ret ) && /^\d/.test( ret ) ) { // Remember the original values var left = style.left, rsLeft = elem.runtimeStyle.left; - + // Put in the new values to get a computed value out elem.runtimeStyle.left = cs.left; style.left = ret || 0; ret = style.pixelLeft + "px"; - + // Revert the changed values style.left = left; elem.runtimeStyle.left = rsLeft; } - + } - + // Normalize margin values. This is not totally valid, but in most cases // it is what the user wants to know. if(name.indexOf("margin") > -1 && ret == "auto") { return "0px"; } - + // Some browsers return undefined width and height values as "auto", so // we need to retrieve those ourselves. if (name == "width" && ret == "auto") { @@ -126,14 +126,14 @@ public class ComputedStyle { } return ret; - + }-*/; /** * Retrieves the given computed property as an integer - * + * * Returns 0 if the property cannot be converted to an integer - * + * * @param name * the property to retrieve * @return the integer value of the property or 0 @@ -148,9 +148,9 @@ public class ComputedStyle { /** * Retrieves the given computed property as a double - * + * * Returns NaN if the property cannot be converted to a double - * + * * @since 7.5.1 * @param name * the property to retrieve @@ -205,7 +205,7 @@ public class ComputedStyle { /** * Returns the current width from the DOM. - * + * * @since 7.5.1 * @return the computed width */ @@ -215,7 +215,7 @@ public class ComputedStyle { /** * Returns the current height from the DOM. - * + * * @since 7.5.1 * @return the computed height */ @@ -225,13 +225,13 @@ public class ComputedStyle { /** * Takes a String value e.g. "12px" and parses that to Integer 12. - * + * * @param String * a value starting with a number * @return Integer the value from the string before any non-numeric * characters. If the value cannot be parsed to a number, returns * null. - * + * * @deprecated Since 7.1.4, the method {@link #parseIntNative(String)} is * used internally and this method does not belong in the public * API of {@link ComputedStyle}. {@link #parseInt(String)} might @@ -250,10 +250,10 @@ public class ComputedStyle { /** * Takes a String value e.g. "12px" and parses that to int 12. - * + * *

    * This method returns 0 for NaN. - * + * * @param String * a value starting with a number * @return int the value from the string before any non-numeric characters. @@ -270,7 +270,7 @@ public class ComputedStyle { /** * Takes a String value e.g. "12.3px" and parses that to a double, 12.3. - * + * * @param String * a value starting with a number * @return the value from the string before any non-numeric characters or @@ -283,7 +283,7 @@ public class ComputedStyle { /** * Returns the sum of the top and bottom border width - * + * * @since 7.5.3 * @return the sum of the top and bottom border */ @@ -296,7 +296,7 @@ public class ComputedStyle { /** * Returns the sum of the left and right border width - * + * * @since 7.5.3 * @return the sum of the left and right border */ @@ -309,7 +309,7 @@ public class ComputedStyle { /** * Returns the sum of the top and bottom padding - * + * * @since 7.5.3 * @return the sum of the top and bottom padding */ @@ -322,7 +322,7 @@ public class ComputedStyle { /** * Returns the sum of the top and bottom padding - * + * * @since 7.5.3 * @return the sum of the left and right padding */ @@ -335,7 +335,7 @@ public class ComputedStyle { /** * Returns the sum of the top and bottom margin - * + * * @since 7.5.6 * @return the sum of the top and bottom margin */ @@ -348,7 +348,7 @@ public class ComputedStyle { /** * Returns the sum of the top and bottom margin - * + * * @since 7.5.6 * @return the sum of the left and right margin */ diff --git a/client/src/main/java/com/vaadin/client/ConnectorHierarchyChangeEvent.java b/client/src/main/java/com/vaadin/client/ConnectorHierarchyChangeEvent.java index 419f052324..a46b191aa1 100644 --- a/client/src/main/java/com/vaadin/client/ConnectorHierarchyChangeEvent.java +++ b/client/src/main/java/com/vaadin/client/ConnectorHierarchyChangeEvent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -29,13 +29,13 @@ import com.vaadin.client.ui.AbstractHasComponentsConnector; * hierarchy. A {@link ConnectorHierarchyChangedEvent} is fired when an update * from the server has been fully processed and all hierarchy updates have been * completed. - * + * * @author Vaadin Ltd * @since 7.0.0 - * + * */ -public class ConnectorHierarchyChangeEvent extends - AbstractServerConnectorEvent { +public class ConnectorHierarchyChangeEvent + extends AbstractServerConnectorEvent { /** * Type of this event, used by the event bus. */ @@ -49,7 +49,7 @@ public class ConnectorHierarchyChangeEvent extends /** * Returns a collection of the old children for the connector. This was the * state before the update was received from the server. - * + * * @return A collection of old child connectors. Never returns null. */ public List getOldChildren() { @@ -58,7 +58,7 @@ public class ConnectorHierarchyChangeEvent extends /** * Sets the collection of the old children for the connector. - * + * * @param oldChildren * The old child connectors. Must not be null. */ @@ -68,7 +68,7 @@ public class ConnectorHierarchyChangeEvent extends /** * Returns the {@link HasComponentsConnector} for which this event occurred. - * + * * @return The {@link HasComponentsConnector} whose child collection has * changed. Never returns null. */ @@ -90,8 +90,8 @@ public class ConnectorHierarchyChangeEvent extends * implement this interface, but instead make your connector class extend * {@link AbstractHasComponentsConnector} or an appropriate subclass. */ - public interface ConnectorHierarchyChangeHandler extends Serializable, - EventHandler { + public interface ConnectorHierarchyChangeHandler + extends Serializable, EventHandler { /** * Called by the framework when the list of child components of the * connector implementing this interface has changed. The implementation @@ -112,7 +112,7 @@ public class ConnectorHierarchyChangeEvent extends * parent connector might not yet have detached a child widget and that * the widget of a removed child might already have been attached by its * new parent. - * + * * @param connectorHierarchyChangeEvent * the event with information about the hierarchy change */ diff --git a/client/src/main/java/com/vaadin/client/ConnectorMap.java b/client/src/main/java/com/vaadin/client/ConnectorMap.java index 3200dd6ab4..d6506db673 100644 --- a/client/src/main/java/com/vaadin/client/ConnectorMap.java +++ b/client/src/main/java/com/vaadin/client/ConnectorMap.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -26,7 +26,8 @@ import com.google.gwt.user.client.ui.Widget; public class ConnectorMap { - public static ConnectorMap get(ApplicationConnection applicationConnection) { + public static ConnectorMap get( + ApplicationConnection applicationConnection) { return applicationConnection.getConnectorMap(); } @@ -36,7 +37,7 @@ public class ConnectorMap { /** * Returns a {@link ServerConnector} by its id - * + * * @param id * The connector id * @return A connector or null if a connector with the given id has not been @@ -53,7 +54,7 @@ public class ConnectorMap { /** * Returns a {@link ComponentConnector} element by its root element. - * + * * @param element * Root element of the {@link ComponentConnector} * @return A connector or null if a connector with the given id has not been @@ -81,7 +82,7 @@ public class ConnectorMap { /** * FIXME: What does this even do and why? - * + * * @param pid * @return */ @@ -91,7 +92,7 @@ public class ConnectorMap { /** * Checks if a connector with the given id has been registered. - * + * * @param connectorId * The id to check for * @return true if a connector has been registered with the given id, false @@ -110,7 +111,7 @@ public class ConnectorMap { /** * Retrieves the connector whose widget matches the parameter. - * + * * @param widget * The widget * @return A connector with {@literal widget} as its root widget or null if @@ -144,7 +145,7 @@ public class ConnectorMap { * Gets the connector id using a DOM element - the element should be the * root element for a connector, otherwise no id will be found. Use * {@link #getConnectorId(ServerConnector)} instead whenever possible. - * + * * @see #getConnectorId(ServerConnector) * @param el * element of the connector whose id is desired @@ -158,7 +159,7 @@ public class ConnectorMap { /** * Gets the main element for the connector with the given id. The reverse of * {@link #getConnectorId(Element)}. - * + * * @param connectorId * the id of the widget whose element is desired * @return the element for the connector corresponding to the id @@ -177,7 +178,7 @@ public class ConnectorMap { * This method does not remove the connector from the DOM, but marks the * connector so that ApplicationConnection may clean up its references to * it. Removing the widget from DOM is component containers responsibility. - * + * * @param connector * the connector to remove */ @@ -208,9 +209,9 @@ public class ConnectorMap { /** * Gets all registered {@link ComponentConnector} instances - * + * * @return An array of all registered {@link ComponentConnector} instances - * + * * @deprecated As of 7.0.1, use {@link #getComponentConnectorsAsJsArray()} * for better performance. */ @@ -259,7 +260,7 @@ public class ConnectorMap { /** * @return - * + * * @deprecated As of 7.0.1, use {@link #getConnectorsAsJsArray()} for * improved performance. */ @@ -290,7 +291,7 @@ public class ConnectorMap { /** * Tests if the widget is the root widget of a {@link ComponentConnector}. - * + * * @param widget * The widget to test * @return true if the widget is the root widget of a diff --git a/client/src/main/java/com/vaadin/client/ContainerResizedListener.java b/client/src/main/java/com/vaadin/client/ContainerResizedListener.java index 702542f0ac..2cacc78b38 100644 --- a/client/src/main/java/com/vaadin/client/ContainerResizedListener.java +++ b/client/src/main/java/com/vaadin/client/ContainerResizedListener.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -19,7 +19,7 @@ package com.vaadin.client; /** * ContainerResizedListener interface is useful for Widgets that support * relative sizes and who need some additional sizing logic. - * + * * @deprecated As of 7.0, serves no purpose. Use {@link LayoutManager} and its * methods instead. */ @@ -31,9 +31,9 @@ public interface ContainerResizedListener { * function on its ancestors that implement NeedsLayout in case their * container has resized. runAnchestorsLayout(HasWidgets parent) function * from Util class may be a good helper for this. - * + * * @deprecated As of 7.0, this method is never called by the framework. - * + * */ @Deprecated public void iLayout(); diff --git a/client/src/main/java/com/vaadin/client/DateTimeService.java b/client/src/main/java/com/vaadin/client/DateTimeService.java index 04006d85fb..af7e861edb 100644 --- a/client/src/main/java/com/vaadin/client/DateTimeService.java +++ b/client/src/main/java/com/vaadin/client/DateTimeService.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -27,9 +27,9 @@ import com.vaadin.shared.ui.datefield.Resolution; /** * This class provides date/time parsing services to all components on the * client side. - * + * * @author Vaadin Ltd. - * + * */ @SuppressWarnings("deprecation") public class DateTimeService { @@ -48,7 +48,7 @@ public class DateTimeService { /** * Creates a new date time service with a given locale. - * + * * @param locale * e.g. fi, en etc. * @throws LocaleNotLoadedException @@ -152,8 +152,8 @@ public class DateTimeService { try { firstDay = LocaleService.getFirstDayOfWeek(currentLocale); } catch (final LocaleNotLoadedException e) { - getLogger().log(Level.SEVERE, - "Locale not loaded, using fallback 0", e); + getLogger().log(Level.SEVERE, "Locale not loaded, using fallback 0", + e); firstDay = 0; } int start = dateForFirstOfThisMonth.getDay() - firstDay; @@ -261,7 +261,7 @@ public class DateTimeService { /** * Returns the ISO-8601 week number of the given date. - * + * * @param date * The date for which the week number should be resolved * @return The ISO-8601 week number for {@literal date} @@ -278,16 +278,16 @@ public class DateTimeService { // Find nearest thursday (defines the week in ISO 8601). The week number // for the nearest thursday is the same as for the target date. int nearestThursdayDiff = 4 - dayOfWeek; // 4 is thursday - Date nearestThursday = new Date(date.getTime() + nearestThursdayDiff - * MILLISECONDS_PER_DAY); + Date nearestThursday = new Date( + date.getTime() + nearestThursdayDiff * MILLISECONDS_PER_DAY); Date firstOfJanuary = new Date(nearestThursday.getYear(), 0, 1); long timeDiff = nearestThursday.getTime() - firstOfJanuary.getTime(); // Rounding the result, as the division doesn't result in an integer // when the given date is inside daylight saving time period. - int daysSinceFirstOfJanuary = (int) Math.round((double) timeDiff - / MILLISECONDS_PER_DAY); + int daysSinceFirstOfJanuary = (int) Math + .round((double) timeDiff / MILLISECONDS_PER_DAY); int weekNumber = (daysSinceFirstOfJanuary) / 7 + 1; @@ -299,11 +299,11 @@ public class DateTimeService { * it to the month name since DateTimeFormat.format always uses the current * locale and will replace the month name wrong if current locale is * different from the locale set for the DateField. - * + * * MMMM is converted into long month name, MMM is converted into short month * name. '' are added around the name to avoid that DateTimeFormat parses * the month name as a pattern. - * + * * @param date * The date to convert * @param formatStr @@ -343,8 +343,8 @@ public class DateTimeService { formatStr = formatStr.replaceAll("'([E]{4,})'", dayName); formatStr = formatStr.replaceAll("([E]{4,})'", "'" + dayName); formatStr = formatStr.replaceAll("'([E]{4,})", dayName + "'"); - formatStr = formatStr - .replaceAll("[E]{4,}", "'" + dayName + "'"); + formatStr = formatStr.replaceAll("[E]{4,}", + "'" + dayName + "'"); } } @@ -363,8 +363,8 @@ public class DateTimeService { formatStr = formatStr.replaceAll("'([E]{3,})'", dayName); formatStr = formatStr.replaceAll("([E]{3,})'", "'" + dayName); formatStr = formatStr.replaceAll("'([E]{3,})", dayName + "'"); - formatStr = formatStr - .replaceAll("[E]{3,}", "'" + dayName + "'"); + formatStr = formatStr.replaceAll("[E]{3,}", + "'" + dayName + "'"); } } @@ -386,8 +386,8 @@ public class DateTimeService { formatStr = formatStr.replaceAll("'([M]{4,})'", monthName); formatStr = formatStr.replaceAll("([M]{4,})'", "'" + monthName); formatStr = formatStr.replaceAll("'([M]{4,})", monthName + "'"); - formatStr = formatStr.replaceAll("[M]{4,}", "'" + monthName - + "'"); + formatStr = formatStr.replaceAll("[M]{4,}", + "'" + monthName + "'"); } } @@ -406,8 +406,8 @@ public class DateTimeService { formatStr = formatStr.replaceAll("'([M]{3,})'", monthName); formatStr = formatStr.replaceAll("([M]{3,})'", "'" + monthName); formatStr = formatStr.replaceAll("'([M]{3,})", monthName + "'"); - formatStr = formatStr.replaceAll("[M]{3,}", "'" + monthName - + "'"); + formatStr = formatStr.replaceAll("[M]{3,}", + "'" + monthName + "'"); } } @@ -417,7 +417,7 @@ public class DateTimeService { /** * Replaces month names in the entered date with the name in the current * browser locale. - * + * * @param enteredDate * Date string e.g. "5 May 2010" * @param formatString @@ -457,7 +457,7 @@ public class DateTimeService { /** * Parses the given date string using the given format string and the locale * set in this DateTimeService instance. - * + * * @param dateString * Date string e.g. "1 February 2010" * @param formatString @@ -467,7 +467,7 @@ public class DateTimeService { * @return A Date object representing the dateString. Never returns null. * @throws IllegalArgumentException * if the parsing fails - * + * */ public Date parseDate(String dateString, String formatString, boolean lenient) throws IllegalArgumentException { @@ -490,8 +490,8 @@ public class DateTimeService { // Some version of Firefox sets the timestamp to 0 if parsing fails. if (date != null && date.getTime() == 0) { - throw new IllegalArgumentException("Parsing of '" + dateString - + "' failed"); + throw new IllegalArgumentException( + "Parsing of '" + dateString + "' failed"); } return date; diff --git a/client/src/main/java/com/vaadin/client/DeferredWorker.java b/client/src/main/java/com/vaadin/client/DeferredWorker.java index cc22cda2a2..c0dd1a8dec 100644 --- a/client/src/main/java/com/vaadin/client/DeferredWorker.java +++ b/client/src/main/java/com/vaadin/client/DeferredWorker.java @@ -20,7 +20,7 @@ package com.vaadin.client; * there is work scheduled to be executed in the near future and that the * framework should wait for this work to complete before assuming the UI has * reached a steady state. - * + * * @since 7.3 * @author Vaadin Ltd */ @@ -28,7 +28,7 @@ public interface DeferredWorker { /** * Checks whether there are operations pending for this widget or connector * that must be executed before reaching a steady state. - * + * * @returns true iff there are operations pending which must be * executed before reaching a steady state */ diff --git a/client/src/main/java/com/vaadin/client/DirectionalManagedLayout.java b/client/src/main/java/com/vaadin/client/DirectionalManagedLayout.java index eab9811082..803410f5e0 100644 --- a/client/src/main/java/com/vaadin/client/DirectionalManagedLayout.java +++ b/client/src/main/java/com/vaadin/client/DirectionalManagedLayout.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/EventHelper.java b/client/src/main/java/com/vaadin/client/EventHelper.java index 1ee252af0f..978e6d5769 100644 --- a/client/src/main/java/com/vaadin/client/EventHelper.java +++ b/client/src/main/java/com/vaadin/client/EventHelper.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -37,9 +37,9 @@ import com.google.gwt.user.client.ui.Widget; * registration (possibly the same as given, should be store for next update. *

    * Pseudocode what helpers do: - * + * *

    - * 
    + *
      * if paintable has event listener in UIDL
      *      if registration is null
      *              register paintable as as handler for event
    @@ -48,8 +48,8 @@ import com.google.gwt.user.client.ui.Widget;
      *      if registration is not null
      *              remove the handler from paintable
      *      return null
    - * 
    - * 
    + *
    + *
      * 
    */ public class EventHelper { @@ -57,7 +57,7 @@ public class EventHelper { /** * Adds or removes a focus handler depending on if the connector has focus * listeners on the server side or not. - * + * * @param connector * The connector to update. Must implement focusHandler. * @param handlerRegistration @@ -75,7 +75,7 @@ public class EventHelper { /** * Adds or removes a focus handler depending on if the connector has focus * listeners on the server side or not. - * + * * @param connector * The connector to update. Must implement focusHandler. * @param handlerRegistration @@ -87,7 +87,8 @@ public class EventHelper { * handler later */ public static HandlerRegistration updateFocusHandler( - T connector, HandlerRegistration handlerRegistration, Widget widget) { + T connector, HandlerRegistration handlerRegistration, + Widget widget) { return updateHandler(connector, connector, FOCUS, handlerRegistration, FocusEvent.getType(), widget); } @@ -95,7 +96,7 @@ public class EventHelper { /** * Adds or removes a blur handler depending on if the connector has blur * listeners on the server side or not. - * + * * @param connector * The connector to update. Must implement BlurHandler. * @param handlerRegistration @@ -113,7 +114,7 @@ public class EventHelper { /** * Adds or removes a blur handler depending on if the connector has blur * listeners on the server side or not. - * + * * @param connector * The connector to update. Must implement BlurHandler. * @param handlerRegistration @@ -121,19 +122,21 @@ public class EventHelper { * registered previously * @param widget * The widget which emits blur events - * + * * @return a new registration handler that can be used to unregister the * handler later */ public static HandlerRegistration updateBlurHandler( - T connector, HandlerRegistration handlerRegistration, Widget widget) { + T connector, HandlerRegistration handlerRegistration, + Widget widget) { return updateHandler(connector, connector, BLUR, handlerRegistration, BlurEvent.getType(), widget); } public static HandlerRegistration updateHandler( ComponentConnector connector, H handler, String eventIdentifier, - HandlerRegistration handlerRegistration, Type type, Widget widget) { + HandlerRegistration handlerRegistration, Type type, + Widget widget) { if (connector.hasEventListener(eventIdentifier)) { if (handlerRegistration == null) { handlerRegistration = widget.addDomHandler(handler, type); diff --git a/client/src/main/java/com/vaadin/client/FastStringMap.java b/client/src/main/java/com/vaadin/client/FastStringMap.java index ba3d07025b..c0a6dceb32 100644 --- a/client/src/main/java/com/vaadin/client/FastStringMap.java +++ b/client/src/main/java/com/vaadin/client/FastStringMap.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/FastStringSet.java b/client/src/main/java/com/vaadin/client/FastStringSet.java index 756bd374dc..ee659cf14f 100644 --- a/client/src/main/java/com/vaadin/client/FastStringSet.java +++ b/client/src/main/java/com/vaadin/client/FastStringSet.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/Focusable.java b/client/src/main/java/com/vaadin/client/Focusable.java index 05b32a7b05..129289ccd0 100644 --- a/client/src/main/java/com/vaadin/client/Focusable.java +++ b/client/src/main/java/com/vaadin/client/Focusable.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -19,7 +19,7 @@ package com.vaadin.client; * GWT's HasFocus is way too overkill for just receiving focus in simple * components. Vaadin uses this interface in addition to GWT's HasFocus to pass * focus requests from server to actual ui widgets in browsers. - * + * * So in to make your server side focusable component receive focus on client * side it must either implement this or HasFocus interface. */ diff --git a/client/src/main/java/com/vaadin/client/HasChildMeasurementHintConnector.java b/client/src/main/java/com/vaadin/client/HasChildMeasurementHintConnector.java index bb76377cd1..2e8a2fd5cd 100644 --- a/client/src/main/java/com/vaadin/client/HasChildMeasurementHintConnector.java +++ b/client/src/main/java/com/vaadin/client/HasChildMeasurementHintConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,12 +21,12 @@ import com.vaadin.client.ui.layout.ElementResizeListener; /** * Connector with layout measuring hint. Used to improve granularity of control * over child component measurements. - * + * * @since 7.6 * @author Vaadin Ltd */ -public interface HasChildMeasurementHintConnector extends - HasComponentsConnector { +public interface HasChildMeasurementHintConnector + extends HasComponentsConnector { /** * Specifies how you would like child components measurements to be handled. @@ -56,7 +56,7 @@ public interface HasChildMeasurementHintConnector extends /** * Sets the child measurement hint for this component. - * + * * @param hint * the value to set */ @@ -64,7 +64,7 @@ public interface HasChildMeasurementHintConnector extends /** * Returns the current child measurement hint value. - * + * * @return a ChildLayoutMeasureMode value */ ChildMeasurementHint getChildMeasurementHint(); diff --git a/client/src/main/java/com/vaadin/client/HasComponentsConnector.java b/client/src/main/java/com/vaadin/client/HasComponentsConnector.java index 19b93edd61..f44ccf5431 100644 --- a/client/src/main/java/com/vaadin/client/HasComponentsConnector.java +++ b/client/src/main/java/com/vaadin/client/HasComponentsConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -31,14 +31,14 @@ public interface HasComponentsConnector extends ServerConnector { /** * Update child components caption, description and error message. - * + * *

    * Each component is responsible for maintaining its caption, description * and error message. In most cases components doesn't want to do that and * those elements reside outside of the component. Because of this layouts * must provide service for it's childen to show those elements for them. *

    - * + * * @param connector * Child component for which service is requested. */ @@ -53,7 +53,7 @@ public interface HasComponentsConnector extends ServerConnector { * Note that the method {@link ServerConnector#getChildren()} can return a * larger list of children including both the child components and any * extensions registered for the connector. - * + * * @return A collection of child components for this connector. An empty * collection if there are no children. Never returns null. */ @@ -73,7 +73,7 @@ public interface HasComponentsConnector extends ServerConnector { * {@link ServerConnector#setChildren(List)} and contains only child * components. Both methods are called separately by the framework if the * connector implements {@link HasComponentsConnector}. - * + * * @param children * The new child connectors (components only) */ @@ -82,7 +82,7 @@ public interface HasComponentsConnector extends ServerConnector { /** * Adds a handler that is called whenever the child hierarchy of this * connector has been updated by the server. - * + * * @param handler * The handler that should be added. * @return A handler registration reference that can be used to unregister diff --git a/client/src/main/java/com/vaadin/client/JavaScriptConnectorHelper.java b/client/src/main/java/com/vaadin/client/JavaScriptConnectorHelper.java index 1833b370e5..b37557cb05 100644 --- a/client/src/main/java/com/vaadin/client/JavaScriptConnectorHelper.java +++ b/client/src/main/java/com/vaadin/client/JavaScriptConnectorHelper.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -64,8 +64,8 @@ public class JavaScriptConnectorHelper { /** * The id of the previous response for which state changes have been * processed. If this is the same as the - * {@link ApplicationConnection#getLastSeenServerSyncId()}, it means that the - * state change has already been handled and should not be done again. + * {@link ApplicationConnection#getLastSeenServerSyncId()}, it means that + * the state change has already been handled and should not be done again. */ private int processedResponseId = -1; @@ -83,7 +83,7 @@ public class JavaScriptConnectorHelper { * javascript is usually initalized the first time a state change event is * received, but it might in some cases be necessary to make this happen * earlier. - * + * * @since 7.4.0 */ public void ensureJavascriptInited() { @@ -93,7 +93,8 @@ public class JavaScriptConnectorHelper { } private void processStateChanges() { - int lastResponseId = connector.getConnection().getLastSeenServerSyncId(); + int lastResponseId = connector.getConnection() + .getLastSeenServerSyncId(); if (processedResponseId == lastResponseId) { return; } @@ -140,7 +141,8 @@ public class JavaScriptConnectorHelper { return rpcName.replace('$', '.'); } - protected JavaScriptObject createRpcObject(String iface, Set methods) { + protected JavaScriptObject createRpcObject(String iface, + Set methods) { JavaScriptObject object = JavaScriptObject.createObject(); for (String method : methods) { @@ -157,19 +159,16 @@ public class JavaScriptConnectorHelper { Integer tag = Integer.valueOf(this.tag); while (tag != null) { String serverSideClassName = conf.getServerSideClassNameForTag(tag); - String initFunctionName = serverSideClassName - .replaceAll("\\.", "_"); + String initFunctionName = serverSideClassName.replaceAll("\\.", + "_"); if (tryInitJs(initFunctionName, getConnectorWrapper())) { - getLogger().info( - "JavaScript connector initialized using " - + initFunctionName); + getLogger().info("JavaScript connector initialized using " + + initFunctionName); this.initFunctionName = initFunctionName; return true; } else { - getLogger() - .warning( - "No JavaScript function " + initFunctionName - + " found"); + getLogger().warning("No JavaScript function " + initFunctionName + + " found"); attemptedNames.add(initFunctionName); tag = conf.getParentTag(tag.intValue()); } @@ -267,8 +266,8 @@ public class JavaScriptConnectorHelper { ElementResizeListener listener = elementListeners.get(callbackFunction); if (listener == null) { - LayoutManager layoutManager = LayoutManager.get(connector - .getConnection()); + LayoutManager layoutManager = LayoutManager + .get(connector.getConnection()); listener = new ElementResizeListener() { @Override public void onElementResize(ElementResizeEvent e) { @@ -343,8 +342,8 @@ public class JavaScriptConnectorHelper { return connector; } - return ConnectorMap.get(connector.getConnection()).getConnector( - connectorId); + return ConnectorMap.get(connector.getConnection()) + .getConnector(connectorId); } private void fireRpc(String iface, String method, @@ -378,16 +377,15 @@ public class JavaScriptConnectorHelper { interfaceList += getJsInterfaceName(iface); } - throw new IllegalStateException( - "Can not call method " - + method - + " for wildcard rpc proxy because the function is defined for multiple rpc interfaces: " - + interfaceList - + ". Retrieve a rpc proxy for a specific interface using getRpcProxy(interfaceName) to use the function."); + throw new IllegalStateException("Can not call method " + method + + " for wildcard rpc proxy because the function is defined for multiple rpc interfaces: " + + interfaceList + + ". Retrieve a rpc proxy for a specific interface using getRpcProxy(interfaceName) to use the function."); } } - private void fireCallback(String name, JsArray arguments) { + private void fireCallback(String name, + JsArray arguments) { MethodInvocation invocation = new JavaScriptMethodInvocation( connector.getConnectorId(), "com.vaadin.ui.JavaScript$JavaScriptCallbackRpc", "call", @@ -410,7 +408,7 @@ public class JavaScriptConnectorHelper { delete state[key]; } } - + for(var key in input) { if (input.hasOwnProperty(key)) { state[key] = input[key]; @@ -450,7 +448,8 @@ public class JavaScriptConnectorHelper { }-*/; private static native void invokeJsRpc(JavaScriptObject rpcMap, - String interfaceName, String methodName, JavaScriptObject parameters) + String interfaceName, String methodName, + JavaScriptObject parameters) /*-{ var targets = rpcMap[interfaceName]; if (!targets) { @@ -479,14 +478,15 @@ public class JavaScriptConnectorHelper { invokeIfPresent(connectorWrapper, "onUnregister"); if (!resizeListeners.isEmpty()) { - LayoutManager layoutManager = LayoutManager.get(connector - .getConnection()); + LayoutManager layoutManager = LayoutManager + .get(connector.getConnection()); for (Entry> entry : resizeListeners .entrySet()) { Element element = entry.getKey(); - for (ElementResizeListener listener : entry.getValue().values()) { - layoutManager - .removeElementResizeListener(element, listener); + for (ElementResizeListener listener : entry.getValue() + .values()) { + layoutManager.removeElementResizeListener(element, + listener); } } resizeListeners.clear(); diff --git a/client/src/main/java/com/vaadin/client/JavaScriptExtension.java b/client/src/main/java/com/vaadin/client/JavaScriptExtension.java index 9c60d38a5a..c74715eb18 100644 --- a/client/src/main/java/com/vaadin/client/JavaScriptExtension.java +++ b/client/src/main/java/com/vaadin/client/JavaScriptExtension.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/JsArrayObject.java b/client/src/main/java/com/vaadin/client/JsArrayObject.java index b6dcf3789d..acbc43ac6b 100644 --- a/client/src/main/java/com/vaadin/client/JsArrayObject.java +++ b/client/src/main/java/com/vaadin/client/JsArrayObject.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/LayoutManager.java b/client/src/main/java/com/vaadin/client/LayoutManager.java index 371ea46d3d..306cea5ced 100644 --- a/client/src/main/java/com/vaadin/client/LayoutManager.java +++ b/client/src/main/java/com/vaadin/client/LayoutManager.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -87,7 +87,7 @@ public class LayoutManager { /** * Returns the application connection for this layout manager. - * + * * @return connection */ protected ApplicationConnection getConnection() { @@ -97,7 +97,7 @@ public class LayoutManager { /** * Gets the layout manager associated with the given * {@link ApplicationConnection}. - * + * * @param connection * the application connection to get a layout manager for * @return the layout manager associated with the provided application @@ -112,7 +112,7 @@ public class LayoutManager { * This causes this layout manager to measure the element in the beginning * of every layout phase and call the appropriate layout method of the * managed layout if the size of the element has changed. - * + * * @param owner * the ManagedLayout that depends on an element * @param element @@ -164,7 +164,7 @@ public class LayoutManager { /** * Assigns a measured size to an element. Method defined as protected to * allow separate implementation for IE8. - * + * * @param element * the dom element to attach the measured size to * @param measuredSize @@ -184,7 +184,7 @@ public class LayoutManager { /** * Gets the measured size for an element. Method defined as protected to * allow separate implementation for IE8. - * + * * @param element * The element to get measured size for * @param defaultSize @@ -209,9 +209,9 @@ public class LayoutManager { /** * Registers that a ManagedLayout is no longer depending on the size of an * Element. - * + * * @see #registerDependency(ManagedLayout, Element) - * + * * @param owner * the ManagedLayout no longer depends on an element * @param element @@ -240,9 +240,8 @@ public class LayoutManager { } layoutCounts.put(layout.getConnectorId(), count); if (count.intValue() > 2) { - getLogger().severe( - Util.getConnectorString(layout) + " has been layouted " - + count.intValue() + " times"); + getLogger().severe(Util.getConnectorString(layout) + + " has been layouted " + count.intValue() + " times"); } } @@ -321,8 +320,8 @@ public class LayoutManager { for (int i = 0; i < dumpLength; i++) { ServerConnector connector = connectorMap.getConnector(dump.get(i)); if (connector != null) { - currentDependencyTree.setNeedsMeasure( - (ComponentConnector) connector, true); + currentDependencyTree + .setNeedsMeasure((ComponentConnector) connector, true); } } needsMeasure = FastStringSet.create(); @@ -357,23 +356,27 @@ public class LayoutManager { Collection listeners = elementResizeListeners .get(element); if (listeners != null) { - Profiler.enter("Layout fire resize events - listeners not null"); - Profiler.enter("ElementResizeListener.onElementResize copy list"); - ElementResizeListener[] array = listeners - .toArray(new ElementResizeListener[listeners - .size()]); - Profiler.leave("ElementResizeListener.onElementResize copy list"); + Profiler.enter( + "Layout fire resize events - listeners not null"); + Profiler.enter( + "ElementResizeListener.onElementResize copy list"); + ElementResizeListener[] array = listeners.toArray( + new ElementResizeListener[listeners.size()]); + Profiler.leave( + "ElementResizeListener.onElementResize copy list"); ElementResizeEvent event = new ElementResizeEvent(this, element); for (ElementResizeListener listener : array) { try { String key = null; if (Profiler.isEnabled()) { - Profiler.enter("ElementResizeListener.onElementResize construct profiler key"); + Profiler.enter( + "ElementResizeListener.onElementResize construct profiler key"); key = "ElementResizeListener.onElementResize for " + listener.getClass() .getSimpleName(); - Profiler.leave("ElementResizeListener.onElementResize construct profiler key"); + Profiler.leave( + "ElementResizeListener.onElementResize construct profiler key"); Profiler.enter(key); } @@ -386,7 +389,8 @@ public class LayoutManager { "Error in resize listener", e); } } - Profiler.leave("Layout fire resize events - listeners not null"); + Profiler.leave( + "Layout fire resize events - listeners not null"); } } listenersToFire.clear(); @@ -451,10 +455,9 @@ public class LayoutManager { Profiler.leave(key); } } catch (RuntimeException e) { - getLogger() - .log(Level.SEVERE, - "Error in SimpleManagedLayout (horizontal) handling", - e); + getLogger().log(Level.SEVERE, + "Error in SimpleManagedLayout (horizontal) handling", + e); } countLayout(layoutCounts, rr); @@ -488,10 +491,9 @@ public class LayoutManager { Profiler.leave(key); } } catch (RuntimeException e) { - getLogger() - .log(Level.SEVERE, - "Error in DirectionalManagedLayout handling", - e); + getLogger().log(Level.SEVERE, + "Error in DirectionalManagedLayout handling", + e); } countLayout(layoutCounts, cl); } else { @@ -514,10 +516,9 @@ public class LayoutManager { Profiler.leave(key); } } catch (RuntimeException e) { - getLogger() - .log(Level.SEVERE, - "Error in SimpleManagedLayout (vertical) handling", - e); + getLogger().log(Level.SEVERE, + "Error in SimpleManagedLayout (vertical) handling", + e); } countLayout(layoutCounts, rr); } @@ -544,8 +545,9 @@ public class LayoutManager { } String connectorString = changedCids.get(i); if (changedCids.length() < 10) { - ServerConnector connector = ConnectorMap.get( - connection).getConnector(connectorString); + ServerConnector connector = ConnectorMap + .get(connection) + .getConnector(connectorString); connectorString = Util .getConnectorString(connector); } @@ -557,18 +559,17 @@ public class LayoutManager { Profiler.leave("Layout pass"); - getLogger() - .info("Pass " + passes + " measured " - + measuredConnectorCount + " elements, fired " - + firedListeners + " listeners and did " - + layoutCount + " layouts."); + getLogger().info("Pass " + passes + " measured " + + measuredConnectorCount + " elements, fired " + + firedListeners + " listeners and did " + layoutCount + + " layouts."); if (passes > 100) { getLogger().severe(LOOP_ABORT_MESSAGE); if (ApplicationConfiguration.isDebugMode()) { - VNotification.createNotification( - VNotification.DELAY_FOREVER, - connection.getUIConnector().getWidget()) + VNotification + .createNotification(VNotification.DELAY_FOREVER, + connection.getUIConnector().getWidget()) .show(LOOP_ABORT_MESSAGE, VNotification.CENTERED, "error"); } @@ -608,15 +609,14 @@ public class LayoutManager { pendingOverflowFixes = FastStringSet.create(); } - getLogger().info( - "Total layout phase time: " + totalDuration.elapsedMillis() - + "ms"); + getLogger().info("Total layout phase time: " + + totalDuration.elapsedMillis() + "ms"); } private void logConnectorStatus(int connectorId) { - currentDependencyTree - .logDependencyStatus((ComponentConnector) ConnectorMap.get( - connection).getConnector(Integer.toString(connectorId))); + currentDependencyTree.logDependencyStatus( + (ComponentConnector) ConnectorMap.get(connection) + .getConnector(Integer.toString(connectorId))); } private int measureConnectors(LayoutDependencyTree layoutDependencyTree, @@ -644,12 +644,10 @@ public class LayoutManager { } if (debugLogging) { - getLogger() - .info("Doing overflow fix for " - + Util.getConnectorString(componentConnector) - + " in " - + Util.getConnectorString(componentConnector - .getParent())); + getLogger().info("Doing overflow fix for " + + Util.getConnectorString(componentConnector) + + " in " + Util.getConnectorString( + componentConnector.getParent())); } Profiler.enter("Overflow fix apply"); @@ -767,9 +765,8 @@ public class LayoutManager { return true; } ServerConnector parent = componentConnector.getParent(); - if (parent instanceof ComponentConnector - && !currentDependencyTree - .noMoreChangesExpected((ComponentConnector) parent)) { + if (parent instanceof ComponentConnector && !currentDependencyTree + .noMoreChangesExpected((ComponentConnector) parent)) { return true; } @@ -826,9 +823,8 @@ public class LayoutManager { measuredAndUpdate(element, getMeasuredSize(element, null)); } Profiler.leave("LayoutManager.measureNonConenctors"); - getLogger().info( - "Measured " + measuredNonConnectorElements.size() - + " non connector elements"); + getLogger().info("Measured " + measuredNonConnectorElements.size() + + " non connector elements"); } private MeasureResult measuredAndUpdate(Element element, @@ -895,7 +891,7 @@ public class LayoutManager { * to explicitly cause some layout to be considered in an ongoing layout * phase, you should use {@link #setNeedsMeasure(ComponentConnector)} * instead. - * + * * @param layout * the managed layout that should be layouted */ @@ -917,15 +913,14 @@ public class LayoutManager { * to explicitly cause some layout to be considered in an ongoing layout * phase, you should use {@link #setNeedsMeasure(ComponentConnector)} * instead. - * + * * @param layout * the managed layout that should be layouted */ public final void setNeedsHorizontalLayout(ManagedLayout layout) { if (isLayoutRunning()) { - getLogger() - .warning( - "setNeedsHorizontalLayout should not be run while a layout phase is in progress."); + getLogger().warning( + "setNeedsHorizontalLayout should not be run while a layout phase is in progress."); } needsHorizontalLayout.add(layout.getConnectorId()); } @@ -943,15 +938,14 @@ public class LayoutManager { * to explicitly cause some layout to be considered in an ongoing layout * phase, you should use {@link #setNeedsMeasure(ComponentConnector)} * instead. - * + * * @param layout * the managed layout that should be layouted */ public final void setNeedsVerticalLayout(ManagedLayout layout) { if (isLayoutRunning()) { - getLogger() - .warning( - "setNeedsVerticalLayout should not be run while a layout phase is in progress."); + getLogger().warning( + "setNeedsVerticalLayout should not be run while a layout phase is in progress."); } needsVerticalLayout.add(layout.getConnectorId()); } @@ -966,22 +960,23 @@ public class LayoutManager { *
  • Elements for which at least one ManagedLayout has registered a * dependency * - * + * * -1 is returned if the element has not been measured. If 0 is returned, it * might indicate that the element is not attached to the DOM. *

    * The value returned by this method is always rounded up. To get the exact * outer width, use {@link #getOuterHeightDouble(Element)} - * + * * @param element * the element to get the measured size for * @return the measured outer height (including margins, paddings and * borders) of the element in pixels. */ public final int getOuterHeight(Element element) { - assert needsMeasure(element) : "Getting measurement for element that is not measured"; - return (int) Math.ceil(getMeasuredSize(element, nullSize) - .getOuterHeight()); + assert needsMeasure( + element) : "Getting measurement for element that is not measured"; + return (int) Math + .ceil(getMeasuredSize(element, nullSize).getOuterHeight()); } /** @@ -994,10 +989,10 @@ public class LayoutManager { *

  • Elements for which at least one ManagedLayout has registered a * dependency * - * + * * -1 is returned if the element has not been measured. If 0 is returned, it * might indicate that the element is not attached to the DOM. - * + * * @since 7.5.1 * @param element * the element to get the measured size for @@ -1005,7 +1000,8 @@ public class LayoutManager { * borders) of the element in pixels. */ public final double getOuterHeightDouble(Element element) { - assert needsMeasure(element) : "Getting measurement for element that is not measured"; + assert needsMeasure( + element) : "Getting measurement for element that is not measured"; return getMeasuredSize(element, nullSize).getOuterHeight(); } @@ -1019,13 +1015,13 @@ public class LayoutManager { *
  • Elements for which at least one ManagedLayout has registered a * dependency * - * + * * -1 is returned if the element has not been measured. If 0 is returned, it * might indicate that the element is not attached to the DOM. *

    * The value returned by this method is always rounded up. To get the exact * outer width, use {@link #getOuterWidthDouble(Element)} - * + * * @since 7.5.1 * @param element * the element to get the measured size for @@ -1033,9 +1029,10 @@ public class LayoutManager { * borders) of the element in pixels. */ public final int getOuterWidth(Element element) { - assert needsMeasure(element) : "Getting measurement for element that is not measured"; - return (int) Math.ceil(getMeasuredSize(element, nullSize) - .getOuterWidth()); + assert needsMeasure( + element) : "Getting measurement for element that is not measured"; + return (int) Math + .ceil(getMeasuredSize(element, nullSize).getOuterWidth()); } /** @@ -1048,17 +1045,18 @@ public class LayoutManager { *

  • Elements for which at least one ManagedLayout has registered a * dependency * - * + * * -1 is returned if the element has not been measured. If 0 is returned, it * might indicate that the element is not attached to the DOM. - * + * * @param element * the element to get the measured size for * @return the measured outer width (including margins, paddings and * borders) of the element in pixels. */ public final double getOuterWidthDouble(Element element) { - assert needsMeasure(element) : "Getting measurement for element that is not measured"; + assert needsMeasure( + element) : "Getting measurement for element that is not measured"; return getMeasuredSize(element, nullSize).getOuterWidth(); } @@ -1072,22 +1070,23 @@ public class LayoutManager { *
  • Elements for which at least one ManagedLayout has registered a * dependency * - * + * * -1 is returned if the element has not been measured. If 0 is returned, it * might indicate that the element is not attached to the DOM. *

    * The value returned by this method is always rounded up. To get the exact * outer width, use {@link #getInnerHeightDouble(Element)} - * + * * @param element * the element to get the measured size for * @return the measured inner height (excluding margins, paddings and * borders) of the element in pixels. */ public final int getInnerHeight(Element element) { - assert needsMeasure(element) : "Getting measurement for element that is not measured"; - return (int) Math.ceil(getMeasuredSize(element, nullSize) - .getInnerHeight()); + assert needsMeasure( + element) : "Getting measurement for element that is not measured"; + return (int) Math + .ceil(getMeasuredSize(element, nullSize).getInnerHeight()); } /** @@ -1100,10 +1099,10 @@ public class LayoutManager { *

  • Elements for which at least one ManagedLayout has registered a * dependency * - * + * * -1 is returned if the element has not been measured. If 0 is returned, it * might indicate that the element is not attached to the DOM. - * + * * @since 7.5.1 * @param element * the element to get the measured size for @@ -1111,7 +1110,8 @@ public class LayoutManager { * borders) of the element in pixels. */ public final double getInnerHeightDouble(Element element) { - assert needsMeasure(element) : "Getting measurement for element that is not measured"; + assert needsMeasure( + element) : "Getting measurement for element that is not measured"; return getMeasuredSize(element, nullSize).getInnerHeight(); } @@ -1125,22 +1125,23 @@ public class LayoutManager { *
  • Elements for which at least one ManagedLayout has registered a * dependency * - * + * * -1 is returned if the element has not been measured. If 0 is returned, it * might indicate that the element is not attached to the DOM. *

    * The value returned by this method is always rounded up. To get the exact * outer width, use {@link #getOuterHeightDouble(Element)} - * + * * @param element * the element to get the measured size for * @return the measured inner width (excluding margins, paddings and * borders) of the element in pixels. */ public final int getInnerWidth(Element element) { - assert needsMeasure(element) : "Getting measurement for element that is not measured"; - return (int) Math.ceil(getMeasuredSize(element, nullSize) - .getInnerWidth()); + assert needsMeasure( + element) : "Getting measurement for element that is not measured"; + return (int) Math + .ceil(getMeasuredSize(element, nullSize).getInnerWidth()); } /** @@ -1153,10 +1154,10 @@ public class LayoutManager { *

  • Elements for which at least one ManagedLayout has registered a * dependency * - * + * * -1 is returned if the element has not been measured. If 0 is returned, it * might indicate that the element is not attached to the DOM. - * + * * @since 7.5.1 * @param element * the element to get the measured size for @@ -1164,7 +1165,8 @@ public class LayoutManager { * borders) of the element in pixels. */ public final double getInnerWidthDouble(Element element) { - assert needsMeasure(element) : "Getting measurement for element that is not measured"; + assert needsMeasure( + element) : "Getting measurement for element that is not measured"; return getMeasuredSize(element, nullSize).getInnerWidth(); } @@ -1178,18 +1180,19 @@ public class LayoutManager { *
  • Elements for which at least one ManagedLayout has registered a * dependency * - * + * * A negative number is returned if the element has not been measured. If 0 * is returned, it might indicate that the element is not attached to the * DOM. - * + * * @param element * the element to get the measured size for * @return the measured border height (top border + bottom border) of the * element in pixels. */ public final int getBorderHeight(Element element) { - assert needsMeasure(element) : "Getting measurement for element that is not measured"; + assert needsMeasure( + element) : "Getting measurement for element that is not measured"; return getMeasuredSize(element, nullSize).getBorderHeight(); } @@ -1203,18 +1206,19 @@ public class LayoutManager { *
  • Elements for which at least one ManagedLayout has registered a * dependency * - * + * * A negative number is returned if the element has not been measured. If 0 * is returned, it might indicate that the element is not attached to the * DOM. - * + * * @param element * the element to get the measured size for * @return the measured padding height (top padding + bottom padding) of the * element in pixels. */ public int getPaddingHeight(Element element) { - assert needsMeasure(element) : "Getting measurement for element that is not measured"; + assert needsMeasure( + element) : "Getting measurement for element that is not measured"; return getMeasuredSize(element, nullSize).getPaddingHeight(); } @@ -1228,18 +1232,19 @@ public class LayoutManager { *
  • Elements for which at least one ManagedLayout has registered a * dependency * - * + * * A negative number is returned if the element has not been measured. If 0 * is returned, it might indicate that the element is not attached to the * DOM. - * + * * @param element * the element to get the measured size for * @return the measured border width (left border + right border) of the * element in pixels. */ public int getBorderWidth(Element element) { - assert needsMeasure(element) : "Getting measurement for element that is not measured"; + assert needsMeasure( + element) : "Getting measurement for element that is not measured"; return getMeasuredSize(element, nullSize).getBorderWidth(); } @@ -1252,17 +1257,18 @@ public class LayoutManager { *
  • Elements for which at least one ManagedLayout has registered a * dependency * - * + * * A negative number is returned if the element has not been measured. If 0 * is returned, it might indicate that the element is not attached to the * DOM. - * + * * @param element * the element to get the measured size for * @return the measured top border of the element in pixels. */ public int getBorderTop(Element element) { - assert needsMeasure(element) : "Getting measurement for element that is not measured"; + assert needsMeasure( + element) : "Getting measurement for element that is not measured"; return getMeasuredSize(element, nullSize).getBorderTop(); } @@ -1275,17 +1281,18 @@ public class LayoutManager { *
  • Elements for which at least one ManagedLayout has registered a * dependency * - * + * * A negative number is returned if the element has not been measured. If 0 * is returned, it might indicate that the element is not attached to the * DOM. - * + * * @param element * the element to get the measured size for * @return the measured left border of the element in pixels. */ public int getBorderLeft(Element element) { - assert needsMeasure(element) : "Getting measurement for element that is not measured"; + assert needsMeasure( + element) : "Getting measurement for element that is not measured"; return getMeasuredSize(element, nullSize).getBorderLeft(); } @@ -1298,17 +1305,18 @@ public class LayoutManager { *
  • Elements for which at least one ManagedLayout has registered a * dependency * - * + * * A negative number is returned if the element has not been measured. If 0 * is returned, it might indicate that the element is not attached to the * DOM. - * + * * @param element * the element to get the measured size for * @return the measured bottom border of the element in pixels. */ public int getBorderBottom(Element element) { - assert needsMeasure(element) : "Getting measurement for element that is not measured"; + assert needsMeasure( + element) : "Getting measurement for element that is not measured"; return getMeasuredSize(element, nullSize).getBorderBottom(); } @@ -1321,17 +1329,18 @@ public class LayoutManager { *
  • Elements for which at least one ManagedLayout has registered a * dependency * - * + * * A negative number is returned if the element has not been measured. If 0 * is returned, it might indicate that the element is not attached to the * DOM. - * + * * @param element * the element to get the measured size for * @return the measured right border of the element in pixels. */ public int getBorderRight(Element element) { - assert needsMeasure(element) : "Getting measurement for element that is not measured"; + assert needsMeasure( + element) : "Getting measurement for element that is not measured"; return getMeasuredSize(element, nullSize).getBorderRight(); } @@ -1345,18 +1354,19 @@ public class LayoutManager { *
  • Elements for which at least one ManagedLayout has registered a * dependency * - * + * * A negative number is returned if the element has not been measured. If 0 * is returned, it might indicate that the element is not attached to the * DOM. - * + * * @param element * the element to get the measured size for * @return the measured padding width (left padding + right padding) of the * element in pixels. */ public int getPaddingWidth(Element element) { - assert needsMeasure(element) : "Getting measurement for element that is not measured"; + assert needsMeasure( + element) : "Getting measurement for element that is not measured"; return getMeasuredSize(element, nullSize).getPaddingWidth(); } @@ -1369,17 +1379,18 @@ public class LayoutManager { *
  • Elements for which at least one ManagedLayout has registered a * dependency * - * + * * A negative number is returned if the element has not been measured. If 0 * is returned, it might indicate that the element is not attached to the * DOM. - * + * * @param element * the element to get the measured size for * @return the measured top padding of the element in pixels. */ public int getPaddingTop(Element element) { - assert needsMeasure(element) : "Getting measurement for element that is not measured"; + assert needsMeasure( + element) : "Getting measurement for element that is not measured"; return getMeasuredSize(element, nullSize).getPaddingTop(); } @@ -1392,17 +1403,18 @@ public class LayoutManager { *
  • Elements for which at least one ManagedLayout has registered a * dependency * - * + * * A negative number is returned if the element has not been measured. If 0 * is returned, it might indicate that the element is not attached to the * DOM. - * + * * @param element * the element to get the measured size for * @return the measured left padding of the element in pixels. */ public int getPaddingLeft(Element element) { - assert needsMeasure(element) : "Getting measurement for element that is not measured"; + assert needsMeasure( + element) : "Getting measurement for element that is not measured"; return getMeasuredSize(element, nullSize).getPaddingLeft(); } @@ -1415,17 +1427,18 @@ public class LayoutManager { *
  • Elements for which at least one ManagedLayout has registered a * dependency * - * + * * A negative number is returned if the element has not been measured. If 0 * is returned, it might indicate that the element is not attached to the * DOM. - * + * * @param element * the element to get the measured size for * @return the measured bottom padding of the element in pixels. */ public int getPaddingBottom(Element element) { - assert needsMeasure(element) : "Getting measurement for element that is not measured"; + assert needsMeasure( + element) : "Getting measurement for element that is not measured"; return getMeasuredSize(element, nullSize).getPaddingBottom(); } @@ -1438,17 +1451,18 @@ public class LayoutManager { *
  • Elements for which at least one ManagedLayout has registered a * dependency * - * + * * A negative number is returned if the element has not been measured. If 0 * is returned, it might indicate that the element is not attached to the * DOM. - * + * * @param element * the element to get the measured size for * @return the measured right padding of the element in pixels. */ public int getPaddingRight(Element element) { - assert needsMeasure(element) : "Getting measurement for element that is not measured"; + assert needsMeasure( + element) : "Getting measurement for element that is not measured"; return getMeasuredSize(element, nullSize).getPaddingRight(); } @@ -1461,17 +1475,18 @@ public class LayoutManager { *
  • Elements for which at least one ManagedLayout has registered a * dependency * - * + * * A negative number is returned if the element has not been measured. If 0 * is returned, it might indicate that the element is not attached to the * DOM. - * + * * @param element * the element to get the measured size for * @return the measured top margin of the element in pixels. */ public int getMarginTop(Element element) { - assert needsMeasure(element) : "Getting measurement for element that is not measured"; + assert needsMeasure( + element) : "Getting measurement for element that is not measured"; return getMeasuredSize(element, nullSize).getMarginTop(); } @@ -1484,17 +1499,18 @@ public class LayoutManager { *
  • Elements for which at least one ManagedLayout has registered a * dependency * - * + * * A negative number is returned if the element has not been measured. If 0 * is returned, it might indicate that the element is not attached to the * DOM. - * + * * @param element * the element to get the measured size for * @return the measured right margin of the element in pixels. */ public int getMarginRight(Element element) { - assert needsMeasure(element) : "Getting measurement for element that is not measured"; + assert needsMeasure( + element) : "Getting measurement for element that is not measured"; return getMeasuredSize(element, nullSize).getMarginRight(); } @@ -1507,17 +1523,18 @@ public class LayoutManager { *
  • Elements for which at least one ManagedLayout has registered a * dependency * - * + * * A negative number is returned if the element has not been measured. If 0 * is returned, it might indicate that the element is not attached to the * DOM. - * + * * @param element * the element to get the measured size for * @return the measured bottom margin of the element in pixels. */ public int getMarginBottom(Element element) { - assert needsMeasure(element) : "Getting measurement for element that is not measured"; + assert needsMeasure( + element) : "Getting measurement for element that is not measured"; return getMeasuredSize(element, nullSize).getMarginBottom(); } @@ -1530,17 +1547,18 @@ public class LayoutManager { *
  • Elements for which at least one ManagedLayout has registered a * dependency * - * + * * A negative number is returned if the element has not been measured. If 0 * is returned, it might indicate that the element is not attached to the * DOM. - * + * * @param element * the element to get the measured size for * @return the measured left margin of the element in pixels. */ public int getMarginLeft(Element element) { - assert needsMeasure(element) : "Getting measurement for element that is not measured"; + assert needsMeasure( + element) : "Getting measurement for element that is not measured"; return getMeasuredSize(element, nullSize).getMarginLeft(); } @@ -1553,11 +1571,11 @@ public class LayoutManager { *
  • Elements for which at least one ManagedLayout has registered a * dependency * - * + * * A negative number is returned if the element has not been measured. If 0 * is returned, it might indicate that the element is not attached to the * DOM. - * + * * @param element * the element to get the measured margin for * @return the measured top+bottom margin of the element in pixels. @@ -1575,11 +1593,11 @@ public class LayoutManager { *
  • Elements for which at least one ManagedLayout has registered a * dependency * - * + * * A negative number is returned if the element has not been measured. If 0 * is returned, it might indicate that the element is not attached to the * DOM. - * + * * @param element * the element to get the measured margin for * @return the measured left+right margin of the element in pixels. @@ -1594,14 +1612,15 @@ public class LayoutManager { * informing the LayoutManager about what size a component will have, the * layout propagation can continue directly without first measuring the * potentially resized elements. - * + * * @param component * the component for which the size is reported * @param outerHeight * the new outer height (including margins, borders and paddings) * of the component in pixels */ - public void reportOuterHeight(ComponentConnector component, int outerHeight) { + public void reportOuterHeight(ComponentConnector component, + int outerHeight) { Element element = component.getWidget().getElement(); MeasuredSize measuredSize = getMeasuredSize(element); if (isLayoutRunning()) { @@ -1623,7 +1642,7 @@ public class LayoutManager { * LayoutManager about what size a component will have, the layout * propagation can continue directly without first measuring the potentially * resized elements. - * + * * @param component * the relatively sized component for which the size is reported * @param assignedHeight @@ -1634,8 +1653,8 @@ public class LayoutManager { int assignedHeight) { assert component.isRelativeHeight(); - float percentSize = parsePercent(component.getState().height == null ? "" - : component.getState().height); + float percentSize = parsePercent(component.getState().height == null + ? "" : component.getState().height); int effectiveHeight = Math.round(assignedHeight * (percentSize / 100)); reportOuterHeight(component, effectiveHeight); @@ -1647,7 +1666,7 @@ public class LayoutManager { * LayoutManager about what size a component will have, the layout * propagation can continue directly without first measuring the potentially * resized elements. - * + * * @param component * the relatively sized component for which the size is reported * @param assignedWidth @@ -1675,7 +1694,7 @@ public class LayoutManager { * informing the LayoutManager about what size a component will have, the * layout propagation can continue directly without first measuring the * potentially resized elements. - * + * * @param component * the component for which the size is reported * @param outerWidth @@ -1703,7 +1722,7 @@ public class LayoutManager { * element changes. Adding a listener to an element also ensures that all * sizes for that element will be available starting from the next layout * phase. - * + * * @param element * the element that should be checked for size changes * @param listener @@ -1726,7 +1745,7 @@ public class LayoutManager { * Removes an element resize listener from the provided element. This might * cause this LayoutManager to stop tracking the size of the element if no * other sources are interested in the size. - * + * * @param element * the element to which the element resize listener was * previously added @@ -1765,7 +1784,7 @@ public class LayoutManager { * {@link #setNeedsMeasureRecursively(ComponentConnector)} instead. *

    * If there is no upcoming layout phase, a new layout phase is scheduled. - * + * * @param component * the component whose size might have changed. */ @@ -1788,7 +1807,7 @@ public class LayoutManager { * {@link #setNeedsMeasure(ComponentConnector)} instead. *

    * If there is no upcoming layout phase, a new layout phase is scheduled. - * + * * @since 7.2 * @param component * the component at the root of the component hierarchy to @@ -1799,7 +1818,8 @@ public class LayoutManager { if (component instanceof HasComponentsConnector) { HasComponentsConnector hasComponents = (HasComponentsConnector) component; - for (ComponentConnector child : hasComponents.getChildComponents()) { + for (ComponentConnector child : hasComponents + .getChildComponents()) { setNeedsMeasureRecursively(child); } } @@ -1821,13 +1841,14 @@ public class LayoutManager { /** * Checks if there is something waiting for a layout to take place. - * + * * @since 7.5.6 * @return true if there are connectors waiting for measurement or layout, * false otherwise */ public boolean isLayoutNeeded() { - if (!needsHorizontalLayout.isEmpty() || !needsVerticalLayout.isEmpty()) { + if (!needsHorizontalLayout.isEmpty() + || !needsVerticalLayout.isEmpty()) { return true; } if (!needsMeasure.isEmpty()) { diff --git a/client/src/main/java/com/vaadin/client/LayoutManagerIE8.java b/client/src/main/java/com/vaadin/client/LayoutManagerIE8.java index 479155d0e6..603ac03337 100644 --- a/client/src/main/java/com/vaadin/client/LayoutManagerIE8.java +++ b/client/src/main/java/com/vaadin/client/LayoutManagerIE8.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -29,10 +29,10 @@ import com.google.gwt.user.client.ui.RootPanel; * element in IE8 seems to make the browser think the element has changed in a * way that requires a reflow. To work around that, the MeasureData is instead * stored in Map for IE8. - * + * * This implementation is injected for IE8 by a replace-with definition in the * GWT module. - * + * * @author Vaadin Ltd * @since 7.0.0 */ diff --git a/client/src/main/java/com/vaadin/client/LocaleNotLoadedException.java b/client/src/main/java/com/vaadin/client/LocaleNotLoadedException.java index 6f59e786e4..6d2cbf28ae 100644 --- a/client/src/main/java/com/vaadin/client/LocaleNotLoadedException.java +++ b/client/src/main/java/com/vaadin/client/LocaleNotLoadedException.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/LocaleService.java b/client/src/main/java/com/vaadin/client/LocaleService.java index dcd1c9ea4e..490101285b 100644 --- a/client/src/main/java/com/vaadin/client/LocaleService.java +++ b/client/src/main/java/com/vaadin/client/LocaleService.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -27,9 +27,9 @@ import com.vaadin.shared.ui.ui.UIState.LocaleData; /** * Date / time etc. localisation service for all widgets. Caches all loaded * locales as JSONObjects. - * + * * @author Vaadin Ltd. - * + * */ public class LocaleService { diff --git a/client/src/main/java/com/vaadin/client/MeasuredSize.java b/client/src/main/java/com/vaadin/client/MeasuredSize.java index 2099008350..7f95d1826a 100644 --- a/client/src/main/java/com/vaadin/client/MeasuredSize.java +++ b/client/src/main/java/com/vaadin/client/MeasuredSize.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -205,7 +205,8 @@ public class MeasuredSize { heightChanged = true; } if (!widthChanged && hasWidthChanged(this.paddings, paddings)) { - debugSizeChange(element, "Width (padding)", this.paddings, paddings); + debugSizeChange(element, "Width (padding)", this.paddings, + paddings); widthChanged = true; } this.paddings = paddings; @@ -278,9 +279,8 @@ public class MeasuredSize { private void debugSizeChange(Element element, String sizeChangeType, String changedFrom, String changedTo) { if (debugSizeChanges) { - getLogger() - .info(sizeChangeType + " has changed from " + changedFrom - + " to " + changedTo + " for " + element.toString()); + getLogger().info(sizeChangeType + " has changed from " + changedFrom + + " to " + changedTo + " for " + element.toString()); } } diff --git a/client/src/main/java/com/vaadin/client/MouseEventDetailsBuilder.java b/client/src/main/java/com/vaadin/client/MouseEventDetailsBuilder.java index 11ebe3925c..62b96ee712 100644 --- a/client/src/main/java/com/vaadin/client/MouseEventDetailsBuilder.java +++ b/client/src/main/java/com/vaadin/client/MouseEventDetailsBuilder.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -24,16 +24,16 @@ import com.vaadin.shared.MouseEventDetails.MouseButton; /** * Helper class for constructing a MouseEventDetails object from a * {@link NativeEvent}. - * + * * @author Vaadin Ltd * @since 7.0.0 - * + * */ public class MouseEventDetailsBuilder { /** * Construct a {@link MouseEventDetails} object from the given event - * + * * @param evt * The event to use as a source for the details * @return a MouseEventDetails containing information from the event @@ -44,7 +44,7 @@ public class MouseEventDetailsBuilder { /** * Construct a {@link MouseEventDetails} object from the given event - * + * * @param evt * The event to use as a source for the details * @param relativeToElement diff --git a/client/src/main/java/com/vaadin/client/Paintable.java b/client/src/main/java/com/vaadin/client/Paintable.java index 34f2d0714f..1e3ca24dca 100644 --- a/client/src/main/java/com/vaadin/client/Paintable.java +++ b/client/src/main/java/com/vaadin/client/Paintable.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,7 +20,7 @@ package com.vaadin.client; * An interface used by client-side widgets or paintable parts to receive * updates from the corresponding server-side components in the form of * {@link UIDL}. - * + * * Updates can be sent back to the server using the * {@link ApplicationConnection#updateVariable()} methods. */ diff --git a/client/src/main/java/com/vaadin/client/Profiler.java b/client/src/main/java/com/vaadin/client/Profiler.java index 3923b66218..b5123bbaa7 100644 --- a/client/src/main/java/com/vaadin/client/Profiler.java +++ b/client/src/main/java/com/vaadin/client/Profiler.java @@ -69,7 +69,7 @@ public class Profiler { * Interface for getting data from the {@link Profiler}. *

    * Warning! This interface is most likely to change in the future - * + * * @since 7.1 * @author Vaadin Ltd */ @@ -98,7 +98,7 @@ public class Profiler { /** * Create a new node with the given name. - * + * * @param name */ public Node(String name) { @@ -107,7 +107,7 @@ public class Profiler { /** * Gets the name of the node - * + * * @return the name of the node */ public String getName() { @@ -117,7 +117,7 @@ public class Profiler { /** * Creates a new child node or retrieves and existing child and updates * its total time and hit count. - * + * * @param name * the name of the child * @param timestamp @@ -138,7 +138,7 @@ public class Profiler { /** * Gets the total time spent in this node, including time spent in sub * nodes - * + * * @return the total time spent, in milliseconds */ public double getTimeSpent() { @@ -148,7 +148,7 @@ public class Profiler { /** * Gets the minimum time spent for one invocation of this node, * including time spent in sub nodes - * + * * @return the time spent for the fastest invocation, in milliseconds */ public double getMinTimeSpent() { @@ -158,7 +158,7 @@ public class Profiler { /** * Gets the maximum time spent for one invocation of this node, * including time spent in sub nodes - * + * * @return the time spent for the slowest invocation, in milliseconds */ public double getMaxTimeSpent() { @@ -167,7 +167,7 @@ public class Profiler { /** * Gets the number of times this node has been entered - * + * * @return the number of times the node has been entered */ public int getCount() { @@ -177,7 +177,7 @@ public class Profiler { /** * Gets the total time spent in this node, excluding time spent in sub * nodes - * + * * @return the total time spent, in milliseconds */ public double getOwnTime() { @@ -190,14 +190,15 @@ public class Profiler { /** * Gets the child nodes of this node - * + * * @return a collection of child nodes */ public Collection getChildren() { return Collections.unmodifiableCollection(children.values()); } - private void buildRecursiveString(StringBuilder builder, String prefix) { + private void buildRecursiveString(StringBuilder builder, + String prefix) { if (getName() != null) { String msg = getStringRepresentation(prefix); builder.append(msg + '\n'); @@ -220,9 +221,7 @@ public class Profiler { String msg = prefix + " " + getName() + " in " + roundToSignificantFigures(getTimeSpent()) + " ms."; if (getCount() > 1) { - msg += " Invoked " - + getCount() - + " times (" + msg += " Invoked " + getCount() + " times (" + roundToSignificantFigures(getTimeSpent() / getCount()) + " ms per time, min " + roundToSignificantFigures(getMinTimeSpent()) @@ -270,10 +269,10 @@ public class Profiler { totalNode.time += getOwnTime(); totalNode.count += getCount(); - totalNode.minTime = roundToSignificantFigures(Math.min( - totalNode.minTime, getMinTimeSpent())); - totalNode.maxTime = roundToSignificantFigures(Math.max( - totalNode.maxTime, getMaxTimeSpent())); + totalNode.minTime = roundToSignificantFigures( + Math.min(totalNode.minTime, getMinTimeSpent())); + totalNode.maxTime = roundToSignificantFigures( + Math.max(totalNode.maxTime, getMaxTimeSpent())); } for (Node node : children.values()) { node.sumUpTotals(totals); @@ -390,7 +389,7 @@ public class Profiler { * Returns time relative to the particular page load time. The value should * not be used directly but rather difference between two values returned by * this method should be used to compare measurements. - * + * * @since 7.6 */ public static double getRelativeTimeMillis() { @@ -468,9 +467,8 @@ public class Profiler { stack.add(rootNode); JsArray gwtStatsEvents = getGwtStatsEvents(); if (gwtStatsEvents.length() == 0) { - getLogger() - .warning( - "No profiling events recorded, this might happen if another __gwtStatsEvent handler is installed."); + getLogger().warning( + "No profiling events recorded, this might happen if another __gwtStatsEvent handler is installed."); return; } @@ -503,10 +501,8 @@ public class Profiler { if (type.equals("end")) { if (!inEvent) { - getLogger().severe( - "Got end event for " + eventName - + " but is currently in " - + stackTop.getName()); + getLogger().severe("Got end event for " + eventName + + " but is currently in " + stackTop.getName()); return; } Node previousStackTop = stack.removeLast(); @@ -516,8 +512,9 @@ public class Profiler { previousStackTop.leave(gwtStatsEvent.getMillis()); } } else { - double millis = isExtendedEvent ? gwtStatsEvent - .getRelativeMillis() : gwtStatsEvent.getMillis(); + double millis = isExtendedEvent + ? gwtStatsEvent.getRelativeMillis() + : gwtStatsEvent.getMillis(); if (!inEvent) { stackTop = stackTop.enterChild(eventName, millis); stack.add(stackTop); @@ -538,9 +535,8 @@ public class Profiler { } if (stack.size() != 1) { - getLogger().warning( - "Not all nodes are left, the last node is " - + stack.getLast().getName()); + getLogger().warning("Not all nodes are left, the last node is " + + stack.getLast().getName()); return; } @@ -600,8 +596,8 @@ public class Profiler { } if (timings.isEmpty()) { - getLogger() - .info("Bootstrap timings not supported, please ensure your browser supports performance.timing"); + getLogger().info( + "Bootstrap timings not supported, please ensure your browser supports performance.timing"); return; } @@ -675,7 +671,8 @@ public class Profiler { public static void setProfilerResultConsumer( ProfilerResultConsumer profilerResultConsumer) { if (consumer != null) { - throw new IllegalStateException("The consumer has already been set"); + throw new IllegalStateException( + "The consumer has already been set"); } consumer = profilerResultConsumer; } @@ -697,8 +694,8 @@ public class Profiler { double getRelativeTime(); } - private static class DefaultRelativeTimeSupplier implements - RelativeTimeSupplier { + private static class DefaultRelativeTimeSupplier + implements RelativeTimeSupplier { @Override public native double getRelativeTime() @@ -707,8 +704,8 @@ public class Profiler { }-*/; } - private static class HighResolutionTimeSupplier implements - RelativeTimeSupplier { + private static class HighResolutionTimeSupplier + implements RelativeTimeSupplier { @Override public native double getRelativeTime() diff --git a/client/src/main/java/com/vaadin/client/RenderInformation.java b/client/src/main/java/com/vaadin/client/RenderInformation.java index 8fd3fc7e0b..dbc08dc8d2 100644 --- a/client/src/main/java/com/vaadin/client/RenderInformation.java +++ b/client/src/main/java/com/vaadin/client/RenderInformation.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,9 +20,9 @@ import com.google.gwt.user.client.DOM; /** * Contains size information about a rendered container and its content area. - * + * * @author Artur Signell - * + * */ public class RenderInformation { @@ -48,9 +48,9 @@ public class RenderInformation { /** * Update the size of the widget. - * + * * @param widget - * + * * @return true if the size has changed since last update * @deprecated As of 7.2, call and override {@link #updateSize(Element)} * instead @@ -69,11 +69,11 @@ public class RenderInformation { /** * Update the size of the widget. - * + * * @param widget - * + * * @return true if the size has changed since last update - * + * * @since 7.2 */ public boolean updateSize(Element element) { diff --git a/client/src/main/java/com/vaadin/client/RenderSpace.java b/client/src/main/java/com/vaadin/client/RenderSpace.java index dff774aa6f..cceb9102ab 100644 --- a/client/src/main/java/com/vaadin/client/RenderSpace.java +++ b/client/src/main/java/com/vaadin/client/RenderSpace.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ResourceLoader.java b/client/src/main/java/com/vaadin/client/ResourceLoader.java index 559768d09c..6bf0e7a4e8 100644 --- a/client/src/main/java/com/vaadin/client/ResourceLoader.java +++ b/client/src/main/java/com/vaadin/client/ResourceLoader.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -37,11 +37,11 @@ import com.google.gwt.user.client.Timer; /** * ResourceLoader lets you dynamically include external scripts and styles on * the page and lets you know when the resource has been loaded. - * + * * You can also preload resources, allowing them to get cached by the browser * without being evaluated. This enables downloading multiple resources at once * while still controlling in which order e.g. scripts are executed. - * + * * @author Vaadin Ltd * @since 7.0.0 */ @@ -56,7 +56,7 @@ public class ResourceLoader { /** * Creates a new event. - * + * * @param loader * the resource loader that has loaded the resource * @param resourceUrl @@ -74,7 +74,7 @@ public class ResourceLoader { /** * Gets the resource loader that has fired this event - * + * * @return the resource loader */ public ResourceLoader getResourceLoader() { @@ -83,7 +83,7 @@ public class ResourceLoader { /** * Gets the absolute url of the loaded resource. - * + * * @return the absolute url of the loaded resource */ public String getResourceUrl() { @@ -93,9 +93,9 @@ public class ResourceLoader { /** * Returns true if the resource has been preloaded, false if it's fully * loaded - * + * * @see ResourceLoader#preloadResource(String, ResourceLoadListener) - * + * * @return true if the resource has been preloaded, false if it's fully * loaded */ @@ -112,9 +112,9 @@ public class ResourceLoader { * Notifies this ResourceLoadListener that a resource has been loaded. * Some browsers do not support any way of detecting load errors. In * these cases, onLoad will be called regardless of the status. - * + * * @see ResourceLoadEvent - * + * * @param event * a resource load event with information about the loaded * resource @@ -127,9 +127,9 @@ public class ResourceLoader { * server did not respond. Some browsers do not support any way of * detecting load errors. In these cases, onLoad will be called * regardless of the status. - * + * * @see ResourceLoadEvent - * + * * @param event * a resource load event with information about the resource * that could not be loaded. @@ -183,7 +183,7 @@ public class ResourceLoader { /** * Returns the default ResourceLoader - * + * * @return the default ResourceLoader */ public static ResourceLoader get() { @@ -195,8 +195,8 @@ public class ResourceLoader { * this method when the script is currently loading or already loaded * doesn't cause the script to be loaded again, but the listener will still * be notified when appropriate. - * - * + * + * * @param scriptUrl * the url of the script to load * @param resourceLoadListener @@ -213,8 +213,8 @@ public class ResourceLoader { * this method when the script is currently loading or already loaded * doesn't cause the script to be loaded again, but the listener will still * be notified when appropriate. - * - * + * + * * @param scriptUrl * url of script to load * @param resourceLoadListener @@ -278,7 +278,7 @@ public class ResourceLoader { /** * The current browser supports script.async='false' for maintaining * execution order for dynamically-added scripts. - * + * * @return Browser supports script.async='false' * @since 7.2.4 */ @@ -292,12 +292,12 @@ public class ResourceLoader { * preloaded, it will be present in the browser's cache (provided the HTTP * headers allow caching), making a subsequent load operation complete * without having to wait for the resource to be downloaded again. - * + * * Calling this method when the resource is currently loading, currently * preloading, already preloaded or already loaded doesn't cause the * resource to be preloaded again, but the listener will still be notified * when appropriate. - * + * * @param url * the url of the resource to preload * @param resourceLoadListener @@ -378,7 +378,7 @@ public class ResourceLoader { * Adds an onload listener to the given element, which should be a link or a * script tag. The listener is called whenever loading is complete or an * error occurred. - * + * * @since 7.3 * @param element * the element to attach a listener to @@ -414,7 +414,7 @@ public class ResourceLoader { * Calling this method when the stylesheet is currently loading or already * loaded doesn't cause the stylesheet to be loaded again, but the listener * will still be notified when appropriate. - * + * * @param stylesheetUrl * the url of the stylesheet to load * @param resourceLoadListener diff --git a/client/src/main/java/com/vaadin/client/ServerConnector.java b/client/src/main/java/com/vaadin/client/ServerConnector.java index 0bc2ac9995..29994961d5 100644 --- a/client/src/main/java/com/vaadin/client/ServerConnector.java +++ b/client/src/main/java/com/vaadin/client/ServerConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -29,7 +29,7 @@ import com.vaadin.shared.communication.SharedState; * Interface implemented by all client side classes that can be communicate with * the server. Classes implementing this interface are initialized by the * framework when needed and have the ability to communicate with the server. - * + * * @author Vaadin Ltd * @since 7.0.0 */ @@ -37,7 +37,7 @@ public interface ServerConnector extends Connector { /** * Gets ApplicationConnection instance that created this connector. - * + * * @return The ApplicationConnection as set by * {@link #doInit(String, ApplicationConnection)} */ @@ -47,13 +47,13 @@ public interface ServerConnector extends Connector { * Tests whether the connector is enabled or not. This method checks that * the connector is enabled in context, i.e. if the parent connector is * disabled, this method must return false. - * + * * @return true if the connector is enabled, false otherwise */ public boolean isEnabled(); /** - * + * * Called once by the framework to initialize the connector. *

    * Note that the shared state is not yet available at this point nor any @@ -64,9 +64,9 @@ public interface ServerConnector extends Connector { /** * For internal use by the framework: returns the registered RPC * implementations for an RPC interface identifier. - * + * * TODO interface identifier type or format may change - * + * * @param rpcInterfaceId * RPC interface identifier: fully qualified interface type name * @return RPC interface implementations registered for an RPC interface, @@ -78,18 +78,19 @@ public interface ServerConnector extends Connector { /** * Adds a handler that is called whenever any part of the state has been * updated by the server. - * + * * @param handler * The handler that should be added. * @return A handler registration reference that can be used to unregister * the handler */ - public HandlerRegistration addStateChangeHandler(StateChangeHandler handler); + public HandlerRegistration addStateChangeHandler( + StateChangeHandler handler); /** * Removes a handler that is called whenever any part of the state has been * updated by the server. - * + * * @param handler * The handler that should be removed. */ @@ -98,7 +99,7 @@ public interface ServerConnector extends Connector { /** * Adds a handler that is called whenever the given part of the state has * been updated by the server. - * + * * @param propertyName * the name of the property for which the handler should be * called @@ -113,7 +114,7 @@ public interface ServerConnector extends Connector { /** * Removes a handler that is called whenever any part of the state has been * updated by the server. - * + * * @param propertyName * the name of the property for which the handler should be * called @@ -125,7 +126,7 @@ public interface ServerConnector extends Connector { /** * Sends the given event to all registered handlers. - * + * * @param event * The event to send. */ @@ -139,7 +140,7 @@ public interface ServerConnector extends Connector { /** * Returns the parent of this connector. Can be null for only the root * connector. - * + * * @return The parent of this connector, as set by * {@link #setParent(ServerConnector)}. */ @@ -154,7 +155,7 @@ public interface ServerConnector extends Connector { * Note that calling this method does not fire a * {@link ConnectorHierarchyChangeEvent}. The event is fired only when the * whole hierarchy has been updated. - * + * * @param parent * The new parent of the connector */ @@ -171,7 +172,7 @@ public interface ServerConnector extends Connector { * {@link HasComponentsConnector#setChildComponents(List)} and takes both * extensions and child components. Both methods are called separately by * the framework if the connector can have child components. - * + * * @param children * The new child connectors (extensions and/or components) */ @@ -184,7 +185,7 @@ public interface ServerConnector extends Connector { * Note that the method {@link HasComponentsConnector#getChildComponents()} * can be used to obtain the subset of child connectors that correspond to * components and not extensions. - * + * * @return A collection of child connectors (components or extensions) for * this connector. An empty collection if there are no children. * Never returns null. @@ -193,12 +194,12 @@ public interface ServerConnector extends Connector { /** * Gets the current shared state of the connector. - * + * * Note that state is considered an internal part of the connector. You * should not rely on the state object outside of the connector who owns it. * If you depend on the state of other connectors you should use their * public API instead of their state object directly. - * + * * @since 7.0. * @return state The shared state object. Can be any sub type of * {@link SharedState}. Never null. @@ -208,7 +209,7 @@ public interface ServerConnector extends Connector { /** * Checks if an event listener has been registered on the server side for * the given event identifier. - * + * * @param eventIdentifier * The identifier for the event * @return true if a listener has been registered on the server side, false diff --git a/client/src/main/java/com/vaadin/client/SimpleTree.java b/client/src/main/java/com/vaadin/client/SimpleTree.java index 3c63f54d5f..76d8cc6cdb 100644 --- a/client/src/main/java/com/vaadin/client/SimpleTree.java +++ b/client/src/main/java/com/vaadin/client/SimpleTree.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -38,7 +38,7 @@ import com.google.gwt.user.client.ui.Widget; /** * @author Vaadin Ltd - * + * * @deprecated as of 7.1. This class was mainly used by the old debug console * but is retained for now for backwards compatibility. */ @@ -81,14 +81,15 @@ public class SimpleTree extends ComplexPanel implements HasDoubleClickHandlers { @Override public void onClick(ClickEvent event) { if (event.getNativeEvent().getEventTarget().cast() == handle) { - if (children.getStyle().getDisplay().intern() == Display.NONE - .getCssName()) { + if (children.getStyle().getDisplay() + .intern() == Display.NONE.getCssName()) { open(event.getNativeEvent().getAltKey()); } else { close(); } - } else if (event.getNativeEvent().getEventTarget().cast() == text) { + } else if (event.getNativeEvent().getEventTarget() + .cast() == text) { select(event); } } @@ -146,7 +147,7 @@ public class SimpleTree extends ComplexPanel implements HasDoubleClickHandlers { /** * {@inheritDoc} - * + * * @deprecated As of 7.2, call and override {@link #add(Widget, Element)} * instead. */ @@ -161,7 +162,7 @@ public class SimpleTree extends ComplexPanel implements HasDoubleClickHandlers { /** * {@inheritDoc} - * + * * @since 7.2 */ @Override @@ -173,20 +174,22 @@ public class SimpleTree extends ComplexPanel implements HasDoubleClickHandlers { * {@inheritDoc} Events are not fired when double clicking child widgets. */ @Override - public HandlerRegistration addDoubleClickHandler(DoubleClickHandler handler) { + public HandlerRegistration addDoubleClickHandler( + DoubleClickHandler handler) { if (textDoubleClickHandlerManager == null) { textDoubleClickHandlerManager = new HandlerManager(this); addDomHandler(new DoubleClickHandler() { @Override public void onDoubleClick(DoubleClickEvent event) { - if (event.getNativeEvent().getEventTarget().cast() == text) { + if (event.getNativeEvent().getEventTarget() + .cast() == text) { textDoubleClickHandlerManager.fireEvent(event); } } }, DoubleClickEvent.getType()); } - return textDoubleClickHandlerManager.addHandler( - DoubleClickEvent.getType(), handler); + return textDoubleClickHandlerManager + .addHandler(DoubleClickEvent.getType(), handler); } } diff --git a/client/src/main/java/com/vaadin/client/StyleConstants.java b/client/src/main/java/com/vaadin/client/StyleConstants.java index fad88f1359..fe04fc7c46 100644 --- a/client/src/main/java/com/vaadin/client/StyleConstants.java +++ b/client/src/main/java/com/vaadin/client/StyleConstants.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/SuperDevMode.java b/client/src/main/java/com/vaadin/client/SuperDevMode.java index f664244715..e6f9295c3c 100644 --- a/client/src/main/java/com/vaadin/client/SuperDevMode.java +++ b/client/src/main/java/com/vaadin/client/SuperDevMode.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -30,10 +30,10 @@ import com.vaadin.client.ui.VNotification.HideEvent; /** * Class that enables SuperDevMode using a ?superdevmode parameter in the url. - * + * * @author Vaadin Ltd * @since 7.0 - * + * */ public class SuperDevMode { @@ -53,9 +53,8 @@ public class SuperDevMode { private static void recompileWidgetsetAndStartInDevMode( final String serverUrl) { - getLogger().info( - "Recompiling widgetset using
    " + serverUrl - + "
    and then reloading in super dev mode"); + getLogger().info("Recompiling widgetset using
    " + serverUrl + + "
    and then reloading in super dev mode"); VNotification n = new VNotification(); n.show("Recompiling widgetset, please wait", VNotification.CENTERED, VNotification.STYLE_SYSTEM); @@ -63,8 +62,9 @@ public class SuperDevMode { JsonpRequestBuilder b = new JsonpRequestBuilder(); b.setCallbackParam("_callback"); b.setTimeout(COMPILE_TIMEOUT_IN_SECONDS * 1000); - b.requestObject(serverUrl + "recompile/" + GWT.getModuleName() + "?" - + getRecompileParameters(GWT.getModuleName()), + b.requestObject( + serverUrl + "recompile/" + GWT.getModuleName() + "?" + + getRecompileParameters(GWT.getModuleName()), new AsyncCallback() { @Override @@ -77,8 +77,7 @@ public class SuperDevMode { return; } - setSession( - getSuperDevModeHookKey(), + setSession(getSuperDevModeHookKey(), getSuperDevWidgetSetUrl(GWT.getModuleName(), serverUrl)); setSession(SKIP_RECOMPILE, "1"); @@ -92,9 +91,8 @@ public class SuperDevMode { getLogger().severe("JSONP compile call failed"); // Don't log exception as they are shown as // notifications - getLogger().severe( - caught.getClass().getSimpleName() + ": " - + caught.getMessage()); + getLogger().severe(caught.getClass().getSimpleName() + + ": " + caught.getMessage()); failed(); } @@ -127,13 +125,13 @@ public class SuperDevMode { private native static String getRecompileParameters(String moduleName) /*-{ var prop_map = $wnd.__gwt_activeModules[moduleName].bindings(); - + // convert map to URL parameter string var props = []; for (var key in prop_map) { props.push(encodeURIComponent(key) + '=' + encodeURIComponent(prop_map[key])) } - + return props.join('&') + '&'; }-*/; @@ -179,7 +177,7 @@ public class SuperDevMode { /** * The URL of the code server. The default URL (http://localhost:9876/) will * be used if this is empty or null. - * + * * @param serverUrl * The url of the code server or null to use the default * @return true if recompile started, false if we are running in @@ -243,7 +241,7 @@ public class SuperDevMode { * method returns true. The application will be restarted once compilation * is done and then this method will return false. *

    - * + * * @return true if a recompile operation has started and the page will be * reloaded once it is done, false if no recompilation will be done. */ @@ -254,9 +252,10 @@ public class SuperDevMode { // in super dev mode, as a result of the recompile, the enabled // check will fail... if (!isSuperDevModeEnabledInModule()) { - showError("SuperDevMode is disabled for this module/widgetset.
    " - + "Ensure that your module definition (.gwt.xml) does not contain
    " - + "<set-configuration-property name="devModeRedirectEnabled" value="false" />
    "); + showError( + "SuperDevMode is disabled for this module/widgetset.
    " + + "Ensure that your module definition (.gwt.xml) does not contain
    " + + "<set-configuration-property name="devModeRedirectEnabled" value="false" />
    "); return false; } return SuperDevMode.recompileIfNeeded(superDevModeParameter); diff --git a/client/src/main/java/com/vaadin/client/TooltipInfo.java b/client/src/main/java/com/vaadin/client/TooltipInfo.java index c1dd5037eb..6e3e063be2 100644 --- a/client/src/main/java/com/vaadin/client/TooltipInfo.java +++ b/client/src/main/java/com/vaadin/client/TooltipInfo.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -71,7 +71,7 @@ public class TooltipInfo { /** * Checks is a message has been defined for the tooltip. - * + * * @return true if title or error message is present, false if both are * empty */ @@ -82,6 +82,7 @@ public class TooltipInfo { public boolean equals(TooltipInfo other) { return (other != null && SharedUtil.equals(other.title, title) - && SharedUtil.equals(other.errorMessageHtml, errorMessageHtml) && other.identifier == identifier); + && SharedUtil.equals(other.errorMessageHtml, errorMessageHtml) + && other.identifier == identifier); } } diff --git a/client/src/main/java/com/vaadin/client/UIDL.java b/client/src/main/java/com/vaadin/client/UIDL.java index 2c2a5de308..4b1bd3c401 100644 --- a/client/src/main/java/com/vaadin/client/UIDL.java +++ b/client/src/main/java/com/vaadin/client/UIDL.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -52,7 +52,7 @@ public final class UIDL extends JavaScriptObject { * Shorthand for getting the attribute named "id", which for Paintables is * the essential paintableId which binds the server side component to the * client side widget. - * + * * @return the value of the id attribute, if available */ public String getId() { @@ -69,7 +69,7 @@ public final class UIDL extends JavaScriptObject { * internally and is not needed within * {@link ComponentConnector#updateFromUIDL(UIDL, ApplicationConnection) * updateFromUIDL()}. - * + * * @return the name for this section */ public native String getTag() @@ -94,7 +94,7 @@ public final class UIDL extends JavaScriptObject { /** * Gets the named attribute as a String. - * + * * @param name * the name of the attribute to get * @return the attribute value @@ -105,7 +105,7 @@ public final class UIDL extends JavaScriptObject { /** * Gets the names of the attributes available. - * + * * @return the names of available attributes */ public Set getAttributeNames() { @@ -116,7 +116,7 @@ public final class UIDL extends JavaScriptObject { /** * Gets the names of variables available. - * + * * @return the names of available variables */ public Set getVariableNames() { @@ -130,7 +130,7 @@ public final class UIDL extends JavaScriptObject { /** * Gets the named attribute as an int. - * + * * @param name * the name of the attribute to get * @return the attribute value @@ -141,7 +141,7 @@ public final class UIDL extends JavaScriptObject { /** * Gets the named attribute as a long. - * + * * @param name * the name of the attribute to get * @return the attribute value @@ -152,7 +152,7 @@ public final class UIDL extends JavaScriptObject { /** * Gets the named attribute as a float. - * + * * @param name * the name of the attribute to get * @return the attribute value @@ -163,7 +163,7 @@ public final class UIDL extends JavaScriptObject { /** * Gets the named attribute as a double. - * + * * @param name * the name of the attribute to get * @return the attribute value @@ -174,7 +174,7 @@ public final class UIDL extends JavaScriptObject { /** * Gets the named attribute as a boolean. - * + * * @param name * the name of the attribute to get * @return the attribute value @@ -185,7 +185,7 @@ public final class UIDL extends JavaScriptObject { /** * Gets the named attribute as a Map of named values (key/value pairs). - * + * * @param name * the name of the attribute to get * @return the attribute Map @@ -196,7 +196,7 @@ public final class UIDL extends JavaScriptObject { /** * Gets the named attribute as an array of Strings. - * + * * @param name * the name of the attribute to get * @return the attribute value @@ -207,7 +207,7 @@ public final class UIDL extends JavaScriptObject { /** * Gets the named attribute as an int array. - * + * * @param name * the name of the attribute to get * @return the attribute value @@ -218,7 +218,7 @@ public final class UIDL extends JavaScriptObject { /** * Get attributes value as string whatever the type is - * + * * @param name * @return string presentation of attribute */ @@ -234,7 +234,7 @@ public final class UIDL extends JavaScriptObject { /** * Indicates whether or not the named attribute is available. - * + * * @param name * the name of the attribute to check * @return true if the attribute is available, false otherwise @@ -245,7 +245,7 @@ public final class UIDL extends JavaScriptObject { /** * Gets the UIDL for the child at the given index. - * + * * @param i * the index of the child to get * @return the UIDL of the child if it exists @@ -257,7 +257,7 @@ public final class UIDL extends JavaScriptObject { /** * Gets the child at the given index as a String. - * + * * @param i * the index of the child to get * @return the String representation of the child if it exists @@ -286,7 +286,7 @@ public final class UIDL extends JavaScriptObject { * if getTag() returns "color", one would update the widgets * color to reflect the value of the "color" section. *

    - * + * * @return an iterator for iterating over UIDL children */ public Iterator getChildIterator() { @@ -314,9 +314,8 @@ public final class UIDL extends JavaScriptObject { case CHILD_TYPE_XML: return getChildXML(index); default: - throw new IllegalStateException( - "Illegal child in tag " + getTag() - + " at index " + index); + throw new IllegalStateException("Illegal child in tag " + + getTag() + " at index " + index); } } return null; @@ -360,7 +359,7 @@ public final class UIDL extends JavaScriptObject { /** * Checks if the named variable is available. - * + * * @param name * the name of the variable desired * @return true if the variable exists, false otherwise @@ -371,7 +370,7 @@ public final class UIDL extends JavaScriptObject { /** * Gets the value of the named variable. - * + * * @param name * the name of the variable * @return the value of the variable @@ -382,7 +381,7 @@ public final class UIDL extends JavaScriptObject { /** * Gets the value of the named variable. - * + * * @param name * the name of the variable * @return the value of the variable @@ -393,7 +392,7 @@ public final class UIDL extends JavaScriptObject { /** * Gets the value of the named variable. - * + * * @param name * the name of the variable * @return the value of the variable @@ -404,7 +403,7 @@ public final class UIDL extends JavaScriptObject { /** * Gets the value of the named variable. - * + * * @param name * the name of the variable * @return the value of the variable @@ -415,7 +414,7 @@ public final class UIDL extends JavaScriptObject { /** * Gets the value of the named variable. - * + * * @param name * the name of the variable * @return the value of the variable @@ -426,7 +425,7 @@ public final class UIDL extends JavaScriptObject { /** * Gets the value of the named variable. - * + * * @param name * the name of the variable * @return the value of the variable @@ -437,7 +436,7 @@ public final class UIDL extends JavaScriptObject { /** * Gets the value of the named variable. - * + * * @param name * the name of the variable * @return the value of the variable @@ -448,7 +447,7 @@ public final class UIDL extends JavaScriptObject { /** * Gets the value of the named String[] variable as a Set of Strings. - * + * * @param name * the name of the variable * @return the value of the variable @@ -464,7 +463,7 @@ public final class UIDL extends JavaScriptObject { /** * Gets the value of the named variable. - * + * * @param name * the name of the variable * @return the value of the variable @@ -500,7 +499,7 @@ public final class UIDL extends JavaScriptObject { /** * Returns the number of children. - * + * * @return the number of children */ public native int getChildCount() @@ -515,34 +514,34 @@ public final class UIDL extends JavaScriptObject { /** * Gets the Paintable with the id found in the named attributes's value. - * + * * @param name * the name of the attribute * @return the Paintable referenced by the attribute, if it exists */ public ServerConnector getPaintableAttribute(String name, ApplicationConnection connection) { - return ConnectorMap.get(connection).getConnector( - getStringAttribute(name)); + return ConnectorMap.get(connection) + .getConnector(getStringAttribute(name)); } /** * Gets the Paintable with the id found in the named variable's value. - * + * * @param name * the name of the variable * @return the Paintable referenced by the variable, if it exists */ public ServerConnector getPaintableVariable(String name, ApplicationConnection connection) { - return ConnectorMap.get(connection).getConnector( - getStringVariable(name)); + return ConnectorMap.get(connection) + .getConnector(getStringVariable(name)); } /** * Returns the child UIDL by its name. If several child nodes exist with the * given name, the first child UIDL will be returned. - * + * * @param tagName * @return the child UIDL or null if child wit given name was not found */ diff --git a/client/src/main/java/com/vaadin/client/Util.java b/client/src/main/java/com/vaadin/client/Util.java index 8b5caa6051..6eb529f6d8 100644 --- a/client/src/main/java/com/vaadin/client/Util.java +++ b/client/src/main/java/com/vaadin/client/Util.java @@ -52,9 +52,9 @@ public class Util { /** * Helper method for debugging purposes. - * + * * Stops execution on firefox browsers on a breakpoint. - * + * * @deprecated As of 7.4.0, use {@link WidgetUtil#browserDebugger()} * instead. */ @@ -67,10 +67,10 @@ public class Util { * Helper method for a bug fix #14041. For mozilla getKeyCode return 0 for * space bar (because space is considered as char). If return 0 use * getCharCode. - * + * * @deprecated As of 7.4.0, use {@link WidgetUtil#getKeyCode(KeyEvent)} * instead. - * + * * @param event * @return return key code * @since 7.2.4 @@ -81,15 +81,15 @@ public class Util { } /** - * + * * Returns the topmost element of from given coordinates. - * + * * TODO fix crossplat issues clientX vs pageX. See quircksmode. Not critical * for vaadin as we scroll div istead of page. - * + * * @deprecated As of 7.4.0, use * {@link WidgetUtil#getElementFromPoint(int, int)} instead. - * + * * @param x * @param y * @return the element at given coordinates @@ -104,18 +104,18 @@ public class Util { * This helper method can be called if components size have been changed * outside rendering phase. It notifies components parent about the size * change so it can react. - * + * * When using this method, developer should consider if size changes could * be notified lazily. If lazy flag is true, method will save widget and * wait for a moment until it notifies parents in chunks. This may vastly * optimize layout in various situation. Example: if component have a lot of * images their onload events may fire "layout phase" many times in a short * period. - * + * * @param widget * @param lazy * run componentSizeUpdated lazyly - * + * * @deprecated As of 7.0, use * {@link LayoutManager#setNeedsMeasure(ComponentConnector)} * instead @@ -159,10 +159,10 @@ public class Util { /** * Converts html entities to text. - * + * * @deprecated As of 7.4.0, use {@link WidgetUtil#escapeHTML(String)} * instead. - * + * * @param html * @return escaped string presentation of given html */ @@ -173,10 +173,10 @@ public class Util { /** * Escapes the string so it is safe to write inside an HTML attribute. - * + * * @deprecated As of 7.4.0, use {@link WidgetUtil#escapeAttribute(String)} * instead. - * + * * @param attribute * The string to escape * @return An escaped version of attribute. @@ -188,12 +188,12 @@ public class Util { /** * Clones given element as in JavaScript. - * + * * Deprecate this if there appears similar method into GWT someday. - * + * * @deprecated As of 7.4.0, use * {@link WidgetUtil#cloneNode(Element, boolean)} instead. - * + * * @param element * @param deep * clone child tree also @@ -225,8 +225,8 @@ public class Util { @Deprecated public static int measureVerticalPaddingAndBorder(Element element, int paddingGuess) { - return WidgetUtil - .measureVerticalPaddingAndBorder(element, paddingGuess); + return WidgetUtil.measureVerticalPaddingAndBorder(element, + paddingGuess); } /** @@ -341,11 +341,11 @@ public class Util { /** * Defers the execution of {@link #runWebkitOverflowAutoFix(Element)} - * + * * @deprecated As of 7.4.0, use * {@link WidgetUtil#runWebkitOverflowAutoFixDeferred(Element)} * instead. - * + * * @since 7.2.6 * @param elem * with overflow auto @@ -357,12 +357,12 @@ public class Util { /** * Run workaround for webkits overflow auto issue. - * + * * See: our bug #2138 and https://bugs.webkit.org/show_bug.cgi?id=21462 - * + * * @deprecated As of 7.4.0, use * {@link WidgetUtil#runWebkitOverflowAutoFix(Element)} instead. - * + * * @param elem * with overflow auto */ @@ -376,7 +376,7 @@ public class Util { * dimension is not specified as relative it will return -1. If the shared * state does not contain width or height specifications this will return * null. - * + * * @param state * @return */ @@ -411,7 +411,7 @@ public class Util { * Checks if a and b are equals using {@link #equals(Object)}. Handles null * values as well. Does not ensure that objects are of the same type. * Assumes that the first object's equals method handle equals properly. - * + * * @param a * The first value to compare * @param b @@ -432,26 +432,27 @@ public class Util { /** * Gets the border-box width for the given element, i.e. element width + * border + padding. Always rounds up to nearest integer. - * + * * @deprecated As of 7.4.0, use {@link WidgetUtil#getRequiredWidth(Element)} * instead. - * + * * @param element * The element to check * @return The border-box width for the element */ @Deprecated - public static int getRequiredWidth(com.google.gwt.dom.client.Element element) { + public static int getRequiredWidth( + com.google.gwt.dom.client.Element element) { return WidgetUtil.getRequiredWidth(element); } /** * Gets the border-box height for the given element, i.e. element height + * border + padding. Always rounds up to nearest integer. - * + * * @deprecated As of 7.4.0, use * {@link WidgetUtil#getRequiredHeight(Element)} instead. - * + * * @param element * The element to check * @return The border-box height for the element @@ -526,16 +527,17 @@ public class Util { /** * Detects what is currently the overflow style attribute in given element. - * + * * @deprecated As of 7.4.0, use * {@link WidgetUtil#mayHaveScrollBars(Element)} instead. - * + * * @param pe * the element to detect * @return true if auto or scroll */ @Deprecated - public static boolean mayHaveScrollBars(com.google.gwt.dom.client.Element pe) { + public static boolean mayHaveScrollBars( + com.google.gwt.dom.client.Element pe) { return WidgetUtil.mayHaveScrollBars(pe); } @@ -545,9 +547,9 @@ public class Util { * also returned if "element" is part of its caption. If * element is not part of any child component, null is * returned. - * + * * This method returns the deepest nested VPaintableWidget. - * + * * @param client * A reference to ApplicationConnection * @param parent @@ -596,8 +598,9 @@ public class Util { VOverlay overlay = findWidget(element, VOverlay.class); if (overlay != null && overlay.getOwner() != null) { - return getConnectorForElement(client, client.getUIConnector() - .getWidget(), overlay.getOwner().getElement()); + return getConnectorForElement(client, + client.getUIConnector().getWidget(), + overlay.getOwner().getElement()); } else { return null; } @@ -605,9 +608,9 @@ public class Util { /** * Will (attempt) to focus the given DOM Element. - * + * * @deprecated As of 7.4.0, use {@link WidgetUtil#focus(Element)} instead. - * + * * @param el * the element to focus */ @@ -619,12 +622,12 @@ public class Util { /** * Helper method to find the nearest parent paintable instance by traversing * the DOM upwards from given element. - * + * * @param element * the element to start from */ - public static ComponentConnector findPaintable( - ApplicationConnection client, Element element) { + public static ComponentConnector findPaintable(ApplicationConnection client, + Element element) { Widget widget = Util.findWidget(element, null); ConnectorMap vPaintableMap = ConnectorMap.get(client); while (widget != null && !vPaintableMap.isConnector(widget)) { @@ -637,10 +640,10 @@ public class Util { /** * Helper method to find first instance of given Widget type found by * traversing DOM upwards from given element. - * + * * @deprecated As of 7.4.0, use * {@link WidgetUtil#findWidget(Element, Class)} instead. - * + * * @param element * the element where to start seeking of Widget * @param class1 @@ -654,10 +657,10 @@ public class Util { /** * Force webkit to redraw an element - * + * * @deprecated As of 7.4.0, use * {@link WidgetUtil#forceWebkitRedraw(Element)} instead. - * + * * @param element * The element that should be redrawn */ @@ -670,10 +673,10 @@ public class Util { * Performs a hack to trigger a re-layout in the IE8. This is usually * necessary in cases where IE8 "forgets" to update child elements when they * resize. - * + * * @deprecated As of 7.4.0, use {@link WidgetUtil#forceIE8Redraw(Element)} * instead. - * + * * @param e * The element to perform the hack on */ @@ -686,10 +689,10 @@ public class Util { * Performs a hack to trigger a re-layout in the IE browser. This is usually * necessary in cases where IE "forgets" to update child elements when they * resize. - * + * * @deprecated As of 7.4.0, use {@link WidgetUtil#forceIERedraw(Element)} * instead. - * + * * @since 7.3 * @param e * The element to perform the hack on @@ -702,12 +705,12 @@ public class Util { /** * Detaches and re-attaches the element from its parent. The element is * reattached at the same position in the DOM as it was before. - * + * * Does nothing if the element is not attached to the DOM. - * + * * @deprecated As of 7.4.0, use {@link WidgetUtil#detachAttach(Element)} * instead. - * + * * @param element * The element to detach and re-attach */ @@ -727,10 +730,10 @@ public class Util { /** * Returns the index of the childElement within its parent. - * + * * @deprecated As of 7.4.0, use * {@link WidgetUtil#getChildElementIndex(Element)} instead. - * + * * @param subElement * @return */ @@ -746,9 +749,8 @@ public class Util { if (connector != null) { getLogger().info("\t" + id + " (" + connector.getClass() + ") :"); } else { - getLogger().warning( - "\t" + id + ": Warning: no corresponding connector for id " - + id); + getLogger().warning("\t" + id + + ": Warning: no corresponding connector for id " + id); } for (MethodInvocation invocation : invocations) { getLogger().info("\t\t" + getInvocationDebugString(invocation)); @@ -758,27 +760,29 @@ public class Util { /** * Produces a string representation of a method invocation, suitable for * debug output - * + * * @since 7.5 * @param invocation * @return */ - private static String getInvocationDebugString(MethodInvocation invocation) { + private static String getInvocationDebugString( + MethodInvocation invocation) { Object[] parameters = invocation.getParameters(); String formattedParams = null; - if (ApplicationConstants.UPDATE_VARIABLE_METHOD.equals(invocation - .getMethodName()) && parameters.length == 2) { + if (ApplicationConstants.UPDATE_VARIABLE_METHOD + .equals(invocation.getMethodName()) && parameters.length == 2) { // name, value Object value = parameters[1]; // TODO paintables inside lists/maps get rendered as // components in the debug console - String formattedValue = value instanceof ServerConnector ? ((ServerConnector) value) - .getConnectorId() : String.valueOf(value); + String formattedValue = value instanceof ServerConnector + ? ((ServerConnector) value).getConnectorId() + : String.valueOf(value); formattedParams = parameters[0] + " : " + formattedValue; } if (null == formattedParams) { - formattedParams = (null != parameters) ? Arrays - .toString(parameters) : null; + formattedParams = (null != parameters) ? Arrays.toString(parameters) + : null; } return invocation.getInterfaceName() + "." + invocation.getMethodName() + "(" + formattedParams + ")"; @@ -806,8 +810,8 @@ public class Util { printConnectorInvocations(invocations, curId, c); } } catch (Exception e) { - getLogger() - .log(Level.SEVERE, "Error logging method invocations", e); + getLogger().log(Level.SEVERE, "Error logging method invocations", + e); } } @@ -815,11 +819,11 @@ public class Util { * Temporarily sets the {@code styleProperty} to {@code tempValue} and then * resets it to its current value. Used mainly to work around rendering * issues in IE (and possibly in other browsers) - * + * * @deprecated As of 7.4.0, use * {@link WidgetUtil#setStyleTemporarily(Element, String, String)} * instead. - * + * * @param element * The target element * @param styleProperty @@ -837,10 +841,10 @@ public class Util { * A helper method to return the client position from an event. Returns * position from either first changed touch (if touch event) or from the * event itself. - * + * * @deprecated As of 7.4.0, use * {@link WidgetUtil#getTouchOrMouseClientX(Event)} instead. - * + * * @param event * @return */ @@ -853,10 +857,10 @@ public class Util { * Find the element corresponding to the coordinates in the passed mouse * event. Please note that this is not always the same as the target of the * event e.g. if event capture is used. - * + * * @deprecated As of 7.4.0, use * {@link WidgetUtil#getElementUnderMouse(NativeEvent)} instead. - * + * * @param event * the mouse event to get coordinates from * @return the element at the coordinates of the event @@ -871,10 +875,10 @@ public class Util { * A helper method to return the client position from an event. Returns * position from either first changed touch (if touch event) or from the * event itself. - * + * * @deprecated As of 7.4.0, use * {@link WidgetUtil#getTouchOrMouseClientY(Event)} instead. - * + * * @param event * @return */ @@ -887,7 +891,7 @@ public class Util { * @deprecated As of 7.4.0, use * {@link WidgetUtil#getTouchOrMouseClientY(NativeEvent)} * instead. - * + * * @see #getTouchOrMouseClientY(Event) * @param currentGwtEvent * @return @@ -901,9 +905,9 @@ public class Util { * @deprecated As of 7.4.0, use * {@link WidgetUtil#getTouchOrMouseClientX(NativeEvent)} * instead. - * + * * @see #getTouchOrMouseClientX(Event) - * + * * @param event * @return */ @@ -943,10 +947,10 @@ public class Util { /** * Gets the currently focused element. - * + * * @deprecated As of 7.4.0, use {@link WidgetUtil#getFocusedElement()} * instead. - * + * * @return The active element or null if no active element could be found. */ @Deprecated @@ -956,7 +960,7 @@ public class Util { /** * Gets the currently focused element for Internet Explorer. - * + * * @return The currently focused element * @deprecated Use #getFocusedElement instead */ @@ -967,12 +971,12 @@ public class Util { /** * Gets currently focused element and checks if it's editable - * + * * @deprecated As of 7.4.0, use * {@link WidgetUtil#isFocusedElementEditable()} instead. - * + * * @since 7.4 - * + * * @return true if focused element is editable */ @Deprecated @@ -985,10 +989,10 @@ public class Util { * this method checks that this widget nor any of its parents is hidden. Can * be e.g used to check whether component should react to some events or * not. - * + * * @deprecated As of 7.4.0, use * {@link WidgetUtil#isAttachedAndDisplayed(Widget)} instead. - * + * * @param widget * @return true if attached and displayed */ @@ -1000,10 +1004,10 @@ public class Util { /** * Scrolls an element into view vertically only. Modified version of * Element.scrollIntoView. - * + * * @deprecated As of 7.4.0, use * {@link WidgetUtil#scrollIntoViewVertically(Element)} instead. - * + * * @param elem * The element to scroll into view */ @@ -1015,11 +1019,11 @@ public class Util { /** * Checks if the given event is either a touch event or caused by the left * mouse button - * + * * @deprecated As of 7.4.0, use * {@link WidgetUtil#isTouchEventOrLeftMouseButton(Event)} * instead. - * + * * @param event * @return true if the event is a touch event or caused by the left mouse * button, false otherwise @@ -1031,7 +1035,7 @@ public class Util { /** * Performs a shallow comparison of the collections. - * + * * @param collection1 * The first collection * @param collection2 @@ -1076,10 +1080,10 @@ public class Util { /** * Resolve a relative URL to an absolute URL based on the current document's * location. - * + * * @deprecated As of 7.4.0, use {@link WidgetUtil#getAbsoluteUrl(String)} * instead. - * + * * @param url * a string with the relative URL to resolve * @return the corresponding absolute URL as a string @@ -1091,16 +1095,16 @@ public class Util { /** * Sets the selection range of an input element. - * + * * We need this JSNI function to set selection range so that we can use the * optional direction attribute to set the anchor to the end and the focus * to the start. This makes Firefox work the same way as other browsers * (#13477) - * + * * @deprecated As of 7.4.0, use * {@link WidgetUtil#setSelectionRange(Element, int, int, String)} * instead. - * + * * @param elem * the html input element. * @param pos @@ -1111,7 +1115,7 @@ public class Util { * a string indicating the direction in which the selection was * performed. This may be "forward" or "backward", or "none" if * the direction is unknown or irrelevant. - * + * * @since 7.3 */ @Deprecated @@ -1124,7 +1128,7 @@ public class Util { * Converts a native {@link JavaScriptObject} into a {@link JsonValue}. This * is a no-op in GWT code compiled to javascript, but needs some special * handling to work when run in JVM. - * + * * @param jso * the java script object to represent as json * @return the json representation @@ -1141,7 +1145,7 @@ public class Util { * Converts a {@link JsonValue} into a native {@link JavaScriptObject}. This * is a no-op in GWT code compiled to javascript, but needs some special * handling to work when run in JVM. - * + * * @param jsonValue * the json value * @return a native javascript object representation of the json value @@ -1156,7 +1160,7 @@ public class Util { /** * Convert a {@link JavaScriptObject} into a string representation. - * + * * @param json * a JavaScript object to be converted to a string * @return JSON in string representation @@ -1168,7 +1172,7 @@ public class Util { /** * Parse a string containing JSON into a {@link JavaScriptObject}. - * + * * @param * the overlay type to expect from the parse * @param jsonAsString @@ -1182,7 +1186,7 @@ public class Util { /** * Round {@code num} up to {@code exp} decimal positions. - * + * * @since 7.6 */ public static native double round(double num, int exp) @@ -1222,7 +1226,7 @@ public class Util { * appropriate mode set. * * This version of the method tries to recursively locate such a parent. - * + * * For internal use only. May be removed or replaced in the future. */ public static boolean shouldSkipMeasurementOfConnector( @@ -1230,7 +1234,8 @@ public class Util { Profiler.enter("skipMeasureDueLayoutHint"); boolean skip = false; - HasChildMeasurementHintConnector parent = getPossibleChildMeasurementHintParentConnector(candidate); + HasChildMeasurementHintConnector parent = getPossibleChildMeasurementHintParentConnector( + candidate); if (parent != null) { ChildMeasurementHint measureMode = parent.getChildMeasurementHint(); diff --git a/client/src/main/java/com/vaadin/client/VCaption.java b/client/src/main/java/com/vaadin/client/VCaption.java index ace4fd7184..1d79bd57cc 100644 --- a/client/src/main/java/com/vaadin/client/VCaption.java +++ b/client/src/main/java/com/vaadin/client/VCaption.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -67,9 +67,9 @@ public class VCaption extends HTML { /** * Creates a caption that is not linked to a {@link ComponentConnector}. - * + * * When using this constructor, {@link #getOwner()} returns null. - * + * * @param client * ApplicationConnection * @deprecated all captions should be associated with a paintable widget and @@ -88,13 +88,14 @@ public class VCaption extends HTML { /** * Creates a caption for a {@link ComponentConnector}. - * + * * @param component * owner of caption, not null * @param client * ApplicationConnection */ - public VCaption(ComponentConnector component, ApplicationConnection client) { + public VCaption(ComponentConnector component, + ApplicationConnection client) { super(); this.client = client; owner = component; @@ -129,10 +130,10 @@ public class VCaption extends HTML { /** * Updates the caption from UIDL. - * + * * This method may only be called when the caption has an owner - otherwise, * use {@link #updateCaptionWithoutOwner(UIDL, String, boolean, boolean)}. - * + * * @return true if the position where the caption should be placed has * changed */ @@ -172,8 +173,8 @@ public class VCaption extends HTML { icon = null; } if (hasIcon) { - String uri = owner.getState().resources.get( - ComponentConstants.ICON_RESOURCE).getURL(); + String uri = owner.getState().resources + .get(ComponentConstants.ICON_RESOURCE).getURL(); icon = client.getIcon(uri); @@ -247,8 +248,8 @@ public class VCaption extends HTML { getInsertPosition(InsertPosition.REQUIRED)); // Hide the required indicator from assistive device - Roles.getTextboxRole().setAriaHiddenState( - requiredFieldIndicator, true); + Roles.getTextboxRole() + .setAriaHiddenState(requiredFieldIndicator, true); } } else if (requiredFieldIndicator != null) { // Remove existing @@ -269,8 +270,8 @@ public class VCaption extends HTML { getInsertPosition(InsertPosition.ERROR)); // Hide error indicator from assistive devices - Roles.getTextboxRole().setAriaHiddenState( - errorIndicatorElement, true); + Roles.getTextboxRole().setAriaHiddenState(errorIndicatorElement, + true); } } else if (errorIndicatorElement != null) { // Remove existing @@ -447,9 +448,8 @@ public class VCaption extends HTML { if (owner != null) { Util.notifyParentOfSizeChange(owner.getWidget(), true); } else { - getLogger() - .warning( - "Warning: Icon load event was not propagated because VCaption owner is unknown."); + getLogger().warning( + "Warning: Icon load event was not propagated because VCaption owner is unknown."); } } } @@ -477,7 +477,7 @@ public class VCaption extends HTML { /** * Checks whether anything in a given state change might cause the caption * to change. - * + * * @param event * the state change event to check * @return true if the caption might have changed; otherwise @@ -499,7 +499,7 @@ public class VCaption extends HTML { /** * Returns Paintable for which this Caption belongs to. - * + * * @return owner Widget */ public ComponentConnector getOwner() { @@ -637,13 +637,13 @@ public class VCaption extends HTML { } if (icon != null) { - int iconRequiredWidth = WidgetUtil.getRequiredWidth(icon - .getElement()); + int iconRequiredWidth = WidgetUtil + .getRequiredWidth(icon.getElement()); if (availableWidth > iconRequiredWidth) { availableWidth -= iconRequiredWidth; } else { - icon.getElement().getStyle() - .setWidth(availableWidth, Unit.PX); + icon.getElement().getStyle().setWidth(availableWidth, + Unit.PX); availableWidth = 0; } } @@ -664,7 +664,7 @@ public class VCaption extends HTML { /** * Sets the tooltip that should be shown for the caption - * + * * @param tooltipInfo * The tooltip that should be shown or null if no tooltip should * be shown @@ -675,7 +675,7 @@ public class VCaption extends HTML { /** * Returns the tooltip that should be shown for the caption - * + * * @return The tooltip to show or null if no tooltip should be shown */ public TooltipInfo getTooltipInfo() { @@ -704,7 +704,7 @@ public class VCaption extends HTML { * Sets whether the caption is rendered as HTML. *

    * Default is false - * + * * @param captionAsHtml * true if the captions are rendered as HTML, false if rendered * as plain text @@ -717,7 +717,7 @@ public class VCaption extends HTML { * Checks whether captions are rendered as HTML. *

    * Default is false - * + * * @return true if the captions are rendered as HTML, false if rendered as * plain text */ @@ -731,7 +731,7 @@ public class VCaption extends HTML { *

    * Uses {@link AbstractComponentState#captionAsHtml} to determine whether to * set the caption as html or plain text - * + * * @since 7.4 * @param captionElement * the target element @@ -753,7 +753,7 @@ public class VCaption extends HTML { *

    * Uses {@link AbstractComponentState#captionAsHtml} to determine whether to * set the caption as html or plain text - * + * * @since 7.4 * @param widget * the target widget diff --git a/client/src/main/java/com/vaadin/client/VCaptionWrapper.java b/client/src/main/java/com/vaadin/client/VCaptionWrapper.java index 382126f409..b9d2edc538 100644 --- a/client/src/main/java/com/vaadin/client/VCaptionWrapper.java +++ b/client/src/main/java/com/vaadin/client/VCaptionWrapper.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -26,7 +26,7 @@ public class VCaptionWrapper extends FlowPanel { /** * Creates a new caption wrapper panel. - * + * * @param toBeWrapped * paintable that the caption is associated with, not null * @param client diff --git a/client/src/main/java/com/vaadin/client/VConsole.java b/client/src/main/java/com/vaadin/client/VConsole.java index c01711c5b3..ababfc2121 100644 --- a/client/src/main/java/com/vaadin/client/VConsole.java +++ b/client/src/main/java/com/vaadin/client/VConsole.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -23,7 +23,7 @@ import com.vaadin.client.debug.internal.VDebugWindow; /** * A helper class to do some client side logging. - * + * * @deprecated as of 7.1, use {@link Logger} from java.util.logging instead. */ @Deprecated @@ -32,7 +32,7 @@ public class VConsole { /** * Used by ApplicationConfiguration to initialize VConsole. - * + * * @param console */ static void setImplementation(VDebugWindow console) { diff --git a/client/src/main/java/com/vaadin/client/VErrorMessage.java b/client/src/main/java/com/vaadin/client/VErrorMessage.java index 271c7b1be8..fa7fe1a51a 100644 --- a/client/src/main/java/com/vaadin/client/VErrorMessage.java +++ b/client/src/main/java/com/vaadin/client/VErrorMessage.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -38,7 +38,7 @@ public class VErrorMessage extends FlowPanel { * The owner must be set if the {@link VErrorMessage} is created * 'stand-alone' (not within a {@link VOverlay}), or theming might not work * properly. - * + * * @see VOverlay#setOwner(Widget) * @param owner * the owner (creator Widget) @@ -59,7 +59,7 @@ public class VErrorMessage extends FlowPanel { /** * Shows this error message next to given element. - * + * * @param indicatorElement * @deprecated As of 7.2, call and override {@link #showAt(Element)} instead */ @@ -73,12 +73,10 @@ public class VErrorMessage extends FlowPanel { } errorContainer.setPopupPosition( DOM.getAbsoluteLeft(indicatorElement) - + 2 - * DOM.getElementPropertyInt(indicatorElement, + + 2 * DOM.getElementPropertyInt(indicatorElement, "offsetHeight"), DOM.getAbsoluteTop(indicatorElement) - + 2 - * DOM.getElementPropertyInt(indicatorElement, + + 2 * DOM.getElementPropertyInt(indicatorElement, "offsetHeight")); errorContainer.show(); @@ -86,9 +84,9 @@ public class VErrorMessage extends FlowPanel { /** * Shows this error message next to given element. - * + * * @param indicatorElement - * + * * @since 7.2 */ public void showAt(Element indicatorElement) { diff --git a/client/src/main/java/com/vaadin/client/VLoadingIndicator.java b/client/src/main/java/com/vaadin/client/VLoadingIndicator.java index 7c7edeb04f..0ba0edd984 100644 --- a/client/src/main/java/com/vaadin/client/VLoadingIndicator.java +++ b/client/src/main/java/com/vaadin/client/VLoadingIndicator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -28,7 +28,7 @@ import com.google.gwt.user.client.Timer; * {@link #trigger()} is called the indicator moves to its "triggered" state and * then transitions from one state to the next when the timeouts specified using * the set*StateDelay methods occur. - * + * * @author Vaadin Ltd * @since 7.1 */ @@ -72,7 +72,7 @@ public class VLoadingIndicator { /** * Returns the delay (in ms) which must pass before the loading indicator * moves into the "first" state and is shown to the user - * + * * @return The delay (in ms) until moving into the "first" state. Counted * from when {@link #trigger()} is called. */ @@ -83,7 +83,7 @@ public class VLoadingIndicator { /** * Sets the delay (in ms) which must pass before the loading indicator moves * into the "first" state and is shown to the user - * + * * @param firstDelay * The delay (in ms) until moving into the "first" state. Counted * from when {@link #trigger()} is called. @@ -95,7 +95,7 @@ public class VLoadingIndicator { /** * Returns the delay (in ms) which must pass before the loading indicator * moves to its "second" state. - * + * * @return The delay (in ms) until the loading indicator moves into its * "second" state. Counted from when {@link #trigger()} is called. */ @@ -106,7 +106,7 @@ public class VLoadingIndicator { /** * Sets the delay (in ms) which must pass before the loading indicator moves * to its "second" state. - * + * * @param secondDelay * The delay (in ms) until the loading indicator moves into its * "second" state. Counted from when {@link #trigger()} is @@ -119,7 +119,7 @@ public class VLoadingIndicator { /** * Returns the delay (in ms) which must pass before the loading indicator * moves to its "third" state. - * + * * @return The delay (in ms) until the loading indicator moves into its * "third" state. Counted from when {@link #trigger()} is called. */ @@ -130,7 +130,7 @@ public class VLoadingIndicator { /** * Sets the delay (in ms) which must pass before the loading indicator moves * to its "third" state. - * + * * @param thirdDelay * The delay (in ms) from the event until changing the loading * indicator into its "third" state. Counted from when @@ -156,7 +156,7 @@ public class VLoadingIndicator { /** * Triggers displaying of this loading indicator unless it's already visible * or scheduled to be shown after a delay. - * + * * @since 7.4 */ public void ensureTriggered() { @@ -191,7 +191,7 @@ public class VLoadingIndicator { /** * Returns the {@link ApplicationConnection} which uses this loading * indicator - * + * * @return The ApplicationConnection for this loading indicator */ public ApplicationConnection getConnection() { @@ -201,7 +201,7 @@ public class VLoadingIndicator { /** * Sets the {@link ApplicationConnection} which uses this loading indicator. * Only used internally. - * + * * @param connection * The ApplicationConnection for this loading indicator */ @@ -223,7 +223,7 @@ public class VLoadingIndicator { /** * Returns whether or not the loading indicator is showing. - * + * * @return true if the loading indicator is visible, false otherwise */ public boolean isVisible() { @@ -237,7 +237,7 @@ public class VLoadingIndicator { /** * Returns the root element of the loading indicator - * + * * @return The loading indicator DOM element */ public com.google.gwt.user.client.Element getElement() { diff --git a/client/src/main/java/com/vaadin/client/VSchedulerImpl.java b/client/src/main/java/com/vaadin/client/VSchedulerImpl.java index 2c0657eb59..68078b4de7 100644 --- a/client/src/main/java/com/vaadin/client/VSchedulerImpl.java +++ b/client/src/main/java/com/vaadin/client/VSchedulerImpl.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/VTooltip.java b/client/src/main/java/com/vaadin/client/VTooltip.java index 39d0682821..09d3ab5d65 100644 --- a/client/src/main/java/com/vaadin/client/VTooltip.java +++ b/client/src/main/java/com/vaadin/client/VTooltip.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -48,9 +48,8 @@ import com.vaadin.client.ui.VOverlay; public class VTooltip extends VOverlay { private static final String CLASSNAME = "v-tooltip"; private static final int MARGIN = 4; - public static final int TOOLTIP_EVENTS = Event.ONKEYDOWN - | Event.ONMOUSEOVER | Event.ONMOUSEOUT | Event.ONMOUSEMOVE - | Event.ONCLICK; + public static final int TOOLTIP_EVENTS = Event.ONKEYDOWN | Event.ONMOUSEOVER + | Event.ONMOUSEOUT | Event.ONMOUSEMOVE | Event.ONCLICK; VErrorMessage em = new VErrorMessage(); Element description = DOM.createDiv(); @@ -80,7 +79,7 @@ public class VTooltip extends VOverlay { * Used to show tooltips; usually used via the singleton in * {@link ApplicationConnection}. NOTE that #setOwner(Widget)} should be * called after instantiating. - * + * * @see ApplicationConnection#getVTooltip() */ public VTooltip() { @@ -108,7 +107,7 @@ public class VTooltip extends VOverlay { /** * Show the tooltip with the provided info for assistive devices. - * + * * @param info * with the content of the tooltip */ @@ -120,7 +119,7 @@ public class VTooltip extends VOverlay { /** * Initialize the tooltip overlay for assistive devices. - * + * * @param info * with the content of the tooltip * @since 7.2.4 @@ -134,7 +133,8 @@ public class VTooltip extends VOverlay { } private void setTooltipText(TooltipInfo info) { - if (info.getErrorMessage() != null && !info.getErrorMessage().isEmpty()) { + if (info.getErrorMessage() != null + && !info.getErrorMessage().isEmpty()) { em.setVisible(true); em.updateMessage(info.getErrorMessage()); } else { @@ -147,12 +147,12 @@ public class VTooltip extends VOverlay { * element we need to clear style width of its parent DIV from old * value (in some strange cases this width=[tooltip MAX_WIDTH] after * tooltip text has been already updated to new shortly value: - * + * *

    This is a short tooltip
    - * + * * and it leads to error during calculation offsetWidth (it is * native GWT method getSubPixelOffsetWidth()) of description * element") @@ -168,7 +168,7 @@ public class VTooltip extends VOverlay { /** * Show a popup containing the currentTooltipInfo - * + * */ private void showTooltip() { if (currentTooltipInfo.hasMessage()) { @@ -212,7 +212,7 @@ public class VTooltip extends VOverlay { * Return the final X-coordinate of the tooltip based on cursor * position, size of the tooltip, size of the page and necessary * margins. - * + * * @param offsetWidth * @return The final X-coordinate */ @@ -227,8 +227,9 @@ public class VTooltip extends VOverlay { x = tooltipEventMouseX + Window.getScrollLeft() - 10 - offsetWidth; } - if (x + offsetWidth + MARGIN - Window.getScrollLeft() > Window - .getClientWidth()) { + if (x + offsetWidth + MARGIN + - Window.getScrollLeft() > Window + .getClientWidth()) { x = Window.getClientWidth() - offsetWidth - MARGIN + Window.getScrollLeft(); } @@ -254,8 +255,9 @@ public class VTooltip extends VOverlay { private int getFinalTouchX(int offsetWidth) { int x = 0; int widthNeeded = 10 + offsetWidth; - int roomLeft = currentElement != null ? currentElement - .getAbsoluteLeft() : EVENT_XY_POSITION_OUTSIDE; + int roomLeft = currentElement != null + ? currentElement.getAbsoluteLeft() + : EVENT_XY_POSITION_OUTSIDE; int viewPortWidth = Window.getClientWidth(); int roomRight = viewPortWidth - roomLeft; if (roomRight > widthNeeded) { @@ -263,7 +265,8 @@ public class VTooltip extends VOverlay { } else { x = roomLeft - offsetWidth; } - if (x + offsetWidth - Window.getScrollLeft() > viewPortWidth) { + if (x + offsetWidth + - Window.getScrollLeft() > viewPortWidth) { x = viewPortWidth - offsetWidth + Window.getScrollLeft(); } @@ -282,10 +285,10 @@ public class VTooltip extends VOverlay { * Return the final Y-coordinate of the tooltip based on cursor * position, size of the tooltip, size of the page and necessary * margins. - * + * * @param offsetHeight * @return The final y-coordinate - * + * */ private int getFinalY(int offsetHeight) { int y = 0; @@ -300,8 +303,9 @@ public class VTooltip extends VOverlay { - offsetHeight; } - if (y + offsetHeight + MARGIN - Window.getScrollTop() > Window - .getClientHeight()) { + if (y + offsetHeight + MARGIN + - Window.getScrollTop() > Window + .getClientHeight()) { y = tooltipEventMouseY - 5 - offsetHeight + Window.getScrollTop(); if (y - Window.getScrollTop() < 0) { @@ -333,19 +337,17 @@ public class VTooltip extends VOverlay { private int getFinalTouchY(int offsetHeight) { int y = 0; int heightNeeded = 10 + offsetHeight; - int roomAbove = currentElement != null ? currentElement - .getAbsoluteTop() - + currentElement.getOffsetHeight() + int roomAbove = currentElement != null + ? currentElement.getAbsoluteTop() + + currentElement.getOffsetHeight() : EVENT_XY_POSITION_OUTSIDE; int roomBelow = Window.getClientHeight() - roomAbove; if (roomBelow > heightNeeded) { y = roomAbove; } else { - y = roomAbove - - offsetHeight - - (currentElement != null ? currentElement - .getOffsetHeight() : 0); + y = roomAbove - offsetHeight - (currentElement != null + ? currentElement.getOffsetHeight() : 0); } if (y + offsetHeight - Window.getScrollTop() > Window @@ -379,7 +381,7 @@ public class VTooltip extends VOverlay { * and attached to the DOM well in advance. For this reason both isShowing * and isVisible return false positives. We can't override either of them as * external code may depend on this behavior. - * + * * @return boolean */ public boolean isTooltipOpen() { @@ -454,13 +456,13 @@ public class VTooltip extends VOverlay { } private int getEventX(Event event, boolean isFocused) { - return isFocused ? EVENT_XY_POSITION_OUTSIDE : DOM - .eventGetClientX(event); + return isFocused ? EVENT_XY_POSITION_OUTSIDE + : DOM.eventGetClientX(event); } private int getEventY(Event event, boolean isFocused) { - return isFocused ? EVENT_XY_POSITION_OUTSIDE : DOM - .eventGetClientY(event); + return isFocused ? EVENT_XY_POSITION_OUTSIDE + : DOM.eventGetClientY(event); } @Override @@ -494,9 +496,9 @@ public class VTooltip extends VOverlay { opening = false; } - private class TooltipEventHandler implements MouseMoveHandler, - KeyDownHandler, FocusHandler, BlurHandler, MouseDownHandler, - MouseOutHandler { + private class TooltipEventHandler + implements MouseMoveHandler, KeyDownHandler, FocusHandler, + BlurHandler, MouseDownHandler, MouseOutHandler { /** * Marker for handling of tooltip through focus @@ -505,7 +507,7 @@ public class VTooltip extends VOverlay { /** * Locate the tooltip for given element - * + * * @param element * Element used in search * @return TooltipInfo if connector and tooltip found, null if not @@ -545,7 +547,7 @@ public class VTooltip extends VOverlay { /** * Handle hide event - * + * */ private void handleHideEvent() { hideTooltip(); @@ -568,7 +570,7 @@ public class VTooltip extends VOverlay { /** * Displays Tooltip when page is navigated with the keyboard. - * + * * Tooltip is not visible. This makes it possible for assistive devices * to recognize the tooltip. */ @@ -579,7 +581,7 @@ public class VTooltip extends VOverlay { /** * Hides Tooltip when the page is navigated with the keyboard. - * + * * Removes the Tooltip from page to make sure assistive devices don't * recognize it by accident. */ @@ -647,8 +649,8 @@ public class VTooltip extends VOverlay { @Override public void onMouseOut(MouseOutEvent moe) { - Element element = WidgetUtil.getElementUnderMouse(moe - .getNativeEvent()); + Element element = WidgetUtil + .getElementUnderMouse(moe.getNativeEvent()); handleOnMouseOut(element); } @@ -668,12 +670,12 @@ public class VTooltip extends VOverlay { } private boolean hasCommonOwner(Widget owner, Element element) { - ComponentConnector connector = Util.findPaintable( - getApplicationConnection(), element); + ComponentConnector connector = Util + .findPaintable(getApplicationConnection(), element); if (connector != null && connector.getConnection() != null && connector.getConnection().getUIConnector() != null) { - return owner.equals(connector.getConnection().getUIConnector() - .getWidget()); + return owner.equals( + connector.getConnection().getUIConnector().getWidget()); } return false; } @@ -683,7 +685,7 @@ public class VTooltip extends VOverlay { /** * Connects DOM handlers to widget that are needed for tooltip presentation. - * + * * @param widget * Widget which DOM handlers are connected */ @@ -700,7 +702,7 @@ public class VTooltip extends VOverlay { /** * Returns the unique id of the tooltip element. - * + * * @return String containing the unique id of the tooltip, which always has * a value */ @@ -721,7 +723,7 @@ public class VTooltip extends VOverlay { * Returns the time (in ms) the tooltip should be displayed after an event * that will cause it to be closed (e.g. mouse click outside the component, * key down). - * + * * @return The close timeout (in ms) */ public int getCloseTimeout() { @@ -732,7 +734,7 @@ public class VTooltip extends VOverlay { * Sets the time (in ms) the tooltip should be displayed after an event that * will cause it to be closed (e.g. mouse click outside the component, key * down). - * + * * @param closeTimeout * The close timeout (in ms) */ @@ -745,7 +747,7 @@ public class VTooltip extends VOverlay { * be used instead of {@link #getOpenDelay()}. The quick open delay is used * when the tooltip has very recently been shown, is currently hidden but * about to be shown again. - * + * * @return The quick open timeout (in ms) */ public int getQuickOpenTimeout() { @@ -757,7 +759,7 @@ public class VTooltip extends VOverlay { * should be used instead of {@link #getOpenDelay()}. The quick open delay * is used when the tooltip has very recently been shown, is currently * hidden but about to be shown again. - * + * * @param quickOpenTimeout * The quick open timeout (in ms) */ @@ -769,7 +771,7 @@ public class VTooltip extends VOverlay { * Returns the time (in ms) that should elapse before a tooltip will be * shown, in the situation when a tooltip has very recently been shown * (within {@link #getQuickOpenDelay()} ms). - * + * * @return The quick open delay (in ms) */ public int getQuickOpenDelay() { @@ -780,7 +782,7 @@ public class VTooltip extends VOverlay { * Sets the time (in ms) that should elapse before a tooltip will be shown, * in the situation when a tooltip has very recently been shown (within * {@link #getQuickOpenDelay()} ms). - * + * * @param quickOpenDelay * The quick open delay (in ms) */ @@ -793,7 +795,7 @@ public class VTooltip extends VOverlay { * tooltip showing has occurred (e.g. mouse over) before the tooltip is * shown. If a tooltip has recently been shown, then * {@link #getQuickOpenDelay()} is used instead of this. - * + * * @return The open delay (in ms) */ public int getOpenDelay() { @@ -805,7 +807,7 @@ public class VTooltip extends VOverlay { * tooltip showing has occurred (e.g. mouse over) before the tooltip is * shown. If a tooltip has recently been shown, then * {@link #getQuickOpenDelay()} is used instead of this. - * + * * @param openDelay * The open delay (in ms) */ @@ -815,7 +817,7 @@ public class VTooltip extends VOverlay { /** * Sets the maximum width of the tooltip popup. - * + * * @param maxWidth * The maximum width the tooltip popup (in pixels) */ @@ -825,7 +827,7 @@ public class VTooltip extends VOverlay { /** * Returns the maximum width of the tooltip popup. - * + * * @return The maximum width the tooltip popup (in pixels) */ public int getMaxWidth() { diff --git a/client/src/main/java/com/vaadin/client/VUIDLBrowser.java b/client/src/main/java/com/vaadin/client/VUIDLBrowser.java index 08f4c653a5..c0b313dcb7 100644 --- a/client/src/main/java/com/vaadin/client/VUIDLBrowser.java +++ b/client/src/main/java/com/vaadin/client/VUIDLBrowser.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -14,7 +14,7 @@ * the License. */ /** - * + * */ package com.vaadin.client; @@ -45,7 +45,7 @@ import elemental.json.JsonValue; /** * @author Vaadin Ltd - * + * * @deprecated as of 7.1. This class was mainly used by the old debug console * but is retained for now for backwards compatibility. */ @@ -74,8 +74,8 @@ public class VUIDLBrowser extends SimpleTree { SimpleTree stateChanges = new SimpleTree("shared state"); for (String connectorId : stateJson.getKeySet()) { - stateChanges.add(new SharedStateItem(connectorId, stateJson - .getValueMap(connectorId))); + stateChanges.add(new SharedStateItem(connectorId, + stateJson.getValueMap(connectorId))); } add(stateChanges); @@ -239,9 +239,8 @@ public class VUIDLBrowser extends SimpleTree { @Override public void open(boolean recursive) { - if (getWidgetCount() == 1 - && getWidget(0).getElement().getInnerText() - .equals("LOADING")) { + if (getWidgetCount() == 1 && getWidget(0).getElement() + .getInnerText().equals("LOADING")) { dir(); } super.open(recursive); diff --git a/client/src/main/java/com/vaadin/client/ValueMap.java b/client/src/main/java/com/vaadin/client/ValueMap.java index 460b6491d0..5df021e948 100644 --- a/client/src/main/java/com/vaadin/client/ValueMap.java +++ b/client/src/main/java/com/vaadin/client/ValueMap.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -14,7 +14,7 @@ * the License. */ /** - * + * */ package com.vaadin.client; diff --git a/client/src/main/java/com/vaadin/client/WidgetInstantiator.java b/client/src/main/java/com/vaadin/client/WidgetInstantiator.java index 727db967ef..a6de051577 100644 --- a/client/src/main/java/com/vaadin/client/WidgetInstantiator.java +++ b/client/src/main/java/com/vaadin/client/WidgetInstantiator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/WidgetLoader.java b/client/src/main/java/com/vaadin/client/WidgetLoader.java index 4cc1cd1d5f..5b049c9ea6 100644 --- a/client/src/main/java/com/vaadin/client/WidgetLoader.java +++ b/client/src/main/java/com/vaadin/client/WidgetLoader.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -17,7 +17,9 @@ package com.vaadin.client; import com.google.gwt.core.client.RunAsyncCallback; -/** A helper class used by WidgetMap implementation. Used by the generated code. */ +/** + * A helper class used by WidgetMap implementation. Used by the generated code. + */ abstract class WidgetLoader implements RunAsyncCallback { @Override diff --git a/client/src/main/java/com/vaadin/client/WidgetMap.java b/client/src/main/java/com/vaadin/client/WidgetMap.java index ec053eb511..714561e5f7 100644 --- a/client/src/main/java/com/vaadin/client/WidgetMap.java +++ b/client/src/main/java/com/vaadin/client/WidgetMap.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,7 +20,7 @@ import java.util.HashMap; /** * Abstract class mapping between {@link ComponentConnector} instances and their * instances. - * + * * A concrete implementation of this class is generated by WidgetMapGenerator or * one of its subclasses during widgetset compilation. */ @@ -30,7 +30,7 @@ abstract class WidgetMap { /** * Create a new instance of a connector based on its type. - * + * * @param classType * {@link ComponentConnector} class to instantiate * @return new instance of the connector @@ -43,7 +43,7 @@ abstract class WidgetMap { /** * Return the connector class to use for a fully qualified server side * component class name. - * + * * @param fullyqualifiedName * fully qualified name of the server side component class * @return component connector class to use @@ -54,7 +54,7 @@ abstract class WidgetMap { /** * Return the connector classes to load after the initial widgetset load and * start. - * + * * @return component connector class to load after the initial widgetset * loading */ @@ -64,7 +64,7 @@ abstract class WidgetMap { * Make sure the code for a (deferred or lazy) component connector type has * been loaded, triggering the load and waiting for its completion if * necessary. - * + * * @param classType * component connector class */ diff --git a/client/src/main/java/com/vaadin/client/WidgetSet.java b/client/src/main/java/com/vaadin/client/WidgetSet.java index e85eac388f..aa35a83822 100644 --- a/client/src/main/java/com/vaadin/client/WidgetSet.java +++ b/client/src/main/java/com/vaadin/client/WidgetSet.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -31,13 +31,13 @@ public class WidgetSet { /** * Create an uninitialized connector that best matches given UIDL. The * connector must implement {@link ServerConnector}. - * + * * @param tag * connector type tag for the connector to create * @param conf * the application configuration to use when creating the * connector - * + * * @return New uninitialized and unregistered connector that can paint given * UIDL. */ @@ -67,8 +67,8 @@ public class WidgetSet { * let the auto generated code instantiate this type */ try { - ServerConnector connector = (ServerConnector) TypeData.getType( - classType).createInstance(); + ServerConnector connector = (ServerConnector) TypeData + .getType(classType).createInstance(); if (connector instanceof HasJavaScriptConnectorHelper) { ((HasJavaScriptConnectorHelper) connector) .getJavascriptConnectorHelper().setTag(tag); @@ -78,8 +78,7 @@ public class WidgetSet { } catch (NoDataException e) { Profiler.leave("WidgetSet.createConnector"); throw new IllegalStateException( - "There is no information about " - + classType + "There is no information about " + classType + ". Did you remember to compile the right widgetset?", e); } @@ -109,7 +108,7 @@ public class WidgetSet { * Due its nature, GWT does not support dynamic classloading. To bypass this * limitation, widgetset must have function that returns Class by its fully * qualified name. - * + * * @param tag * @param applicationConfiguration * @return @@ -127,10 +126,9 @@ public class WidgetSet { } while (bundleName == null && t != null); if (bundleName != null && !loader.isBundleLoaded(bundleName)) { - getLogger().info( - "Loading bundle " + bundleName - + " to be able to render server side class " - + serverSideClassName); + getLogger().info("Loading bundle " + bundleName + + " to be able to render server side class " + + serverSideClassName); ApplicationConfiguration.startDependencyLoading(); loader.loadBundle(bundleName, new BundleLoadCallback() { @Override diff --git a/client/src/main/java/com/vaadin/client/WidgetUtil.java b/client/src/main/java/com/vaadin/client/WidgetUtil.java index 8161ceff19..d6d36c1cb1 100644 --- a/client/src/main/java/com/vaadin/client/WidgetUtil.java +++ b/client/src/main/java/com/vaadin/client/WidgetUtil.java @@ -54,9 +54,9 @@ public class WidgetUtil { /** * Helper method for debugging purposes. - * + * * Stops execution on firefox browsers on a breakpoint. - * + * */ public static native void browserDebugger() /*-{ @@ -67,7 +67,7 @@ public class WidgetUtil { /** * Redirects the browser to the given url or refreshes the page if url is * null - * + * * @since 7.6 * @param url * The url to redirect to or null to refresh @@ -85,7 +85,7 @@ public class WidgetUtil { * Helper method for a bug fix #14041. For mozilla getKeyCode return 0 for * space bar (because space is considered as char). If return 0 use * getCharCode. - * + * * @param event * @return return key code * @since 7.2.4 @@ -99,12 +99,12 @@ public class WidgetUtil { } /** - * + * * Returns the topmost element of from given coordinates. - * + * * TODO fix crossplat issues clientX vs pageX. See quircksmode. Not critical * for vaadin as we scroll div istead of page. - * + * * @param x * @param y * @return the element at given coordinates @@ -137,7 +137,7 @@ public class WidgetUtil { /** * Converts html entities to text. - * + * * @param html * @return escaped string presentation of given html */ @@ -155,7 +155,7 @@ public class WidgetUtil { /** * Escapes the string so it is safe to write inside an HTML attribute. - * + * * @param attribute * The string to escape * @return An escaped version of attribute. @@ -174,9 +174,9 @@ public class WidgetUtil { /** * Clones given element as in JavaScript. - * + * * Deprecate this if there appears similar method into GWT someday. - * + * * @param element * @param deep * clone child tree also @@ -293,8 +293,8 @@ public class WidgetUtil { setHeight(widget, ""); return paddingBorderGuess; } else if (height.endsWith("px")) { - int pixelHeight = Integer.parseInt(height.substring(0, - height.length() - 2)); + int pixelHeight = Integer + .parseInt(height.substring(0, height.length() - 2)); return setHeightExcludingPaddingAndBorder(widget.getElement(), pixelHeight, paddingBorderGuess, false); } else { @@ -320,8 +320,8 @@ public class WidgetUtil { setWidth(widget, ""); return paddingBorderGuess; } else if (width.endsWith("px")) { - int pixelWidth = Integer.parseInt(width.substring(0, - width.length() - 2)); + int pixelWidth = Integer + .parseInt(width.substring(0, width.length() - 2)); return setWidthExcludingPaddingAndBorder(widget.getElement(), pixelWidth, paddingBorderGuess, false); } else { @@ -427,7 +427,7 @@ public class WidgetUtil { /** * Defers the execution of {@link #runWebkitOverflowAutoFix(Element)} - * + * * @since 7.2.6 * @param elem * with overflow auto @@ -445,9 +445,9 @@ public class WidgetUtil { /** * Run workaround for webkits overflow auto issue. - * + * * See: our bug #2138 and https://bugs.webkit.org/show_bug.cgi?id=21462 - * + * * @param elem * with overflow auto */ @@ -455,12 +455,12 @@ public class WidgetUtil { // Add max version if fix lands sometime to Webkit // Starting from Opera 11.00, also a problem in Opera if (BrowserInfo.get().requiresOverflowAutoFix()) { - final String originalOverflow = elem.getStyle().getProperty( - "overflow"); - final String originalOverflowX = elem.getStyle().getProperty( - "overflowX"); - final String originalOverflowY = elem.getStyle().getProperty( - "overflowY"); + final String originalOverflow = elem.getStyle() + .getProperty("overflow"); + final String originalOverflowX = elem.getStyle() + .getProperty("overflowX"); + final String originalOverflowY = elem.getStyle() + .getProperty("overflowY"); if ("hidden".equals(originalOverflow) || "hidden".equals(originalOverflowX) || "hidden".equals(originalOverflowY)) { @@ -505,7 +505,8 @@ public class WidgetUtil { // updated when collapsing/expanding columns // Also appeared in Safari 5.1 with webkit 534 (#7667) if ((BrowserInfo.get().isChrome() || (BrowserInfo.get() - .isSafari() && BrowserInfo.get().getWebkitVersion() >= 534)) + .isSafari() + && BrowserInfo.get().getWebkitVersion() >= 534)) && (scrollleft > 0 || elem.getScrollLeft() > 0)) { int scrollvalue = scrollleft; @@ -536,12 +537,13 @@ public class WidgetUtil { /** * Gets the border-box width for the given element, i.e. element width + * border + padding. Always rounds up to nearest integer. - * + * * @param element * The element to check * @return The border-box width for the element */ - public static int getRequiredWidth(com.google.gwt.dom.client.Element element) { + public static int getRequiredWidth( + com.google.gwt.dom.client.Element element) { int reqWidth = getRequiredWidthBoundingClientRect(element); if (BrowserInfo.get().isIE() && !BrowserInfo.get().isIE8()) { int csSize = getRequiredWidthComputedStyle(element); @@ -561,7 +563,7 @@ public class WidgetUtil { /** * Gets the border-box width for the given element, i.e. element width + * border + padding. - * + * * @since 7.5.1 * @param element * The element to check @@ -586,7 +588,7 @@ public class WidgetUtil { /** * Gets the border-box height for the given element, i.e. element height + * border + padding. Always rounds up to nearest integer. - * + * * @param element * The element to check * @return The border-box height for the element @@ -612,7 +614,7 @@ public class WidgetUtil { /** * Gets the border-box height for the given element, i.e. element height + * border + padding. - * + * * @since 7.5.1 * @param element * The element to check @@ -642,7 +644,7 @@ public class WidgetUtil { *

    * In case the browser doesn't support bounding rectangles, the returned * value is the offset width. - * + * * @param element * the element of which to calculate the width * @return the width of the element @@ -659,7 +661,7 @@ public class WidgetUtil { *

    * In case the browser doesn't support bounding rectangles, the returned * value is the offset width. - * + * * @param element * the element of which to calculate the width * @return the subpixel-accurate width of the element @@ -721,7 +723,7 @@ public class WidgetUtil { *

    * In case the browser doesn't support bounding rectangles, the returned * value is the offset height. - * + * * @param element * the element of which to calculate the height * @return the height of the element @@ -738,7 +740,7 @@ public class WidgetUtil { *

    * In case the browser doesn't support bounding rectangles, the returned * value is the offset height. - * + * * @param element * the element of which to calculate the height * @return the subpixel-accurate height of the element @@ -767,12 +769,13 @@ public class WidgetUtil { /** * Detects what is currently the overflow style attribute in given element. - * + * * @param pe * the element to detect * @return true if auto or scroll */ - public static boolean mayHaveScrollBars(com.google.gwt.dom.client.Element pe) { + public static boolean mayHaveScrollBars( + com.google.gwt.dom.client.Element pe) { String overflow = getComputedStyle(pe, "overflow"); if (overflow != null) { if (overflow.equals("auto") || overflow.equals("scroll")) { @@ -789,7 +792,7 @@ public class WidgetUtil { * A simple helper method to detect "computed style" (aka style sheets + * element styles). Values returned differ a lot depending on browsers. * Always be very careful when using this. - * + * * @param el * the element from which the style property is detected * @param p @@ -820,7 +823,7 @@ public class WidgetUtil { /** * Will (attempt) to focus the given DOM Element. - * + * * @param el * the element to focus */ @@ -843,7 +846,7 @@ public class WidgetUtil { * {@code C} or null, depending on whether the class parameter matches. This * may also be the case with other Composite-like classes that hijack the * event handling of their child widget(s). - * + * * @param element * the element where to start seeking of Widget * @param class1 @@ -880,7 +883,7 @@ public class WidgetUtil { /** * Force webkit to redraw an element - * + * * @param element * The element that should be redrawn */ @@ -898,7 +901,7 @@ public class WidgetUtil { * Performs a hack to trigger a re-layout in the IE8. This is usually * necessary in cases where IE8 "forgets" to update child elements when they * resize. - * + * * @param e * The element to perform the hack on */ @@ -912,7 +915,7 @@ public class WidgetUtil { * Performs a hack to trigger a re-layout in the IE browser. This is usually * necessary in cases where IE "forgets" to update child elements when they * resize. - * + * * @since 7.3 * @param e * The element to perform the hack on @@ -926,9 +929,9 @@ public class WidgetUtil { /** * Detaches and re-attaches the element from its parent. The element is * reattached at the same position in the DOM as it was before. - * + * * Does nothing if the element is not attached to the DOM. - * + * * @param element * The element to detach and re-attach */ @@ -963,7 +966,7 @@ public class WidgetUtil { /** * Returns the index of the childElement within its parent. - * + * * @param subElement * @return */ @@ -981,7 +984,7 @@ public class WidgetUtil { * Temporarily sets the {@code styleProperty} to {@code tempValue} and then * resets it to its current value. Used mainly to work around rendering * issues in IE (and possibly in other browsers) - * + * * @param element * The target element * @param styleProperty @@ -1007,7 +1010,7 @@ public class WidgetUtil { * A helper method to return the client position from an event. Returns * position from either first changed touch (if touch event) or from the * event itself. - * + * * @param event * @return */ @@ -1023,7 +1026,7 @@ public class WidgetUtil { * Find the element corresponding to the coordinates in the passed mouse * event. Please note that this is not always the same as the target of the * event e.g. if event capture is used. - * + * * @param event * the mouse event to get coordinates from * @return the element at the coordinates of the event @@ -1039,7 +1042,7 @@ public class WidgetUtil { * A helper method to return the client position from an event. Returns * position from either first changed touch (if touch event) or from the * event itself. - * + * * @param event * @return */ @@ -1052,7 +1055,7 @@ public class WidgetUtil { } /** - * + * * @see #getTouchOrMouseClientY(Event) * @param currentGwtEvent * @return @@ -1063,7 +1066,7 @@ public class WidgetUtil { /** * @see #getTouchOrMouseClientX(Event) - * + * * @param event * @return */ @@ -1087,10 +1090,9 @@ public class WidgetUtil { touch.getClientX(), touch.getClientY(), false, false, false, false, NativeEvent.BUTTON_LEFT); final NativeEvent createMouseDownEvent = Document.get() - .createMouseDownEvent(0, touch.getScreenX(), - touch.getScreenY(), touch.getClientX(), - touch.getClientY(), false, false, false, false, - NativeEvent.BUTTON_LEFT); + .createMouseDownEvent(0, touch.getScreenX(), touch.getScreenY(), + touch.getClientX(), touch.getClientY(), false, false, + false, false, NativeEvent.BUTTON_LEFT); final NativeEvent createMouseClickEvent = Document.get() .createClickEvent(0, touch.getScreenX(), touch.getScreenY(), touch.getClientX(), touch.getClientY(), false, false, @@ -1132,7 +1134,7 @@ public class WidgetUtil { /** * Gets the currently focused element. - * + * * @return The active element or null if no active element could be found. */ public native static Element getFocusedElement() @@ -1146,9 +1148,9 @@ public class WidgetUtil { /** * Gets currently focused element and checks if it's editable - * + * * @since 7.4 - * + * * @return true if focused element is editable */ public static boolean isFocusedElementEditable() { @@ -1170,7 +1172,7 @@ public class WidgetUtil { * this method checks that this widget nor any of its parents is hidden. Can * be e.g used to check whether component should react to some events or * not. - * + * * @param widget * @return true if attached and displayed */ @@ -1203,7 +1205,7 @@ public class WidgetUtil { /** * Scrolls an element into view vertically only. Modified version of * Element.scrollIntoView. - * + * * @param elem * The element to scroll into view */ @@ -1238,7 +1240,7 @@ public class WidgetUtil { /** * Checks if the given event is either a touch event or caused by the left * mouse button - * + * * @param event * @return true if the event is a touch event or caused by the left mouse * button, false otherwise @@ -1251,7 +1253,7 @@ public class WidgetUtil { /** * Resolve a relative URL to an absolute URL based on the current document's * location. - * + * * @param url * a string with the relative URL to resolve * @return the corresponding absolute URL as a string @@ -1263,8 +1265,8 @@ public class WidgetUtil { divElement.getStyle().setDisplay(Display.NONE); RootPanel.getBodyElement().appendChild(divElement); - divElement.setInnerHTML(""); + divElement.setInnerHTML( + ""); AnchorElement a = divElement.getChild(0).cast(); String href = a.getHref(); @@ -1280,12 +1282,12 @@ public class WidgetUtil { /** * Sets the selection range of an input element. - * + * * We need this JSNI function to set selection range so that we can use the * optional direction attribute to set the anchor to the end and the focus * to the start. This makes Firefox work the same way as other browsers * (#13477) - * + * * @param elem * the html input element. * @param pos @@ -1296,7 +1298,7 @@ public class WidgetUtil { * a string indicating the direction in which the selection was * performed. This may be "forward" or "backward", or "none" if * the direction is unknown or irrelevant. - * + * * @since 7.3 */ public native static void setSelectionRange(Element elem, int pos, @@ -1311,7 +1313,7 @@ public class WidgetUtil { /** * JavaScript hack to prevent text selection in various browsers. - * + * * @since 7.6 * @param e * element for enabling or disabling text selection @@ -1334,7 +1336,7 @@ public class WidgetUtil { /** * JavaScript hack to clear text selection in various browsers. - * + * * @since 7.6 */ public native static void clearTextSelection() @@ -1356,16 +1358,17 @@ public class WidgetUtil { /** * Compares two double values with the error margin of * {@link #PIXEL_EPSILON} (i.e. {@value #PIXEL_EPSILON}) - * + * * @param num1 * the first value for which to compare equality * @param num2 * the second value for which to compare equality * @since 7.4 - * + * * @return true if the values are considered equals; false otherwise */ - public static boolean pixelValuesEqual(final double num1, final double num2) { + public static boolean pixelValuesEqual(final double num1, + final double num2) { return Math.abs(num1 - num2) <= PIXEL_EPSILON; } @@ -1413,7 +1416,7 @@ public class WidgetUtil { * Wrap a css size value and its unit and translate back and forth to the * string representation.
    * Eg. 50%, 123px, ... - * + * * @since 7.2.6 * @author Vaadin Ltd */ @@ -1432,7 +1435,7 @@ public class WidgetUtil { /** * Gets the unit value by its type. - * + * * @param type * the type of the unit as found in the style. * @return the unit value. @@ -1449,7 +1452,7 @@ public class WidgetUtil { /** * Parse the size from string format to {@link CssSize}. - * + * * @param s * the size as string. * @return a {@link CssSize} object. @@ -1480,16 +1483,16 @@ public class WidgetUtil { unit = unitByType(symbol); } } else { - throw new IllegalArgumentException("Invalid size argument: \"" - + s + "\" (should match " + sizePattern.getSource() - + ")"); + throw new IllegalArgumentException( + "Invalid size argument: \"" + s + "\" (should match " + + sizePattern.getSource() + ")"); } return new CssSize(size, unit); } /** * Creates a {@link CssSize} using a value and its measurement unit. - * + * * @param value * the value. * @param unit @@ -1517,7 +1520,7 @@ public class WidgetUtil { /** * Gets the value for this css size. - * + * * @return the value. */ public float getValue() { @@ -1526,7 +1529,7 @@ public class WidgetUtil { /** * Gets the measurement unit for this css size. - * + * * @return the unit. */ public Unit getUnit() { @@ -1550,7 +1553,7 @@ public class WidgetUtil { /** * Check whether the two sizes are equals. - * + * * @param cssSize1 * the first size to compare. * @param cssSize2 @@ -1558,8 +1561,8 @@ public class WidgetUtil { * @return true if the two sizes are equals, otherwise false. */ public static boolean equals(String cssSize1, String cssSize2) { - return CssSize.fromString(cssSize1).equals( - CssSize.fromString(cssSize2)); + return CssSize.fromString(cssSize1) + .equals(CssSize.fromString(cssSize2)); } } @@ -1573,7 +1576,7 @@ public class WidgetUtil { *

    * The value is determined using computed style when available and * calculated otherwise. - * + * * @since 7.5.0 * @param element * the element to measure @@ -1588,14 +1591,15 @@ public class WidgetUtil { *

    * The value is determined using computed style when available and * calculated otherwise. - * + * * @since 7.5.0 * @param element * the element to measure * @return the bottom border thickness */ public static double getBorderBottomThickness(Element element) { - return getBorderThickness(element, new String[] { "borderBottomWidth" }); + return getBorderThickness(element, + new String[] { "borderBottomWidth" }); } /** @@ -1604,15 +1608,15 @@ public class WidgetUtil { *

    * The value is determined using computed style when available and * calculated otherwise. - * + * * @since 7.5.0 * @param element * the element to measure * @return the top and bottom border thickness */ public static double getBorderTopAndBottomThickness(Element element) { - return getBorderThickness(element, new String[] { "borderTopWidth", - "borderBottomWidth" }); + return getBorderThickness(element, + new String[] { "borderTopWidth", "borderBottomWidth" }); } /** @@ -1620,7 +1624,7 @@ public class WidgetUtil { *

    * The value is determined using computed style when available and * calculated otherwise. - * + * * @since 7.5.0 * @param element * the element to measure @@ -1635,7 +1639,7 @@ public class WidgetUtil { *

    * The value is determined using computed style when available and * calculated otherwise. - * + * * @since 7.5.0 * @param element * the element to measure @@ -1650,15 +1654,15 @@ public class WidgetUtil { *

    * The value is determined using computed style when available and * calculated otherwise. - * + * * @since 7.5.0 * @param element * the element to measure * @return the top border thickness */ public static double getBorderLeftAndRightThickness(Element element) { - return getBorderThickness(element, new String[] { "borderLeftWidth", - "borderRightWidth" }); + return getBorderThickness(element, + new String[] { "borderLeftWidth", "borderRightWidth" }); } private static native double getBorderThickness( @@ -1684,20 +1688,20 @@ public class WidgetUtil { } var heightWithoutBorder = cloneElement.offsetHeight; parentElement.removeChild(cloneElement); - + return heightWithBorder - heightWithoutBorder; } }-*/; /** * Rounds the given size up to a value which the browser will accept. - * + * * Safari/WebKit uses 1/64th of a pixel to enable using integer math * (http://trac.webkit.org/wiki/LayoutUnit). - * + * * Firefox uses 1/60th of a pixel because it is divisible by three * (https://bugzilla.mozilla.org/show_bug.cgi?id=1070940) - * + * * @since 7.5.1 * @param size * the value to round @@ -1709,15 +1713,15 @@ public class WidgetUtil { /** * Rounds the given size down to a value which the browser will accept. - * + * * Safari/WebKit uses 1/64th of a pixel to enable using integer math * (http://trac.webkit.org/wiki/LayoutUnit). - * + * * Firefox uses 1/60th of a pixel because it is divisible by three * (https://bugzilla.mozilla.org/show_bug.cgi?id=1070940) - * + * * IE9+ uses 1/100th of a pixel - * + * * @since 7.5.1 * @param size * the value to round @@ -1750,7 +1754,7 @@ public class WidgetUtil { /** * Returns the factor used by browsers to round subpixel values - * + * * @since 7.5.1 * @return the factor N used by the browser when storing subpixels as X+Y/N */ diff --git a/client/src/main/java/com/vaadin/client/annotations/OnStateChange.java b/client/src/main/java/com/vaadin/client/annotations/OnStateChange.java index d15e32f493..c3d0424373 100644 --- a/client/src/main/java/com/vaadin/client/annotations/OnStateChange.java +++ b/client/src/main/java/com/vaadin/client/annotations/OnStateChange.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -33,7 +33,7 @@ import com.vaadin.client.communication.StateChangeEvent; *

    * If there is no state variable with the provided name, the widgetset * compilation will fail. - * + * * @since 7.2 * @author Vaadin Ltd */ @@ -43,7 +43,7 @@ import com.vaadin.client.communication.StateChangeEvent; public @interface OnStateChange { /** * Defines a list of property names to listen for. - * + * * @return an array of property names, should contain at least one item */ public String[] value(); diff --git a/client/src/main/java/com/vaadin/client/communication/AbstractServerConnectorEvent.java b/client/src/main/java/com/vaadin/client/communication/AbstractServerConnectorEvent.java index 9f99a451e1..3d8dc58e96 100644 --- a/client/src/main/java/com/vaadin/client/communication/AbstractServerConnectorEvent.java +++ b/client/src/main/java/com/vaadin/client/communication/AbstractServerConnectorEvent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -36,7 +36,7 @@ public abstract class AbstractServerConnectorEvent /** * Sends this event to the given handler. - * + * * @param handler * The handler to dispatch. */ diff --git a/client/src/main/java/com/vaadin/client/communication/AtmospherePushConnection.java b/client/src/main/java/com/vaadin/client/communication/AtmospherePushConnection.java index f439d27107..34e1c5ff30 100644 --- a/client/src/main/java/com/vaadin/client/communication/AtmospherePushConnection.java +++ b/client/src/main/java/com/vaadin/client/communication/AtmospherePushConnection.java @@ -42,7 +42,7 @@ import elemental.json.JsonObject; /** * The default {@link PushConnection} implementation that uses Atmosphere for * handling the communication channel. - * + * * @author Vaadin Ltd * @since 7.1 */ @@ -140,7 +140,7 @@ public class AtmospherePushConnection implements PushConnection { /* * (non-Javadoc) - * + * * @see * com.vaadin.client.communication.PushConnection#init(ApplicationConnection * , Map, CommunicationErrorHandler) @@ -209,8 +209,8 @@ public class AtmospherePushConnection implements PushConnection { String csrfToken = connection.getMessageHandler().getCsrfToken(); if (!csrfToken.equals(ApplicationConstants.CSRF_TOKEN_DEFAULT_VALUE)) { - extraParams += "&" + ApplicationConstants.CSRF_TOKEN_PARAMETER - + "=" + csrfToken; + extraParams += "&" + ApplicationConstants.CSRF_TOKEN_PARAMETER + "=" + + csrfToken; } // uri is needed to identify the right connection when closing @@ -266,9 +266,8 @@ public class AtmospherePushConnection implements PushConnection { "This server to client push connection should not be used to send client to server messages"); } if (state == State.CONNECTED) { - getLogger().info( - "Sending push (" + transport + ") message to server: " - + message.toJson()); + getLogger().info("Sending push (" + transport + + ") message to server: " + message.toJson()); if (transport.equals("websocket")) { FragmentedMessage fragmented = new FragmentedMessage( @@ -295,9 +294,8 @@ public class AtmospherePushConnection implements PushConnection { } protected void onReopen(AtmosphereResponse response) { - getLogger().info( - "Push connection re-established using " - + response.getTransport()); + getLogger().info("Push connection re-established using " + + response.getTransport()); onConnect(response); } @@ -310,9 +308,9 @@ public class AtmospherePushConnection implements PushConnection { /** * Called whenever a server push connection is established (or * re-established). - * + * * @param response - * + * * @since 7.2 */ protected void onConnect(AtmosphereResponse response) { @@ -340,7 +338,7 @@ public class AtmospherePushConnection implements PushConnection { /* * (non-Javadoc) - * + * * @see com.vaadin.client.communication.PushConenction#disconnect() */ @Override @@ -362,7 +360,8 @@ public class AtmospherePushConnection implements PushConnection { break; case DISCONNECT_PENDING: case DISCONNECTED: - throw new IllegalStateException("Can not disconnect more than once"); + throw new IllegalStateException( + "Can not disconnect more than once"); } } @@ -374,9 +373,8 @@ public class AtmospherePushConnection implements PushConnection { getConnectionStateHandler().pushInvalidContent(this, message); return; } else { - getLogger().info( - "Received push (" + getTransportType() + ") message: " - + message); + getLogger().info("Received push (" + getTransportType() + + ") message: " + message); connection.getMessageHandler().handleMessage(json); } } @@ -386,16 +384,15 @@ public class AtmospherePushConnection implements PushConnection { * tried */ protected void onTransportFailure() { - getLogger().warning( - "Push connection using primary method (" - + getConfig().getTransport() + ") failed. Trying with " - + getConfig().getFallbackTransport()); + getLogger().warning("Push connection using primary method (" + + getConfig().getTransport() + ") failed. Trying with " + + getConfig().getFallbackTransport()); } /** * Called if the push connection fails. Atmosphere will automatically retry * the connection until successful. - * + * */ protected void onError(AtmosphereResponse response) { state = State.DISCONNECTED; diff --git a/client/src/main/java/com/vaadin/client/communication/ConnectionStateHandler.java b/client/src/main/java/com/vaadin/client/communication/ConnectionStateHandler.java index cc33dd0086..13c1e47ae7 100644 --- a/client/src/main/java/com/vaadin/client/communication/ConnectionStateHandler.java +++ b/client/src/main/java/com/vaadin/client/communication/ConnectionStateHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,11 +25,11 @@ import elemental.json.JsonObject; /** * Interface for handling problems and other events which occur during * communication with the server. - * + * * The handler is responsible for handling any problem in XHR, heartbeat and * push connections in a way it sees fit. The default implementation is * {@link DefaultConnectionStateHandler}. - * + * * @since 7.6 * @author Vaadin Ltd */ @@ -46,7 +46,7 @@ public interface ConnectionStateHandler { /** * Called when an exception occurs during a {@link Heartbeat} request - * + * * @param request * The heartbeat request * @param exception @@ -56,7 +56,7 @@ public interface ConnectionStateHandler { /** * Called when a heartbeat request returns a status code other than OK (200) - * + * * @param request * The heartbeat request * @param response @@ -74,7 +74,7 @@ public interface ConnectionStateHandler { * result in the push connection trying a fallback connection method, trying * to reconnect to the server or might just be an indication that the * connection was intentionally closed ("unsubscribe"), - * + * * @param pushConnection * The push connection which was closed * @param response @@ -86,10 +86,10 @@ public interface ConnectionStateHandler { /** * Called when a client side timeout occurs before a push connection to the * server completes. - * + * * The client side timeout causes a disconnection of the push connection and * no reconnect will be attempted after this method is called, - * + * * @param pushConnection * The push connection which timed out * @param response @@ -100,13 +100,13 @@ public interface ConnectionStateHandler { /** * Called when a fatal error fatal error occurs in the push connection. - * + * * The push connection will not try to recover from this situation itself * and typically the problem handler should not try to do automatic recovery * either. The cause can be e.g. maximum number of reconnection attempts * have been reached, neither the selected transport nor the fallback * transport can be used or similar. - * + * * @param pushConnection * The push connection where the error occurred * @param response @@ -117,7 +117,7 @@ public interface ConnectionStateHandler { /** * Called when the push connection has lost the connection to the server and * will proceed to try to re-establish the connection - * + * * @param pushConnection * The push connection which will be reconnected */ @@ -125,7 +125,7 @@ public interface ConnectionStateHandler { /** * Called when the push connection to the server has been established. - * + * * @param pushConnection * The push connection which was established */ @@ -133,7 +133,7 @@ public interface ConnectionStateHandler { /** * Called when the required push script could not be loaded - * + * * @param resourceUrl * The URL which was used for loading the script */ @@ -142,7 +142,7 @@ public interface ConnectionStateHandler { /** * Called when an exception occurs during an XmlHttpRequest request to the * server. - * + * * @param xhrConnectionError * An event containing what was being sent to the server and what * exception occurred @@ -152,7 +152,7 @@ public interface ConnectionStateHandler { /** * Called when invalid content (not JSON) was returned from the server as * the result of an XmlHttpRequest request - * + * * @param communicationProblemEvent * An event containing what was being sent to the server and what * was returned @@ -162,7 +162,7 @@ public interface ConnectionStateHandler { /** * Called when invalid status code (not 200) was returned by the server as * the result of an XmlHttpRequest. - * + * * @param communicationProblemEvent * An event containing what was being sent to the server and what * was returned @@ -177,7 +177,7 @@ public interface ConnectionStateHandler { /** * Called when a message is to be sent to the server through the push * channel but the push channel is not connected - * + * * @param payload * The payload to send to the server */ @@ -186,7 +186,7 @@ public interface ConnectionStateHandler { /** * Called when invalid content (not JSON) was pushed from the server through * the push connection - * + * * @param communicationProblemEvent * An event containing what was being sent to the server and what * was returned diff --git a/client/src/main/java/com/vaadin/client/communication/Date_Serializer.java b/client/src/main/java/com/vaadin/client/communication/Date_Serializer.java index 14eb6e4e3d..cec1799188 100644 --- a/client/src/main/java/com/vaadin/client/communication/Date_Serializer.java +++ b/client/src/main/java/com/vaadin/client/communication/Date_Serializer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,7 +25,7 @@ import elemental.json.JsonValue; /** * Client side serializer/deserializer for java.util.Date - * + * * @since 7.2 * @author Vaadin Ltd */ diff --git a/client/src/main/java/com/vaadin/client/communication/DefaultConnectionStateHandler.java b/client/src/main/java/com/vaadin/client/communication/DefaultConnectionStateHandler.java index f32bd5c5ea..9a8348f29b 100644 --- a/client/src/main/java/com/vaadin/client/communication/DefaultConnectionStateHandler.java +++ b/client/src/main/java/com/vaadin/client/communication/DefaultConnectionStateHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -42,7 +42,7 @@ import elemental.json.JsonObject; *

    * Handles permanent errors by showing a critical system notification to the * user - * + * * @since 7.6 * @author Vaadin Ltd */ @@ -78,7 +78,7 @@ public class DefaultConnectionStateHandler implements ConnectionStateHandler { /** * Checks if this type is of higher priority than the given type - * + * * @param type * the type to compare to * @return true if this type has higher priority than the given type, @@ -116,7 +116,7 @@ public class DefaultConnectionStateHandler implements ConnectionStateHandler { /** * Checks if we are currently trying to reconnect - * + * * @return true if we have noted a problem and are trying to re-establish * server connection, false otherwise */ @@ -130,7 +130,7 @@ public class DefaultConnectionStateHandler implements ConnectionStateHandler { /** * Returns the connection this handler is connected to - * + * * @return the connection for this handler */ protected ApplicationConnection getConnection() { @@ -185,7 +185,7 @@ public class DefaultConnectionStateHandler implements ConnectionStateHandler { * Called whenever an error occurs in communication which should be handled * by showing the reconnect dialog and retrying communication until * successful again - * + * * @param type * The type of failure detected * @param payload @@ -229,8 +229,8 @@ public class DefaultConnectionStateHandler implements ConnectionStateHandler { } reconnectAttempt++; - getLogger().info( - "Reconnect attempt " + reconnectAttempt + " for " + type); + getLogger() + .info("Reconnect attempt " + reconnectAttempt + " for " + type); if (reconnectAttempt >= getConfiguration().reconnectAttempts) { // Max attempts reached, stop trying @@ -243,10 +243,10 @@ public class DefaultConnectionStateHandler implements ConnectionStateHandler { /** * Called after a problem occurred. - * + * * This method is responsible for re-sending the payload to the server (if * not null) or re-send a heartbeat request at some point - * + * * @param payload * the payload that did not reach the server, null if the problem * was detected by a heartbeat @@ -274,7 +274,7 @@ public class DefaultConnectionStateHandler implements ConnectionStateHandler { /** * Re-sends the payload to the server (if not null) or re-sends a heartbeat * request immediately - * + * * @param payload * the payload that did not reach the server, null if the problem * was detected by a heartbeat @@ -283,9 +283,8 @@ public class DefaultConnectionStateHandler implements ConnectionStateHandler { if (!connection.isApplicationRunning()) { // This should not happen as nobody should call this if the // application has been stopped - getLogger() - .warning( - "Trying to reconnect after application has been stopped. Giving up"); + getLogger().warning( + "Trying to reconnect after application has been stopped. Giving up"); return; } if (payload != null) { @@ -309,7 +308,7 @@ public class DefaultConnectionStateHandler implements ConnectionStateHandler { /** * Called when we should give up trying to reconnect and let the user decide * how to continue - * + * */ protected void giveUp() { reconnectionCause = null; @@ -340,7 +339,7 @@ public class DefaultConnectionStateHandler implements ConnectionStateHandler { /** * Checks if the reconnect dialog is visible to the user - * + * * @return true if the user can see the dialog, false otherwise */ protected boolean isDialogVisible() { @@ -372,7 +371,7 @@ public class DefaultConnectionStateHandler implements ConnectionStateHandler { /** * Gets the text to show in the reconnect dialog after giving up (reconnect * limit reached) - * + * * @param reconnectAttempt * The number of the current reconnection attempt * @return The text to show in the reconnect dialog after giving up @@ -384,14 +383,14 @@ public class DefaultConnectionStateHandler implements ConnectionStateHandler { /** * Gets the text to show in the reconnect dialog - * + * * @param reconnectAttempt * The number of the current reconnection attempt * @return The text to show in the reconnect dialog */ protected String getDialogText(int reconnectAttempt) { - return getConfiguration().dialogText.replace("{0}", reconnectAttempt - + ""); + return getConfiguration().dialogText.replace("{0}", + reconnectAttempt + ""); } @Override @@ -401,7 +400,8 @@ public class DefaultConnectionStateHandler implements ConnectionStateHandler { } private ReconnectDialogConfigurationState getConfiguration() { - return connection.getUIConnector().getState().reconnectDialogConfiguration; + return connection.getUIConnector() + .getState().reconnectDialogConfiguration; } @Override @@ -416,9 +416,10 @@ public class DefaultConnectionStateHandler implements ConnectionStateHandler { * has expired.) If the response contains a magic substring, do a * synchronous refresh. See #8241. */ - MatchResult refreshToken = RegExp.compile( - ApplicationConnection.UIDL_REFRESH_TOKEN - + "(:\\s*(.*?))?(\\s|$)").exec(responseText); + MatchResult refreshToken = RegExp + .compile(ApplicationConnection.UIDL_REFRESH_TOKEN + + "(:\\s*(.*?))?(\\s|$)") + .exec(responseText); if (refreshToken != null) { WidgetUtil.redirect(refreshToken.getGroup(2)); } else { @@ -430,7 +431,8 @@ public class DefaultConnectionStateHandler implements ConnectionStateHandler { } @Override - public void pushInvalidContent(PushConnection pushConnection, String message) { + public void pushInvalidContent(PushConnection pushConnection, + String message) { debug("pushInvalidContent"); if (pushConnection.isBidirectional()) { // We can't be sure that what was pushed was actually a response but @@ -441,8 +443,8 @@ public class DefaultConnectionStateHandler implements ConnectionStateHandler { // Do nothing special for now. Should likely do the same as // xhrInvalidContent - handleUnrecoverableCommunicationError("Invalid JSON from server: " - + message, null); + handleUnrecoverableCommunicationError( + "Invalid JSON from server: " + message, null); } @@ -538,8 +540,8 @@ public class DefaultConnectionStateHandler implements ConnectionStateHandler { @Override public void pushScriptLoadError(String resourceUrl) { - connection.handleCommunicationError(resourceUrl - + " could not be loaded. Push will not work.", 0); + connection.handleCommunicationError( + resourceUrl + " could not be loaded. Push will not work.", 0); } @Override @@ -550,7 +552,8 @@ public class DefaultConnectionStateHandler implements ConnectionStateHandler { @Override public void pushReconnectPending(PushConnection pushConnection) { - debug("pushReconnectPending(" + pushConnection.getTransportType() + ")"); + debug("pushReconnectPending(" + pushConnection.getTransportType() + + ")"); getLogger().info("Reopening push connection"); if (pushConnection.isBidirectional()) { // Lost connection for a connection which will tell us when the @@ -579,10 +582,9 @@ public class DefaultConnectionStateHandler implements ConnectionStateHandler { debug("pushClientTimeout()"); // TODO Reconnect, allowing client timeout to be set // https://dev.vaadin.com/ticket/18429 - connection - .handleCommunicationError( - "Client unexpectedly disconnected. Ensure client timeout is disabled.", - -1); + connection.handleCommunicationError( + "Client unexpectedly disconnected. Ensure client timeout is disabled.", + -1); } @Override diff --git a/client/src/main/java/com/vaadin/client/communication/DefaultReconnectDialog.java b/client/src/main/java/com/vaadin/client/communication/DefaultReconnectDialog.java index 05b4e109ff..68a6814aef 100644 --- a/client/src/main/java/com/vaadin/client/communication/DefaultReconnectDialog.java +++ b/client/src/main/java/com/vaadin/client/communication/DefaultReconnectDialog.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -33,11 +33,12 @@ import com.vaadin.client.ui.VOverlay; /** * The default implementation of the reconnect dialog - * + * * @since 7.6 * @author Vaadin Ltd */ -public class DefaultReconnectDialog extends VOverlay implements ReconnectDialog { +public class DefaultReconnectDialog extends VOverlay + implements ReconnectDialog { private static final String STYLE_RECONNECTING = "active"; private static final String STYLE_BODY_RECONNECTING = "v-reconnecting"; diff --git a/client/src/main/java/com/vaadin/client/communication/DiffJSONSerializer.java b/client/src/main/java/com/vaadin/client/communication/DiffJSONSerializer.java index d433a8964c..64e296ab94 100644 --- a/client/src/main/java/com/vaadin/client/communication/DiffJSONSerializer.java +++ b/client/src/main/java/com/vaadin/client/communication/DiffJSONSerializer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -22,7 +22,7 @@ import elemental.json.JsonValue; public interface DiffJSONSerializer extends JSONSerializer { /** * Update the target object in place based on the passed JSON data. - * + * * @param target * @param jsonValue * @param connection diff --git a/client/src/main/java/com/vaadin/client/communication/HasJavaScriptConnectorHelper.java b/client/src/main/java/com/vaadin/client/communication/HasJavaScriptConnectorHelper.java index deb5900b89..b7b21014d0 100644 --- a/client/src/main/java/com/vaadin/client/communication/HasJavaScriptConnectorHelper.java +++ b/client/src/main/java/com/vaadin/client/communication/HasJavaScriptConnectorHelper.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/communication/Heartbeat.java b/client/src/main/java/com/vaadin/client/communication/Heartbeat.java index f38fbca5c8..3ec39804bb 100644 --- a/client/src/main/java/com/vaadin/client/communication/Heartbeat.java +++ b/client/src/main/java/com/vaadin/client/communication/Heartbeat.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -31,7 +31,7 @@ import com.vaadin.shared.util.SharedUtil; /** * Handles sending of heartbeats to the server and reacting to the response - * + * * @since 7.2 * @author Vaadin Ltd */ @@ -54,7 +54,7 @@ public class Heartbeat { /** * Initializes the heartbeat for the given application connection - * + * * @param connection * the connection */ @@ -63,9 +63,10 @@ public class Heartbeat { setInterval(connection.getConfiguration().getHeartbeatInterval()); - uri = SharedUtil.addGetParameters(connection - .translateVaadinUri(ApplicationConstants.APP_PROTOCOL_PREFIX - + ApplicationConstants.HEARTBEAT_PATH + '/'), + uri = SharedUtil.addGetParameters( + connection.translateVaadinUri( + ApplicationConstants.APP_PROTOCOL_PREFIX + + ApplicationConstants.HEARTBEAT_PATH + '/'), UIConstants.UI_ID_PARAMETER + "=" + connection.getConfiguration().getUIId()); @@ -111,8 +112,8 @@ public class Heartbeat { public void onError(Request request, Throwable exception) { // Handler should stop the application if heartbeat should no // longer be sent - connection.getConnectionStateHandler().heartbeatException( - request, exception); + connection.getConnectionStateHandler() + .heartbeatException(request, exception); schedule(); } }; @@ -160,7 +161,7 @@ public class Heartbeat { /** * Changes the heartbeatInterval in runtime and applies it. - * + * * @param heartbeatInterval * new interval in seconds. */ diff --git a/client/src/main/java/com/vaadin/client/communication/JSONSerializer.java b/client/src/main/java/com/vaadin/client/communication/JSONSerializer.java index 59e0329ae1..922f2f90fe 100644 --- a/client/src/main/java/com/vaadin/client/communication/JSONSerializer.java +++ b/client/src/main/java/com/vaadin/client/communication/JSONSerializer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -34,7 +34,7 @@ import elemental.json.JsonValue; *

    * This is the client side interface, see * com.vaadin.server.communication.JSONSerializer for the server side interface. - * + * * @since 7.0 */ public interface JSONSerializer { @@ -43,14 +43,14 @@ public interface JSONSerializer { * Creates and deserializes an object received from the server. Must be * compatible with {@link #serialize(Object, ApplicationConnection)} and * also with the server side JsonCodec.encode method. - * + * * @param type * the type to deserialize * @param jsonValue * JSON map from property name to property value * @param connection * the application connection providing the context - * + * * @return A deserialized object */ T deserialize(Type type, JsonValue jsonValue, @@ -60,7 +60,7 @@ public interface JSONSerializer { * Serialize the given object into JSON. Must be compatible with * {@link #deserialize(Type, JsonValue, ApplicationConnection)} and also * with the server side JsonCodec.decodeCustomType method. - * + * * @param value * The object to serialize * @param connection diff --git a/client/src/main/java/com/vaadin/client/communication/JavaScriptMethodInvocation.java b/client/src/main/java/com/vaadin/client/communication/JavaScriptMethodInvocation.java index 43366902e2..af1d43bce4 100644 --- a/client/src/main/java/com/vaadin/client/communication/JavaScriptMethodInvocation.java +++ b/client/src/main/java/com/vaadin/client/communication/JavaScriptMethodInvocation.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,7 +21,7 @@ import com.vaadin.shared.communication.MethodInvocation; /** * A {@link MethodInvocation} that originates from JavaScript. This means that * there might not be any type information available on the client. - * + * * @author Vaadin Ltd * @since 7.0.0 */ diff --git a/client/src/main/java/com/vaadin/client/communication/JsonDecoder.java b/client/src/main/java/com/vaadin/client/communication/JsonDecoder.java index 0ce89c873e..f18d7dc2f8 100644 --- a/client/src/main/java/com/vaadin/client/communication/JsonDecoder.java +++ b/client/src/main/java/com/vaadin/client/communication/JsonDecoder.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -119,8 +119,8 @@ public class JsonDecoder { } else if (Character.class.getName().equals(baseTypeName)) { return Character.valueOf(jsonValue.asString().charAt(0)); } else if (Connector.class.getName().equals(baseTypeName)) { - return ConnectorMap.get(connection).getConnector( - jsonValue.asString()); + return ConnectorMap.get(connection) + .getConnector(jsonValue.asString()); } else { return decodeObject(type, jsonValue, target, connection); } @@ -169,12 +169,15 @@ public class JsonDecoder { propertyReference = null; } - Profiler.leave("JsonDecoder.decodeObject meta data processing"); - JsonValue encodedPropertyValue = jsonObject.get(property - .getName()); + Profiler.leave( + "JsonDecoder.decodeObject meta data processing"); + JsonValue encodedPropertyValue = jsonObject + .get(property.getName()); Object decodedValue = decodeValue(propertyType, - encodedPropertyValue, propertyReference, connection); - Profiler.enter("JsonDecoder.decodeObject meta data processing"); + encodedPropertyValue, propertyReference, + connection); + Profiler.enter( + "JsonDecoder.decodeObject meta data processing"); property.setValue(target, decodedValue); } Profiler.leave("JsonDecoder.decodeObject meta data processing"); @@ -183,8 +186,8 @@ public class JsonDecoder { } catch (NoDataException e) { Profiler.leave("JsonDecoder.decodeObject meta data processing"); Profiler.leave("JsonDecoder.decodeObject"); - throw new RuntimeException("Can not deserialize " - + type.getSignature(), e); + throw new RuntimeException( + "Can not deserialize " + type.getSignature(), e); } } } @@ -210,7 +213,8 @@ public class JsonDecoder { if (keyType.getBaseTypeName().equals(String.class.getName())) { assert jsonMap.getType() == JsonType.OBJECT; return decodeStringMap(valueType, (JsonObject) jsonMap, connection); - } else if (keyType.getBaseTypeName().equals(Connector.class.getName())) { + } else if (keyType.getBaseTypeName() + .equals(Connector.class.getName())) { assert jsonMap.getType() == JsonType.OBJECT; return decodeConnectorMap(valueType, (JsonObject) jsonMap, connection); @@ -274,16 +278,16 @@ public class JsonDecoder { private static List decodeList(Type type, JsonArray jsonArray, ApplicationConnection connection) { List tokens = new ArrayList(); - decodeIntoCollection(type.getParameterTypes()[0], jsonArray, - connection, tokens); + decodeIntoCollection(type.getParameterTypes()[0], jsonArray, connection, + tokens); return tokens; } private static Set decodeSet(Type type, JsonArray jsonArray, ApplicationConnection connection) { Set tokens = new HashSet(); - decodeIntoCollection(type.getParameterTypes()[0], jsonArray, - connection, tokens); + decodeIntoCollection(type.getParameterTypes()[0], jsonArray, connection, + tokens); return tokens; } diff --git a/client/src/main/java/com/vaadin/client/communication/JsonEncoder.java b/client/src/main/java/com/vaadin/client/communication/JsonEncoder.java index 8d2a447ac5..9316c5f6f7 100644 --- a/client/src/main/java/com/vaadin/client/communication/JsonEncoder.java +++ b/client/src/main/java/com/vaadin/client/communication/JsonEncoder.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -39,12 +39,12 @@ import elemental.json.JsonValue; /** * Encoder for converting RPC parameters and other values to JSON for transfer * between the client and the server. - * + * * Currently, basic data types as well as Map, String[] and Object[] are * supported, where maps and Object[] can contain other supported data types. - * + * * TODO extensible type support - * + * * @since 7.0 */ public class JsonEncoder { @@ -52,7 +52,7 @@ public class JsonEncoder { /** * Encode a value to a JSON representation for transport from the client to * the server. - * + * * @param value * value to convert * @param connection @@ -122,14 +122,14 @@ public class JsonEncoder { Type propertyType = property.getType(); JsonValue encodedPropertyValue = encode(propertyValue, propertyType, connection); - jsonObject - .put(property.getName(), encodedPropertyValue); + jsonObject.put(property.getName(), + encodedPropertyValue); } return jsonObject; } catch (NoDataException e) { - throw new RuntimeException("Can not encode " - + type.getSignature(), e); + throw new RuntimeException( + "Can not encode " + type.getSignature(), e); } } else { @@ -154,8 +154,8 @@ public class JsonEncoder { if (value != null) { valueType = value.getClass().getName(); } - throw new IllegalArgumentException("Cannot encode object of type " - + valueType); + throw new IllegalArgumentException( + "Cannot encode object of type " + valueType); } jsonArray.set(0, Json.create(transportType)); jsonArray.set(1, encode(value, null, connection)); @@ -188,22 +188,23 @@ public class JsonEncoder { } } - private static JsonValue encodeChildValue(Object value, - Type collectionType, int typeIndex, ApplicationConnection connection) { + private static JsonValue encodeChildValue(Object value, Type collectionType, + int typeIndex, ApplicationConnection connection) { if (collectionType == null) { return encode(new UidlValue(value), null, connection); } else { assert collectionType.getParameterTypes() != null && collectionType.getParameterTypes().length > typeIndex - && collectionType.getParameterTypes()[typeIndex] != null : "Proper generics required for encoding child value, assertion failed for " - + collectionType; + && collectionType + .getParameterTypes()[typeIndex] != null : "Proper generics required for encoding child value, assertion failed for " + + collectionType; Type childType = collectionType.getParameterTypes()[typeIndex]; return encode(value, childType, connection); } } - private static JsonArray encodeObjectMap(Map map, - Type type, ApplicationConnection connection) { + private static JsonArray encodeObjectMap(Map map, Type type, + ApplicationConnection connection) { JsonArray keys = Json.createArray(); JsonArray values = Json.createArray(); @@ -230,8 +231,8 @@ public class JsonEncoder { for (Entry entry : map.entrySet()) { Connector connector = (Connector) entry.getKey(); - JsonValue encodedValue = encodeChildValue(entry.getValue(), type, - 1, connection); + JsonValue encodedValue = encodeChildValue(entry.getValue(), type, 1, + connection); jsonMap.put(connector.getConnectorId(), encodedValue); } @@ -239,8 +240,8 @@ public class JsonEncoder { return jsonMap; } - private static JsonValue encodeStringMap(Map map, - Type type, ApplicationConnection connection) { + private static JsonValue encodeStringMap(Map map, Type type, + ApplicationConnection connection) { JsonObject jsonMap = Json.createObject(); for (Entry entry : map.entrySet()) { @@ -291,7 +292,7 @@ public class JsonEncoder { /** * Returns the transport type for the given value. Only returns a transport * type for internally handled values. - * + * * @param value * The value that should be transported * @return One of the JsonEncode.VTYPE_ constants or null if the value diff --git a/client/src/main/java/com/vaadin/client/communication/MessageHandler.java b/client/src/main/java/com/vaadin/client/communication/MessageHandler.java index 15e94ca8d9..714af23683 100644 --- a/client/src/main/java/com/vaadin/client/communication/MessageHandler.java +++ b/client/src/main/java/com/vaadin/client/communication/MessageHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -79,7 +79,7 @@ import elemental.json.JsonObject; * A MessageHandler is responsible for handling all incoming messages (JSON) * from the server (state changes, RPCs and other updates) and ensuring that the * connectors are updated accordingly. - * + * * @since 7.6 * @author Vaadin Ltd */ @@ -125,7 +125,9 @@ public class MessageHandler { */ private Set responseHandlingLocks = new HashSet(); - /** Contains all UIDL messages received while response handling is suspended */ + /** + * Contains all UIDL messages received while response handling is suspended + */ private List pendingUIDLMessages = new ArrayList(); // will hold the CSRF token once received @@ -154,7 +156,7 @@ public class MessageHandler { * has not yet been rendered (or that your browser is very fast). -1 means * that the browser does not support the performance.timing feature used to * get this measurement. - * + * * Note: also used for tracking whether the first UIDL has been handled */ private int bootstrapTime = 0; @@ -207,7 +209,7 @@ public class MessageHandler { /** * Sets the application connection this instance is connected to. Called * internally by the framework. - * + * * @param connection * the application connection this instance is connected to */ @@ -222,7 +224,7 @@ public class MessageHandler { /** * Handles a received UIDL JSON text, parsing it, and passing it on to the * appropriate handlers, while logging timing information. - * + * * @param jsonText * The JSON to handle */ @@ -232,14 +234,14 @@ public class MessageHandler { "The json to handle cannot be null"); } if (getServerId(json) == -1) { - getLogger() - .severe("Response didn't contain a server id. " - + "Please verify that the server is up-to-date and that the response data has not been modified in transmission."); + getLogger().severe("Response didn't contain a server id. " + + "Please verify that the server is up-to-date and that the response data has not been modified in transmission."); } if (connection.getApplicationState() == ApplicationState.RUNNING) { handleJSON(json); - } else if (connection.getApplicationState() == ApplicationState.INITIALIZING) { + } else if (connection + .getApplicationState() == ApplicationState.INITIALIZING) { // Application is starting up for the first time connection.setApplicationRunning(true); connection.executeWhenCSSLoaded(new Command() { @@ -249,9 +251,8 @@ public class MessageHandler { } }); } else { - getLogger() - .warning( - "Ignored received message because application has already been stopped"); + getLogger().warning( + "Ignored received message because application has already been stopped"); return; } } @@ -264,9 +265,8 @@ public class MessageHandler { // messages and ensure this is handled next. Otherwise we // would keep waiting for an older message forever (if this // is triggered by forceHandleMessage) - getLogger().info( - "Received resync message with id " + serverId - + " while waiting for " + getExpectedServerId()); + getLogger().info("Received resync message with id " + serverId + + " while waiting for " + getExpectedServerId()); lastSeenServerSyncId = serverId - 1; removeOldPendingMessages(); } @@ -286,21 +286,17 @@ public class MessageHandler { // Unexpected server id if (serverId <= lastSeenServerSyncId) { // Why is the server re-sending an old package? Ignore it - getLogger().warning( - "Received message with server id " + serverId - + " but have already seen " - + lastSeenServerSyncId + ". Ignoring it"); + getLogger().warning("Received message with server id " + + serverId + " but have already seen " + + lastSeenServerSyncId + ". Ignoring it"); endRequestIfResponse(json); return; } // We are waiting for an earlier message... - getLogger() - .info("Received message with server id " - + serverId - + " but expected " - + getExpectedServerId() - + ". Postponing handling until the missing message(s) have been received"); + getLogger().info("Received message with server id " + serverId + + " but expected " + getExpectedServerId() + + ". Postponing handling until the missing message(s) have been received"); } pendingUIDLMessages.add(new PendingUIDLMessage(json)); if (!forceHandleMessage.isRunning()) { @@ -364,8 +360,8 @@ public class MessageHandler { connection.setResource(key, resources.getAsString(key)); } } - handleUIDLDuration.logDuration( - " * Handling resources from server completed", 10); + handleUIDLDuration + .logDuration(" * Handling resources from server completed", 10); getLogger().info(" * Handling type inheritance map from server"); @@ -379,20 +375,20 @@ public class MessageHandler { getLogger().info("Handling type mappings from server"); if (json.containsKey("typeMappings")) { - connection.getConfiguration() - .addComponentMappings(json.getValueMap("typeMappings"), - connection.getWidgetSet()); + connection.getConfiguration().addComponentMappings( + json.getValueMap("typeMappings"), + connection.getWidgetSet()); } getLogger().info("Handling resource dependencies"); if (json.containsKey("scriptDependencies")) { - connection.loadScriptDependencies(json - .getJSStringArray("scriptDependencies")); + connection.loadScriptDependencies( + json.getJSStringArray("scriptDependencies")); } if (json.containsKey("styleDependencies")) { - connection.loadStyleDependencies(json - .getJSStringArray("styleDependencies")); + connection.loadStyleDependencies( + json.getJSStringArray("styleDependencies")); } handleUIDLDuration.logDuration( @@ -431,8 +427,8 @@ public class MessageHandler { redirectTimer = new Timer() { @Override public void run() { - WidgetUtil.redirect(timedRedirect - .getString("url")); + WidgetUtil.redirect( + timedRedirect.getString("url")); } }; sessionExpirationInterval = timedRedirect @@ -450,7 +446,8 @@ public class MessageHandler { double processUidlStart = Duration.currentTimeMillis(); // Ensure that all connectors that we are about to update exist - JsArrayString createdConnectorIds = createConnectorsIfNeeded(json); + JsArrayString createdConnectorIds = createConnectorsIfNeeded( + json); // Update states, do not fire events JsArrayObject pendingStateChangeEvents = updateConnectorState( @@ -463,15 +460,17 @@ public class MessageHandler { Profiler.enter("Handling locales"); getLogger().info(" * Handling locales"); // Store locale data - LocaleService - .addLocales(getUIConnector().getState().localeServiceState.localeData); + LocaleService.addLocales(getUIConnector() + .getState().localeServiceState.localeData); Profiler.leave("Handling locales"); // Update hierarchy, do not fire events - ConnectorHierarchyUpdateResult connectorHierarchyUpdateResult = updateConnectorHierarchy(json); + ConnectorHierarchyUpdateResult connectorHierarchyUpdateResult = updateConnectorHierarchy( + json); // Fire hierarchy change events - sendHierarchyChangeEvents(connectorHierarchyUpdateResult.events); + sendHierarchyChangeEvents( + connectorHierarchyUpdateResult.events); updateCaptions(pendingStateChangeEvents, connectorHierarchyUpdateResult.parentChangedIds); @@ -489,20 +488,20 @@ public class MessageHandler { if (json.containsKey("dd")) { // response contains data for drag and drop service - VDragAndDropManager.get().handleServerResponse( - json.getValueMap("dd")); + VDragAndDropManager.get() + .handleServerResponse(json.getValueMap("dd")); } - int removed = unregisterRemovedConnectors(connectorHierarchyUpdateResult.detachedConnectorIds); + int removed = unregisterRemovedConnectors( + connectorHierarchyUpdateResult.detachedConnectorIds); if (removed > 0 && !isResponse(json)) { // Must acknowledge the removal using an XHR or server // memory usage will keep growing getUIConnector().sendAck(); } - getLogger() - .info("handleUIDLMessage: " - + (Duration.currentTimeMillis() - processUidlStart) - + " ms"); + getLogger().info("handleUIDLMessage: " + + (Duration.currentTimeMillis() - processUidlStart) + + " ms"); updatingState = false; @@ -516,8 +515,8 @@ public class MessageHandler { layoutManager.layoutNow(); } } catch (final Throwable e) { - getLogger() - .log(Level.SEVERE, "Error processing layouts", e); + getLogger().log(Level.SEVERE, "Error processing layouts", + e); } Profiler.leave("Layout processing"); @@ -546,18 +545,17 @@ public class MessageHandler { // TODO build profiling for widget impl loading time - lastProcessingTime = (int) ((new Date().getTime()) - start - .getTime()); + lastProcessingTime = (int) ((new Date().getTime()) + - start.getTime()); totalProcessingTime += lastProcessingTime; if (bootstrapTime == 0) { double fetchStart = getFetchStartTime(); if (fetchStart != 0) { - int time = (int) (Duration.currentTimeMillis() - fetchStart); - getLogger().log( - Level.INFO, - "First response processed " + time - + " ms after fetchStart"); + int time = (int) (Duration.currentTimeMillis() + - fetchStart); + getLogger().log(Level.INFO, "First response processed " + + time + " ms after fetchStart"); } bootstrapTime = calculateBootstrapTime(); @@ -566,9 +564,8 @@ public class MessageHandler { } } - getLogger().info( - " Processing time was " - + String.valueOf(lastProcessingTime) + "ms"); + getLogger().info(" Processing time was " + + String.valueOf(lastProcessingTime) + "ms"); getLogger().info( "Referenced paintables: " + getConnectorMap().size()); @@ -607,13 +604,16 @@ public class MessageHandler { .cast(); // Update hierarchy based on the fake response - ConnectorHierarchyUpdateResult connectorHierarchyUpdateResult = updateConnectorHierarchy(fakeValueMap); + ConnectorHierarchyUpdateResult connectorHierarchyUpdateResult = updateConnectorHierarchy( + fakeValueMap); // Send hierarchy events based on the fake update - sendHierarchyChangeEvents(connectorHierarchyUpdateResult.events); + sendHierarchyChangeEvents( + connectorHierarchyUpdateResult.events); // Unregister all the old connectors that have now been removed - unregisterRemovedConnectors(connectorHierarchyUpdateResult.detachedConnectorIds); + unregisterRemovedConnectors( + connectorHierarchyUpdateResult.detachedConnectorIds); getLayoutManager().cleanMeasuredSizes(); } @@ -654,10 +654,12 @@ public class MessageHandler { .delegateCaptionHandling()) { ServerConnector parent = child.getParent(); if (parent instanceof HasComponentsConnector) { - Profiler.enter("HasComponentsConnector.updateCaption"); + Profiler.enter( + "HasComponentsConnector.updateCaption"); ((HasComponentsConnector) parent) .updateCaption((ComponentConnector) child); - Profiler.leave("HasComponentsConnector.updateCaption"); + Profiler.leave( + "HasComponentsConnector.updateCaption"); } } } @@ -725,28 +727,29 @@ public class MessageHandler { .getReturnType(); Widget widget = component.getWidget(); - Object propertyValue = property.getValue(component - .getState()); + Object propertyValue = property + .getValue(component.getState()); widgetType.getMethod(methodName).invoke(widget, propertyValue); } catch (NoDataException e) { throw new RuntimeException( "Missing data needed to invoke @DelegateToWidget for " - + component.getClass().getSimpleName(), e); + + component.getClass().getSimpleName(), + e); } } /** * Sends the state change events created while updating the state * information. - * + * * This must be called after hierarchy change listeners have been * called. At least caption updates for the parent are strange if * fired from state change listeners and thus calls the parent * BEFORE the parent is aware of the child (through a * ConnectorHierarchyChangedEvent) - * + * * @param pendingStateChangeEvents * The events to send */ @@ -770,7 +773,8 @@ public class MessageHandler { } private void verifyConnectorHierarchy() { - Profiler.enter("verifyConnectorHierarchy - this is only performed in debug mode"); + Profiler.enter( + "verifyConnectorHierarchy - this is only performed in debug mode"); JsArrayObject currentConnectors = getConnectorMap() .getConnectorsAsJsArray(); @@ -779,31 +783,29 @@ public class MessageHandler { ServerConnector c = currentConnectors.get(i); if (c.getParent() != null) { if (!c.getParent().getChildren().contains(c)) { - getLogger() - .severe("ERROR: Connector " - + c.getConnectorId() - + " is connected to a parent but the parent (" - + c.getParent().getConnectorId() - + ") does not contain the connector"); + getLogger().severe("ERROR: Connector " + + c.getConnectorId() + + " is connected to a parent but the parent (" + + c.getParent().getConnectorId() + + ") does not contain the connector"); } } else if (c == getUIConnector()) { // UIConnector for this connection, ignore - } else if (c instanceof WindowConnector - && getUIConnector().hasSubWindow( - (WindowConnector) c)) { + } else if (c instanceof WindowConnector && getUIConnector() + .hasSubWindow((WindowConnector) c)) { // Sub window attached to this UIConnector, ignore } else { // The connector has been detached from the // hierarchy but was not unregistered. - getLogger() - .severe("ERROR: Connector " - + c.getConnectorId() - + " is not attached to a parent but has not been unregistered"); + getLogger().severe("ERROR: Connector " + + c.getConnectorId() + + " is not attached to a parent but has not been unregistered"); } } - Profiler.leave("verifyConnectorHierarchy - this is only performed in debug mode"); + Profiler.leave( + "verifyConnectorHierarchy - this is only performed in debug mode"); } private int unregisterRemovedConnectors( @@ -813,12 +815,14 @@ public class MessageHandler { JsArrayString detachedArray = detachedConnectors.dump(); int nrDetached = detachedArray.length(); for (int i = 0; i < nrDetached; i++) { - ServerConnector connector = getConnectorMap().getConnector( - detachedArray.get(i)); + ServerConnector connector = getConnectorMap() + .getConnector(detachedArray.get(i)); - Profiler.enter("unregisterRemovedConnectors unregisterConnector"); + Profiler.enter( + "unregisterRemovedConnectors unregisterConnector"); getConnectorMap().unregisterConnector(connector); - Profiler.leave("unregisterRemovedConnectors unregisterConnector"); + Profiler.leave( + "unregisterRemovedConnectors unregisterConnector"); } if (ApplicationConfiguration.isDebugMode()) { @@ -836,8 +840,8 @@ public class MessageHandler { private JsArrayString createConnectorsIfNeeded(ValueMap json) { getLogger().info(" * Creating connectors (if needed)"); - JsArrayString createdConnectors = JavaScriptObject - .createArray().cast(); + JsArrayString createdConnectors = JavaScriptObject.createArray() + .cast(); if (!json.containsKey("types")) { return createdConnectors; } @@ -859,8 +863,8 @@ public class MessageHandler { // connector onlyNoLayoutUpdates = false; - int connectorType = Integer.parseInt(types - .getString(connectorId)); + int connectorType = Integer + .parseInt(types.getString(connectorId)); Class connectorClass = connection .getConfiguration() @@ -869,10 +873,12 @@ public class MessageHandler { // Connector does not exist so we must create it if (connectorClass != getUIConnector().getClass()) { // create, initialize and register the paintable - Profiler.enter("ApplicationConnection.getConnector"); + Profiler.enter( + "ApplicationConnection.getConnector"); connector = connection.getConnector(connectorId, connectorType); - Profiler.leave("ApplicationConnection.getConnector"); + Profiler.leave( + "ApplicationConnection.getConnector"); createdConnectors.push(connectorId); } else { @@ -921,9 +927,8 @@ public class MessageHandler { if (legacyConnector instanceof Paintable) { String key = null; if (Profiler.isEnabled()) { - key = "updateFromUIDL for " - + legacyConnector.getClass() - .getSimpleName(); + key = "updateFromUIDL for " + legacyConnector + .getClass().getSimpleName(); Profiler.enter(key); } @@ -934,15 +939,15 @@ public class MessageHandler { Profiler.leave(key); } } else if (legacyConnector == null) { - getLogger() - .severe("Received update for " - + uidl.getTag() + getLogger().severe( + "Received update for " + uidl.getTag() + ", but there is no such paintable (" + connectorId + ") rendered."); } else { getLogger() .severe("Server sent Vaadin 6 style updates for " - + Util.getConnectorString(legacyConnector) + + Util.getConnectorString( + legacyConnector) + " but this is not a Vaadin 6 Paintable"); } @@ -977,15 +982,15 @@ public class MessageHandler { Profiler.leave("sendHierarchyChangeEvents"); } - private void logHierarchyChange(ConnectorHierarchyChangeEvent event) { + private void logHierarchyChange( + ConnectorHierarchyChangeEvent event) { if (true) { // Always disabled for now. Can be enabled manually return; } - getLogger() - .info("Hierarchy changed for " - + Util.getConnectorString(event.getConnector())); + getLogger().info("Hierarchy changed for " + + Util.getConnectorString(event.getConnector())); String oldChildren = "* Old children: "; for (ComponentConnector child : event.getOldChildren()) { oldChildren += Util.getConnectorString(child) + " "; @@ -1041,11 +1046,12 @@ public class MessageHandler { } SharedState state = connector.getState(); - Type stateType = new Type(state.getClass() - .getName(), null); + Type stateType = new Type( + state.getClass().getName(), null); if (onlyNoLayoutUpdates) { - Profiler.enter("updateConnectorState @NoLayout handling"); + Profiler.enter( + "updateConnectorState @NoLayout handling"); for (String propertyName : stateJson.keys()) { Property property = stateType .getProperty(propertyName); @@ -1054,12 +1060,13 @@ public class MessageHandler { break; } } - Profiler.leave("updateConnectorState @NoLayout handling"); + Profiler.leave( + "updateConnectorState @NoLayout handling"); } Profiler.enter("updateConnectorState decodeValue"); - JsonDecoder.decodeValue(stateType, stateJson, - state, connection); + JsonDecoder.decodeValue(stateType, stateJson, state, + connection); Profiler.leave("updateConnectorState decodeValue"); if (Profiler.isEnabled()) { @@ -1095,8 +1102,8 @@ public class MessageHandler { int length = dump.length(); for (int i = 0; i < length; i++) { String connectorId = dump.get(i); - ServerConnector connector = getConnectorMap().getConnector( - connectorId); + ServerConnector connector = getConnectorMap() + .getConnector(connectorId); StateChangeEvent event = new StateChangeEvent(connector, Json.createObject(), true); @@ -1115,7 +1122,7 @@ public class MessageHandler { * Updates the connector hierarchy and returns a list of events that * should be fired after update of the hierarchy and the state is * done. - * + * * @param json * The JSON containing the hierarchy information * @return A collection of events that should be fired when update @@ -1143,8 +1150,8 @@ public class MessageHandler { .getJSStringArray(connectorId); hasHierarchy.add(connectorId); - updateConnectorHierarchy(connectorId, - childConnectorIds, maybeDetached, result); + updateConnectorHierarchy(connectorId, childConnectorIds, + maybeDetached, result); } } @@ -1166,7 +1173,8 @@ public class MessageHandler { } } - Profiler.enter("updateConnectorHierarchy detach removed connectors"); + Profiler.enter( + "updateConnectorHierarchy detach removed connectors"); /* * Connector is in maybeDetached at this point if it has been @@ -1174,13 +1182,14 @@ public class MessageHandler { */ JsArrayString maybeDetachedArray = maybeDetached.dump(); for (int i = 0; i < maybeDetachedArray.length(); i++) { - ServerConnector removed = getConnectorMap().getConnector( - maybeDetachedArray.get(i)); + ServerConnector removed = getConnectorMap() + .getConnector(maybeDetachedArray.get(i)); recursivelyDetach(removed, result.events, result.detachedConnectorIds); } - Profiler.leave("updateConnectorHierarchy detach removed connectors"); + Profiler.leave( + "updateConnectorHierarchy detach removed connectors"); if (result.events.size() != 0) { onlyNoLayoutUpdates = false; @@ -1194,7 +1203,7 @@ public class MessageHandler { /** * Updates the hierarchy for a connector - * + * * @param connectorId * the id of the connector to update * @param childConnectorIds @@ -1217,7 +1226,8 @@ public class MessageHandler { .getConnector(connectorId); int childConnectorSize = childConnectorIds.length(); - Profiler.enter("updateConnectorHierarchy find new connectors"); + Profiler.enter( + "updateConnectorHierarchy find new connectors"); List newChildren = new ArrayList(); List newComponents = new ArrayList(); @@ -1227,18 +1237,14 @@ public class MessageHandler { ServerConnector childConnector = connectorMap .getConnector(childConnectorId); if (childConnector == null) { - getLogger() - .severe("Hierarchy claims that " - + childConnectorId - + " is a child for " - + connectorId - + " (" - + parentConnector.getClass() - .getName() - + ") but no connector with id " - + childConnectorId - + " has been registered. " - + "More information might be available in the server-side log if assertions are enabled"); + getLogger().severe("Hierarchy claims that " + + childConnectorId + " is a child for " + + connectorId + " (" + + parentConnector.getClass().getName() + + ") but no connector with id " + + childConnectorId + + " has been registered. " + + "More information might be available in the server-side log if assertions are enabled"); continue; } newChildren.add(childConnector); @@ -1246,9 +1252,9 @@ public class MessageHandler { newComponents .add((ComponentConnector) childConnector); } else if (!(childConnector instanceof AbstractExtensionConnector)) { - throw new IllegalStateException( - Util.getConnectorString(childConnector) - + " is not a ComponentConnector nor an AbstractExtensionConnector"); + throw new IllegalStateException(Util + .getConnectorString(childConnector) + + " is not a ComponentConnector nor an AbstractExtensionConnector"); } if (childConnector.getParent() != parentConnector) { childConnector.setParent(parentConnector); @@ -1259,21 +1265,23 @@ public class MessageHandler { } } - Profiler.leave("updateConnectorHierarchy find new connectors"); + Profiler.leave( + "updateConnectorHierarchy find new connectors"); // TODO This check should be done on the server side in // the future so the hierarchy update is only sent when // something actually has changed List oldChildren = parentConnector .getChildren(); - boolean actuallyChanged = !Util.collectionsEquals( - oldChildren, newChildren); + boolean actuallyChanged = !Util + .collectionsEquals(oldChildren, newChildren); if (!actuallyChanged) { return; } - Profiler.enter("updateConnectorHierarchy handle HasComponentsConnector"); + Profiler.enter( + "updateConnectorHierarchy handle HasComponentsConnector"); if (parentConnector instanceof HasComponentsConnector) { HasComponentsConnector ccc = (HasComponentsConnector) parentConnector; @@ -1283,27 +1291,28 @@ public class MessageHandler { newComponents)) { // Fire change event if the hierarchy has // changed - ConnectorHierarchyChangeEvent event = GWT - .create(ConnectorHierarchyChangeEvent.class); + ConnectorHierarchyChangeEvent event = GWT.create( + ConnectorHierarchyChangeEvent.class); event.setOldChildren(oldComponents); event.setConnector(parentConnector); ccc.setChildComponents(newComponents); result.events.add(event); } } else if (!newComponents.isEmpty()) { - getLogger() - .severe("Hierachy claims " - + Util.getConnectorString(parentConnector) - + " has component children even though it isn't a HasComponentsConnector"); + getLogger().severe("Hierachy claims " + + Util.getConnectorString(parentConnector) + + " has component children even though it isn't a HasComponentsConnector"); } - Profiler.leave("updateConnectorHierarchy handle HasComponentsConnector"); + Profiler.leave( + "updateConnectorHierarchy handle HasComponentsConnector"); Profiler.enter("updateConnectorHierarchy setChildren"); parentConnector.setChildren(newChildren); Profiler.leave("updateConnectorHierarchy setChildren"); - Profiler.enter("updateConnectorHierarchy find removed children"); + Profiler.enter( + "updateConnectorHierarchy find removed children"); /* * Find children removed from this parent and mark for @@ -1325,7 +1334,8 @@ public class MessageHandler { } } - Profiler.leave("updateConnectorHierarchy find removed children"); + Profiler.leave( + "updateConnectorHierarchy find removed children"); } catch (final Throwable e) { getLogger().log(Level.SEVERE, "Error updating connector hierarchy", e); @@ -1412,20 +1422,20 @@ public class MessageHandler { /* * Clear child list and parent */ - Profiler.enter(prefix - + "recursivelyDetach clear children and parent"); + Profiler.enter( + prefix + "recursivelyDetach clear children and parent"); connector .setChildren(Collections. emptyList()); connector.setParent(null); - Profiler.leave(prefix - + "recursivelyDetach clear children and parent"); + Profiler.leave( + prefix + "recursivelyDetach clear children and parent"); /* * Create an artificial hierarchy event for containers to give * it a chance to clean up after its children if it has any */ - Profiler.enter(prefix - + "recursivelyDetach create hierarchy event"); + Profiler.enter( + prefix + "recursivelyDetach create hierarchy event"); if (connector instanceof HasComponentsConnector) { HasComponentsConnector ccc = (HasComponentsConnector) connector; List oldChildren = ccc @@ -1435,8 +1445,8 @@ public class MessageHandler { * HasComponentsConnector has a separate child component * list that should also be cleared */ - ccc.setChildComponents(Collections - . emptyList()); + ccc.setChildComponents( + Collections. emptyList()); // Create event and add it to the list of pending events ConnectorHierarchyChangeEvent event = GWT @@ -1446,8 +1456,8 @@ public class MessageHandler { events.add(event); } } - Profiler.leave(prefix - + "recursivelyDetach create hierarchy event"); + Profiler.leave( + prefix + "recursivelyDetach create hierarchy event"); } private native void replaceState(AbstractConnector connector, @@ -1463,8 +1473,8 @@ public class MessageHandler { getLogger() .info(" * Performing server to client RPC calls"); - JsonArray rpcCalls = Util.jso2json(json - .getJavaScriptObject("rpc")); + JsonArray rpcCalls = Util + .jso2json(json.getJavaScriptObject("rpc")); int rpcLength = rpcCalls.length(); for (int i = 0; i < rpcLength; i++) { @@ -1474,17 +1484,15 @@ public class MessageHandler { .parseAndApplyInvocation(rpcCall, connection); - if (onlyNoLayoutUpdates - && !RpcManager.getMethod(invocation) - .isNoLayout()) { + if (onlyNoLayoutUpdates && !RpcManager + .getMethod(invocation).isNoLayout()) { onlyNoLayoutUpdates = false; } } catch (final Throwable e) { - getLogger() - .log(Level.SEVERE, - "Error performing server to client RPC calls", - e); + getLogger().log(Level.SEVERE, + "Error performing server to client RPC calls", + e); } } @@ -1557,18 +1565,16 @@ public class MessageHandler { if (!responseHandlingLocks.isEmpty()) { // Lock which was never release -> bug in locker or things just // too slow - getLogger() - .warning( - "WARNING: reponse handling was never resumed, forcibly removing locks..."); + getLogger().warning( + "WARNING: reponse handling was never resumed, forcibly removing locks..."); responseHandlingLocks.clear(); } else { // Waited for out-of-order message which never arrived // Do one final check and resynchronize if the message is not // there. The final check is only a precaution as this timer // should have been cancelled if the message has arrived - getLogger().warning( - "Gave up waiting for message " + getExpectedServerId() - + " from the server"); + getLogger().warning("Gave up waiting for message " + + getExpectedServerId() + " from the server"); } if (!handlePendingMessages() && !pendingUIDLMessages.isEmpty()) { @@ -1584,7 +1590,7 @@ public class MessageHandler { /** * This method can be used to postpone rendering of a response for a short * period of time (e.g. to avoid the rendering process during animation). - * + * * @param lock */ public void suspendReponseHandling(Object lock) { @@ -1593,7 +1599,7 @@ public class MessageHandler { /** * Resumes the rendering process once all locks have been removed. - * + * * @param lock */ public void resumeResponseHandling(Object lock) { @@ -1603,8 +1609,8 @@ public class MessageHandler { forceHandleMessage.cancel(); if (!pendingUIDLMessages.isEmpty()) { - getLogger() - .info("No more response handling locks, handling pending requests."); + getLogger().info( + "No more response handling locks, handling pending requests."); handlePendingMessages(); } } @@ -1623,7 +1629,7 @@ public class MessageHandler { /** * Finds the next pending UIDL message and handles it (next pending is * decided based on the server id) - * + * * @return true if a message was handled, false otherwise */ private boolean handlePendingMessages() { @@ -1676,7 +1682,7 @@ public class MessageHandler { * server is received. *

    * The initial id when no request has yet been processed is -1. - * + * * @return an id identifying the response */ public int getLastSeenServerSyncId() { @@ -1686,7 +1692,7 @@ public class MessageHandler { /** * Gets the token (aka double submit cookie) that the server uses to protect * against Cross Site Request Forgery attacks. - * + * * @return the CSRF token string */ public String getCsrfToken() { @@ -1698,7 +1704,7 @@ public class MessageHandler { * operations are not allowed when the internal state of the application * might be in an inconsistent state because some state changes have been * applied but others not. This includes running layotus. - * + * * @return true if the internal state might be inconsistent * because changes are being processed; false if the * state should be consistent @@ -1709,7 +1715,7 @@ public class MessageHandler { /** * Checks if the first UIDL has been handled - * + * * @return true if the initial UIDL has already been processed, false * otherwise */ @@ -1739,9 +1745,9 @@ public class MessageHandler { /** * Strips the JSON wrapping from the given json string with wrapping. - * + * * If the given string is not wrapped as expected, returns null - * + * * @since 7.6 * @param jsonWithWrapping * the JSON received from the server @@ -1763,7 +1769,7 @@ public class MessageHandler { /** * Unwraps and parses the given JSON, originating from the server - * + * * @param jsonText * the json from the server * @return A parsed ValueMap or null if the input could not be parsed (or @@ -1776,10 +1782,9 @@ public class MessageHandler { final double start = Profiler.getRelativeTimeMillis(); try { ValueMap json = parseJSONResponse(jsonText); - getLogger().info( - "JSON parsing took " - + Util.round(Profiler.getRelativeTimeMillis() - - start, 3) + "ms"); + getLogger().info("JSON parsing took " + + Util.round(Profiler.getRelativeTimeMillis() - start, 3) + + "ms"); return json; } catch (final Exception e) { getLogger().severe("Unable to parse JSON: " + jsonText); @@ -1798,7 +1803,7 @@ public class MessageHandler { /** * Parse the given wrapped JSON, received from the server, to a ValueMap - * + * * @param wrappedJsonText * the json, wrapped as done by the server * @return a ValueMap, or null if the wrapping was incorrect or json could diff --git a/client/src/main/java/com/vaadin/client/communication/MessageSender.java b/client/src/main/java/com/vaadin/client/communication/MessageSender.java index 5862809b0c..22e3e8d420 100644 --- a/client/src/main/java/com/vaadin/client/communication/MessageSender.java +++ b/client/src/main/java/com/vaadin/client/communication/MessageSender.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -40,7 +40,7 @@ import elemental.json.JsonValue; *

    * Internally uses {@link XhrConnection} and/or {@link PushConnection} for * delivering messages, depending on the application configuration. - * + * * @since 7.6 * @author Vaadin Ltd */ @@ -78,9 +78,8 @@ public class MessageSender { public void sendInvocationsToServer() { if (!connection.isApplicationRunning()) { - getLogger() - .warning( - "Trying to send RPC from not yet started or stopped application"); + getLogger().warning( + "Trying to send RPC from not yet started or stopped application"); return; } @@ -95,7 +94,7 @@ public class MessageSender { /** * Sends all pending method invocations (server RPC and legacy variable * changes) to the server. - * + * */ private void doSendInvocationsToServer() { @@ -115,9 +114,8 @@ public class MessageSender { if (reqJson.length() == 0) { // Nothing to send, all invocations were filtered out (for // non-existing connectors) - getLogger() - .warning( - "All RPCs filtered out, not sending anything to the server"); + getLogger().warning( + "All RPCs filtered out, not sending anything to the server"); return; } @@ -139,7 +137,7 @@ public class MessageSender { /** * Makes an UIDL request to the server. - * + * * @param reqInvocations * Data containing RPC invocations and all related information. * @param extraParams @@ -155,8 +153,8 @@ public class MessageSender { payload.put(ApplicationConstants.CSRF_TOKEN, csrfToken); } payload.put(ApplicationConstants.RPC_INVOCATIONS, reqInvocations); - payload.put(ApplicationConstants.SERVER_SYNC_ID, getMessageHandler() - .getLastSeenServerSyncId()); + payload.put(ApplicationConstants.SERVER_SYNC_ID, + getMessageHandler().getLastSeenServerSyncId()); payload.put(ApplicationConstants.CLIENT_TO_SERVER_ID, clientToServerMessageId++); @@ -174,7 +172,7 @@ public class MessageSender { /** * Sends an asynchronous or synchronous UIDL request to the server using the * given URI. - * + * * @param uri * The URI to use for the request. May includes GET parameters * @param payload @@ -190,7 +188,7 @@ public class MessageSender { /** * Sets the status for the push connection. - * + * * @param enabled * true to enable the push connection; * false to disable the push connection. @@ -257,9 +255,8 @@ public class MessageSender { Scheduler.get().scheduleDeferred(new Command() { @Override public void execute() { - if (!connection.isApplicationRunning() - || !(hasActiveRequest() || getServerRpcQueue() - .isFlushPending())) { + if (!connection.isApplicationRunning() || !(hasActiveRequest() + || getServerRpcQueue().isFlushPending())) { getLoadingIndicator().hide(); // If on Liferay and session expiration management is in @@ -278,7 +275,7 @@ public class MessageSender { /** * Runs possibly registered client side post request hooks. This is expected * to be run after each uidl request made by Vaadin application. - * + * * @param appId */ public static native void runPostRequestHooks(String appId) @@ -298,7 +295,7 @@ public class MessageSender { /** * If on Liferay and logged in, ask the client side session management * JavaScript to extend the session duration. - * + * * Otherwise, Liferay client side JavaScript will explicitly expire the * session even though the server side considers the session to be active. * See ticket #8305 for more information. @@ -317,7 +314,7 @@ public class MessageSender { /** * Indicates whether or not there are currently active UIDL requests. Used * internally to sequence requests properly, seldom needed in Widgets. - * + * * @return true if there are active requests */ public boolean hasActiveRequest() { @@ -327,7 +324,7 @@ public class MessageSender { /** * Returns a human readable string representation of the method used to * communicate with the server. - * + * * @return A string representation of the current transport type */ public String getCommunicationMethodName() { @@ -369,7 +366,7 @@ public class MessageSender { /** * Used internally to update what the server expects - * + * * @param clientToServerMessageId * the new client id to set * @param force @@ -392,9 +389,8 @@ public class MessageSender { // We have never sent a message to the server, so likely the // server knows better (typical case is that we refreshed a // @PreserveOnRefresh UI) - getLogger().info( - "Updating client-to-server id to " + nextExpectedId - + " based on server"); + getLogger().info("Updating client-to-server id to " + + nextExpectedId + " based on server"); } else { getLogger().warning( "Server expects next client-to-server id to be " diff --git a/client/src/main/java/com/vaadin/client/communication/PushConnection.java b/client/src/main/java/com/vaadin/client/communication/PushConnection.java index 489d2c39a4..ae3e698dbc 100644 --- a/client/src/main/java/com/vaadin/client/communication/PushConnection.java +++ b/client/src/main/java/com/vaadin/client/communication/PushConnection.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -28,7 +28,7 @@ import elemental.json.JsonObject; * receive UIDL messages from the server (either asynchronously or as a response * to a UIDL request.) Delegates the UIDL handling to the * {@link ApplicationConnection}. - * + * * @author Vaadin Ltd * @since 7.1 */ @@ -36,7 +36,7 @@ public interface PushConnection { /** * Two-phase construction to allow using GWT.create(). - * + * * @param connection * The ApplicationConnection */ @@ -49,17 +49,17 @@ public interface PushConnection { *

    * Implementation detail: If the push connection is not connected and the * message can thus not be sent, the implementation must call - * {@link ConnectionStateHandler#pushNotConnected(JsonObject)}, which - * will retry the send later. + * {@link ConnectionStateHandler#pushNotConnected(JsonObject)}, which will + * retry the send later. *

    * This method must not be called if the push connection is not * bidirectional (if {@link #isBidirectional()} returns false) - * + * * @param payload * the payload to push * @throws IllegalStateException * if this connection is not active - * + * * @see #isActive() */ public void push(JsonObject payload); @@ -68,7 +68,7 @@ public interface PushConnection { * Checks whether this push connection is in a state where it can push * messages to the server. A connection is active until * {@link #disconnect(Command)} has been called. - * + * * @return true if this connection can accept new messages; * false if this connection is disconnected or * disconnecting. @@ -85,7 +85,7 @@ public interface PushConnection { * After this method has been called, {@link #isActive()} returns * false. Calling this method for a connection that is no * longer active will throw an exception. - * + * * @param command * callback command invoked when the connection has been properly * disconnected @@ -97,7 +97,7 @@ public interface PushConnection { /** * Returns a human readable string representation of the transport type used * to communicate with the server. - * + * * @since 7.1 * @return A human readable string representation of the transport type */ @@ -107,10 +107,10 @@ public interface PushConnection { * Checks whether this push connection should be used for communication in * both directions or if an XHR should be used for client to server * communication. - * + * * A bidirectional push connection must be able to reliably inform about its * connection state. - * + * * @since 7.6 * @return true if the push connection should be used for messages in both * directions, false if it should only be used for server to client diff --git a/client/src/main/java/com/vaadin/client/communication/ReconnectDialog.java b/client/src/main/java/com/vaadin/client/communication/ReconnectDialog.java index 1e77eb63b8..146d6de39b 100644 --- a/client/src/main/java/com/vaadin/client/communication/ReconnectDialog.java +++ b/client/src/main/java/com/vaadin/client/communication/ReconnectDialog.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -19,7 +19,7 @@ import com.vaadin.client.ApplicationConnection; /** * Interface which must be implemented by the reconnect dialog - * + * * @since 7.6 * @author Vaadin Ltd */ @@ -27,7 +27,7 @@ public interface ReconnectDialog { /** * Sets the main text shown in the dialog - * + * * @param text * the text to show */ @@ -36,7 +36,7 @@ public interface ReconnectDialog { /** * Sets the reconnecting state, which is true if we are trying to * re-establish a connection with the server. - * + * * @param reconnecting * true if we are trying to re-establish the server connection, * false if we have given up @@ -45,14 +45,14 @@ public interface ReconnectDialog { /** * Checks if the reconnect dialog is visible to the user - * + * * @return true if the user can see the dialog, false otherwise */ boolean isVisible(); /** * Shows the dialog to the user - * + * * @param connection * the application connection this is related to */ @@ -69,7 +69,7 @@ public interface ReconnectDialog { * not modal, the user can continue to use the application as normally and * all server events will be queued until connection has been * re-established. - * + * * @param modal * true to make the dialog modal, false to allow usage while * dialog is shown @@ -78,7 +78,7 @@ public interface ReconnectDialog { /** * Checks the modality of the dialog. - * + * * @see #setModal(boolean) * @return true if the dialog is modal, false otherwise */ diff --git a/client/src/main/java/com/vaadin/client/communication/RpcManager.java b/client/src/main/java/com/vaadin/client/communication/RpcManager.java index dfcfb47f46..7252823355 100644 --- a/client/src/main/java/com/vaadin/client/communication/RpcManager.java +++ b/client/src/main/java/com/vaadin/client/communication/RpcManager.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -33,17 +33,17 @@ import elemental.json.JsonArray; /** * Client side RPC manager that can invoke methods based on RPC calls received * from the server. - * + * * A GWT generator is used to create an implementation of this class at * run-time. - * + * * @since 7.0 */ public class RpcManager { /** * Perform server to client RPC invocation. - * + * * @param invocation * method to invoke */ @@ -58,18 +58,19 @@ public class RpcManager { method.invoke(clientRpc, invocation.getParameters()); } } catch (NoDataException e) { - throw new IllegalStateException("There is no information about " - + method.getSignature() - + ". Did you remember to compile the right widgetset?", e); + throw new IllegalStateException( + "There is no information about " + method.getSignature() + + ". Did you remember to compile the right widgetset?", + e); } } /** * Gets the method that an invocation targets. - * + * * @param invocation * the method invocation to get the method for - * + * * @since 7.4 * @return the method targeted by this invocation */ @@ -91,9 +92,10 @@ public class RpcManager { Type[] parameterTypes = method.getParameterTypes(); return parameterTypes; } catch (NoDataException e) { - throw new IllegalStateException("There is no information about " - + method.getSignature() - + ". Did you remember to compile the right widgetset?", e); + throw new IllegalStateException( + "There is no information about " + method.getSignature() + + ". Did you remember to compile the right widgetset?", + e); } } @@ -112,13 +114,12 @@ public class RpcManager { interfaceName, methodName); if (connector instanceof HasJavaScriptConnectorHelper) { ((HasJavaScriptConnectorHelper) connector) - .getJavascriptConnectorHelper().invokeJsRpc(invocation, - parametersJson); + .getJavascriptConnectorHelper() + .invokeJsRpc(invocation, parametersJson); } else { if (connector == null) { - throw new IllegalStateException("Target connector (" - + connector + ") not found for RCC to " - + getSignature(invocation)); + throw new IllegalStateException("Target connector (" + connector + + ") not found for RCC to " + getSignature(invocation)); } parseMethodParameters(invocation, parametersJson, connection); diff --git a/client/src/main/java/com/vaadin/client/communication/RpcProxy.java b/client/src/main/java/com/vaadin/client/communication/RpcProxy.java index b757590f77..8808a8a6ef 100644 --- a/client/src/main/java/com/vaadin/client/communication/RpcProxy.java +++ b/client/src/main/java/com/vaadin/client/communication/RpcProxy.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,7 +25,7 @@ import com.vaadin.shared.communication.ServerRpc; /** * Class for creating proxy instances for Client to Server RPC. - * + * * @since 7.0 */ public class RpcProxy { @@ -36,14 +36,14 @@ public class RpcProxy { return (T) TypeData.getType(rpcInterface).createProxy( new RpcInvokationHandler(rpcInterface, connector)); } catch (NoDataException e) { - throw new IllegalStateException("There is no information about " - + rpcInterface - + ". Did you forget to compile the widgetset?"); + throw new IllegalStateException( + "There is no information about " + rpcInterface + + ". Did you forget to compile the widgetset?"); } } - private static final class RpcInvokationHandler implements - InvokationHandler { + private static final class RpcInvokationHandler + implements InvokationHandler { private final Class rpcInterface; private final ServerConnector connector; @@ -58,8 +58,8 @@ public class RpcProxy { MethodInvocation invocation = new MethodInvocation( connector.getConnectorId(), rpcInterface.getName(), method.getName(), params); - ServerRpcQueue serverRpcQueue = ServerRpcQueue.get(connector - .getConnection()); + ServerRpcQueue serverRpcQueue = ServerRpcQueue + .get(connector.getConnection()); serverRpcQueue.add(invocation, method.isLastOnly()); if (!method.isDelayed()) { serverRpcQueue.flush(); diff --git a/client/src/main/java/com/vaadin/client/communication/ServerRpcQueue.java b/client/src/main/java/com/vaadin/client/communication/ServerRpcQueue.java index f6d2097e98..157d23e7b6 100644 --- a/client/src/main/java/com/vaadin/client/communication/ServerRpcQueue.java +++ b/client/src/main/java/com/vaadin/client/communication/ServerRpcQueue.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -38,7 +38,7 @@ import elemental.json.JsonValue; /** * Manages the queue of server invocations (RPC) which are waiting to be sent to * the server. - * + * * @since 7.6 * @author Vaadin Ltd */ @@ -83,7 +83,7 @@ public class ServerRpcQueue { /** * Removes any pending invocation of the given method from the queue - * + * * @param invocation * The invocation to remove */ @@ -100,7 +100,7 @@ public class ServerRpcQueue { /** * Adds an explicit RPC method invocation to the send queue. - * + * * @param invocation * RPC method invocation * @param delayed @@ -118,15 +118,15 @@ public class ServerRpcQueue { */ public void add(MethodInvocation invocation, boolean lastOnly) { if (!connection.isApplicationRunning()) { - getLogger() - .warning( - "Trying to invoke method on not yet started or stopped application"); + getLogger().warning( + "Trying to invoke method on not yet started or stopped application"); return; } String tag; if (lastOnly) { tag = invocation.getLastOnlyTag(); - assert !tag.matches("\\d+") : "getLastOnlyTag value must have at least one non-digit character"; + assert !tag.matches( + "\\d+") : "getLastOnlyTag value must have at least one non-digit character"; pendingInvocations.remove(tag); } else { tag = Integer.toString(lastInvocationTag++); @@ -138,7 +138,7 @@ public class ServerRpcQueue { * Returns a collection of all queued method invocations *

    * The returned collection must not be modified in any way - * + * * @return a collection of all queued method invocations */ public Collection getAll() { @@ -157,7 +157,7 @@ public class ServerRpcQueue { /** * Returns the current size of the queue - * + * * @return the number of invocations in the queue */ public int size() { @@ -166,7 +166,7 @@ public class ServerRpcQueue { /** * Returns the server RPC queue for the given application - * + * * @param connection * the application connection which owns the queue * @return the server rpc queue for the given application @@ -177,7 +177,7 @@ public class ServerRpcQueue { /** * Checks if the queue is empty - * + * * @return true if the queue is empty, false otherwise */ public boolean isEmpty() { @@ -211,7 +211,7 @@ public class ServerRpcQueue { /** * Checks if a flush operation is pending - * + * * @return true if a flush is pending, false otherwise */ public boolean isFlushPending() { @@ -221,7 +221,7 @@ public class ServerRpcQueue { /** * Checks if a loading indicator should be shown when the RPCs have been * sent to the server and we are waiting for a response - * + * * @return true if a loading indicator should be shown, false otherwise */ public boolean showLoadingIndicator() { @@ -244,7 +244,7 @@ public class ServerRpcQueue { /** * Returns the current invocations as JSON - * + * * @return the current invocations in a JSON format ready to be sent to the * server */ @@ -257,9 +257,8 @@ public class ServerRpcQueue { for (MethodInvocation invocation : getAll()) { String connectorId = invocation.getConnectorId(); if (!connectorExists(connectorId)) { - getLogger().info( - "Ignoring RPC for removed connector: " + connectorId - + ": " + invocation.toString()); + getLogger().info("Ignoring RPC for removed connector: " + + connectorId + ": " + invocation.toString()); continue; } @@ -277,8 +276,8 @@ public class ServerRpcQueue { Method method = type.getMethod(invocation.getMethodName()); parameterTypes = method.getParameterTypes(); } catch (NoDataException e) { - throw new RuntimeException("No type data for " - + invocation.toString(), e); + throw new RuntimeException( + "No type data for " + invocation.toString(), e); } } @@ -303,7 +302,7 @@ public class ServerRpcQueue { /** * Checks if the connector with the given id is still ok to use (has not * been removed) - * + * * @param connectorId * the connector id to check * @return true if the connector exists, false otherwise @@ -316,7 +315,7 @@ public class ServerRpcQueue { /** * Checks if the given method invocation originates from Javascript - * + * * @param invocation * the invocation to check * @return true if the method invocation originates from javascript, false @@ -329,15 +328,15 @@ public class ServerRpcQueue { /** * Checks if the given method invocation represents a Vaadin 6 variable * change - * + * * @param invocation * the invocation to check * @return true if the method invocation is a legacy variable change, false * otherwise */ public static boolean isLegacyVariableChange(MethodInvocation invocation) { - return ApplicationConstants.UPDATE_VARIABLE_METHOD.equals(invocation - .getInterfaceName()) + return ApplicationConstants.UPDATE_VARIABLE_METHOD + .equals(invocation.getInterfaceName()) && ApplicationConstants.UPDATE_VARIABLE_METHOD .equals(invocation.getMethodName()); } diff --git a/client/src/main/java/com/vaadin/client/communication/StateChangeEvent.java b/client/src/main/java/com/vaadin/client/communication/StateChangeEvent.java index c2c1ceaea9..136e285a86 100644 --- a/client/src/main/java/com/vaadin/client/communication/StateChangeEvent.java +++ b/client/src/main/java/com/vaadin/client/communication/StateChangeEvent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -33,8 +33,8 @@ import com.vaadin.client.ui.AbstractConnector; import elemental.json.JsonObject; -public class StateChangeEvent extends - AbstractServerConnectorEvent { +public class StateChangeEvent + extends AbstractServerConnectorEvent { /** * Type of this event, used by the event bus. */ @@ -65,7 +65,7 @@ public class StateChangeEvent extends /** * Creates a new state change event. - * + * * @param connector * the event whose state has changed * @param changedPropertiesSet @@ -89,7 +89,7 @@ public class StateChangeEvent extends /** * Creates a new state change event. - * + * * @param connector * the event whose state has changed * @param changedProperties @@ -107,7 +107,7 @@ public class StateChangeEvent extends /** * /** Creates a new state change event. - * + * * @param connector * the event whose state has changed * @param stateJson @@ -131,7 +131,7 @@ public class StateChangeEvent extends /** * Event handler that gets notified whenever any part of the state has been * updated by the server. - * + * * @author Vaadin Ltd * @version @VERSION@ * @since 7.0.0 @@ -139,7 +139,7 @@ public class StateChangeEvent extends public interface StateChangeHandler extends Serializable, EventHandler { /** * Notifies the event handler that the state has changed. - * + * * @param stateChangeEvent * the state change event with details about the change */ @@ -148,9 +148,9 @@ public class StateChangeEvent extends /** * Gets the properties that have changed. - * + * * @return a set of names of the changed properties - * + * * @deprecated As of 7.0.1, use {@link #hasPropertyChanged(String)} instead * for improved performance. */ @@ -167,16 +167,17 @@ public class StateChangeEvent extends /** * Gets the properties that have changed. - * + * * @return a set of names of the changed properties - * + * * @deprecated As of 7.0.1, use {@link #hasPropertyChanged(String)} instead * for improved performance. */ @Deprecated public FastStringSet getChangedPropertiesFastSet() { if (changedProperties == null) { - Profiler.enter("StateChangeEvent.getChangedPropertiesFastSet populate"); + Profiler.enter( + "StateChangeEvent.getChangedPropertiesFastSet populate"); changedProperties = FastStringSet.create(); addJsonFields(stateJson, changedProperties, ""); @@ -186,14 +187,15 @@ public class StateChangeEvent extends changedProperties, ""); } - Profiler.leave("StateChangeEvent.getChangedPropertiesFastSet populate"); + Profiler.leave( + "StateChangeEvent.getChangedPropertiesFastSet populate"); } return changedProperties; } /** * Checks whether the give property has changed. - * + * * @param property * the name of the property to check * @return true if the property has changed, else @@ -224,7 +226,7 @@ public class StateChangeEvent extends /** * Checks whether the given property name (which might contains dots) is * defined in some JavaScript object. - * + * * @param property * the name of the property, might include dots to reference * inner objects @@ -255,7 +257,7 @@ public class StateChangeEvent extends /** * Recursively adds the names of all properties in the provided state type. - * + * * @param type * the type to process * @param changedProperties @@ -282,15 +284,17 @@ public class StateChangeEvent extends } } } catch (NoDataException e) { - throw new IllegalStateException("No property info for " + type - + ". Did you remember to compile the right widgetset?", e); + throw new IllegalStateException( + "No property info for " + type + + ". Did you remember to compile the right widgetset?", + e); } } /** * Recursively adds the names of all fields in all objects in the provided * json object. - * + * * @param json * the json object to process * @param changedProperties @@ -315,7 +319,7 @@ public class StateChangeEvent extends /** * Checks if the state change event is the first one for the given * connector. - * + * * @since 7.1 * @return true if this is the first state change event for the connector, * false otherwise diff --git a/client/src/main/java/com/vaadin/client/communication/XhrConnection.java b/client/src/main/java/com/vaadin/client/communication/XhrConnection.java index 11e3cf3cb7..69c9be8b21 100644 --- a/client/src/main/java/com/vaadin/client/communication/XhrConnection.java +++ b/client/src/main/java/com/vaadin/client/communication/XhrConnection.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -45,7 +45,7 @@ import elemental.json.JsonObject; /** * Provides a connection to the /UIDL url on the server and knows how to send * messages to that end point - * + * * @since 7.6 * @author Vaadin Ltd */ @@ -119,7 +119,7 @@ public class XhrConnection { /** * Sets the payload which was sent to the server - * + * * @param payload * the payload which was sent to the server */ @@ -146,10 +146,9 @@ public class XhrConnection { return; } - getLogger().info( - "Server visit took " - + Util.round(Profiler.getRelativeTimeMillis() - - requestStartTime, 3) + "ms"); + getLogger().info("Server visit took " + Util.round( + Profiler.getRelativeTimeMillis() - requestStartTime, 3) + + "ms"); // for(;;);["+ realJson +"]" String responseText = response.getText(); @@ -170,7 +169,7 @@ public class XhrConnection { /** * Sets the relative time (see {@link Profiler#getRelativeTimeMillis()}) * when the request was sent. - * + * * @param requestStartTime * the relative time when the request was sent */ @@ -182,7 +181,7 @@ public class XhrConnection { /** * Sends an asynchronous UIDL request to the server using the given URI. - * + * * @param payload * The URI to use for the request. May includes GET parameters * @throws RequestException @@ -221,14 +220,14 @@ public class XhrConnection { }.schedule(retryTimeout); } } catch (RequestException e) { - getConnectionStateHandler().xhrException( - new XhrConnectionError(null, payload, e)); + getConnectionStateHandler() + .xhrException(new XhrConnectionError(null, payload, e)); } } /** * Retrieves the URI to use when sending RPCs to the server - * + * * @return The URI to use for server messages. */ protected String getUri() { @@ -236,8 +235,8 @@ public class XhrConnection { .translateVaadinUri(ApplicationConstants.APP_PROTOCOL_PREFIX + ApplicationConstants.UIDL_PATH + '/'); - uri = SharedUtil.addGetParameters(uri, UIConstants.UI_ID_PARAMETER - + "=" + connection.getConfiguration().getUIId()); + uri = SharedUtil.addGetParameters(uri, UIConstants.UI_ID_PARAMETER + "=" + + connection.getConfiguration().getUIId()); return uri; diff --git a/client/src/main/java/com/vaadin/client/communication/XhrConnectionError.java b/client/src/main/java/com/vaadin/client/communication/XhrConnectionError.java index 025f1d70e7..ff39e47f11 100644 --- a/client/src/main/java/com/vaadin/client/communication/XhrConnectionError.java +++ b/client/src/main/java/com/vaadin/client/communication/XhrConnectionError.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -23,7 +23,7 @@ import elemental.json.JsonObject; /** * XhrConnectionError provides detail about an error which occured during an XHR * request to the server - * + * * @since 7.6 * @author Vaadin Ltd */ @@ -36,7 +36,7 @@ public class XhrConnectionError { /** * Constructs an event from the given request, payload and exception - * + * * @param request * the request which failed * @param payload @@ -53,7 +53,7 @@ public class XhrConnectionError { /** * Constructs an event from the given request, response and payload - * + * * @param request * the request which failed * @param payload @@ -70,7 +70,7 @@ public class XhrConnectionError { /** * Returns the exception which caused the problem, if available - * + * * @return the exception which caused the problem, or null if not available */ public Throwable getException() { @@ -79,7 +79,7 @@ public class XhrConnectionError { /** * Returns the request for which the problem occurred - * + * * @return the request where the problem occurred */ public Request getRequest() { @@ -88,7 +88,7 @@ public class XhrConnectionError { /** * Returns the received response, if available - * + * * @return the received response, or null if not available */ public Response getResponse() { @@ -97,7 +97,7 @@ public class XhrConnectionError { /** * Returns the payload which was sent to the server - * + * * @return the payload which was sent, never null */ public JsonObject getPayload() { diff --git a/client/src/main/java/com/vaadin/client/componentlocator/ComponentLocator.java b/client/src/main/java/com/vaadin/client/componentlocator/ComponentLocator.java index 0dfaf99cc1..f7c821d0a2 100644 --- a/client/src/main/java/com/vaadin/client/componentlocator/ComponentLocator.java +++ b/client/src/main/java/com/vaadin/client/componentlocator/ComponentLocator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -30,7 +30,7 @@ import com.vaadin.client.ApplicationConnection; *

    * The main use for this class is locating components for automated testing * purposes. - * + * * @since 7.2, moved from {@link com.vaadin.client.ComponentLocator} */ public class ComponentLocator { @@ -45,14 +45,15 @@ public class ComponentLocator { /** * Construct a ComponentLocator for the given ApplicationConnection. - * + * * @param client * ApplicationConnection instance for the application. */ public ComponentLocator(ApplicationConnection client) { this.client = client; - locatorStrategies = Arrays.asList(new VaadinFinderLocatorStrategy( - client), new LegacyLocatorStrategy(client)); + locatorStrategies = Arrays.asList( + new VaadinFinderLocatorStrategy(client), + new LegacyLocatorStrategy(client)); } /** @@ -66,7 +67,7 @@ public class ComponentLocator { * element if the widget determines an action on the other element will give * the same result as the action on the target element. *

    - * + * * @since 5.4 * @param targetElement * The element to generate a path for. @@ -98,7 +99,7 @@ public class ComponentLocator { * element if the widget determines an action on the other element will give * the same result as the action on the target element. *

    - * + * * @since 7.2 * @param targetElement * The element to generate a path for. @@ -117,7 +118,7 @@ public class ComponentLocator { * element. The {@link #getPathForElement(Element)} method can be used for * the inverse operation, i.e. generating a string expression for a DOM * element. - * + * * @since 5.4 * @param path * The String locator which identifies the target element. @@ -139,7 +140,7 @@ public class ComponentLocator { /** * Locates elements using a String locator (path) which identifies DOM * elements. - * + * * @since 7.2 * @param path * The String locator which identifies target elements. @@ -165,9 +166,9 @@ public class ComponentLocator { /** * Locates elements using a String locator (path) which identifies DOM * elements. The path starts from the specified root element. - * + * * @see #getElementByPath(String) - * + * * @since 7.2 * @param path * The path of elements to be found @@ -181,8 +182,8 @@ public class ComponentLocator { JsArray jsElements = JavaScriptObject.createArray().cast(); for (LocatorStrategy strategy : locatorStrategies) { if (strategy.validatePath(path)) { - List elements = strategy.getElementsByPathStartingAt( - path, root); + List elements = strategy + .getElementsByPathStartingAt(path, root); if (elements.size() > 0) { for (Element e : elements) { jsElements.push(e); @@ -197,11 +198,11 @@ public class ComponentLocator { /** * Locates an element using a String locator (path) which identifies a DOM * element. The path starts from the specified root element. - * + * * @see #getElementByPath(String) - * + * * @since 7.2 - * + * * @param path * The path of the element to be found * @param root @@ -227,7 +228,7 @@ public class ComponentLocator { * Returns the {@link ApplicationConnection} used by this locator. *

    * This method is primarily for internal use by the framework. - * + * * @return the application connection */ public ApplicationConnection getClient() { @@ -236,7 +237,7 @@ public class ComponentLocator { /** * Check if a given selector is valid for LegacyLocatorStrategy. - * + * * @param path * Vaadin selector path * @return true if passes path validation with LegacyLocatorStrategy diff --git a/client/src/main/java/com/vaadin/client/componentlocator/LegacyLocatorStrategy.java b/client/src/main/java/com/vaadin/client/componentlocator/LegacyLocatorStrategy.java index 517d979c8e..9e36e18162 100644 --- a/client/src/main/java/com/vaadin/client/componentlocator/LegacyLocatorStrategy.java +++ b/client/src/main/java/com/vaadin/client/componentlocator/LegacyLocatorStrategy.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -51,7 +51,7 @@ import com.vaadin.shared.communication.SharedState; * The LegacyLocatorStrategy class handles the legacy locator syntax that was * introduced in version 5.4 of the framework. The legacy locator strategy is * always used if no other strategy claims responsibility for a locator string. - * + * * @since 7.2 * @author Vaadin Ltd */ @@ -75,8 +75,8 @@ public class LegacyLocatorStrategy implements LocatorStrategy { private final ApplicationConnection client; - private static final RegExp validSyntax = RegExp - .compile("^((\\w+::)?((PID_S)?\\w[-$_a-zA-Z0-9.' ]*)?)?(/[-$_a-zA-Z0-9]+\\[\\d+\\])*/?(#.*)?$"); + private static final RegExp validSyntax = RegExp.compile( + "^((\\w+::)?((PID_S)?\\w[-$_a-zA-Z0-9.' ]*)?)?(/[-$_a-zA-Z0-9]+\\[\\d+\\])*/?(#.*)?$"); public LegacyLocatorStrategy(ApplicationConnection clientConnection) { client = clientConnection; @@ -89,8 +89,8 @@ public class LegacyLocatorStrategy implements LocatorStrategy { @Override public String getPathForElement(Element targetElement) { - ComponentConnector connector = Util - .findPaintable(client, targetElement); + ComponentConnector connector = Util.findPaintable(client, + targetElement); Widget w = null; if (connector != null) { @@ -169,8 +169,8 @@ public class LegacyLocatorStrategy implements LocatorStrategy { * If the widget can provide an identifier for the targetElement we * let it do that */ - String elementLocator = ((SubPartAware) w).getSubPartName(DOM - .asOld(targetElement)); + String elementLocator = ((SubPartAware) w) + .getSubPartName(DOM.asOld(targetElement)); if (elementLocator != null) { return path + LegacyLocatorStrategy.SUBPART_SEPARATOR + elementLocator; @@ -200,7 +200,8 @@ public class LegacyLocatorStrategy implements LocatorStrategy { * {@inheritDoc} */ @Override - public Element getElementByPathStartingAt(String path, Element baseElement) { + public Element getElementByPathStartingAt(String path, + Element baseElement) { /* * Path is of type "targetWidgetPath#componentPart" or * "targetWidgetPath". @@ -253,7 +254,8 @@ public class LegacyLocatorStrategy implements LocatorStrategy { * {@inheritDoc} */ @Override - public List getElementsByPathStartingAt(String path, Element root) { + public List getElementsByPathStartingAt(String path, + Element root) { // This type of search is not supported in LegacyLocator List array = new ArrayList(); Element e = getElementByPathStartingAt(path, root); @@ -267,7 +269,7 @@ public class LegacyLocatorStrategy implements LocatorStrategy { * Finds the first widget in the hierarchy (moving upwards) that implements * SubPartAware. Returns the SubPartAware implementor or null if none is * found. - * + * * @param w * The widget to start from. This is returned if it implements * SubPartAware. @@ -289,13 +291,14 @@ public class LegacyLocatorStrategy implements LocatorStrategy { * Returns the first widget found when going from {@code targetElement} * upwards in the DOM hierarchy, assuming that {@code ancestorWidget} is a * parent of {@code targetElement}. - * + * * @param targetElement * @param ancestorWidget * @return The widget whose root element is a parent of * {@code targetElement}. */ - private Widget findParentWidget(Element targetElement, Widget ancestorWidget) { + private Widget findParentWidget(Element targetElement, + Widget ancestorWidget) { /* * As we cannot resolve Widgets from the element we start from the * widget and move downwards to the correct child widget, as long as we @@ -315,7 +318,7 @@ public class LegacyLocatorStrategy implements LocatorStrategy { /** * Locates an element based on a DOM path and a base element. - * + * * @param baseElement * The base element which the path is relative to * @param path @@ -334,13 +337,13 @@ public class LegacyLocatorStrategy implements LocatorStrategy { String childIndexString = part.substring("domChild[".length(), part.length() - 1); - if (WidgetUtil.findWidget(baseElement, null) instanceof VAbstractOrderedLayout) { + if (WidgetUtil.findWidget(baseElement, + null) instanceof VAbstractOrderedLayout) { if (element.hasChildNodes()) { Element e = element.getFirstChildElement().cast(); String cn = e.getClassName(); - if (cn != null - && (cn.equals("v-expand") || cn - .contains("v-has-caption"))) { + if (cn != null && (cn.equals("v-expand") + || cn.contains("v-has-caption"))) { element = e; } } @@ -374,7 +377,7 @@ public class LegacyLocatorStrategy implements LocatorStrategy { /** * Generates a String locator using domChild[x] parts for the element * relative to the baseElement. - * + * * @param element * The target element * @param baseElement @@ -421,7 +424,7 @@ public class LegacyLocatorStrategy implements LocatorStrategy { *

    * Returns null if no path can be determined for the widget or if the widget * is null. - * + * * @param w * The target widget * @return A String locator for the widget @@ -472,8 +475,8 @@ public class LegacyLocatorStrategy implements LocatorStrategy { while (i.hasNext()) { Object child = i.next(); if (child == w) { - return basePath + PARENTCHILD_SEPARATOR + simpleName + "[" - + pos + "]"; + return basePath + PARENTCHILD_SEPARATOR + simpleName + "[" + pos + + "]"; } String simpleName2 = Util.getSimpleName(child); if (simpleName.equals(simpleName2)) { @@ -486,7 +489,7 @@ public class LegacyLocatorStrategy implements LocatorStrategy { /** * Locates the widget based on a String locator. - * + * * @param path * The String locator that identifies the widget. * @param baseWidget @@ -568,8 +571,9 @@ public class LegacyLocatorStrategy implements LocatorStrategy { // ChildComponentContainer and VOrderedLayout$Slot have been // replaced with Slot if (w instanceof VAbstractOrderedLayout - && ("ChildComponentContainer".equals(widgetClassName) || "VOrderedLayout$Slot" - .equals(widgetClassName))) { + && ("ChildComponentContainer".equals(widgetClassName) + || "VOrderedLayout$Slot" + .equals(widgetClassName))) { widgetClassName = "Slot"; } @@ -606,8 +610,8 @@ public class LegacyLocatorStrategy implements LocatorStrategy { // the same type before it int nextIndex = 0; for (Widget child : layout) { - boolean matchingType = nextWidgetClassName.equals(Util - .getSimpleName(child)); + boolean matchingType = nextWidgetClassName + .equals(Util.getSimpleName(child)); if (matchingType && widgetPosition == 0) { // This is the n:th child that we looked for break; diff --git a/client/src/main/java/com/vaadin/client/componentlocator/LocatorStrategy.java b/client/src/main/java/com/vaadin/client/componentlocator/LocatorStrategy.java index 15a156a815..8aafdbaf0a 100644 --- a/client/src/main/java/com/vaadin/client/componentlocator/LocatorStrategy.java +++ b/client/src/main/java/com/vaadin/client/componentlocator/LocatorStrategy.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,7 +25,7 @@ import com.google.gwt.dom.client.Element; * an element in the DOM. A strategy can implement its own syntax for the * locator string, which may be completely different from any other strategy's * syntax. - * + * * @since 7.2 * @author Vaadin Ltd */ @@ -34,7 +34,7 @@ public interface LocatorStrategy { /** * Test the given input path for formatting errors. If a given path can not * be validated, the locator strategy will not be attempted. - * + * * @param path * a locator path expression * @return true, if the implementing class can process the given path, @@ -53,7 +53,7 @@ public interface LocatorStrategy { * element if the widget determines an action on the other element will give * the same result as the action on the target element. *

    - * + * * @param targetElement * The element to generate a path for. * @return A String locator that identifies the target element or null if a @@ -66,7 +66,7 @@ public interface LocatorStrategy { * element. The {@link #getPathForElement(Element)} method can be used for * the inverse operation, i.e. generating a string expression for a DOM * element. - * + * * @param path * The String locator which identifies the target element. * @return The DOM element identified by {@code path} or null if the element @@ -77,9 +77,9 @@ public interface LocatorStrategy { /** * Locates an element using a String locator (path) which identifies a DOM * element. The path starts from the specified root element. - * + * * @see #getElementByPath(String) - * + * * @param path * The String locator which identifies the target element. * @param root @@ -92,9 +92,9 @@ public interface LocatorStrategy { /** * Locates all elements that match a String locator (path) which identifies * DOM elements. - * + * * This functionality is limited in {@link LegacyLocatorStrategy}. - * + * * @param path * The String locator which identifies target elements. * @return List that contains all matched elements. Empty list if none @@ -105,11 +105,11 @@ public interface LocatorStrategy { /** * Locates all elements that match a String locator (path) which identifies * DOM elements. The path starts from the specified root element. - * + * * This functionality is limited in {@link LegacyLocatorStrategy}. - * + * * @see #getElementsByPath(String) - * + * * @param path * The String locator which identifies target elements. * @param root diff --git a/client/src/main/java/com/vaadin/client/componentlocator/LocatorUtil.java b/client/src/main/java/com/vaadin/client/componentlocator/LocatorUtil.java index 7de0de3855..5a1203f664 100644 --- a/client/src/main/java/com/vaadin/client/componentlocator/LocatorUtil.java +++ b/client/src/main/java/com/vaadin/client/componentlocator/LocatorUtil.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,7 +20,7 @@ import com.google.gwt.regexp.shared.RegExp; /** * Common String manipulator utilities used in VaadinFinderLocatorStrategy and * SelectorPredicates. - * + * * @since 7.2 * @author Vaadin Ltd */ @@ -29,7 +29,7 @@ public class LocatorUtil { /** * Find first occurrence of character that's not inside quotes starting from * specified index. - * + * * @param str * Full string for searching * @param find @@ -65,7 +65,7 @@ public class LocatorUtil { /** * Find first occurrence of character that's not inside quotes starting from * the beginning of string. - * + * * @param str * Full string for searching * @param find @@ -78,7 +78,7 @@ public class LocatorUtil { /** * Checks if path refers to vaadin UI element com.vaadin.ui.UI. - * + * * @param path * to vaadin element * @return true if path refers to UI element, false otherwise @@ -92,7 +92,7 @@ public class LocatorUtil { /** * Checks if path refers to vaadin Notification element * com.vaadin.ui.Notification. - * + * * @param path * to vaadin element * @return true if path refers to Notification element, false otherwise diff --git a/client/src/main/java/com/vaadin/client/componentlocator/SelectorPredicate.java b/client/src/main/java/com/vaadin/client/componentlocator/SelectorPredicate.java index 31f6cc9b05..7143bbf62b 100644 --- a/client/src/main/java/com/vaadin/client/componentlocator/SelectorPredicate.java +++ b/client/src/main/java/com/vaadin/client/componentlocator/SelectorPredicate.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -23,7 +23,7 @@ import java.util.List; * that VaadinFinderLocatorStrategy is finding. SelectorPredicates also provide * useful information of said components to debug window by giving means to * provide better variable naming. - * + * * @since 7.2 * @author Vaadin Ltd */ @@ -43,7 +43,7 @@ public class SelectorPredicate { /** * Generate a list of predicates from a single predicate string - * + * * @param str * a comma separated string of predicates * @return a List of Predicate objects @@ -108,7 +108,7 @@ public class SelectorPredicate { /** * Splits the predicate string to list of predicate strings. - * + * * @param predicateStr * Comma separated predicate strings * @return List of predicate strings @@ -134,18 +134,18 @@ public class SelectorPredicate { * VTextField[0] => 0 * VTextField[caption='foo'] => caption='foo' * - * + * * @param pathFragment * The path fragment from which to extract the predicate string. * @return The predicate string for the path fragment or empty string if not * found. */ private static String extractPredicateString(String pathFragment) { - int ixOpenBracket = LocatorUtil - .indexOfIgnoringQuoted(pathFragment, '['); + int ixOpenBracket = LocatorUtil.indexOfIgnoringQuoted(pathFragment, + '['); if (ixOpenBracket >= 0) { - int ixCloseBracket = LocatorUtil.indexOfIgnoringQuoted( - pathFragment, ']', ixOpenBracket); + int ixCloseBracket = LocatorUtil.indexOfIgnoringQuoted(pathFragment, + ']', ixOpenBracket); return pathFragment.substring(ixOpenBracket + 1, ixCloseBracket); } return ""; @@ -153,7 +153,7 @@ public class SelectorPredicate { /** * Removes the surrounding quotes from a string if it is quoted. - * + * * @param str * the possibly quoted string * @return an unquoted version of str diff --git a/client/src/main/java/com/vaadin/client/componentlocator/VaadinFinderLocatorStrategy.java b/client/src/main/java/com/vaadin/client/componentlocator/VaadinFinderLocatorStrategy.java index 44bdeddff3..9356d5e34a 100644 --- a/client/src/main/java/com/vaadin/client/componentlocator/VaadinFinderLocatorStrategy.java +++ b/client/src/main/java/com/vaadin/client/componentlocator/VaadinFinderLocatorStrategy.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -40,7 +40,7 @@ import com.vaadin.client.ui.ui.UIConnector; * The VaadinFinder locator strategy implements an XPath-like syntax for * locating elements in Vaadin applications. This is used in the new * VaadinFinder API in TestBench 4. - * + * * Examples of the supported syntax: *
      *
    • Find the third text field in the DOM: {@code //VTextField[2]}
    • @@ -49,7 +49,7 @@ import com.vaadin.client.ui.ui.UIConnector; *
    • Find the first column on the third row of the "Accounts" table: * {@code //VScrollTable[caption="Accounts"]#row[2]/col[0]}
    • *
    - * + * * @since 7.2 * @author Vaadin Ltd */ @@ -86,8 +86,8 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { boolean hasSubParts = targetWidget instanceof SubPartAware; if (oldTarget != targetElement) { if (hasSubParts) { - subPart = ((SubPartAware) targetWidget).getSubPartName(DOM - .asOld(oldTarget)); + subPart = ((SubPartAware) targetWidget) + .getSubPartName(DOM.asOld(oldTarget)); } if (!hasSubParts || subPart == null) { @@ -96,7 +96,8 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { } } - List hierarchy = getConnectorHierarchyForElement(targetElement); + List hierarchy = getConnectorHierarchyForElement( + targetElement); List path = new ArrayList(); // Assemble longname path components back-to-forth with useful @@ -129,7 +130,7 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { * Search different queries for the best one. Use the fact that the lowest * possible index is with the last selector. Last selector is the full * search path containing the complete Component hierarchy. - * + * * @param selectors * List of selectors * @param target @@ -151,12 +152,13 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { // See if we get minimum from second last. If not then we already // have the best one.. Second last one contains almost full // component hierarchy. - if (getElementsByPath(selectors.get(selectors.size() - 2)).indexOf( - target) == min) { + if (getElementsByPath(selectors.get(selectors.size() - 2)) + .indexOf(target) == min) { for (int i = 1; i < selectors.size() - 2; ++i) { // Loop through the remaining selectors and look for one // with the same index - if (getElementsByPath(selectors.get(i)).indexOf(target) == min) { + if (getElementsByPath(selectors.get(i)) + .indexOf(target) == min) { bestSelector = selectors.get(i); break; } @@ -173,7 +175,7 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { * Function to generate all possible search paths for given component list. * Function strips out all the com.vaadin.ui. prefixes from elements as this * functionality makes generating a query later on easier. - * + * * @param components * List of components * @return List of Vaadin selectors @@ -208,7 +210,7 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { /** * Helper method to get the string-form value of a named property of a * component connector - * + * * @since 7.2 * @param c * any ComponentConnector instance @@ -218,8 +220,8 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { * not exist on the object (or some other error is encountered). */ private String getPropertyValue(ComponentConnector c, String propertyName) { - Property prop = AbstractConnector.getStateType(c).getProperty( - propertyName); + Property prop = AbstractConnector.getStateType(c) + .getProperty(propertyName); try { return prop.getValue(c.getState()).toString(); } catch (Exception e) { @@ -231,7 +233,7 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { * Generate a list representing the top-to-bottom connector hierarchy for * any given element. ConnectorPath element provides long- and short names, * as well as connector and widget root element references. - * + * * @since 7.2 * @param elem * any Element that is part of a widget hierarchy @@ -289,8 +291,9 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { } else { final UIConnector uiConnector = client.getUIConnector(); - elements.addAll(eliminateDuplicates(getElementsByPathStartingAtConnector( - path, uiConnector, Document.get().getBody()))); + elements.addAll( + eliminateDuplicates(getElementsByPathStartingAtConnector( + path, uiConnector, Document.get().getBody()))); } for (SelectorPredicate p : postFilters) { @@ -340,7 +343,8 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { * {@inheritDoc} */ @Override - public List getElementsByPathStartingAt(String path, Element root) { + public List getElementsByPathStartingAt(String path, + Element root) { List postFilters = SelectorPredicate .extractPostFilterPredicates(path); if (postFilters.size() > 0) { @@ -372,7 +376,7 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { /** * Special case for finding notifications as they have no connectors and are * directly attached to {@link RootPanel}. - * + * * @param path * The path of the notification, should be * {@code "//VNotification"} optionally followed by an index in @@ -408,7 +412,7 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { /** * Finds a list of elements by the specified path, starting traversal of the * connector hierarchy from the specified root. - * + * * @param path * the locator path * @param root @@ -454,7 +458,7 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { * Recursively finds connectors for the elements identified by the provided * path by traversing the connector hierarchy starting from {@code parents} * connectors. - * + * * @param path * The path identifying elements. * @param parents @@ -474,8 +478,8 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { for (ComponentConnector parent : parents) { connectors.addAll(filterMatches( collectPotentialMatches(parent, fragments[0], - findRecursively), SelectorPredicate - .extractPredicates(fragments[0]))); + findRecursively), + SelectorPredicate.extractPredicates(fragments[0]))); } if (!connectors.isEmpty() && fragments.length > 1) { @@ -488,7 +492,7 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { * Go through a list of potentially matching components, modifying that list * until all elements that remain in that list match the complete list of * predicates. - * + * * @param potentialMatches * a list of component connectors. Will be changed. * @param predicates @@ -518,8 +522,8 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { String propData = getPropertyValue(potentialMatches.get(i), p.getName()); - if ((p.isWildcard() && propData == null) - || (!p.isWildcard() && !p.getValue().equals(propData))) { + if ((p.isWildcard() && propData == null) || (!p.isWildcard() + && !p.getValue().equals(propData))) { potentialMatches.remove(i); --l; --i; @@ -535,10 +539,10 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { * Collects all connectors that match the widget class name of the path * fragment. If the {@code collectRecursively} parameter is true, a * depth-first search of the connector hierarchy is performed. - * + * * Searching depth-first ensure that we can return the matches in correct * order for selecting based on index predicates. - * + * * @param parent * The {@link ComponentConnector} to start the search from. * @param pathFragment @@ -592,7 +596,7 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { * Determines whether a connector matches a path fragment. This is done by * comparing the path fragment to the name of the widget type of the * connector. - * + * * @param connector * The connector to compare. * @param widgetName @@ -637,7 +641,8 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { if (widgetName.equals(fullName + ".class") || widgetName.equals(fullName) || widgetName.equals(simpleName + ".class") - || widgetName.equals(simpleName) || widgetName.equals(name)) { + || widgetName.equals(simpleName) + || widgetName.equals(name)) { return true; } } @@ -652,7 +657,7 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { /** * Extracts the name of the widget class from a path fragment - * + * * @param pathFragment * the path fragment * @return the name of the widget class. @@ -671,7 +676,7 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { * two elements, where the first element is the first path fragment and the * second element is the rest of the path (all remaining path fragments * untouched). - * + * * @param path * The path to split. * @return An array of two elements: The first path fragment and the rest of @@ -703,7 +708,7 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { /* * (non-Javadoc) - * + * * @see * com.vaadin.client.componentlocator.LocatorStrategy#validatePath(java. * lang.String) @@ -720,9 +725,9 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { * Go through a list, removing all duplicate elements from it. This method * is used to avoid accumulation of duplicate entries in result lists * resulting from low-context recursion. - * + * * Preserves first entry in list, removes others. Preserves list order. - * + * * @return list passed as parameter, after modification */ private final List eliminateDuplicates(List list) { diff --git a/client/src/main/java/com/vaadin/client/connectors/AbstractRendererConnector.java b/client/src/main/java/com/vaadin/client/connectors/AbstractRendererConnector.java index f7e3c15ac8..6d522ace5b 100644 --- a/client/src/main/java/com/vaadin/client/connectors/AbstractRendererConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/AbstractRendererConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -34,18 +34,17 @@ import elemental.json.JsonValue; * {@link com.vaadin.ui.components.grid.Renderer Renderer}. As a connector, it * can use the regular Vaadin RPC and shared state mechanism to pass additional * state and information between the client and the server. This base class - * itself only uses the basic - * {@link com.vaadin.shared.communication.SharedState SharedState} and no RPC - * interfaces. - * + * itself only uses the basic {@link com.vaadin.shared.communication.SharedState + * SharedState} and no RPC interfaces. + * * @param * the presentation type of the renderer - * + * * @since 7.4 * @author Vaadin Ltd */ -public abstract class AbstractRendererConnector extends - AbstractExtensionConnector { +public abstract class AbstractRendererConnector + extends AbstractExtensionConnector { private Renderer renderer = null; @@ -54,10 +53,9 @@ public abstract class AbstractRendererConnector extends protected AbstractRendererConnector() { if (presentationType == null) { - throw new IllegalStateException( - "No presentation type found for " - + getClass().getSimpleName() - + ". This may be caused by some unspecified problem in widgetset compilation."); + throw new IllegalStateException("No presentation type found for " + + getClass().getSimpleName() + + ". This may be caused by some unspecified problem in widgetset compilation."); } } @@ -69,13 +67,13 @@ public abstract class AbstractRendererConnector extends * {@link com.google.gwt.core.client.GWT#create(Class) GWT.create(Class)} to * create a renderer based on the return type of the overridden method, but * only if {@link #createRenderer()} is not overridden as well: - * + * *
          * public MyRenderer getRenderer() {
          *     return (MyRenderer) super.getRenderer();
          * }
          * 
    - * + * * @return the renderer bound to this connector */ public Renderer getRenderer() { @@ -95,7 +93,7 @@ public abstract class AbstractRendererConnector extends * {@link #getRenderer()}. If you do override the method, you can't call * super.createRenderer() since the metadata needed for that * implementation is not generated if there's an override of the method. - * + * * @return a new renderer to be used with this connector */ protected Renderer createRenderer() { @@ -112,14 +110,15 @@ public abstract class AbstractRendererConnector extends + getClass().getSimpleName() + ". This might be caused by explicitely using " + "super.createRenderer() or some unspecified " - + "problem with the widgetset compilation.", e); + + "problem with the widgetset compilation.", + e); } } /** * Decodes the given JSON value into a value of type T so it can be passed * to the {@link #getRenderer() renderer}. - * + * * @param value * the value to decode * @return the decoded value of {@code value} @@ -143,7 +142,7 @@ public abstract class AbstractRendererConnector extends * In case this renderer wants be able to identify a row in such a way that * the server also understands it, the row key is used for that. Rows are * identified by unified keys between the client and the server. - * + * * @param row * the row object * @return the row key for the given row @@ -153,8 +152,8 @@ public abstract class AbstractRendererConnector extends if (parent instanceof GridConnector) { return ((GridConnector) parent).getRowKey(row); } else { - throw new IllegalStateException("Renderers can only be used " - + "with a Grid."); + throw new IllegalStateException( + "Renderers can only be used " + "with a Grid."); } } @@ -164,7 +163,7 @@ public abstract class AbstractRendererConnector extends * In case this renderer wants be able to identify a column in such a way * that the server also understands it, the column id is used for that. * Columns are identified by unified ids between the client and the server. - * + * * @param column * the column object * @return the column id for the given column @@ -174,8 +173,8 @@ public abstract class AbstractRendererConnector extends if (parent instanceof GridConnector) { return ((GridConnector) parent).getColumnId(column); } else { - throw new IllegalStateException("Renderers can only be used " - + "with a Grid."); + throw new IllegalStateException( + "Renderers can only be used " + "with a Grid."); } } diff --git a/client/src/main/java/com/vaadin/client/connectors/AbstractSelectionModelConnector.java b/client/src/main/java/com/vaadin/client/connectors/AbstractSelectionModelConnector.java index 3a96f0f03b..1fb98224bd 100644 --- a/client/src/main/java/com/vaadin/client/connectors/AbstractSelectionModelConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/AbstractSelectionModelConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -27,7 +27,7 @@ import elemental.json.JsonObject; /** * Base class for all selection model connectors. - * + * * @since 7.6 * @author Vaadin Ltd */ @@ -53,8 +53,8 @@ public abstract class AbstractSelectionModelConnector { + public abstract static class AbstractSelectionModel + implements SelectionModel { @Override public boolean isSelected(JsonObject row) { diff --git a/client/src/main/java/com/vaadin/client/connectors/ButtonRendererConnector.java b/client/src/main/java/com/vaadin/client/connectors/ButtonRendererConnector.java index 094ca24b5a..b2c8a5f70d 100644 --- a/client/src/main/java/com/vaadin/client/connectors/ButtonRendererConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/ButtonRendererConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -24,12 +24,13 @@ import elemental.json.JsonObject; /** * A connector for {@link ButtonRenderer}. - * + * * @since 7.4 * @author Vaadin Ltd */ @Connect(com.vaadin.ui.renderers.ButtonRenderer.class) -public class ButtonRendererConnector extends ClickableRendererConnector { +public class ButtonRendererConnector + extends ClickableRendererConnector { @Override public ButtonRenderer getRenderer() { diff --git a/client/src/main/java/com/vaadin/client/connectors/ClickableRendererConnector.java b/client/src/main/java/com/vaadin/client/connectors/ClickableRendererConnector.java index 9d16a57a17..ec4333be81 100644 --- a/client/src/main/java/com/vaadin/client/connectors/ClickableRendererConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/ClickableRendererConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -26,30 +26,31 @@ import elemental.json.JsonObject; /** * An abstract base class for {@link ClickableRenderer} connectors. - * + * * @param * the presentation type of the renderer - * + * * @since 7.4 * @author Vaadin Ltd */ -public abstract class ClickableRendererConnector extends - AbstractRendererConnector { +public abstract class ClickableRendererConnector + extends AbstractRendererConnector { HandlerRegistration clickRegistration; @Override protected void init() { - clickRegistration = addClickHandler(new RendererClickHandler() { - @Override - public void onClick(RendererClickEvent event) { - getRpcProxy(RendererClickRpc.class).click( - getRowKey(event.getCell().getRow()), - getColumnId(event.getCell().getColumn()), - MouseEventDetailsBuilder.buildMouseEventDetails(event - .getNativeEvent())); - } - }); + clickRegistration = addClickHandler( + new RendererClickHandler() { + @Override + public void onClick(RendererClickEvent event) { + getRpcProxy(RendererClickRpc.class).click( + getRowKey(event.getCell().getRow()), + getColumnId(event.getCell().getColumn()), + MouseEventDetailsBuilder.buildMouseEventDetails( + event.getNativeEvent())); + } + }); } @Override diff --git a/client/src/main/java/com/vaadin/client/connectors/DateRendererConnector.java b/client/src/main/java/com/vaadin/client/connectors/DateRendererConnector.java index c861df6369..4de1cca075 100644 --- a/client/src/main/java/com/vaadin/client/connectors/DateRendererConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/DateRendererConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -24,7 +24,7 @@ import com.vaadin.shared.ui.Connect; * The server-side Renderer operates on dates, but the data is serialized as a * string, and displayed as-is on the client side. This is to be able to support * the server's locale. - * + * * @since 7.4 * @author Vaadin Ltd */ diff --git a/client/src/main/java/com/vaadin/client/connectors/DetailComponentManagerConnector.java b/client/src/main/java/com/vaadin/client/connectors/DetailComponentManagerConnector.java index 6830d27ef0..63822ca9b3 100644 --- a/client/src/main/java/com/vaadin/client/connectors/DetailComponentManagerConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/DetailComponentManagerConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -22,11 +22,12 @@ import com.vaadin.ui.Grid.DetailComponentManager; /** * Client-side connector for the DetailComponentManager of Grid. - * + * * @since 7.6.1 */ @Connect(DetailComponentManager.class) -public class DetailComponentManagerConnector extends AbstractExtensionConnector { +public class DetailComponentManagerConnector + extends AbstractExtensionConnector { @Override protected void extend(ServerConnector target) { diff --git a/client/src/main/java/com/vaadin/client/connectors/GridConnector.java b/client/src/main/java/com/vaadin/client/connectors/GridConnector.java index 550cf1517c..ddde546da9 100644 --- a/client/src/main/java/com/vaadin/client/connectors/GridConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/GridConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -106,13 +106,13 @@ import elemental.json.JsonValue; * The Grid is typed to JSONObject. The structure of the JSONObject is described * at {@link com.vaadin.shared.data.DataProviderRpc#setRowData(int, List) * DataProviderRpc.setRowData(int, List)}. - * + * * @since 7.4 * @author Vaadin Ltd */ @Connect(com.vaadin.ui.Grid.class) -public class GridConnector extends AbstractHasComponentsConnector implements - SimpleManagedLayout, DeferredWorker { +public class GridConnector extends AbstractHasComponentsConnector + implements SimpleManagedLayout, DeferredWorker { private static final class CustomStyleGenerator implements CellStyleGenerator, RowStyleGenerator { @@ -175,7 +175,7 @@ public class GridConnector extends AbstractHasComponentsConnector implements /** * Sets a new renderer for this column object - * + * * @param rendererConnector * a renderer connector object */ @@ -223,7 +223,8 @@ public class GridConnector extends AbstractHasComponentsConnector implements public void onStateChanged( StateChangeEvent stateChangeEvent) { - String error = editorConnector.getState().errorMessage; + String error = editorConnector + .getState().errorMessage; if (error == null) { columnToErrorMessage @@ -233,7 +234,8 @@ public class GridConnector extends AbstractHasComponentsConnector implements // therefore, we use this hack to make the // string human-readable. Element e = DOM.createElement("div"); - e.setInnerHTML(editorConnector.getState().errorMessage); + e.setInnerHTML(editorConnector + .getState().errorMessage); error = getHeaderCaption() + ": " + e.getInnerText(); @@ -242,8 +244,8 @@ public class GridConnector extends AbstractHasComponentsConnector implements } // Handle Editor RPC before updating error status - Scheduler.get().scheduleFinally( - new ScheduledCommand() { + Scheduler.get() + .scheduleFinally(new ScheduledCommand() { @Override public void execute() { @@ -348,7 +350,7 @@ public class GridConnector extends AbstractHasComponentsConnector implements * Used to handle the case where the editor calls us because it was * invoked by the server via RPC and not by the client. In that case, * the request can be simply synchronously completed. - * + * * @param request * the request object * @return true if the request was originally triggered by the server, @@ -400,8 +402,8 @@ public class GridConnector extends AbstractHasComponentsConnector implements } } - private class ItemClickHandler implements BodyClickHandler, - BodyDoubleClickHandler { + private class ItemClickHandler + implements BodyClickHandler, BodyDoubleClickHandler { @Override public void onClick(GridClickEvent event) { @@ -417,15 +419,13 @@ public class GridConnector extends AbstractHasComponentsConnector implements } } - private void fireItemClick(CellReference cell, NativeEvent mouseEvent) { + private void fireItemClick(CellReference cell, + NativeEvent mouseEvent) { String rowKey = getRowKey((JsonObject) cell.getRow()); String columnId = getColumnId(cell.getColumn()); - getRpcProxy(GridServerRpc.class) - .itemClick( - rowKey, - columnId, - MouseEventDetailsBuilder - .buildMouseEventDetails(mouseEvent)); + getRpcProxy(GridServerRpc.class).itemClick(rowKey, columnId, + MouseEventDetailsBuilder + .buildMouseEventDetails(mouseEvent)); } } @@ -441,8 +441,8 @@ public class GridConnector extends AbstractHasComponentsConnector implements newColumnOrder.add(((CustomGridColumn) column).id); } // the other case would be the multi selection column } - getRpcProxy(GridServerRpc.class).columnsReordered( - newColumnOrder, columnOrder); + getRpcProxy(GridServerRpc.class) + .columnsReordered(newColumnOrder, columnOrder); columnOrder = newColumnOrder; getState().columnOrder = newColumnOrder; } @@ -491,7 +491,8 @@ public class GridConnector extends AbstractHasComponentsConnector implements } }; - private class CustomDetailsGenerator implements HeightAwareDetailsGenerator { + private class CustomDetailsGenerator + implements HeightAwareDetailsGenerator { private final Map idToDetailsMap = new HashMap(); private final Map idToRowIndex = new HashMap(); @@ -525,7 +526,7 @@ public class GridConnector extends AbstractHasComponentsConnector implements /** * Fetches id from the row object that corresponds with the given * rowIndex. - * + * * @since 7.6.1 * @param rowIndex * the index of the row for which to fetch the id @@ -534,9 +535,8 @@ public class GridConnector extends AbstractHasComponentsConnector implements private String getId(int rowIndex) { JsonObject row = getWidget().getDataSource().getRow(rowIndex); - if (!row.hasKey(GridState.JSONKEY_DETAILS_VISIBLE) - || row.getString(GridState.JSONKEY_DETAILS_VISIBLE) - .isEmpty()) { + if (!row.hasKey(GridState.JSONKEY_DETAILS_VISIBLE) || row + .getString(GridState.JSONKEY_DETAILS_VISIBLE).isEmpty()) { return null; } @@ -576,7 +576,7 @@ public class GridConnector extends AbstractHasComponentsConnector implements /** * Class for handling scrolling issues with open details. - * + * * @since 7.5.2 */ private class LazyDetailsScroller implements DeferredWorker { @@ -606,7 +606,7 @@ public class GridConnector extends AbstractHasComponentsConnector implements /** * Inform LazyDetailsScroller that a details row has opened on a row. - * + * * @param rowIndex * index of row with details now open */ @@ -782,8 +782,8 @@ public class GridConnector extends AbstractHasComponentsConnector implements if (!Arrays.equals(columnIds, getState().sortColumns) || !Arrays.equals(directions, getState().sortDirs)) { // Report back to server if changed - getRpcProxy(GridServerRpc.class).sort(columnIds, - directions, event.isUserOriginated()); + getRpcProxy(GridServerRpc.class).sort(columnIds, directions, + event.isUserOriginated()); } } }); @@ -939,7 +939,8 @@ public class GridConnector extends AbstractHasComponentsConnector implements } } - private void updateHeaderCellFromState(HeaderCell cell, CellState cellState) { + private void updateHeaderCellFromState(HeaderCell cell, + CellState cellState) { switch (cellState.type) { case TEXT: cell.setText(cellState.text); @@ -958,8 +959,8 @@ public class GridConnector extends AbstractHasComponentsConnector implements } break; default: - throw new IllegalStateException("unexpected cell type: " - + cellState.type); + throw new IllegalStateException( + "unexpected cell type: " + cellState.type); } cell.setStyleName(cellState.styleName); } @@ -999,7 +1000,8 @@ public class GridConnector extends AbstractHasComponentsConnector implements } } - private void updateFooterCellFromState(FooterCell cell, CellState cellState) { + private void updateFooterCellFromState(FooterCell cell, + CellState cellState) { switch (cellState.type) { case TEXT: cell.setText(cellState.text); @@ -1018,15 +1020,15 @@ public class GridConnector extends AbstractHasComponentsConnector implements } break; default: - throw new IllegalStateException("unexpected cell type: " - + cellState.type); + throw new IllegalStateException( + "unexpected cell type: " + cellState.type); } cell.setStyleName(cellState.styleName); } /** * Updates a column from a state change event. - * + * * @param columnIndex * The index of the column to update */ @@ -1040,7 +1042,7 @@ public class GridConnector extends AbstractHasComponentsConnector implements /** * Adds a new column to the grid widget from a state change event - * + * * @param columnIndex * The index of the column, according to how it */ @@ -1059,7 +1061,7 @@ public class GridConnector extends AbstractHasComponentsConnector implements /** * Updates the column values from a state - * + * * @param column * The column to update * @param state @@ -1074,7 +1076,8 @@ public class GridConnector extends AbstractHasComponentsConnector implements column.setExpandRatio(state.expandRatio); assert state.rendererConnector instanceof AbstractRendererConnector : "GridColumnState.rendererConnector is invalid (not subclass of AbstractRendererConnector)"; - column.setRenderer((AbstractRendererConnector) state.rendererConnector); + column.setRenderer( + (AbstractRendererConnector) state.rendererConnector); column.setSortable(state.sortable); @@ -1087,7 +1090,8 @@ public class GridConnector extends AbstractHasComponentsConnector implements column.setHidingToggleCaption(state.hidingToggleCaption); column.setEditable(state.editable); - column.setEditorConnector((AbstractComponentConnector) state.editorConnector); + column.setEditorConnector( + (AbstractComponentConnector) state.editorConnector); } /** @@ -1141,7 +1145,7 @@ public class GridConnector extends AbstractHasComponentsConnector implements /** * Gets the row key for a row object. - * + * * @param row * the row object * @return the key for the given row @@ -1155,7 +1159,7 @@ public class GridConnector extends AbstractHasComponentsConnector implements /* * (non-Javadoc) - * + * * @see * com.vaadin.client.HasComponentsConnector#updateCaption(com.vaadin.client * .ComponentConnector) @@ -1191,7 +1195,7 @@ public class GridConnector extends AbstractHasComponentsConnector implements /** * Gets the listener used by this connector for tracking when row detail * visibility changes. - * + * * @since 7.5.0 * @return the used details listener */ @@ -1274,7 +1278,7 @@ public class GridConnector extends AbstractHasComponentsConnector implements /** * Creates a concatenation of all columns errors for Editor. - * + * * @since 7.6 * @return displayed error string */ diff --git a/client/src/main/java/com/vaadin/client/connectors/ImageRendererConnector.java b/client/src/main/java/com/vaadin/client/connectors/ImageRendererConnector.java index f7690cb6fe..4961a52a3f 100644 --- a/client/src/main/java/com/vaadin/client/connectors/ImageRendererConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/ImageRendererConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -28,7 +28,7 @@ import elemental.json.JsonValue; /** * A connector for {@link ImageRenderer}. - * + * * @since 7.4 * @author Vaadin Ltd */ diff --git a/client/src/main/java/com/vaadin/client/connectors/JavaScriptRendererConnector.java b/client/src/main/java/com/vaadin/client/connectors/JavaScriptRendererConnector.java index 1229922a9c..503884b566 100644 --- a/client/src/main/java/com/vaadin/client/connectors/JavaScriptRendererConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/JavaScriptRendererConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -38,21 +38,21 @@ import elemental.json.JsonValue; /** * Connector for server-side renderer implemented using JavaScript. - * + * * @since 7.4 * @author Vaadin Ltd */ // This is really typed to , but because of the way native strings // are not always instanceof JsonValue, we need to accept Object @Connect(AbstractJavaScriptRenderer.class) -public class JavaScriptRendererConnector extends - AbstractRendererConnector implements - HasJavaScriptConnectorHelper { +public class JavaScriptRendererConnector + extends AbstractRendererConnector + implements HasJavaScriptConnectorHelper { private final JavaScriptConnectorHelper helper = new JavaScriptConnectorHelper( this); - private final JavaScriptObject cellReferenceWrapper = createCellReferenceWrapper(BrowserInfo - .get().isIE8()); + private final JavaScriptObject cellReferenceWrapper = createCellReferenceWrapper( + BrowserInfo.get().isIE8()); @Override protected void init() { @@ -70,7 +70,7 @@ public class JavaScriptRendererConnector extends // IE8 only supports defineProperty for DOM objects reference = $doc.createElement('div'); } - + var setProperty = function(name, getter, setter) { var descriptor = { get: getter @@ -80,25 +80,25 @@ public class JavaScriptRendererConnector extends } Object.defineProperty(reference, name, descriptor); }; - + setProperty("element", function() { return reference.target.@CellReference::getElement()(); }, null); - + setProperty("rowIndex", function() { return reference.target.@CellReference::getRowIndex()(); }, null); - + setProperty("columnIndex", function() { return reference.target.@CellReference::getColumnIndex()(); }, null); - + setProperty("colSpan", function() { return reference.target.@RendererCellReference::getColSpan()(); }, function(colSpan) { reference.target.@RendererCellReference::setColSpan(*)(colSpan); }); - + return reference; }-*/; @@ -137,9 +137,9 @@ public class JavaScriptRendererConnector extends helper.ensureJavascriptInited(); if (!hasFunction("render")) { - throw new RuntimeException("JavaScriptRenderer " - + helper.getInitFunctionName() - + " must have a function named 'render'"); + throw new RuntimeException( + "JavaScriptRenderer " + helper.getInitFunctionName() + + " must have a function named 'render'"); } final boolean hasInit = hasFunction("init"); @@ -221,8 +221,8 @@ public class JavaScriptRendererConnector extends @Override public Collection getConsumedEvents() { if (hasGetConsumedEvents) { - JsArrayString events = getConsumedEvents(helper - .getConnectorWrapper()); + JsArrayString events = getConsumedEvents( + helper.getConnectorWrapper()); ArrayList list = new ArrayList( events.length()); diff --git a/client/src/main/java/com/vaadin/client/connectors/MultiSelectionModelConnector.java b/client/src/main/java/com/vaadin/client/connectors/MultiSelectionModelConnector.java index 5d00619995..748e9b1acf 100644 --- a/client/src/main/java/com/vaadin/client/connectors/MultiSelectionModelConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/MultiSelectionModelConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -52,7 +52,7 @@ import elemental.json.JsonObject; /** * Connector for server-side {@link MultiSelectionModel}. - * + * * @since 7.6 * @author Vaadin Ltd */ @@ -87,8 +87,8 @@ public class MultiSelectionModelConnector extends @OnStateChange("allSelected") void updateSelectAllCheckbox() { if (selectionModel.getSelectionColumnRenderer() != null) { - HeaderCell cell = getGrid().getDefaultHeaderRow().getCell( - getGrid().getColumn(0)); + HeaderCell cell = getGrid().getDefaultHeaderRow() + .getCell(getGrid().getColumn(0)); CheckBox widget = (CheckBox) cell.getWidget(); widget.setValue(getState().allSelected, false); } @@ -119,11 +119,12 @@ public class MultiSelectionModelConnector extends selectAll(); } }); - dataAvailable = getGrid().addDataAvailableHandler( - new DataAvailableHandler() { + dataAvailable = getGrid() + .addDataAvailableHandler(new DataAvailableHandler() { @Override - public void onDataAvailable(DataAvailableEvent event) { + public void onDataAvailable( + DataAvailableEvent event) { availableRows = event.getAvailableRows(); } }); @@ -138,7 +139,7 @@ public class MultiSelectionModelConnector extends * Creates a selection column renderer. This method can be overridden to * use a custom renderer or use {@code null} to disable the selection * column. - * + * * @param grid * the grid for this selection model * @return selection column renderer or {@code null} if not needed @@ -156,7 +157,8 @@ public class MultiSelectionModelConnector extends assert !isBeingBatchSelected() : "Can't select all in middle of a batch selection."; DataSource dataSource = getGrid().getDataSource(); - for (int i = availableRows.getStart(); i < availableRows.getEnd(); ++i) { + for (int i = availableRows.getStart(); i < availableRows + .getEnd(); ++i) { final JsonObject row = dataSource.getRow(i); if (row != null) { RowHandle handle = dataSource.getHandle(row); @@ -174,7 +176,7 @@ public class MultiSelectionModelConnector extends /** * {@inheritDoc} - * + * * @return {@code false} if rows is empty, else {@code true} */ @Override @@ -184,7 +186,7 @@ public class MultiSelectionModelConnector extends /** * {@inheritDoc} - * + * * @return {@code false} if rows is empty, else {@code true} */ @Override @@ -194,7 +196,7 @@ public class MultiSelectionModelConnector extends /** * {@inheritDoc} - * + * * @return always {@code true} */ @Override @@ -202,7 +204,8 @@ public class MultiSelectionModelConnector extends assert !isBeingBatchSelected() : "Can't select all in middle of a batch selection."; DataSource dataSource = getGrid().getDataSource(); - for (int i = availableRows.getStart(); i < availableRows.getEnd(); ++i) { + for (int i = availableRows.getStart(); i < availableRows + .getEnd(); ++i) { final JsonObject row = dataSource.getRow(i); if (row != null) { RowHandle handle = dataSource.getHandle(row); @@ -217,7 +220,7 @@ public class MultiSelectionModelConnector extends /** * {@inheritDoc} - * + * * @return {@code false} if rows is empty, else {@code true} */ @Override @@ -245,7 +248,7 @@ public class MultiSelectionModelConnector extends *

    * Note: If selection model is in batch select state, the row will be * pinned on select. - * + * * @param row * row handle * @param selected @@ -273,7 +276,7 @@ public class MultiSelectionModelConnector extends /** * {@inheritDoc} - * + * * @return {@code false} if rows is empty, else {@code true} */ @Override @@ -300,8 +303,8 @@ public class MultiSelectionModelConnector extends * rows. Unpins any pinned rows. */ private void sendDeselected() { - getRpcProxy(MultiSelectionModelServerRpc.class).deselect( - getRowKeys(deselected)); + getRpcProxy(MultiSelectionModelServerRpc.class) + .deselect(getRowKeys(deselected)); if (isBeingBatchSelected()) { for (RowHandle row : deselected) { @@ -317,8 +320,8 @@ public class MultiSelectionModelConnector extends * Unpins any pinned rows. */ private void sendSelected() { - getRpcProxy(MultiSelectionModelServerRpc.class).select( - getRowKeys(selected)); + getRpcProxy(MultiSelectionModelServerRpc.class) + .select(getRowKeys(selected)); if (isBeingBatchSelected()) { for (RowHandle row : selected) { @@ -347,7 +350,8 @@ public class MultiSelectionModelConnector extends @Override public void startBatchSelect() { - assert selected.isEmpty() && deselected.isEmpty() : "Row caches were not clear."; + assert selected.isEmpty() + && deselected.isEmpty() : "Row caches were not clear."; batchSelect = true; } diff --git a/client/src/main/java/com/vaadin/client/connectors/NoSelectionModelConnector.java b/client/src/main/java/com/vaadin/client/connectors/NoSelectionModelConnector.java index b9f2d626c2..b0d6e364b5 100644 --- a/client/src/main/java/com/vaadin/client/connectors/NoSelectionModelConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/NoSelectionModelConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,13 +25,13 @@ import elemental.json.JsonObject; /** * Connector for server-side {@link NoSelectionModel}. - * + * * @since 7.6 * @author Vaadin Ltd */ @Connect(NoSelectionModel.class) -public class NoSelectionModelConnector extends - AbstractSelectionModelConnector> { +public class NoSelectionModelConnector + extends AbstractSelectionModelConnector> { @Override protected void extend(ServerConnector target) { diff --git a/client/src/main/java/com/vaadin/client/connectors/NumberRendererConnector.java b/client/src/main/java/com/vaadin/client/connectors/NumberRendererConnector.java index c044e0d6f1..9b94b82e4c 100644 --- a/client/src/main/java/com/vaadin/client/connectors/NumberRendererConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/NumberRendererConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -18,14 +18,13 @@ package com.vaadin.client.connectors; import com.vaadin.shared.ui.Connect; /** - * A connector for - * {@link com.vaadin.ui.components.grid.renderers.NumberRenderer NumberRenderer} - * . + * A connector for {@link com.vaadin.ui.components.grid.renderers.NumberRenderer + * NumberRenderer} . *

    * The server-side Renderer operates on numbers, but the data is serialized as a * string, and displayed as-is on the client side. This is to be able to support * the server's locale. - * + * * @since 7.4 * @author Vaadin Ltd */ diff --git a/client/src/main/java/com/vaadin/client/connectors/ProgressBarRendererConnector.java b/client/src/main/java/com/vaadin/client/connectors/ProgressBarRendererConnector.java index 9b5e8a9677..7ab9923b57 100644 --- a/client/src/main/java/com/vaadin/client/connectors/ProgressBarRendererConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/ProgressBarRendererConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,13 +20,13 @@ import com.vaadin.shared.ui.Connect; /** * A connector for {@link ProgressBarRenderer}. - * + * * @since 7.4 * @author Vaadin Ltd */ @Connect(com.vaadin.ui.renderers.ProgressBarRenderer.class) -public class ProgressBarRendererConnector extends - AbstractRendererConnector { +public class ProgressBarRendererConnector + extends AbstractRendererConnector { @Override public ProgressBarRenderer getRenderer() { diff --git a/client/src/main/java/com/vaadin/client/connectors/RpcDataSourceConnector.java b/client/src/main/java/com/vaadin/client/connectors/RpcDataSourceConnector.java index d744bbc1c7..a9837fa06b 100644 --- a/client/src/main/java/com/vaadin/client/connectors/RpcDataSourceConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/RpcDataSourceConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -38,7 +38,7 @@ import elemental.json.JsonObject; * currently implemented as an Extension hardcoded to support a specific * connector type. This will be changed once framework support for something * more flexible has been implemented. - * + * * @since 7.4 * @author Vaadin Ltd */ @@ -48,7 +48,7 @@ public class RpcDataSourceConnector extends AbstractExtensionConnector { /** * A callback interface to let {@link GridConnector} know that detail * visibilities might have changed. - * + * * @since 7.5.0 * @author Vaadin Ltd */ @@ -57,7 +57,7 @@ public class RpcDataSourceConnector extends AbstractExtensionConnector { /** * A request to verify (and correct) the visibility for a row, given * updated metadata. - * + * * @param rowIndex * the index of the row that should be checked * @param row @@ -122,7 +122,7 @@ public class RpcDataSourceConnector extends AbstractExtensionConnector { /* * If you're looking at this code because you want to learn how to * use AbstactRemoteDataSource, please look somewhere else instead. - * + * * We're not doing things in the conventional way with the callback * here since Vaadin doesn't directly support RPC with return * values. We're instead asking the server to push us some data, and @@ -133,15 +133,15 @@ public class RpcDataSourceConnector extends AbstractExtensionConnector { Range cached = getCachedRange(); - rpcProxy.requestRows(firstRowIndex, numberOfRows, - cached.getStart(), cached.length()); + rpcProxy.requestRows(firstRowIndex, numberOfRows, cached.getStart(), + cached.length()); /* * Show the progress indicator if there is a pending data request * and some of the visible rows are being requested. The RPC in * itself will not trigger the indicator since it might just fetch * some rows in the background to fill the cache. - * + * * The indicator will be hidden by the framework when the response * is received (unless another request is already on its way at that * point). @@ -160,7 +160,7 @@ public class RpcDataSourceConnector extends AbstractExtensionConnector { * We trigger the indicator already at this point since the actual * RPC will not be sent right away when waiting for the response to * a previous request. - * + * * Only triggering here would not be enough since the check that * sets isWaitingForData is deferred. We don't want to trigger the * loading indicator here if we don't know that there is actually a @@ -222,7 +222,7 @@ public class RpcDataSourceConnector extends AbstractExtensionConnector { /** * Updates row data based on row key. - * + * * @since 7.6 * @param row * new row object diff --git a/client/src/main/java/com/vaadin/client/connectors/SingleSelectionModelConnector.java b/client/src/main/java/com/vaadin/client/connectors/SingleSelectionModelConnector.java index fddf3865a2..ea0d6171af 100644 --- a/client/src/main/java/com/vaadin/client/connectors/SingleSelectionModelConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/SingleSelectionModelConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -33,7 +33,7 @@ import elemental.json.JsonObject; /** * Connector for server-side {@link SingleSelectionModel}. - * + * * @since 7.6 * @author Vaadin Ltd */ @@ -78,8 +78,8 @@ public class SingleSelectionModelConnector extends /** * SingleSelectionModel without a selection column renderer. */ - public class SingleSelectionModel extends AbstractSelectionModel implements - SelectionModel.Single { + public class SingleSelectionModel extends AbstractSelectionModel + implements SelectionModel.Single { private RowHandle selectedRow; private boolean deselectAllowed; @@ -110,8 +110,8 @@ public class SingleSelectionModelConnector extends // Check if currently re-selected row was deselected from // the server. if (row != null && getRowHandle(row).equals(selectedRow)) { - if (selectedRow.getRow().hasKey( - GridState.JSONKEY_SELECTED)) { + if (selectedRow.getRow() + .hasKey(GridState.JSONKEY_SELECTED)) { // Everything is OK, no need to do anything. return false; } @@ -130,8 +130,8 @@ public class SingleSelectionModelConnector extends } if (changed) { - getRpcProxy(SingleSelectionModelServerRpc.class).select( - getRowKey(row)); + getRpcProxy(SingleSelectionModelServerRpc.class) + .select(getRowKey(row)); } return changed; diff --git a/client/src/main/java/com/vaadin/client/connectors/TextRendererConnector.java b/client/src/main/java/com/vaadin/client/connectors/TextRendererConnector.java index baf317510d..b5ad8fd67d 100644 --- a/client/src/main/java/com/vaadin/client/connectors/TextRendererConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/TextRendererConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,7 +20,7 @@ import com.vaadin.shared.ui.Connect; /** * A connector for {@link TextRenderer}. - * + * * @since 7.4 * @author Vaadin Ltd */ diff --git a/client/src/main/java/com/vaadin/client/connectors/UnsafeHtmlRendererConnector.java b/client/src/main/java/com/vaadin/client/connectors/UnsafeHtmlRendererConnector.java index 72d8db3c4a..726e823fba 100644 --- a/client/src/main/java/com/vaadin/client/connectors/UnsafeHtmlRendererConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/UnsafeHtmlRendererConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,13 +21,13 @@ import com.vaadin.shared.ui.Connect; /** * A connector for {@link UnsafeHtmlRenderer} - * + * * @since 7.4 * @author Vaadin Ltd */ @Connect(com.vaadin.ui.renderers.HtmlRenderer.class) -public class UnsafeHtmlRendererConnector extends - AbstractRendererConnector { +public class UnsafeHtmlRendererConnector + extends AbstractRendererConnector { public static class UnsafeHtmlRenderer implements Renderer { @Override diff --git a/client/src/main/java/com/vaadin/client/data/AbstractRemoteDataSource.java b/client/src/main/java/com/vaadin/client/data/AbstractRemoteDataSource.java index 05ac7182c5..34342ebce9 100644 --- a/client/src/main/java/com/vaadin/client/data/AbstractRemoteDataSource.java +++ b/client/src/main/java/com/vaadin/client/data/AbstractRemoteDataSource.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -32,7 +32,7 @@ import com.vaadin.shared.ui.grid.Range; * user. An implementation of this class should override * {@link #requestRows(int, int, RequestRowsCallback)} to trigger asynchronously * loading of data and then pass the loaded data into the provided callback. - * + * * @since 7.4 * @author Vaadin Ltd * @param @@ -52,7 +52,7 @@ public abstract class AbstractRemoteDataSource implements DataSource { /** * Creates a new callback - * + * * @param source * the data source for which the request is made * @param requestedRange @@ -70,7 +70,7 @@ public abstract class AbstractRemoteDataSource implements DataSource { * Called by the * {@link AbstractRemoteDataSource#requestRows(int, int, RequestRowsCallback)} * implementation when data has been received. - * + * * @param rowData * a list of row objects starting at the requested offset * @param totalSize @@ -85,7 +85,7 @@ public abstract class AbstractRemoteDataSource implements DataSource { /** * Gets the range of rows that was requested. - * + * * @return the requsted row range */ public Range getRequestedRange() { @@ -105,7 +105,7 @@ public abstract class AbstractRemoteDataSource implements DataSource { /** * A method for the data source to update the row data. - * + * * @param row * the updated row object */ @@ -204,7 +204,7 @@ public abstract class AbstractRemoteDataSource implements DataSource { /** * Pins a row with given handle. This function can be overridden to do * specific logic related to pinning rows. - * + * * @param handle * row handle to pin */ @@ -221,10 +221,10 @@ public abstract class AbstractRemoteDataSource implements DataSource { /** * Unpins a previously pinned row with given handle. This function can be * overridden to do specific logic related to unpinning rows. - * + * * @param handle * row handle to unpin - * + * * @throws IllegalStateException * if given row handle has not been pinned before */ @@ -257,7 +257,7 @@ public abstract class AbstractRemoteDataSource implements DataSource { /** * Gets the row index range that was requested by the previous call to * {@link #ensureAvailability(int, int)}. - * + * * @return the requested availability range */ public Range getRequestedAvailability() { @@ -304,7 +304,7 @@ public abstract class AbstractRemoteDataSource implements DataSource { /** * Checks whether this data source is currently waiting for more rows to * become available. - * + * * @return true if waiting for data; otherwise * false */ @@ -338,7 +338,7 @@ public abstract class AbstractRemoteDataSource implements DataSource { *

    * NOTE: This method has been replaced. Override * {@link #onDropFromCache(int, Object)} instead of this method. - * + * * @since 7.5.0 * @param rowIndex * the index of the dropped row @@ -353,7 +353,7 @@ public abstract class AbstractRemoteDataSource implements DataSource { * A hook that can be overridden to do something whenever a row has been * dropped from the cache. DataSource no longer has anything in the given * index. - * + * * @since 7.6 * @param rowIndex * the index of the dropped row @@ -376,7 +376,7 @@ public abstract class AbstractRemoteDataSource implements DataSource { /** * Triggers fetching rows from the remote data source. The provided callback * should be informed when the requested rows have been received. - * + * * @param firstRowIndex * the index of the first row to fetch * @param numberOfRows @@ -397,7 +397,7 @@ public abstract class AbstractRemoteDataSource implements DataSource { *

    * Note: This method does not verify that the given row object * exists at all in this DataSource. - * + * * @param row * the row object * @return index of the row; or -1 if row is not available @@ -423,7 +423,7 @@ public abstract class AbstractRemoteDataSource implements DataSource { /** * Informs this data source that updated data has been sent from the server. - * + * * @param firstRowIndex * the index of the first received row * @param rowData @@ -437,8 +437,10 @@ public abstract class AbstractRemoteDataSource implements DataSource { Range received = Range.withLength(firstRowIndex, rowData.size()); if (isWaitingForData()) { - cacheStrategy.onDataArrive(Duration.currentTimeMillis() - - currentRequestCallback.requestStart, received.length()); + cacheStrategy.onDataArrive( + Duration.currentTimeMillis() + - currentRequestCallback.requestStart, + received.length()); currentRequestCallback = null; } @@ -450,17 +452,20 @@ public abstract class AbstractRemoteDataSource implements DataSource { Range newUsefulData = partition[1]; if (!newUsefulData.isEmpty()) { // Update the parts that are actually inside - for (int i = newUsefulData.getStart(); i < newUsefulData.getEnd(); i++) { + for (int i = newUsefulData.getStart(); i < newUsefulData + .getEnd(); i++) { final T row = rowData.get(i - firstRowIndex); indexToRowMap.put(Integer.valueOf(i), row); keyToIndexMap.put(getRowKey(row), Integer.valueOf(i)); } if (dataChangeHandler != null) { - Profiler.enter("AbstractRemoteDataSource.setRowData notify dataChangeHandler"); + Profiler.enter( + "AbstractRemoteDataSource.setRowData notify dataChangeHandler"); dataChangeHandler.dataUpdated(newUsefulData.getStart(), newUsefulData.length()); - Profiler.leave("AbstractRemoteDataSource.setRowData notify dataChangeHandler"); + Profiler.leave( + "AbstractRemoteDataSource.setRowData notify dataChangeHandler"); } // Potentially extend the range @@ -490,7 +495,7 @@ public abstract class AbstractRemoteDataSource implements DataSource { if (!partition[0].isEmpty() || !partition[2].isEmpty()) { /* * FIXME - * + * * Got data that we might need in a moment if the container is * updated before the widget settings. Support for this will be * implemented later on. @@ -524,7 +529,7 @@ public abstract class AbstractRemoteDataSource implements DataSource { /** * Informs this data source that the server has removed data. - * + * * @param firstRowIndex * the index of the first removed row * @param count @@ -552,8 +557,8 @@ public abstract class AbstractRemoteDataSource implements DataSource { // Removal and cache share some indices. fix accordingly. Range[] partitions = cached.partitionWith(removedRange); Range remainsBefore = partitions[0]; - Range transposedRemainsAfter = partitions[2].offsetBy(-removedRange - .length()); + Range transposedRemainsAfter = partitions[2] + .offsetBy(-removedRange.length()); cached = remainsBefore.combineWith(transposedRemainsAfter); } else if (removedRange.getEnd() <= cached.getStart()) { // Removal was before the cache. offset the cache. @@ -570,7 +575,7 @@ public abstract class AbstractRemoteDataSource implements DataSource { /** * Informs this data source that new data has been inserted from the server. - * + * * @param firstRowIndex * the destination index of the new row data * @param count @@ -596,7 +601,7 @@ public abstract class AbstractRemoteDataSource implements DataSource { * We need to invalidate the cache from the inserted row onwards, * since the cache wants to be a contiguous range. It doesn't * support holes. - * + * * If holes were supported, we could shift the higher part of * "cached" and leave a hole the size of "count" in the middle. */ @@ -633,7 +638,7 @@ public abstract class AbstractRemoteDataSource implements DataSource { /** * Gets the current range of cached rows - * + * * @return the range of currently cached rows */ public Range getCachedRange() { @@ -646,7 +651,7 @@ public abstract class AbstractRemoteDataSource implements DataSource { *

    * The new strategy is immediately used to evaluate whether currently cached * rows should be discarded or new rows should be fetched. - * + * * @param cacheStrategy * a cache strategy implementation, not null */ @@ -696,8 +701,8 @@ public abstract class AbstractRemoteDataSource implements DataSource { Object key = getRowKey(row); if (key == null) { - throw new NullPointerException("key may not be null (row: " + row - + ")"); + throw new NullPointerException( + "key may not be null (row: " + row + ")"); } if (pinnedRows.containsKey(key)) { @@ -725,7 +730,7 @@ public abstract class AbstractRemoteDataSource implements DataSource { *

    * A very usual and simple example what this could be, is an unique ID for * this object that would also be stored in a database. - * + * * @param row * the row object for which to get the key * @return a non-null object that uniquely and consistently represents the @@ -747,7 +752,7 @@ public abstract class AbstractRemoteDataSource implements DataSource { * If you have information about the structure of the change, use * {@link #insertRowData(int, int)} or {@link #removeRowData(int, int)} to * indicate where the inserted or removed rows are located. - * + * * @param newSize * the new size of the container */ diff --git a/client/src/main/java/com/vaadin/client/data/CacheStrategy.java b/client/src/main/java/com/vaadin/client/data/CacheStrategy.java index 79ce537314..6a0f4452d2 100644 --- a/client/src/main/java/com/vaadin/client/data/CacheStrategy.java +++ b/client/src/main/java/com/vaadin/client/data/CacheStrategy.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,7 +21,7 @@ import com.vaadin.shared.ui.grid.Range; /** * Determines what data an {@link AbstractRemoteDataSource} should fetch and * keep cached. - * + * * @since 7.4 * @author Vaadin Ltd */ @@ -46,8 +46,8 @@ public interface CacheStrategy { Range estimatedAvailableRange) { int cacheSize = getMinimumCacheSize(displayedRange.length()); - return displayedRange.expand(cacheSize, cacheSize).restrictTo( - estimatedAvailableRange); + return displayedRange.expand(cacheSize, cacheSize) + .restrictTo(estimatedAvailableRange); } @Override @@ -55,13 +55,13 @@ public interface CacheStrategy { Range estimatedAvailableRange) { int cacheSize = getMaximumCacheSize(displayedRange.length()); - return displayedRange.expand(cacheSize, cacheSize).restrictTo( - estimatedAvailableRange); + return displayedRange.expand(cacheSize, cacheSize) + .restrictTo(estimatedAvailableRange); } /** * Gets the maximum number of extra items to cache in one direction. - * + * * @param pageSize * the current number of items used at once * @return maximum of items to cache @@ -70,7 +70,7 @@ public interface CacheStrategy { /** * Gets the the minimum number of extra items to cache in one direction. - * + * * @param pageSize * the current number of items used at once * @return minimum number of items to cache @@ -86,8 +86,8 @@ public interface CacheStrategy { * the cache and items are discarded if there's yet another page size worth * of items cached in either direction. */ - public static class DefaultCacheStrategy extends - AbstractBasicSymmetricalCacheStrategy { + public static class DefaultCacheStrategy + extends AbstractBasicSymmetricalCacheStrategy { private final int minimumRatio; private final int maximumRatio; @@ -103,7 +103,7 @@ public interface CacheStrategy { * Creates a DefaultCacheStrategy with custom ratios for how much data * to cache. The ratios denote how many multiples of the currently used * page size are kept in the cache in each direction. - * + * * @param minimumRatio * the minimum number of pages to keep in the cache in each * direction @@ -135,7 +135,7 @@ public interface CacheStrategy { * A cache strategy implementation cannot use this information to keep track * of which items are in the cache since the data source might discard items * without notifying the cache strategy. - * + * * @param roundTripTime * the total number of milliseconds elapsed from requesting the * data until the response was passed to the data source @@ -148,14 +148,14 @@ public interface CacheStrategy { * Gets the minimum row range that should be cached. The data source will * fetch new data if the currently cached range does not fill the entire * minimum cache range. - * + * * @param displayedRange * the range of currently displayed rows * @param cachedRange * the range of currently cached rows * @param estimatedAvailableRange * the estimated range of rows available for the data source - * + * * @return the minimum range of rows that should be cached, should at least * include the displayed range and should not exceed the total * estimated available range @@ -166,14 +166,14 @@ public interface CacheStrategy { /** * Gets the maximum row range that should be cached. The data source will * discard cached rows that are outside the maximum range. - * + * * @param displayedRange * the range of currently displayed rows * @param cachedRange * the range of currently cached rows * @param estimatedAvailableRange * the estimated range of rows available for the data source - * + * * @return the maximum range of rows that should be cached, should at least * include the displayed range and should not exceed the total * estimated available range diff --git a/client/src/main/java/com/vaadin/client/data/DataChangeHandler.java b/client/src/main/java/com/vaadin/client/data/DataChangeHandler.java index 35f1eafea9..7e34cf9386 100644 --- a/client/src/main/java/com/vaadin/client/data/DataChangeHandler.java +++ b/client/src/main/java/com/vaadin/client/data/DataChangeHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -19,7 +19,7 @@ package com.vaadin.client.data; /** * Callback interface used by {@link DataSource} to inform its user about * updates to the data. - * + * * @since 7.4 * @author Vaadin Ltd */ @@ -29,7 +29,7 @@ public interface DataChangeHandler { * rows has changed or if rows have been moved around, * {@link #dataAdded(int, int)} or {@link #dataRemoved(int, int)} should * ideally be used instead. - * + * * @param firstRowIndex * the index of the first changed row * @param numberOfRows @@ -39,7 +39,7 @@ public interface DataChangeHandler { /** * Called when rows have been removed from the data source. - * + * * @param firstRowIndex * the index that the first removed row had prior to removal * @param numberOfRows @@ -49,7 +49,7 @@ public interface DataChangeHandler { /** * Called when the new rows have been added to the container. - * + * * @param firstRowIndex * the index of the first added row * @param numberOfRows @@ -60,7 +60,7 @@ public interface DataChangeHandler { /** * Called when rows requested with * {@link DataSource#ensureAvailability(int, int)} rows are available. - * + * * @param firstRowIndex * the index of the first available row * @param numberOfRows @@ -74,7 +74,7 @@ public interface DataChangeHandler { * This should be used in the cases where the data has changed in some * unverifiable way. I.e. "something happened". This will lead to a * re-rendering of the current Grid viewport - * + * * @param estimatedNewDataSize * the estimated size of the new data set */ diff --git a/client/src/main/java/com/vaadin/client/data/DataSource.java b/client/src/main/java/com/vaadin/client/data/DataSource.java index f3711c3c68..5e4cbc1b40 100644 --- a/client/src/main/java/com/vaadin/client/data/DataSource.java +++ b/client/src/main/java/com/vaadin/client/data/DataSource.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,7 +20,7 @@ package com.vaadin.client.data; * Source of data for widgets showing lazily loaded data based on indexable * items (e.g. rows) of a specified type. The data source is a lazy view into a * larger data set. - * + * * @since 7.4 * @author Vaadin Ltd * @param @@ -32,7 +32,7 @@ public interface DataSource { * A handle that contains information on whether a row should be * {@link #pin() pinned} or {@link #unpin() unpinned}, and also always the * most recent representation for that particular row. - * + * * @param * the row type */ @@ -40,7 +40,7 @@ public interface DataSource { /** * Gets the most recent representation for the row this handle * represents. - * + * * @return the most recent representation for the row this handle * represents * @throws IllegalStateException @@ -60,7 +60,7 @@ public interface DataSource { * source is able to. Since the DataSource might create a new instance * of an object, object references aren't necessarily kept up-to-date. * This is a technical work-around for that. - * + * * @see #unpin() */ public abstract void pin(); @@ -76,7 +76,7 @@ public interface DataSource { * source is able to. Since the DataSource might create a new instance * of an object, object references aren't necessarily kept up-to-date. * This is a technical work-around for that. - * + * * @throws IllegalStateException * if this row handle has not been pinned before * @see #pin() @@ -87,7 +87,7 @@ public interface DataSource { * Informs the DataSource that the row data represented by this * RowHandle has been updated. DataChangeHandler for the DataSource * should be informed that parts of data have been updated. - * + * * @see DataChangeHandler#dataUpdated(int, int) */ public abstract void updateRow(); @@ -101,7 +101,7 @@ public interface DataSource { * RowHandle to function. Because Java has no mechanism to force an * override of an existing method, we're defining a new method for that * instead. - * + * * @param rowHandle * the reference object with which to compare * @return {@code true} if this object is the same as the obj argument; @@ -118,7 +118,7 @@ public interface DataSource { * RowHandle to function. Because Java has no mechanism to force an * override of an existing method, we're defining a new method for that * instead. - * + * * @return a hash code value for this object */ protected abstract int hashCodeExplicit(); @@ -145,7 +145,7 @@ public interface DataSource { *

    * After any possible lazy loading and updates are done, the change handler * is informed that new data is available. - * + * * @param firstRowIndex * the index of the first needed row * @param numberOfRows @@ -160,7 +160,7 @@ public interface DataSource { * This method does not trigger loading of unavailable data. * {@link #ensureAvailability(int, int)} should be used to signal what data * will be needed. - * + * * @param rowIndex * the index of the row to retrieve data for * @return data for the row; or null if no data is available @@ -169,7 +169,7 @@ public interface DataSource { /** * Returns the number of rows in the data source. - * + * * @return the current size of the data source */ public int size(); @@ -177,7 +177,7 @@ public interface DataSource { /** * Sets a data change handler to inform when data is updated, added or * removed. - * + * * @param dataChangeHandler * the data change handler */ @@ -185,7 +185,7 @@ public interface DataSource { /** * Gets a {@link RowHandle} of a row object in the cache. - * + * * @param row * the row object for which to retrieve a row handle * @return a non-null row handle of the given row object diff --git a/client/src/main/java/com/vaadin/client/debug/internal/AnalyzeLayoutsPanel.java b/client/src/main/java/com/vaadin/client/debug/internal/AnalyzeLayoutsPanel.java index fc9f3856b5..55c2ce5d75 100644 --- a/client/src/main/java/com/vaadin/client/debug/internal/AnalyzeLayoutsPanel.java +++ b/client/src/main/java/com/vaadin/client/debug/internal/AnalyzeLayoutsPanel.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -44,7 +44,7 @@ import com.vaadin.client.ValueMap; /** * Analyze layouts view panel of the debug window. - * + * * @since 7.1.4 */ public class AnalyzeLayoutsPanel extends FlowPanel { @@ -68,8 +68,8 @@ public class AnalyzeLayoutsPanel extends FlowPanel { int size = valueMapArray.length(); if (size > 0) { - SimpleTree root = new SimpleTree("Layouts analyzed, " + size - + " top level problems"); + SimpleTree root = new SimpleTree( + "Layouts analyzed, " + size + " top level problems"); for (int i = 0; i < size; i++) { printLayoutError(ac, valueMapArray.get(i), root); } @@ -94,7 +94,8 @@ public class AnalyzeLayoutsPanel extends FlowPanel { printClientSideDetectedIssues(zeroHeightComponents, ac); } if (zeroWidthComponents.size() > 0) { - add(new HTML("

    Horizontally zero size:

    ")); + add(new HTML( + "

    Horizontally zero size:

    ")); printClientSideDetectedIssues(zeroWidthComponents, ac); } } @@ -111,12 +112,10 @@ public class AnalyzeLayoutsPanel extends FlowPanel { final ServerConnector parent = connector.getParent(); final String parentId = parent.getConnectorId(); - final Label errorDetails = new Label(connector.getClass() - .getSimpleName() - + "[" - + connector.getConnectorId() - + "]" - + " inside " + parent.getClass().getSimpleName()); + final Label errorDetails = new Label( + connector.getClass().getSimpleName() + "[" + + connector.getConnectorId() + "]" + " inside " + + parent.getClass().getSimpleName()); if (parent instanceof ComponentConnector) { final ComponentConnector parentConnector = (ComponentConnector) parent; @@ -173,8 +172,8 @@ public class AnalyzeLayoutsPanel extends FlowPanel { Highlight.show(connector); - final SimpleTree errorNode = new SimpleTree(connector.getClass() - .getSimpleName() + " id: " + pid); + final SimpleTree errorNode = new SimpleTree( + connector.getClass().getSimpleName() + " id: " + pid); errorNode.addDomHandler(new MouseOverHandler() { @Override public void onMouseOver(MouseOverEvent event) { @@ -205,12 +204,12 @@ public class AnalyzeLayoutsPanel extends FlowPanel { VerticalPanel errorDetails = new VerticalPanel(); if (valueMap.containsKey("heightMsg")) { - errorDetails.add(new Label("Height problem: " - + valueMap.getString("heightMsg"))); + errorDetails.add(new Label( + "Height problem: " + valueMap.getString("heightMsg"))); } if (valueMap.containsKey("widthMsg")) { - errorDetails.add(new Label("Width problem: " - + valueMap.getString("widthMsg"))); + errorDetails.add(new Label( + "Width problem: " + valueMap.getString("widthMsg"))); } if (errorDetails.getWidgetCount() > 0) { errorNode.add(errorDetails); diff --git a/client/src/main/java/com/vaadin/client/debug/internal/ConnectorInfoPanel.java b/client/src/main/java/com/vaadin/client/debug/internal/ConnectorInfoPanel.java index 5269d82bd6..f41c99decf 100644 --- a/client/src/main/java/com/vaadin/client/debug/internal/ConnectorInfoPanel.java +++ b/client/src/main/java/com/vaadin/client/debug/internal/ConnectorInfoPanel.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -35,14 +35,14 @@ import com.vaadin.shared.communication.SharedState; /** * Connector information view panel of the debug window. - * + * * @since 7.1.4 */ public class ConnectorInfoPanel extends FlowPanel { /** * Update the panel to show information about a connector. - * + * * @param connector */ public void update(ServerConnector connector) { @@ -57,13 +57,13 @@ public class ConnectorInfoPanel extends FlowPanel { if (connector instanceof ComponentConnector) { ComponentConnector component = (ComponentConnector) connector; - ignoreProperties.addAll(Arrays.asList("caption", "description", - "width", "height")); + ignoreProperties.addAll( + Arrays.asList("caption", "description", "width", "height")); AbstractComponentState componentState = component.getState(); - html += getRowHTML("Widget", component.getWidget().getClass() - .getSimpleName()); + html += getRowHTML("Widget", + component.getWidget().getClass().getSimpleName()); html += getRowHTML("Caption", componentState.caption); html += getRowHTML("Description", componentState.description); html += getRowHTML("Width", componentState.width + " (actual: " diff --git a/client/src/main/java/com/vaadin/client/debug/internal/DebugButton.java b/client/src/main/java/com/vaadin/client/debug/internal/DebugButton.java index f797197afb..8a2bc96d24 100644 --- a/client/src/main/java/com/vaadin/client/debug/internal/DebugButton.java +++ b/client/src/main/java/com/vaadin/client/debug/internal/DebugButton.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,7 +21,7 @@ import com.google.gwt.user.client.ui.Button; * Simple extension of {@link Button} that is preconfigured with for use in * {@link VDebugWindow}. Uses icon-font for icons, and allows title to be * specified in the constructor. - * + * * @since 7.1 * @author Vaadin Ltd */ @@ -32,7 +32,7 @@ public class DebugButton extends Button { /** * Creates a {@link Button} with the given icon-font icon. The icon id will * be used in the data-icon attribute of an <i> -tag. - * + * * @param icon * Identifier for the desired icon in an icon-font */ @@ -54,12 +54,12 @@ public class DebugButton extends Button { * Creates a {@link Button} with the given icon-font icon and title * (tooltip). The icon id will be used in the data-icon attribute of * an <i> -tag. - * + * * @param icon * Identifier for the desired icon in an icon-font * @param title * Button title (tooltip) - * + * */ public DebugButton(Icon icon, String title) { this(icon, title, null); @@ -69,7 +69,7 @@ public class DebugButton extends Button { * Creates a {@link Button} with the given icon-font icon, title (tooltip), * and caption. The icon id will be used in the data-icon attribute * of an <i> -tag. - * + * * @param icon * Identifier for the desired icon in an icon-font * @param title @@ -89,7 +89,7 @@ public class DebugButton extends Button { /** * Adds or removes a stylename, indicating whether or not the button is in * it's active state. - * + * * @param active */ public void setActive(boolean active) { @@ -99,7 +99,7 @@ public class DebugButton extends Button { /** * Indicates wheter the Button is currently in its active state or not - * + * * @return true if the Button is active, false otherwise */ public boolean isActive() { diff --git a/client/src/main/java/com/vaadin/client/debug/internal/ErrorNotificationHandler.java b/client/src/main/java/com/vaadin/client/debug/internal/ErrorNotificationHandler.java index 5d128cbdcc..958985b397 100644 --- a/client/src/main/java/com/vaadin/client/debug/internal/ErrorNotificationHandler.java +++ b/client/src/main/java/com/vaadin/client/debug/internal/ErrorNotificationHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -30,7 +30,7 @@ import com.vaadin.client.ui.VNotification; /** * Log message handler that shows big red notification for {@link Level#SEVERE} * messages that have a throwable. - * + * * @since 7.1 * @author Vaadin Ltd */ @@ -66,8 +66,8 @@ public class ErrorNotificationHandler extends Handler { .getRunningApplications().get(0); owner = connection.getUIConnector().getWidget(); } - VNotification n = VNotification.createNotification( - VNotification.DELAY_FOREVER, owner); + VNotification n = VNotification + .createNotification(VNotification.DELAY_FOREVER, owner); n.getElement().getStyle().setTextAlign(TextAlign.LEFT); n.show("

    Uncaught client side exception


    " + exceptionText.replace("\n", "
    \n"), diff --git a/client/src/main/java/com/vaadin/client/debug/internal/HierarchyPanel.java b/client/src/main/java/com/vaadin/client/debug/internal/HierarchyPanel.java index c5c134fc31..2b033f0f88 100644 --- a/client/src/main/java/com/vaadin/client/debug/internal/HierarchyPanel.java +++ b/client/src/main/java/com/vaadin/client/debug/internal/HierarchyPanel.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -39,7 +39,7 @@ import com.vaadin.client.Util; /** * Hierarchy view panel of the debug window. This class can be used in various * debug window sections to show the current connector hierarchy. - * + * * @since 7.1.4 */ public class HierarchyPanel extends FlowPanel { @@ -73,7 +73,7 @@ public class HierarchyPanel extends FlowPanel { /** * Adds the captions of all open (non-leaf) nodes in the hierarchy tree * recursively. - * + * * @param widget * the widget in which to search for open nodes (if SimpleTree) * @param openNodes @@ -163,7 +163,7 @@ public class HierarchyPanel extends FlowPanel { /** * Outputs debug information on the server - usually in the console of an * IDE, with a clickable reference to the relevant code location. - * + * * @since 7.1 * @param connector * show debug info for this connector diff --git a/client/src/main/java/com/vaadin/client/debug/internal/HierarchySection.java b/client/src/main/java/com/vaadin/client/debug/internal/HierarchySection.java index ffb4042e69..cc3a6be4d5 100644 --- a/client/src/main/java/com/vaadin/client/debug/internal/HierarchySection.java +++ b/client/src/main/java/com/vaadin/client/debug/internal/HierarchySection.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -39,7 +39,7 @@ import com.vaadin.client.WidgetUtil; /** * Provides functionality for examining the UI component hierarchy. - * + * * @since 7.1 * @author Vaadin Ltd */ @@ -77,14 +77,14 @@ public class HierarchySection implements Section { * Called when the user hovers over a connector, which is highlighted. * Also called when hovering outside the tree, e.g. over the debug * console, but in this case the connector is null - * + * * @param connector */ void onHover(ComponentConnector connector); /** * Called when the user clicks on a highlighted connector. - * + * * @param connector */ void onSelected(ComponentConnector connector); @@ -121,8 +121,8 @@ public class HierarchySection implements Section { stopFind(); connector.getConnection().getUIConnector() .showServerDesign(connector); - content.setWidget(new HTML( - "Design file for component sent to server log")); + content.setWidget( + new HTML("Design file for component sent to server log")); } }; @@ -334,17 +334,17 @@ public class HierarchySection implements Section { @Override public void onPreviewNativeEvent(NativePreviewEvent event) { - if (event.getTypeInt() == Event.ONKEYDOWN - && event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ESCAPE) { + if (event.getTypeInt() == Event.ONKEYDOWN && event.getNativeEvent() + .getKeyCode() == KeyCodes.KEY_ESCAPE) { stopFind(); Highlight.hideAll(); return; } if (event.getTypeInt() == Event.ONMOUSEMOVE) { Highlight.hideAll(); - Element eventTarget = WidgetUtil.getElementFromPoint(event - .getNativeEvent().getClientX(), event.getNativeEvent() - .getClientY()); + Element eventTarget = WidgetUtil.getElementFromPoint( + event.getNativeEvent().getClientX(), + event.getNativeEvent().getClientY()); if (VDebugWindow.get().getElement().isOrHasChild(eventTarget)) { // Do not prevent using debug window controls @@ -376,9 +376,9 @@ public class HierarchySection implements Section { event.cancel(); event.consume(); event.getNativeEvent().stopPropagation(); - Element eventTarget = WidgetUtil.getElementFromPoint(event - .getNativeEvent().getClientX(), event.getNativeEvent() - .getClientY()); + Element eventTarget = WidgetUtil.getElementFromPoint( + event.getNativeEvent().getClientX(), + event.getNativeEvent().getClientY()); for (ApplicationConnection a : ApplicationConfiguration .getRunningApplications()) { ComponentConnector connector = Util.getConnectorForElement( diff --git a/client/src/main/java/com/vaadin/client/debug/internal/Highlight.java b/client/src/main/java/com/vaadin/client/debug/internal/Highlight.java index e91f4abcbb..b24e19e05e 100644 --- a/client/src/main/java/com/vaadin/client/debug/internal/Highlight.java +++ b/client/src/main/java/com/vaadin/client/debug/internal/Highlight.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -40,7 +40,7 @@ import com.vaadin.client.ui.VWindow; * disappear with the highlighted widget, and it is also fairly likely that * someone else calls {@link #hideAll()} eventually. *

    - * + * * @since 7.1 * @author Vaadin Ltd */ @@ -59,7 +59,7 @@ public class Highlight { * Pass the returned {@link Element} to {@link #hide(Element)} to remove * this particular highlight. *

    - * + * * @param connector * ComponentConnector * @return Highlight element @@ -75,9 +75,9 @@ public class Highlight { * Pass the returned {@link Element} to {@link #hide(Element)} to remove * this particular highlight. *

    - * + * * @since 7.1 - * + * * @param connector * the server connector to highlight * @return Highlight element, or null if the connector isn't a @@ -99,7 +99,7 @@ public class Highlight { * Pass the returned {@link Element} to {@link #hide(Element)} to remove * this particular highlight. *

    - * + * * @param connector * ComponentConnector * @param color @@ -120,7 +120,7 @@ public class Highlight { * Pass the returned {@link Element} to {@link #hide(Element)} to remove * this particular highlight. *

    - * + * * @param widget * Widget to highlight * @return Highlight element @@ -135,7 +135,7 @@ public class Highlight { * Pass the returned {@link Element} to {@link #hide(Element)} to remove * this particular highlight. *

    - * + * * @param widget * Widget to highlight * @param color @@ -155,7 +155,7 @@ public class Highlight { * Pass the returned {@link Element} to {@link #hide(Element)} to remove * this particular highlight. *

    - * + * * @param element * Element to highlight * @return Highlight element @@ -170,7 +170,7 @@ public class Highlight { * Pass the returned highlight {@link Element} to {@link #hide(Element)} to * remove this particular highlight. *

    - * + * * @param element * Element to highlight * @param color @@ -204,8 +204,8 @@ public class Highlight { style.setBackgroundColor(color); style.setOpacity(DEFAULT_OPACITY); if (BrowserInfo.get().isIE()) { - style.setProperty("filter", "alpha(opacity=" - + (DEFAULT_OPACITY * 100) + ")"); + style.setProperty("filter", + "alpha(opacity=" + (DEFAULT_OPACITY * 100) + ")"); } highlights.add(highlight); @@ -217,7 +217,7 @@ public class Highlight { /** * Hides the given highlight. - * + * * @param highlight * Highlight to hide */ diff --git a/client/src/main/java/com/vaadin/client/debug/internal/Icon.java b/client/src/main/java/com/vaadin/client/debug/internal/Icon.java index a30dc05fcb..8e56525c3a 100644 --- a/client/src/main/java/com/vaadin/client/debug/internal/Icon.java +++ b/client/src/main/java/com/vaadin/client/debug/internal/Icon.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/debug/internal/InfoSection.java b/client/src/main/java/com/vaadin/client/debug/internal/InfoSection.java index 39ff345cb1..d3b882e342 100644 --- a/client/src/main/java/com/vaadin/client/debug/internal/InfoSection.java +++ b/client/src/main/java/com/vaadin/client/debug/internal/InfoSection.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -34,7 +34,7 @@ import com.vaadin.shared.util.SharedUtil; /** * Information section of the debug window - * + * * @since 7.1 * @author Vaadin Ltd */ @@ -57,7 +57,7 @@ public class InfoSection implements Section { }; /** - * + * */ public InfoSection() { createContent(); @@ -95,7 +95,7 @@ public class InfoSection implements Section { /* * (non-Javadoc) - * + * * @see com.vaadin.client.debug.internal.Section#getTabButton() */ @Override @@ -105,7 +105,7 @@ public class InfoSection implements Section { /* * (non-Javadoc) - * + * * @see com.vaadin.client.debug.internal.Section#getControls() */ @Override @@ -115,7 +115,7 @@ public class InfoSection implements Section { /* * (non-Javadoc) - * + * * @see com.vaadin.client.debug.internal.Section#getContent() */ @Override @@ -125,7 +125,7 @@ public class InfoSection implements Section { /* * (non-Javadoc) - * + * * @see com.vaadin.client.debug.internal.Section#show() */ @Override @@ -135,7 +135,7 @@ public class InfoSection implements Section { /** * Updates the information for all running applications - * + * * @since 7.1 */ private void refresh() { @@ -154,7 +154,7 @@ public class InfoSection implements Section { /** * Updates the information for a single running application - * + * * @since 7.1 */ private void refresh(ApplicationConnection connection) { @@ -165,8 +165,8 @@ public class InfoSection implements Section { addRow("Widget set", GWT.getModuleName()); addRow("Theme", connection.getUIConnector().getActiveTheme()); - String communicationMethodInfo = connection - .getMessageSender().getCommunicationMethodName(); + String communicationMethodInfo = connection.getMessageSender() + .getCommunicationMethodName(); int pollInterval = connection.getUIConnector().getState().pollInterval; if (pollInterval > 0) { communicationMethodInfo += " (poll interval " + pollInterval @@ -185,7 +185,7 @@ public class InfoSection implements Section { /** * Logs version information for client/server/theme. - * + * * @param applicationConfiguration * @since 7.1 */ @@ -211,10 +211,10 @@ public class InfoSection implements Section { themeVersion); boolean servletOk = equalsEither(servletVersion, clientVersion, themeVersion); - addRow("Client engine version", clientVersion, clientOk ? null - : ERROR_STYLE); - addRow("Server engine version", servletVersion, servletOk ? null - : ERROR_STYLE); + addRow("Client engine version", clientVersion, + clientOk ? null : ERROR_STYLE); + addRow("Server engine version", servletVersion, + servletOk ? null : ERROR_STYLE); addRow("Theme version", themeVersion, themeOk ? null : ERROR_STYLE); if (jsVersion != null) { addRow("Push server version", atmosphereVersion); @@ -225,7 +225,7 @@ public class InfoSection implements Section { /** * Checks if the target value equals one of the reference values - * + * * @param target * The value to compare * @param reference1 @@ -249,7 +249,7 @@ public class InfoSection implements Section { /** * Finds out the version of the current theme (i.e. the version of Vaadin * used to compile it) - * + * * @since 7.1 * @return The full version as a string */ @@ -279,7 +279,7 @@ public class InfoSection implements Section { /** * Removes all content - * + * * @since 7.1 */ private void clear() { @@ -288,7 +288,7 @@ public class InfoSection implements Section { /* * (non-Javadoc) - * + * * @see com.vaadin.client.debug.internal.Section#hide() */ @Override @@ -298,7 +298,7 @@ public class InfoSection implements Section { /* * (non-Javadoc) - * + * * @see com.vaadin.client.debug.internal.Section#meta(com.vaadin.client. * ApplicationConnection, com.vaadin.client.ValueMap) */ @@ -309,7 +309,7 @@ public class InfoSection implements Section { /* * (non-Javadoc) - * + * * @see com.vaadin.client.debug.internal.Section#uidl(com.vaadin.client. * ApplicationConnection, com.vaadin.client.ValueMap) */ diff --git a/client/src/main/java/com/vaadin/client/debug/internal/LogSection.java b/client/src/main/java/com/vaadin/client/debug/internal/LogSection.java index 30abb4fff9..f4881efb95 100644 --- a/client/src/main/java/com/vaadin/client/debug/internal/LogSection.java +++ b/client/src/main/java/com/vaadin/client/debug/internal/LogSection.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -40,7 +40,7 @@ import com.vaadin.client.ValueMap; *

    * Scroll lock state is persisted. *

    - * + * * @since 7.1 * @author Vaadin Ltd */ @@ -61,7 +61,8 @@ public class LogSection implements Section { } @Override - protected String getRecordInfo(LogRecord event, String newline) { + protected String getRecordInfo(LogRecord event, + String newline) { return ""; } }); @@ -157,8 +158,8 @@ public class LogSection implements Section { public void onClick(ClickEvent event) { Element el = Element .as(event.getNativeEvent().getEventTarget()); - while (!el.getClassName().contains( - VDebugWindow.STYLENAME + "-message")) { + while (!el.getClassName() + .contains(VDebugWindow.STYLENAME + "-message")) { if (el == contentElement) { // clicked something else return; @@ -188,7 +189,7 @@ public class LogSection implements Section { /** * Activates or deactivates scroll lock - * + * * @param locked */ void setScrollLock(boolean locked) { @@ -242,7 +243,7 @@ public class LogSection implements Section { /** * Sets the log row limit. - * + * * @param limit */ public void setLimit(int limit) { @@ -254,7 +255,7 @@ public class LogSection implements Section { /** * Gets the current log row limit. - * + * * @return */ public int getLimit() { @@ -319,7 +320,7 @@ public class LogSection implements Section { /** * Adds a row to the log, applies the log row limit by removing old rows if * needed, and scrolls new row into view if scroll lock is not active. - * + * * @param level * @param msg * @return @@ -336,8 +337,8 @@ public class LogSection implements Section { + "'>" - + sinceReset + "ms" + msg + ""; + + sinceReset + "ms" + msg + ""; row.setInnerHTML(inner); contentElement.appendChild(row); diff --git a/client/src/main/java/com/vaadin/client/debug/internal/NetworkSection.java b/client/src/main/java/com/vaadin/client/debug/internal/NetworkSection.java index 5b0579238f..23d7883c05 100644 --- a/client/src/main/java/com/vaadin/client/debug/internal/NetworkSection.java +++ b/client/src/main/java/com/vaadin/client/debug/internal/NetworkSection.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -24,9 +24,9 @@ import com.vaadin.client.ValueMap; /** * Displays network activity; requests and responses. - * + * * Currently only displays responses in a simple manner. - * + * * @since 7.1 * @author Vaadin Ltd */ @@ -84,8 +84,8 @@ public class NetworkSection implements Section { VUIDLBrowser vuidlBrowser = new VUIDLBrowser(uidl, ac); vuidlBrowser.addStyleName(VDebugWindow.STYLENAME + "-row"); vuidlBrowser.setText("Response @ " + sinceReset + "ms"); - vuidlBrowser.setTitle(VDebugWindow.getTimingTooltip(sinceStart, - sinceReset)); + vuidlBrowser.setTitle( + VDebugWindow.getTimingTooltip(sinceStart, sinceReset)); vuidlBrowser.close(); content.add(vuidlBrowser); diff --git a/client/src/main/java/com/vaadin/client/debug/internal/OptimizedWidgetsetPanel.java b/client/src/main/java/com/vaadin/client/debug/internal/OptimizedWidgetsetPanel.java index d9aad9e61b..4654421361 100644 --- a/client/src/main/java/com/vaadin/client/debug/internal/OptimizedWidgetsetPanel.java +++ b/client/src/main/java/com/vaadin/client/debug/internal/OptimizedWidgetsetPanel.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -29,7 +29,7 @@ import com.vaadin.client.ui.UnknownComponentConnector; /** * Optimized widgetset view panel of the debug window. - * + * * @since 7.1.4 */ public class OptimizedWidgetsetPanel extends FlowPanel { @@ -95,8 +95,8 @@ public class OptimizedWidgetsetPanel extends FlowPanel { tag++; if (tag > 10000) { // Sanity check - getLogger() - .severe("Search for used connector classes was forcefully terminated"); + getLogger().severe( + "Search for used connector classes was forcefully terminated"); break; } } diff --git a/client/src/main/java/com/vaadin/client/debug/internal/ProfilerSection.java b/client/src/main/java/com/vaadin/client/debug/internal/ProfilerSection.java index 2851563884..3c542dbe69 100644 --- a/client/src/main/java/com/vaadin/client/debug/internal/ProfilerSection.java +++ b/client/src/main/java/com/vaadin/client/debug/internal/ProfilerSection.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -36,10 +36,10 @@ import com.vaadin.client.ValueMap; /** * Debug window section for investigating {@link Profiler} data. This section is * only visible if the profiler is enabled ({@link Profiler#isEnabled()}). - * + * * @since 7.1 * @author Vaadin Ltd - * + * * @see Profiler */ public class ProfilerSection implements Section { @@ -69,13 +69,13 @@ public class ProfilerSection implements Section { SimpleTree offendersTree = new SimpleTree("Longest events"); for (int i = 0; i < totals.size() && i < 20; i++) { Node node = totals.get(i); - offendersTree.add(new Label(node - .getStringRepresentation(""))); + offendersTree + .add(new Label(node.getStringRepresentation(""))); } - SimpleTree root = new SimpleTree(eventCount - + " profiler events using " + Util.round(totalTime, 3) - + " ms"); + SimpleTree root = new SimpleTree( + eventCount + " profiler events using " + + Util.round(totalTime, 3) + " ms"); root.add(drillDownTree); root.add(offendersTree); root.open(false); @@ -85,12 +85,14 @@ public class ProfilerSection implements Section { } @Override - public void addBootstrapData(LinkedHashMap timings) { + public void addBootstrapData( + LinkedHashMap timings) { SimpleTree tree = new SimpleTree( "Time since window.performance.timing events"); Set> entrySet = timings.entrySet(); for (Entry entry : entrySet) { - tree.add(new Label(entry.getValue() + " " + entry.getKey())); + tree.add( + new Label(entry.getValue() + " " + entry.getKey())); } tree.open(false); diff --git a/client/src/main/java/com/vaadin/client/debug/internal/Section.java b/client/src/main/java/com/vaadin/client/debug/internal/Section.java index 876b9bbc27..e9e0fbf08f 100644 --- a/client/src/main/java/com/vaadin/client/debug/internal/Section.java +++ b/client/src/main/java/com/vaadin/client/debug/internal/Section.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,7 +21,7 @@ import com.vaadin.client.ValueMap; /** * A Section is displayed as a tab in the {@link VDebugWindow}. - * + * * @since 7.1 * @author Vaadin Ltd */ @@ -31,13 +31,14 @@ public interface Section { * Returns a button that will be used to activate this section, displayed as * a tab in {@link VDebugWindow}. *

    - * The same instance must be returned each time this method is called. + * The same instance must be returned each time this method is + * called. *

    *

    * The button should preferably only have an icon (no caption), and should * have a longer description as title (tooltip). *

    - * + * * @return section id */ public DebugButton getTabButton(); @@ -45,7 +46,7 @@ public interface Section { /** * Returns a widget that is placed on top of the Section content when the * Section (tab) is active in the {@link VDebugWindow}. - * + * * @return section controls */ public Widget getControls(); @@ -53,7 +54,7 @@ public interface Section { /** * Returns a widget that is the main content of the section, displayed when * the section is active in the {@link VDebugWindow}. - * + * * @return */ public Widget getContent(); diff --git a/client/src/main/java/com/vaadin/client/debug/internal/SelectConnectorListener.java b/client/src/main/java/com/vaadin/client/debug/internal/SelectConnectorListener.java index 46c8070b30..91d88a3874 100644 --- a/client/src/main/java/com/vaadin/client/debug/internal/SelectConnectorListener.java +++ b/client/src/main/java/com/vaadin/client/debug/internal/SelectConnectorListener.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,14 +20,14 @@ import com.vaadin.client.ServerConnector; /** * Listener for the selection of a connector in the debug window. - * + * * @since 7.1.4 */ public interface SelectConnectorListener { /** * Listener method called when a connector has been selected. If a specific * element of the connector was selected, it is also given. - * + * * @param connector * selected connector * @param element diff --git a/client/src/main/java/com/vaadin/client/debug/internal/SelectorPath.java b/client/src/main/java/com/vaadin/client/debug/internal/SelectorPath.java index 3f21e46a96..68002abc85 100644 --- a/client/src/main/java/com/vaadin/client/debug/internal/SelectorPath.java +++ b/client/src/main/java/com/vaadin/client/debug/internal/SelectorPath.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -31,7 +31,7 @@ import com.vaadin.client.componentlocator.SelectorPredicate; * This class should be considered internal to the framework and may change at * any time. *

    - * + * * @since 7.1.x */ public class SelectorPath { @@ -67,7 +67,7 @@ public class SelectorPath { /** * Generate ElementQuery code for Java. Fallback to By.vaadin(path) if * dealing with LegacyLocator - * + * * @return String containing Java code for finding the element described by * path */ @@ -131,7 +131,7 @@ public class SelectorPath { /** * Finds out if the given query fragment has a defined id - * + * * @param fragment * Query fragment * @return true if has id @@ -148,7 +148,7 @@ public class SelectorPath { /** * Generates a recursive ElementQuery for given path fragment - * + * * @param fragment * Query fragment * @return ElementQuery java code as a String @@ -169,7 +169,7 @@ public class SelectorPath { /** * Returns the name of the component described by given query fragment - * + * * @param fragment * Query fragment * @return Class part of fragment @@ -180,7 +180,7 @@ public class SelectorPath { /** * Generates a legacy locator for SelectorPath. - * + * * @return String containing Java code for element search and assignment */ private String getLegacyLocatorQuery() { @@ -206,7 +206,7 @@ public class SelectorPath { /** * Get variable name with counter for given component name. - * + * * @param name * Component name * @return name followed by count @@ -222,7 +222,7 @@ public class SelectorPath { /** * Generate Java variable assignment from given selector fragment - * + * * @param pathFragment * Selector fragment * @return piece of java code @@ -248,7 +248,7 @@ public class SelectorPath { /** * Get variable name based on predicates. Fallback to elementType - * + * * @param predicates * Predicates related to element * @param elementType diff --git a/client/src/main/java/com/vaadin/client/debug/internal/TestBenchSection.java b/client/src/main/java/com/vaadin/client/debug/internal/TestBenchSection.java index d0b6b10722..665c44325f 100644 --- a/client/src/main/java/com/vaadin/client/debug/internal/TestBenchSection.java +++ b/client/src/main/java/com/vaadin/client/debug/internal/TestBenchSection.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -45,7 +45,7 @@ import com.vaadin.client.WidgetUtil; /** * Provides functionality for picking selectors for Vaadin TestBench. - * + * * @since 7.1.x * @author Vaadin Ltd */ @@ -54,8 +54,8 @@ public class TestBenchSection implements Section { /** * Selector widget showing a selector in a program-usable form. */ - private static class SelectorWidget extends HTML implements - MouseOverHandler, MouseOutHandler { + private static class SelectorWidget extends HTML + implements MouseOverHandler, MouseOutHandler { private final SelectorPath path; public SelectorWidget(final SelectorPath path) { @@ -197,9 +197,9 @@ public class TestBenchSection implements Section { private void pickSelector(ServerConnector connector, Element element) { - SelectorPath p = new SelectorPath(connector, Util - .findPaintable(connector.getConnection(), element).getWidget() - .getElement()); + SelectorPath p = new SelectorPath(connector, + Util.findPaintable(connector.getConnection(), element) + .getWidget().getElement()); SelectorWidget w = new SelectorWidget(p); content.add(w); @@ -210,17 +210,17 @@ public class TestBenchSection implements Section { @Override public void onPreviewNativeEvent(NativePreviewEvent event) { - if (event.getTypeInt() == Event.ONKEYDOWN - && event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ESCAPE) { + if (event.getTypeInt() == Event.ONKEYDOWN && event.getNativeEvent() + .getKeyCode() == KeyCodes.KEY_ESCAPE) { stopFind(); Highlight.hideAll(); return; } if (event.getTypeInt() == Event.ONMOUSEMOVE || event.getTypeInt() == Event.ONCLICK) { - Element eventTarget = WidgetUtil.getElementFromPoint(event - .getNativeEvent().getClientX(), event.getNativeEvent() - .getClientY()); + Element eventTarget = WidgetUtil.getElementFromPoint( + event.getNativeEvent().getClientX(), + event.getNativeEvent().getClientY()); if (VDebugWindow.get().getElement().isOrHasChild(eventTarget)) { if (isFindMode() && event.getTypeInt() == Event.ONCLICK) { stopFind(); @@ -232,9 +232,9 @@ public class TestBenchSection implements Section { // make sure that not finding the highlight element only Highlight.hideAll(); - eventTarget = WidgetUtil.getElementFromPoint(event - .getNativeEvent().getClientX(), event.getNativeEvent() - .getClientY()); + eventTarget = WidgetUtil.getElementFromPoint( + event.getNativeEvent().getClientX(), + event.getNativeEvent().getClientY()); ComponentConnector connector = findConnector(eventTarget); if (event.getTypeInt() == Event.ONMOUSEMOVE) { @@ -264,8 +264,8 @@ public class TestBenchSection implements Section { private ComponentConnector findConnector(Element element) { for (ApplicationConnection a : ApplicationConfiguration .getRunningApplications()) { - ComponentConnector connector = Util.getConnectorForElement(a, a - .getUIConnector().getWidget(), element); + ComponentConnector connector = Util.getConnectorForElement(a, + a.getUIConnector().getWidget(), element); if (connector == null) { connector = Util.getConnectorForElement(a, RootPanel.get(), element); diff --git a/client/src/main/java/com/vaadin/client/debug/internal/VDebugWindow.java b/client/src/main/java/com/vaadin/client/debug/internal/VDebugWindow.java index fbc838f861..800e64f9f7 100644 --- a/client/src/main/java/com/vaadin/client/debug/internal/VDebugWindow.java +++ b/client/src/main/java/com/vaadin/client/debug/internal/VDebugWindow.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -58,7 +58,7 @@ import com.vaadin.client.ui.VOverlay; /** * Debug window implementation. - * + * * @since 7.1 * @author Vaadin Ltd */ @@ -235,7 +235,7 @@ public final class VDebugWindow extends VOverlay { /** * Adds dummy handle elements to the bottom corners that might have * scrollbars that interfere with resizing on some platforms. - * + * * @since 7.1 */ private void addHandles() { @@ -252,7 +252,7 @@ public final class VDebugWindow extends VOverlay { /** * Gets the {@link #VDebugWindow()} singleton instance. - * + * * @return */ public static VDebugWindow get() { @@ -337,7 +337,7 @@ public final class VDebugWindow extends VOverlay { /** * Writes the given value to the given {@link Storage} using the given key * (automatically prefixed with {@value #STORAGE_PREFIX}). - * + * * @param storage * @param key * @param value @@ -351,7 +351,7 @@ public final class VDebugWindow extends VOverlay { * {@value #STORAGE_PREFIX}) as an int from the given {@link Storage}, * returning the given default value instead if not successful (e.g missing * item). - * + * * @param storage * @param key * @param def @@ -370,7 +370,7 @@ public final class VDebugWindow extends VOverlay { * {@value #STORAGE_PREFIX}) as a boolean from the given {@link Storage}, * returning the given default value instead if not successful (e.g missing * item). - * + * * @param storage * @param key * @param def @@ -389,7 +389,7 @@ public final class VDebugWindow extends VOverlay { * {@value #STORAGE_PREFIX}) as a String from the given {@link Storage}, * returning the given default value instead if not successful (e.g missing * item). - * + * * @param storage * @param key * @param def @@ -422,7 +422,7 @@ public final class VDebugWindow extends VOverlay { /** * Removes the item with the given key (automatically prefixed with * {@value #STORAGE_PREFIX}) from the given {@link Storage}. - * + * * @param storage * @param key */ @@ -433,10 +433,10 @@ public final class VDebugWindow extends VOverlay { /** * Applies the appropriate instance variables for width, height, x, y * depending on if the window is minimized or not. - * + * * If the value is negative, the window is positioned that amount of pixels * from the right/bottom instead of left/top. - * + * * Finally, the position is bounds-checked so that the window is not moved * off-screen (the adjusted values are not saved). */ @@ -528,7 +528,7 @@ public final class VDebugWindow extends VOverlay { * Adds the given {@link Section} as a tab in the {@link VDebugWindow} UI. * {@link Section#getTabButton()} is called to obtain a button which is used * tab. - * + * * @param section */ public void addSection(final Section section) { @@ -551,7 +551,7 @@ public final class VDebugWindow extends VOverlay { /** * Activates the given {@link Section} - * + * * @param section */ void activateSection(Section section) { @@ -597,7 +597,7 @@ public final class VDebugWindow extends VOverlay { /** * Sets whether or not the window is minimized. - * + * * @param minimized */ private void setMinimized(boolean minimized) { @@ -613,7 +613,7 @@ public final class VDebugWindow extends VOverlay { /** * Sets the font size in use. - * + * * @param size */ private void setFontSize(int size) { @@ -624,7 +624,7 @@ public final class VDebugWindow extends VOverlay { /** * Gets the font size currently in use. - * + * * @return */ private int getFontSize() { @@ -633,7 +633,7 @@ public final class VDebugWindow extends VOverlay { /** * Gets the milliseconds since application start. - * + * * @return */ static int getMillisSinceStart() { @@ -642,7 +642,7 @@ public final class VDebugWindow extends VOverlay { /** * Gets the milliseconds since last {@link #resetTimer()} call. - * + * * @return */ static int getMillisSinceReset() { @@ -651,7 +651,7 @@ public final class VDebugWindow extends VOverlay { /** * Resets the timer. - * + * * @return Milliseconds elapsed since the timer was last reset. */ static int resetTimer() { @@ -663,7 +663,7 @@ public final class VDebugWindow extends VOverlay { /** * Gets a nicely formatted string with timing information suitable for * display in tooltips. - * + * * @param sinceStart * @param sinceReset * @return @@ -679,7 +679,7 @@ public final class VDebugWindow extends VOverlay { /** * Formats the given milliseconds as hours, minutes, seconds and * milliseconds. - * + * * @param ms * @return */ @@ -710,29 +710,30 @@ public final class VDebugWindow extends VOverlay { public void execute() { readStoredState(); - Window.addResizeHandler(new com.google.gwt.event.logical.shared.ResizeHandler() { - - Timer t = new Timer() { - @Override - public void run() { - applyPositionAndSize(); - } - }; - - @Override - public void onResize(ResizeEvent event) { - t.cancel(); - // TODO less - t.schedule(1000); - } - }); + Window.addResizeHandler( + new com.google.gwt.event.logical.shared.ResizeHandler() { + + Timer t = new Timer() { + @Override + public void run() { + applyPositionAndSize(); + } + }; + + @Override + public void onResize(ResizeEvent event) { + t.cancel(); + // TODO less + t.schedule(1000); + } + }); } }); } /** * Called when the result from analyzeLayouts is received. - * + * * @param ac * @param meta */ @@ -747,7 +748,7 @@ public final class VDebugWindow extends VOverlay { /** * Called when a response is received - * + * * @param ac * @param uidl */ @@ -764,7 +765,7 @@ public final class VDebugWindow extends VOverlay { * Gets the container element for this window. The debug window is always * global to the document and not related to any * {@link ApplicationConnection} in particular. - * + * * @return The global overlay container element. */ @Override @@ -778,7 +779,7 @@ public final class VDebugWindow extends VOverlay { /** * Popup menu for {@link VDebugWindow}. - * + * * @since 7.1 * @author Vaadin Ltd */ @@ -793,7 +794,8 @@ public final class VDebugWindow extends VOverlay { DebugButton[] modes = new DebugButton[] { new DebugButton(Icon.DEVMODE_OFF, "Debug only (causes page reload)"), - new DebugButton(Icon.DEVMODE_ON, "DevMode (causes page reload)"), + new DebugButton(Icon.DEVMODE_ON, + "DevMode (causes page reload)"), new DebugButton(Icon.DEVMODE_SUPER, "SuperDevMode (causes page reload)") }; @@ -907,7 +909,7 @@ public final class VDebugWindow extends VOverlay { /** * Handler for resizing and moving window, also updates cursor on mousemove. - * + * * @since 7.1 * @author Vaadin Ltd */ diff --git a/client/src/main/java/com/vaadin/client/debug/internal/theme/DebugWindowStyles.java b/client/src/main/java/com/vaadin/client/debug/internal/theme/DebugWindowStyles.java index 249b24a938..61c35a8f4f 100644 --- a/client/src/main/java/com/vaadin/client/debug/internal/theme/DebugWindowStyles.java +++ b/client/src/main/java/com/vaadin/client/debug/internal/theme/DebugWindowStyles.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/event/PointerCancelEvent.java b/client/src/main/java/com/vaadin/client/event/PointerCancelEvent.java index 906a07b120..d8e44b7f00 100644 --- a/client/src/main/java/com/vaadin/client/event/PointerCancelEvent.java +++ b/client/src/main/java/com/vaadin/client/event/PointerCancelEvent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -19,7 +19,7 @@ import com.google.gwt.event.dom.client.DomEvent; /** * Represents a native PointerCancelEvent. - * + * * @since 7.2 */ public class PointerCancelEvent extends PointerEvent { @@ -34,7 +34,7 @@ public class PointerCancelEvent extends PointerEvent { /** * Gets the event type associated with pointer cancel events. - * + * * @return the handler type */ public static Type getType() { diff --git a/client/src/main/java/com/vaadin/client/event/PointerCancelHandler.java b/client/src/main/java/com/vaadin/client/event/PointerCancelHandler.java index fa2210b73c..334a99a7f2 100644 --- a/client/src/main/java/com/vaadin/client/event/PointerCancelHandler.java +++ b/client/src/main/java/com/vaadin/client/event/PointerCancelHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -19,14 +19,14 @@ import com.google.gwt.event.shared.EventHandler; /** * Handler interface for {@link PointerCancelEvent} events. - * + * * @since 7.2 */ public interface PointerCancelHandler extends EventHandler { /** * Called when PointerCancelEvent is fired. - * + * * @param event * the {@link PointerCancelEvent} that was fired */ diff --git a/client/src/main/java/com/vaadin/client/event/PointerDownEvent.java b/client/src/main/java/com/vaadin/client/event/PointerDownEvent.java index eeae9891f2..37809e6a39 100644 --- a/client/src/main/java/com/vaadin/client/event/PointerDownEvent.java +++ b/client/src/main/java/com/vaadin/client/event/PointerDownEvent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -19,7 +19,7 @@ import com.google.gwt.event.dom.client.DomEvent; /** * Represents a native PointerDownEvent. - * + * * @since 7.2 */ public class PointerDownEvent extends PointerEvent { @@ -33,7 +33,7 @@ public class PointerDownEvent extends PointerEvent { /** * Gets the event type associated with PointerDownEvent events. - * + * * @return the handler type */ public static Type getType() { diff --git a/client/src/main/java/com/vaadin/client/event/PointerDownHandler.java b/client/src/main/java/com/vaadin/client/event/PointerDownHandler.java index dfd9a358eb..e9ab0ff3e6 100644 --- a/client/src/main/java/com/vaadin/client/event/PointerDownHandler.java +++ b/client/src/main/java/com/vaadin/client/event/PointerDownHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -19,14 +19,14 @@ import com.google.gwt.event.shared.EventHandler; /** * Handler interface for {@link PointerDownEvent} events. - * + * * @since 7.2 */ public interface PointerDownHandler extends EventHandler { /** * Called when PointerDownEvent is fired. - * + * * @param event * the {@link PointerDownEvent} that was fired */ diff --git a/client/src/main/java/com/vaadin/client/event/PointerEvent.java b/client/src/main/java/com/vaadin/client/event/PointerEvent.java index 71e73f945c..d91168ff53 100644 --- a/client/src/main/java/com/vaadin/client/event/PointerEvent.java +++ b/client/src/main/java/com/vaadin/client/event/PointerEvent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,14 +21,14 @@ import com.google.gwt.event.shared.EventHandler; /** * Abstract class representing Pointer events. - * + * * @param * handler type - * + * * @since 7.2 */ -public abstract class PointerEvent extends - MouseEvent { +public abstract class PointerEvent + extends MouseEvent { enum EventType { PointerDown, PointerMove, PointerOut, PointerOver, PointerUp, PointerCancel; @@ -46,7 +46,7 @@ public abstract class PointerEvent extends /** * Gets a unique identifier for the pointer that caused this event. The * identifiers of previously active but retired pointers may be recycled. - * + * * @return unique pointer id */ public final int getPointerId() { @@ -55,7 +55,7 @@ public abstract class PointerEvent extends /** * Gets the width of the contact geometry of the pointer in CSS pixels. - * + * * @return width in CSS pixels */ public final int getWidth() { @@ -64,7 +64,7 @@ public abstract class PointerEvent extends /** * Gets the height of the contact geometry of the pointer in CSS pixels. - * + * * @return height in CSS pixels. */ public final int getHeight() { @@ -74,7 +74,7 @@ public abstract class PointerEvent extends /** * Gets the pressure of the pointer input as a value in the range of [0, 1] * where 0 and 1 represent the minimum and maximum, respectively. - * + * * @return input pressure as a value between 0 and 1 */ public final double getPressure() { @@ -84,7 +84,7 @@ public abstract class PointerEvent extends /** * Gets the angle between the Y-Z plane and the plane containing both the * transducer and the Y axis. A positive tilt is to the right. - * + * * @return the tilt along the X axis as degrees in the range of [-90, 90], * or 0 if the device does not support tilt */ @@ -95,7 +95,7 @@ public abstract class PointerEvent extends /** * Gets the angle between the X-Z plane and the plane containing both the * transducer and the X axis. A positive tilt is towards the user. - * + * * @return the tilt along the Y axis as degrees in the range of [-90, 90], * or 0 if the device does not support tilt */ @@ -105,12 +105,12 @@ public abstract class PointerEvent extends /** * Gets the type of the pointer device that caused this event. - * + * * @see PointerEvent#TYPE_UNKNOWN * @see PointerEvent#TYPE_TOUCH * @see PointerEvent#TYPE_PEN * @see PointerEvent#TYPE_MOUSE - * + * * @return a String indicating the type of the pointer device */ public final String getPointerType() { @@ -119,7 +119,7 @@ public abstract class PointerEvent extends /** * Indicates whether the pointer is the primary pointer of this type. - * + * * @return true if the pointer is the primary pointer, otherwise false */ public final boolean isPrimary() { diff --git a/client/src/main/java/com/vaadin/client/event/PointerEventSupport.java b/client/src/main/java/com/vaadin/client/event/PointerEventSupport.java index 99d73745c5..70f13c80fa 100644 --- a/client/src/main/java/com/vaadin/client/event/PointerEventSupport.java +++ b/client/src/main/java/com/vaadin/client/event/PointerEventSupport.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,7 +21,7 @@ import com.vaadin.client.event.PointerEvent.EventType; /** * Main class for pointer event support. Contains functionality for determining * if pointer events are available or not. - * + * * @since 7.2 * @author Vaadin Ltd */ diff --git a/client/src/main/java/com/vaadin/client/event/PointerEventSupportImpl.java b/client/src/main/java/com/vaadin/client/event/PointerEventSupportImpl.java index 7605104ade..1dcd65a159 100644 --- a/client/src/main/java/com/vaadin/client/event/PointerEventSupportImpl.java +++ b/client/src/main/java/com/vaadin/client/event/PointerEventSupportImpl.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,7 +20,7 @@ import com.vaadin.client.event.PointerEvent.EventType; /** * Main pointer event support implementation class. Made for browser without * pointer event support. - * + * * @since 7.2 * @author Vaadin Ltd */ diff --git a/client/src/main/java/com/vaadin/client/event/PointerEventSupportImplIE10.java b/client/src/main/java/com/vaadin/client/event/PointerEventSupportImplIE10.java index 1de2f9722f..bb824c6b6c 100644 --- a/client/src/main/java/com/vaadin/client/event/PointerEventSupportImplIE10.java +++ b/client/src/main/java/com/vaadin/client/event/PointerEventSupportImplIE10.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -19,12 +19,12 @@ import com.vaadin.client.event.PointerEvent.EventType; /** * Pointer event support class for IE 10 ("ms" prefixed pointer events) - * + * * @since 7.2 * @author Vaadin Ltd */ -public class PointerEventSupportImplIE10 extends - PointerEventSupportImplModernIE { +public class PointerEventSupportImplIE10 + extends PointerEventSupportImplModernIE { @Override public String getNativeEventName(EventType eventName) { diff --git a/client/src/main/java/com/vaadin/client/event/PointerEventSupportImplModernIE.java b/client/src/main/java/com/vaadin/client/event/PointerEventSupportImplModernIE.java index 851c600bcb..554a5ee2a8 100644 --- a/client/src/main/java/com/vaadin/client/event/PointerEventSupportImplModernIE.java +++ b/client/src/main/java/com/vaadin/client/event/PointerEventSupportImplModernIE.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,7 +21,7 @@ import com.vaadin.client.event.PointerEvent.EventType; /** * Pointer event support class for IE 11+ (unprefixed pointer events) - * + * * @since 7.2 * @author Vaadin Ltd */ @@ -50,8 +50,8 @@ public class PointerEventSupportImplModernIE extends PointerEventSupportImpl { } DOMImplStandard .addBitlessEventDispatchers(eventDispatcherMapExtensions); - DOMImplStandard - .addCaptureEventDispatchers(captureEventDispatcherMapExtensions); + DOMImplStandard.addCaptureEventDispatchers( + captureEventDispatcherMapExtensions); inited = true; } diff --git a/client/src/main/java/com/vaadin/client/event/PointerMoveEvent.java b/client/src/main/java/com/vaadin/client/event/PointerMoveEvent.java index 6a4a81e17d..e109f02fc0 100644 --- a/client/src/main/java/com/vaadin/client/event/PointerMoveEvent.java +++ b/client/src/main/java/com/vaadin/client/event/PointerMoveEvent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -19,7 +19,7 @@ import com.google.gwt.event.dom.client.DomEvent; /** * Represents a native PointerMoveEvent event. - * + * * @since 7.2 */ public class PointerMoveEvent extends PointerEvent { @@ -33,7 +33,7 @@ public class PointerMoveEvent extends PointerEvent { /** * Gets the event type associated with PointerMoveEvent. - * + * * @return the handler type */ public static Type getType() { diff --git a/client/src/main/java/com/vaadin/client/event/PointerMoveHandler.java b/client/src/main/java/com/vaadin/client/event/PointerMoveHandler.java index ad6a93da8d..4d966a0f27 100644 --- a/client/src/main/java/com/vaadin/client/event/PointerMoveHandler.java +++ b/client/src/main/java/com/vaadin/client/event/PointerMoveHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -19,14 +19,14 @@ import com.google.gwt.event.shared.EventHandler; /** * Handler interface for {@link PointerMoveEvent} events. - * + * * @since 7.2 */ public interface PointerMoveHandler extends EventHandler { /** * Called when PointerMoveEvent is fired. - * + * * @param event * the {@link PointerMoveEvent} that was fired */ diff --git a/client/src/main/java/com/vaadin/client/event/PointerUpEvent.java b/client/src/main/java/com/vaadin/client/event/PointerUpEvent.java index 005902d7f7..5b848bbb6c 100644 --- a/client/src/main/java/com/vaadin/client/event/PointerUpEvent.java +++ b/client/src/main/java/com/vaadin/client/event/PointerUpEvent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -19,7 +19,7 @@ import com.google.gwt.event.dom.client.DomEvent; /** * Represents a native PointerUpEvent. - * + * * @since 7.2 */ public class PointerUpEvent extends PointerEvent { @@ -33,7 +33,7 @@ public class PointerUpEvent extends PointerEvent { /** * Gets the event type associated with PointerUpEvent. - * + * * @return the handler type */ public static Type getType() { diff --git a/client/src/main/java/com/vaadin/client/event/PointerUpHandler.java b/client/src/main/java/com/vaadin/client/event/PointerUpHandler.java index 587b249634..01db75cdb5 100644 --- a/client/src/main/java/com/vaadin/client/event/PointerUpHandler.java +++ b/client/src/main/java/com/vaadin/client/event/PointerUpHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -19,14 +19,14 @@ import com.google.gwt.event.shared.EventHandler; /** * Handler interface for {@link PointerUpEvent} events. - * + * * @since 7.2 */ public interface PointerUpHandler extends EventHandler { /** * Called when PointerUpEvent is fired. - * + * * @param event * the {@link PointerUpEvent} that was fired */ diff --git a/client/src/main/java/com/vaadin/client/extensions/AbstractExtensionConnector.java b/client/src/main/java/com/vaadin/client/extensions/AbstractExtensionConnector.java index 79eaa2f8b9..6bd91d932a 100644 --- a/client/src/main/java/com/vaadin/client/extensions/AbstractExtensionConnector.java +++ b/client/src/main/java/com/vaadin/client/extensions/AbstractExtensionConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -45,7 +45,7 @@ public abstract class AbstractExtensionConnector extends AbstractConnector { /** * Called when the extension is attached to its parent. This method is only * called once as an extension cannot be moved from one parent to another. - * + * * @param target * The connector this extension extends */ diff --git a/client/src/main/java/com/vaadin/client/extensions/BrowserWindowOpenerConnector.java b/client/src/main/java/com/vaadin/client/extensions/BrowserWindowOpenerConnector.java index 11e3e80a14..364718bcc6 100644 --- a/client/src/main/java/com/vaadin/client/extensions/BrowserWindowOpenerConnector.java +++ b/client/src/main/java/com/vaadin/client/extensions/BrowserWindowOpenerConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -32,7 +32,7 @@ import com.vaadin.shared.util.SharedUtil; /** * Client-side code for {@link BrowserWindowOpener} - * + * * @author Vaadin Ltd * @since 7.0.0 */ @@ -68,7 +68,8 @@ public class BrowserWindowOpenerConnector extends AbstractExtensionConnector if (!getState().parameters.isEmpty()) { StringBuilder params = new StringBuilder(); - for (Entry entry : getState().parameters.entrySet()) { + for (Entry entry : getState().parameters + .entrySet()) { if (params.length() != 0) { params.append('&'); } diff --git a/client/src/main/java/com/vaadin/client/extensions/FileDownloaderConnector.java b/client/src/main/java/com/vaadin/client/extensions/FileDownloaderConnector.java index bed6622a6c..431991e886 100644 --- a/client/src/main/java/com/vaadin/client/extensions/FileDownloaderConnector.java +++ b/client/src/main/java/com/vaadin/client/extensions/FileDownloaderConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/extensions/ResponsiveConnector.java b/client/src/main/java/com/vaadin/client/extensions/ResponsiveConnector.java index ae330be8f4..864a948a1e 100644 --- a/client/src/main/java/com/vaadin/client/extensions/ResponsiveConnector.java +++ b/client/src/main/java/com/vaadin/client/extensions/ResponsiveConnector.java @@ -4,9 +4,9 @@ * Licensed under the Apache 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 @@ -34,14 +34,14 @@ import com.vaadin.shared.util.SharedUtil; /** * The client side connector for the Responsive extension. - * + * * @author Vaadin Ltd * @since 7.2 */ @SuppressWarnings("GwtInconsistentSerializableClass") @Connect(Responsive.class) -public class ResponsiveConnector extends AbstractExtensionConnector implements - ElementResizeListener { +public class ResponsiveConnector extends AbstractExtensionConnector + implements ElementResizeListener { /** * The target component which we will monitor for width changes @@ -99,7 +99,7 @@ public class ResponsiveConnector extends AbstractExtensionConnector implements /** * Construct the list of selectors that should be matched against in the * range selectors - * + * * @return The selectors in a comma delimited string. */ protected String constructSelectorsForTarget() { @@ -192,7 +192,7 @@ public class ResponsiveConnector extends AbstractExtensionConnector implements * Process an individual stylesheet object. Any @import statements are * handled recursively. Regular rule declarations are searched for * 'width-range' and 'height-range' attribute selectors. - * + * * @param sheet */ private static native void searchStylesheetForBreakPoints( @@ -268,7 +268,7 @@ public class ResponsiveConnector extends AbstractExtensionConnector implements // Loop all the selectors in this ruleset for(var k = 0, len2 = haystack.length; k < len2; k++) { - + // Split the haystack into parts. var widthRange = haystack[k].match(/\[width-range.*?\]/); var heightRange = haystack[k].match(/\[height-range.*?\]/); @@ -276,13 +276,13 @@ public class ResponsiveConnector extends AbstractExtensionConnector implements if (selector != null) { selector = selector[1]; - + // Check for width-ranges. if (widthRange != null) { var minMax = widthRange[0].match(/\[width-range~?=["|'](.*?)-(.*?)["|']\]/i); var min = minMax[1]; var max = minMax[2]; - + pushToCache(widthRanges, selector, min, max); } @@ -291,7 +291,7 @@ public class ResponsiveConnector extends AbstractExtensionConnector implements var minMax = heightRange[0].match(/\[height-range~?=["|'](.*?)-(.*?)["|']\]/i); var min = minMax[1]; var max = minMax[2]; - + pushToCache(heightRanges, selector, min, max); } } @@ -303,7 +303,7 @@ public class ResponsiveConnector extends AbstractExtensionConnector implements /** * Get all matching ranges from the cache for this particular instance. - * + * * @param selectors */ private native void getBreakPointsFor(final String selectors) @@ -386,8 +386,8 @@ public class ResponsiveConnector extends AbstractExtensionConnector implements // case some new styles are applied if (!currentWidthRanges.equals(oldWidthRanges) || !currentHeightRanges.equals(oldHeightRanges)) { - layoutManager - .setNeedsMeasureRecursively(ResponsiveConnector.this.target); + layoutManager.setNeedsMeasureRecursively( + ResponsiveConnector.this.target); } } @@ -395,7 +395,7 @@ public class ResponsiveConnector extends AbstractExtensionConnector implements * Forces IE8 to reinterpret CSS rules. * {@link com.vaadin.client.WidgetUtil#forceIE8Redraw(com.google.gwt.dom.client.Element)} * doesn't work in this case. - * + * * @param element * the element to redraw */ diff --git a/client/src/main/java/com/vaadin/client/extensions/javascriptmanager/JavaScriptManagerConnector.java b/client/src/main/java/com/vaadin/client/extensions/javascriptmanager/JavaScriptManagerConnector.java index 364b948573..604081c5e5 100644 --- a/client/src/main/java/com/vaadin/client/extensions/javascriptmanager/JavaScriptManagerConnector.java +++ b/client/src/main/java/com/vaadin/client/extensions/javascriptmanager/JavaScriptManagerConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -71,7 +71,7 @@ public class JavaScriptManagerConnector extends AbstractExtensionConnector { var m = this; var target = $wnd; var parts = name.split('.'); - + for(var i = 0; i < parts.length - 1; i++) { var part = parts[i]; if (target[part] === undefined) { @@ -79,7 +79,7 @@ public class JavaScriptManagerConnector extends AbstractExtensionConnector { } target = target[part]; } - + target[parts[parts.length - 1]] = $entry(function() { //Must make a copy because arguments is an array-like object (not instanceof Array), causing suboptimal JSON encoding var args = Array.prototype.slice.call(arguments, 0); @@ -94,7 +94,7 @@ public class JavaScriptManagerConnector extends AbstractExtensionConnector { /*-{ var target = $wnd; var parts = name.split('.'); - + for(var i = 0; i < parts.length - 1; i++) { var part = parts[i]; if (target[part] === undefined) { diff --git a/client/src/main/java/com/vaadin/client/metadata/AsyncBundleLoader.java b/client/src/main/java/com/vaadin/client/metadata/AsyncBundleLoader.java index 9b7f611281..174b5cb4a9 100644 --- a/client/src/main/java/com/vaadin/client/metadata/AsyncBundleLoader.java +++ b/client/src/main/java/com/vaadin/client/metadata/AsyncBundleLoader.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/metadata/BundleLoadCallback.java b/client/src/main/java/com/vaadin/client/metadata/BundleLoadCallback.java index 399ac87d4e..a3f6217142 100644 --- a/client/src/main/java/com/vaadin/client/metadata/BundleLoadCallback.java +++ b/client/src/main/java/com/vaadin/client/metadata/BundleLoadCallback.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/metadata/ConnectorBundleLoader.java b/client/src/main/java/com/vaadin/client/metadata/ConnectorBundleLoader.java index e67fee96cf..9a02912b6c 100644 --- a/client/src/main/java/com/vaadin/client/metadata/ConnectorBundleLoader.java +++ b/client/src/main/java/com/vaadin/client/metadata/ConnectorBundleLoader.java @@ -102,8 +102,8 @@ public abstract class ConnectorBundleLoader { public boolean isBundleLoaded(String bundleName) { AsyncBundleLoader loader = asyncBlockLoaders.get(bundleName); if (loader == null) { - throw new IllegalArgumentException("Bundle " + bundleName - + " not recognized"); + throw new IllegalArgumentException( + "Bundle " + bundleName + " not recognized"); } return loader.getState() == State.LOADED; } diff --git a/client/src/main/java/com/vaadin/client/metadata/InvokationHandler.java b/client/src/main/java/com/vaadin/client/metadata/InvokationHandler.java index 4faf0a1484..74dfee9cbc 100644 --- a/client/src/main/java/com/vaadin/client/metadata/InvokationHandler.java +++ b/client/src/main/java/com/vaadin/client/metadata/InvokationHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/metadata/Invoker.java b/client/src/main/java/com/vaadin/client/metadata/Invoker.java index 6e263829c0..31440e9d1a 100644 --- a/client/src/main/java/com/vaadin/client/metadata/Invoker.java +++ b/client/src/main/java/com/vaadin/client/metadata/Invoker.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/metadata/JsniInvoker.java b/client/src/main/java/com/vaadin/client/metadata/JsniInvoker.java index d6a60c89f3..fe4f613650 100644 --- a/client/src/main/java/com/vaadin/client/metadata/JsniInvoker.java +++ b/client/src/main/java/com/vaadin/client/metadata/JsniInvoker.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,7 +21,7 @@ import com.vaadin.client.JsArrayObject; /** * Special {@link Invoker} that uses JSNI to invoke methods with limited * visibility. - * + * * @since 7.2 * @author Vaadin Ltd */ @@ -39,7 +39,7 @@ public abstract class JsniInvoker implements Invoker { /** * Abstract method that will be generated to contain JSNI for invoking the * actual method. - * + * * @param target * the object upon which to invoke the method * @param params diff --git a/client/src/main/java/com/vaadin/client/metadata/Method.java b/client/src/main/java/com/vaadin/client/metadata/Method.java index 8757a9de20..dadbe90ba0 100644 --- a/client/src/main/java/com/vaadin/client/metadata/Method.java +++ b/client/src/main/java/com/vaadin/client/metadata/Method.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -48,7 +48,7 @@ public class Method { * returned string may change without notice and should not be used for any * other purpose than identification. The signature is currently based on * the declaring type's signature and the method's name. - * + * * @return the unique signature of this method */ public String getSignature() { @@ -59,9 +59,9 @@ public class Method { * Gets the string that is internally used when looking up generated support * code for this method. This is the same as {@link #getSignature()}, but * without any type parameters. - * + * * @return the string to use for looking up generated support code - * + * * @since 7.2 */ public String getLookupKey() { @@ -104,9 +104,9 @@ public class Method { /** * Checks whether this method is annotated with {@link NoLayout}. - * + * * @since 7.4 - * + * * @return true if this method has a NoLayout annotation; * otherwise false */ diff --git a/client/src/main/java/com/vaadin/client/metadata/NoDataException.java b/client/src/main/java/com/vaadin/client/metadata/NoDataException.java index 45ea67d017..415b9eb958 100644 --- a/client/src/main/java/com/vaadin/client/metadata/NoDataException.java +++ b/client/src/main/java/com/vaadin/client/metadata/NoDataException.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/metadata/OnStateChangeMethod.java b/client/src/main/java/com/vaadin/client/metadata/OnStateChangeMethod.java index 47749fcd52..bf3b0d2694 100644 --- a/client/src/main/java/com/vaadin/client/metadata/OnStateChangeMethod.java +++ b/client/src/main/java/com/vaadin/client/metadata/OnStateChangeMethod.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -26,7 +26,7 @@ import com.vaadin.client.communication.StateChangeEvent; /** * Encapsulates the data that the widgetset compiler generates for supporting a * connector method annotated with {@link OnStateChange} - * + * * @since 7.2 * @author Vaadin Ltd */ @@ -39,7 +39,7 @@ public class OnStateChangeMethod { /** * Creates a new instance based on a method name, a list of parameters names * and a list of properties to listen for. - * + * * @param methodName * the name of the method to call * @param properties @@ -55,7 +55,7 @@ public class OnStateChangeMethod { *

    * If the declaring class is null, the method is found based on * the type of the connector that fired the state change event. - * + * * @param declaringClass * the class in which the target method is declared, or * null to use the class of the connector firing the @@ -70,15 +70,15 @@ public class OnStateChangeMethod { this.methodName = methodName; - this.properties = Collections.unmodifiableList(Arrays - .asList(properties)); + this.properties = Collections + .unmodifiableList(Arrays.asList(properties)); this.declaringClass = declaringClass; } /** * Invokes the listener method for a state change. - * + * * @param stateChangeEvent * the state change event */ @@ -95,14 +95,16 @@ public class OnStateChangeMethod { try { declaringType.getMethod(methodName).invoke(connector); } catch (NoDataException e) { - throw new RuntimeException("Couldn't invoke @OnStateChange method " - + declaringType.getSignature() + "." + methodName, e); + throw new RuntimeException( + "Couldn't invoke @OnStateChange method " + + declaringType.getSignature() + "." + methodName, + e); } } /** * Gets the list of state property names to listen for. - * + * * @return the list of state property names to listen for */ public List getProperties() { diff --git a/client/src/main/java/com/vaadin/client/metadata/Property.java b/client/src/main/java/com/vaadin/client/metadata/Property.java index 90b29b32b7..a4ec8c56e4 100644 --- a/client/src/main/java/com/vaadin/client/metadata/Property.java +++ b/client/src/main/java/com/vaadin/client/metadata/Property.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -57,7 +57,7 @@ public class Property { * returned string may change without notice and should not be used for any * other purpose than identification. The signature is currently based on * the declaring type's signature and the property's name. - * + * * @return the unique signature of this property */ public String getSignature() { @@ -68,9 +68,9 @@ public class Property { * Gets the string that is internally used when looking up generated support * code for this method. This is the same as {@link #getSignature()}, but * without any type parameters. - * + * * @return the string to use for looking up generated support code - * + * * @since 7.2 */ public String getLookupKey() { @@ -105,9 +105,9 @@ public class Property { /** * Gets the property name formatted for displaying in a user interface. This - * returns a string where e.g. "camelCase" has been converted to - * "Camel case". - * + * returns a string where e.g. "camelCase" has been converted to "Camel + * case". + * * @return the name of this property, formatted for humans to read */ public String getDisplayName() { @@ -130,9 +130,9 @@ public class Property { /** * Checks whether this property is annotated with {@link NoLayout}. - * + * * @since 7.4 - * + * * @return true if this property has a NoLayout annotation; * otherwise false */ diff --git a/client/src/main/java/com/vaadin/client/metadata/ProxyHandler.java b/client/src/main/java/com/vaadin/client/metadata/ProxyHandler.java index 6fba8a8155..a9e9ada083 100644 --- a/client/src/main/java/com/vaadin/client/metadata/ProxyHandler.java +++ b/client/src/main/java/com/vaadin/client/metadata/ProxyHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/metadata/Type.java b/client/src/main/java/com/vaadin/client/metadata/Type.java index 15617ffe3c..d863bed78b 100644 --- a/client/src/main/java/com/vaadin/client/metadata/Type.java +++ b/client/src/main/java/com/vaadin/client/metadata/Type.java @@ -80,7 +80,8 @@ public class Type { return new Property(this, propertyName); } - private static String calculateSignature(String name, Type[] parameterTypes) { + private static String calculateSignature(String name, + Type[] parameterTypes) { String string = name; if (parameterTypes != null && parameterTypes.length != 0) { string += '<'; diff --git a/client/src/main/java/com/vaadin/client/metadata/TypeData.java b/client/src/main/java/com/vaadin/client/metadata/TypeData.java index 9addc4ffb2..cadbb1262c 100644 --- a/client/src/main/java/com/vaadin/client/metadata/TypeData.java +++ b/client/src/main/java/com/vaadin/client/metadata/TypeData.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/metadata/TypeDataStore.java b/client/src/main/java/com/vaadin/client/metadata/TypeDataStore.java index e3c1c8392a..a057f4aed2 100644 --- a/client/src/main/java/com/vaadin/client/metadata/TypeDataStore.java +++ b/client/src/main/java/com/vaadin/client/metadata/TypeDataStore.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -74,8 +74,8 @@ public class TypeDataStore { public static Class getClass(String identifier) throws NoDataException { Class class1 = get().identifiers.get(identifier); if (class1 == null) { - throw new NoDataException("There is not class for identifier " - + identifier); + throw new NoDataException( + "There is not class for identifier " + identifier); } return class1; } @@ -103,8 +103,8 @@ public class TypeDataStore { public static Type getReturnType(Method method) throws NoDataException { Type type = get().returnTypes.get(method.getLookupKey()); if (type == null) { - throw new NoDataException("There is no return type for " - + method.getSignature()); + throw new NoDataException( + "There is no return type for " + method.getSignature()); } return type; } @@ -112,26 +112,27 @@ public class TypeDataStore { public static Invoker getInvoker(Method method) throws NoDataException { Invoker invoker = get().invokers.get(method.getLookupKey()); if (invoker == null) { - throw new NoDataException("There is no invoker for " - + method.getSignature()); + throw new NoDataException( + "There is no invoker for " + method.getSignature()); } return invoker; } public static Invoker getConstructor(Type type) throws NoDataException { - Invoker invoker = get().invokers.get(new Method(type, CONSTRUCTOR_NAME) - .getLookupKey()); + Invoker invoker = get().invokers + .get(new Method(type, CONSTRUCTOR_NAME).getLookupKey()); if (invoker == null) { - throw new NoDataException("There is no constructor for " - + type.getSignature()); + throw new NoDataException( + "There is no constructor for " + type.getSignature()); } return invoker; } public static Object getValue(Property property, Object target) throws NoDataException { - return getJsPropertyValue(get().jsTypeData, property.getBeanType() - .getBaseTypeName(), property.getName(), target); + return getJsPropertyValue(get().jsTypeData, + property.getBeanType().getBaseTypeName(), property.getName(), + target); } public static String getDelegateToWidget(Property property) { @@ -151,8 +152,8 @@ public class TypeDataStore { Type type = getType(clazz); delegateToWidget.put(new Property(type, propertyName).getLookupKey(), delegateValue); - JsArrayString typeProperties = delegateToWidgetProperties.get(type - .getBaseTypeName()); + JsArrayString typeProperties = delegateToWidgetProperties + .get(type.getBaseTypeName()); if (typeProperties == null) { typeProperties = JavaScriptObject.createArray().cast(); delegateToWidgetProperties.put(type.getBaseTypeName(), @@ -166,7 +167,8 @@ public class TypeDataStore { getType(presentationType)); } - public void setReturnType(Class type, String methodName, Type returnType) { + public void setReturnType(Class type, String methodName, + Type returnType) { returnTypes.put(new Method(getType(type), methodName).getLookupKey(), returnType); } @@ -202,11 +204,11 @@ public class TypeDataStore { public static ProxyHandler getProxyHandler(Type type) throws NoDataException { - ProxyHandler proxyHandler = get().proxyHandlers.get(type - .getBaseTypeName()); + ProxyHandler proxyHandler = get().proxyHandlers + .get(type.getBaseTypeName()); if (proxyHandler == null) { - throw new NoDataException("No proxy handler for " - + type.getSignature()); + throw new NoDataException( + "No proxy handler for " + type.getSignature()); } return proxyHandler; } @@ -225,8 +227,8 @@ public class TypeDataStore { private static boolean hasMethodAttribute(Method method, MethodAttribute attribute) { - FastStringSet attributes = get().methodAttributes.get(method - .getLookupKey()); + FastStringSet attributes = get().methodAttributes + .get(method.getLookupKey()); return attributes != null && attributes.contains(attribute.name()); } @@ -249,7 +251,7 @@ public class TypeDataStore { * @param type * @return * @throws NoDataException - * + * * @deprecated As of 7.0.1, use {@link #getPropertiesAsArray(Type)} instead * for improved performance */ @@ -282,17 +284,20 @@ public class TypeDataStore { } public static Type getType(Property property) throws NoDataException { - return getJsPropertyType(get().jsTypeData, property.getBeanType() - .getBaseTypeName(), property.getName()); + return getJsPropertyType(get().jsTypeData, + property.getBeanType().getBaseTypeName(), property.getName()); } - public void setPropertyType(Class clazz, String propertyName, Type type) { + public void setPropertyType(Class clazz, String propertyName, + Type type) { setJsPropertyType(jsTypeData, clazz.getName(), propertyName, type); } - public static void setValue(Property property, Object target, Object value) { - setJsPropertyValue(get().jsTypeData, property.getBeanType() - .getBaseTypeName(), property.getName(), target, value); + public static void setValue(Property property, Object target, + Object value) { + setJsPropertyValue(get().jsTypeData, + property.getBeanType().getBaseTypeName(), property.getName(), + target, value); } public void setSerializerFactory(Class clazz, Invoker factory) { @@ -300,8 +305,8 @@ public class TypeDataStore { } public static JSONSerializer findSerializer(Type type) { - Invoker factoryCreator = get().serializerFactories.get(type - .getBaseTypeName()); + Invoker factoryCreator = get().serializerFactories + .get(type.getBaseTypeName()); if (factoryCreator == null) { return null; } @@ -313,8 +318,8 @@ public class TypeDataStore { } public void setSuperClass(Class baseClass, Class superClass) { - String superClassName = superClass == null ? null : superClass - .getName(); + String superClassName = superClass == null ? null + : superClass.getName(); setSuperClass(jsTypeData, baseClass.getName(), superClassName); } @@ -324,7 +329,8 @@ public class TypeDataStore { } private static native void setPropertyData(JavaScriptObject typeData, - String className, String propertyName, JavaScriptObject propertyData) + String className, String propertyName, + JavaScriptObject propertyData) /*-{ typeData[className][propertyName] = propertyData; }-*/; @@ -333,7 +339,7 @@ public class TypeDataStore { * This method sets up prototypes chain for baseClassName. * Precondition is : superClassName had to be handled before * its child baseClassName. - * + * * It makes all properties defined in the superClassName * available for baseClassName as well. */ @@ -414,7 +420,7 @@ public class TypeDataStore { /** * Gets data for all methods annotated with {@link OnStateChange} in the * given connector type. - * + * * @since 7.2 * @param type * the connector type @@ -428,7 +434,7 @@ public class TypeDataStore { /** * Adds data about a method annotated with {@link OnStateChange} for the * given connector type. - * + * * @since 7.2 * @param clazz * the connector type @@ -437,7 +443,8 @@ public class TypeDataStore { */ public void addOnStateChangeMethod(Class clazz, OnStateChangeMethod method) { - FastStringMap> handlers = getOnStateChangeMethods(clazz); + FastStringMap> handlers = getOnStateChangeMethods( + clazz); if (handlers == null) { handlers = FastStringMap.create(); onStateChangeMethods.put(getType(clazz).getSignature(), handlers); @@ -457,12 +464,12 @@ public class TypeDataStore { /** * Checks whether the provided method is annotated with {@link NoLayout}. - * + * * @param method * the rpc method to check - * + * * @since 7.4 - * + * * @return true if the method has a NoLayout annotation; * otherwise false */ @@ -472,17 +479,17 @@ public class TypeDataStore { /** * Checks whether the provided property is annotated with {@link NoLayout}. - * + * * @param property * the property to check - * + * * @since 7.4 - * + * * @return true if the property has a NoLayout annotation; * otherwise false */ public static boolean isNoLayoutProperty(Property property) { - return hasNoLayout(get().jsTypeData, property.getBeanType() - .getSignature(), property.getName()); + return hasNoLayout(get().jsTypeData, + property.getBeanType().getSignature(), property.getName()); } } diff --git a/client/src/main/java/com/vaadin/client/renderers/ButtonRenderer.java b/client/src/main/java/com/vaadin/client/renderers/ButtonRenderer.java index b173aef60a..52fa2c7bdb 100644 --- a/client/src/main/java/com/vaadin/client/renderers/ButtonRenderer.java +++ b/client/src/main/java/com/vaadin/client/renderers/ButtonRenderer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -23,7 +23,7 @@ import com.vaadin.client.widget.grid.RendererCellReference; * A Renderer that displays buttons with textual captions. The values of the * corresponding column are used as the captions. Click handlers can be added to * the renderer, invoked when any of the rendered buttons is clicked. - * + * * @since 7.4 * @author Vaadin Ltd */ diff --git a/client/src/main/java/com/vaadin/client/renderers/ClickableRenderer.java b/client/src/main/java/com/vaadin/client/renderers/ClickableRenderer.java index caffc521d1..59caf4f150 100644 --- a/client/src/main/java/com/vaadin/client/renderers/ClickableRenderer.java +++ b/client/src/main/java/com/vaadin/client/renderers/ClickableRenderer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -40,31 +40,31 @@ import com.vaadin.shared.ui.grid.GridConstants.Section; * An abstract superclass for renderers that render clickable widgets. Click * handlers can be added to a renderer to listen to click events emitted by all * widgets rendered by the renderer. - * + * * @param * the presentation (column) type * @param * the widget type - * + * * @since 7.4 * @author Vaadin Ltd */ -public abstract class ClickableRenderer extends - WidgetRenderer implements ClickHandler { +public abstract class ClickableRenderer + extends WidgetRenderer implements ClickHandler { /** * A handler for {@link RendererClickEvent renderer click events}. - * + * * @param * the row type of the containing Grid - * + * * @see {@link ButtonRenderer#addClickHandler(RendererClickHandler)} */ public interface RendererClickHandler extends EventHandler { /** * Called when a rendered button is clicked. - * + * * @param event * the event representing the click */ @@ -74,13 +74,13 @@ public abstract class ClickableRenderer extends /** * An event fired when a widget rendered by a ClickableWidgetRenderer * subclass is clicked. - * + * * @param * the row type of the containing Grid */ @SuppressWarnings("rawtypes") - public static class RendererClickEvent extends - MouseEvent { + public static class RendererClickEvent + extends MouseEvent { @SuppressWarnings("unchecked") static final Type TYPE = new Type( @@ -95,7 +95,7 @@ public abstract class ClickableRenderer extends /** * Returns the cell of the clicked button. - * + * * @return the cell */ public CellReference getCell() { @@ -105,7 +105,7 @@ public abstract class ClickableRenderer extends /** * Returns the data object corresponding to the row of the clicked * button. - * + * * @return the row data object */ public R getRow() { @@ -138,7 +138,7 @@ public abstract class ClickableRenderer extends /** * Returns the cell the given element belongs to. - * + * * @param grid * the grid instance that is queried * @param e @@ -174,7 +174,7 @@ public abstract class ClickableRenderer extends * please refer to the note in * {@link WidgetUtil#findWidget(Element, Class) Util.findWidget} for * details. - * + * * @param e * the element whose parent grid to find * @return the parent grid or null if none found. @@ -209,11 +209,12 @@ public abstract class ClickableRenderer extends *

    * Note that the row type of the click handler must match the row type of * the containing Grid. - * + * * @param handler * the click handler to be added */ - public HandlerRegistration addClickHandler(RendererClickHandler handler) { + public HandlerRegistration addClickHandler( + RendererClickHandler handler) { if (handlerManager == null) { handlerManager = new HandlerManager(this); } diff --git a/client/src/main/java/com/vaadin/client/renderers/ComplexRenderer.java b/client/src/main/java/com/vaadin/client/renderers/ComplexRenderer.java index 262de79468..eeb0577737 100644 --- a/client/src/main/java/com/vaadin/client/renderers/ComplexRenderer.java +++ b/client/src/main/java/com/vaadin/client/renderers/ComplexRenderer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -32,11 +32,11 @@ import com.vaadin.client.widget.grid.RendererCellReference; * (override {@link #init(FlyweightCell)} and {@link #destroy(FlyweightCell) } * and event handling (see {@link #onBrowserEvent(Cell, NativeEvent)}, * {@link #getConsumedEvents()} and {@link #onActivate()}. - * + * *

    * Also provides a helper method for hiding the cell contents by overriding * {@link #setContentVisible(FlyweightCell, boolean)} - * + * * @since 7.4.0 * @author Vaadin Ltd */ @@ -45,7 +45,7 @@ public abstract class ComplexRenderer implements Renderer { /** * Called at initialization stage. Perform any initialization here e.g. * attach handlers, attach widgets etc. - * + * * @param cell * The cell. Note that the cell is not to be stored outside of * the method as the cell instance will change. See @@ -59,7 +59,7 @@ public abstract class ComplexRenderer implements Renderer { *

    * The row object in the cell reference will be null since the * row might no longer be present in the data source. - * + * * @param cell * The cell. Note that the cell is not to be stored outside of * the method as the cell instance will change. See @@ -73,9 +73,9 @@ public abstract class ComplexRenderer implements Renderer { * Returns the events that the renderer should consume. These are also the * events that the Grid will pass to * {@link #onBrowserEvent(Cell, NativeEvent)} when they occur. - * + * * @return a list of consumed events - * + * * @see com.google.gwt.dom.client.BrowserEvents */ public Collection getConsumedEvents() { @@ -91,11 +91,11 @@ public abstract class ComplexRenderer implements Renderer { *

    * Returns boolean telling if the event has been completely handled and * should not cause any other actions. - * + * * @param cell * Object containing information about the cell the event was * triggered on. - * + * * @param event * The original DOM event * @return true if event should not be handled by grid @@ -112,12 +112,12 @@ public abstract class ComplexRenderer implements Renderer { * Default implementation hides content by setting visibility: hidden to all * elements inside the cell. Text nodes are left as is - renderers that add * such to the root element need to implement explicit support hiding them. - * + * * @param cell * The cell * @param hasData * Has the cell content been loaded from the data source - * + * */ public void setContentVisible(RendererCellReference cell, boolean hasData) { Element cellElement = cell.getElement(); @@ -137,7 +137,7 @@ public abstract class ComplexRenderer implements Renderer { /** * Called when the cell is activated by pressing enter, double * clicking or performing a double tap on the cell. - * + * * @param cell * the activated cell * @return true if event was handled and should not be diff --git a/client/src/main/java/com/vaadin/client/renderers/DateRenderer.java b/client/src/main/java/com/vaadin/client/renderers/DateRenderer.java index 4d15fac724..45f82ccff3 100644 --- a/client/src/main/java/com/vaadin/client/renderers/DateRenderer.java +++ b/client/src/main/java/com/vaadin/client/renderers/DateRenderer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -24,7 +24,7 @@ import com.vaadin.client.widget.grid.RendererCellReference; /** * A renderer for rendering dates into cells - * + * * @since 7.4 * @author Vaadin Ltd */ @@ -34,8 +34,8 @@ public class DateRenderer implements Renderer { // Calendar is unavailable for GWT @SuppressWarnings("deprecation") - private TimeZone timeZone = TimeZone.createTimeZone(new Date() - .getTimezoneOffset()); + private TimeZone timeZone = TimeZone + .createTimeZone(new Date().getTimezoneOffset()); public DateRenderer() { this(PredefinedFormat.DATE_TIME_SHORT); @@ -57,10 +57,10 @@ public class DateRenderer implements Renderer { /** * Gets the format of how the date is formatted. - * + * * @return the format - * @see GWT + * @see GWT * documentation on DateTimeFormat */ public DateTimeFormat getFormat() { @@ -69,11 +69,11 @@ public class DateRenderer implements Renderer { /** * Sets the format used for formatting the dates. - * + * * @param format * the format to set - * @see GWT + * @see GWT * documentation on DateTimeFormat */ public void setFormat(DateTimeFormat format) { @@ -85,7 +85,7 @@ public class DateRenderer implements Renderer { /** * Returns the time zone of the date. - * + * * @return the time zone */ public TimeZone getTimeZone() { @@ -95,7 +95,7 @@ public class DateRenderer implements Renderer { /** * Sets the time zone of the the date. By default uses the time zone of the * browser. - * + * * @param timeZone * the timeZone to set */ diff --git a/client/src/main/java/com/vaadin/client/renderers/HtmlRenderer.java b/client/src/main/java/com/vaadin/client/renderers/HtmlRenderer.java index ec6dc761f6..fe0b96400d 100644 --- a/client/src/main/java/com/vaadin/client/renderers/HtmlRenderer.java +++ b/client/src/main/java/com/vaadin/client/renderers/HtmlRenderer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -26,7 +26,7 @@ import com.vaadin.client.widget.grid.RendererCellReference; * developer to ensure that the html string honors the {@link SafeHtml} * contract. For more information see * {@link SafeHtmlUtils#fromSafeConstant(String)}. - * + * * @since 7.4 * @author Vaadin Ltd * @see SafeHtmlUtils#fromSafeConstant(String) @@ -35,7 +35,7 @@ public class HtmlRenderer implements Renderer { @Override public void render(RendererCellReference cell, String htmlString) { - cell.getElement().setInnerSafeHtml( - SafeHtmlUtils.fromSafeConstant(htmlString)); + cell.getElement() + .setInnerSafeHtml(SafeHtmlUtils.fromSafeConstant(htmlString)); } } diff --git a/client/src/main/java/com/vaadin/client/renderers/ImageRenderer.java b/client/src/main/java/com/vaadin/client/renderers/ImageRenderer.java index d52bc1ba6d..bf27e1e822 100644 --- a/client/src/main/java/com/vaadin/client/renderers/ImageRenderer.java +++ b/client/src/main/java/com/vaadin/client/renderers/ImageRenderer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -23,7 +23,7 @@ import com.vaadin.client.widget.grid.RendererCellReference; * A renderer that renders an image into a cell. Click handlers can be added to * the renderer, invoked every time any of the images rendered by that rendered * is clicked. - * + * * @since 7.4 * @author Vaadin Ltd */ diff --git a/client/src/main/java/com/vaadin/client/renderers/NumberRenderer.java b/client/src/main/java/com/vaadin/client/renderers/NumberRenderer.java index a040e8d1ce..5c8fe199d3 100644 --- a/client/src/main/java/com/vaadin/client/renderers/NumberRenderer.java +++ b/client/src/main/java/com/vaadin/client/renderers/NumberRenderer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -22,7 +22,7 @@ import com.vaadin.client.widget.grid.RendererCellReference; * Renders a number into a cell using a specific {@link NumberFormat}. By * default uses the default number format returned by * {@link NumberFormat#getDecimalFormat()}. - * + * * @since 7.4 * @author Vaadin Ltd * @param @@ -42,7 +42,7 @@ public class NumberRenderer implements Renderer { /** * Gets the number format that the number should be formatted in. - * + * * @return the number format used to render the number */ public NumberFormat getFormat() { @@ -51,7 +51,7 @@ public class NumberRenderer implements Renderer { /** * Sets the number format to use for formatting the number. - * + * * @param format * the format to use * @throws IllegalArgumentException diff --git a/client/src/main/java/com/vaadin/client/renderers/ProgressBarRenderer.java b/client/src/main/java/com/vaadin/client/renderers/ProgressBarRenderer.java index 5b2c70d274..f945283542 100644 --- a/client/src/main/java/com/vaadin/client/renderers/ProgressBarRenderer.java +++ b/client/src/main/java/com/vaadin/client/renderers/ProgressBarRenderer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,7 +21,7 @@ import com.vaadin.client.widget.grid.RendererCellReference; /** * A Renderer that represents a double value as a graphical progress bar. - * + * * @since 7.4 * @author Vaadin Ltd */ diff --git a/client/src/main/java/com/vaadin/client/renderers/Renderer.java b/client/src/main/java/com/vaadin/client/renderers/Renderer.java index b2e9acd582..46b68b39de 100644 --- a/client/src/main/java/com/vaadin/client/renderers/Renderer.java +++ b/client/src/main/java/com/vaadin/client/renderers/Renderer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,10 +25,10 @@ import com.vaadin.client.widgets.Grid; * You can add a renderer to any column by overring the * {@link GridColumn#getRenderer()} method and returning your own renderer. You * can retrieve the cell element using {@link Cell#getElement()}. - * + * * @param * The column type - * + * * @since 7.4 * @author Vaadin Ltd */ @@ -42,11 +42,11 @@ public interface Renderer { * It is recommended to set up the cell's DOM structure in * {@link ComplexRenderer#init(RendererCellReference)} and only make * incremental updates based on cell data in this method. - * + * * @param cell * The cell. Note that the cell is a flyweight and should not be * stored outside of the method as it will change. - * + * * @param data * The column data object */ diff --git a/client/src/main/java/com/vaadin/client/renderers/TextRenderer.java b/client/src/main/java/com/vaadin/client/renderers/TextRenderer.java index 3f704fd0b4..250eb35661 100644 --- a/client/src/main/java/com/vaadin/client/renderers/TextRenderer.java +++ b/client/src/main/java/com/vaadin/client/renderers/TextRenderer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -19,7 +19,7 @@ import com.vaadin.client.widget.grid.RendererCellReference; /** * Renderer that renders text into a cell. - * + * * @since 7.4 * @author Vaadin Ltd */ diff --git a/client/src/main/java/com/vaadin/client/renderers/WidgetRenderer.java b/client/src/main/java/com/vaadin/client/renderers/WidgetRenderer.java index d7219e7241..8ad9d96bd6 100644 --- a/client/src/main/java/com/vaadin/client/renderers/WidgetRenderer.java +++ b/client/src/main/java/com/vaadin/client/renderers/WidgetRenderer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -22,7 +22,7 @@ import com.vaadin.client.widget.grid.RendererCellReference; /** * A renderer for rendering widgets into cells. - * + * * @since 7.4 * @author Vaadin Ltd * @param @@ -30,8 +30,8 @@ import com.vaadin.client.widget.grid.RendererCellReference; * @param * the Widget type */ -public abstract class WidgetRenderer extends - ComplexRenderer { +public abstract class WidgetRenderer + extends ComplexRenderer { @Override public void init(RendererCellReference cell) { @@ -41,7 +41,7 @@ public abstract class WidgetRenderer extends /** * Creates a widget to attach to a cell. The widgets will be attached to the * cell after the cell element has been attached to DOM. - * + * * @return widget to attach to a cell. All returned instances should be new * widget instances without a parent. */ @@ -50,8 +50,8 @@ public abstract class WidgetRenderer extends @Override public void render(RendererCellReference cell, T data) { W w = getWidget(cell.getElement()); - assert w != null : "Widget not found in cell (" + cell.getColumn() - + "," + cell.getRow() + ")"; + assert w != null : "Widget not found in cell (" + cell.getColumn() + "," + + cell.getRow() + ")"; render(cell, data, w); } @@ -65,7 +65,7 @@ public abstract class WidgetRenderer extends * minimum since it will be called continuously while the user is scrolling. * The renderer can use {@link Widget#setLayoutData(Object)} to store cell * data that might be needed in e.g. event listeners. - * + * * @param cell * The cell to render. Note that the cell is a flyweight and * should not be stored and used outside of this method as its @@ -80,7 +80,7 @@ public abstract class WidgetRenderer extends /** * Returns the widget contained inside the given cell element. Cannot be * called for cells that do not contain a widget. - * + * * @param e * the element inside which to find a widget * @return the widget inside the element @@ -95,7 +95,7 @@ public abstract class WidgetRenderer extends * Returns the widget contained inside the given cell element, or null if it * is not an instance of the given class. Cannot be called for cells that do * not contain a widget. - * + * * @param e * the element inside to find a widget * @param klass @@ -105,7 +105,8 @@ public abstract class WidgetRenderer extends protected static W getWidget(TableCellElement e, Class klass) { W w = WidgetUtil.findWidget(e.getFirstChildElement(), klass); - assert w == null || w.getElement() == e.getFirstChildElement() : "Widget not found inside cell"; + assert w == null || w.getElement() == e + .getFirstChildElement() : "Widget not found inside cell"; return w; } } diff --git a/client/src/main/java/com/vaadin/client/ui/AbstractClickEventHandler.java b/client/src/main/java/com/vaadin/client/ui/AbstractClickEventHandler.java index a2c54ec7ca..b4688f19ad 100644 --- a/client/src/main/java/com/vaadin/client/ui/AbstractClickEventHandler.java +++ b/client/src/main/java/com/vaadin/client/ui/AbstractClickEventHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -128,7 +128,7 @@ public abstract class AbstractClickEventHandler implements MouseDownHandler, *

    * By default registers the handler with the connector root widget. *

    - * + * * @param * @param handler * The handler to register @@ -143,7 +143,7 @@ public abstract class AbstractClickEventHandler implements MouseDownHandler, /** * Checks if there is a server side event listener registered for clicks - * + * * @return true if there is a server side event listener registered, false * otherwise */ @@ -171,8 +171,8 @@ public abstract class AbstractClickEventHandler implements MouseDownHandler, * When getting a mousedown event, we must detect where the * corresponding mouseup event if it's on a different part of the page. */ - lastMouseDownTarget = WidgetUtil.getElementUnderMouse(event - .getNativeEvent()); + lastMouseDownTarget = WidgetUtil + .getElementUnderMouse(event.getNativeEvent()); mouseUpPreviewMatched = false; mouseUpEventPreviewRegistration = Event .addNativePreviewHandler(mouseUpPreviewHandler); @@ -186,10 +186,10 @@ public abstract class AbstractClickEventHandler implements MouseDownHandler, * but we can't fire the even there as the event might get canceled * before it gets here. */ - if (hasEventListener() - && mouseUpPreviewMatched + if (hasEventListener() && mouseUpPreviewMatched && lastMouseDownTarget != null - && WidgetUtil.getElementUnderMouse(event.getNativeEvent()) == lastMouseDownTarget + && WidgetUtil.getElementUnderMouse( + event.getNativeEvent()) == lastMouseDownTarget && shouldFireEvent(event)) { // "Click" with left, right or middle button fireClick(event.getNativeEvent()); @@ -200,7 +200,7 @@ public abstract class AbstractClickEventHandler implements MouseDownHandler, /** * Sends the click event based on the given native event. - * + * * @param event * The native event that caused this click event */ @@ -209,7 +209,7 @@ public abstract class AbstractClickEventHandler implements MouseDownHandler, /** * Called before firing a click event. Allows sub classes to decide if this * in an event that should cause an event or not. - * + * * @param event * The user event * @return true if the event should be fired, false otherwise @@ -235,7 +235,7 @@ public abstract class AbstractClickEventHandler implements MouseDownHandler, * Click event calculates and returns coordinates relative to the element * returned by this method. Default implementation uses the root element of * the widget. Override to provide a different relative element. - * + * * @return The Element used for calculating relative coordinates for a click * or null if no relative coordinates can be calculated. */ diff --git a/client/src/main/java/com/vaadin/client/ui/AbstractComponentConnector.java b/client/src/main/java/com/vaadin/client/ui/AbstractComponentConnector.java index e040386e63..75370114ac 100644 --- a/client/src/main/java/com/vaadin/client/ui/AbstractComponentConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/AbstractComponentConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -104,18 +104,19 @@ public abstract class AbstractComponentConnector extends AbstractConnector @OnStateChange("registeredEventListeners") void handleContextClickListenerChange() { if (contextHandler == null && hasEventListener(EventId.CONTEXT_CLICK)) { - contextHandler = getWidget().addDomHandler( - new ContextMenuHandler() { + contextHandler = getWidget() + .addDomHandler(new ContextMenuHandler() { @Override public void onContextMenu(ContextMenuEvent event) { - final MouseEventDetails mouseEventDetails = MouseEventDetailsBuilder.buildMouseEventDetails( - event.getNativeEvent(), getWidget() - .getElement()); + final MouseEventDetails mouseEventDetails = MouseEventDetailsBuilder + .buildMouseEventDetails( + event.getNativeEvent(), + getWidget().getElement()); event.preventDefault(); event.stopPropagation(); - sendContextClickEvent(mouseEventDetails, event - .getNativeEvent().getEventTarget()); + sendContextClickEvent(mouseEventDetails, + event.getNativeEvent().getEventTarget()); } }, ContextMenuEvent.getType()); @@ -139,10 +140,10 @@ public abstract class AbstractComponentConnector extends AbstractConnector /** * The new default behaviour is for long taps to fire a contextclick event * if there's a contextclick listener attached to the component. - * + * * If you do not want this in your component, override this with a blank * method to get rid of said behaviour. - * + * * @since 7.6 */ protected void unregisterTouchHandlers() { @@ -163,13 +164,13 @@ public abstract class AbstractComponentConnector extends AbstractConnector /** * The new default behaviour is for long taps to fire a contextclick event * if there's a contextclick listener attached to the component. - * + * * If you do not want this in your component, override this with a blank * method to get rid of said behaviour. - * + * * Some Vaadin Components already handle the long tap as a context menu. * This method is unnecessary for those. - * + * * @since 7.6 */ protected void registerTouchHandlers() { @@ -196,8 +197,9 @@ public abstract class AbstractComponentConnector extends AbstractConnector * this was the case with iOS devices. */ - final MouseEventDetails mouseEventDetails = MouseEventDetailsBuilder.buildMouseEventDetails( - event.getNativeEvent(), getWidget().getElement()); + final MouseEventDetails mouseEventDetails = MouseEventDetailsBuilder + .buildMouseEventDetails(event.getNativeEvent(), + getWidget().getElement()); final EventTarget eventTarget = event.getNativeEvent() .getEventTarget(); @@ -288,7 +290,7 @@ public abstract class AbstractComponentConnector extends AbstractConnector /** * If a long touch event timer is running, cancel it. - * + * * @since 7.6 */ private void cancelTouchTimer() { @@ -302,7 +304,7 @@ public abstract class AbstractComponentConnector extends AbstractConnector /** * Cancel the timer recursively for parent components that have timers * running - * + * * @since 7.6 */ private void cancelParentTouchTimers() { @@ -324,7 +326,7 @@ public abstract class AbstractComponentConnector extends AbstractConnector * This method sends the context menu event to the server-side. Can be * overridden to provide extra information through an alternative RPC * interface. - * + * * @since 7.6 * @param event */ @@ -349,7 +351,7 @@ public abstract class AbstractComponentConnector extends AbstractConnector * can't call super.createWidget() since the metadata needed * for that implementation is not generated if there's an override of the * method. - * + * * @return a new widget instance to use for this component connector */ protected Widget createWidget() { @@ -364,14 +366,15 @@ public abstract class AbstractComponentConnector extends AbstractConnector + getClass().getSimpleName() + ". This might be caused by explicitely using " + "super.createWidget() or some unspecified " - + "problem with the widgetset compilation.", e); + + "problem with the widgetset compilation.", + e); } } /** * Returns the widget associated with this paintable. The widget returned by * this method must not changed during the life time of the paintable. - * + * * @return The widget associated with this paintable */ @Override @@ -419,7 +422,8 @@ public abstract class AbstractComponentConnector extends AbstractConnector * first setting tabindex, then enabled state (through super * implementation). */ - Profiler.enter("AbstractComponentConnector.onStateChanged update tab index"); + Profiler.enter( + "AbstractComponentConnector.onStateChanged update tab index"); if (getState() instanceof TabIndexState) { if (getWidget() instanceof Focusable) { ((Focusable) getWidget()) @@ -434,27 +438,35 @@ public abstract class AbstractComponentConnector extends AbstractConnector // + " which does not implement Focusable"); } } - Profiler.leave("AbstractComponentConnector.onStateChanged update tab index"); + Profiler.leave( + "AbstractComponentConnector.onStateChanged update tab index"); - Profiler.enter("AbstractComponentConnector.onStateChanged AbstractConnector.onStateChanged()"); + Profiler.enter( + "AbstractComponentConnector.onStateChanged AbstractConnector.onStateChanged()"); super.onStateChanged(stateChangeEvent); - Profiler.leave("AbstractComponentConnector.onStateChanged AbstractConnector.onStateChanged()"); + Profiler.leave( + "AbstractComponentConnector.onStateChanged AbstractConnector.onStateChanged()"); // Style names - Profiler.enter("AbstractComponentConnector.onStateChanged updateWidgetStyleNames"); + Profiler.enter( + "AbstractComponentConnector.onStateChanged updateWidgetStyleNames"); updateWidgetStyleNames(); - Profiler.leave("AbstractComponentConnector.onStateChanged updateWidgetStyleNames"); + Profiler.leave( + "AbstractComponentConnector.onStateChanged updateWidgetStyleNames"); /* * updateComponentSize need to be after caption update so caption can be * taken into account */ - Profiler.enter("AbstractComponentConnector.onStateChanged updateComponentSize"); + Profiler.enter( + "AbstractComponentConnector.onStateChanged updateComponentSize"); updateComponentSize(); - Profiler.leave("AbstractComponentConnector.onStateChanged updateComponentSize"); + Profiler.leave( + "AbstractComponentConnector.onStateChanged updateComponentSize"); - Profiler.enter("AbstractComponentContainer.onStateChanged check tooltip"); + Profiler.enter( + "AbstractComponentContainer.onStateChanged check tooltip"); if (!tooltipListenersAttached && hasTooltip()) { /* * Add event handlers for tooltips if they are needed but have not @@ -463,7 +475,8 @@ public abstract class AbstractComponentConnector extends AbstractConnector tooltipListenersAttached = true; getConnection().getVTooltip().connectHandlersToWidget(getWidget()); } - Profiler.leave("AbstractComponentContainer.onStateChanged check tooltip"); + Profiler.leave( + "AbstractComponentContainer.onStateChanged check tooltip"); Profiler.leave("AbstractComponentConnector.onStateChanged"); } @@ -504,7 +517,7 @@ public abstract class AbstractComponentConnector extends AbstractConnector /** * Updates the component size, invoking the {@link LayoutManager layout * manager} if necessary. - * + * * @param newWidth * The new width as a CSS string. Cannot be null. * @param newHeight @@ -518,16 +531,16 @@ public abstract class AbstractComponentConnector extends AbstractConnector if (newWidth.endsWith("%") != lastKnownWidth.endsWith("%")) { Connector parent = getParent(); if (parent instanceof ManagedLayout) { - getLayoutManager().setNeedsHorizontalLayout( - (ManagedLayout) parent); + getLayoutManager() + .setNeedsHorizontalLayout((ManagedLayout) parent); } } if (newHeight.endsWith("%") != lastKnownHeight.endsWith("%")) { Connector parent = getParent(); if (parent instanceof ManagedLayout) { - getLayoutManager().setNeedsVerticalLayout( - (ManagedLayout) parent); + getLayoutManager() + .setNeedsVerticalLayout((ManagedLayout) parent); } } @@ -537,21 +550,25 @@ public abstract class AbstractComponentConnector extends AbstractConnector // Set defined sizes Widget widget = getWidget(); - Profiler.enter("AbstractComponentConnector.updateComponentSize update styleNames"); + Profiler.enter( + "AbstractComponentConnector.updateComponentSize update styleNames"); widget.setStyleName("v-has-width", !isUndefinedWidth()); widget.setStyleName("v-has-height", !isUndefinedHeight()); - Profiler.leave("AbstractComponentConnector.updateComponentSize update styleNames"); + Profiler.leave( + "AbstractComponentConnector.updateComponentSize update styleNames"); - Profiler.enter("AbstractComponentConnector.updateComponentSize update DOM"); + Profiler.enter( + "AbstractComponentConnector.updateComponentSize update DOM"); updateWidgetSize(newWidth, newHeight); - Profiler.leave("AbstractComponentConnector.updateComponentSize update DOM"); + Profiler.leave( + "AbstractComponentConnector.updateComponentSize update DOM"); Profiler.leave("AbstractComponentConnector.updateComponentSize"); } /** * Updates the DOM size of this connector's {@link #getWidget() widget}. - * + * * @since 7.1.15 * @param newWidth * The new width as a CSS string. Cannot be null. @@ -585,7 +602,7 @@ public abstract class AbstractComponentConnector extends AbstractConnector /* * (non-Javadoc) - * + * * @see com.vaadin.client.ComponentConnector#delegateCaptionHandling () */ @Override @@ -617,8 +634,8 @@ public abstract class AbstractComponentConnector extends AbstractConnector setWidgetStyleName("v-readonly", isReadOnly()); // add / remove error style name - setWidgetStyleNameWithPrefix(primaryStyleName, - StyleConstants.ERROR_EXT, null != state.errorMessage); + setWidgetStyleNameWithPrefix(primaryStyleName, StyleConstants.ERROR_EXT, + null != state.errorMessage); // add additional user defined style names as class names, prefixed with // component default class name. remove nonexistent style names. @@ -662,7 +679,7 @@ public abstract class AbstractComponentConnector extends AbstractConnector * updated in another widget in addition to the one returned by the * {@link #getWidget()}. *

    - * + * * @param styleName * the style name to be added or removed * @param add @@ -683,7 +700,7 @@ public abstract class AbstractComponentConnector extends AbstractConnector * different. For example see * {@link com.vaadin.client.ui.datefield.DateFieldConnector#setWidgetStyleNameWithPrefix(String, String, boolean)} *

    - * + * * @param styleName * the style name to be added or removed * @param add @@ -693,8 +710,8 @@ public abstract class AbstractComponentConnector extends AbstractConnector * prefixes. */ @Deprecated - protected void setWidgetStyleNameWithPrefix(String prefix, - String styleName, boolean add) { + protected void setWidgetStyleNameWithPrefix(String prefix, String styleName, + boolean add) { if (!styleName.startsWith("-")) { if (!prefix.endsWith("-")) { prefix += "-"; @@ -709,7 +726,7 @@ public abstract class AbstractComponentConnector extends AbstractConnector /* * (non-Javadoc) - * + * * @see com.vaadin.client.ComponentConnector#isReadOnly() */ @Override @@ -738,9 +755,10 @@ public abstract class AbstractComponentConnector extends AbstractConnector // at this point. if (getWidget() != null && getWidget().isAttached()) { getWidget().removeFromParent(); - VConsole.error("Widget is still attached to the DOM after the connector (" - + Util.getConnectorString(this) - + ") has been unregistered. Widget was removed."); + VConsole.error( + "Widget is still attached to the DOM after the connector (" + + Util.getConnectorString(this) + + ") has been unregistered. Widget was removed."); } } @@ -755,7 +773,8 @@ public abstract class AbstractComponentConnector extends AbstractConnector AbstractComponentState state = getState(); if (state.description != null && !state.description.equals("")) { return true; - } else if (state.errorMessage != null && !state.errorMessage.equals("")) { + } else if (state.errorMessage != null + && !state.errorMessage.equals("")) { return true; } else { return false; @@ -764,7 +783,7 @@ public abstract class AbstractComponentConnector extends AbstractConnector /** * Gets the URI of the icon set for this component. - * + * * @return the URI of the icon, or null if no icon has been * defined. */ @@ -774,7 +793,7 @@ public abstract class AbstractComponentConnector extends AbstractConnector /** * Gets the icon set for this component. - * + * * @return the icon, or null if no icon has been defined. */ protected Icon getIcon() { @@ -783,7 +802,7 @@ public abstract class AbstractComponentConnector extends AbstractConnector /* * (non-Javadoc) - * + * * @see com.vaadin.client.ComponentConnector#flush() */ @Override diff --git a/client/src/main/java/com/vaadin/client/ui/AbstractComponentContainerConnector.java b/client/src/main/java/com/vaadin/client/ui/AbstractComponentContainerConnector.java index f808fb194c..4e8b2a087e 100644 --- a/client/src/main/java/com/vaadin/client/ui/AbstractComponentContainerConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/AbstractComponentContainerConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -17,10 +17,10 @@ package com.vaadin.client.ui; /** * Client side connector for subclasses of AbstractComponentConnector. - * + * * @since 7.0 */ -public abstract class AbstractComponentContainerConnector extends - AbstractHasComponentsConnector { +public abstract class AbstractComponentContainerConnector + extends AbstractHasComponentsConnector { } diff --git a/client/src/main/java/com/vaadin/client/ui/AbstractConnector.java b/client/src/main/java/com/vaadin/client/ui/AbstractConnector.java index 7f8d6c2b14..15a62b4817 100644 --- a/client/src/main/java/com/vaadin/client/ui/AbstractConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/AbstractConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -49,13 +49,13 @@ import com.vaadin.shared.communication.URLReference; /** * An abstract implementation of Connector. - * + * * @author Vaadin Ltd * @since 7.0.0 - * + * */ -public abstract class AbstractConnector implements ServerConnector, - StateChangeHandler { +public abstract class AbstractConnector + implements ServerConnector, StateChangeHandler { private ApplicationConnection connection; private String id; @@ -85,7 +85,7 @@ public abstract class AbstractConnector implements ServerConnector, /* * (non-Javadoc) - * + * * @see com.vaadin.client.VPaintable#getConnection() */ @Override @@ -95,7 +95,7 @@ public abstract class AbstractConnector implements ServerConnector, /* * (non-Javadoc) - * + * * @see com.vaadin.client.Connector#getId() */ @Override @@ -120,13 +120,13 @@ public abstract class AbstractConnector implements ServerConnector, addStateChangeHandler(this); if (Profiler.isEnabled()) { - Profiler.enter("AbstractConnector.init " - + getClass().getSimpleName()); + Profiler.enter( + "AbstractConnector.init " + getClass().getSimpleName()); } init(); if (Profiler.isEnabled()) { - Profiler.leave("AbstractConnector.init " - + getClass().getSimpleName()); + Profiler.leave( + "AbstractConnector.init " + getClass().getSimpleName()); } Profiler.leave("AbstractConnector.doInit"); } @@ -144,10 +144,10 @@ public abstract class AbstractConnector implements ServerConnector, /** * Registers an implementation for a server to client RPC interface. - * + * * Multiple registrations can be made for a single interface, in which case * all of them receive corresponding RPC calls. - * + * * @param rpcInterface * RPC interface * @param implementation @@ -169,7 +169,7 @@ public abstract class AbstractConnector implements ServerConnector, /** * Unregisters an implementation for a server to client RPC interface. - * + * * @param rpcInterface * RPC interface * @param implementation @@ -187,7 +187,7 @@ public abstract class AbstractConnector implements ServerConnector, /** * Returns an RPC proxy object which can be used to invoke the RPC method on * the server. - * + * * @param * The type of the ServerRpc interface * @param rpcInterface @@ -225,7 +225,8 @@ public abstract class AbstractConnector implements ServerConnector, } if (statePropertyHandlerManagers != null && event instanceof StateChangeEvent) { - Profiler.enter("AbstractConnector.fireEvent statePropertyHandlerManagers"); + Profiler.enter( + "AbstractConnector.fireEvent statePropertyHandlerManagers"); StateChangeEvent stateChangeEvent = (StateChangeEvent) event; JsArrayString keys = statePropertyHandlerManagers.getKeys(); for (int i = 0; i < keys.length(); i++) { @@ -234,7 +235,8 @@ public abstract class AbstractConnector implements ServerConnector, statePropertyHandlerManagers.get(property).fireEvent(event); } } - Profiler.leave("AbstractConnector.fireEvent statePropertyHandlerManagers"); + Profiler.leave( + "AbstractConnector.fireEvent statePropertyHandlerManagers"); } if (Profiler.isEnabled()) { Profiler.leave(profilerKey); @@ -251,9 +253,10 @@ public abstract class AbstractConnector implements ServerConnector, } @Override - public HandlerRegistration addStateChangeHandler(StateChangeHandler handler) { - return ensureHandlerManager() - .addHandler(StateChangeEvent.TYPE, handler); + public HandlerRegistration addStateChangeHandler( + StateChangeHandler handler) { + return ensureHandlerManager().addHandler(StateChangeEvent.TYPE, + handler); } @Override @@ -264,8 +267,8 @@ public abstract class AbstractConnector implements ServerConnector, @Override public HandlerRegistration addStateChangeHandler(String propertyName, StateChangeHandler handler) { - return ensureHandlerManager(propertyName).addHandler( - StateChangeEvent.TYPE, handler); + return ensureHandlerManager(propertyName) + .addHandler(StateChangeEvent.TYPE, handler); } @Override @@ -333,23 +336,23 @@ public abstract class AbstractConnector implements ServerConnector, /* * (non-Javadoc) - * + * * @see com.vaadin.client.ServerConnector#onUnregister() */ @Override public void onUnregister() { if (debugLogging) { - VConsole.log("Unregistered connector " - + Util.getConnectorString(this)); + VConsole.log( + "Unregistered connector " + Util.getConnectorString(this)); } } /** * Returns the shared state object for this connector. - * + * * Override this method to define the shared state type for your connector. - * + * * @return the current shared state (never null) */ @Override @@ -368,7 +371,7 @@ public abstract class AbstractConnector implements ServerConnector, * created state object must be compatible with the return type of * {@link #getState()}. The default implementation creates a state object * using GWT.create() using the defined return type of {@link #getState()}. - * + * * @return A new state object */ protected SharedState createState() { @@ -457,7 +460,7 @@ public abstract class AbstractConnector implements ServerConnector, * {@link com.vaadin.terminal.AbstractClientConnector#setResource(String, com.vaadin.terminal.Resource)} * with the same key. null is returned if no corresponding * resource is found. - * + * * @param key * a string identifying the resource. * @return the resource URL as a string, or null if no @@ -474,7 +477,7 @@ public abstract class AbstractConnector implements ServerConnector, /* * (non-Javadoc) - * + * * @see com.vaadin.client.ServerConnector#hasEventListener(java.lang.String) */ @Override @@ -486,7 +489,7 @@ public abstract class AbstractConnector implements ServerConnector, /** * Force the connector to recheck its state variables as the variables or * their meaning might have changed. - * + * * @since 7.3 */ public void forceStateChange() { diff --git a/client/src/main/java/com/vaadin/client/ui/AbstractFieldConnector.java b/client/src/main/java/com/vaadin/client/ui/AbstractFieldConnector.java index 8d8df81bd8..a093f2f3ef 100644 --- a/client/src/main/java/com/vaadin/client/ui/AbstractFieldConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/AbstractFieldConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -18,7 +18,8 @@ package com.vaadin.client.ui; import com.vaadin.client.StyleConstants; import com.vaadin.shared.AbstractFieldState; -public abstract class AbstractFieldConnector extends AbstractComponentConnector { +public abstract class AbstractFieldConnector + extends AbstractComponentConnector { @Override public AbstractFieldState getState() { @@ -36,10 +37,10 @@ public abstract class AbstractFieldConnector extends AbstractComponentConnector /** * Checks whether the required indicator should be shown for the field. - * + * * Required indicators are hidden if the field or its data source is * read-only. - * + * * @return true if required indicator should be shown */ public boolean isRequired() { diff --git a/client/src/main/java/com/vaadin/client/ui/AbstractHasComponentsConnector.java b/client/src/main/java/com/vaadin/client/ui/AbstractHasComponentsConnector.java index 27210de10d..50ecd7a014 100644 --- a/client/src/main/java/com/vaadin/client/ui/AbstractHasComponentsConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/AbstractHasComponentsConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -24,9 +24,9 @@ import com.vaadin.client.ConnectorHierarchyChangeEvent; import com.vaadin.client.ConnectorHierarchyChangeEvent.ConnectorHierarchyChangeHandler; import com.vaadin.client.HasComponentsConnector; -public abstract class AbstractHasComponentsConnector extends - AbstractComponentConnector implements HasComponentsConnector, - ConnectorHierarchyChangeHandler { +public abstract class AbstractHasComponentsConnector + extends AbstractComponentConnector + implements HasComponentsConnector, ConnectorHierarchyChangeHandler { List childComponents; @@ -39,7 +39,7 @@ public abstract class AbstractHasComponentsConnector extends /* * (non-Javadoc) - * + * * @see com.vaadin.client.HasComponentsConnector#getChildren() */ @Override @@ -53,7 +53,7 @@ public abstract class AbstractHasComponentsConnector extends /* * (non-Javadoc) - * + * * @see com.vaadin.client.HasComponentsConnector#setChildren * (java.util.Collection) */ @@ -65,7 +65,7 @@ public abstract class AbstractHasComponentsConnector extends @Override public HandlerRegistration addConnectorHierarchyChangeHandler( ConnectorHierarchyChangeHandler handler) { - return ensureHandlerManager().addHandler( - ConnectorHierarchyChangeEvent.TYPE, handler); + return ensureHandlerManager() + .addHandler(ConnectorHierarchyChangeEvent.TYPE, handler); } } diff --git a/client/src/main/java/com/vaadin/client/ui/AbstractLayoutConnector.java b/client/src/main/java/com/vaadin/client/ui/AbstractLayoutConnector.java index 6e1dde3863..b18acdf9bb 100644 --- a/client/src/main/java/com/vaadin/client/ui/AbstractLayoutConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/AbstractLayoutConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -17,8 +17,8 @@ package com.vaadin.client.ui; import com.vaadin.shared.ui.AbstractLayoutState; -public abstract class AbstractLayoutConnector extends - AbstractComponentContainerConnector { +public abstract class AbstractLayoutConnector + extends AbstractComponentContainerConnector { @Override public AbstractLayoutState getState() { diff --git a/client/src/main/java/com/vaadin/client/ui/AbstractSingleComponentContainerConnector.java b/client/src/main/java/com/vaadin/client/ui/AbstractSingleComponentContainerConnector.java index 954803b64c..9c93d91177 100644 --- a/client/src/main/java/com/vaadin/client/ui/AbstractSingleComponentContainerConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/AbstractSingleComponentContainerConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -22,15 +22,15 @@ import com.vaadin.client.ComponentConnector; /** * Client side connector for subclasses of AbstractSingleComponentConnector. - * + * * @since 7.0 */ -public abstract class AbstractSingleComponentContainerConnector extends - AbstractHasComponentsConnector { +public abstract class AbstractSingleComponentContainerConnector + extends AbstractHasComponentsConnector { /** * Returns the content (only/first child) of the container. - * + * * @return child connector or null if none (e.g. invisible or not set on * server) */ @@ -45,7 +45,7 @@ public abstract class AbstractSingleComponentContainerConnector extends /** * Returns the widget (if any) of the content of the container. - * + * * @return widget of the only/first connector of the container, null if no * content or if there is no widget for the connector */ diff --git a/client/src/main/java/com/vaadin/client/ui/Action.java b/client/src/main/java/com/vaadin/client/ui/Action.java index d7593740d6..6dc7d95d74 100644 --- a/client/src/main/java/com/vaadin/client/ui/Action.java +++ b/client/src/main/java/com/vaadin/client/ui/Action.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -19,7 +19,7 @@ package com.vaadin.client.ui; import com.google.gwt.user.client.Command; /** - * + * */ public abstract class Action implements Command { @@ -72,7 +72,7 @@ public abstract class Action implements Command { /* * (non-Javadoc) - * + * * @see java.lang.Object#toString() */ @Override diff --git a/client/src/main/java/com/vaadin/client/ui/ActionOwner.java b/client/src/main/java/com/vaadin/client/ui/ActionOwner.java index 73c3675438..d775a8ca5e 100644 --- a/client/src/main/java/com/vaadin/client/ui/ActionOwner.java +++ b/client/src/main/java/com/vaadin/client/ui/ActionOwner.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/CalendarEntry.java b/client/src/main/java/com/vaadin/client/ui/CalendarEntry.java index 8050f0aab1..e40903009a 100644 --- a/client/src/main/java/com/vaadin/client/ui/CalendarEntry.java +++ b/client/src/main/java/com/vaadin/client/ui/CalendarEntry.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/ClickEventHandler.java b/client/src/main/java/com/vaadin/client/ui/ClickEventHandler.java index 7947e0560c..0a24bb5122 100644 --- a/client/src/main/java/com/vaadin/client/ui/ClickEventHandler.java +++ b/client/src/main/java/com/vaadin/client/ui/ClickEventHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -35,7 +35,7 @@ public abstract class ClickEventHandler extends AbstractClickEventHandler { /** * Sends the click event based on the given native event. Delegates actual * sending to {@link #fireClick(MouseEventDetails)}. - * + * * @param event * The native event that caused this click event */ @@ -49,10 +49,10 @@ public abstract class ClickEventHandler extends AbstractClickEventHandler { /** * Sends the click event to the server. Must be implemented by sub classes, * typically by calling an RPC method. - * + * * @param event * The event that caused this click to be fired - * + * * @param mouseDetails * The mouse details for the event */ diff --git a/client/src/main/java/com/vaadin/client/ui/ConnectorFocusAndBlurHandler.java b/client/src/main/java/com/vaadin/client/ui/ConnectorFocusAndBlurHandler.java index 8272f99d25..fd7c4d1f53 100644 --- a/client/src/main/java/com/vaadin/client/ui/ConnectorFocusAndBlurHandler.java +++ b/client/src/main/java/com/vaadin/client/ui/ConnectorFocusAndBlurHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -31,12 +31,12 @@ import com.vaadin.shared.communication.FieldRpc.FocusAndBlurServerRpc; * A handler for focus and blur events which uses {@link FocusAndBlurServerRpc} * to transmit received events to the server. Events are only handled if there * is a corresponding listener on the server side. - * + * * @since 7.6 * @author Vaadin Ltd */ -public class ConnectorFocusAndBlurHandler implements StateChangeHandler, - FocusHandler, BlurHandler { +public class ConnectorFocusAndBlurHandler + implements StateChangeHandler, FocusHandler, BlurHandler { private final AbstractComponentConnector connector; private final Widget widget; diff --git a/client/src/main/java/com/vaadin/client/ui/Field.java b/client/src/main/java/com/vaadin/client/ui/Field.java index 99bfe107b3..8a5e8e96b8 100644 --- a/client/src/main/java/com/vaadin/client/ui/Field.java +++ b/client/src/main/java/com/vaadin/client/ui/Field.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -14,14 +14,14 @@ * the License. */ /** - * + * */ package com.vaadin.client.ui; /** * This interface indicates that the component is a Field (serverside), and * wants (for instance) to automatically get the v-modified classname. - * + * */ public interface Field { diff --git a/client/src/main/java/com/vaadin/client/ui/FocusElementPanel.java b/client/src/main/java/com/vaadin/client/ui/FocusElementPanel.java index d0ddca0935..3aa087f7d1 100644 --- a/client/src/main/java/com/vaadin/client/ui/FocusElementPanel.java +++ b/client/src/main/java/com/vaadin/client/ui/FocusElementPanel.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/FocusUtil.java b/client/src/main/java/com/vaadin/client/ui/FocusUtil.java index 4750b89173..27a1015d77 100644 --- a/client/src/main/java/com/vaadin/client/ui/FocusUtil.java +++ b/client/src/main/java/com/vaadin/client/ui/FocusUtil.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,38 +21,40 @@ import com.google.gwt.user.client.ui.Widget; /** * A helper class used to make it easier for {@link Widget}s to implement * {@link Focusable}. - * + * * @author Vaadin Ltd * @version @VERSION@ * @since 7.0.3 - * + * */ public class FocusUtil { /** * Sets the access key property - * + * * @param focusable * The widget for which we want to set the access key. * @param key * The access key to set */ public static void setAccessKey(Widget focusable, char key) { - assert (focusable != null && focusable.getElement() != null) : "Can't setAccessKey for a widget without an element"; + assert (focusable != null && focusable + .getElement() != null) : "Can't setAccessKey for a widget without an element"; focusable.getElement().setPropertyString("accessKey", "" + key); } /** * Explicitly focus/unfocus the given widget. Only one widget can have focus * at a time, and the widget that does will receive all keyboard events. - * + * * @param focusable * the widget to focus/unfocus * @param focused * whether this widget should take focus or release it */ public static void setFocus(Widget focusable, boolean focus) { - assert (focusable != null && focusable.getElement() != null) : "Can't setFocus for a widget without an element"; + assert (focusable != null && focusable + .getElement() != null) : "Can't setFocus for a widget without an element"; if (focus) { focusable.getElement().focus(); @@ -66,28 +68,30 @@ public class FocusUtil { * the same tab index, each such widget will receive focus in an arbitrary * order. Setting the tab index to -1 will cause the widget to * be removed from the tab order. - * + * * @param focusable * The widget * @param tabIndex * the widget's tab index */ public static void setTabIndex(Widget focusable, int tabIndex) { - assert (focusable != null && focusable.getElement() != null) : "Can't setTabIndex for a widget without an element"; + assert (focusable != null && focusable + .getElement() != null) : "Can't setTabIndex for a widget without an element"; focusable.getElement().setTabIndex(tabIndex); } /** * Gets the widget's position in the tab index. - * + * * @param focusable * The widget - * + * * @return the widget's tab index */ public static int getTabIndex(Widget focusable) { - assert (focusable != null && focusable.getElement() != null) : "Can't getTabIndex for a widget without an element"; + assert (focusable != null && focusable + .getElement() != null) : "Can't getTabIndex for a widget without an element"; return focusable.getElement().getTabIndex(); } diff --git a/client/src/main/java/com/vaadin/client/ui/FocusableFlexTable.java b/client/src/main/java/com/vaadin/client/ui/FocusableFlexTable.java index 8deec2babb..13628e1413 100644 --- a/client/src/main/java/com/vaadin/client/ui/FocusableFlexTable.java +++ b/client/src/main/java/com/vaadin/client/ui/FocusableFlexTable.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -49,7 +49,7 @@ public class FocusableFlexTable extends FlexTable implements HasFocusHandlers, /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.HasFocusHandlers#addFocusHandler(com. * google.gwt.event.dom.client.FocusHandler) @@ -61,7 +61,7 @@ public class FocusableFlexTable extends FlexTable implements HasFocusHandlers, /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.HasBlurHandlers#addBlurHandler(com.google * .gwt.event.dom.client.BlurHandler) @@ -73,7 +73,7 @@ public class FocusableFlexTable extends FlexTable implements HasFocusHandlers, /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.HasKeyDownHandlers#addKeyDownHandler( * com.google.gwt.event.dom.client.KeyDownHandler) @@ -85,7 +85,7 @@ public class FocusableFlexTable extends FlexTable implements HasFocusHandlers, /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.HasKeyPressHandlers#addKeyPressHandler * (com.google.gwt.event.dom.client.KeyPressHandler) @@ -97,7 +97,7 @@ public class FocusableFlexTable extends FlexTable implements HasFocusHandlers, /** * Sets the keyboard focus to the panel - * + * * @param focus * Should the panel have keyboard focus. If true the keyboard * focus will be moved to the @@ -112,7 +112,7 @@ public class FocusableFlexTable extends FlexTable implements HasFocusHandlers, /* * (non-Javadoc) - * + * * @see com.vaadin.client.Focusable#focus() */ @Override diff --git a/client/src/main/java/com/vaadin/client/ui/FocusableFlowPanel.java b/client/src/main/java/com/vaadin/client/ui/FocusableFlowPanel.java index 77a26361ef..f2d84cf590 100644 --- a/client/src/main/java/com/vaadin/client/ui/FocusableFlowPanel.java +++ b/client/src/main/java/com/vaadin/client/ui/FocusableFlowPanel.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -46,7 +46,7 @@ public class FocusableFlowPanel extends FlowPanel implements HasFocusHandlers, /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.HasFocusHandlers#addFocusHandler(com. * google.gwt.event.dom.client.FocusHandler) @@ -58,7 +58,7 @@ public class FocusableFlowPanel extends FlowPanel implements HasFocusHandlers, /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.HasBlurHandlers#addBlurHandler(com.google * .gwt.event.dom.client.BlurHandler) @@ -70,7 +70,7 @@ public class FocusableFlowPanel extends FlowPanel implements HasFocusHandlers, /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.HasKeyDownHandlers#addKeyDownHandler( * com.google.gwt.event.dom.client.KeyDownHandler) @@ -82,7 +82,7 @@ public class FocusableFlowPanel extends FlowPanel implements HasFocusHandlers, /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.HasKeyPressHandlers#addKeyPressHandler * (com.google.gwt.event.dom.client.KeyPressHandler) @@ -94,7 +94,7 @@ public class FocusableFlowPanel extends FlowPanel implements HasFocusHandlers, /** * Sets/Removes the keyboard focus to the panel. - * + * * @param focus * If set to true then the focus is moved to the panel, if set to * false the focus is removed diff --git a/client/src/main/java/com/vaadin/client/ui/FocusableScrollPanel.java b/client/src/main/java/com/vaadin/client/ui/FocusableScrollPanel.java index 1ac5a08ccd..e49e7692c1 100644 --- a/client/src/main/java/com/vaadin/client/ui/FocusableScrollPanel.java +++ b/client/src/main/java/com/vaadin/client/ui/FocusableScrollPanel.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -37,10 +37,10 @@ import com.vaadin.client.BrowserInfo; /** * A scrollhandlers similar to {@link ScrollPanel}. - * + * */ -public class FocusableScrollPanel extends SimpleFocusablePanel implements - HasScrollHandlers, ScrollHandler { +public class FocusableScrollPanel extends SimpleFocusablePanel + implements HasScrollHandlers, ScrollHandler { public FocusableScrollPanel() { // Prevent IE standard mode bug when a AbsolutePanel is contained. @@ -131,7 +131,7 @@ public class FocusableScrollPanel extends SimpleFocusablePanel implements /** * Gets the horizontal scroll position. - * + * * @return the horizontal scroll position, in pixels */ public int getHorizontalScrollPosition() { @@ -140,7 +140,7 @@ public class FocusableScrollPanel extends SimpleFocusablePanel implements /** * Gets the vertical scroll position. - * + * * @return the vertical scroll position, in pixels */ public int getScrollPosition() { @@ -153,7 +153,7 @@ public class FocusableScrollPanel extends SimpleFocusablePanel implements /** * Sets the horizontal scroll position. - * + * * @param position * the new horizontal scroll position, in pixels */ @@ -163,7 +163,7 @@ public class FocusableScrollPanel extends SimpleFocusablePanel implements /** * Sets the vertical scroll position. - * + * * @param position * the new vertical scroll position, in pixels */ @@ -174,8 +174,8 @@ public class FocusableScrollPanel extends SimpleFocusablePanel implements .getElements(getElement()); for (com.google.gwt.dom.client.Element el : elements) { final Style style = el.getStyle(); - style.setProperty("webkitTransform", "translate3d(0px," - + -position + "px,0px)"); + style.setProperty("webkitTransform", + "translate3d(0px," + -position + "px,0px)"); } getElement().setPropertyInt("_vScrollTop", position); } else { diff --git a/client/src/main/java/com/vaadin/client/ui/FontIcon.java b/client/src/main/java/com/vaadin/client/ui/FontIcon.java index 74d094a0f2..d5a1e9579a 100644 --- a/client/src/main/java/com/vaadin/client/ui/FontIcon.java +++ b/client/src/main/java/com/vaadin/client/ui/FontIcon.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -27,7 +27,7 @@ import com.vaadin.shared.ApplicationConstants; * (identified by font-family, {@link #getFontFamily()}, * {@link #setFontFamily(String)}). *

    - * + * * @since 7.2 * @author Vaadin Ltd */ @@ -43,16 +43,17 @@ public class FontIcon extends Icon { @Override public void setUri(String uri) { - String[] parts = uri.substring( - ApplicationConstants.FONTICON_PROTOCOL_PREFIX.length()).split( - "/"); + String[] parts = uri + .substring( + ApplicationConstants.FONTICON_PROTOCOL_PREFIX.length()) + .split("/"); setFontFamily(URL.decode(parts[0])); setCodepoint(Integer.parseInt(parts[1], 16)); } /** * Not implemeted for {@link FontIcon} yet. - * + * * @see com.vaadin.client.ui.Icon#setAlternateText(java.lang.String) */ @Override @@ -66,7 +67,7 @@ public class FontIcon extends Icon { * Sets the font-family from which this icon comes. Use * {@link #setCodepoint(int)} to specify a particular icon (character) * within the font. - * + * * @param fontFamily * font-family name */ @@ -84,7 +85,7 @@ public class FontIcon extends Icon { * Gets the font-family from which this icon comes. Use * {@link #getCodepoint()} to find out which particular icon (character) * within the font this is. - * + * * @return font-family name */ public String getFontFamily() { @@ -94,7 +95,7 @@ public class FontIcon extends Icon { /** * Sets the codepoint indicating which particular icon (character) within * the font-family this is. - * + * * @param codepoint */ protected void setCodepoint(int codepoint) { @@ -105,7 +106,7 @@ public class FontIcon extends Icon { /** * Gets the codepoint indicating which particular icon (character) within * the font-family this is. - * + * * @return */ public int getCodepoint() { @@ -114,7 +115,7 @@ public class FontIcon extends Icon { /** * Get the font-family based stylename used to apply the font-family. - * + * * @since 7.2 * @return stylename used to apply font-family */ @@ -128,14 +129,14 @@ public class FontIcon extends Icon { /** * Checks whether or not the given uri is a font icon uri. Does not check * whether or not the font icon is available and can be rendered. - * + * * @since 7.2 * @param uri * @return true if it's a fonticon uri */ public static boolean isFontIconUri(String uri) { - return uri != null - && uri.startsWith(ApplicationConstants.FONTICON_PROTOCOL_PREFIX); + return uri != null && uri + .startsWith(ApplicationConstants.FONTICON_PROTOCOL_PREFIX); } @Override diff --git a/client/src/main/java/com/vaadin/client/ui/Icon.java b/client/src/main/java/com/vaadin/client/ui/Icon.java index 277fc2dd5d..f3cc3f3785 100644 --- a/client/src/main/java/com/vaadin/client/ui/Icon.java +++ b/client/src/main/java/com/vaadin/client/ui/Icon.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,7 +20,7 @@ import com.vaadin.client.ApplicationConnection; /** * An abstract representation of an icon. - * + * * @since 7.2 * @author Vaadin Ltd */ @@ -35,7 +35,7 @@ public abstract class Icon extends UIObject { * This might be a URL referencing a image (e.g {@link ImageIcon}) or a * custom URI (e.g {@link FontIcon}). *

    - * + * * @param uri * the URI for this icon */ @@ -43,14 +43,14 @@ public abstract class Icon extends UIObject { /** * Gets the current URI for this icon. - * + * * @return URI in use */ public abstract String getUri(); /** * Sets the alternate text for the icon. - * + * * @param alternateText * with the alternate text. */ diff --git a/client/src/main/java/com/vaadin/client/ui/ImageIcon.java b/client/src/main/java/com/vaadin/client/ui/ImageIcon.java index 7174c73637..b3e2166142 100644 --- a/client/src/main/java/com/vaadin/client/ui/ImageIcon.java +++ b/client/src/main/java/com/vaadin/client/ui/ImageIcon.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -28,7 +28,7 @@ import com.vaadin.client.BrowserInfo; * The image is loaded from the given URL ( {@link #setUri(String)}) and * displayed in full. *

    - * + * * @author Vaadin Ltd */ public class ImageIcon extends Icon { diff --git a/client/src/main/java/com/vaadin/client/ui/JavaScriptComponentConnector.java b/client/src/main/java/com/vaadin/client/ui/JavaScriptComponentConnector.java index a3a03b597b..c6be984759 100644 --- a/client/src/main/java/com/vaadin/client/ui/JavaScriptComponentConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/JavaScriptComponentConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/JavaScriptWidget.java b/client/src/main/java/com/vaadin/client/ui/JavaScriptWidget.java index da9192dace..7691888e76 100644 --- a/client/src/main/java/com/vaadin/client/ui/JavaScriptWidget.java +++ b/client/src/main/java/com/vaadin/client/ui/JavaScriptWidget.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/JsniMousewheelHandler.java b/client/src/main/java/com/vaadin/client/ui/JsniMousewheelHandler.java index 82ea768871..58ad36855a 100644 --- a/client/src/main/java/com/vaadin/client/ui/JsniMousewheelHandler.java +++ b/client/src/main/java/com/vaadin/client/ui/JsniMousewheelHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -24,9 +24,9 @@ import com.vaadin.client.widgets.Escalator; /** * A mousewheel handling class to get around the limits of * {@link Event#ONMOUSEWHEEL}. - * + * * For internal use only. May be removed or replaced in the future. - * + * * @see Escalator.JsniWorkaround */ abstract class JsniMousewheelHandler { @@ -34,7 +34,7 @@ abstract class JsniMousewheelHandler { /** * A JavaScript function that handles the mousewheel DOM event, and passes * it on to Java code. - * + * * @see #createMousewheelListenerFunction(Widget) */ protected final JavaScriptObject mousewheelListenerFunction; @@ -46,7 +46,7 @@ abstract class JsniMousewheelHandler { /** * A method that constructs the JavaScript function that will be stored into * {@link #mousewheelListenerFunction}. - * + * * @param widget * a reference to the current instance of {@link Widget} */ diff --git a/client/src/main/java/com/vaadin/client/ui/LayoutClickEventHandler.java b/client/src/main/java/com/vaadin/client/ui/LayoutClickEventHandler.java index 6eccb9cb3b..d5b731ca13 100644 --- a/client/src/main/java/com/vaadin/client/ui/LayoutClickEventHandler.java +++ b/client/src/main/java/com/vaadin/client/ui/LayoutClickEventHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -22,7 +22,8 @@ import com.vaadin.shared.EventId; import com.vaadin.shared.MouseEventDetails; import com.vaadin.shared.ui.LayoutClickRpc; -public abstract class LayoutClickEventHandler extends AbstractClickEventHandler { +public abstract class LayoutClickEventHandler + extends AbstractClickEventHandler { public LayoutClickEventHandler(ComponentConnector connector) { this(connector, EventId.LAYOUT_CLICK_EVENT_IDENTIFIER); diff --git a/client/src/main/java/com/vaadin/client/ui/LegacyConnector.java b/client/src/main/java/com/vaadin/client/ui/LegacyConnector.java index 35a82cff53..891f7f6a1d 100644 --- a/client/src/main/java/com/vaadin/client/ui/LegacyConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/LegacyConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/ManagedLayout.java b/client/src/main/java/com/vaadin/client/ui/ManagedLayout.java index e7266d99b5..ab17e4023b 100644 --- a/client/src/main/java/com/vaadin/client/ui/ManagedLayout.java +++ b/client/src/main/java/com/vaadin/client/ui/ManagedLayout.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/MediaBaseConnector.java b/client/src/main/java/com/vaadin/client/ui/MediaBaseConnector.java index fdd9610517..c2300de671 100644 --- a/client/src/main/java/com/vaadin/client/ui/MediaBaseConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/MediaBaseConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/PostLayoutListener.java b/client/src/main/java/com/vaadin/client/ui/PostLayoutListener.java index bbeb6f1255..ed108d91a8 100644 --- a/client/src/main/java/com/vaadin/client/ui/PostLayoutListener.java +++ b/client/src/main/java/com/vaadin/client/ui/PostLayoutListener.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -23,7 +23,7 @@ import com.vaadin.client.LayoutManager; * to know whenever a layout phase has ended. At the end of each layout phase, * {@link LayoutManager} invokes the {@link #postLayout()} method for all * registered component connectors implementing this interface. - * + * * @since 7.0 * @author Vaadin Ltd */ diff --git a/client/src/main/java/com/vaadin/client/ui/ShortcutActionHandler.java b/client/src/main/java/com/vaadin/client/ui/ShortcutActionHandler.java index a9d5f0731a..83214173dc 100644 --- a/client/src/main/java/com/vaadin/client/ui/ShortcutActionHandler.java +++ b/client/src/main/java/com/vaadin/client/ui/ShortcutActionHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -37,7 +37,7 @@ import com.vaadin.client.Util; * A helper class to implement keyboard shorcut handling. Keeps a list of owners * actions and fires actions to server. User class needs to delegate keyboard * events to handleKeyboardEvents function. - * + * * @author Vaadin Ltd */ public class ShortcutActionHandler { @@ -71,7 +71,7 @@ public class ShortcutActionHandler { * shortcut if the Paintable is currently focused (aka the target of the * shortcut action). Eg. a field can update its possibly changed value * to the server before shortcut action is fired. - * + * * @param e * the event that triggered the shortcut action */ @@ -83,7 +83,7 @@ public class ShortcutActionHandler { private String paintableId; /** - * + * * @param pid * Paintable id * @param c @@ -96,7 +96,7 @@ public class ShortcutActionHandler { /** * Updates list of actions this handler listens to. - * + * * @param c * UIDL snippet containing actions */ @@ -119,7 +119,8 @@ public class ShortcutActionHandler { } } - public void handleKeyboardEvent(final Event event, ComponentConnector target) { + public void handleKeyboardEvent(final Event event, + ComponentConnector target) { final int modifiers = KeyboardListenerCollection .getKeyboardModifiers(event); final char keyCode = (char) DOM.eventGetKeyCode(event); @@ -192,7 +193,7 @@ public class ShortcutActionHandler { * {@link BeforeShortcutActionListener} via widgets could be notified when * they should fire value change. Big task for TextFields, DateFields and * various selects. - * + * *

    * TODO separate opera impl with generator */ @@ -291,7 +292,8 @@ class ShortcutAction { private final String caption; private final String key; - public ShortcutAction(String key, ShortcutKeyCombination sc, String caption) { + public ShortcutAction(String key, ShortcutKeyCombination sc, + String caption) { this.sc = sc; this.key = key; this.caption = caption; diff --git a/client/src/main/java/com/vaadin/client/ui/SimpleFocusablePanel.java b/client/src/main/java/com/vaadin/client/ui/SimpleFocusablePanel.java index f938b2e74f..6d989988a7 100644 --- a/client/src/main/java/com/vaadin/client/ui/SimpleFocusablePanel.java +++ b/client/src/main/java/com/vaadin/client/ui/SimpleFocusablePanel.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -38,8 +38,8 @@ import com.vaadin.client.Focusable; * Compared to FocusPanel in GWT this panel does not support eg. accesskeys, but * is simpler by its dom hierarchy nor supports focusing via java api. */ -public class SimpleFocusablePanel extends SimplePanel implements - HasFocusHandlers, HasBlurHandlers, HasKeyDownHandlers, +public class SimpleFocusablePanel extends SimplePanel + implements HasFocusHandlers, HasBlurHandlers, HasKeyDownHandlers, HasKeyPressHandlers, Focusable { public SimpleFocusablePanel() { diff --git a/client/src/main/java/com/vaadin/client/ui/SimpleManagedLayout.java b/client/src/main/java/com/vaadin/client/ui/SimpleManagedLayout.java index e61e2799c4..4a4990e132 100644 --- a/client/src/main/java/com/vaadin/client/ui/SimpleManagedLayout.java +++ b/client/src/main/java/com/vaadin/client/ui/SimpleManagedLayout.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/SubPartAware.java b/client/src/main/java/com/vaadin/client/ui/SubPartAware.java index 7a40eea20e..4e8b861d01 100644 --- a/client/src/main/java/com/vaadin/client/ui/SubPartAware.java +++ b/client/src/main/java/com/vaadin/client/ui/SubPartAware.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,7 +20,7 @@ import com.google.gwt.user.client.ui.Widget; /** * Interface implemented by {@link Widget}s which can provide identifiers for at * least one element inside the component. - * + * */ public interface SubPartAware { @@ -28,7 +28,7 @@ public interface SubPartAware { * Locates an element inside a component using the identifier provided in * {@code subPart}. The {@code subPart} identifier is component specific and * may be any string of characters, numbers, space characters and brackets. - * + * * @param subPart * The identifier for the element inside the component * @return The element identified by subPart or null if the element could @@ -49,7 +49,7 @@ public interface SubPartAware { * identifier for the root element even though a DIV inside the button was * passed as {@code subElement} because interactions with the DIV and the * root button element produce the same result. - * + * * @param subElement * The element the identifier string should uniquely identify * @return An identifier that uniquely identifies {@code subElement} or null diff --git a/client/src/main/java/com/vaadin/client/ui/TouchScrollDelegate.java b/client/src/main/java/com/vaadin/client/ui/TouchScrollDelegate.java index f53b32b4e1..7ef673ad68 100644 --- a/client/src/main/java/com/vaadin/client/ui/TouchScrollDelegate.java +++ b/client/src/main/java/com/vaadin/client/ui/TouchScrollDelegate.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -57,26 +57,26 @@ import com.vaadin.client.VConsole; * Scroll event should only happen when the "touch scrolling actually ends". * Later we might also tune this so that a scroll event happens if user stalls * her finger long enought. - * + * * TODO static getter for active touch scroll delegate. Components might need to * prevent scrolling in some cases. Consider Table with drag and drop, or drag * and drop in scrollable area. Optimal implementation might be to start the * drag and drop only if user keeps finger down for a moment, otherwise do the * scroll. In this case, the draggable component would need to cancel scrolling * in a timer after touchstart event and take over from there. - * + * * TODO support scrolling horizontally - * + * * TODO cancel if user add second finger to the screen (user expects a gesture). - * + * * TODO "scrollbars", see e.g. iscroll.js - * + * * TODO write an email to sjobs √§t apple dot com and beg for this feature to be * built into webkit. Seriously, we should try to lobbying this to webkit folks. * This sure ain't our business to implement this with javascript. - * + * * TODO collect all general touch related constant to better place. - * + * * @author Matti Tahvonen, Vaadin Ltd */ public class TouchScrollDelegate implements NativePreviewHandler { @@ -129,12 +129,12 @@ public class TouchScrollDelegate implements NativePreviewHandler { /** * Attaches the scroll handler to the widget. This method must be called * before calling any other methods in this class. - * + * * @param widget * The widget that contains scrollable elements * @param scrollables * The elements of the widget that should be scrollable. - * + * * @deprecated Use {@link GWT#create(Class)} and * {@link #init(Widget, Element...)} instead of this * constructor to enable overriding. @@ -148,7 +148,7 @@ public class TouchScrollDelegate implements NativePreviewHandler { /** * Attaches the scroll handler to the widget. This method must be called * once before calling any other method in this class. - * + * * @param widget * The widget that contains scrollable elements * @param scrollables @@ -202,7 +202,7 @@ public class TouchScrollDelegate implements NativePreviewHandler { /** * Registers the given elements as scrollable, removing previously * registered scrollables from this handler. - * + * * @param scrollables * The elements that should be scrollable */ @@ -223,7 +223,7 @@ public class TouchScrollDelegate implements NativePreviewHandler { * scrolling of the device should be used. By default, relies on * {@link BrowserInfo#requiresTouchScrollDelegate()}, override to change * the behavior. - * + * * @return true if a Javascript delegate should be used for scrolling, * false to use the native scrolling of the device */ @@ -242,7 +242,7 @@ public class TouchScrollDelegate implements NativePreviewHandler { /** * Makes the given elements scrollable, either natively or by using a * TouchScrollDelegate, depending on platform capabilities. - * + * * @param widget * The widget that contains scrollable elements * @param scrollables @@ -270,7 +270,7 @@ public class TouchScrollDelegate implements NativePreviewHandler { /** * Has user moved the touch. - * + * * @return */ public boolean isMoved() { @@ -399,7 +399,7 @@ public class TouchScrollDelegate implements NativePreviewHandler { /** * Detects if a touch happens on a predefined element and the element has * something to scroll. - * + * * @param touch * @return */ @@ -480,7 +480,7 @@ public class TouchScrollDelegate implements NativePreviewHandler { private Animation momentum; /** - * + * * @param event * @return */ @@ -602,15 +602,15 @@ public class TouchScrollDelegate implements NativePreviewHandler { private void translateTo(double translateY) { for (Element el : layers) { Style style = el.getStyle(); - style.setProperty("webkitTransform", "translate3d(0px," - + translateY + "px,0px)"); + style.setProperty("webkitTransform", + "translate3d(0px," + translateY + "px,0px)"); } } /** * Note positive scrolltop moves layer up, positive translate moves layer * down. - * + * * @param duration */ private void translateTo(int duration, final int fromY, final int finalY) { @@ -621,8 +621,8 @@ public class TouchScrollDelegate implements NativePreviewHandler { @Override protected void onUpdate(double progress) { - lastAnimatedTranslateY = (fromY + (finalY - fromY) - * progress); + lastAnimatedTranslateY = (fromY + + (finalY - fromY) * progress); translateTo(lastAnimatedTranslateY); } @@ -651,8 +651,8 @@ public class TouchScrollDelegate implements NativePreviewHandler { } private int getMaxOverScroll() { - return androidWithBrokenScrollTop ? 0 : scrolledElement - .getClientHeight() / 3; + return androidWithBrokenScrollTop ? 0 + : scrolledElement.getClientHeight() / 3; } private int getMaxFinalY() { @@ -713,7 +713,7 @@ public class TouchScrollDelegate implements NativePreviewHandler { /** * long calcucation are not very efficient in GWT, so this helper method * returns timestamp in double. - * + * * @return */ public static double getTimeStamp() { diff --git a/client/src/main/java/com/vaadin/client/ui/TreeAction.java b/client/src/main/java/com/vaadin/client/ui/TreeAction.java index f190ab62d2..222c0f8108 100644 --- a/client/src/main/java/com/vaadin/client/ui/TreeAction.java +++ b/client/src/main/java/com/vaadin/client/ui/TreeAction.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -38,9 +38,9 @@ public class TreeAction extends Action { * Sends message to server that this action has been fired. Messages are * "standard" Vaadin messages whose value is comma separated pair of * targetKey (row, treeNod ...) and actions id. - * + * * Variablename is always "action". - * + * * Actions are always sent immediatedly to server. */ @Override diff --git a/client/src/main/java/com/vaadin/client/ui/UnknownComponentConnector.java b/client/src/main/java/com/vaadin/client/ui/UnknownComponentConnector.java index 50ded0aeba..bb06aa3507 100644 --- a/client/src/main/java/com/vaadin/client/ui/UnknownComponentConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/UnknownComponentConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -31,17 +31,13 @@ public class UnknownComponentConnector extends AbstractComponentConnector { } public void setServerSideClassName(String serverClassName) { - getWidget() - .setCaption( - "Widgetset '" - + GWT.getModuleName() - + "' does not contain implementation for " - + serverClassName - + ". Check its component connector's @Connect mapping, widgetsets " - + "GWT module description file and re-compile your" - + " widgetset. In case you have downloaded a vaadin" - + " add-on package, you might want to refer to " - + "add-on " - + "instructions."); + getWidget().setCaption("Widgetset '" + GWT.getModuleName() + + "' does not contain implementation for " + serverClassName + + ". Check its component connector's @Connect mapping, widgetsets " + + "GWT module description file and re-compile your" + + " widgetset. In case you have downloaded a vaadin" + + " add-on package, you might want to refer to " + + "add-on " + + "instructions."); } } diff --git a/client/src/main/java/com/vaadin/client/ui/VAbsoluteLayout.java b/client/src/main/java/com/vaadin/client/ui/VAbsoluteLayout.java index 44230288a7..880463dfa3 100644 --- a/client/src/main/java/com/vaadin/client/ui/VAbsoluteLayout.java +++ b/client/src/main/java/com/vaadin/client/ui/VAbsoluteLayout.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -53,7 +53,7 @@ public class VAbsoluteLayout extends ComplexPanel { /* * (non-Javadoc) - * + * * @see * com.google.gwt.user.client.ui.Panel#add(com.google.gwt.user.client.ui * .Widget) @@ -67,7 +67,7 @@ public class VAbsoluteLayout extends ComplexPanel { /* * (non-Javadoc) - * + * * @see * com.google.gwt.user.client.ui.ComplexPanel#remove(com.google.gwt.user * .client.ui.Widget) @@ -84,7 +84,7 @@ public class VAbsoluteLayout extends ComplexPanel { /** * Does this layout contain a widget - * + * * @param widget * The widget to check * @return Returns true if the widget is in this layout, false if not @@ -95,7 +95,7 @@ public class VAbsoluteLayout extends ComplexPanel { /* * (non-Javadoc) - * + * * @see com.google.gwt.user.client.ui.ComplexPanel#getWidget(int) */ @Override @@ -115,7 +115,7 @@ public class VAbsoluteLayout extends ComplexPanel { /* * (non-Javadoc) - * + * * @see com.google.gwt.user.client.ui.ComplexPanel#getWidgetCount() */ @Override @@ -131,7 +131,7 @@ public class VAbsoluteLayout extends ComplexPanel { /* * (non-Javadoc) - * + * * @see * com.google.gwt.user.client.ui.ComplexPanel#getWidgetIndex(com.google. * gwt.user.client.ui.Widget) @@ -153,7 +153,7 @@ public class VAbsoluteLayout extends ComplexPanel { /** * Sets a caption for a contained widget - * + * * @param child * The child widget to set the caption for * @param caption @@ -178,7 +178,7 @@ public class VAbsoluteLayout extends ComplexPanel { /** * Set the position of the widget in the layout. The position is a CSS * property string using properties such as top,left,right,top - * + * * @param child * The child widget to set the position for * @param position @@ -193,7 +193,7 @@ public class VAbsoluteLayout extends ComplexPanel { /** * Get the caption for a widget - * + * * @param child * The child widget to get the caption of */ @@ -207,7 +207,7 @@ public class VAbsoluteLayout extends ComplexPanel { /** * Get the pixel width of an slot in the layout - * + * * @param child * The widget in the layout. * @return Returns the size in pixels, or 0 if child is not in the layout @@ -222,7 +222,7 @@ public class VAbsoluteLayout extends ComplexPanel { /** * Get the pixel height of an slot in the layout - * + * * @param child * The widget in the layout * @return Returns the size in pixels, or 0 if the child is not in the @@ -238,7 +238,7 @@ public class VAbsoluteLayout extends ComplexPanel { /** * Get the wrapper for a widget - * + * * @param child * The child to get the wrapper for * @return @@ -257,7 +257,7 @@ public class VAbsoluteLayout extends ComplexPanel { /* * (non-Javadoc) - * + * * @see * com.google.gwt.user.client.ui.UIObject#setStylePrimaryName(java.lang. * String) @@ -269,7 +269,7 @@ public class VAbsoluteLayout extends ComplexPanel { /* * (non-Javadoc) - * + * * @see * com.google.gwt.user.client.ui.UIObject#setStyleName(java.lang.String) */ @@ -282,7 +282,7 @@ public class VAbsoluteLayout extends ComplexPanel { /** * Updates all style names contained in the layout - * + * * @param primaryStyleName * The style name to use as primary */ @@ -347,13 +347,14 @@ public class VAbsoluteLayout extends ComplexPanel { /** * Sets style names for the wrapper wrapping the widget in the layout. The * style names will be prefixed with v-absolutelayout-wrapper. - * + * * @param widget * The widget which wrapper we want to add the stylenames to * @param stylenames * The style names that should be added to the wrapper */ - public void setWidgetWrapperStyleNames(Widget widget, String... stylenames) { + public void setWidgetWrapperStyleNames(Widget widget, + String... stylenames) { AbsoluteWrapper wrapper = getChildWrapper(widget); if (wrapper == null) { throw new IllegalArgumentException( @@ -378,7 +379,7 @@ public class VAbsoluteLayout extends ComplexPanel { /** * Constructor - * + * * @param child * The child to wrap */ @@ -395,7 +396,7 @@ public class VAbsoluteLayout extends ComplexPanel { /** * Set the caption for the wrapper - * + * * @param caption * The caption for the wrapper */ @@ -420,7 +421,7 @@ public class VAbsoluteLayout extends ComplexPanel { /** * Set the position for the wrapper in the layout - * + * * @param position * The position string */ @@ -474,15 +475,15 @@ public class VAbsoluteLayout extends ComplexPanel { Style style = caption.getElement().getStyle(); style.setProperty("position", "absolute"); style.setPropertyPx("left", getElement().getOffsetLeft()); - style.setPropertyPx("top", getElement().getOffsetTop() - - caption.getHeight()); + style.setPropertyPx("top", + getElement().getOffsetTop() - caption.getHeight()); } } /** * Sets the style names of the wrapper. Will be prefixed with the * v-absolutelayout-wrapper prefix - * + * * @param stylenames * The wrapper style names */ @@ -495,8 +496,8 @@ public class VAbsoluteLayout extends ComplexPanel { * Updates the style names using the primary style name as prefix */ protected void updateStyleNames() { - setStyleName(VAbsoluteLayout.this.getStylePrimaryName() - + "-wrapper"); + setStyleName( + VAbsoluteLayout.this.getStylePrimaryName() + "-wrapper"); if (extraStyleNames != null) { for (String stylename : extraStyleNames) { addStyleDependentName(stylename); diff --git a/client/src/main/java/com/vaadin/client/ui/VAbstractSplitPanel.java b/client/src/main/java/com/vaadin/client/ui/VAbstractSplitPanel.java index 6c11783d34..06a773e0eb 100644 --- a/client/src/main/java/com/vaadin/client/ui/VAbstractSplitPanel.java +++ b/client/src/main/java/com/vaadin/client/ui/VAbstractSplitPanel.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -252,18 +252,17 @@ public abstract class VAbstractSplitPanel extends ComplexPanel { /** * Converts given split position string (in pixels or percentage) to a * floating point pixel value. - * + * * @param pos * @return */ private float convertToPixels(String pos) { float posAsFloat; if (pos.indexOf("%") > 0) { - posAsFloat = Math.round(Float.parseFloat(pos.substring(0, - pos.length() - 1)) - / 100 - * (orientation == Orientation.HORIZONTAL ? getOffsetWidth() - : getOffsetHeight())); + posAsFloat = Math + .round(Float.parseFloat(pos.substring(0, pos.length() - 1)) + / 100 * (orientation == Orientation.HORIZONTAL + ? getOffsetWidth() : getOffsetHeight())); } else { posAsFloat = Float.parseFloat(pos.substring(0, pos.length() - 2)); } @@ -273,16 +272,16 @@ public abstract class VAbstractSplitPanel extends ComplexPanel { /** * Converts given split position string (in pixels or percentage) to a float * percentage value. - * + * * @param pos * @return */ private float convertToPercentage(String pos) { if (pos.endsWith("px")) { - float pixelPosition = Float.parseFloat(pos.substring(0, - pos.length() - 2)); - int offsetLength = orientation == Orientation.HORIZONTAL ? getOffsetWidth() - : getOffsetHeight(); + float pixelPosition = Float + .parseFloat(pos.substring(0, pos.length() - 2)); + int offsetLength = orientation == Orientation.HORIZONTAL + ? getOffsetWidth() : getOffsetHeight(); // Take splitter size into account at the edge if (pixelPosition + getSplitterSize() >= offsetLength) { @@ -299,9 +298,9 @@ public abstract class VAbstractSplitPanel extends ComplexPanel { /** * Returns the given position clamped to the range between current minimum * and maximum positions. - * + * * TODO Should this be in the connector? - * + * * @param pos * Position of the splitter as a CSS string, either pixels or a * percentage. @@ -324,7 +323,7 @@ public abstract class VAbstractSplitPanel extends ComplexPanel { /** * Converts given string to the same units as the split position is. - * + * * @param pos * position to be converted * @return converted position string @@ -359,8 +358,8 @@ public abstract class VAbstractSplitPanel extends ComplexPanel { if (pos.indexOf("%") > 0) { int size = orientation == Orientation.HORIZONTAL ? getOffsetWidth() : getOffsetHeight(); - float percentage = Float.parseFloat(pos.substring(0, - pos.length() - 1)); + float percentage = Float + .parseFloat(pos.substring(0, pos.length() - 1)); pos = percentage / 100 * size + "px"; } @@ -419,7 +418,8 @@ public abstract class VAbstractSplitPanel extends ComplexPanel { } firstContainer.getStyle().setHeight(pixelPosition, Unit.PX); - int secondContainerHeight = (wholeSize - pixelPosition - getSplitterSize()); + int secondContainerHeight = (wholeSize - pixelPosition + - getSplitterSize()); if (secondContainerHeight < 0) { secondContainerHeight = 0; } @@ -468,7 +468,8 @@ public abstract class VAbstractSplitPanel extends ComplexPanel { } firstContainer.getStyle().setWidth(pixelPosition, Unit.PX); - int secondContainerWidth = (wholeSize - pixelPosition - getSplitterSize()); + int secondContainerWidth = (wholeSize - pixelPosition + - getSplitterSize()); if (secondContainerWidth < 0) { secondContainerWidth = 0; } @@ -605,21 +606,21 @@ public abstract class VAbstractSplitPanel extends ComplexPanel { /** * Called when starting drag resize - * + * * @since 7.5.1 */ abstract protected void startResize(); /** * Called when stopping drag resize - * + * * @since 7.5.1 */ abstract protected void stopResize(); /** * Gets the first container - * + * * @since 7.5.1 * @return the firstContainer */ @@ -629,7 +630,7 @@ public abstract class VAbstractSplitPanel extends ComplexPanel { /** * Gets the second container - * + * * @since 7.5.1 * @return the secondContainer */ @@ -732,8 +733,8 @@ public abstract class VAbstractSplitPanel extends ComplexPanel { public interface SplitterMoveHandler extends EventHandler { public void splitterMoved(SplitterMoveEvent event); - public static class SplitterMoveEvent extends - GwtEvent { + public static class SplitterMoveEvent + extends GwtEvent { public static final Type TYPE = new Type(); @@ -784,7 +785,7 @@ public abstract class VAbstractSplitPanel extends ComplexPanel { /** * A dragging curtain is required in Gecko and Webkit. - * + * * @return true if the browser requires a dragging curtain */ private boolean isDraggingCurtainRequired() { @@ -836,8 +837,8 @@ public abstract class VAbstractSplitPanel extends ComplexPanel { secondContainer.setClassName(secondContainerClass); for (String styleName : componentStyleNames) { - splitter.addClassName(splitterClass + "-" + styleName - + lockedSuffix); + splitter.addClassName( + splitterClass + "-" + styleName + lockedSuffix); firstContainer.addClassName(firstContainerClass + "-" + styleName); secondContainer .addClassName(secondContainerClass + "-" + styleName); diff --git a/client/src/main/java/com/vaadin/client/ui/VAccordion.java b/client/src/main/java/com/vaadin/client/ui/VAccordion.java index afc66d0f7b..0e202c3153 100644 --- a/client/src/main/java/com/vaadin/client/ui/VAccordion.java +++ b/client/src/main/java/com/vaadin/client/ui/VAccordion.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -151,8 +151,8 @@ public class VAccordion extends VTabsheetBase { addStyleDependentName("loading"); - connector.getRpcProxy(TabsheetServerRpc.class).setSelected( - tabKeys.get(index).toString()); + connector.getRpcProxy(TabsheetServerRpc.class) + .setSelected(tabKeys.get(index).toString()); } } @@ -210,7 +210,7 @@ public class VAccordion extends VTabsheetBase { /** * Returns caption width including padding - * + * * @return */ public int getCaptionWidth() { @@ -333,10 +333,10 @@ public class VAccordion extends VTabsheetBase { /** * Updates the content of the open tab of the accordion. - * + * * This method is mostly for internal use and may change in future * versions. - * + * * @since 7.2 * @param newWidget * new content @@ -361,13 +361,11 @@ public class VAccordion extends VTabsheetBase { public void updateCaption(TabState tabState) { // TODO need to call this because the caption does not have an owner caption.setCaptionAsHtml(isTabCaptionsAsHtml()); - caption.updateCaptionWithoutOwner( - tabState.caption, - !tabState.enabled, - hasAttribute(tabState.description), + caption.updateCaptionWithoutOwner(tabState.caption, + !tabState.enabled, hasAttribute(tabState.description), hasAttribute(tabState.componentError), - connector.getResourceUrl(ComponentConstants.ICON_RESOURCE - + tabState.key)); + connector.getResourceUrl( + ComponentConstants.ICON_RESOURCE + tabState.key)); } private boolean hasAttribute(String string) { @@ -376,7 +374,7 @@ public class VAccordion extends VTabsheetBase { /** * Updates a tabs stylename from the child UIDL - * + * * @param uidl * The child uidl of the tab */ diff --git a/client/src/main/java/com/vaadin/client/ui/VAudio.java b/client/src/main/java/com/vaadin/client/ui/VAudio.java index 109e4d65b0..f77a74fd06 100644 --- a/client/src/main/java/com/vaadin/client/ui/VAudio.java +++ b/client/src/main/java/com/vaadin/client/ui/VAudio.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/VBrowserFrame.java b/client/src/main/java/com/vaadin/client/ui/VBrowserFrame.java index 2c4011e87d..d6ecda6425 100644 --- a/client/src/main/java/com/vaadin/client/ui/VBrowserFrame.java +++ b/client/src/main/java/com/vaadin/client/ui/VBrowserFrame.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -40,7 +40,7 @@ public class VBrowserFrame extends Widget { /** * Always creates new iframe inside widget. Will replace previous iframe. - * + * * @return */ protected IFrameElement createIFrameElement(String src) { @@ -109,7 +109,7 @@ public class VBrowserFrame extends Widget { /** * Set the source (the "src" attribute) of iframe. Will replace old iframe * with new. - * + * * @param source * Source of iframe. */ diff --git a/client/src/main/java/com/vaadin/client/ui/VButton.java b/client/src/main/java/com/vaadin/client/ui/VButton.java index 2eb967c4fa..e3d8908c9d 100644 --- a/client/src/main/java/com/vaadin/client/ui/VButton.java +++ b/client/src/main/java/com/vaadin/client/ui/VButton.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -138,14 +138,14 @@ public class VButton extends FocusWidget implements ClickHandler { @Override /* * Copy-pasted from GWT CustomButton, some minor modifications done: - * + * * -for IE/Opera added CLASSNAME_PRESSED - * + * * -event.preventDefault() removed from ONMOUSEDOWN (Firefox won't apply * :active styles if it is present) - * + * * -Tooltip event handling added - * + * * -onload event handler added (for icon handling) */ public void onBrowserEvent(Event event) { @@ -168,8 +168,8 @@ public class VButton extends FocusWidget implements ClickHandler { boolean isPhantomClickPossible = BrowserInfo.get().isSafari() && BrowserInfo.get().isTouchDevice() && BrowserInfo.get().getBrowserMajorVersion() == 8; - long clickTime = isPhantomClickPossible ? System - .currentTimeMillis() : 0; + long clickTime = isPhantomClickPossible ? System.currentTimeMillis() + : 0; // If clicks are currently disallowed or phantom, keep it from // bubbling or being passed to the superclass. if (disallowNextClick || isPhantomClickPossible @@ -251,8 +251,10 @@ public class VButton extends FocusWidget implements ClickHandler { case Event.ONMOUSEOUT: if (isTargetInsideButton(event)) { if (clickPending - && Math.abs(mousedownX - event.getClientX()) < MOVE_THRESHOLD - && Math.abs(mousedownY - event.getClientY()) < MOVE_THRESHOLD) { + && Math.abs(mousedownX + - event.getClientX()) < MOVE_THRESHOLD + && Math.abs(mousedownY + - event.getClientY()) < MOVE_THRESHOLD) { onClick(); break; } @@ -330,7 +332,7 @@ public class VButton extends FocusWidget implements ClickHandler { /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.ClickHandler#onClick(com.google.gwt.event * .dom.client.ClickEvent) @@ -382,7 +384,7 @@ public class VButton extends FocusWidget implements ClickHandler { /** * Sets whether this button is enabled. - * + * * @param enabled * true to enable the button, false to * disable it @@ -447,7 +449,7 @@ public class VButton extends FocusWidget implements ClickHandler { // Revert the changed values elem.style.left = left; elem.runtimeStyle.left = rsLeft; - + return ret; } @@ -466,7 +468,7 @@ public class VButton extends FocusWidget implements ClickHandler { ret += parseInt(value.substr(0, value.length-2)); } } - + // Padding ------------------------------------------------------- value = elem.currentStyle["padding"+side]; if ( !/^\d+(px)?$/i.test( value ) && /^\d/.test( value ) ) { diff --git a/client/src/main/java/com/vaadin/client/ui/VCalendar.java b/client/src/main/java/com/vaadin/client/ui/VCalendar.java index 08d4351931..2c600d2bb9 100644 --- a/client/src/main/java/com/vaadin/client/ui/VCalendar.java +++ b/client/src/main/java/com/vaadin/client/ui/VCalendar.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -45,7 +45,7 @@ import com.vaadin.shared.ui.calendar.DateConstants; /** * Client side implementation for Calendar - * + * * @since 7.1 * @author Vaadin Ltd. */ @@ -106,7 +106,7 @@ public class VCalendar extends Composite implements VHasDropHandler { public interface DateClickListener { /** * Triggered when a date was clicked - * + * * @param date * The date and time that was clicked */ @@ -119,7 +119,7 @@ public class VCalendar extends Composite implements VHasDropHandler { public interface WeekClickListener { /** * Called when a week number was selected. - * + * * @param event * The format of the vent string is "w" */ @@ -156,9 +156,9 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Called when a user selected a new event by highlighting an area of * the calendar. - * + * * FIXME Fix the value nonsense. - * + * * @param value * The format of the value string is * "::" if called from the @@ -174,7 +174,7 @@ public class VCalendar extends Composite implements VHasDropHandler { public interface EventClickListener { /** * Called when an event was clicked - * + * * @param event * The event that was clicked */ @@ -189,7 +189,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Triggered when an event was dragged to a new position and the start * and end dates was changed - * + * * @param event * The event that was moved */ @@ -203,7 +203,7 @@ public class VCalendar extends Composite implements VHasDropHandler { public interface EventResizeListener { /** * Triggers when the time limits for the event was changed. - * + * * @param event * The event that was changed. The new time limits have been * updated in the event before calling this method @@ -217,7 +217,7 @@ public class VCalendar extends Composite implements VHasDropHandler { public interface ScrollListener { /** * Triggered when the calendar is scrolled - * + * * @param scrollPosition * The scroll position in pixels as returned by * {@link ScrollPanel#getScrollPosition()} @@ -231,10 +231,10 @@ public class VCalendar extends Composite implements VHasDropHandler { public interface MouseEventListener { /** * Triggered when a user wants an context menu - * + * * @param event * The context menu event - * + * * @param widget * The widget that the context menu should be added to */ @@ -253,7 +253,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Hack for IE to not select text when dragging. - * + * * @param e * The element to apply the hack on */ @@ -292,13 +292,13 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Adds events to the month grid - * + * * @param events * The events to add * @param drawImmediately * Should the grid be rendered immediately. (currently not in * use) - * + * */ public void updateEventsToMonthGrid(Collection events, boolean drawImmediately) { @@ -308,7 +308,8 @@ public class VCalendar extends Composite implements VHasDropHandler { } } - private void addEventToMonthGrid(CalendarEvent e, boolean renderImmediately) { + private void addEventToMonthGrid(CalendarEvent e, + boolean renderImmediately) { Date when = e.getStart(); Date to = e.getEnd(); boolean eventAdded = false; @@ -374,7 +375,8 @@ public class VCalendar extends Composite implements VHasDropHandler { && from.getDay() != to.getDay() && isMidnight(endTime))); } - private void updateEventSlotIndex(CalendarEvent e, List cells) { + private void updateEventSlotIndex(CalendarEvent e, + List cells) { if (cells.isEmpty()) { return; } @@ -424,10 +426,10 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Remove a month event from the view - * + * * @param target * The event to remove - * + * * @param repaintImmediately * Should we repaint after the event was removed? */ @@ -437,8 +439,8 @@ public class VCalendar extends Composite implements VHasDropHandler { // Remove event for (int row = 0; row < monthGrid.getRowCount(); row++) { for (int cell = 0; cell < monthGrid.getCellCount(row); cell++) { - SimpleDayCell sdc = (SimpleDayCell) monthGrid.getWidget( - row, cell); + SimpleDayCell sdc = (SimpleDayCell) monthGrid.getWidget(row, + cell); if (sdc == null) { return; } @@ -450,7 +452,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Updates an event in the month grid - * + * * @param changedEvent * The event that has changed */ @@ -462,12 +464,13 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Sort the event by how long they are - * + * * @param events * The events to sort * @return An array where the events has been sorted */ - public CalendarEvent[] sortEventsByDuration(Collection events) { + public CalendarEvent[] sortEventsByDuration( + Collection events) { CalendarEvent[] sorted = events .toArray(new CalendarEvent[events.size()]); Arrays.sort(sorted, getEventComparator()); @@ -489,7 +492,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Re-render the week grid - * + * * @param daysCount * The amount of days to include in the week * @param days @@ -541,11 +544,11 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Updates the events in the Month view - * + * * @param daysCount * How many days there are * @param daysUidl - * + * * @param today * Todays date */ @@ -649,13 +652,13 @@ public class VCalendar extends Composite implements VHasDropHandler { monthGrid.updateCellSizes(intWidth - weekToolbar.getOffsetWidth(), intHeight - nameToolbar.getOffsetHeight()); - weekToolbar.setHeightPX((intHeight == -1) ? intHeight : intHeight - - nameToolbar.getOffsetHeight()); + weekToolbar.setHeightPX((intHeight == -1) ? intHeight + : intHeight - nameToolbar.getOffsetHeight()); } else if (weekGrid != null) { - weekGrid.setHeightPX((intHeight == -1) ? intHeight : intHeight - - weeklyLongEvents.getOffsetHeight() - - dayToolbar.getOffsetHeight()); + weekGrid.setHeightPX((intHeight == -1) ? intHeight + : intHeight - weeklyLongEvents.getOffsetHeight() + - dayToolbar.getOffsetHeight()); } } @@ -669,8 +672,8 @@ public class VCalendar extends Composite implements VHasDropHandler { if (monthGrid != null) { monthGrid.updateCellSizes( - intWidth - weekToolbar.getOffsetWidth(), intHeight - - nameToolbar.getOffsetHeight()); + intWidth - weekToolbar.getOffsetWidth(), + intHeight - nameToolbar.getOffsetHeight()); } else if (weekGrid != null) { weekGrid.setWidthPX(intWidth); weeklyLongEvents.setWidthPX(weekGrid.getInternalWidth()); @@ -695,7 +698,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Get the date format used to format dates only (excludes time) - * + * * @return */ public DateTimeFormat getDateFormat() { @@ -704,7 +707,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Get the time format used to format time only (excludes date) - * + * * @return */ public DateTimeFormat getTimeFormat() { @@ -717,7 +720,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Get the date and time format to format the dates (includes both date and * time) - * + * * @return */ public DateTimeFormat getDateTimeFormat() { @@ -726,7 +729,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Is the calendar either disabled or readonly - * + * * @return */ public boolean isDisabledOrReadOnly() { @@ -742,7 +745,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Is the component disabled - * + * * @param disabled * True if disabled */ @@ -759,7 +762,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Is the component read-only - * + * * @param readOnly * True if component is readonly */ @@ -769,7 +772,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Get the month grid component - * + * * @return */ public MonthGrid getMonthGrid() { @@ -778,7 +781,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Get he week grid component - * + * * @return */ public WeekGrid getWeekGrid() { @@ -788,7 +791,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Calculates correct size for all cells (size / amount of cells ) and * distributes any overflow over all the cells. - * + * * @param totalSize * the total amount of size reserved for all cells * @param numberOfCells @@ -826,7 +829,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Returns a comparator which can compare calendar events. - * + * * @return */ public static Comparator getEventComparator() { @@ -846,8 +849,9 @@ public class VCalendar extends Composite implements VHasDropHandler { int r = 0; if (!d1.equals(0L) && !d2.equals(0L)) { r = d2.compareTo(d1); - return (r == 0) ? ((Integer) o2.getIndex()).compareTo(o1 - .getIndex()) : r; + return (r == 0) + ? ((Integer) o2.getIndex()).compareTo(o1.getIndex()) + : r; } if (d2.equals(0L) && d1.equals(0L)) { @@ -862,29 +866,30 @@ public class VCalendar extends Composite implements VHasDropHandler { return -1; } r = d2.compareTo(d1); - return (r == 0) ? ((Integer) o2.getIndex()).compareTo(o1 - .getIndex()) : r; + return (r == 0) + ? ((Integer) o2.getIndex()).compareTo(o1.getIndex()) + : r; } }; } /** * Is the date at midnight - * + * * @param date * The date to check - * + * * @return */ @SuppressWarnings("deprecation") public static boolean isMidnight(Date date) { - return (date.getHours() == 0 && date.getMinutes() == 0 && date - .getSeconds() == 0); + return (date.getHours() == 0 && date.getMinutes() == 0 + && date.getSeconds() == 0); } /** * Are the dates equal (uses second resolution) - * + * * @param date1 * The first the to compare * @param date2 @@ -902,7 +907,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Is the calendar event zero seconds long and is occurring at midnight - * + * * @param event * The event to check * @return @@ -914,7 +919,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Should the 24h time format be used - * + * * @param format * True if the 24h format should be used else the 12h format is * used @@ -932,7 +937,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Set the names of the week days - * + * * @param names * The names of the days (Monday, Thursday,...) */ @@ -950,7 +955,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Set the names of the months - * + * * @param names * The names of the months (January, February,...) */ @@ -968,7 +973,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Set the number when a week starts - * + * * @param dayNumber * The number of the day */ @@ -986,7 +991,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Set the number when a week ends - * + * * @param dayNumber * The number of the day */ @@ -1004,7 +1009,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Set the number when a week starts - * + * * @param dayNumber * The number of the day */ @@ -1022,7 +1027,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Set the number when a week ends - * + * * @param dayNumber * The number of the day */ @@ -1040,7 +1045,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Re-renders the whole week view - * + * * @param scroll * The amount of pixels to scroll the week view * @param today @@ -1090,7 +1095,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Re-renders the whole month view - * + * * @param firstDayOfWeek * The first day of the week * @param today @@ -1102,9 +1107,8 @@ public class VCalendar extends Composite implements VHasDropHandler { * @param days * The day information */ - public void updateMonthView(int firstDayOfWeek, Date today, - int daysInMonth, Collection events, - List days) { + public void updateMonthView(int firstDayOfWeek, Date today, int daysInMonth, + Collection events, List days) { // Remove all week numbers from bar while (outer.getWidgetCount() > 0) { @@ -1152,7 +1156,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Sets the listener for listening to event clicks - * + * * @param listener * The listener to use */ @@ -1162,7 +1166,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Gets the listener for listening to event clicks - * + * * @return */ public DateClickListener getDateClickListener() { @@ -1173,7 +1177,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Set the listener which listens to forward events from the calendar - * + * * @param listener * The listener to use */ @@ -1183,7 +1187,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Get the listener which listens to forward events from the calendar - * + * * @return */ public ForwardListener getForwardListener() { @@ -1194,7 +1198,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Set the listener which listens to backward events from the calendar - * + * * @param listener * The listener to use */ @@ -1204,7 +1208,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Set the listener which listens to backward events from the calendar - * + * * @return */ public BackwardListener getBackwardListener() { @@ -1215,7 +1219,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Set the listener that listens to user clicking on the week numbers - * + * * @param listener * The listener to use */ @@ -1225,7 +1229,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Get the listener that listens to user clicking on the week numbers - * + * * @return */ public WeekClickListener getWeekClickListener() { @@ -1237,7 +1241,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Set the listener that listens to the user highlighting a region in the * calendar - * + * * @param listener * The listener to use */ @@ -1248,7 +1252,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Get the listener that listens to the user highlighting a region in the * calendar - * + * * @return */ public RangeSelectListener getRangeSelectListener() { @@ -1266,7 +1270,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Set the listener that listens to the user clicking on the events - * + * * @param listener * The listener to use */ @@ -1278,7 +1282,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Get the listener that listens to when event is dragged to a new location - * + * * @return */ public EventMovedListener getEventMovedListener() { @@ -1287,7 +1291,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Set the listener that listens to when event is dragged to a new location - * + * * @param eventMovedListener * The listener to use */ @@ -1299,7 +1303,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Get the listener that listens to when the calendar widget is scrolled - * + * * @return */ public ScrollListener getScrollListener() { @@ -1308,7 +1312,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Set the listener that listens to when the calendar widget is scrolled - * + * * @param scrollListener * The listener to use */ @@ -1321,7 +1325,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Get the listener that listens to when an events time limits are being * adjusted - * + * * @return */ public EventResizeListener getEventResizeListener() { @@ -1331,7 +1335,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Set the listener that listens to when an events time limits are being * adjusted - * + * * @param eventResizeListener * The listener to use */ @@ -1346,7 +1350,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Get the listener that listen to mouse events - * + * * @return */ public MouseEventListener getMouseEventListener() { @@ -1355,7 +1359,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Set the listener that listen to mouse events - * + * * @param mouseEventListener * The listener to use */ @@ -1372,7 +1376,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Set selecting a range allowed - * + * * @param rangeSelectAllowed * Should selecting a range be allowed */ @@ -1382,7 +1386,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Is moving a range allowed - * + * * @return */ public boolean isRangeMoveAllowed() { @@ -1391,7 +1395,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Is moving a range allowed - * + * * @param rangeMoveAllowed * Is it allowed */ @@ -1408,7 +1412,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Is resizing an event allowed - * + * * @param eventResizeAllowed * True if allowed false if not */ @@ -1425,7 +1429,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Is moving an event allowed - * + * * @param eventMoveAllowed * True if moving is allowed, false if not */ @@ -1451,7 +1455,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /* * (non-Javadoc) - * + * * @see com.vaadin.client.ui.dd.VHasDropHandler#getDropHandler() */ @Override @@ -1461,7 +1465,7 @@ public class VCalendar extends Composite implements VHasDropHandler { /** * Set the drop handler - * + * * @param dropHandler * The drophandler to use */ @@ -1477,7 +1481,7 @@ public class VCalendar extends Composite implements VHasDropHandler { * false, the caption is rendered in the browser as plain text. *

    * The default is false, i.e. to render that caption as plain text. - * + * * @param captionAsHtml * true if the captions are rendered as HTML, false if rendered * as plain text @@ -1490,7 +1494,7 @@ public class VCalendar extends Composite implements VHasDropHandler { * Checks whether event captions are rendered as HTML *

    * The default is false, i.e. to render that caption as plain text. - * + * * @return true if the captions are rendered as HTML, false if rendered as * plain text */ diff --git a/client/src/main/java/com/vaadin/client/ui/VCalendarPanel.java b/client/src/main/java/com/vaadin/client/ui/VCalendarPanel.java index e1b906b6e4..4b3ebff766 100644 --- a/client/src/main/java/com/vaadin/client/ui/VCalendarPanel.java +++ b/client/src/main/java/com/vaadin/client/ui/VCalendarPanel.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -132,7 +132,7 @@ public class VCalendarPanel extends FocusableFlexTable implements private ClickHandler dayClickHandler = new ClickHandler() { /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.ClickHandler#onClick(com.google.gwt * .event.dom.client.ClickEvent) @@ -231,14 +231,15 @@ public class VCalendarPanel extends FocusableFlexTable implements /** * Sets the focus to given date in the current view. Used when moving in the * calendar with the keyboard. - * + * * @param date * A Date representing the day of month to be focused. Must be * one of the days currently visible. */ private void focusDay(Date date) { // Only used when calender body is present - if (resolution.getCalendarField() > Resolution.MONTH.getCalendarField()) { + if (resolution.getCalendarField() > Resolution.MONTH + .getCalendarField()) { if (focusedDay != null) { focusedDay.removeStyleDependentName(CN_FOCUSED); } @@ -266,17 +267,17 @@ public class VCalendarPanel extends FocusableFlexTable implements /** * Sets the selection highlight to a given day in the current view - * + * * @param date * A Date representing the day of month to be selected. Must be * one of the days currently visible. - * + * */ private void selectDate(Date date) { if (selectedDay != null) { selectedDay.removeStyleDependentName(CN_SELECTED); - Roles.getGridcellRole().removeAriaSelectedState( - selectedDay.getElement()); + Roles.getGridcellRole() + .removeAriaSelectedState(selectedDay.getElement()); } int rowCount = days.getRowCount(); @@ -396,7 +397,7 @@ public class VCalendarPanel extends FocusableFlexTable implements /** * Builds the top buttons and current month and year header. - * + * * @param needsMonth * Should the month buttons be visible? */ @@ -446,8 +447,8 @@ public class VCalendarPanel extends FocusableFlexTable implements updateControlButtonRangeStyles(needsMonth); - final String monthName = needsMonth ? getDateTimeService().getMonth( - displayedMonth.getMonth()) : ""; + final String monthName = needsMonth + ? getDateTimeService().getMonth(displayedMonth.getMonth()) : ""; final int year = displayedMonth.getYear() + 1900; getFlexCellFormatter().setStyleName(0, 2, @@ -461,9 +462,10 @@ public class VCalendarPanel extends FocusableFlexTable implements getFlexCellFormatter().setStyleName(0, 1, parent.getStylePrimaryName() + "-calendarpanel-prevmonth"); - setHTML(0, 2, "" + monthName + " " + year - + ""); + setHTML(0, 2, + "" + monthName + " " + year + + ""); } private void updateControlButtonRangeStyles(boolean needsMonth) { @@ -520,7 +522,7 @@ public class VCalendarPanel extends FocusableFlexTable implements * Returns whether ISO 8601 week numbers should be shown in the value * selector or not. ISO 8601 defines that a week always starts with a Monday * so the week numbers are only shown if this is the case. - * + * * @return true if week number should be shown, false otherwise */ public boolean isShowISOWeekNumbers() { @@ -533,7 +535,7 @@ public class VCalendarPanel extends FocusableFlexTable implements /** * Checks inclusively whether a date is inside a range of dates or not. - * + * * @param date * @return */ @@ -550,12 +552,13 @@ public class VCalendarPanel extends FocusableFlexTable implements * day-basis. If the resolution is set to YEAR, only years are compared. So * even if the range is set to one millisecond in next year, also next year * will be included. - * + * * @param date * @param minResolution * @return */ - private boolean isAcceptedByRangeStart(Date date, Resolution minResolution) { + private boolean isAcceptedByRangeStart(Date date, + Resolution minResolution) { assert (date != null); // rangeStart == null means that we accept all values below rangeEnd @@ -586,7 +589,7 @@ public class VCalendarPanel extends FocusableFlexTable implements * day-basis. If the resolution is set to YEAR, only years are compared. So * even if the range is set to one millisecond in next year, also next year * will be included. - * + * * @param date * @param minResolution * @return @@ -663,11 +666,9 @@ public class VCalendarPanel extends FocusableFlexTable implements "v-first"); days.getFlexCellFormatter().setStyleName(headerRow, firstWeekdayColumn, ""); - days.getRowFormatter() - .addStyleName( - headerRow, - parent.getStylePrimaryName() - + "-calendarpanel-weeknumbers"); + days.getRowFormatter().addStyleName(headerRow, + parent.getStylePrimaryName() + + "-calendarpanel-weeknumbers"); } else { days.getFlexCellFormatter().setStyleName(headerRow, weekColumn, ""); days.getFlexCellFormatter().setStyleName(headerRow, @@ -692,9 +693,8 @@ public class VCalendarPanel extends FocusableFlexTable implements days.setHTML(headerRow, firstWeekdayColumn + i, ""); } - Roles.getColumnheaderRole().set( - days.getCellFormatter().getElement(headerRow, - firstWeekdayColumn + i)); + Roles.getColumnheaderRole().set(days.getCellFormatter() + .getElement(headerRow, firstWeekdayColumn + i)); } // Zero out hours, minutes, seconds, and milliseconds to compare dates @@ -703,11 +703,11 @@ public class VCalendarPanel extends FocusableFlexTable implements final Date today = new Date(tmp.getYear(), tmp.getMonth(), tmp.getDate()); - final Date selectedDate = value == null ? null : new Date( - value.getYear(), value.getMonth(), value.getDate()); + final Date selectedDate = value == null ? null + : new Date(value.getYear(), value.getMonth(), value.getDate()); - final int startWeekDay = getDateTimeService().getStartWeekDay( - displayedMonth); + final int startWeekDay = getDateTimeService() + .getStartWeekDay(displayedMonth); final Date curr = (Date) displayedMonth.clone(); // Start from the first day of the week that at least partially belongs // to the current month @@ -721,8 +721,8 @@ public class VCalendarPanel extends FocusableFlexTable implements Date dayDate = (Date) curr.clone(); Day day = new Day(dayDate); - day.setStyleName(parent.getStylePrimaryName() - + "-calendarpanel-day"); + day.setStyleName( + parent.getStylePrimaryName() + "-calendarpanel-day"); if (!isDateInsideRange(dayDate, Resolution.DAY)) { day.addStyleDependentName(CN_OUTSIDE_RANGE); @@ -747,10 +747,10 @@ public class VCalendarPanel extends FocusableFlexTable implements day.addStyleDependentName(CN_OFFMONTH); } - days.setWidget(weekOfMonth, firstWeekdayColumn + dayOfWeek, day); - Roles.getGridcellRole().set( - days.getCellFormatter().getElement(weekOfMonth, - firstWeekdayColumn + dayOfWeek)); + days.setWidget(weekOfMonth, firstWeekdayColumn + dayOfWeek, + day); + Roles.getGridcellRole().set(days.getCellFormatter().getElement( + weekOfMonth, firstWeekdayColumn + dayOfWeek)); // ISO week numbers if requested days.getCellFormatter().setVisible(weekOfMonth, weekColumn, @@ -763,9 +763,8 @@ public class VCalendarPanel extends FocusableFlexTable implements int weekNumber = DateTimeService.getISOWeekNumber(curr); - days.setHTML(weekOfMonth, 0, "" + weekNumber - + ""); + days.setHTML(weekOfMonth, 0, "" + weekNumber + ""); } curr.setDate(curr.getDate() + 1); } @@ -774,7 +773,7 @@ public class VCalendarPanel extends FocusableFlexTable implements /** * Do we need the time selector - * + * * @return True if it is required */ private boolean isTimeSelectorNeeded() { @@ -791,9 +790,9 @@ public class VCalendarPanel extends FocusableFlexTable implements /** * For internal use only. May be removed or replaced in the future. - * + * * Updates the calendar and text field with the selected dates. - * + * * @param updateDate * The value false prevents setting the selected date of the * calendar based on focusedDate. That can be used when only the @@ -802,8 +801,8 @@ public class VCalendarPanel extends FocusableFlexTable implements */ public void renderCalendar(boolean updateDate) { - super.setStylePrimaryName(parent.getStylePrimaryName() - + "-calendarpanel"); + super.setStylePrimaryName( + parent.getStylePrimaryName() + "-calendarpanel"); if (focusedDate == null) { Date now = new Date(); @@ -813,14 +812,13 @@ public class VCalendarPanel extends FocusableFlexTable implements displayedMonth = new FocusedDate(now.getYear(), now.getMonth(), 1); } - if (updateDate - && getResolution().getCalendarField() <= Resolution.MONTH - .getCalendarField() && focusChangeListener != null) { + if (updateDate && getResolution().getCalendarField() <= Resolution.MONTH + .getCalendarField() && focusChangeListener != null) { focusChangeListener.focusChanged(new Date(focusedDate.getTime())); } - final boolean needsMonth = getResolution().getCalendarField() > Resolution.YEAR - .getCalendarField(); + final boolean needsMonth = getResolution() + .getCalendarField() > Resolution.YEAR.getCalendarField(); boolean needsBody = getResolution().getCalendarField() >= Resolution.DAY .getCalendarField(); buildCalendarHeader(needsMonth); @@ -901,7 +899,8 @@ public class VCalendarPanel extends FocusableFlexTable implements // inside, // correct it if (!isDateInsideRange(requestedNextMonthDate, Resolution.DAY)) { - requestedNextMonthDate = adjustDateToFitInsideRange(requestedNextMonthDate); + requestedNextMonthDate = adjustDateToFitInsideRange( + requestedNextMonthDate); } focusedDate.setTime(requestedNextMonthDate.getTime()); @@ -957,7 +956,8 @@ public class VCalendarPanel extends FocusableFlexTable implements } if (!isDateInsideRange(requestedPreviousMonthDate, Resolution.DAY)) { - requestedPreviousMonthDate = adjustDateToFitInsideRange(requestedPreviousMonthDate); + requestedPreviousMonthDate = adjustDateToFitInsideRange( + requestedPreviousMonthDate); } focusedDate.setTime(requestedPreviousMonthDate.getTime()); displayedMonth.setMonth(displayedMonth.getMonth() - 1); @@ -1051,12 +1051,12 @@ public class VCalendarPanel extends FocusableFlexTable implements /** * Handles a user click on the component - * + * * @param sender * The component that was clicked * @param updateVariable * Should the value field be updated - * + * */ private void processClickEvent(Widget sender) { if (!isEnabled() || isReadonly()) { @@ -1075,7 +1075,7 @@ public class VCalendarPanel extends FocusableFlexTable implements /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.KeyDownHandler#onKeyDown(com.google.gwt * .event.dom.client.KeyDownEvent) @@ -1087,7 +1087,7 @@ public class VCalendarPanel extends FocusableFlexTable implements /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.KeyPressHandler#onKeyPress(com.google * .gwt.event.dom.client.KeyPressEvent) @@ -1100,15 +1100,14 @@ public class VCalendarPanel extends FocusableFlexTable implements /** * Handles the keypress from both the onKeyPress event and the onKeyDown * event - * + * * @param event * The keydown/keypress event */ private void handleKeyPress(DomEvent event) { // Special handling for events from time ListBoxes. - if (time != null - && time.getElement().isOrHasChild( - (Node) event.getNativeEvent().getEventTarget().cast())) { + if (time != null && time.getElement().isOrHasChild( + (Node) event.getNativeEvent().getEventTarget().cast())) { int nativeKeyCode = event.getNativeEvent().getKeyCode(); if (nativeKeyCode == getSelectKey()) { onSubmit(); // submit if enter key hit down on listboxes @@ -1125,16 +1124,18 @@ public class VCalendarPanel extends FocusableFlexTable implements // Check tabs int keycode = event.getNativeEvent().getKeyCode(); - if (keycode == KeyCodes.KEY_TAB && event.getNativeEvent().getShiftKey()) { + if (keycode == KeyCodes.KEY_TAB + && event.getNativeEvent().getShiftKey()) { if (onTabOut(event)) { return; } } // Handle the navigation - if (handleNavigation(keycode, event.getNativeEvent().getCtrlKey() - || event.getNativeEvent().getMetaKey(), event.getNativeEvent() - .getShiftKey())) { + if (handleNavigation(keycode, + event.getNativeEvent().getCtrlKey() + || event.getNativeEvent().getMetaKey(), + event.getNativeEvent().getShiftKey())) { event.preventDefault(); } @@ -1160,7 +1161,7 @@ public class VCalendarPanel extends FocusableFlexTable implements /** * Handles the keyboard navigation when the resolution is set to years. - * + * * @param keycode * The keycode to process * @param ctrl @@ -1218,7 +1219,7 @@ public class VCalendarPanel extends FocusableFlexTable implements /** * Handle the keyboard navigation when the resolution is set to MONTH - * + * * @param keycode * The keycode to handle * @param ctrl @@ -1274,7 +1275,7 @@ public class VCalendarPanel extends FocusableFlexTable implements /** * Handle keyboard navigation what the resolution is set to DAY - * + * * @param keycode * The keycode to handle * @param ctrl @@ -1380,7 +1381,7 @@ public class VCalendarPanel extends FocusableFlexTable implements /** * Handles the keyboard navigation - * + * * @param keycode * The key code that was pressed * @param ctrl @@ -1390,7 +1391,8 @@ public class VCalendarPanel extends FocusableFlexTable implements * @return Return true if key press was handled by the component, else * return false */ - protected boolean handleNavigation(int keycode, boolean ctrl, boolean shift) { + protected boolean handleNavigation(int keycode, boolean ctrl, + boolean shift) { if (!isEnabled() || isReadonly()) { return false; } @@ -1417,7 +1419,7 @@ public class VCalendarPanel extends FocusableFlexTable implements * Returns the reset key which will reset the calendar to the previous * selection. By default this is backspace but it can be overriden to change * the key to whatever you want. - * + * * @return */ protected int getResetKey() { @@ -1428,7 +1430,7 @@ public class VCalendarPanel extends FocusableFlexTable implements * Returns the select key which selects the value. By default this is the * enter key but it can be changed to whatever you like by overriding this * method. - * + * * @return */ protected int getSelectKey() { @@ -1439,7 +1441,7 @@ public class VCalendarPanel extends FocusableFlexTable implements * Returns the key that closes the popup window if this is a VPopopCalendar. * Else this does nothing. By default this is the Escape key but you can * change the key to whatever you want by overriding this method. - * + * * @return */ protected int getCloseKey() { @@ -1450,7 +1452,7 @@ public class VCalendarPanel extends FocusableFlexTable implements * The key that selects the next day in the calendar. By default this is the * right arrow key but by overriding this method it can be changed to * whatever you like. - * + * * @return */ protected int getForwardKey() { @@ -1461,7 +1463,7 @@ public class VCalendarPanel extends FocusableFlexTable implements * The key that selects the previous day in the calendar. By default this is * the left arrow key but by overriding this method it can be changed to * whatever you like. - * + * * @return */ protected int getBackwardKey() { @@ -1472,7 +1474,7 @@ public class VCalendarPanel extends FocusableFlexTable implements * The key that selects the next week in the calendar. By default this is * the down arrow key but by overriding this method it can be changed to * whatever you like. - * + * * @return */ protected int getNextKey() { @@ -1483,7 +1485,7 @@ public class VCalendarPanel extends FocusableFlexTable implements * The key that selects the previous week in the calendar. By default this * is the up arrow key but by overriding this method it can be changed to * whatever you like. - * + * * @return */ protected int getPreviousKey() { @@ -1492,7 +1494,7 @@ public class VCalendarPanel extends FocusableFlexTable implements /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.MouseOutHandler#onMouseOut(com.google * .gwt.event.dom.client.MouseOutEvent) @@ -1506,7 +1508,7 @@ public class VCalendarPanel extends FocusableFlexTable implements /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.MouseDownHandler#onMouseDown(com.google * .gwt.event.dom.client.MouseDownEvent) @@ -1540,7 +1542,7 @@ public class VCalendarPanel extends FocusableFlexTable implements /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.MouseUpHandler#onMouseUp(com.google.gwt * .event.dom.client.MouseUpEvent) @@ -1554,7 +1556,7 @@ public class VCalendarPanel extends FocusableFlexTable implements /** * Adjusts a date to fit inside the range, only if outside - * + * * @param date */ private Date adjustDateToFitInsideRange(Date date) { @@ -1568,7 +1570,7 @@ public class VCalendarPanel extends FocusableFlexTable implements /** * Sets the data of the Panel. - * + * * @param currentDate * The date to set */ @@ -1580,7 +1582,8 @@ public class VCalendarPanel extends FocusableFlexTable implements } boolean currentDateWasAdjusted = false; // Check that selected date is inside the allowed range - if (currentDate != null && !isDateInsideRange(currentDate, resolution)) { + if (currentDate != null + && !isDateInsideRange(currentDate, resolution)) { currentDate = adjustDateToFitInsideRange(currentDate); currentDateWasAdjusted = true; } @@ -1595,9 +1598,9 @@ public class VCalendarPanel extends FocusableFlexTable implements // If ranges enabled, we may need to focus on a different view to // potentially not get stuck if (rangeStart != null || rangeEnd != null) { - Date dateThatFitsInsideRange = adjustDateToFitInsideRange(new Date()); - focusedDate = new FocusedDate( - dateThatFitsInsideRange.getYear(), + Date dateThatFitsInsideRange = adjustDateToFitInsideRange( + new Date()); + focusedDate = new FocusedDate(dateThatFitsInsideRange.getYear(), dateThatFitsInsideRange.getMonth(), dateThatFitsInsideRange.getDate()); displayedMonth = new FocusedDate( @@ -1644,7 +1647,7 @@ public class VCalendarPanel extends FocusableFlexTable implements /** * TimeSelector is a widget consisting of list boxes that modifie the Date * object that is given for. - * + * */ public class VTime extends FlowPanel implements ChangeHandler { @@ -1676,7 +1679,7 @@ public class VCalendarPanel extends FocusableFlexTable implements /** * Constructs the ListBoxes and updates their value - * + * * @param redraw * Should new instances of the listboxes be created */ @@ -1857,7 +1860,7 @@ public class VCalendarPanel extends FocusableFlexTable implements /* * (non-Javadoc) VT - * + * * @see * com.google.gwt.event.dom.client.ChangeHandler#onChange(com.google.gwt * .event.dom.client.ChangeEvent) @@ -1941,7 +1944,7 @@ public class VCalendarPanel extends FocusableFlexTable implements /** * If true should be returned if the panel will not be used after this * event. - * + * * @param event * @return */ @@ -1955,7 +1958,7 @@ public class VCalendarPanel extends FocusableFlexTable implements /** * A focus out listener is triggered when the panel loosed focus. This can * happen either after a user clicks outside the panel or tabs out. - * + * * @param listener * The listener to trigger */ @@ -1966,7 +1969,7 @@ public class VCalendarPanel extends FocusableFlexTable implements /** * The submit listener is called when the user selects a value from the * calender either by clicking the day or selects it by keyboard. - * + * * @param submitListener * The listener to trigger */ @@ -1977,7 +1980,7 @@ public class VCalendarPanel extends FocusableFlexTable implements /** * The given FocusChangeListener is notified when the focused date changes * by user either clicking on a new date or by using the keyboard. - * + * * @param listener * The FocusChangeListener to be notified */ @@ -1987,7 +1990,7 @@ public class VCalendarPanel extends FocusableFlexTable implements /** * The time change listener is triggered when the user changes the time. - * + * * @param listener */ public void setTimeChangeListener(TimeChangeListener listener) { @@ -1996,7 +1999,7 @@ public class VCalendarPanel extends FocusableFlexTable implements /** * Returns the submit listener that listens to selection made from the panel - * + * * @return The listener or NULL if no listener has been set */ public SubmitListener getSubmitListener() { @@ -2005,7 +2008,7 @@ public class VCalendarPanel extends FocusableFlexTable implements /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.BlurHandler#onBlur(com.google.gwt.event * .dom.client.BlurEvent) @@ -2020,7 +2023,7 @@ public class VCalendarPanel extends FocusableFlexTable implements /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.FocusHandler#onFocus(com.google.gwt.event * .dom.client.FocusEvent) @@ -2054,7 +2057,8 @@ public class VCalendarPanel extends FocusableFlexTable implements private Date rangeEnd; @Override - public String getSubPartName(com.google.gwt.user.client.Element subElement) { + public String getSubPartName( + com.google.gwt.user.client.Element subElement) { if (contains(nextMonth, subElement)) { return SUBPART_NEXT_MONTH; } else if (contains(prevMonth, subElement)) { @@ -2090,7 +2094,8 @@ public class VCalendarPanel extends FocusableFlexTable implements return SUBPART_AMPM_SELECT; } - } else if (getCellFormatter().getElement(0, 2).isOrHasChild(subElement)) { + } else if (getCellFormatter().getElement(0, 2) + .isOrHasChild(subElement)) { return SUBPART_MONTH_YEAR_HEADER; } @@ -2099,7 +2104,7 @@ public class VCalendarPanel extends FocusableFlexTable implements /** * Checks if subElement is inside the widget DOM hierarchy. - * + * * @param w * @param subElement * @return true if {@code w} is a parent of subElement, false otherwise. @@ -2113,7 +2118,8 @@ public class VCalendarPanel extends FocusableFlexTable implements } @Override - public com.google.gwt.user.client.Element getSubPartElement(String subPart) { + public com.google.gwt.user.client.Element getSubPartElement( + String subPart) { if (SUBPART_NEXT_MONTH.equals(subPart)) { return nextMonth.getElement(); } @@ -2141,8 +2147,8 @@ public class VCalendarPanel extends FocusableFlexTable implements if (subPart.startsWith(SUBPART_DAY)) { // Zero or negative ids map to days in the preceding month, // past-the-end-of-month ids to days in the following month - int dayOfMonth = Integer.parseInt(subPart.substring(SUBPART_DAY - .length())); + int dayOfMonth = Integer + .parseInt(subPart.substring(SUBPART_DAY.length())); Date date = new Date(displayedMonth.getYear(), displayedMonth.getMonth(), dayOfMonth); Iterator iter = days.iterator(); @@ -2158,8 +2164,8 @@ public class VCalendarPanel extends FocusableFlexTable implements } if (SUBPART_MONTH_YEAR_HEADER.equals(subPart)) { - return DOM.asOld((Element) getCellFormatter().getElement(0, 2) - .getChild(0)); + return DOM.asOld( + (Element) getCellFormatter().getElement(0, 2).getChild(0)); } return null; } @@ -2222,7 +2228,7 @@ public class VCalendarPanel extends FocusableFlexTable implements * Sets the start range for this component. The start range is inclusive, * and it depends on the current resolution, what is considered inside the * range. - * + * * @param startDate * - the allowed range's start date */ @@ -2241,7 +2247,7 @@ public class VCalendarPanel extends FocusableFlexTable implements /** * Sets the end range for this component. The end range is inclusive, and it * depends on the current resolution, what is considered inside the range. - * + * * @param endDate * - the allowed range's end date */ diff --git a/client/src/main/java/com/vaadin/client/ui/VCheckBox.java b/client/src/main/java/com/vaadin/client/ui/VCheckBox.java index 887dba262a..34f1b4f38f 100644 --- a/client/src/main/java/com/vaadin/client/ui/VCheckBox.java +++ b/client/src/main/java/com/vaadin/client/ui/VCheckBox.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -29,8 +29,8 @@ import com.vaadin.client.ui.aria.AriaHelper; import com.vaadin.client.ui.aria.HandlesAriaInvalid; import com.vaadin.client.ui.aria.HandlesAriaRequired; -public class VCheckBox extends com.google.gwt.user.client.ui.CheckBox implements - Field, HandlesAriaInvalid, HandlesAriaRequired { +public class VCheckBox extends com.google.gwt.user.client.ui.CheckBox + implements Field, HandlesAriaInvalid, HandlesAriaRequired { public static final String CLASSNAME = "v-checkbox"; @@ -88,7 +88,7 @@ public class VCheckBox extends com.google.gwt.user.client.ui.CheckBox implements /** * Gives access to the input element. - * + * * @return Element of the CheckBox itself */ private Element getCheckBoxElement() { diff --git a/client/src/main/java/com/vaadin/client/ui/VColorPicker.java b/client/src/main/java/com/vaadin/client/ui/VColorPicker.java index b55c125418..c7197aa493 100644 --- a/client/src/main/java/com/vaadin/client/ui/VColorPicker.java +++ b/client/src/main/java/com/vaadin/client/ui/VColorPicker.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,7 +21,7 @@ import com.google.gwt.user.client.ui.HTML; /** * Client side implementation for ColorPicker. - * + * * @since 7.0.0 */ public class VColorPicker extends VButton implements ClickHandler { @@ -41,7 +41,7 @@ public class VColorPicker extends VButton implements ClickHandler { /** * Set the color of the component, e.g. #ffffff - * + * * @param color */ public void setColor(String color) { @@ -50,7 +50,7 @@ public class VColorPicker extends VButton implements ClickHandler { /** * Mark the popup opened/closed. - * + * * @param open */ public void setOpen(boolean open) { @@ -59,7 +59,7 @@ public class VColorPicker extends VButton implements ClickHandler { /** * Check the popup's marked state. - * + * * @return true if the popup has been marked being open, false otherwise. */ public boolean isOpen() { diff --git a/client/src/main/java/com/vaadin/client/ui/VColorPickerArea.java b/client/src/main/java/com/vaadin/client/ui/VColorPickerArea.java index 23a9379c80..6e82ac2998 100644 --- a/client/src/main/java/com/vaadin/client/ui/VColorPickerArea.java +++ b/client/src/main/java/com/vaadin/client/ui/VColorPickerArea.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -28,11 +28,11 @@ import com.google.gwt.user.client.ui.Widget; /** * Client side implementation for ColorPickerArea. - * + * * @since 7.0.0 */ -public class VColorPickerArea extends Widget implements ClickHandler, HasHTML, - HasClickHandlers { +public class VColorPickerArea extends Widget + implements ClickHandler, HasHTML, HasClickHandlers { public static final String CLASSNAME = "v-colorpicker"; private String color = null; @@ -65,7 +65,7 @@ public class VColorPickerArea extends Widget implements ClickHandler, HasHTML, /** * Adds a click handler to the widget and sinks the click event. - * + * * @param handler * @return HandlerRegistration used to remove the handler */ @@ -84,7 +84,8 @@ public class VColorPickerArea extends Widget implements ClickHandler, HasHTML, int type = DOM.eventGetType(event); switch (type) { case Event.ONCLICK: - if (DOM.isOrHasChild(area.getElement(), DOM.eventGetTarget(event))) { + if (DOM.isOrHasChild(area.getElement(), + DOM.eventGetTarget(event))) { super.onBrowserEvent(event); } break; @@ -95,7 +96,7 @@ public class VColorPickerArea extends Widget implements ClickHandler, HasHTML, /** * Mark the popup opened/closed. - * + * * @param open */ public void setOpen(boolean open) { @@ -104,7 +105,7 @@ public class VColorPickerArea extends Widget implements ClickHandler, HasHTML, /** * Check the popup's marked state. - * + * * @return true if the popup has been marked being open, false otherwise. */ public boolean isOpen() { @@ -113,9 +114,9 @@ public class VColorPickerArea extends Widget implements ClickHandler, HasHTML, /** * Sets the caption's content to the given text. - * + * * @param text - * + * * @see Label#setText(String) */ @Override @@ -125,7 +126,7 @@ public class VColorPickerArea extends Widget implements ClickHandler, HasHTML, /** * Gets the caption's contents as text. - * + * * @return the caption's text */ @Override @@ -135,7 +136,7 @@ public class VColorPickerArea extends Widget implements ClickHandler, HasHTML, /** * Sets the caption's content to the given HTML. - * + * * @param html */ @Override @@ -145,7 +146,7 @@ public class VColorPickerArea extends Widget implements ClickHandler, HasHTML, /** * Gets the caption's contents as HTML. - * + * * @return the caption's HTML */ @Override @@ -155,7 +156,7 @@ public class VColorPickerArea extends Widget implements ClickHandler, HasHTML, /** * Sets the color for the area. - * + * * @param color */ public void setColor(String color) { diff --git a/client/src/main/java/com/vaadin/client/ui/VContextMenu.java b/client/src/main/java/com/vaadin/client/ui/VContextMenu.java index 6028eea52c..553e972532 100644 --- a/client/src/main/java/com/vaadin/client/ui/VContextMenu.java +++ b/client/src/main/java/com/vaadin/client/ui/VContextMenu.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -76,7 +76,7 @@ public class VContextMenu extends VOverlay implements SubPartAware { /** * This method should be used only by Client object as only one per client * should exists. Request an instance via client.getContextMenu(); - * + * * @param cli * to be set as an owner of menu */ @@ -90,10 +90,9 @@ public class VContextMenu extends VOverlay implements SubPartAware { @Override public void onClose(CloseEvent event) { Element currentFocus = WidgetUtil.getFocusedElement(); - if (focusedElement != null - && (currentFocus == null - || menu.getElement().isOrHasChild(currentFocus) || RootPanel - .getBodyElement().equals(currentFocus))) { + if (focusedElement != null && (currentFocus == null + || menu.getElement().isOrHasChild(currentFocus) + || RootPanel.getBodyElement().equals(currentFocus))) { focusedElement.focus(); focusedElement = null; } @@ -109,7 +108,7 @@ public class VContextMenu extends VOverlay implements SubPartAware { /** * Sets the element from which to build menu - * + * * @param ao */ public void setActionOwner(ActionOwner ao) { @@ -118,7 +117,7 @@ public class VContextMenu extends VOverlay implements SubPartAware { /** * Shows context menu at given location IF it contain at least one item. - * + * * @param left * @param top */ @@ -197,9 +196,9 @@ public class VContextMenu extends VOverlay implements SubPartAware { * Extend standard Gwt MenuBar to set proper settings and to override * onPopupClosed method so that PopupPanel gets closed. */ - class CMenuBar extends MenuBar implements HasFocusHandlers, - HasBlurHandlers, HasKeyDownHandlers, HasKeyPressHandlers, - Focusable, LoadHandler, KeyUpHandler { + class CMenuBar extends MenuBar + implements HasFocusHandlers, HasBlurHandlers, HasKeyDownHandlers, + HasKeyPressHandlers, Focusable, LoadHandler, KeyUpHandler { public CMenuBar() { super(true); addDomHandler(this, LoadEvent.getType()); @@ -225,7 +224,7 @@ public class VContextMenu extends VOverlay implements SubPartAware { * (!DOM.isOrHasChild(getElement(), to)) { DOM.setElementProperty( * super.getSelectedItem().getElement(), "className", * super.getSelectedItem().getStylePrimaryName()); } } - * + * * super.onBrowserEvent(event); } */ @@ -282,7 +281,8 @@ public class VContextMenu extends VOverlay implements SubPartAware { } @Override - public com.google.gwt.user.client.Element getSubPartElement(String subPart) { + public com.google.gwt.user.client.Element getSubPartElement( + String subPart) { int index = Integer.parseInt(subPart.substring(6)); // ApplicationConnection.getConsole().log( // "Searching element for selection index " + index); @@ -293,11 +293,13 @@ public class VContextMenu extends VOverlay implements SubPartAware { } @Override - public String getSubPartName(com.google.gwt.user.client.Element subElement) { + public String getSubPartName( + com.google.gwt.user.client.Element subElement) { if (getElement().isOrHasChild(subElement)) { com.google.gwt.dom.client.Element e = subElement; { - while (e != null && !e.getTagName().toLowerCase().equals("tr")) { + while (e != null + && !e.getTagName().toLowerCase().equals("tr")) { e = e.getParentElement(); // ApplicationConnection.getConsole().log("Found row"); } @@ -320,7 +322,7 @@ public class VContextMenu extends VOverlay implements SubPartAware { /** * Hides context menu if it is currently shown by given action owner. - * + * * @param actionOwner */ public void ensureHidden(ActionOwner actionOwner) { diff --git a/client/src/main/java/com/vaadin/client/ui/VCssLayout.java b/client/src/main/java/com/vaadin/client/ui/VCssLayout.java index d7d9eefef9..9e262f64cf 100644 --- a/client/src/main/java/com/vaadin/client/ui/VCssLayout.java +++ b/client/src/main/java/com/vaadin/client/ui/VCssLayout.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/VCustomComponent.java b/client/src/main/java/com/vaadin/client/ui/VCustomComponent.java index 6aa21b08d2..7184af58d5 100644 --- a/client/src/main/java/com/vaadin/client/ui/VCustomComponent.java +++ b/client/src/main/java/com/vaadin/client/ui/VCustomComponent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/VCustomLayout.java b/client/src/main/java/com/vaadin/client/ui/VCustomLayout.java index 0ee50fe0dd..33ac090aae 100644 --- a/client/src/main/java/com/vaadin/client/ui/VCustomLayout.java +++ b/client/src/main/java/com/vaadin/client/ui/VCustomLayout.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -41,9 +41,9 @@ import com.vaadin.client.WidgetUtil; /** * Custom Layout implements complex layout defined with HTML template. - * + * * @author Vaadin Ltd - * + * */ public class VCustomLayout extends ComplexPanel { @@ -106,14 +106,14 @@ public class VCustomLayout extends ComplexPanel { /** * Sets widget to given location. - * + * * If location already contains a widget it will be removed. - * + * * @param widget * Widget to be set into location. * @param location * location name where widget will be added - * + * * @throws IllegalArgumentException * if no such location is found in the layout. */ @@ -126,8 +126,8 @@ public class VCustomLayout extends ComplexPanel { // If no given location is found in the layout, and exception is throws Element elem = locationToElement.get(location); if (elem == null && hasTemplate()) { - throw new IllegalArgumentException("No location " + location - + " found"); + throw new IllegalArgumentException( + "No location " + location + " found"); } // Get previous widget @@ -168,15 +168,13 @@ public class VCustomLayout extends ComplexPanel { "<((?:img)|(?:IMG))\\s([^>]*)src=\"((?![a-z]+:)[^/][^\"]+)\"", "<$1 $2src=\"" + relImgPrefix + "$3\""); // also support src attributes without quotes - template = template - .replaceAll( - "<((?:img)|(?:IMG))\\s([^>]*)src=[^\"]((?![a-z]+:)[^/][^ />]+)[ />]", - "<$1 $2src=\"" + relImgPrefix + "$3\""); + template = template.replaceAll( + "<((?:img)|(?:IMG))\\s([^>]*)src=[^\"]((?![a-z]+:)[^/][^ />]+)[ />]", + "<$1 $2src=\"" + relImgPrefix + "$3\""); // also prefix relative style="...url(...)..." - template = template - .replaceAll( - "(<[^>]+style=\"[^\"]*url\\()((?![a-z]+:)[^/][^\"]+)(\\)[^>]*>)", - "$1 " + relImgPrefix + "$2 $3"); + template = template.replaceAll( + "(<[^>]+style=\"[^\"]*url\\()((?![a-z]+:)[^/][^\"]+)(\\)[^>]*>)", + "$1 " + relImgPrefix + "$2 $3"); getElement().setInnerHTML(template); @@ -251,11 +249,11 @@ public class VCustomLayout extends ComplexPanel { /** * Extract body part and script tags from raw html-template. - * + * * Saves contents of all script-tags to private property: scripts. Returns * contents of the body part for the html without script-tags. Also replaces * all _UID_ tags with an unique id-string. - * + * * @param html * Original HTML-template received from server * @return html that is used to create the HTMLPanel. @@ -416,7 +414,7 @@ public class VCustomLayout extends ComplexPanel { * functions are to be run. *

    * For internal use only. May be removed or replaced in the future. - * + * * @param el * @return true if layout function exists and was run successfully, else * false. diff --git a/client/src/main/java/com/vaadin/client/ui/VDateField.java b/client/src/main/java/com/vaadin/client/ui/VDateField.java index b4084847dd..3922219c7b 100644 --- a/client/src/main/java/com/vaadin/client/ui/VDateField.java +++ b/client/src/main/java/com/vaadin/client/ui/VDateField.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -188,7 +188,7 @@ public class VDateField extends FlowPanel implements Field, HasEnabled { * Returns whether ISO 8601 week numbers should be shown in the date * selector or not. ISO 8601 defines that a week always starts with a Monday * so the week numbers are only shown if this is the case. - * + * * @return true if week number should be shown, false otherwise */ public boolean isShowISOWeekNumbers() { @@ -205,7 +205,7 @@ public class VDateField extends FlowPanel implements Field, HasEnabled { * the current date. *

    * For internal use only. May be removed or replaced in the future. - * + * * @return A copy of the current date */ public Date getDate() { @@ -219,7 +219,7 @@ public class VDateField extends FlowPanel implements Field, HasEnabled { /** * Sets the current date for this VDateField. - * + * * @param date * The new date to use */ diff --git a/client/src/main/java/com/vaadin/client/ui/VDateFieldCalendar.java b/client/src/main/java/com/vaadin/client/ui/VDateFieldCalendar.java index 759ebef102..8f1b86a28f 100644 --- a/client/src/main/java/com/vaadin/client/ui/VDateFieldCalendar.java +++ b/client/src/main/java/com/vaadin/client/ui/VDateFieldCalendar.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -87,24 +87,26 @@ public class VDateFieldCalendar extends VDateField { .getCalendarField()) { getClient().updateVariable(getId(), "day", date2.getDate(), false); - if (getCurrentResolution().getCalendarField() > Resolution.DAY - .getCalendarField()) { + if (getCurrentResolution() + .getCalendarField() > Resolution.DAY + .getCalendarField()) { getClient().updateVariable(getId(), "hour", date2.getHours(), false); - if (getCurrentResolution().getCalendarField() > Resolution.HOUR - .getCalendarField()) { + if (getCurrentResolution() + .getCalendarField() > Resolution.HOUR + .getCalendarField()) { getClient().updateVariable(getId(), "min", date2.getMinutes(), false); - if (getCurrentResolution().getCalendarField() > Resolution.MINUTE - .getCalendarField()) { + if (getCurrentResolution() + .getCalendarField() > Resolution.MINUTE + .getCalendarField()) { getClient().updateVariable(getId(), "sec", date2.getSeconds(), false); - if (getCurrentResolution().getCalendarField() > Resolution.SECOND - .getCalendarField()) { - getClient().updateVariable( - getId(), - "msec", - DateTimeService + if (getCurrentResolution() + .getCalendarField() > Resolution.SECOND + .getCalendarField()) { + getClient().updateVariable(getId(), + "msec", DateTimeService .getMilliseconds(date2), false); } diff --git a/client/src/main/java/com/vaadin/client/ui/VDragAndDropWrapper.java b/client/src/main/java/com/vaadin/client/ui/VDragAndDropWrapper.java index 4ecdec8b6f..e025d88740 100644 --- a/client/src/main/java/com/vaadin/client/ui/VDragAndDropWrapper.java +++ b/client/src/main/java/com/vaadin/client/ui/VDragAndDropWrapper.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -60,14 +60,14 @@ import com.vaadin.shared.ui.dd.HorizontalDropLocation; import com.vaadin.shared.ui.dd.VerticalDropLocation; /** - * + * * Must have features pending: - * + * * drop details: locations + sizes in document hierarchy up to wrapper - * + * */ -public class VDragAndDropWrapper extends VCustomComponent implements - VHasDropHandler { +public class VDragAndDropWrapper extends VCustomComponent + implements VHasDropHandler { /** * Minimum pixel delta is used to detect click from drag. #12838 @@ -91,7 +91,8 @@ public class VDragAndDropWrapper extends VCustomComponent implements @Override public void onMouseDown(final MouseDownEvent event) { if (getConnector().isEnabled() - && event.getNativeEvent().getButton() == Event.BUTTON_LEFT + && event.getNativeEvent() + .getButton() == Event.BUTTON_LEFT && startDrag(event.getNativeEvent())) { event.preventDefault(); // prevent text selection startX = event.getClientX(); @@ -135,7 +136,7 @@ public class VDragAndDropWrapper extends VCustomComponent implements /** * Starts a drag and drop operation from mousedown or touchstart event if * required conditions are met. - * + * * @param event * @return true if the event was handled as a drag start event */ @@ -149,8 +150,8 @@ public class VDragAndDropWrapper extends VCustomComponent implements Element.as(event.getEventTarget())); Widget widget = paintable.getWidget(); transferable.setData("component", paintable); - VDragEvent dragEvent = VDragAndDropManager.get().startDrag( - transferable, event, true); + VDragEvent dragEvent = VDragAndDropManager.get() + .startDrag(transferable, event, true); transferable.setData("mouseDown", MouseEventDetailsBuilder .buildMouseEventDetails(event).serialize()); @@ -253,9 +254,8 @@ public class VDragAndDropWrapper extends VCustomComponent implements uploading = true; final Integer fileId = fileIds.remove(0); VHtml5File file = files.remove(0); - final String receiverUrl = client - .translateVaadinUri(fileIdToReceiver - .remove(fileId.toString())); + final String receiverUrl = client.translateVaadinUri( + fileIdToReceiver.remove(fileId.toString())); ExtendedXHR extendedXHR = (ExtendedXHR) ExtendedXHR .create(); extendedXHR @@ -297,14 +297,15 @@ public class VDragAndDropWrapper extends VCustomComponent implements dragleavetimer.cancel(); dragleavetimer = null; } - if (VDragAndDropManager.get().getCurrentDropHandler() != getDropHandler()) { + if (VDragAndDropManager.get() + .getCurrentDropHandler() != getDropHandler()) { VTransferable transferable = new VTransferable(); transferable.setDragSource(getConnector()); - vaadinDragEvent = VDragAndDropManager.get().startDrag( - transferable, event, false); - VDragAndDropManager.get().setCurrentDropHandler( - getDropHandler()); + vaadinDragEvent = VDragAndDropManager.get() + .startDrag(transferable, event, false); + VDragAndDropManager.get() + .setCurrentDropHandler(getDropHandler()); } try { event.preventDefault(); @@ -334,9 +335,8 @@ public class VDragAndDropWrapper extends VCustomComponent implements // this // is what IE does). // In Vaadin we fire it only if drop did not happen. - if (vaadinDragEvent != null - && VDragAndDropManager.get() - .getCurrentDropHandler() == getDropHandler()) { + if (vaadinDragEvent != null && VDragAndDropManager.get() + .getCurrentDropHandler() == getDropHandler()) { VDragAndDropManager.get().interruptDrag(); } } @@ -617,7 +617,7 @@ public class VDragAndDropWrapper extends VCustomComponent implements /** * Prototype code, memory leak risk. - * + * * @param el * @deprecated As of 7.2, call or override {@link #hookHtml5Events(Element)} * instead @@ -646,9 +646,9 @@ public class VDragAndDropWrapper extends VCustomComponent implements /** * Prototype code, memory leak risk. - * + * * @param el - * + * * @since 7.2 */ protected void hookHtml5Events(Element el) { @@ -676,10 +676,12 @@ public class VDragAndDropWrapper extends VCustomComponent implements protected void deEmphasis(boolean doLayout) { if (emphasizedVDrop != null) { VDragAndDropWrapper.setStyleName(getElement(), OVER_STYLE, false); - VDragAndDropWrapper.setStyleName(getElement(), OVER_STYLE + "-" - + emphasizedVDrop.toString().toLowerCase(), false); - VDragAndDropWrapper.setStyleName(getElement(), OVER_STYLE + "-" - + emphasizedHDrop.toString().toLowerCase(), false); + VDragAndDropWrapper.setStyleName(getElement(), + OVER_STYLE + "-" + emphasizedVDrop.toString().toLowerCase(), + false); + VDragAndDropWrapper.setStyleName(getElement(), + OVER_STYLE + "-" + emphasizedHDrop.toString().toLowerCase(), + false); } if (doLayout) { notifySizePotentiallyChanged(); @@ -695,8 +697,10 @@ public class VDragAndDropWrapper extends VCustomComponent implements VDragAndDropWrapper.setStyleName(getElement(), OVER_STYLE, true); VDragAndDropWrapper.setStyleName(getElement(), OVER_STYLE + "-" + verticalDropLocation.toString().toLowerCase(), true); - VDragAndDropWrapper.setStyleName(getElement(), OVER_STYLE + "-" - + horizontalDropLocation.toString().toLowerCase(), true); + VDragAndDropWrapper.setStyleName(getElement(), + OVER_STYLE + "-" + + horizontalDropLocation.toString().toLowerCase(), + true); emphasizedVDrop = verticalDropLocation; emphasizedHDrop = horizontalDropLocation; @@ -708,7 +712,7 @@ public class VDragAndDropWrapper extends VCustomComponent implements /** * Set the widget that will be used as the drag image when using * DragStartMode {@link COMPONENT_OTHER} . - * + * * @param widget */ public void setDragAndDropWidget(Widget widget) { @@ -727,7 +731,7 @@ public class VDragAndDropWrapper extends VCustomComponent implements * Internal client side interface used by the connector and the widget for * the drag and drop wrapper to signal the completion of an HTML5 file * upload. - * + * * @since 7.6.4 */ public interface UploadHandler { diff --git a/client/src/main/java/com/vaadin/client/ui/VDragAndDropWrapperIE.java b/client/src/main/java/com/vaadin/client/ui/VDragAndDropWrapperIE.java index b32b36d13b..4ddaad25a5 100644 --- a/client/src/main/java/com/vaadin/client/ui/VDragAndDropWrapperIE.java +++ b/client/src/main/java/com/vaadin/client/ui/VDragAndDropWrapperIE.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/VEmbedded.java b/client/src/main/java/com/vaadin/client/ui/VEmbedded.java index f3970f9ac7..68dcc6152a 100644 --- a/client/src/main/java/com/vaadin/client/ui/VEmbedded.java +++ b/client/src/main/java/com/vaadin/client/ui/VEmbedded.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -58,7 +58,7 @@ public class VEmbedded extends HTML { * cross-browser. *

    * For internal use only. May be removed or replaced in the future. - * + * * @param uidl * The UIDL * @return Tags concatenated into a string @@ -83,11 +83,14 @@ public class VEmbedded extends HTML { * this by setting his own classid. */ if (uidl.hasAttribute("classid")) { - html.append("classid=\"" - + WidgetUtil.escapeAttribute(uidl - .getStringAttribute("classid")) + "\" "); + html.append( + "classid=\"" + + WidgetUtil.escapeAttribute( + uidl.getStringAttribute("classid")) + + "\" "); } else { - html.append("classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" "); + html.append( + "classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" "); } /* @@ -99,15 +102,18 @@ public class VEmbedded extends HTML { * codebase */ if (uidl.hasAttribute("codebase")) { - html.append("codebase=\"" - + WidgetUtil.escapeAttribute(uidl - .getStringAttribute("codebase")) + "\" "); + html.append( + "codebase=\"" + + WidgetUtil.escapeAttribute( + uidl.getStringAttribute("codebase")) + + "\" "); } else { - html.append("codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" "); + html.append( + "codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" "); } - ComponentConnector paintable = ConnectorMap.get(client).getConnector( - this); + ComponentConnector paintable = ConnectorMap.get(client) + .getConnector(this); String height = paintable.getState().height; String width = paintable.getState().width; @@ -118,23 +124,29 @@ public class VEmbedded extends HTML { // Codetype if (uidl.hasAttribute("codetype")) { - html.append("codetype=\"" - + WidgetUtil.escapeAttribute(uidl - .getStringAttribute("codetype")) + "\" "); + html.append( + "codetype=\"" + + WidgetUtil.escapeAttribute( + uidl.getStringAttribute("codetype")) + + "\" "); } // Standby if (uidl.hasAttribute("standby")) { - html.append("standby=\"" - + WidgetUtil.escapeAttribute(uidl - .getStringAttribute("standby")) + "\" "); + html.append( + "standby=\"" + + WidgetUtil.escapeAttribute( + uidl.getStringAttribute("standby")) + + "\" "); } // Archive if (uidl.hasAttribute("archive")) { - html.append("archive=\"" - + WidgetUtil.escapeAttribute(uidl - .getStringAttribute("archive")) + "\" "); + html.append( + "archive=\"" + + WidgetUtil.escapeAttribute( + uidl.getStringAttribute("archive")) + + "\" "); } // End object tag @@ -175,8 +187,8 @@ public class VEmbedded extends HTML { html.append(">"); if (uidl.hasAttribute(EmbeddedConstants.ALTERNATE_TEXT)) { - html.append(uidl - .getStringAttribute(EmbeddedConstants.ALTERNATE_TEXT)); + html.append( + uidl.getStringAttribute(EmbeddedConstants.ALTERNATE_TEXT)); } // End object tag @@ -189,7 +201,7 @@ public class VEmbedded extends HTML { * Returns a map (name -> value) of all parameters in the UIDL. *

    * For internal use only. May be removed or replaced in the future. - * + * * @param uidl * @return */ @@ -219,7 +231,7 @@ public class VEmbedded extends HTML { * Helper to return translated src-attribute from embedded's UIDL *

    * For internal use only. May be removed or replaced in the future. - * + * * @param uidl * @param client * @return diff --git a/client/src/main/java/com/vaadin/client/ui/VFilterSelect.java b/client/src/main/java/com/vaadin/client/ui/VFilterSelect.java index e3fe49871a..2eeff9ece2 100644 --- a/client/src/main/java/com/vaadin/client/ui/VFilterSelect.java +++ b/client/src/main/java/com/vaadin/client/ui/VFilterSelect.java @@ -89,14 +89,14 @@ import com.vaadin.shared.util.SharedUtil; /** * Client side implementation of the Select component. - * + * * TODO needs major refactoring (to be extensible etc) */ @SuppressWarnings("deprecation") -public class VFilterSelect extends Composite implements Field, KeyDownHandler, - KeyUpHandler, ClickHandler, FocusHandler, BlurHandler, Focusable, - SubPartAware, HandlesAriaCaption, HandlesAriaInvalid, - HandlesAriaRequired, DeferredWorker { +public class VFilterSelect extends Composite + implements Field, KeyDownHandler, KeyUpHandler, ClickHandler, + FocusHandler, BlurHandler, Focusable, SubPartAware, HandlesAriaCaption, + HandlesAriaInvalid, HandlesAriaRequired, DeferredWorker { /** * Represents a suggestion in the suggestion popup box @@ -110,7 +110,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Constructor - * + * * @param uidl * The UIDL recieved from the server */ @@ -133,8 +133,8 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, @Override public String getDisplayString() { final StringBuffer sb = new StringBuffer(); - final Icon icon = client.getIcon(client - .translateVaadinUri(untranslatedIconUri)); + final Icon icon = client + .getIcon(client.translateVaadinUri(untranslatedIconUri)); if (icon != null) { sb.append(icon.getElement().getString()); } @@ -161,7 +161,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Get the option key which represents the item on the server side. - * + * * @return The key of the item */ public String getOptionKey() { @@ -170,7 +170,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Get the URI of the icon. Used when constructing the displayed option. - * + * * @return */ public String getIconUri() { @@ -181,7 +181,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, * Gets the style set for this suggestion item. Styles are typically set * by a server-side {@link com.vaadin.ui.ComboBox.ItemStyleGenerator}. * The returned style is prefixed by v-filterselect-item-. - * + * * @since 7.5.6 * @return the style name to use, or null to not apply any * custom style. @@ -238,7 +238,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, return $entry(function(e) { var deltaX = e.deltaX ? e.deltaX : -0.5*e.wheelDeltaX; var deltaY = e.deltaY ? e.deltaY : -0.5*e.wheelDeltaY; - + // IE8 has only delta y if (isNaN(deltaY)) { deltaY = -0.5*e.wheelDelta; @@ -317,8 +317,8 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, * Represents the popup box with the selection options. Wraps a suggestion * menu. */ - public class SuggestionPopup extends VOverlay implements PositionCallback, - CloseHandler { + public class SuggestionPopup extends VOverlay + implements PositionCallback, CloseHandler { private static final int Z_INDEX = 30000; @@ -389,7 +389,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Shows the popup where the user can see the filtered options - * + * * @param currentSuggestions * The filtered suggestions * @param currentPage @@ -410,7 +410,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, * correctly. This issue manifests when a Combobox is placed in * another popupView which also needs to calculate the absoluteTop() * to position itself. #9768 - * + * * After deferring the showSuggestions method, a problem with * navigating in the combo box occurs. Because of that the method * navigateItemAfterPageChange in ComboBoxConnector class, which @@ -437,9 +437,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, boolean firstPage = (currentPage == 0); final int first = currentPage * pageLength + 1 - (firstPage ? 0 : nullOffset); - final int last = first - + currentSuggestions.size() - - 1 + final int last = first + currentSuggestions.size() - 1 - (firstPage && "".equals(lastFilter) ? nullOffset : 0); final int matches = totalSuggestions - nullOffset; @@ -471,7 +469,8 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, // box-shadow. // IE9 and IE10 need explicit update to remove extra // box-shadows - if (BrowserInfo.get().isIE9() || BrowserInfo.get().isIE10()) { + if (BrowserInfo.get().isIE9() + || BrowserInfo.get().isIE10()) { forceReflow(); } } @@ -480,7 +479,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Should the next page button be visible to the user? - * + * * @param active */ private void setNextButtonActive(boolean active) { @@ -489,8 +488,8 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, } if (active) { DOM.sinkEvents(down, Event.ONCLICK); - down.setClassName(VFilterSelect.this.getStylePrimaryName() - + "-nextpage"); + down.setClassName( + VFilterSelect.this.getStylePrimaryName() + "-nextpage"); } else { DOM.sinkEvents(down, 0); down.setClassName(VFilterSelect.this.getStylePrimaryName() @@ -500,7 +499,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Should the previous page button be visible to the user - * + * * @param active */ private void setPrevButtonActive(boolean active) { @@ -510,8 +509,8 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, if (active) { DOM.sinkEvents(up, Event.ONCLICK); - up.setClassName(VFilterSelect.this.getStylePrimaryName() - + "-prevpage"); + up.setClassName( + VFilterSelect.this.getStylePrimaryName() + "-prevpage"); } else { DOM.sinkEvents(up, 0); up.setClassName(VFilterSelect.this.getStylePrimaryName() @@ -557,7 +556,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Select the first item of the suggestions list popup. - * + * * @since 7.2.6 */ public void selectFirstItem() { @@ -567,7 +566,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Select the last item of the suggestions list popup. - * + * * @since 7.2.6 */ public void selectLastItem() { @@ -610,7 +609,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, * because otherwise the waiting flag will be reset in * the first response and the second response will be * ignored, causing an empty popup... - * + * * As long as the scrolling delay is suitable * double/triple clicks will work by scrolling two or * three pages at a time and this should not be a @@ -683,7 +682,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, * amount of items are visible at a time and a scrollbar or buttons are * visible to change page. If paging is turned of then all options are * rendered into the popup menu. - * + * * @param paging * Should the paging be turned on? */ @@ -821,7 +820,8 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, menuHeight -= up.getOffsetHeight() + down.getOffsetHeight() + status.getOffsetHeight(); } else { - final ComputedStyle s = new ComputedStyle(menu.getElement()); + final ComputedStyle s = new ComputedStyle( + menu.getElement()); menuHeight -= s.getIntProperty("marginBottom") + s.getIntProperty("marginTop"); } @@ -865,7 +865,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Adds in-line CSS rules to the DOM according to the * suggestionPopupWidth field - * + * * @param desiredWidth * @param naturalMenuWidth */ @@ -873,13 +873,13 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, int naturalMenuWidth) { /** * Three different width modes for the suggestion pop-up: - * + * * 1. Legacy "null"-mode: width is determined by the longest item * caption for each page while still maintaining minimum width of * (desiredWidth - popupOuterPadding) - * + * * 2. relative to the component itself - * + * * 3. fixed width */ String width = "auto"; @@ -891,8 +891,8 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, } else if (isrelativeUnits(suggestionPopupWidth)) { float mainComponentWidth = desiredWidth - popupOuterPadding; // convert percentage value to fraction - int widthInPx = Math.round(mainComponentWidth - * asFraction(suggestionPopupWidth)); + int widthInPx = Math.round( + mainComponentWidth * asFraction(suggestionPopupWidth)); width = widthInPx + "px"; } else { // use as fixed width CSS definition @@ -912,8 +912,8 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, int compensation = WidgetUtil .measureHorizontalPaddingAndBorder( menu.getElement(), 4); - setTdWidth(menu.getElement(), menu.getOffsetWidth() - - compensation); + setTdWidth(menu.getElement(), + menu.getOffsetWidth() - compensation); } } @@ -923,7 +923,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, * Descends to child elements until finds TD elements and sets their * width in pixels. Can be used to workaround IE8 & 9 TD element * display: block issues - * + * * @param parent * @param width */ @@ -941,7 +941,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Returns the percentage value as a fraction, e.g. 42% -> 0.42 - * + * * @param percentage */ private float asFraction(String percentage) { @@ -963,7 +963,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Was the popup just closed? - * + * * @return true if popup was just closed */ public boolean isJustClosed() { @@ -974,7 +974,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.logical.shared.CloseHandler#onClose(com.google * .gwt.event.logical.shared.CloseEvent) @@ -992,7 +992,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Updates style names in suggestion popup to help theme building. - * + * * @param uidl * UIDL for the whole combo box * @param componentState @@ -1001,12 +1001,12 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, public void updateStyleNames(UIDL uidl, AbstractComponentState componentState) { debug("VFS.SP: updateStyleNames()"); - setStyleName(VFilterSelect.this.getStylePrimaryName() - + "-suggestpopup"); - menu.setStyleName(VFilterSelect.this.getStylePrimaryName() - + "-suggestmenu"); - status.setClassName(VFilterSelect.this.getStylePrimaryName() - + "-status"); + setStyleName( + VFilterSelect.this.getStylePrimaryName() + "-suggestpopup"); + menu.setStyleName( + VFilterSelect.this.getStylePrimaryName() + "-suggestmenu"); + status.setClassName( + VFilterSelect.this.getStylePrimaryName() + "-status"); if (ComponentStateUtil.hasStyles(componentState)) { for (String style : componentState.styles) { if (!"".equals(style)) { @@ -1021,8 +1021,8 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * The menu where the suggestions are rendered */ - public class SuggestionMenu extends MenuBar implements SubPartAware, - LoadHandler { + public class SuggestionMenu extends MenuBar + implements SubPartAware, LoadHandler { private VLazyExecutor delayedImageLoadExecutioner = new VLazyExecutor( 100, new ScheduledCommand() { @@ -1066,8 +1066,8 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, */ String getPreferredHeight(int pageItemsCount) { if (currentSuggestions.size() > 0) { - final int pixels = (getPreferredHeight() / currentSuggestions - .size()) * pageItemsCount; + final int pixels = (getPreferredHeight() + / currentSuggestions.size()) * pageItemsCount; return pixels + "px"; } else { return ""; @@ -1076,7 +1076,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Sets the suggestions rendered in the menu - * + * * @param suggestions * The suggestions to be rendered in the menu */ @@ -1121,8 +1121,8 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, && BrowserInfo.get().getBrowserMajorVersion() < 10) { // set TD width to a low value so that they won't mandate the // suggestion pop-up width - suggestionPopup - .setTdWidth(suggestionPopup.menu.getElement(), 1); + suggestionPopup.setTdWidth(suggestionPopup.menu.getElement(), + 1); } } @@ -1174,13 +1174,14 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, if (p > 0) { for (int i = 0; i < p; i++) { final MenuItem potentialExactMatch = getItems().get(i); - if (potentialExactMatch.getText().equals(enteredItemValue)) { + if (potentialExactMatch.getText() + .equals(enteredItemValue)) { selectItem(potentialExactMatch); // do not send a value change event if null was and // stays selected if (!"".equals(enteredItemValue) - || (selectedOptionKey != null && !"" - .equals(selectedOptionKey))) { + || (selectedOptionKey != null + && !"".equals(selectedOptionKey))) { doItemAction(potentialExactMatch, true); } suggestionPopup.hide(); @@ -1199,13 +1200,12 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, enteredItemValue, immediate); afterUpdateClientVariables(); } - } else if (item != null - && !"".equals(lastFilter) - && (filteringmode == FilteringMode.CONTAINS ? item - .getText().toLowerCase() - .contains(lastFilter.toLowerCase()) : item - .getText().toLowerCase() - .startsWith(lastFilter.toLowerCase()))) { + } else if (item != null && !"".equals(lastFilter) + && (filteringmode == FilteringMode.CONTAINS + ? item.getText().toLowerCase() + .contains(lastFilter.toLowerCase()) + : item.getText().toLowerCase() + .startsWith(lastFilter.toLowerCase()))) { doItemAction(item, true); } else { // currentSuggestion has key="" for nullselection @@ -1229,8 +1229,8 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, @Override public com.google.gwt.user.client.Element getSubPartElement( String subPart) { - int index = Integer.parseInt(subPart.substring(SUBPART_PREFIX - .length())); + int index = Integer + .parseInt(subPart.substring(SUBPART_PREFIX.length())); MenuItem item = getItems().get(index); @@ -1296,8 +1296,8 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, */ int getItemOffsetHeight() { List items = getItems(); - return items != null && items.size() > 0 ? items.get(0) - .getOffsetHeight() : 0; + return items != null && items.size() > 0 + ? items.get(0).getOffsetHeight() : 0; } /* @@ -1305,8 +1305,8 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, */ int getItemOffsetWidth() { List items = getItems(); - return items != null && items.size() > 0 ? items.get(0) - .getOffsetWidth() : 0; + return items != null && items.size() > 0 + ? items.get(0).getOffsetWidth() : 0; } /** @@ -1314,7 +1314,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, * menu currently displays the last page with less items then the * maximum visibility (in which case the scroll is not active, but the * scroll is active for any other page in general). - * + * * @since 7.2.6 */ @Override @@ -1322,8 +1322,8 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, String height = getElement().getStyle().getHeight(); String preferredHeight = getPreferredHeight(pageLength); - return !(height == null || height.length() == 0 || height - .equals(preferredHeight)); + return !(height == null || height.length() == 0 + || height.equals(preferredHeight)); } } @@ -1331,23 +1331,23 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * TextBox variant used as input element for filter selects, which prevents * selecting text when disabled. - * + * * @since 7.1.5 */ public class FilterSelectTextBox extends TextBox { /** * Creates a new filter select text box. - * + * * @since 7.6.4 */ public FilterSelectTextBox() { /*- * Stop the browser from showing its own suggestion popup. - * + * * Using an invalid value instead of "off" as suggested by * https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion - * + * * Leaving the non-standard Safari options autocapitalize and * autocorrect untouched since those do not interfere in the same * way, and they might be useful in a combo box where new items are @@ -1367,7 +1367,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, * back, focus at the front. This means that items that are too * long to display will display from the start and not the end * even on Firefox. - * + * * We need the JSNI function to set selection range so that we * can use the optional direction attribute to set the anchor to * the end and the focus to the start. This makes Firefox work @@ -1382,7 +1382,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, * unwanted behaviour when the width of the textbox is narrower * than the width of the entry: the end of the entry is shown * instead of the beginning. (see #13477) - * + * * To avoid this, we set the caret to the beginning of the line. */ @@ -1426,7 +1426,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /* * (non-Javadoc) - * + * * @see * com.google.gwt.user.client.ui.Widget#onBrowserEvent(com.google.gwt * .user.client.Event) @@ -1575,8 +1575,8 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, suggestionPopup = createSuggestionPopup(); popupOpener.sinkEvents(Event.ONMOUSEDOWN); - Roles.getButtonRole() - .setAriaHiddenState(popupOpener.getElement(), true); + Roles.getButtonRole().setAriaHiddenState(popupOpener.getElement(), + true); Roles.getButtonRole().set(popupOpener.getElement()); panel.add(tb); @@ -1606,7 +1606,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /* * (non-Javadoc) - * + * * @see * com.google.gwt.user.client.ui.Composite#onBrowserEvent(com.google.gwt * .user.client.Event) @@ -1633,7 +1633,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, * It is invoked during the Constructor and should only be overridden if a * custom TextBox shall be used. The overriding method cannot use any * instance variables. - * + * * @since 7.1.5 * @return TextBox instance used by this VFilterSelect */ @@ -1646,7 +1646,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, * instance. It is invoked during the Constructor and should only be * overridden if a custom SuggestionPopup shall be used. The overriding * method cannot use any instance variables. - * + * * @since 7.1.5 * @return SuggestionPopup instance used by this VFilterSelect */ @@ -1674,7 +1674,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Does the Select have more pages? - * + * * @return true if a next page exists, else false if the current page is the * last page */ @@ -1689,7 +1689,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Filters the options at a certain page. Uses the text box input as a * filter - * + * * @param page * The page which items are to be filtered */ @@ -1699,7 +1699,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Filters the options at certain page using the given filter - * + * * @param page * The page to filter * @param filter @@ -1711,7 +1711,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Filters the options at certain page using the given filter - * + * * @param page * The page to filter * @param filter @@ -1725,8 +1725,8 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, if (filter.equals(lastFilter) && currentPage == page) { if (!suggestionPopup.isAttached()) { - suggestionPopup.showSuggestions(currentSuggestions, - currentPage, totalMatches); + suggestionPopup.showSuggestions(currentSuggestions, currentPage, + totalMatches); } return; } @@ -1779,7 +1779,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Sets the text in the text box. - * + * * @param text * the text to set in the text box */ @@ -1819,7 +1819,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, * shown in the text box if nothing has been entered. *

    * For internal use only. May be removed or replaced in the future. - * + * * @param text * The text the text box should contain. */ @@ -1834,7 +1834,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Triggered when a suggestion is selected - * + * * @param suggestion * The suggestion that just got selected. */ @@ -1863,7 +1863,8 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, } setSelectedItemIcon(suggestion.getIconUri()); - if (!(newKey.equals(selectedOptionKey) || ("".equals(newKey) && selectedOptionKey == null))) { + if (!(newKey.equals(selectedOptionKey) + || ("".equals(newKey) && selectedOptionKey == null))) { selectedOptionKey = newKey; client.updateVariable(paintableId, "selected", new String[] { selectedOptionKey }, immediate); @@ -1889,7 +1890,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Sets the icon URI of the selected item. The icon is shown on the left * side of the item caption text. Set the URI to null to remove the icon. - * + * * @param iconUri * The URI of the icon */ @@ -1947,8 +1948,8 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, int iconHeight = WidgetUtil.getRequiredHeight(selectedItemIcon); int marginTop = (availableHeight - iconHeight) / 2; - selectedItemIcon.getElement().getStyle() - .setMarginTop(marginTop, Unit.PX); + selectedItemIcon.getElement().getStyle().setMarginTop(marginTop, + Unit.PX); } private static Set navigationKeyCodes = new HashSet(); @@ -1962,7 +1963,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.KeyDownHandler#onKeyDown(com.google.gwt * .event.dom.client.KeyDownEvent) @@ -1984,8 +1985,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, * items, wrongly interpreted responses and more. */ if (enableDebug) { - debug("Ignoring " - + keyCode + debug("Ignoring " + keyCode + " because we are waiting for a filtering response"); } DOM.eventPreventDefault(DOM.eventGetCurrentEvent()); @@ -2015,7 +2015,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Triggered when a key is pressed in the text box - * + * * @param event * The KeyDownEvent */ @@ -2043,9 +2043,8 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, return; } - if (currentSuggestion != null - && tb.getText().equals( - currentSuggestion.getReplacementString())) { + if (currentSuggestion != null && tb.getText() + .equals(currentSuggestion.getReplacementString())) { // Retain behavior from #6686 by returning without stopping // propagation if there's nothing to do return; @@ -2060,7 +2059,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Triggered when a key was pressed in the suggestion popup. - * + * * @param event * The KeyDownEvent of the key */ @@ -2143,7 +2142,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Triggered when a key was depressed - * + * * @param event * The KeyUpEvent of the key depressed */ @@ -2212,9 +2211,8 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, @Override public void onClick(ClickEvent event) { debug("VFS: onClick()"); - if (textInputEnabled - && event.getNativeEvent().getEventTarget().cast() == tb - .getElement()) { + if (textInputEnabled && event.getNativeEvent().getEventTarget() + .cast() == tb.getElement()) { // Don't process clicks on the text field if text input is enabled return; } @@ -2295,7 +2293,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.FocusHandler#onFocus(com.google.gwt.event * .dom.client.FocusEvent) @@ -2326,10 +2324,10 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, afterUpdateClientVariables(); } - ComponentConnector connector = ConnectorMap.get(client).getConnector( - this); - client.getVTooltip().showAssistive( - connector.getTooltipInfo(getElement())); + ComponentConnector connector = ConnectorMap.get(client) + .getConnector(this); + client.getVTooltip() + .showAssistive(connector.getTooltipInfo(getElement())); } /** @@ -2342,7 +2340,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.BlurHandler#onBlur(com.google.gwt.event * .dom.client.BlurEvent) @@ -2364,9 +2362,8 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, preventNextBlurEventInIE = false; Element focusedElement = WidgetUtil.getFocusedElement(); - if (getElement().isOrHasChild(focusedElement) - || suggestionPopup.getElement() - .isOrHasChild(focusedElement)) { + if (getElement().isOrHasChild(focusedElement) || suggestionPopup + .getElement().isOrHasChild(focusedElement)) { // IF the suggestion popup or another part of the VFilterSelect // was focused, move the focus back to the textfield and prevent @@ -2399,7 +2396,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /* * (non-Javadoc) - * + * * @see com.vaadin.client.Focusable#focus() */ @@ -2420,8 +2417,8 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, * For internal use only. May be removed or replaced in the future. */ public void updateRootWidth() { - ComponentConnector paintable = ConnectorMap.get(client).getConnector( - this); + ComponentConnector paintable = ConnectorMap.get(client) + .getConnector(this); if (paintable.isUndefinedWidth()) { @@ -2453,10 +2450,10 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, // Use util.getRequiredWidth instead of getOffsetWidth here - int iconWidth = selectedItemIcon == null ? 0 : WidgetUtil - .getRequiredWidth(selectedItemIcon); - int buttonWidth = popupOpener == null ? 0 : WidgetUtil - .getRequiredWidth(popupOpener); + int iconWidth = selectedItemIcon == null ? 0 + : WidgetUtil.getRequiredWidth(selectedItemIcon); + int buttonWidth = popupOpener == null ? 0 + : WidgetUtil.getRequiredWidth(popupOpener); /* * Instead of setting the width of the wrapper, set the width of @@ -2474,8 +2471,8 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, * locked */ if (!tb.getElement().getStyle().getWidth().endsWith("px")) { - int iconWidth = selectedItemIcon == null ? 0 : selectedItemIcon - .getOffsetWidth(); + int iconWidth = selectedItemIcon == null ? 0 + : selectedItemIcon.getOffsetWidth(); tb.setWidth((tb.getOffsetWidth() - iconWidth) + "px"); } } @@ -2484,7 +2481,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Get the width of the select in pixels where the text area and icon has * been included. - * + * * @return The width in pixels */ private int getMainWidth() { @@ -2501,7 +2498,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Handles special behavior of the mouse down event - * + * * @param event */ private void handleMouseDownEvent(Event event) { @@ -2534,7 +2531,8 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, } @Override - public com.google.gwt.user.client.Element getSubPartElement(String subPart) { + public com.google.gwt.user.client.Element getSubPartElement( + String subPart) { String[] parts = subPart.split("/"); if ("textbox".equals(parts[0])) { return tb.getElement(); @@ -2550,7 +2548,8 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, } @Override - public String getSubPartName(com.google.gwt.user.client.Element subElement) { + public String getSubPartName( + com.google.gwt.user.client.Element subElement) { if (tb.getElement().isOrHasChild(subElement)) { return "textbox"; } else if (popupOpener.getElement().isOrHasChild(subElement)) { @@ -2594,9 +2593,9 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, } /** - * Sets the caption of selected item, if "scroll to page" is disabled. - * This method is meant for internal use and may change in future versions. - * + * Sets the caption of selected item, if "scroll to page" is disabled. This + * method is meant for internal use and may change in future versions. + * * @since 7.7 * @param selectedCaption * the caption of selected item @@ -2610,7 +2609,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * This method is meant for internal use and may change in future versions. - * + * * @since 7.7 * @return the caption of selected item, if "scroll to page" is disabled */ diff --git a/client/src/main/java/com/vaadin/client/ui/VFlash.java b/client/src/main/java/com/vaadin/client/ui/VFlash.java index eaf53836ee..00fc881bc3 100644 --- a/client/src/main/java/com/vaadin/client/ui/VFlash.java +++ b/client/src/main/java/com/vaadin/client/ui/VFlash.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -156,10 +156,11 @@ public class VFlash extends HTML { * this by setting his own classid. */ if (classId != null) { - html.append("classid=\"" + WidgetUtil.escapeAttribute(classId) - + "\" "); + html.append( + "classid=\"" + WidgetUtil.escapeAttribute(classId) + "\" "); } else { - html.append("classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" "); + html.append( + "classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" "); } /* @@ -174,7 +175,8 @@ public class VFlash extends HTML { html.append("codebase=\"" + WidgetUtil.escapeAttribute(codebase) + "\" "); } else { - html.append("codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" "); + html.append( + "codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" "); } // Add width and height @@ -190,14 +192,14 @@ public class VFlash extends HTML { // Standby if (standby != null) { - html.append("standby=\"" + WidgetUtil.escapeAttribute(standby) - + "\" "); + html.append( + "standby=\"" + WidgetUtil.escapeAttribute(standby) + "\" "); } // Archive if (archive != null) { - html.append("archive=\"" + WidgetUtil.escapeAttribute(archive) - + "\" "); + html.append( + "archive=\"" + WidgetUtil.escapeAttribute(archive) + "\" "); } // End object tag @@ -213,7 +215,8 @@ public class VFlash extends HTML { html.append(""); } @@ -228,8 +231,8 @@ public class VFlash extends HTML { for (String name : embedParams.keySet()) { html.append(WidgetUtil.escapeAttribute(name)); html.append("="); - html.append("\"" - + WidgetUtil.escapeAttribute(embedParams.get(name)) + "\""); + html.append("\"" + WidgetUtil.escapeAttribute(embedParams.get(name)) + + "\""); } // End embed tag diff --git a/client/src/main/java/com/vaadin/client/ui/VForm.java b/client/src/main/java/com/vaadin/client/ui/VForm.java index ca38ea070b..ca1217551e 100644 --- a/client/src/main/java/com/vaadin/client/ui/VForm.java +++ b/client/src/main/java/com/vaadin/client/ui/VForm.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/VFormLayout.java b/client/src/main/java/com/vaadin/client/ui/VFormLayout.java index 3719688f2b..a221222b92 100644 --- a/client/src/main/java/com/vaadin/client/ui/VFormLayout.java +++ b/client/src/main/java/com/vaadin/client/ui/VFormLayout.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -60,7 +60,7 @@ public class VFormLayout extends SimplePanel { /** * Parses the stylenames from shared state - * + * * @param state * shared state of the component * @param enabled @@ -100,7 +100,7 @@ public class VFormLayout extends SimplePanel { /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.ClickHandler#onClick(com.google.gwt * .event.dom.client.ClickEvent) @@ -111,7 +111,8 @@ public class VFormLayout extends SimplePanel { if (caption.getOwner() != null) { if (caption.getOwner() instanceof Focusable) { ((Focusable) caption.getOwner()).focus(); - } else if (caption.getOwner() instanceof com.google.gwt.user.client.ui.Focusable) { + } else if (caption + .getOwner() instanceof com.google.gwt.user.client.ui.Focusable) { ((com.google.gwt.user.client.ui.Focusable) caption .getOwner()).setFocus(true); } @@ -124,8 +125,7 @@ public class VFormLayout extends SimplePanel { margins.hasTop()); setStyleName(margin, CLASSNAME + "-" + StyleConstants.MARGIN_RIGHT, margins.hasRight()); - setStyleName(margin, - CLASSNAME + "-" + StyleConstants.MARGIN_BOTTOM, + setStyleName(margin, CLASSNAME + "-" + StyleConstants.MARGIN_BOTTOM, margins.hasBottom()); setStyleName(margin, CLASSNAME + "-" + StyleConstants.MARGIN_LEFT, margins.hasLeft()); @@ -225,7 +225,7 @@ public class VFormLayout extends SimplePanel { private Element captionContent; /** - * + * * @param component * optional owner of caption. If not set, getOwner will * return null @@ -253,7 +253,8 @@ public class VFormLayout extends SimplePanel { setStyleName(styleName); } - public void updateCaption(AbstractComponentState state, boolean enabled) { + public void updateCaption(AbstractComponentState state, + boolean enabled) { // Update styles as they might have changed when the caption changed setStyles(getStylesFromState(state, enabled)); @@ -264,9 +265,8 @@ public class VFormLayout extends SimplePanel { icon = null; } if (state.resources.containsKey(ComponentConstants.ICON_RESOURCE)) { - icon = owner.getConnection().getIcon( - state.resources.get(ComponentConstants.ICON_RESOURCE) - .getURL()); + icon = owner.getConnection().getIcon(state.resources + .get(ComponentConstants.ICON_RESOURCE).getURL()); DOM.insertChild(getElement(), icon.getElement(), 0); isEmpty = false; @@ -317,8 +317,8 @@ public class VFormLayout extends SimplePanel { // Hide the required indicator from screen reader, as this // information is set directly at the input field - Roles.getTextboxRole().setAriaHiddenState( - requiredFieldIndicator, true); + Roles.getTextboxRole() + .setAriaHiddenState(requiredFieldIndicator, true); } } else { if (requiredFieldIndicator != null) { @@ -330,7 +330,7 @@ public class VFormLayout extends SimplePanel { /** * Returns Paintable for which this Caption belongs to. - * + * * @return owner Widget */ public ComponentConnector getOwner() { @@ -378,8 +378,8 @@ public class VFormLayout extends SimplePanel { // Hide the error indicator from screen reader, as this // information is set directly at the input field - Roles.getFormRole().setAriaHiddenState( - errorIndicatorElement, true); + Roles.getFormRole() + .setAriaHiddenState(errorIndicatorElement, true); } } else if (errorIndicatorElement != null) { diff --git a/client/src/main/java/com/vaadin/client/ui/VGridLayout.java b/client/src/main/java/com/vaadin/client/ui/VGridLayout.java index 9e13bb7fb2..c9140b8e91 100644 --- a/client/src/main/java/com/vaadin/client/ui/VGridLayout.java +++ b/client/src/main/java/com/vaadin/client/ui/VGridLayout.java @@ -97,7 +97,7 @@ public class VGridLayout extends ComplexPanel { /** * Returns the column widths measured in pixels - * + * * @return */ protected int[] getColumnWidths() { @@ -106,7 +106,7 @@ public class VGridLayout extends ComplexPanel { /** * Returns the row heights measured in pixels - * + * * @return */ protected int[] getRowHeights() { @@ -115,7 +115,7 @@ public class VGridLayout extends ComplexPanel { /** * Returns the spacing between the cells horizontally in pixels - * + * * @return */ protected int getHorizontalSpacing() { @@ -124,7 +124,7 @@ public class VGridLayout extends ComplexPanel { /** * Returns the spacing between the cells vertically in pixels - * + * * @return */ protected int getVerticalSpacing() { @@ -155,7 +155,8 @@ public class VGridLayout extends ComplexPanel { expandRatioSum += actualExpandRatio[i]; } for (int i = 0; i < rowHeights.length; i++) { - int ew = (int) (excessSpace * actualExpandRatio[i] / expandRatioSum); + int ew = (int) (excessSpace * actualExpandRatio[i] + / expandRatioSum); rowHeights[i] = minRowHeights[i] + ew; distributed += ew; } @@ -184,7 +185,7 @@ public class VGridLayout extends ComplexPanel { /** * Checks if it is ok to hide (or ignore) the given row. - * + * * @param rowIndex * the row to check * @return true, if the row should be interpreted as non-existant (hides @@ -197,7 +198,7 @@ public class VGridLayout extends ComplexPanel { /** * Checks if it is ok to hide (or ignore) the given column. - * + * * @param columnIndex * the column to check * @return true, if the column should be interpreted as non-existant (hides @@ -236,7 +237,8 @@ public class VGridLayout extends ComplexPanel { expandRatioSum += actualExpandRatio[i]; } for (int i = 0; i < columnWidths.length; i++) { - int ew = (int) (excessSpace * actualExpandRatio[i] / expandRatioSum); + int ew = (int) (excessSpace * actualExpandRatio[i] + / expandRatioSum); columnWidths[i] = minColumnWidths[i] + ew; distributed += ew; } @@ -533,9 +535,8 @@ public class VGridLayout extends ComplexPanel { } } - private static void distributeSpanSize(int[] dimensions, - int spanStartIndex, int spanSize, int spacingSize, int size, - float[] expansionRatios) { + private static void distributeSpanSize(int[] dimensions, int spanStartIndex, + int spanSize, int spacingSize, int size, float[] expansionRatios) { int allocated = dimensions[spanStartIndex]; for (int i = 1; i < spanSize; i++) { allocated += spacingSize + dimensions[spanStartIndex + i]; @@ -784,7 +785,7 @@ public class VGridLayout extends ComplexPanel { * Creates a new Cell with the given coordinates. *

    * For internal use only. May be removed or replaced in the future. - * + * * @param row * @param col * @return @@ -800,7 +801,7 @@ public class VGridLayout extends ComplexPanel { * child component is also returned if "element" is part of its caption. *

    * For internal use only. May be removed or replaced in the future. - * + * * @param element * An element that is a nested sub element of the root element in * this layout @@ -821,13 +822,13 @@ public class VGridLayout extends ComplexPanel { * child component is also returned if "element" is part of its caption. *

    * For internal use only. May be removed or replaced in the future. - * + * * @param element * An element that is a nested sub element of the root element in * this layout * @return The Paintable which the element is a part of. Null if the element * belongs to the layout and not to a child. - * + * * @since 7.2 */ public ComponentConnector getComponent(Element element) { diff --git a/client/src/main/java/com/vaadin/client/ui/VHorizontalLayout.java b/client/src/main/java/com/vaadin/client/ui/VHorizontalLayout.java index b890aefe3d..295117f6c9 100644 --- a/client/src/main/java/com/vaadin/client/ui/VHorizontalLayout.java +++ b/client/src/main/java/com/vaadin/client/ui/VHorizontalLayout.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/VImage.java b/client/src/main/java/com/vaadin/client/ui/VImage.java index 2742182179..3f0828a9ba 100644 --- a/client/src/main/java/com/vaadin/client/ui/VImage.java +++ b/client/src/main/java/com/vaadin/client/ui/VImage.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/VLabel.java b/client/src/main/java/com/vaadin/client/ui/VLabel.java index a3572759c4..d1358c4df0 100644 --- a/client/src/main/java/com/vaadin/client/ui/VLabel.java +++ b/client/src/main/java/com/vaadin/client/ui/VLabel.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/VLazyExecutor.java b/client/src/main/java/com/vaadin/client/ui/VLazyExecutor.java index dfa4f574c6..7190de45b3 100644 --- a/client/src/main/java/com/vaadin/client/ui/VLazyExecutor.java +++ b/client/src/main/java/com/vaadin/client/ui/VLazyExecutor.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -23,7 +23,7 @@ import com.google.gwt.user.client.Timer; * {@link #trigger()}. Calling {@link #trigger()} again before the command has * been executed causes the execution to be rescheduled to {@code delayMs} after * the second call. - * + * */ public class VLazyExecutor { diff --git a/client/src/main/java/com/vaadin/client/ui/VLink.java b/client/src/main/java/com/vaadin/client/ui/VLink.java index de99a8617f..929413db77 100644 --- a/client/src/main/java/com/vaadin/client/ui/VLink.java +++ b/client/src/main/java/com/vaadin/client/ui/VLink.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/VListSelect.java b/client/src/main/java/com/vaadin/client/ui/VListSelect.java index 83e25163b3..82b7e9a229 100644 --- a/client/src/main/java/com/vaadin/client/ui/VListSelect.java +++ b/client/src/main/java/com/vaadin/client/ui/VListSelect.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/VMediaBase.java b/client/src/main/java/com/vaadin/client/ui/VMediaBase.java index 53d7cef02d..8a6cd1af29 100644 --- a/client/src/main/java/com/vaadin/client/ui/VMediaBase.java +++ b/client/src/main/java/com/vaadin/client/ui/VMediaBase.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -31,7 +31,7 @@ public abstract class VMediaBase extends Widget { /** * Sets the MediaElement that is to receive all commands and properties. - * + * * @param element */ public void setMediaElement(MediaElement element) { diff --git a/client/src/main/java/com/vaadin/client/ui/VMenuBar.java b/client/src/main/java/com/vaadin/client/ui/VMenuBar.java index e0cea1c837..54a8f58c23 100644 --- a/client/src/main/java/com/vaadin/client/ui/VMenuBar.java +++ b/client/src/main/java/com/vaadin/client/ui/VMenuBar.java @@ -52,8 +52,8 @@ import com.vaadin.client.Util; import com.vaadin.client.WidgetUtil; import com.vaadin.shared.ui.menubar.MenuBarConstants; -public class VMenuBar extends SimpleFocusablePanel implements - CloseHandler, KeyPressHandler, KeyDownHandler, +public class VMenuBar extends SimpleFocusablePanel + implements CloseHandler, KeyPressHandler, KeyDownHandler, FocusHandler, SubPartAware { // The hierarchy of VMenuBar is a bit weird as VMenuBar is the Paintable, @@ -170,8 +170,8 @@ public class VMenuBar extends SimpleFocusablePanel implements } protected void updateStyleNames() { - String primaryStyleName = getParentMenu() != null ? getParentMenu() - .getStylePrimaryName() : getStylePrimaryName(); + String primaryStyleName = getParentMenu() != null + ? getParentMenu().getStylePrimaryName() : getStylePrimaryName(); // Reset the style name for all the items for (CustomMenuItem item : items) { @@ -183,8 +183,8 @@ public class VMenuBar extends SimpleFocusablePanel implements /* * Sub-menus should get the sub-menu prefix */ - super.setStylePrimaryName(primaryStyleName - + SUBMENU_CLASSNAME_PREFIX); + super.setStylePrimaryName( + primaryStyleName + SUBMENU_CLASSNAME_PREFIX); } } @@ -223,7 +223,8 @@ public class VMenuBar extends SimpleFocusablePanel implements if (item.getChildCount() > 0) { String bgStyle = ""; itemHTML.append(""); + + "-submenu-indicator\"" + bgStyle + + ">►"); } itemHTML.append(" 0) { // First move the top of the popup to get more space @@ -683,7 +685,7 @@ public class VMenuBar extends SimpleFocusablePanel implements /** * Hides the submenu of an item - * + * * @param item */ public void hideChildMenu(CustomMenuItem item) { @@ -727,9 +729,9 @@ public class VMenuBar extends SimpleFocusablePanel implements } /** - * + * * Recursively hide all child menus - * + * * @param animateIn * enable/disable animate-in animation when hide popup * @param animateOut @@ -761,7 +763,7 @@ public class VMenuBar extends SimpleFocusablePanel implements /** * Returns the parent menu of this menu, or null if this is the top-level * menu - * + * * @return */ public VMenuBar getParentMenu() { @@ -770,7 +772,7 @@ public class VMenuBar extends SimpleFocusablePanel implements /** * Set the parent menu of this menu - * + * * @param parent */ public void setParentMenu(VMenuBar parent) { @@ -780,7 +782,7 @@ public class VMenuBar extends SimpleFocusablePanel implements /** * Returns the currently selected item of this menu, or null if nothing is * selected - * + * * @return */ public CustomMenuItem getSelected() { @@ -789,7 +791,7 @@ public class VMenuBar extends SimpleFocusablePanel implements /** * Set the currently selected item of this menu - * + * * @param item */ public void setSelected(CustomMenuItem item) { @@ -806,9 +808,9 @@ public class VMenuBar extends SimpleFocusablePanel implements } /** - * + * * A class to hold information on menu items - * + * */ public static class CustomMenuItem extends Widget implements HasHTML { @@ -827,7 +829,7 @@ public class VMenuBar extends SimpleFocusablePanel implements /** * Default menu item {@link Widget} constructor for GWT.create(). - * + * * Use {@link #setHTML(String)} and {@link #setCommand(Command)} after * constructing a menu item. */ @@ -837,7 +839,7 @@ public class VMenuBar extends SimpleFocusablePanel implements /** * Creates a menu item {@link Widget}. - * + * * @param html * @param cmd * @deprecated use the default constructor and {@link #setHTML(String)} @@ -921,8 +923,8 @@ public class VMenuBar extends SimpleFocusablePanel implements String primaryStyleName = parentMenu.getStylePrimaryName(); if (parentMenu.subMenu) { - primaryStyleName = primaryStyleName.replace( - SUBMENU_CLASSNAME_PREFIX, ""); + primaryStyleName = primaryStyleName + .replace(SUBMENU_CLASSNAME_PREFIX, ""); } String currentStyles = super.getStyleName(); @@ -1054,20 +1056,21 @@ public class VMenuBar extends SimpleFocusablePanel implements // if the selected attribute is present (either true or false), // the item is selectable setCheckable(true); - setChecked(uidl - .getBooleanAttribute(MenuBarConstants.ATTRIBUTE_CHECKED)); + setChecked(uidl.getBooleanAttribute( + MenuBarConstants.ATTRIBUTE_CHECKED)); } else { setCheckable(false); } if (uidl.hasAttribute(MenuBarConstants.ATTRIBUTE_ITEM_STYLE)) { - styleName = uidl - .getStringAttribute(MenuBarConstants.ATTRIBUTE_ITEM_STYLE); + styleName = uidl.getStringAttribute( + MenuBarConstants.ATTRIBUTE_ITEM_STYLE); } - if (uidl.hasAttribute(MenuBarConstants.ATTRIBUTE_ITEM_DESCRIPTION)) { - description = uidl - .getStringAttribute(MenuBarConstants.ATTRIBUTE_ITEM_DESCRIPTION); + if (uidl.hasAttribute( + MenuBarConstants.ATTRIBUTE_ITEM_DESCRIPTION)) { + description = uidl.getStringAttribute( + MenuBarConstants.ATTRIBUTE_ITEM_DESCRIPTION); } updateStyleNames(); @@ -1083,7 +1086,7 @@ public class VMenuBar extends SimpleFocusablePanel implements /** * Checks if the item can be selected. - * + * * @return true if it is possible to select this item, false otherwise */ public boolean isSelectable() { @@ -1103,8 +1106,8 @@ public class VMenuBar extends SimpleFocusablePanel implements public void iLayout(boolean iconLoadEvent) { // Only collapse if there is more than one item in the root menu and the // menu has an explicit size - if ((getItems().size() > 1 || (collapsedRootItems != null && collapsedRootItems - .getItems().size() > 0)) + if ((getItems().size() > 1 || (collapsedRootItems != null + && collapsedRootItems.getItems().size() > 0)) && getElement().getStyle().getProperty("width") != null && moreItem != null) { @@ -1116,8 +1119,8 @@ public class VMenuBar extends SimpleFocusablePanel implements removeItem(moreItem); } - int availableWidth = LayoutManager.get(client).getInnerWidth( - getElement()); + int availableWidth = LayoutManager.get(client) + .getInnerWidth(getElement()); // Used width includes the "more" item if present int usedWidth = getConsumedWidth(); @@ -1134,8 +1137,8 @@ public class VMenuBar extends SimpleFocusablePanel implements while (widthReduced < widthNeeded && getItems().size() > 0) { // Move last root menu item to collapsed menu - CustomMenuItem collapse = getItems().get( - getItems().size() - 1); + CustomMenuItem collapse = getItems() + .get(getItems().size() - 1); widthReduced += collapse.getOffsetWidth(); removeItem(collapse); collapsedRootItems.addItem(collapse, 0); @@ -1194,7 +1197,7 @@ public class VMenuBar extends SimpleFocusablePanel implements /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.KeyPressHandler#onKeyPress(com.google * .gwt.event.dom.client.KeyPressEvent) @@ -1217,7 +1220,7 @@ public class VMenuBar extends SimpleFocusablePanel implements /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.KeyDownHandler#onKeyDown(com.google.gwt * .event.dom.client.KeyDownEvent) @@ -1242,7 +1245,7 @@ public class VMenuBar extends SimpleFocusablePanel implements * Get the key that moves the selection upwards. By default it is the up * arrow key but by overriding this you can change the key to whatever you * want. - * + * * @return The keycode of the key */ protected int getNavigationUpKey() { @@ -1253,7 +1256,7 @@ public class VMenuBar extends SimpleFocusablePanel implements * Get the key that moves the selection downwards. By default it is the down * arrow key but by overriding this you can change the key to whatever you * want. - * + * * @return The keycode of the key */ protected int getNavigationDownKey() { @@ -1264,7 +1267,7 @@ public class VMenuBar extends SimpleFocusablePanel implements * Get the key that moves the selection left. By default it is the left * arrow key but by overriding this you can change the key to whatever you * want. - * + * * @return The keycode of the key */ protected int getNavigationLeftKey() { @@ -1275,7 +1278,7 @@ public class VMenuBar extends SimpleFocusablePanel implements * Get the key that moves the selection right. By default it is the right * arrow key but by overriding this you can change the key to whatever you * want. - * + * * @return The keycode of the key */ protected int getNavigationRightKey() { @@ -1285,7 +1288,7 @@ public class VMenuBar extends SimpleFocusablePanel implements /** * Get the key that selects a menu item. By default it is the Enter key but * by overriding this you can change the key to whatever you want. - * + * * @deprecated use {@link #isNavigationSelectKey(int)} instead * @return */ @@ -1298,7 +1301,7 @@ public class VMenuBar extends SimpleFocusablePanel implements * Checks whether key code selects a menu item. By default it is the Enter * and Space keys but by overriding this you can change the keys to whatever * you want. - * + * * @since 7.2 * @param keycode * @return true if key selects menu item @@ -1311,7 +1314,7 @@ public class VMenuBar extends SimpleFocusablePanel implements /** * Get the key that closes the menu. By default it is the escape key but by * overriding this yoy can change the key to whatever you want. - * + * * @return */ protected int getCloseMenuKey() { @@ -1320,7 +1323,7 @@ public class VMenuBar extends SimpleFocusablePanel implements /** * Handles the keyboard events handled by the MenuBar - * + * * @param event * The keyboard event received * @return true iff the navigation event was handled @@ -1569,7 +1572,7 @@ public class VMenuBar extends SimpleFocusablePanel implements /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.FocusHandler#onFocus(com.google.gwt.event * .dom.client.FocusEvent) @@ -1582,10 +1585,11 @@ public class VMenuBar extends SimpleFocusablePanel implements private final String SUBPART_PREFIX = "item"; @Override - public com.google.gwt.user.client.Element getSubPartElement(String subPart) { + public com.google.gwt.user.client.Element getSubPartElement( + String subPart) { if (subPart.startsWith(SUBPART_PREFIX)) { - int index = Integer.parseInt(subPart.substring(SUBPART_PREFIX - .length())); + int index = Integer + .parseInt(subPart.substring(SUBPART_PREFIX.length())); CustomMenuItem item = getItems().get(index); return item.getElement(); @@ -1604,7 +1608,8 @@ public class VMenuBar extends SimpleFocusablePanel implements if (!item.isSeparator() && isItemNamed(item, subPart)) { return item.getElement(); } - if (item.getSubMenu() != null && item.getSubMenu().menuVisible) { + if (item.getSubMenu() != null + && item.getSubMenu().menuVisible) { submenuItems.addAll(item.getSubMenu().getItems()); } @@ -1649,7 +1654,8 @@ public class VMenuBar extends SimpleFocusablePanel implements } @Override - public String getSubPartName(com.google.gwt.user.client.Element subElement) { + public String getSubPartName( + com.google.gwt.user.client.Element subElement) { if (!getElement().isOrHasChild(subElement)) { return null; } @@ -1673,7 +1679,7 @@ public class VMenuBar extends SimpleFocusablePanel implements /** * Get menu item with given DOM element - * + * * @param element * Element used in search * @return Menu item or null if not found @@ -1702,11 +1708,11 @@ public class VMenuBar extends SimpleFocusablePanel implements /** * Get menu item with given DOM element - * + * * @param element * Element used in search * @return Menu item or null if not found - * + * * @since 7.2 */ public CustomMenuItem getMenuItemWithElement(Element element) { diff --git a/client/src/main/java/com/vaadin/client/ui/VNativeButton.java b/client/src/main/java/com/vaadin/client/ui/VNativeButton.java index 77b2515f45..6378da871d 100644 --- a/client/src/main/java/com/vaadin/client/ui/VNativeButton.java +++ b/client/src/main/java/com/vaadin/client/ui/VNativeButton.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -126,7 +126,7 @@ public class VNativeButton extends Button implements ClickHandler { /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.ClickHandler#onClick(com.google.gwt.event * .dom.client.ClickEvent) diff --git a/client/src/main/java/com/vaadin/client/ui/VNativeSelect.java b/client/src/main/java/com/vaadin/client/ui/VNativeSelect.java index 330442b550..bd9386f601 100644 --- a/client/src/main/java/com/vaadin/client/ui/VNativeSelect.java +++ b/client/src/main/java/com/vaadin/client/ui/VNativeSelect.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -92,8 +92,8 @@ public class VNativeSelect extends VOptionGroupBase implements Field { client.updateVariable(paintableId, "selected", getSelectedItems(), isImmediate()); } else { - client.updateVariable(paintableId, "selected", new String[] { "" - + getSelectedItem() }, isImmediate()); + client.updateVariable(paintableId, "selected", + new String[] { "" + getSelectedItem() }, isImmediate()); } if (firstValueIsTemporaryNullItem) { // remove temporary empty item @@ -102,9 +102,9 @@ public class VNativeSelect extends VOptionGroupBase implements Field { /* * Workaround to achrome bug that may cause value change event not * to fire when selection is done with keyboard. - * + * * http://dev.vaadin.com/ticket/10109 - * + * * Problem is confirmed to exist only on Chrome-Win, but just * execute in for all webkits. Probably exists also in other * webkits/blinks on windows. diff --git a/client/src/main/java/com/vaadin/client/ui/VNotification.java b/client/src/main/java/com/vaadin/client/ui/VNotification.java index 1ff51df8d0..9b361ae114 100644 --- a/client/src/main/java/com/vaadin/client/ui/VNotification.java +++ b/client/src/main/java/com/vaadin/client/ui/VNotification.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -108,7 +108,7 @@ public class VNotification extends VOverlay { /** * @deprecated Use static {@link #createNotification(int)} instead to enable * GWT deferred binding. - * + * * @param delayMsec */ @Deprecated @@ -131,7 +131,7 @@ public class VNotification extends VOverlay { /** * @deprecated Use static {@link #createNotification(int, int, int)} instead * to enable GWT deferred binding. - * + * * @param delayMsec * @param fadeMsec * @param startOpacity @@ -227,8 +227,8 @@ public class VNotification extends VOverlay { return null; } - return getApplicationConnection().getUIConnector().getState().notificationConfigurations - .get(style); + return getApplicationConnection().getUIConnector() + .getState().notificationConfigurations.get(style); } private void setWaiAriaRole(NotificationTypeConfiguration styleSetup) { @@ -296,14 +296,13 @@ public class VNotification extends VOverlay { // Still animating in, wait for it to finish before touching // the animation delay (which would restart the animation-in // in some browsers) - if (getStyleName().contains( - VOverlay.ADDITIONAL_CLASSNAME_ANIMATE_IN)) { + if (getStyleName() + .contains(VOverlay.ADDITIONAL_CLASSNAME_ANIMATE_IN)) { AnimationUtil.addAnimationEndListener(getElement(), new AnimationEndListener() { @Override public void onAnimationEnd(NativeEvent event) { - if (AnimationUtil - .getAnimationName(event) + if (AnimationUtil.getAnimationName(event) .contains( VOverlay.ADDITIONAL_CLASSNAME_ANIMATE_IN)) { VNotification.this.hide(); @@ -439,8 +438,10 @@ public class VNotification extends VOverlay { if (x < 0) { x = DOM.eventGetClientX(event); y = DOM.eventGetClientY(event); - } else if (Math.abs(DOM.eventGetClientX(event) - x) > mouseMoveThreshold - || Math.abs(DOM.eventGetClientY(event) - y) > mouseMoveThreshold) { + } else if (Math + .abs(DOM.eventGetClientX(event) - x) > mouseMoveThreshold + || Math.abs(DOM.eventGetClientY(event) + - y) > mouseMoveThreshold) { hideAfterDelay(); } break; @@ -487,18 +488,19 @@ public class VNotification extends VOverlay { public static void showNotification(ApplicationConnection client, final UIDL notification) { - boolean onlyPlainText = notification - .hasAttribute(UIConstants.NOTIFICATION_HTML_CONTENT_NOT_ALLOWED); + boolean onlyPlainText = notification.hasAttribute( + UIConstants.NOTIFICATION_HTML_CONTENT_NOT_ALLOWED); String html = ""; - if (notification.hasAttribute(UIConstants.ATTRIBUTE_NOTIFICATION_ICON)) { - String iconUri = notification - .getStringAttribute(UIConstants.ATTRIBUTE_NOTIFICATION_ICON); + if (notification + .hasAttribute(UIConstants.ATTRIBUTE_NOTIFICATION_ICON)) { + String iconUri = notification.getStringAttribute( + UIConstants.ATTRIBUTE_NOTIFICATION_ICON); html += client.getIcon(iconUri).getElement().getString(); } if (notification .hasAttribute(UIConstants.ATTRIBUTE_NOTIFICATION_CAPTION)) { - String caption = notification - .getStringAttribute(UIConstants.ATTRIBUTE_NOTIFICATION_CAPTION); + String caption = notification.getStringAttribute( + UIConstants.ATTRIBUTE_NOTIFICATION_CAPTION); if (onlyPlainText) { caption = WidgetUtil.escapeHTML(caption); caption = caption.replaceAll("\\n", "
    "); @@ -508,20 +510,21 @@ public class VNotification extends VOverlay { } if (notification .hasAttribute(UIConstants.ATTRIBUTE_NOTIFICATION_MESSAGE)) { - String message = notification - .getStringAttribute(UIConstants.ATTRIBUTE_NOTIFICATION_MESSAGE); + String message = notification.getStringAttribute( + UIConstants.ATTRIBUTE_NOTIFICATION_MESSAGE); if (onlyPlainText) { message = WidgetUtil.escapeHTML(message); message = message.replaceAll("\\n", "
    "); } - html += "

    " + message + "

    "; + html += "

    " + + message + "

    "; } final String style = notification - .hasAttribute(UIConstants.ATTRIBUTE_NOTIFICATION_STYLE) ? notification - .getStringAttribute(UIConstants.ATTRIBUTE_NOTIFICATION_STYLE) - : null; + .hasAttribute(UIConstants.ATTRIBUTE_NOTIFICATION_STYLE) + ? notification.getStringAttribute( + UIConstants.ATTRIBUTE_NOTIFICATION_STYLE) + : null; final int pos = notification .getIntAttribute(UIConstants.ATTRIBUTE_NOTIFICATION_POSITION); @@ -529,13 +532,13 @@ public class VNotification extends VOverlay { final int delay = notification .getIntAttribute(UIConstants.ATTRIBUTE_NOTIFICATION_DELAY); - createNotification(delay, client.getUIConnector().getWidget()).show( - html, position, style); + createNotification(delay, client.getUIConnector().getWidget()) + .show(html, position, style); } /** * Meant for internal usage only. - * + * * @since 7.5.0 * @param client * application connection @@ -546,15 +549,16 @@ public class VNotification extends VOverlay { */ public static String getDependentStyle(ApplicationConnection client, String style) { - VNotification notification = createNotification(-1, client - .getUIConnector().getWidget()); + VNotification notification = createNotification(-1, + client.getUIConnector().getWidget()); String styleName = notification.getStyleName(); notification.addStyleDependentName(style); String extendedStyle = notification.getStyleName(); return extendedStyle.substring(styleName.length()).trim(); } - public static VNotification createNotification(int delayMsec, Widget owner) { + public static VNotification createNotification(int delayMsec, + Widget owner) { final VNotification notification = GWT.create(VNotification.class); notification.setWaiAriaRole(null); notification.setDelay(delayMsec); @@ -589,7 +593,7 @@ public class VNotification extends VOverlay { * stack. Can be called when opening other overlays such as subwindows to * ensure the notifications receive the events they need and don't linger * indefinitely. See #7136. - * + * * TODO Should this be a generic Overlay feature instead? */ public static void bringNotificationsToFront() { @@ -602,10 +606,10 @@ public class VNotification extends VOverlay { /** * Shows an error notification and redirects the user to the given URL when * she clicks on the notification. - * + * * If both message and caption are null, redirects the user to the url * immediately - * + * * @since 7.5.1 * @param connection * A reference to the ApplicationConnection @@ -663,10 +667,10 @@ public class VNotification extends VOverlay { /** * Listens for Notification hide event, and redirects. Used for system * messages, such as session expired. - * + * */ - private static class NotificationRedirect implements - VNotification.EventListener { + private static class NotificationRedirect + implements VNotification.EventListener { String url; NotificationRedirect(String url) { diff --git a/client/src/main/java/com/vaadin/client/ui/VOptionGroup.java b/client/src/main/java/com/vaadin/client/ui/VOptionGroup.java index 9a28111dc5..72b0d841f0 100644 --- a/client/src/main/java/com/vaadin/client/ui/VOptionGroup.java +++ b/client/src/main/java/com/vaadin/client/ui/VOptionGroup.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -48,8 +48,8 @@ import com.vaadin.client.WidgetUtil; import com.vaadin.shared.EventId; import com.vaadin.shared.ui.optiongroup.OptionGroupConstants; -public class VOptionGroup extends VOptionGroupBase implements FocusHandler, - BlurHandler { +public class VOptionGroup extends VOptionGroupBase + implements FocusHandler, BlurHandler { public static final String CLASSNAME = "v-select-optiongroup"; @@ -173,8 +173,8 @@ public class VOptionGroup extends VOptionGroupBase implements FocusHandler, op.setHTML(itemHtml); op.setValue(opUidl.getBooleanAttribute("selected")); - boolean optionEnabled = !opUidl - .getBooleanAttribute(OptionGroupConstants.ATTRIBUTE_OPTION_DISABLED); + boolean optionEnabled = !opUidl.getBooleanAttribute( + OptionGroupConstants.ATTRIBUTE_OPTION_DISABLED); boolean enabled = optionEnabled && !isReadonly() && isEnabled(); op.setEnabled(enabled); optionsEnabled.put(op, optionEnabled); @@ -235,7 +235,8 @@ public class VOptionGroup extends VOptionGroupBase implements FocusHandler, @Override public void setTabIndex(int tabIndex) { - for (Iterator iterator = panel.iterator(); iterator.hasNext();) { + for (Iterator iterator = panel.iterator(); iterator + .hasNext();) { FocusWidget widget = (FocusWidget) iterator.next(); widget.setTabIndex(tabIndex); } diff --git a/client/src/main/java/com/vaadin/client/ui/VOptionGroupBase.java b/client/src/main/java/com/vaadin/client/ui/VOptionGroupBase.java index ce75043d89..7b0d9531e4 100644 --- a/client/src/main/java/com/vaadin/client/ui/VOptionGroupBase.java +++ b/client/src/main/java/com/vaadin/client/ui/VOptionGroupBase.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -137,7 +137,7 @@ public abstract class VOptionGroupBase extends Composite implements Field, /** * For internal use only. May be removed or replaced in the future. - * + * * @return "cols" specified in uidl, 0 if not specified */ public int getColumns() { @@ -146,7 +146,7 @@ public abstract class VOptionGroupBase extends Composite implements Field, /** * For internal use only. May be removed or replaced in the future. - * + * * @return "rows" specified in uidl, 0 if not specified */ public int getRows() { @@ -171,8 +171,8 @@ public abstract class VOptionGroupBase extends Composite implements Field, client.updateVariable(paintableId, "selected", getSelectedItems(), immediate); } else { - client.updateVariable(paintableId, "selected", new String[] { "" - + getSelectedItem() }, immediate); + client.updateVariable(paintableId, "selected", + new String[] { "" + getSelectedItem() }, immediate); } } diff --git a/client/src/main/java/com/vaadin/client/ui/VOverlay.java b/client/src/main/java/com/vaadin/client/ui/VOverlay.java index 5dc29f5a42..076d7994cb 100644 --- a/client/src/main/java/com/vaadin/client/ui/VOverlay.java +++ b/client/src/main/java/com/vaadin/client/ui/VOverlay.java @@ -39,7 +39,7 @@ import com.vaadin.client.widgets.Overlay; * {@link Overlay} superclass and the default widgetset will replace it with * this. The widget will not be dependent on this Vaadin specific widget and can * be used in a pure GWT environment. - * + * * @deprecated as this is specifically for Vaadin only, it should not be used * directly. */ @@ -80,7 +80,7 @@ public class VOverlay extends Overlay implements CloseHandler { * A "thread local" of sorts, set temporarily so that VOverlayImpl knows * which VOverlay is using it, so that it can be attached to the correct * overlay container. - * + * * TODO this is a strange pattern that we should get rid of when possible. */ protected static VOverlay current; @@ -88,7 +88,7 @@ public class VOverlay extends Overlay implements CloseHandler { /** * Get the {@link ApplicationConnection} that this overlay belongs to. If * it's not set, {@link #getOwner()} is used to figure it out. - * + * * @return */ protected ApplicationConnection getApplicationConnection() { @@ -108,7 +108,7 @@ public class VOverlay extends Overlay implements CloseHandler { /** * Gets the 'overlay container' element. Tries to find the current * {@link ApplicationConnection} using {@link #getApplicationConnection()}. - * + * * @return the overlay container element for the current * {@link ApplicationConnection} or another element if the current * {@link ApplicationConnection} cannot be determined. @@ -119,9 +119,8 @@ public class VOverlay extends Overlay implements CloseHandler { if (ac == null) { // could not figure out which one we belong to, styling will // probably fail - Logger.getLogger(getClass().getSimpleName()) - .warning( - "Could not determine ApplicationConnection for Overlay. Overlay will be attached directly to the root panel"); + Logger.getLogger(getClass().getSimpleName()).warning( + "Could not determine ApplicationConnection for Overlay. Overlay will be attached directly to the root panel"); return super.getOverlayContainer(); } else { return getOverlayContainer(ac); @@ -133,7 +132,7 @@ public class VOverlay extends Overlay implements CloseHandler { * {@link ApplicationConnection}. Each overlay should be created in a * overlay container element, so that the correct theme and styles can be * applied. - * + * * @param ac * A reference to {@link ApplicationConnection} * @return The overlay container @@ -160,7 +159,7 @@ public class VOverlay extends Overlay implements CloseHandler { /** * Set the label of the container element, where tooltip, notification and * dialgs are added to. - * + * * @param applicationConnection * the application connection for which to change the label * @param overlayContainerLabel diff --git a/client/src/main/java/com/vaadin/client/ui/VPanel.java b/client/src/main/java/com/vaadin/client/ui/VPanel.java index 946ff83180..a48703c914 100644 --- a/client/src/main/java/com/vaadin/client/ui/VPanel.java +++ b/client/src/main/java/com/vaadin/client/ui/VPanel.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -27,8 +27,8 @@ import com.vaadin.client.Focusable; import com.vaadin.client.ui.ShortcutActionHandler.ShortcutActionHandlerOwner; import com.vaadin.client.ui.TouchScrollDelegate.TouchScrollHandler; -public class VPanel extends SimplePanel implements ShortcutActionHandlerOwner, - Focusable { +public class VPanel extends SimplePanel + implements ShortcutActionHandlerOwner, Focusable { public static final String CLASSNAME = "v-panel"; @@ -99,7 +99,7 @@ public class VPanel extends SimplePanel implements ShortcutActionHandlerOwner, /** * Sets the keyboard focus on the Panel - * + * * @param focus * Should the panel have focus or not. */ @@ -113,7 +113,7 @@ public class VPanel extends SimplePanel implements ShortcutActionHandlerOwner, /* * (non-Javadoc) - * + * * @see com.vaadin.client.Focusable#focus() */ @@ -175,8 +175,8 @@ public class VPanel extends SimplePanel implements ShortcutActionHandlerOwner, "scrollTop"); int newscrollLeft = DOM.getElementPropertyInt(contentNode, "scrollLeft"); - if (client != null - && (newscrollLeft != scrollLeft || newscrollTop != scrollTop)) { + if (client != null && (newscrollLeft != scrollLeft + || newscrollTop != scrollTop)) { scrollLeft = newscrollLeft; scrollTop = newscrollTop; client.updateVariable(id, "scrollTop", scrollTop, false); diff --git a/client/src/main/java/com/vaadin/client/ui/VPasswordField.java b/client/src/main/java/com/vaadin/client/ui/VPasswordField.java index dcbb60364c..746bfe653c 100644 --- a/client/src/main/java/com/vaadin/client/ui/VPasswordField.java +++ b/client/src/main/java/com/vaadin/client/ui/VPasswordField.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,9 +20,9 @@ import com.google.gwt.user.client.DOM; /** * This class represents a password field. - * + * * @author Vaadin Ltd. - * + * */ public class VPasswordField extends VTextField { diff --git a/client/src/main/java/com/vaadin/client/ui/VPopupCalendar.java b/client/src/main/java/com/vaadin/client/ui/VPopupCalendar.java index 47f11b09b1..bba1045b89 100644 --- a/client/src/main/java/com/vaadin/client/ui/VPopupCalendar.java +++ b/client/src/main/java/com/vaadin/client/ui/VPopupCalendar.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -57,15 +57,15 @@ import com.vaadin.shared.ui.datefield.Resolution; /** * Represents a date selection component with a text field and a popup date * selector. - * + * * Note: To change the keyboard assignments used in the popup dialog you * should extend com.vaadin.client.ui.VCalendarPanel and then pass * set it by calling the setCalendarPanel(VCalendarPanel panel) * method. - * + * */ -public class VPopupCalendar extends VTextualDate implements Field, - ClickHandler, CloseHandler, SubPartAware { +public class VPopupCalendar extends VTextualDate + implements Field, ClickHandler, CloseHandler, SubPartAware { /** For internal use only. May be removed or replaced in the future. */ public final Button calendarToggle = new Button(); @@ -129,8 +129,8 @@ public class VPopupCalendar extends VTextualDate implements Field, // Description of the usage of the widget for assisitve device users descriptionForAssisitveDevicesElement = DOM.createDiv(); - descriptionForAssisitveDevicesElement - .setInnerText(PopupDateFieldState.DESCRIPTION_FOR_ASSISTIVE_DEVICES); + descriptionForAssisitveDevicesElement.setInnerText( + PopupDateFieldState.DESCRIPTION_FOR_ASSISTIVE_DEVICES); AriaHelper.ensureHasId(descriptionForAssisitveDevicesElement); Roles.getTextboxRole().setAriaDescribedbyProperty(text.getElement(), Id.of(descriptionForAssisitveDevicesElement)); @@ -230,16 +230,19 @@ public class VPopupCalendar extends VTextualDate implements Field, .getCalendarField()) { getClient().updateVariable(getId(), "day", newDate.getDate(), false); - if (getCurrentResolution().getCalendarField() > Resolution.DAY - .getCalendarField()) { + if (getCurrentResolution() + .getCalendarField() > Resolution.DAY + .getCalendarField()) { getClient().updateVariable(getId(), "hour", newDate.getHours(), false); - if (getCurrentResolution().getCalendarField() > Resolution.HOUR - .getCalendarField()) { + if (getCurrentResolution() + .getCalendarField() > Resolution.HOUR + .getCalendarField()) { getClient().updateVariable(getId(), "min", newDate.getMinutes(), false); - if (getCurrentResolution().getCalendarField() > Resolution.MINUTE - .getCalendarField()) { + if (getCurrentResolution() + .getCalendarField() > Resolution.MINUTE + .getCalendarField()) { getClient().updateVariable(getId(), "sec", newDate.getSeconds(), false); } @@ -252,7 +255,7 @@ public class VPopupCalendar extends VTextualDate implements Field, /** * Checks whether the text field is enabled. - * + * * @see VPopupCalendar#setTextFieldEnabled(boolean) * @return The current state of the text field. */ @@ -265,7 +268,7 @@ public class VPopupCalendar extends VTextualDate implements Field, * field is enabled. Disabling it causes only the button for date selection * to be active, thus preventing the user from entering invalid dates. See * {@link http://dev.vaadin.com/ticket/6790}. - * + * * @param state */ public void setTextFieldEnabled(boolean textFieldEnabled) { @@ -294,12 +297,12 @@ public class VPopupCalendar extends VTextualDate implements Field, if (reallyEnabled) { calendarToggle.setTabIndex(-1); - Roles.getButtonRole().setAriaHiddenState( - calendarToggle.getElement(), true); + Roles.getButtonRole() + .setAriaHiddenState(calendarToggle.getElement(), true); } else { calendarToggle.setTabIndex(0); - Roles.getButtonRole().setAriaHiddenState( - calendarToggle.getElement(), false); + Roles.getButtonRole() + .setAriaHiddenState(calendarToggle.getElement(), false); } handleAriaAttributes(); @@ -309,7 +312,7 @@ public class VPopupCalendar extends VTextualDate implements Field, * Set correct tab index for disabled text field in IE as the value set in * setTextFieldEnabled(...) gets overridden in * TextualDateConnection.updateFromUIDL(...) - * + * * @since 7.3.1 */ public void setTextFieldTabIndex() { @@ -349,11 +352,11 @@ public class VPopupCalendar extends VTextualDate implements Field, removeFromWidget = text; } - Roles.getFormRole().removeAriaLabelledbyProperty( - removeFromWidget.getElement()); + Roles.getFormRole() + .removeAriaLabelledbyProperty(removeFromWidget.getElement()); if (captionId == null) { - Roles.getFormRole().removeAriaLabelledbyProperty( - setForWidget.getElement()); + Roles.getFormRole() + .removeAriaLabelledbyProperty(setForWidget.getElement()); } else { Roles.getFormRole().setAriaLabelledbyProperty( setForWidget.getElement(), Id.of(captionId)); @@ -362,7 +365,7 @@ public class VPopupCalendar extends VTextualDate implements Field, /* * (non-Javadoc) - * + * * @see * com.google.gwt.user.client.ui.UIObject#setStyleName(java.lang.String) */ @@ -415,7 +418,7 @@ public class VPopupCalendar extends VTextualDate implements Field, /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.ClickHandler#onClick(com.google.gwt.event * .dom.client.ClickEvent) @@ -432,7 +435,7 @@ public class VPopupCalendar extends VTextualDate implements Field, /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.logical.shared.CloseHandler#onClose(com.google.gwt * .event.logical.shared.CloseEvent) @@ -462,7 +465,7 @@ public class VPopupCalendar extends VTextualDate implements Field, /** * Sets focus to Calendar panel. - * + * * @param focus */ public void setFocus(boolean focus) { @@ -482,7 +485,7 @@ public class VPopupCalendar extends VTextualDate implements Field, * Sets the content of a special field for assistive devices, so that they * can recognize the change and inform the user (reading out in case of * screen reader) - * + * * @param selectedDate * Date that is currently selected */ @@ -493,7 +496,7 @@ public class VPopupCalendar extends VTextualDate implements Field, /** * For internal use only. May be removed or replaced in the future. - * + * * @see com.vaadin.client.ui.VTextualDate#buildDate() */ @Override @@ -511,7 +514,7 @@ public class VPopupCalendar extends VTextualDate implements Field, /** * Update the text field contents from the date. See {@link #buildDate()}. - * + * * @param forceValid * true to force the text field to be updated, false to only * update if the parsable flag is true. @@ -525,7 +528,7 @@ public class VPopupCalendar extends VTextualDate implements Field, /* * (non-Javadoc) - * + * * @see com.vaadin.client.ui.VDateField#onBrowserEvent(com.google * .gwt.user.client.Event) */ @@ -542,7 +545,7 @@ public class VPopupCalendar extends VTextualDate implements Field, /** * Get the key code that opens the calendar panel. By default it is the down * key but you can override this to be whatever you like - * + * * @return */ protected int getOpenCalenderPanelKey() { @@ -562,7 +565,8 @@ public class VPopupCalendar extends VTextualDate implements Field, private final String CALENDAR_TOGGLE_ID = "popupButton"; @Override - public com.google.gwt.user.client.Element getSubPartElement(String subPart) { + public com.google.gwt.user.client.Element getSubPartElement( + String subPart) { if (subPart.equals(CALENDAR_TOGGLE_ID)) { return calendarToggle.getElement(); } @@ -571,7 +575,8 @@ public class VPopupCalendar extends VTextualDate implements Field, } @Override - public String getSubPartName(com.google.gwt.user.client.Element subElement) { + public String getSubPartName( + com.google.gwt.user.client.Element subElement) { if (calendarToggle.getElement().isOrHasChild(subElement)) { return CALENDAR_TOGGLE_ID; } @@ -582,7 +587,7 @@ public class VPopupCalendar extends VTextualDate implements Field, /** * Set a description that explains the usage of the Widget for users of * assistive devices. - * + * * @param descriptionForAssistiveDevices * String with the description */ @@ -595,7 +600,7 @@ public class VPopupCalendar extends VTextualDate implements Field, /** * Get the description that explains the usage of the Widget for users of * assistive devices. - * + * * @return String with the description */ public String getDescriptionForAssistiveDevices() { @@ -606,7 +611,7 @@ public class VPopupCalendar extends VTextualDate implements Field, * Sets the start range for this component. The start range is inclusive, * and it depends on the current resolution, what is considered inside the * range. - * + * * @param startDate * - the allowed range's start date */ @@ -617,7 +622,7 @@ public class VPopupCalendar extends VTextualDate implements Field, /** * Sets the end range for this component. The end range is inclusive, and it * depends on the current resolution, what is considered inside the range. - * + * * @param endDate * - the allowed range's end date */ diff --git a/client/src/main/java/com/vaadin/client/ui/VPopupView.java b/client/src/main/java/com/vaadin/client/ui/VPopupView.java index 0f4e68acab..11a38b6737 100644 --- a/client/src/main/java/com/vaadin/client/ui/VPopupView.java +++ b/client/src/main/java/com/vaadin/client/ui/VPopupView.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -52,8 +52,8 @@ import com.vaadin.client.ui.ShortcutActionHandler.ShortcutActionHandlerOwner; import com.vaadin.client.ui.popupview.VisibilityChangeEvent; import com.vaadin.client.ui.popupview.VisibilityChangeHandler; -public class VPopupView extends HTML implements HasEnabled, Iterable, - DeferredWorker { +public class VPopupView extends HTML + implements HasEnabled, Iterable, DeferredWorker { public static final String CLASSNAME = "v-popupview"; @@ -132,12 +132,12 @@ public class VPopupView extends HTML implements HasEnabled, Iterable, /** * Determines the correct position for a popup and displays the popup at * that position. - * + * * By default, the popup is shown centered relative to its host component, * ensuring it is visible on the screen if possible. - * + * * Can be overridden to customize the popup position. - * + * * @param popup */ public void showPopup(final CustomPopup popup) { @@ -184,7 +184,7 @@ public class VPopupView extends HTML implements HasEnabled, Iterable, /** * Make sure that we remove the popup when the main widget is removed. - * + * * @see com.google.gwt.user.client.ui.Widget#onUnload() */ @Override @@ -229,8 +229,8 @@ public class VPopupView extends HTML implements HasEnabled, Iterable, * (other than it being a VOverlay) is to be considered private and * potentially subject to change. */ - public class CustomPopup extends VOverlay implements - StateChangeEvent.StateChangeHandler { + public class CustomPopup extends VOverlay + implements StateChangeEvent.StateChangeHandler { private ComponentConnector popupComponentConnector = null; @@ -256,8 +256,8 @@ public class VPopupView extends HTML implements HasEnabled, Iterable, @Override public void onKeyDown(KeyDownEvent event) { if (shortcutActionHandler != null) { - shortcutActionHandler.handleKeyboardEvent(Event - .as(event.getNativeEvent())); + shortcutActionHandler.handleKeyboardEvent( + Event.as(event.getNativeEvent())); } } }, KeyDownEvent.getType()); diff --git a/client/src/main/java/com/vaadin/client/ui/VProgressBar.java b/client/src/main/java/com/vaadin/client/ui/VProgressBar.java index 348791728f..b01c017fd9 100644 --- a/client/src/main/java/com/vaadin/client/ui/VProgressBar.java +++ b/client/src/main/java/com/vaadin/client/ui/VProgressBar.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -30,7 +30,7 @@ import com.vaadin.client.StyleConstants; * floating point value between 0 and 1 (inclusive). The progress bar can also * be in an indeterminate mode showing an animation indicating that the task is * running but without providing any information about the current progress. - * + * * @since 7.1 * @author Vaadin Ltd */ @@ -55,7 +55,7 @@ public class VProgressBar extends Widget implements HasEnabled { /* * (non-Javadoc) - * + * * @see * com.google.gwt.user.client.ui.UIObject#setStylePrimaryName(java.lang. * String) diff --git a/client/src/main/java/com/vaadin/client/ui/VProgressIndicator.java b/client/src/main/java/com/vaadin/client/ui/VProgressIndicator.java index f93fa37af6..158c8d3cd6 100644 --- a/client/src/main/java/com/vaadin/client/ui/VProgressIndicator.java +++ b/client/src/main/java/com/vaadin/client/ui/VProgressIndicator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -19,9 +19,9 @@ package com.vaadin.client.ui; import com.vaadin.shared.ui.progressindicator.ProgressIndicatorState; /** - * + * * @author Vaadin Ltd - * + * * @deprecated as of 7.1, renamed to VProgressBar */ @Deprecated diff --git a/client/src/main/java/com/vaadin/client/ui/VRichTextArea.java b/client/src/main/java/com/vaadin/client/ui/VRichTextArea.java index cb4482f7cb..8f1ff6c513 100644 --- a/client/src/main/java/com/vaadin/client/ui/VRichTextArea.java +++ b/client/src/main/java/com/vaadin/client/ui/VRichTextArea.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -43,12 +43,12 @@ import com.vaadin.client.ui.richtextarea.VRichTextToolbar; /** * This class implements a basic client side rich text editor component. - * + * * @author Vaadin Ltd. - * + * */ -public class VRichTextArea extends Composite implements Field, KeyPressHandler, - KeyDownHandler, Focusable { +public class VRichTextArea extends Composite + implements Field, KeyPressHandler, KeyDownHandler, Focusable { /** * The input node CSS classname. @@ -155,7 +155,7 @@ public class VRichTextArea extends Composite implements Field, KeyPressHandler, * render. Simple deferred command is not enough. Using Timer with * moderated timeout. If this appears to fail on many (most likely slow) * environments, consider increasing the timeout. - * + * * FF seems to require the most time to stabilize its RTA. On Vaadin * tiergarden test machines, 200ms was not enough always (about 50% * success rate) - 300 ms was 100% successful. This however was not @@ -232,10 +232,9 @@ public class VRichTextArea extends Composite implements Field, KeyPressHandler, ShortcutActionHandler shortcutHandler = getShortcutHandlerOwner() .getShortcutActionHandler(); if (shortcutHandler != null) { - shortcutHandler - .handleKeyboardEvent(com.google.gwt.user.client.Event - .as(event.getNativeEvent()), - ConnectorMap.get(client).getConnector(this)); + shortcutHandler.handleKeyboardEvent( + com.google.gwt.user.client.Event.as(event.getNativeEvent()), + ConnectorMap.get(client).getConnector(this)); } } @@ -285,7 +284,7 @@ public class VRichTextArea extends Composite implements Field, KeyPressHandler, /** * Set the value of the text area - * + * * @param value * The text value. Can be html. */ @@ -312,7 +311,7 @@ public class VRichTextArea extends Composite implements Field, KeyPressHandler, * Browsers differ in what they return as the content of a visually empty * rich text area. This method is used to normalize these to an empty * string. See #8004. - * + * * @return cleaned html string */ public String getSanitizedValue() { @@ -340,7 +339,7 @@ public class VRichTextArea extends Composite implements Field, KeyPressHandler, /** * Adds a blur handler to the component. - * + * * @param blurHandler * the blur handler to add */ @@ -350,7 +349,7 @@ public class VRichTextArea extends Composite implements Field, KeyPressHandler, /** * Removes a blur handler. - * + * * @param blurHandler * the handler to remove */ diff --git a/client/src/main/java/com/vaadin/client/ui/VScrollTable.java b/client/src/main/java/com/vaadin/client/ui/VScrollTable.java index 479fffc741..b4eb18a01d 100644 --- a/client/src/main/java/com/vaadin/client/ui/VScrollTable.java +++ b/client/src/main/java/com/vaadin/client/ui/VScrollTable.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -109,34 +109,34 @@ import com.vaadin.shared.ui.table.TableConstants; /** * VScrollTable - * + * * VScrollTable is a FlowPanel having two widgets in it: * TableHead component * * ScrollPanel - * + * * TableHead contains table's header and widgets + logic for resizing, * reordering and hiding columns. - * + * * ScrollPanel contains VScrollTableBody object which handles content. To save * some bandwidth and to improve clients responsiveness with loads of data, in * VScrollTableBody all rows are not necessary rendered. There are "spacers" in * VScrollTableBody to use the exact same space as non-rendered rows would use. * This way we can use seamlessly traditional scrollbars and scrolling to fetch * more rows instead of "paging". - * + * * In VScrollTable we listen to scroll events. On horizontal scrolling we also * update TableHeads scroll position which has its scrollbars hidden. On * vertical scroll events we will check if we are reaching the end of area where * we have rows rendered and - * + * * TODO implement unregistering for child components in Cells */ -public class VScrollTable extends FlowPanel implements HasWidgets, - ScrollHandler, VHasDropHandler, FocusHandler, BlurHandler, Focusable, - ActionOwner, SubPartAware, DeferredWorker { +public class VScrollTable extends FlowPanel + implements HasWidgets, ScrollHandler, VHasDropHandler, FocusHandler, + BlurHandler, Focusable, ActionOwner, SubPartAware, DeferredWorker { /** * Simple interface for parts of the table capable of owning a context menu. - * + * * @since 7.2 * @author Vaadin Ltd */ @@ -146,7 +146,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Handles showing context menu on "long press" from a touch screen. - * + * * @since 7.2 * @author Vaadin Ltd */ @@ -162,7 +162,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Initializes a handler for a certain context menu owner. - * + * * @param target * the owner of the context menu */ @@ -183,7 +183,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * A function to handle touch context events in a table. - * + * * @param event * browser event to handle */ @@ -237,7 +237,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, * Calculates how many pixels away the user's finger has traveled. This * reduces the chance of small non-intentional movements from canceling * the long press detection. - * + * * @param event * the Event for which to check the move distance * @return true if this is considered an intentional move by the user @@ -403,7 +403,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, * The last known row height used to preserve the height of a table with * custom row heights and a fixed page length after removing the last row * from the table. - * + * * A new VScrollTableBody instance is created every time the number of rows * changes causing {@link VScrollTableBody#rowHeight} to be discarded and * the height recalculated by {@link VScrollTableBody#getRowHeight(boolean)} @@ -447,7 +447,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /* * (non-Javadoc) - * + * * @see java.lang.Object#toString() */ @@ -468,8 +468,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, int endOfFirstRange = row.getIndex() - 1; if (endOfFirstRange >= startRow.getIndex()) { // create range of first part unless its length is < 1 - ranges.add(new SelectionRange(startRow, endOfFirstRange - - startRow.getIndex() + 1)); + ranges.add(new SelectionRange(startRow, + endOfFirstRange - startRow.getIndex() + 1)); } int startOfSecondRange = row.getIndex() + 1; if (getEndIndex() >= startOfSecondRange) { @@ -477,8 +477,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, VScrollTableRow startOfRange = scrollBody .getRowByRowIndex(startOfSecondRange); if (startOfRange != null) { - ranges.add(new SelectionRange(startOfRange, getEndIndex() - - startOfSecondRange + 1)); + ranges.add(new SelectionRange(startOfRange, + getEndIndex() - startOfSecondRange + 1)); } } return ranges; @@ -529,11 +529,11 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * For internal use only. May be removed or replaced in the future. - * + * * Overwrites onBrowserEvent function on FocusableScrollPanel to give event * access to touchContextProvider. Has to be public to give TableConnector * access to the scrollBodyPanel field. - * + * * @since 7.2 * @author Vaadin Ltd */ @@ -634,8 +634,9 @@ public class VScrollTable extends FlowPanel implements HasWidgets, // (prevents scrolling) event.preventDefault(); } else if (hasFocus()) { - if (handleNavigation(event.getKeyCode(), event.getCtrlKey() - || event.getMetaKey(), event.getShiftKey())) { + if (handleNavigation(event.getKeyCode(), + event.getCtrlKey() || event.getMetaKey(), + event.getShiftKey())) { navKeyDown = true; event.preventDefault(); } @@ -718,14 +719,14 @@ public class VScrollTable extends FlowPanel implements HasWidgets, * Values (serverCacheFirst+serverCacheLast) sent by server that tells which * rows (indexes) are in the server side cache (page buffer). -1 means * unknown. The server side cache row MUST MATCH the client side cache rows. - * + * * If the client side cache contains additional rows with e.g. buttons, it * will cause out of sync when such a button is pressed. - * + * * If the server side cache contains additional rows with e.g. buttons, * scrolling in the client will cause empty buttons to be rendered * (cached=true request for non-existing components) - * + * * For internal use only. May be removed or replaced in the future. */ public int serverCacheFirst = -1; @@ -806,12 +807,11 @@ public class VScrollTable extends FlowPanel implements HasWidgets, // capture is in use Element elementUnderMouse = WidgetUtil .getElementUnderMouse(event.getNativeEvent()); - if (lastMouseDownTarget != null - && lastMouseDownTarget.isOrHasChild(elementUnderMouse)) { + if (lastMouseDownTarget != null && lastMouseDownTarget + .isOrHasChild(elementUnderMouse)) { mouseUpPreviewMatched = true; } else { - getLogger().log( - Level.FINEST, + getLogger().log(Level.FINEST, "Ignoring mouseup from " + elementUnderMouse + " when mousedown was on " + lastMouseDownTarget); @@ -867,8 +867,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, scrollBodyPanel.removeStyleName(getStylePrimaryName() + "-body"); if (scrollBody != null) { - scrollBody.removeStyleName(getStylePrimaryName() - + "-body-noselection"); + scrollBody.removeStyleName( + getStylePrimaryName() + "-body-noselection"); } if (isPrimary) { @@ -892,8 +892,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, this.client = client; // Add a handler to clear saved context menu details when the menu // closes. See #8526. - addCloseHandler = client.getContextMenu().addCloseHandler( - new CloseHandler() { + addCloseHandler = client.getContextMenu() + .addCloseHandler(new CloseHandler() { @Override public void onClose(CloseEvent event) { @@ -904,7 +904,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Handles a context menu event on table body. - * + * * @param left * left position of the context menu * @param top @@ -924,7 +924,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Fires a column resize event which sends the resize information to the * server. - * + * * @param columnId * The columnId of the column which was resized * @param originalWidth @@ -946,7 +946,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Non-immediate variable update of column widths for a collection of * columns. - * + * * @param columns * the columns to trigger the events for. */ @@ -962,7 +962,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Moves the focus one step down - * + * * @return Returns true if succeeded */ private boolean moveFocusDown() { @@ -971,7 +971,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Moves the focus down by 1+offset rows - * + * * @return Returns true if succeeded, else false if the selection could not * be move downwards */ @@ -980,8 +980,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, if (focusedRow == null && scrollBody.iterator().hasNext()) { // FIXME should focus first visible from top, not first rendered // ?? - return setRowFocus((VScrollTableRow) scrollBody.iterator() - .next()); + return setRowFocus( + (VScrollTableRow) scrollBody.iterator().next()); } else { VScrollTableRow next = getNextRow(focusedRow, offset); if (next != null) { @@ -995,7 +995,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Moves the selection one step up - * + * * @return Returns true if succeeded */ private boolean moveFocusUp() { @@ -1004,18 +1004,18 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Moves the focus row upwards - * + * * @return Returns true if succeeded, else false if the selection could not * be move upwards - * + * */ private boolean moveFocusUp(int offset) { if (isSelectable()) { if (focusedRow == null && scrollBody.iterator().hasNext()) { // FIXME logic is exactly the same as in moveFocusDown, should // be the opposite?? - return setRowFocus((VScrollTableRow) scrollBody.iterator() - .next()); + return setRowFocus( + (VScrollTableRow) scrollBody.iterator().next()); } else { VScrollTableRow prev = getPreviousRow(focusedRow, offset); if (prev != null) { @@ -1031,7 +1031,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Selects a row where the current selection head is - * + * * @param ctrlSelect * Is the selection a ctrl+selection * @param shiftSelect @@ -1071,7 +1071,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Sends the selection to the server if it has been changed since the last * update/visit. - * + * * @param immediately * set to true to immediately send the rows */ @@ -1095,12 +1095,13 @@ public class VScrollTable extends FlowPanel implements HasWidgets, // Send the selected row ranges client.updateVariable(paintableId, "selectedRanges", - ranges.toArray(new String[selectedRowRanges.size()]), false); + ranges.toArray(new String[selectedRowRanges.size()]), + false); selectedRowRanges.clear(); // clean selectedRowKeys so that they don't contain excess values - for (Iterator iterator = selectedRowKeys.iterator(); iterator - .hasNext();) { + for (Iterator iterator = selectedRowKeys + .iterator(); iterator.hasNext();) { String key = iterator.next(); VScrollTableRow renderedRowByKey = getRenderedRowByKey(key); if (renderedRowByKey != null) { @@ -1128,7 +1129,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, * Get the key that moves the selection head upwards. By default it is the * up arrow key but by overriding this you can change the key to whatever * you want. - * + * * @return The keycode of the key */ protected int getNavigationUpKey() { @@ -1139,7 +1140,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, * Get the key that moves the selection head downwards. By default it is the * down arrow key but by overriding this you can change the key to whatever * you want. - * + * * @return The keycode of the key */ protected int getNavigationDownKey() { @@ -1150,7 +1151,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, * Get the key that scrolls to the left in the table. By default it is the * left arrow key but by overriding this you can change the key to whatever * you want. - * + * * @return The keycode of the key */ protected int getNavigationLeftKey() { @@ -1161,7 +1162,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, * Get the key that scroll to the right on the table. By default it is the * right arrow key but by overriding this you can change the key to whatever * you want. - * + * * @return The keycode of the key */ protected int getNavigationRightKey() { @@ -1172,7 +1173,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, * Get the key that selects an item in the table. By default it is the space * bar key but by overriding this you can change the key to whatever you * want. - * + * * @return */ protected int getNavigationSelectKey() { @@ -1183,7 +1184,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, * Get the key the moves the selection one page up in the table. By default * this is the Page Up key but by overriding this you can change the key to * whatever you want. - * + * * @return */ protected int getNavigationPageUpKey() { @@ -1194,7 +1195,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, * Get the key the moves the selection one page down in the table. By * default this is the Page Down key but by overriding this you can change * the key to whatever you want. - * + * * @return */ protected int getNavigationPageDownKey() { @@ -1205,7 +1206,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, * Get the key the moves the selection to the beginning of the table. By * default this is the Home key but by overriding this you can change the * key to whatever you want. - * + * * @return */ protected int getNavigationStartKey() { @@ -1216,7 +1217,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, * Get the key the moves the selection to the end of the table. By default * this is the End key but by overriding this you can change the key to * whatever you want. - * + * * @return */ protected int getNavigationEndKey() { @@ -1312,10 +1313,9 @@ public class VScrollTable extends FlowPanel implements HasWidgets, */ VScrollTableRow row = (VScrollTableRow) iterator.next(); boolean selected = selectedKeys.contains(row.getKey()); - if (!selected - && unSyncedselectionsBeforeRowFetch != null - && unSyncedselectionsBeforeRowFetch.contains(row - .getKey())) { + if (!selected && unSyncedselectionsBeforeRowFetch != null + && unSyncedselectionsBeforeRowFetch + .contains(row.getKey())) { selected = true; keyboardSelectionOverRowFetchInProgress = true; } @@ -1409,11 +1409,11 @@ public class VScrollTable extends FlowPanel implements HasWidgets, if (firstvisible >= 0) { firstRowInViewPort = firstvisible; if (firstvisibleOnLastPage > -1) { - scrollBodyPanel - .setScrollPosition(measureRowHeightOffset(firstvisibleOnLastPage)); + scrollBodyPanel.setScrollPosition( + measureRowHeightOffset(firstvisibleOnLastPage)); } else { - scrollBodyPanel - .setScrollPosition(measureRowHeightOffset(firstvisible)); + scrollBodyPanel.setScrollPosition( + measureRowHeightOffset(firstvisible)); } } disableLazyScroller(); @@ -1422,10 +1422,10 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** For internal use only. May be removed or replaced in the future. */ public void updateFirstVisibleAndScrollIfNeeded(UIDL uidl) { - firstvisible = uidl.hasVariable("firstvisible") ? uidl - .getIntVariable("firstvisible") : 0; - firstvisibleOnLastPage = uidl.hasVariable("firstvisibleonlastpage") ? uidl - .getIntVariable("firstvisibleonlastpage") : -1; + firstvisible = uidl.hasVariable("firstvisible") + ? uidl.getIntVariable("firstvisible") : 0; + firstvisibleOnLastPage = uidl.hasVariable("firstvisibleonlastpage") + ? uidl.getIntVariable("firstvisibleonlastpage") : -1; if (firstvisible != lastRequestedFirstvisible && scrollBody != null) { // Update lastRequestedFirstvisible right away here @@ -1462,11 +1462,12 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** For internal use only. May be removed or replaced in the future. */ public void updateSelectionProperties(UIDL uidl, AbstractComponentState state, boolean readOnly) { - setMultiSelectMode(uidl.hasAttribute("multiselectmode") ? uidl - .getIntAttribute("multiselectmode") : MULTISELECT_MODE_DEFAULT); + setMultiSelectMode(uidl.hasAttribute("multiselectmode") + ? uidl.getIntAttribute("multiselectmode") + : MULTISELECT_MODE_DEFAULT); - nullSelectionAllowed = uidl.hasAttribute("nsa") ? uidl - .getBooleanAttribute("nsa") : true; + nullSelectionAllowed = uidl.hasAttribute("nsa") + ? uidl.getBooleanAttribute("nsa") : true; if (uidl.hasAttribute("selectmode")) { if (readOnly) { @@ -1483,8 +1484,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** For internal use only. May be removed or replaced in the future. */ public void updateDragMode(UIDL uidl) { - dragmode = uidl.hasAttribute("dragmode") ? uidl - .getIntAttribute("dragmode") : 0; + dragmode = uidl.hasAttribute("dragmode") + ? uidl.getIntAttribute("dragmode") : 0; if (BrowserInfo.get().isIE()) { if (dragmode > 0) { getElement().setPropertyJSO("onselectstart", @@ -1523,7 +1524,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Returns the extra space that is given to the header column when column * width is determined by header text. - * + * * @return extra space in pixels */ private int getHeaderPadding() { @@ -1534,7 +1535,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, * This method exists for the needs of {@link VTreeTable} only. Not part of * the official API, extend at your own risk. May be removed or * replaced in the future. - * + * * @return index of TreeTable's hierarchy column, or -1 if not applicable */ protected int getHierarchyColumnIndex() { @@ -1559,9 +1560,11 @@ public class VScrollTable extends FlowPanel implements HasWidgets, // try to focus a row currently selected and in viewport String selectedRowKey = selectedRowKeys.iterator().next(); if (selectedRowKey != null) { - VScrollTableRow renderedRow = getRenderedRowByKey(selectedRowKey); + VScrollTableRow renderedRow = getRenderedRowByKey( + selectedRowKey); if (renderedRow == null || !renderedRow.isInViewPort()) { - setRowFocus(scrollBody.getRowByRowIndex(firstRowInViewPort)); + setRowFocus( + scrollBody.getRowByRowIndex(firstRowInViewPort)); } else { setRowFocus(renderedRow); } @@ -1580,7 +1583,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, * Selects the last row visible in the table *

    * For internal use only. May be removed or replaced in the future. - * + * * @param focusOnly * Should the focus only be moved to the last row */ @@ -1590,8 +1593,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, if (lastRowInViewport == null) { // this should not happen in normal situations (white space at the // end of viewport). Select the last rendered as a fallback. - lastRowInViewport = scrollBody.getRowByRowIndex(scrollBody - .getLastRendered()); + lastRowInViewport = scrollBody + .getRowByRowIndex(scrollBody.getLastRendered()); if (lastRowInViewport == null) { return; // empty table } @@ -1607,7 +1610,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, * Selects the first row visible in the table *

    * For internal use only. May be removed or replaced in the future. - * + * * @param focusOnly * Should the focus only be moved to the first row */ @@ -1705,7 +1708,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, *

    * Update headers whould be called before this method is called! *

    - * + * * @param strings */ private void updateFooter(String[] strings) { @@ -1734,7 +1737,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * For internal use only. May be removed or replaced in the future. - * + * * @param uidl * which contains row data * @param firstRow @@ -1784,10 +1787,10 @@ public class VScrollTable extends FlowPanel implements HasWidgets, * caching window. */ protected void discardRowsOutsideCacheWindow() { - int firstRowToKeep = (int) (firstRowInViewPort - pageLength - * cache_rate); - int lastRowToKeep = (int) (firstRowInViewPort + pageLength + pageLength - * cache_rate); + int firstRowToKeep = (int) (firstRowInViewPort + - pageLength * cache_rate); + int lastRowToKeep = (int) (firstRowInViewPort + pageLength + + pageLength * cache_rate); // sanity checks: if (firstRowToKeep < 0) { firstRowToKeep = 0; @@ -1863,7 +1866,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, * on the commands in the UIDL. *

    * For internal use only. May be removed or replaced in the future. - * + * * @param partialRowAdditions * the UIDL containing row updates. */ @@ -1893,7 +1896,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Gives correct column index for given column key ("cid" in UIDL). - * + * * @param colKey * @return column index of visible columns, -1 if column not visible */ @@ -1961,9 +1964,9 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Note: not part of the official API, extend at your own risk. May be * removed or replaced in the future. - * + * * Sets the indicated column's width for headers and scrollBody alike. - * + * * @param colIndex * index of the modified column * @param w @@ -2011,7 +2014,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Get a rendered row by its key - * + * * @param key * The key to search with * @return @@ -2032,10 +2035,10 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Returns the next row to the given row - * + * * @param row * The row to calculate from - * + * * @return The next row or null if no row exists */ private VScrollTableRow getNextRow(VScrollTableRow row, int offset) { @@ -2058,7 +2061,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Returns the previous row from the given row - * + * * @param row * The row to calculate from * @return The previous row or null if no row exists @@ -2170,13 +2173,13 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Run only once when component is attached and received its initial * content. This function: - * + * * * Syncs headers and bodys "natural widths and saves the values. - * + * * * Sets proper width and height - * + * * * Makes deferred request to get some cache rows - * + * * For internal use only. May be removed or replaced in the future. */ public void sizeInit() { @@ -2188,7 +2191,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, * We will use browsers table rendering algorithm to find proper column * widths. If content and header take less space than available, we will * divide extra space relatively to each column which has not width set. - * + * * Overflow pixels are added to last column. */ @@ -2204,8 +2207,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, tHead.enableBrowserIntelligence(); tFoot.enableBrowserIntelligence(); - int hierarchyColumnIndent = scrollBody != null ? scrollBody - .getMaxIndent() : 0; + int hierarchyColumnIndent = scrollBody != null + ? scrollBody.getMaxIndent() : 0; HeaderCell hierarchyHeaderWithExpandRatio = null; // first loop: collect natural widths @@ -2319,9 +2322,9 @@ public class VScrollTable extends FlowPanel implements HasWidgets, if (hierarchyHeaderWithExpandRatio != null) { // ensure first that the hierarchyColumn gets at least the // space allocated for indent - final int newSpace = Math - .round((extraSpace * (hierarchyHeaderWithExpandRatio - .getExpandRatio() / expandRatioDivider))); + final int newSpace = Math.round((extraSpace + * (hierarchyHeaderWithExpandRatio.getExpandRatio() + / expandRatioDivider))); if (newSpace < hierarchyColumnIndent) { // not enough space for indent, remove indent from the // extraSpace again and handle hierarchy column's header @@ -2340,14 +2343,15 @@ public class VScrollTable extends FlowPanel implements HasWidgets, if (hCell.getExpandRatio() > 0) { int w = widths[i]; if (setIndentToHierarchyHeader - && hierarchyHeaderWithExpandRatio.equals(hCell)) { + && hierarchyHeaderWithExpandRatio + .equals(hCell)) { // hierarchy column's header is no longer part of // the expansion divide and only gets indent w += hierarchyColumnIndent; } else { final int newSpace = Math - .round((extraSpace * (hCell - .getExpandRatio() / expandRatioDivider))); + .round((extraSpace * (hCell.getExpandRatio() + / expandRatioDivider))); w += newSpace; } widths[i] = w; @@ -2366,8 +2370,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, HeaderCell hCell = (HeaderCell) headCells.next(); if (!hCell.isDefinedWidth()) { int w = widths[i]; - final int newSpace = Math.round((float) extraSpace - * (float) w / totalWidthR); + final int newSpace = Math.round( + (float) extraSpace * (float) w / totalWidthR); w += newSpace; widths[i] = w; } @@ -2444,8 +2448,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, // int bodyHeight = scrollBody.getOffsetHeight(); bodyHeight = scrollBody.getRequiredHeight(); } else { - bodyHeight = (int) Math.round(scrollBody.getRowHeight(true) - * pageLength); + bodyHeight = (int) Math + .round(scrollBody.getRowHeight(true) * pageLength); } boolean needsSpaceForHorizontalSrollbar = (total > availW); if (needsSpaceForHorizontalSrollbar) { @@ -2468,8 +2472,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, if (totalRows - 1 > scrollBody.getLastRendered()) { // fetch cache rows int firstInNewSet = scrollBody.getLastRendered() + 1; - int lastInNewSet = (int) (firstRowInViewPort + pageLength + cache_rate - * pageLength); + int lastInNewSet = (int) (firstRowInViewPort + pageLength + + cache_rate * pageLength); if (lastInNewSet > totalRows - 1) { lastInNewSet = totalRows - 1; } @@ -2483,8 +2487,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, * Ensures the column alignments are correct at initial loading.
    * (child components widths are correct) */ - WidgetUtil.runWebkitOverflowAutoFixDeferred(scrollBodyPanel - .getElement()); + WidgetUtil + .runWebkitOverflowAutoFixDeferred(scrollBodyPanel.getElement()); hadScrollBars = willHaveScrollbarz; } @@ -2492,7 +2496,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Note: this method is not part of official API although declared as * protected. Extend at your own risk. - * + * * @return true if content area will have scrollbars visible. */ protected boolean willHaveScrollbars() { @@ -2501,10 +2505,10 @@ public class VScrollTable extends FlowPanel implements HasWidgets, return true; } } else { - int fakeheight = (int) Math.round(scrollBody.getRowHeight() - * totalRows); - int availableHeight = scrollBodyPanel.getElement().getPropertyInt( - "clientHeight"); + int fakeheight = (int) Math + .round(scrollBody.getRowHeight() * totalRows); + int availableHeight = scrollBodyPanel.getElement() + .getPropertyInt("clientHeight"); if (fakeheight > availableHeight) { return true; } @@ -2515,8 +2519,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, private void announceScrollPosition() { if (scrollPositionElement == null) { scrollPositionElement = DOM.createDiv(); - scrollPositionElement.setClassName(getStylePrimaryName() - + "-scrollposition"); + scrollPositionElement + .setClassName(getStylePrimaryName() + "-scrollposition"); scrollPositionElement.getStyle().setPosition(Position.ABSOLUTE); scrollPositionElement.getStyle().setDisplay(Display.NONE); getElement().appendChild(scrollPositionElement); @@ -2545,9 +2549,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** For internal use only. May be removed or replaced in the future. */ public boolean isScrollPositionVisible() { - return scrollPositionElement != null - && !scrollPositionElement.getStyle().getDisplay() - .equals(Display.NONE.toString()); + return scrollPositionElement != null && !scrollPositionElement + .getStyle().getDisplay().equals(Display.NONE.toString()); } /** For internal use only. May be removed or replaced in the future. */ @@ -2584,9 +2587,9 @@ public class VScrollTable extends FlowPanel implements HasWidgets, // tell scroll position to user if currently "visible" rows are // not rendered - if (totalRows > pageLength - && ((firstRowInViewPort + pageLength > scrollBody - .getLastRendered()) || (firstRowInViewPort < scrollBody + if (totalRows > pageLength && ((firstRowInViewPort + + pageLength > scrollBody.getLastRendered()) + || (firstRowInViewPort < scrollBody .getFirstRendered()))) { announceScrollPosition(); } else { @@ -2633,12 +2636,13 @@ public class VScrollTable extends FlowPanel implements HasWidgets, * to Table.setCurrentPageFirstItemIndex(int) In this case, * scrolling event takes way too late, and all the rows from * previous viewport to this one were requested. - * + * * This should prevent requesting unneeded rows by updating * reqFirstRow and reqRows before needing them. See (#14135) */ - setReqFirstRow((firstRowInViewPort - (int) (pageLength * cache_rate))); + setReqFirstRow( + (firstRowInViewPort - (int) (pageLength * cache_rate))); int last = firstRowInViewPort + (int) (cache_rate * pageLength) + pageLength - 1; if (last >= totalRows) { @@ -2661,7 +2665,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, if (reqFirstRow < firstToBeRendered) { firstToBeRendered = reqFirstRow; - } else if (firstRowInViewPort - (int) (cache_rate * pageLength) > firstToBeRendered) { + } else if (firstRowInViewPort + - (int) (cache_rate * pageLength) > firstToBeRendered) { firstToBeRendered = firstRowInViewPort - (int) (cache_rate * pageLength); if (firstToBeRendered < 0) { @@ -2685,9 +2690,10 @@ public class VScrollTable extends FlowPanel implements HasWidgets, if (lastReqRow > lastToBeRendered) { lastToBeRendered = lastReqRow; - } else if (firstRowInViewPort + pageLength + pageLength - * cache_rate < lastToBeRendered) { - lastToBeRendered = (firstRowInViewPort + pageLength + (int) (pageLength * cache_rate)); + } else if (firstRowInViewPort + pageLength + + pageLength * cache_rate < lastToBeRendered) { + lastToBeRendered = (firstRowInViewPort + pageLength + + (int) (pageLength * cache_rate)); if (lastToBeRendered >= totalRows) { lastToBeRendered = totalRows - 1; } @@ -2707,7 +2713,9 @@ public class VScrollTable extends FlowPanel implements HasWidgets, lastToBeRendered = totalRows - 1; } if (reqFirstRow < firstToBeRendered - || (reqFirstRow > firstToBeRendered && (reqFirstRow < firstRendered || reqFirstRow > lastRendered + 1))) { + || (reqFirstRow > firstToBeRendered + && (reqFirstRow < firstRendered + || reqFirstRow > lastRendered + 1))) { setReqFirstRow(firstToBeRendered); } if (lastRendered < lastToBeRendered @@ -2823,8 +2831,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, * of the caption container element by the correct amount */ public void resizeCaptionContainer(int rightSpacing) { - int captionContainerWidth = width - - colResizeWidget.getOffsetWidth() - rightSpacing; + int captionContainerWidth = width - colResizeWidget.getOffsetWidth() + - rightSpacing; if (td.getClassName().contains("-asc") || td.getClassName().contains("-desc")) { @@ -2876,8 +2884,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, protected void updateStyleNames(String primaryStyleName) { colResizeWidget.setClassName(primaryStyleName + "-resizer"); sortIndicator.setClassName(primaryStyleName + "-sort-indicator"); - captionContainer.setClassName(primaryStyleName - + "-caption-container"); + captionContainer + .setClassName(primaryStyleName + "-caption-container"); if (sorted) { if (sortAscending) { setStyleName(primaryStyleName + "-header-cell-asc"); @@ -2918,7 +2926,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, * Sets width to the header cell. This width should not include any * possible indent modifications that are present in * {@link VScrollTableBody#getMaxIndent()}. - * + * * @param w * required width of the cell sans indentations * @param ensureDefinedWidth @@ -2985,7 +2993,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Detects if width is fixed by developer on server side or resized to * current width by user. - * + * * @return true if defined, false if "natural" width */ public boolean isDefinedWidth() { @@ -2994,10 +3002,10 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * This method exists for the needs of {@link VTreeTable} only. - * + * * Returns the pixels width of the header cell. This includes the * indent, if applicable. - * + * * @return The width in pixels */ protected int getWidthWithIndent() { @@ -3012,7 +3020,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Returns the pixels width of the header cell. - * + * * @return The width in pixels */ public int getWidth() { @@ -3021,7 +3029,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * This method exists for the needs of {@link VTreeTable} only. - * + * * @return true if this is hierarcyColumn's header cell, * false otherwise */ @@ -3053,9 +3061,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, if (enabled && event != null) { if (isResizing || event.getEventTarget().cast() == colResizeWidget) { - if (dragging - && (event.getTypeInt() == Event.ONMOUSEUP || event - .getTypeInt() == Event.ONTOUCHEND)) { + if (dragging && (event.getTypeInt() == Event.ONMOUSEUP + || event.getTypeInt() == Event.ONTOUCHEND)) { // Handle releasing column header on spacer #5318 handleCaptionEvent(event); } else { @@ -3092,8 +3099,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, private void createFloatingCopy() { floatingCopyOfHeaderCell = DOM.createDiv(); DOM.setInnerHTML(floatingCopyOfHeaderCell, DOM.getInnerHTML(td)); - floatingCopyOfHeaderCell = DOM - .getChild(floatingCopyOfHeaderCell, 2); + floatingCopyOfHeaderCell = DOM.getChild(floatingCopyOfHeaderCell, + 2); // #12714 the shown "ghost element" should be inside // v-overlay-container, and it should contain the same styles as the // table to enable theming (except v-table & v-widget). @@ -3135,7 +3142,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Fires a header click event after the user has clicked a column header * cell - * + * * @param event * The click event */ @@ -3207,8 +3214,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, if (!moved) { // mouse event was a click to header -> sort column - if (sortable - && WidgetUtil.isTouchEventOrLeftMouseButton(event)) { + if (sortable && WidgetUtil + .isTouchEventOrLeftMouseButton(event)) { if (sortColumn.equals(cid)) { // just toggle order client.updateVariable(paintableId, "sortascending", @@ -3222,8 +3229,9 @@ public class VScrollTable extends FlowPanel implements HasWidgets, scrollBodyPanel.setScrollPosition(0); firstvisible = 0; rowRequestHandler.setReqFirstRow(0); - rowRequestHandler.setReqRows((int) (2 * pageLength - * cache_rate + pageLength)); + rowRequestHandler + .setReqRows((int) (2 * pageLength * cache_rate + + pageLength)); rowRequestHandler.deferRowFetch(); // some validation + // defer 250ms rowRequestHandler.cancel(); // instead of waiting @@ -3250,10 +3258,10 @@ public class VScrollTable extends FlowPanel implements HasWidgets, // distance in x-axis (the same idea as in #13381) int currentX = WidgetUtil.getTouchOrMouseClientX(event); - if (currentDragX == null - || Math.abs(currentDragX - currentX) > VDragAndDropManager.MINIMUM_DISTANCE_TO_START_DRAG) { - if (dragging - && WidgetUtil.isTouchEventOrLeftMouseButton(event)) { + if (currentDragX == null || Math.abs(currentDragX + - currentX) > VDragAndDropManager.MINIMUM_DISTANCE_TO_START_DRAG) { + if (dragging && WidgetUtil + .isTouchEventOrLeftMouseButton(event)) { if (event.getTypeInt() == Event.ONTOUCHMOVE) { /* * prevent using this event in e.g. scrolling @@ -3288,7 +3296,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, + scrollBody.getCellExtraWidth(); } final int dist = Math.abs(x - slotX); - if (closestDistance == -1 || dist < closestDistance) { + if (closestDistance == -1 + || dist < closestDistance) { closestDistance = dist; closestSlot = i; } @@ -3327,8 +3336,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, // Ensure last header cell is taking into account possible // column selector - HeaderCell lastCell = tHead.getHeaderCell(tHead - .getVisibleCellCount() - 1); + HeaderCell lastCell = tHead + .getHeaderCell(tHead.getVisibleCellCount() - 1); tHead.resizeCaptionContainer(lastCell); triggerLazyColumnAdjustment(true); @@ -3364,7 +3373,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Returns the smallest possible cell width in pixels. - * + * * @param includeIndent * - width should include hierarchy column indent if * applicable (VTreeTable only) @@ -3414,7 +3423,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Saves natural column width if it hasn't been saved already. - * + * * @param columnIndex * @since 7.3.9 */ @@ -3429,7 +3438,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, } if (columnIndex < 0) { columnIndex = 0; - for (Iterator it = tHead.iterator(); it.hasNext(); columnIndex++) { + for (Iterator it = tHead.iterator(); it + .hasNext(); columnIndex++) { if (it.next() == this) { break; } @@ -3444,15 +3454,15 @@ public class VScrollTable extends FlowPanel implements HasWidgets, * Detects the natural minimum width for the column of this header cell. * If column is resized by user or the width is defined by server the * actual width is returned. Else the natural min width is returned. - * + * * @param columnIndex * column index hint, if -1 (unknown) it will be detected - * + * * @return */ public int getNaturalColumnWidth(int columnIndex) { - final int iw = columnIndex == getHierarchyColumnIndex() ? scrollBody - .getMaxIndent() : 0; + final int iw = columnIndex == getHierarchyColumnIndex() + ? scrollBody.getMaxIndent() : 0; saveNaturalColumnWidthIfNotSaved(columnIndex); if (isDefinedWidth()) { if (iw > width) { @@ -3488,7 +3498,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * HeaderCell that is header cell for row headers. - * + * * Reordering disabled and clicking on it resets sorting. */ public class RowHeadersHeaderCell extends HeaderCell { @@ -3573,7 +3583,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, for (Widget w : visibleCells) { int cellExtraWidth = w.getOffsetWidth(); if (scrollBody != null - && visibleCells.indexOf(w) == getHierarchyColumnIndex() + && visibleCells + .indexOf(w) == getHierarchyColumnIndex() && cellExtraWidth < scrollBody.getMaxIndent()) { // indent must be taken into consideration even if it // hasn't been applied yet @@ -3824,9 +3835,9 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Get's HeaderCell by it's column Key. - * + * * Note that this returns HeaderCell even if it is currently collapsed. - * + * * @param cid * Column key of accessed HeaderCell * @return HeaderCell @@ -3871,14 +3882,14 @@ public class VScrollTable extends FlowPanel implements HasWidgets, removeSlotFocus(); if (index > 0) { Element child = tr.getChild(index - 1).getFirstChild().cast(); - child.setClassName(VScrollTable.this.getStylePrimaryName() - + "-resizer"); + child.setClassName( + VScrollTable.this.getStylePrimaryName() + "-resizer"); child.addClassName(VScrollTable.this.getStylePrimaryName() + "-focus-slot-right"); } else { Element child = tr.getChild(index).getFirstChild().cast(); - child.setClassName(VScrollTable.this.getStylePrimaryName() - + "-resizer"); + child.setClassName( + VScrollTable.this.getStylePrimaryName() + "-resizer"); child.addClassName(VScrollTable.this.getStylePrimaryName() + "-focus-slot-left"); } @@ -3891,13 +3902,13 @@ public class VScrollTable extends FlowPanel implements HasWidgets, } if (focusedSlot == 0) { Element child = tr.getChild(focusedSlot).getFirstChild().cast(); - child.setClassName(VScrollTable.this.getStylePrimaryName() - + "-resizer"); + child.setClassName( + VScrollTable.this.getStylePrimaryName() + "-resizer"); } else if (focusedSlot > 0) { Element child = tr.getChild(focusedSlot - 1).getFirstChild() .cast(); - child.setClassName(VScrollTable.this.getStylePrimaryName() - + "-resizer"); + child.setClassName( + VScrollTable.this.getStylePrimaryName() + "-resizer"); } focusedSlot = -1; } @@ -3953,9 +3964,10 @@ public class VScrollTable extends FlowPanel implements HasWidgets, } // update variable to server - client.updateVariable(paintableId, "collapsedcolumns", - collapsedColumns.toArray(new String[collapsedColumns - .size()]), false); + client.updateVariable( + paintableId, "collapsedcolumns", collapsedColumns + .toArray(new String[collapsedColumns.size()]), + false); // let rowRequestHandler determine proper rows rowRequestHandler.refreshContent(); lazyRevertFocusToRow(currentlyFocusedRow); @@ -4111,8 +4123,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, DOM.appendChild(td, captionContainer); - DOM.sinkEvents(td, Event.MOUSEEVENTS | Event.ONDBLCLICK - | Event.ONCONTEXTMENU); + DOM.sinkEvents(td, + Event.MOUSEEVENTS | Event.ONDBLCLICK | Event.ONCONTEXTMENU); setElement(td); @@ -4120,13 +4132,13 @@ public class VScrollTable extends FlowPanel implements HasWidgets, } protected void updateStyleNames(String primaryStyleName) { - captionContainer.setClassName(primaryStyleName - + "-footer-container"); + captionContainer + .setClassName(primaryStyleName + "-footer-container"); } /** * Sets the text of the footer - * + * * @param footerText * The text in the footer */ @@ -4140,7 +4152,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Set alignment of the text in the cell - * + * * @param c * The alignment which can be ALIGN_CENTER, ALIGN_LEFT, * ALIGN_RIGHT @@ -4164,7 +4176,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Get the alignment of the text int the cell - * + * * @return Returns either ALIGN_CENTER, ALIGN_LEFT or ALIGN_RIGHT */ public char getAlign() { @@ -4175,7 +4187,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, * Sets the width of the cell. This width should not include any * possible indent modifications that are present in * {@link VScrollTableBody#getMaxIndent()}. - * + * * @param w * The width of the cell * @param ensureDefinedWidth @@ -4217,8 +4229,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, */ if (scrollBody != null) { int maxIndent = scrollBody.getMaxIndent(); - if (w < maxIndent - && tFoot.visibleCells.indexOf(this) == getHierarchyColumnIndex()) { + if (w < maxIndent && tFoot.visibleCells + .indexOf(this) == getHierarchyColumnIndex()) { // ensure there's room for the indent w = maxIndent; } @@ -4233,7 +4245,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, int tdWidth = width; int maxIndent = scrollBody.getMaxIndent(); if (tdWidth < maxIndent - && tFoot.visibleCells.indexOf(this) == getHierarchyColumnIndex()) { + && tFoot.visibleCells.indexOf( + this) == getHierarchyColumnIndex()) { // ensure there's room for the indent tdWidth = maxIndent; } @@ -4257,7 +4270,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Detects if width is fixed by developer on server side or resized to * current width by user. - * + * * @return true if defined, false if "natural" width */ public boolean isDefinedWidth() { @@ -4266,7 +4279,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Returns the pixels width of the footer cell. - * + * * @return The width in pixels */ public int getWidth() { @@ -4275,7 +4288,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Sets the expand ratio of the cell - * + * * @param floatAttribute * The expand ratio */ @@ -4285,7 +4298,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Returns the expand ratio of the cell - * + * * @return The expand ratio */ public float getExpandRatio() { @@ -4294,7 +4307,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Is the cell enabled? - * + * * @return True if enabled else False */ public boolean isEnabled() { @@ -4330,7 +4343,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Handles a event on the captions - * + * * @param event * The event to handle */ @@ -4344,7 +4357,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Fires a footer click event after the user has clicked a column footer * cell - * + * * @param event * The click event */ @@ -4361,7 +4374,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Returns the column key of the column - * + * * @return The column key */ public String getColKey() { @@ -4370,7 +4383,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Saves natural column width if it hasn't been saved already. - * + * * @param columnIndex * @since 7.3.9 */ @@ -4383,7 +4396,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, .getOffsetWidth() + getHeaderPadding(); if (columnIndex < 0) { columnIndex = 0; - for (Iterator it = tHead.iterator(); it.hasNext(); columnIndex++) { + for (Iterator it = tHead.iterator(); it + .hasNext(); columnIndex++) { if (it.next() == this) { break; } @@ -4398,15 +4412,15 @@ public class VScrollTable extends FlowPanel implements HasWidgets, * Detects the natural minimum width for the column of this header cell. * If column is resized by user or the width is defined by server the * actual width is returned. Else the natural min width is returned. - * + * * @param columnIndex * column index hint, if -1 (unknown) it will be detected - * + * * @return */ public int getNaturalColumnWidth(int columnIndex) { - final int iw = columnIndex == getHierarchyColumnIndex() ? scrollBody - .getMaxIndent() : 0; + final int iw = columnIndex == getHierarchyColumnIndex() + ? scrollBody.getMaxIndent() : 0; saveNaturalColumnWidthIfNotSaved(columnIndex); if (isDefinedWidth()) { if (iw > width) { @@ -4429,7 +4443,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * HeaderCell that is header cell for row headers. - * + * * Reordering disabled and clicking on it resets sorting. */ public class RowHeadersFooterCell extends FooterCell { @@ -4499,7 +4513,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /* * (non-Javadoc) - * + * * @see * com.google.gwt.user.client.ui.Panel#remove(com.google.gwt.user.client * .ui.Widget) @@ -4518,7 +4532,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /* * (non-Javadoc) - * + * * @see com.google.gwt.user.client.ui.HasWidgets#iterator() */ @@ -4529,10 +4543,10 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Gets a footer cell which represents the given columnId - * + * * @param cid * The columnId - * + * * @return The cell */ public FooterCell getFooterCell(String cid) { @@ -4541,7 +4555,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Gets a footer cell by using a column index - * + * * @param index * The index of the column * @return The Cell @@ -4556,7 +4570,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Updates the cells contents when updateUIDL request is received - * + * * @param uidl * The UIDL */ @@ -4568,8 +4582,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, final String cid = col.getStringAttribute("cid"); updated.add(cid); - String caption = col.hasAttribute("fcaption") ? col - .getStringAttribute("fcaption") : ""; + String caption = col.hasAttribute("fcaption") + ? col.getStringAttribute("fcaption") : ""; FooterCell c = getFooterCell(cid); if (c == null) { c = new FooterCell(cid, caption); @@ -4627,7 +4641,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Set a footer cell for a specified column index - * + * * @param index * The index * @param cell @@ -4658,7 +4672,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Remove a cell by using the columnId - * + * * @param colKey * The columnId to remove */ @@ -4669,7 +4683,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Enable a column (Sets the footer cell) - * + * * @param cid * The columnId * @param index @@ -4702,7 +4716,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Set the horizontal position in the cell in the footer. This is done * when a horizontal scrollbar is present. - * + * * @param scrollLeft * The value of the leftScroll */ @@ -4712,7 +4726,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Swap cells when the column are dragged - * + * * @param oldIndex * The old index of the cell * @param newIndex @@ -4734,7 +4748,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, * This Panel can only contain VScrollTableRow type of widgets. This * "simulates" very large table, keeping spacers which take room of * unrendered rows. - * + * */ public class VScrollTableBody extends Panel { @@ -4927,10 +4941,10 @@ public class VScrollTable extends FlowPanel implements HasWidgets, return; } - int reactFirstRow = (int) (firstRowInViewPort - pageLength - * cache_react_rate); - int reactLastRow = (int) (firstRowInViewPort + pageLength + pageLength - * cache_react_rate); + int reactFirstRow = (int) (firstRowInViewPort + - pageLength * cache_react_rate); + int reactLastRow = (int) (firstRowInViewPort + pageLength + + pageLength * cache_react_rate); if (reactFirstRow < 0) { reactFirstRow = 0; } @@ -4941,14 +4955,14 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /* * #8040 - scroll position is completely changed since the * latest request, so request a new set of rows. - * + * * TODO: We should probably check whether the fetched rows match * the current scroll position right when they arrive, so as to * not waste time rendering a set of rows that will never be * visible... */ - rowRequestHandler.triggerRowFetch(reactFirstRow, reactLastRow - - reactFirstRow + 1, 1); + rowRequestHandler.triggerRowFetch(reactFirstRow, + reactLastRow - reactFirstRow + 1, 1); } else if (lastRendered < reactLastRow) { // get some cache rows below visible area rowRequestHandler.triggerRowFetch(lastRendered + 1, @@ -4956,28 +4970,28 @@ public class VScrollTable extends FlowPanel implements HasWidgets, } else if (firstRendered > reactFirstRow) { /* * Branch for fetching cache above visible area. - * + * * If cache needed for both before and after visible area, this * will be rendered after-cache is received and rendered. So in * some rare situations the table may make two cache visits to * server. */ - rowRequestHandler.triggerRowFetch(reactFirstRow, firstRendered - - reactFirstRow, 1); + rowRequestHandler.triggerRowFetch(reactFirstRow, + firstRendered - reactFirstRow, 1); } } /** * Inserts rows as provided in the rowData starting at firstIndex. - * + * * @param rowData * @param firstIndex * @param rows * the number of rows * @return a list of the rows added. */ - protected List insertRows(UIDL rowData, - int firstIndex, int rows) { + protected List insertRows(UIDL rowData, int firstIndex, + int rows) { aligns = tHead.getColumnAlignments(); final Iterator it = rowData.getChildIterator(); List insertedRows = new ArrayList(); @@ -5051,9 +5065,9 @@ public class VScrollTable extends FlowPanel implements HasWidgets, * This method is used to instantiate new rows for this table. It * automatically sets correct widths to rows cells and assigns correct * client reference for child widgets. - * + * * This method can be called only after table has been initialized - * + * * @param uidl */ private VScrollTableRow prepareRow(UIDL uidl) { @@ -5100,8 +5114,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, } if (index > 0) { VScrollTableRow sibling = getRowByRowIndex(index - 1); - tBodyElement - .insertAfter(row.getElement(), sibling.getElement()); + tBodyElement.insertAfter(row.getElement(), + sibling.getElement()); } else { VScrollTableRow sibling = getRowByRowIndex(index); tBodyElement.insertBefore(row.getElement(), @@ -5294,7 +5308,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Returns the width available for column content. - * + * * @param columnIndex * @return */ @@ -5310,8 +5324,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, // Spanned rows might cause an NPE. if (columnIndex < tr.getChildCount()) { Element wrapperdiv = tr.getCells() - .getItem(columnIndex) - .getFirstChildElement().cast(); + .getItem(columnIndex).getFirstChildElement() + .cast(); return wrapperdiv.getOffsetWidth(); } } @@ -5324,14 +5338,14 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Sets the content width of a column. - * + * * Due IE limitation, we must set the width to a wrapper elements inside * table cells (with overflow hidden, which does not work on td * elements). - * + * * To get this work properly crossplatform, we will also set the width * of td. - * + * * @param colIndex * @param w */ @@ -5355,11 +5369,12 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * This method exists for the needs of {@link VTreeTable} only. May be - * removed or replaced in the future.

    Returns the maximum - * indent of the hierarcyColumn, if applicable. - * + * removed or replaced in the future.
    + *
    + * Returns the maximum indent of the hierarcyColumn, if applicable. + * * @see {@link VScrollTable#getHierarchyColumnIndex()} - * + * * @return maximum indent in pixels */ protected int getMaxIndent() { @@ -5368,8 +5383,9 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * This method exists for the needs of {@link VTreeTable} only. May be - * removed or replaced in the future.

    Calculates the maximum - * indent of the hierarcyColumn, if applicable. + * removed or replaced in the future.
    + *
    + * Calculates the maximum indent of the hierarcyColumn, if applicable. */ protected void calculateMaxIndent() { // NOP @@ -5380,8 +5396,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, if (rows.getLength() == 0) { /* need to temporary add empty row and detect */ VScrollTableRow scrollTableRow = new VScrollTableRow(); - scrollTableRow.updateStyleNames(VScrollTable.this - .getStylePrimaryName()); + scrollTableRow.updateStyleNames( + VScrollTable.this.getStylePrimaryName()); tBodyElement.appendChild(scrollTableRow.getElement()); detectExtrawidth(); tBodyElement.removeChild(scrollTableRow.getElement()); @@ -5394,8 +5410,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, // for measuring noCells = true; VScrollTableRow next = (VScrollTableRow) iterator().next(); - boolean sorted = tHead.getHeaderCell(0) != null ? tHead - .getHeaderCell(0).isSorted() : false; + boolean sorted = tHead.getHeaderCell(0) != null + ? tHead.getHeaderCell(0).isSorted() : false; next.addCell(null, "", ALIGN_LEFT, "", true, sorted); firstTD = item.getCells().getItem(0); } @@ -5450,8 +5466,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, return -1; } - public class VScrollTableRow extends Panel implements ActionOwner, - ContextMenuOwner { + public class VScrollTableRow extends Panel + implements ActionOwner, ContextMenuOwner { private static final int TOUCHSCROLL_TIMEOUT = 100; private static final int DRAGMODE_MULTIROW = 2; @@ -5483,9 +5499,10 @@ public class VScrollTable extends FlowPanel implements HasWidgets, this.rowKey = rowKey; rowElement = Document.get().createTRElement(); setElement(rowElement); - DOM.sinkEvents(getElement(), Event.MOUSEEVENTS - | Event.TOUCHEVENTS | Event.ONDBLCLICK - | Event.ONCONTEXTMENU | VTooltip.TOOLTIP_EVENTS); + DOM.sinkEvents(getElement(), + Event.MOUSEEVENTS | Event.TOUCHEVENTS | Event.ONDBLCLICK + | Event.ONCONTEXTMENU + | VTooltip.TOOLTIP_EVENTS); } public VScrollTableRow(UIDL uidl, char[] aligns) { @@ -5610,8 +5627,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, String description = null; if (uidl.hasAttribute("descr-" + columnId)) { - description = uidl.getStringAttribute("descr-" - + columnId); + description = uidl + .getStringAttribute("descr-" + columnId); } boolean sorted = tHead.getHeaderCell(col).isSorted(); @@ -5631,7 +5648,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Overriding this and returning true causes all text cells to be * rendered as HTML. - * + * * @return always returns false in the default implementation */ protected boolean isRenderHtmlInCells() { @@ -5640,7 +5657,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Detects whether row is visible in tables viewport. - * + * * @return */ public boolean isInViewPort() { @@ -5656,7 +5673,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Makes a check based on indexes whether the row is before the * compared row. - * + * * @param row1 * @return true if this rows index is smaller than in the row1 */ @@ -5667,7 +5684,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Sets the index of the row in the whole table. Currently used just * to set even/odd classname - * + * * @param indexInWholeTable */ private void setIndex(int indexInWholeTable) { @@ -5687,8 +5704,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, addStyleName(VScrollTable.this.getStylePrimaryName() + "-row-odd"); } else { - addStyleName(VScrollTable.this.getStylePrimaryName() - + "-row"); + addStyleName( + VScrollTable.this.getStylePrimaryName() + "-row"); } } @@ -5762,8 +5779,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, */ String className = td.getClassName(); String oldPrimaryName = className.split("-cell-content")[0]; - td.setClassName(className.replaceAll(oldPrimaryName, - primaryStyleName)); + td.setClassName( + className.replaceAll(oldPrimaryName, primaryStyleName)); } public void addCell(UIDL rowUidl, Widget w, char align, @@ -5846,7 +5863,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * If there are registered click listeners, sends a click event and * returns true. Otherwise, does nothing and returns false. - * + * * @param event * @param targetTdOrTr * @param immediate @@ -5889,8 +5906,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, TooltipInfo info = null; final Element targetTdOrTr = getTdOrTr(target); - if (targetTdOrTr != null - && "td".equals(targetTdOrTr.getTagName().toLowerCase())) { + if (targetTdOrTr != null && "td" + .equals(targetTdOrTr.getTagName().toLowerCase())) { TableCellElement td = (TableCellElement) targetTdOrTr .cast(); info = cellToolTips.get(td); @@ -5921,7 +5938,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Special handler for touch devices that support native scrolling - * + * * @return Whether the event was handled by this method. */ private boolean handleTouchEvent(final Event event) { @@ -6048,11 +6065,9 @@ public class VScrollTable extends FlowPanel implements HasWidgets, final Element targetTdOrTr = getEventTargetTdOrTr(event); if (type == Event.ONCONTEXTMENU) { showContextMenu(event); - if (enabled - && (actionKeys != null || client - .hasEventListeners( - VScrollTable.this, - TableConstants.ITEM_CLICK_EVENT_ID))) { + if (enabled && (actionKeys != null + || client.hasEventListeners(VScrollTable.this, + TableConstants.ITEM_CLICK_EVENT_ID))) { /* * Prevent browser context menu only if there are * action handlers or item click listeners @@ -6080,10 +6095,10 @@ public class VScrollTable extends FlowPanel implements HasWidgets, * event there as the event might get canceled before it * gets here. */ - if (mouseUpPreviewMatched - && lastMouseDownTarget != null - && lastMouseDownTarget == getElementTdOrTr(WidgetUtil - .getElementUnderMouse(event))) { + if (mouseUpPreviewMatched && lastMouseDownTarget != null + && lastMouseDownTarget == getElementTdOrTr( + WidgetUtil + .getElementUnderMouse(event))) { // "Click" with left, right or middle button if (targetCellOrRowFound) { @@ -6091,23 +6106,23 @@ public class VScrollTable extends FlowPanel implements HasWidgets, * Queue here, send at the same time as the * corresponding value change event - see #7127 */ - boolean clickEventSent = handleClickEvent( - event, targetTdOrTr, false); + boolean clickEventSent = handleClickEvent(event, + targetTdOrTr, false); if (event.getButton() == Event.BUTTON_LEFT && isSelectable()) { // Ctrl+Shift click - if ((event.getCtrlKey() || event - .getMetaKey()) + if ((event.getCtrlKey() + || event.getMetaKey()) && event.getShiftKey() && isMultiSelectModeDefault()) { toggleShiftSelection(false); setRowFocus(this); // Ctrl click - } else if ((event.getCtrlKey() || event - .getMetaKey()) + } else if ((event.getCtrlKey() + || event.getMetaKey()) && isMultiSelectModeDefault()) { boolean wasSelected = isSelected(); toggleSelection(); @@ -6118,16 +6133,17 @@ public class VScrollTable extends FlowPanel implements HasWidgets, */ selectionRangeStart = this; if (wasSelected) { - removeRowFromUnsentSelectionRanges(this); + removeRowFromUnsentSelectionRanges( + this); } - } else if ((event.getCtrlKey() || event - .getMetaKey()) + } else if ((event.getCtrlKey() + || event.getMetaKey()) && isSingleSelectMode()) { // Ctrl (or meta) click (Single // selection) - if (!isSelected() - || (isSelected() && nullSelectionAllowed)) { + if (!isSelected() || (isSelected() + && nullSelectionAllowed)) { if (!isSelected()) { deselectAll(); @@ -6166,14 +6182,15 @@ public class VScrollTable extends FlowPanel implements HasWidgets, deselectAll(); } toggleSelection(); - } else if ((isSingleSelectMode() || isMultiSelectModeSimple()) + } else if ((isSingleSelectMode() + || isMultiSelectModeSimple()) && nullSelectionAllowed) { toggleSelection(); - }/* - * else NOP to avoid excessive server - * visits (selection is removed with - * CTRL/META click) - */ + } /* + * else NOP to avoid excessive server + * visits (selection is removed with + * CTRL/META click) + */ selectionRangeStart = this; setRowFocus(this); @@ -6183,7 +6200,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, if (BrowserInfo.get().isIE()) { ((Element) event.getEventTarget() .cast()).setPropertyJSO( - "onselectstart", null); + "onselectstart", null); } // Queue value change sendSelectedRows(false); @@ -6222,8 +6239,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, * if row is selected. Null check for active * delegate is as a workaround. */ - if (dragmode != 0 - && touchStart != null + if (dragmode != 0 && touchStart != null && (TouchScrollDelegate .getActiveScrollDelegate() == null)) { startRowDrag(touchStart, type, targetTdOrTr); @@ -6312,8 +6328,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, * the corresponding mouseup event if it's on a * different part of the page. */ - lastMouseDownTarget = getElementTdOrTr(WidgetUtil - .getElementUnderMouse(event)); + lastMouseDownTarget = getElementTdOrTr( + WidgetUtil.getElementUnderMouse(event)); mouseUpPreviewMatched = false; mouseUpEventPreviewRegistration = Event .addNativePreviewHandler(mouseUpPreviewHandler); @@ -6321,14 +6337,13 @@ public class VScrollTable extends FlowPanel implements HasWidgets, if (targetCellOrRowFound) { setRowFocus(this); ensureFocus(); - if (dragmode != 0 - && (event.getButton() == NativeEvent.BUTTON_LEFT)) { + if (dragmode != 0 && (event + .getButton() == NativeEvent.BUTTON_LEFT)) { startRowDrag(event, type, targetTdOrTr); - } else if (event.getCtrlKey() - || event.getShiftKey() + } else if (event.getCtrlKey() || event.getShiftKey() || event.getMetaKey() - && isMultiSelectModeDefault()) { + && isMultiSelectModeDefault()) { // Prevent default text selection in Firefox event.preventDefault(); @@ -6336,8 +6351,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, // Prevent default text selection in IE if (BrowserInfo.get().isIE()) { ((Element) event.getEventTarget().cast()) - .setPropertyJSO( - "onselectstart", + .setPropertyJSO("onselectstart", getPreventTextSelectionIEHack()); } @@ -6364,10 +6378,12 @@ public class VScrollTable extends FlowPanel implements HasWidgets, * axis checks */ Touch touch = event.getChangedTouches().get(0); - if (Math.abs(touch.getClientX() - touchStartX) > TouchScrollDelegate.SIGNIFICANT_MOVE_THRESHOLD) { + if (Math.abs(touch.getClientX() + - touchStartX) > TouchScrollDelegate.SIGNIFICANT_MOVE_THRESHOLD) { return true; } - if (Math.abs(touch.getClientY() - touchStartY) > TouchScrollDelegate.SIGNIFICANT_MOVE_THRESHOLD) { + if (Math.abs(touch.getClientY() + - touchStartY) > TouchScrollDelegate.SIGNIFICANT_MOVE_THRESHOLD) { return true; } return false; @@ -6375,7 +6391,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Checks if the row represented by the row key has been selected - * + * * @param key * The generated row key */ @@ -6409,8 +6425,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, } } - VDragEvent ev = VDragAndDropManager.get().startDrag( - transferable, event, true); + VDragEvent ev = VDragAndDropManager.get() + .startDrag(transferable, event, true); if (dragmode == DRAGMODE_MULTIROW && isMultiSelectModeAny() && rowKeyIsSelected(rowKey)) { @@ -6420,8 +6436,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, // Hide rows which are not selected Element dragImage = ev.getDragImage(); int i = 0; - for (Iterator iterator = scrollBody.iterator(); iterator - .hasNext();) { + for (Iterator iterator = scrollBody + .iterator(); iterator.hasNext();) { VScrollTableRow next = (VScrollTableRow) iterator .next(); @@ -6445,7 +6461,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, * target of the event should not be handled. If the event target is * the row directly this method returns the TR element instead of * the TD. - * + * * @param event * @return TD or TR element that the event targets (the actual event * target is this element or a child of it) @@ -6472,8 +6488,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, if (!(widget instanceof VLabel) && !(widget instanceof VEmbedded) - && !(widget instanceof VTextField && ((VTextField) widget) - .isReadOnly())) { + && !(widget instanceof VTextField + && ((VTextField) widget).isReadOnly())) { return null; } } @@ -6500,7 +6516,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Has the row been selected? - * + * * @return Returns true if selected, else false */ public boolean isSelected() { @@ -6525,7 +6541,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Is called when a user clicks an item when holding SHIFT key down. * This will select a new range from the last focused row - * + * * @param deselectPrevious * Should the previous selected range be deselected */ @@ -6594,7 +6610,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /* * (non-Javadoc) - * + * * @see com.vaadin.client.ui.IActionOwner#getActions () */ @@ -6708,9 +6724,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, if (cells.hasNext()) { final Object cell = cells.next(); if (cell instanceof String) { - addSpannedCell(uidl, cell.toString(), aligns[0], - "", htmlContentAllowed, false, null, - colCount); + addSpannedCell(uidl, cell.toString(), aligns[0], "", + htmlContentAllowed, false, null, colCount); } else { addSpannedCell(uidl, (Widget) cell, aligns[0], "", false, colCount); @@ -6773,7 +6788,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Ensure the component has a focus. - * + * * TODO the current implementation simply always calls focus for the * component. In case the Table at some point implements focus/blur * listeners, this method needs to be evolved to conditionally call @@ -6984,7 +6999,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, if (getTotalRows() == 0) { /* * Too wide header combined with no rows in the table. - * + * * No horizontal scrollbars would be displayed because * there's no rows that grows too wide causing the * scrollBody container div to overflow. Must explicitely @@ -7017,7 +7032,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, - totalExplicitColumnsWidths; if (hierarchyHeaderInNeedOfFurtherHandling != null - && !hierarchyHeaderInNeedOfFurtherHandling.isDefinedWidth()) { + && !hierarchyHeaderInNeedOfFurtherHandling + .isDefinedWidth()) { // ensure the cell gets enough space for the indent int w = hierarchyHeaderInNeedOfFurtherHandling .getNaturalColumnWidth(hierarchyColumnIndex); @@ -7102,8 +7118,9 @@ public class VScrollTable extends FlowPanel implements HasWidgets, while (headCells.hasNext()) { HeaderCell hc = (HeaderCell) headCells.next(); if (!hc.isResizing && !hc.isDefinedWidth()) { - setColWidth(colIndex, hc.getWidthWithIndent() + availW - - checksum, false); + setColWidth(colIndex, + hc.getWidthWithIndent() + availW - checksum, + false); break; } colIndex++; @@ -7145,7 +7162,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * helper to set pixel size of head and body part - * + * * @param pixels */ private void setContentWidth(int pixels) { @@ -7284,8 +7301,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, @Override public void execute() { - scrollBodyPanel - .setScrollPosition(measureRowHeightOffset(firstRowInViewPort)); + scrollBodyPanel.setScrollPosition( + measureRowHeightOffset(firstRowInViewPort)); } }); } @@ -7295,14 +7312,14 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Helper function to build html snippet for column or row headers - * + * * @param uidl * possibly with values caption and icon * @return html snippet containing possibly an icon + caption text */ protected String buildCaptionHtmlSnippet(UIDL uidl) { - String s = uidl.hasAttribute("caption") ? uidl - .getStringAttribute("caption") : ""; + String s = uidl.hasAttribute("caption") + ? uidl.getStringAttribute("caption") : ""; if (uidl.hasAttribute("icon")) { Icon icon = client.getIcon(uidl.getStringAttribute("icon")); icon.setAlternateText("icon"); @@ -7342,7 +7359,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, scrollTop = scrollBodyPanel.getScrollPosition(); /* * #6970 - IE sometimes fires scroll events for a detached table. - * + * * FIXME initializedAndAttached should probably be renamed - its name * doesn't seem to reflect its semantics. onDetach() doesn't set it to * false, and changing that might break something else, so we need to @@ -7352,8 +7369,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, return; } if (!enabled) { - scrollBodyPanel - .setScrollPosition(measureRowHeightOffset(firstRowInViewPort)); + scrollBodyPanel.setScrollPosition( + measureRowHeightOffset(firstRowInViewPort)); return; } @@ -7391,13 +7408,13 @@ public class VScrollTable extends FlowPanel implements HasWidgets, firstRowInViewPort = maxFirstRow; } - int postLimit = (int) (firstRowInViewPort + (pageLength - 1) + pageLength - * cache_react_rate); + int postLimit = (int) (firstRowInViewPort + (pageLength - 1) + + pageLength * cache_react_rate); if (postLimit > totalRows - 1) { postLimit = totalRows - 1; } - int preLimit = (int) (firstRowInViewPort - pageLength - * cache_react_rate); + int preLimit = (int) (firstRowInViewPort + - pageLength * cache_react_rate); if (preLimit < 0) { preLimit = 0; } @@ -7416,15 +7433,15 @@ public class VScrollTable extends FlowPanel implements HasWidgets, if (allRenderedRowsAreNew()) { // need a totally new set of rows - rowRequestHandler - .setReqFirstRow((firstRowInViewPort - (int) (pageLength * cache_rate))); + rowRequestHandler.setReqFirstRow( + (firstRowInViewPort - (int) (pageLength * cache_rate))); int last = firstRowInViewPort + (int) (cache_rate * pageLength) + pageLength - 1; if (last >= totalRows) { last = totalRows - 1; } - rowRequestHandler.setReqRows(last - - rowRequestHandler.getReqFirstRow() + 1); + rowRequestHandler + .setReqRows(last - rowRequestHandler.getReqFirstRow() + 1); updatedReqRows = false; rowRequestHandler.deferRowFetch(); return; @@ -7432,19 +7449,18 @@ public class VScrollTable extends FlowPanel implements HasWidgets, if (preLimit < firstRendered) { // need some rows to the beginning of the rendered area - rowRequestHandler - .setReqFirstRow((int) (firstRowInViewPort - pageLength - * cache_rate)); - rowRequestHandler.setReqRows(firstRendered - - rowRequestHandler.getReqFirstRow()); + rowRequestHandler.setReqFirstRow( + (int) (firstRowInViewPort - pageLength * cache_rate)); + rowRequestHandler.setReqRows( + firstRendered - rowRequestHandler.getReqFirstRow()); rowRequestHandler.deferRowFetch(); return; } if (postLimit > lastRendered) { // need some rows to the end of the rendered area - int reqRows = (int) ((firstRowInViewPort + pageLength + pageLength - * cache_rate) - lastRendered); + int reqRows = (int) ((firstRowInViewPort + pageLength + + pageLength * cache_rate) - lastRendered); rowRequestHandler.triggerRowFetch(lastRendered + 1, reqRows); } } @@ -7453,8 +7469,9 @@ public class VScrollTable extends FlowPanel implements HasWidgets, int firstRowInViewPort = calcFirstRowInViewPort(); int firstRendered = scrollBody.getFirstRendered(); int lastRendered = scrollBody.getLastRendered(); - return (firstRowInViewPort - pageLength * cache_rate > lastRendered || firstRowInViewPort - + pageLength + pageLength * cache_rate < firstRendered); + return (firstRowInViewPort - pageLength * cache_rate > lastRendered + || firstRowInViewPort + pageLength + + pageLength * cache_rate < firstRendered); } protected int calcFirstRowInViewPort() { @@ -7477,7 +7494,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, TableDDDetails other = (TableDDDetails) obj; return dropLocation == other.dropLocation && overkey == other.overkey - && ((colkey != null && colkey.equals(other.colkey)) || (colkey == null && other.colkey == null)); + && ((colkey != null && colkey.equals(other.colkey)) + || (colkey == null && other.colkey == null)); } return false; } @@ -7524,10 +7542,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, } drag.getDropDetails().put("itemIdOver", dropDetails.overkey + ""); - drag.getDropDetails().put( - "detail", - dropDetails.dropLocation != null ? dropDetails.dropLocation - .toString() : null); + drag.getDropDetails().put("detail", dropDetails.dropLocation != null + ? dropDetails.dropLocation.toString() : null); } @@ -7578,8 +7594,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, } private void deEmphasis() { - UIObject.setStyleName(getElement(), - getStylePrimaryName() + "-drag", false); + UIObject.setStyleName(getElement(), getStylePrimaryName() + "-drag", + false); if (lastEmphasized == null) { return; } @@ -7604,8 +7620,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, */ private void emphasis(TableDDDetails details) { deEmphasis(); - UIObject.setStyleName(getElement(), - getStylePrimaryName() + "-drag", true); + UIObject.setStyleName(getElement(), getStylePrimaryName() + "-drag", + true); // iterate old and new emphasized row for (Widget w : scrollBody.renderedRows) { VScrollTableRow row = (VScrollTableRow) w; @@ -7643,7 +7659,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Moves the selection head to a specific row - * + * * @param row * The row to where the selection head should move * @return Returns true if focus was moved successfully, else false @@ -7685,7 +7701,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Ensures that the row is visible - * + * * @param row * The row to ensure is visible */ @@ -7704,12 +7720,13 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Handles the keyboard events handled by the table - * + * * @param event * The keyboard event received * @return true iff the navigation event was handled */ - protected boolean handleNavigation(int keycode, boolean ctrl, boolean shift) { + protected boolean handleNavigation(int keycode, boolean ctrl, + boolean shift) { if (keycode == KeyCodes.KEY_TAB || keycode == KeyCodes.KEY_SHIFT) { // Do not handle tab key return false; @@ -7717,8 +7734,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, // Down navigation if (!isSelectable() && keycode == getNavigationDownKey()) { - scrollBodyPanel.setScrollPosition(scrollBodyPanel - .getScrollPosition() + scrollingVelocity); + scrollBodyPanel.setScrollPosition( + scrollBodyPanel.getScrollPosition() + scrollingVelocity); return true; } else if (keycode == getNavigationDownKey()) { if (isMultiSelectModeAny() && moveFocusDown()) { @@ -7732,8 +7749,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, // Up navigation if (!isSelectable() && keycode == getNavigationUpKey()) { - scrollBodyPanel.setScrollPosition(scrollBodyPanel - .getScrollPosition() - scrollingVelocity); + scrollBodyPanel.setScrollPosition( + scrollBodyPanel.getScrollPosition() - scrollingVelocity); return true; } else if (keycode == getNavigationUpKey()) { if (isMultiSelectModeAny() && moveFocusUp()) { @@ -7746,14 +7763,16 @@ public class VScrollTable extends FlowPanel implements HasWidgets, if (keycode == getNavigationLeftKey()) { // Left navigation - scrollBodyPanel.setHorizontalScrollPosition(scrollBodyPanel - .getHorizontalScrollPosition() - scrollingVelocity); + scrollBodyPanel.setHorizontalScrollPosition( + scrollBodyPanel.getHorizontalScrollPosition() + - scrollingVelocity); return true; } else if (keycode == getNavigationRightKey()) { // Right navigation - scrollBodyPanel.setHorizontalScrollPosition(scrollBodyPanel - .getHorizontalScrollPosition() + scrollingVelocity); + scrollBodyPanel.setHorizontalScrollPosition( + scrollBodyPanel.getHorizontalScrollPosition() + + scrollingVelocity); return true; } @@ -7945,8 +7964,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, } private int getFullyVisibleRowCount() { - return (int) (scrollBodyPanel.getOffsetHeight() / scrollBody - .getRowHeight()); + return (int) (scrollBodyPanel.getOffsetHeight() + / scrollBody.getRowHeight()); } private void scrollByPagelength(int i) { @@ -7961,7 +7980,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.FocusHandler#onFocus(com.google.gwt.event * .dom.client.FocusEvent) @@ -7983,7 +8002,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.BlurHandler#onBlur(com.google.gwt.event * .dom.client.BlurEvent) @@ -8009,7 +8028,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, && focusedElement != scrollBodyPanel.getFocusElement() && Util.getConnectorForElement(client, getParent(), focusedElement) == ConnectorMap.get(client) - .getConnector(this)) { + .getConnector(this)) { /* * Steal focus back to the focus handler if it was moved to some * other part of the table. Avoid stealing focus in other cases. @@ -8027,14 +8046,14 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Removes a key from a range if the key is found in a selected range - * + * * @param key * The key to remove */ private void removeRowFromUnsentSelectionRanges(VScrollTableRow row) { Collection newRanges = null; - for (Iterator iterator = selectedRowRanges.iterator(); iterator - .hasNext();) { + for (Iterator iterator = selectedRowRanges + .iterator(); iterator.hasNext();) { SelectionRange range = iterator.next(); if (range.inRange(row)) { // Split the range if given row is in range @@ -8053,12 +8072,13 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Can the Table be focused? - * + * * @return True if the table can be focused, else false */ public boolean isFocusable() { if (scrollBody != null && enabled) { - return !(!hasHorizontalScrollbar() && !hasVerticalScrollbar() && !isSelectable()); + return !(!hasHorizontalScrollbar() && !hasVerticalScrollbar() + && !isSelectable()); } return false; } @@ -8073,7 +8093,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /* * (non-Javadoc) - * + * * @see com.vaadin.client.Focusable#focus() */ @@ -8142,7 +8162,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, } /** - * + * * @param keyCode * @return true if the given keyCode is used by the table for navigation */ @@ -8157,7 +8177,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, || keyCode == getNavigationStartKey(); } - public void lazyRevertFocusToRow(final VScrollTableRow currentlyFocusedRow) { + public void lazyRevertFocusToRow( + final VScrollTableRow currentlyFocusedRow) { Scheduler.get().scheduleFinally(new ScheduledCommand() { @Override public void execute() { @@ -8202,7 +8223,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, * Add this to the element mouse down event by using element.setPropertyJSO * ("onselectstart",applyDisableTextSelectionIEHack()); Remove it then again * when the mouse is depressed in the mouse up event. - * + * * @return Returns the JSO preventing text selection */ private static native JavaScriptObject getPreventTextSelectionIEHack() @@ -8220,14 +8241,14 @@ public class VScrollTable extends FlowPanel implements HasWidgets, } private boolean isDynamicWidth() { - ComponentConnector paintable = ConnectorMap.get(client).getConnector( - this); + ComponentConnector paintable = ConnectorMap.get(client) + .getConnector(this); return paintable.isUndefinedWidth(); } private boolean isDynamicHeight() { - ComponentConnector paintable = ConnectorMap.get(client).getConnector( - this); + ComponentConnector paintable = ConnectorMap.get(client) + .getConnector(this); if (paintable == null) { // This should be refactored. As isDynamicHeight can be called from // a timer it is possible that the connector has been unregistered @@ -8264,15 +8285,17 @@ public class VScrollTable extends FlowPanel implements HasWidgets, private static final RegExp SUBPART_FOOTER_REGEXP = RegExp .compile(SUBPART_FOOTER + "\\[(\\d+)\\]"); /** Matches row[ix] - used for extracting the index of the targeted row */ - private static final RegExp SUBPART_ROW_REGEXP = RegExp.compile(SUBPART_ROW - + "\\[(\\d+)]"); - /** Matches col[ix] - used for extracting the index of the targeted column */ - private static final RegExp SUBPART_ROW_COL_REGEXP = RegExp - .compile(SUBPART_ROW + "\\[(\\d+)\\]/" + SUBPART_COL - + "\\[(\\d+)\\]"); + private static final RegExp SUBPART_ROW_REGEXP = RegExp + .compile(SUBPART_ROW + "\\[(\\d+)]"); + /** + * Matches col[ix] - used for extracting the index of the targeted column + */ + private static final RegExp SUBPART_ROW_COL_REGEXP = RegExp.compile( + SUBPART_ROW + "\\[(\\d+)\\]/" + SUBPART_COL + "\\[(\\d+)\\]"); @Override - public com.google.gwt.user.client.Element getSubPartElement(String subPart) { + public com.google.gwt.user.client.Element getSubPartElement( + String subPart) { if (SUBPART_ROW_COL_REGEXP.test(subPart)) { MatchResult result = SUBPART_ROW_COL_REGEXP.exec(subPart); int rowIx = Integer.valueOf(result.getGroup(1)); @@ -8314,7 +8337,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, } @Override - public String getSubPartName(com.google.gwt.user.client.Element subElement) { + public String getSubPartName( + com.google.gwt.user.client.Element subElement) { Widget widget = WidgetUtil.findWidget(subElement, null); if (widget instanceof HeaderCell) { return SUBPART_HEADER + "[" + tHead.visibleCells.indexOf(widget) @@ -8329,7 +8353,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, if (rowIx >= 0) { int colIx = -1; for (int ix = 0; ix < row.getElement().getChildCount(); ix++) { - if (row.getElement().getChild(ix).isOrHasChild(subElement)) { + if (row.getElement().getChild(ix) + .isOrHasChild(subElement)) { colIx = ix; break; } diff --git a/client/src/main/java/com/vaadin/client/ui/VSlider.java b/client/src/main/java/com/vaadin/client/ui/VSlider.java index 952c387539..cc36d8b8d9 100644 --- a/client/src/main/java/com/vaadin/client/ui/VSlider.java +++ b/client/src/main/java/com/vaadin/client/ui/VSlider.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -37,8 +37,8 @@ import com.vaadin.client.BrowserInfo; import com.vaadin.client.WidgetUtil; import com.vaadin.shared.ui.slider.SliderOrientation; -public class VSlider extends SimpleFocusablePanel implements Field, - HasValue, SubPartAware { +public class VSlider extends SimpleFocusablePanel + implements Field, HasValue, SubPartAware { public static final String CLASSNAME = "v-slider"; @@ -137,7 +137,8 @@ public class VSlider extends SimpleFocusablePanel implements Field, updateStyleNames(style, true); } - protected void updateStyleNames(String styleName, boolean isPrimaryStyleName) { + protected void updateStyleNames(String styleName, + boolean isPrimaryStyleName) { feedbackPopup.removeStyleName(getStylePrimaryName() + "-feedback"); removeStyleName(getStylePrimaryName() + "-vertical"); @@ -282,8 +283,10 @@ public class VSlider extends SimpleFocusablePanel implements Field, increaseValue(true); } else if (DOM.eventGetType(event) == Event.MOUSEEVENTS) { processBaseEvent(event); - } else if ((BrowserInfo.get().isGecko() && DOM.eventGetType(event) == Event.ONKEYPRESS) - || (!BrowserInfo.get().isGecko() && DOM.eventGetType(event) == Event.ONKEYDOWN)) { + } else if ((BrowserInfo.get().isGecko() + && DOM.eventGetType(event) == Event.ONKEYPRESS) + || (!BrowserInfo.get().isGecko() + && DOM.eventGetType(event) == Event.ONKEYDOWN)) { if (handleNavigation(event.getKeyCode(), event.getCtrlKey(), event.getShiftKey())) { @@ -403,8 +406,8 @@ public class VSlider extends SimpleFocusablePanel implements Field, } if (isVertical()) { - v = ((baseSize - (coord - baseOffset)) / (double) (baseSize - handleSize)) - * (max - min) + min; + v = ((baseSize - (coord - baseOffset)) + / (double) (baseSize - handleSize)) * (max - min) + min; } else { v = ((coord - baseOffset) / (double) (baseSize - handleSize)) * (max - min) + min; @@ -422,7 +425,7 @@ public class VSlider extends SimpleFocusablePanel implements Field, /** * TODO consider extracting touches support to an impl class specific for * webkit (only browser that really supports touches). - * + * * @param event * @return */ @@ -460,7 +463,7 @@ public class VSlider extends SimpleFocusablePanel implements Field, /** * Handles the keyboard events handled by the Slider - * + * * @param event * The keyboard event received * @return true iff the navigation event was handled @@ -503,7 +506,7 @@ public class VSlider extends SimpleFocusablePanel implements Field, * Get the key that increases the vertical slider. By default it is the up * arrow key but by overriding this you can change the key to whatever you * want. - * + * * @return The keycode of the key */ protected int getNavigationUpKey() { @@ -514,7 +517,7 @@ public class VSlider extends SimpleFocusablePanel implements Field, * Get the key that decreases the vertical slider. By default it is the down * arrow key but by overriding this you can change the key to whatever you * want. - * + * * @return The keycode of the key */ protected int getNavigationDownKey() { @@ -525,7 +528,7 @@ public class VSlider extends SimpleFocusablePanel implements Field, * Get the key that decreases the horizontal slider. By default it is the * left arrow key but by overriding this you can change the key to whatever * you want. - * + * * @return The keycode of the key */ protected int getNavigationLeftKey() { @@ -536,7 +539,7 @@ public class VSlider extends SimpleFocusablePanel implements Field, * Get the key that increases the horizontal slider. By default it is the * right arrow key but by overriding this you can change the key to whatever * you want. - * + * * @return The keycode of the key */ protected int getNavigationRightKey() { @@ -657,7 +660,8 @@ public class VSlider extends SimpleFocusablePanel implements Field, } @Override - public com.google.gwt.user.client.Element getSubPartElement(String subPart) { + public com.google.gwt.user.client.Element getSubPartElement( + String subPart) { if (subPart.equals("popup")) { feedbackPopup.show(); return feedbackPopup.getElement(); @@ -666,7 +670,8 @@ public class VSlider extends SimpleFocusablePanel implements Field, } @Override - public String getSubPartName(com.google.gwt.user.client.Element subElement) { + public String getSubPartName( + com.google.gwt.user.client.Element subElement) { if (feedbackPopup.getElement().isOrHasChild(subElement)) { return "popup"; } diff --git a/client/src/main/java/com/vaadin/client/ui/VSplitPanelHorizontal.java b/client/src/main/java/com/vaadin/client/ui/VSplitPanelHorizontal.java index 1a3e699b20..facba82b4a 100644 --- a/client/src/main/java/com/vaadin/client/ui/VSplitPanelHorizontal.java +++ b/client/src/main/java/com/vaadin/client/ui/VSplitPanelHorizontal.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/VSplitPanelVertical.java b/client/src/main/java/com/vaadin/client/ui/VSplitPanelVertical.java index 7baed03ca3..b3904960ad 100644 --- a/client/src/main/java/com/vaadin/client/ui/VSplitPanelVertical.java +++ b/client/src/main/java/com/vaadin/client/ui/VSplitPanelVertical.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -32,7 +32,8 @@ public class VSplitPanelVertical extends VAbstractSplitPanel { getFirstContainer().getStyle().setOverflow(Overflow.HIDDEN); } - if (getSecondWidget() != null && isWidgetFullHeight(getSecondWidget())) { + if (getSecondWidget() != null + && isWidgetFullHeight(getSecondWidget())) { getSecondContainer().getStyle().setOverflow(Overflow.HIDDEN); } } diff --git a/client/src/main/java/com/vaadin/client/ui/VTabsheet.java b/client/src/main/java/com/vaadin/client/ui/VTabsheet.java index 9b1608cb65..ca7db968d8 100644 --- a/client/src/main/java/com/vaadin/client/ui/VTabsheet.java +++ b/client/src/main/java/com/vaadin/client/ui/VTabsheet.java @@ -77,7 +77,8 @@ import com.vaadin.shared.ui.tabsheet.TabState; import com.vaadin.shared.ui.tabsheet.TabsheetServerRpc; import com.vaadin.shared.ui.tabsheet.TabsheetState; -public class VTabsheet extends VTabsheetBase implements Focusable, SubPartAware { +public class VTabsheet extends VTabsheetBase + implements Focusable, SubPartAware { private static final String PREV_SCROLLER_DISABLED_CLASSNAME = "Prev-disabled"; @@ -284,7 +285,8 @@ public class VTabsheet extends VTabsheetBase implements Focusable, SubPartAware } @Override - public HandlerRegistration addMouseDownHandler(MouseDownHandler handler) { + public HandlerRegistration addMouseDownHandler( + MouseDownHandler handler) { return addDomHandler(handler, MouseDownEvent.getType()); } @@ -334,7 +336,8 @@ public class VTabsheet extends VTabsheetBase implements Focusable, SubPartAware } private boolean update(TabState tabState) { - if (tabState.description != null || tabState.componentError != null) { + if (tabState.description != null + || tabState.componentError != null) { setTooltipInfo(new TooltipInfo(tabState.description, tabState.componentError, this)); } else { @@ -348,9 +351,9 @@ public class VTabsheet extends VTabsheetBase implements Focusable, SubPartAware boolean ret = updateCaptionWithoutOwner(captionString, !tabState.enabled, hasAttribute(tabState.description), hasAttribute(tabState.componentError), - tab.getTabsheet().connector - .getResourceUrl(ComponentConstants.ICON_RESOURCE - + tabState.key), tabState.iconAltText); + tab.getTabsheet().connector.getResourceUrl( + ComponentConstants.ICON_RESOURCE + tabState.key), + tabState.iconAltText); setClosable(tabState.closable); @@ -602,7 +605,8 @@ public class VTabsheet extends VTabsheetBase implements Focusable, SubPartAware } // FIXME: Shouldn't something be selected instead? - int scrollerIndexCandidate = getTabIndex(getTabsheet().scrollerPositionTabId); + int scrollerIndexCandidate = getTabIndex( + getTabsheet().scrollerPositionTabId); if (scrollerIndexCandidate < 0) { // The tab with id scrollerPositionTabId has been removed scrollerIndexCandidate = getTabsheet().scrollerIndex; @@ -901,15 +905,15 @@ public class VTabsheet extends VTabsheetBase implements Focusable, SubPartAware scrollerPrev = DOM.createButton(); scrollerPrev.setTabIndex(-1); - DOM.setElementProperty(scrollerPrev, "className", SCROLLER_CLASSNAME - + "Prev"); + DOM.setElementProperty(scrollerPrev, "className", + SCROLLER_CLASSNAME + "Prev"); Roles.getTablistRole().setAriaHiddenState(scrollerPrev, true); DOM.sinkEvents(scrollerPrev, Event.ONCLICK | Event.ONMOUSEDOWN); scrollerNext = DOM.createButton(); scrollerNext.setTabIndex(-1); - DOM.setElementProperty(scrollerNext, "className", SCROLLER_CLASSNAME - + "Next"); + DOM.setElementProperty(scrollerNext, "className", + SCROLLER_CLASSNAME + "Next"); Roles.getTablistRole().setAriaHiddenState(scrollerNext, true); DOM.sinkEvents(scrollerNext, Event.ONCLICK | Event.ONMOUSEDOWN); @@ -923,7 +927,8 @@ public class VTabsheet extends VTabsheetBase implements Focusable, SubPartAware deco = DOM.createDiv(); tb.setStyleName(CLASSNAME + "-tabs"); - DOM.setElementProperty(contentNode, "className", CLASSNAME + "-content"); + DOM.setElementProperty(contentNode, "className", + CLASSNAME + "-content"); DOM.setElementProperty(deco, "className", CLASSNAME + "-deco"); add(tb, tabs); @@ -1020,7 +1025,8 @@ public class VTabsheet extends VTabsheetBase implements Focusable, SubPartAware // style inheritance) if (ComponentStateUtil.hasStyles(state)) { final List styles = state.styles; - if (currentStyle == null || !currentStyle.equals(styles.toString())) { + if (currentStyle == null + || !currentStyle.equals(styles.toString())) { currentStyle = styles.toString(); final String tabsBaseClass = TABS_CLASSNAME; String tabsClass = tabsBaseClass; @@ -1041,8 +1047,8 @@ public class VTabsheet extends VTabsheetBase implements Focusable, SubPartAware } else { tb.setStyleName(CLASSNAME + "-tabs"); DOM.setElementProperty(tabs, "className", TABS_CLASSNAME); - DOM.setElementProperty(contentNode, "className", CLASSNAME - + "-content"); + DOM.setElementProperty(contentNode, "className", + CLASSNAME + "-content"); DOM.setElementProperty(deco, "className", CLASSNAME + "-deco"); } } @@ -1109,8 +1115,8 @@ public class VTabsheet extends VTabsheetBase implements Focusable, SubPartAware } private boolean isScrollerPrevDisabled() { - return scrollerPrev.getClassName().contains( - PREV_SCROLLER_DISABLED_CLASSNAME); + return scrollerPrev.getClassName() + .contains(PREV_SCROLLER_DISABLED_CLASSNAME); } private boolean isScrollerHidden() { @@ -1319,18 +1325,16 @@ public class VTabsheet extends VTabsheetBase implements Focusable, SubPartAware boolean clipped = isClippedTabs(); if (tb.getTabCount() > 0 && tb.isVisible() && (scrolled || clipped)) { scroller.getStyle().clearDisplay(); - DOM.setElementProperty(scrollerPrev, "className", - SCROLLER_CLASSNAME - + (scrolled ? "Prev" - : PREV_SCROLLER_DISABLED_CLASSNAME)); + DOM.setElementProperty(scrollerPrev, "className", SCROLLER_CLASSNAME + + (scrolled ? "Prev" : PREV_SCROLLER_DISABLED_CLASSNAME)); DOM.setElementProperty(scrollerNext, "className", SCROLLER_CLASSNAME + (clipped ? "Next" : "Next-disabled")); // the active tab should be focusable if and only if it is visible boolean isActiveTabVisible = scrollerIndex <= activeTabIndex && !isClipped(tb.selected); - tb.selected.setTabulatorIndex(isActiveTabVisible ? tabulatorIndex - : -1); + tb.selected.setTabulatorIndex( + isActiveTabVisible ? tabulatorIndex : -1); } else { scroller.getStyle().setDisplay(Display.NONE); @@ -1358,8 +1362,8 @@ public class VTabsheet extends VTabsheetBase implements Focusable, SubPartAware /** For internal use only. May be removed or replaced in the future. */ public void showAllTabs() { scrollerIndex = tb.getFirstVisibleTab(); - scrollerPositionTabId = scrollerIndex < 0 ? null : tb - .getTab(scrollerIndex).id; + scrollerPositionTabId = scrollerIndex < 0 ? null + : tb.getTab(scrollerIndex).id; for (int i = 0; i < tb.getTabCount(); i++) { Tab t = tb.getTab(i); if (!t.isHiddenOnServer()) { @@ -1373,9 +1377,10 @@ public class VTabsheet extends VTabsheetBase implements Focusable, SubPartAware } private boolean isClippedTabs() { - return (tb.getOffsetWidth() - DOM.getElementPropertyInt((Element) tb - .getContainerElement().getLastChild().cast(), "offsetWidth")) > getOffsetWidth() - - (isScrolledTabs() ? scroller.getOffsetWidth() : 0); + return (tb.getOffsetWidth() - DOM.getElementPropertyInt( + (Element) tb.getContainerElement().getLastChild().cast(), + "offsetWidth")) > getOffsetWidth() + - (isScrolledTabs() ? scroller.getOffsetWidth() : 0); } private boolean isClipped(Tab tab) { @@ -1461,7 +1466,7 @@ public class VTabsheet extends VTabsheetBase implements Focusable, SubPartAware /* * Generate the correct focus/blur events for the main TabSheet component * (#14304). - * + * * The TabSheet must fire one focus event when the user clicks on the tab * bar (i.e. inner TabBar class) containing the Tabs or when the focus is * provided to the TabSheet by any means. Also one blur event should be @@ -1469,15 +1474,15 @@ public class VTabsheet extends VTabsheetBase implements Focusable, SubPartAware * tab bar and before leaving it, no matter how many times he's pressing the * Tabs or the scroll buttons, the TabSheet component should not fire any of * those blur/focus events. - * + * * The only focusable elements contained in the tab bar are the Tabs (see * inner class Tab). The reason is the accessibility support. - * + * * Having this in mind, the chosen solution path for our problem is to match * a sequence of focus/blur events on the tabs, choose only the first focus * and last blur events and pass only those further to the main component. * Any consecutive blur/focus events on 2 Tabs must be ignored. - * + * * Because in a blur event we don't know whether or not a focus will follow, * we just defer a command initiated on the blur event to wait and see if * any focus will appear. The command will be executed after the next focus, @@ -1733,8 +1738,8 @@ public class VTabsheet extends VTabsheetBase implements Focusable, SubPartAware focusBlurManager.onFocus(focusSource); if (focusSource.hasTooltip()) { - focusSource.setAssistiveDescription(getVTooltip() - .getUniqueId()); + focusSource.setAssistiveDescription( + getVTooltip().getUniqueId()); getVTooltip().showAssistive(focusSource.getTooltipInfo()); } @@ -1888,9 +1893,9 @@ public class VTabsheet extends VTabsheetBase implements Focusable, SubPartAware /** * Gets the key to activate the selected tab when navigating using * previous/next (left/right) keys. - * + * * @return the key to activate the selected tab. - * + * * @see #getNextTabKey() * @see #getPreviousTabKey() */ @@ -1944,7 +1949,7 @@ public class VTabsheet extends VTabsheetBase implements Focusable, SubPartAware /** * Makes tab bar visible. - * + * * @since 7.2 */ public void showTabs() { @@ -1968,7 +1973,8 @@ public class VTabsheet extends VTabsheetBase implements Focusable, SubPartAware .compile("tab\\[(\\d+)](.*)"); @Override - public com.google.gwt.user.client.Element getSubPartElement(String subPart) { + public com.google.gwt.user.client.Element getSubPartElement( + String subPart) { if ("tabpanel".equals(subPart)) { return DOM.asOld(tabPanel.getElement().getFirstChildElement()); } else if (SUBPART_TAB_REGEXP.test(subPart)) { @@ -1989,16 +1995,16 @@ public class VTabsheet extends VTabsheetBase implements Focusable, SubPartAware } @Override - public String getSubPartName(com.google.gwt.user.client.Element subElement) { + public String getSubPartName( + com.google.gwt.user.client.Element subElement) { if (tabPanel.getElement().equals(subElement.getParentElement()) || tabPanel.getElement().equals(subElement)) { return "tabpanel"; } else { for (int i = 0; i < tb.getTabCount(); ++i) { Tab tab = tb.getTab(i); - if (tab.isClosable() - && tab.tabCaption.getCloseButton().isOrHasChild( - subElement)) { + if (tab.isClosable() && tab.tabCaption.getCloseButton() + .isOrHasChild(subElement)) { return "tab[" + i + "]/close"; } else if (tab.getElement().isOrHasChild(subElement)) { return "tab[" + i + "]"; diff --git a/client/src/main/java/com/vaadin/client/ui/VTabsheetBase.java b/client/src/main/java/com/vaadin/client/ui/VTabsheetBase.java index e96aa035ed..cc22213b14 100644 --- a/client/src/main/java/com/vaadin/client/ui/VTabsheetBase.java +++ b/client/src/main/java/com/vaadin/client/ui/VTabsheetBase.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -92,7 +92,7 @@ public abstract class VTabsheetBase extends ComplexPanel implements HasEnabled { /** * Returns true if the width of the widget is undefined, false otherwise. - * + * * @since 7.2 * @return true if width of the widget is determined by its content */ @@ -102,7 +102,7 @@ public abstract class VTabsheetBase extends ComplexPanel implements HasEnabled { /** * Returns true if the height of the widget is undefined, false otherwise. - * + * * @since 7.2 * @return true if width of the height is determined by its content */ @@ -112,10 +112,10 @@ public abstract class VTabsheetBase extends ComplexPanel implements HasEnabled { /** * Sets the connector that should be notified of events etc. - * + * * For internal use only. This method may be removed or replaced in the * future. - * + * * @since 7.2 * @param connector */ @@ -175,7 +175,7 @@ public abstract class VTabsheetBase extends ComplexPanel implements HasEnabled { * Sets whether the caption is rendered as HTML. *

    * The default is false, i.e. render tab captions as plain text - * + * * @since 7.4 * @param captionAsHtml * true if the captions are rendered as HTML, false if rendered @@ -187,9 +187,9 @@ public abstract class VTabsheetBase extends ComplexPanel implements HasEnabled { /** * Checks whether captions are rendered as HTML - * + * * The default is false, i.e. render tab captions as plain text - * + * * @since 7.4 * @return true if the captions are rendered as HTML, false if rendered as * plain text diff --git a/client/src/main/java/com/vaadin/client/ui/VTabsheetPanel.java b/client/src/main/java/com/vaadin/client/ui/VTabsheetPanel.java index 240f493907..a2da8f948a 100644 --- a/client/src/main/java/com/vaadin/client/ui/VTabsheetPanel.java +++ b/client/src/main/java/com/vaadin/client/ui/VTabsheetPanel.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -29,7 +29,7 @@ import com.vaadin.client.ui.TouchScrollDelegate.TouchScrollHandler; * A panel that displays all of its child widgets in a 'deck', where only one * can be visible at a time. It is used by * {@link com.vaadin.client.ui.VTabsheet}. - * + * * This class has the same basic functionality as the GWT DeckPanel * {@link com.google.gwt.user.client.ui.DeckPanel}, with the exception that it * doesn't manipulate the child widgets' width and height attributes. @@ -50,7 +50,7 @@ public class VTabsheetPanel extends ComplexPanel { /** * Adds the specified widget to the deck. - * + * * @param w * the widget to be added */ @@ -71,7 +71,7 @@ public class VTabsheetPanel extends ComplexPanel { /** * Gets the index of the currently-visible widget. - * + * * @return the visible widget's index */ public int getVisibleWidget() { @@ -80,7 +80,7 @@ public class VTabsheetPanel extends ComplexPanel { /** * Inserts a widget before the specified index. - * + * * @param w * the widget to be inserted * @param beforeIndex @@ -117,7 +117,7 @@ public class VTabsheetPanel extends ComplexPanel { /** * Shows the widget at the specified index. This causes the currently- * visible widget to be hidden. - * + * * @param index * the index of the widget to be shown */ @@ -129,8 +129,8 @@ public class VTabsheetPanel extends ComplexPanel { hide(DOM.getParent(visibleWidget.getElement())); } visibleWidget = newVisible; - touchScrollHandler.setElements(visibleWidget.getElement() - .getParentElement()); + touchScrollHandler + .setElements(visibleWidget.getElement().getParentElement()); } // Always ensure the selected tab is visible. If server prevents a tab // change we might end up here with visibleWidget == newVisible but its diff --git a/client/src/main/java/com/vaadin/client/ui/VTextArea.java b/client/src/main/java/com/vaadin/client/ui/VTextArea.java index bb3d3a476b..c675986f1e 100644 --- a/client/src/main/java/com/vaadin/client/ui/VTextArea.java +++ b/client/src/main/java/com/vaadin/client/ui/VTextArea.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -37,12 +37,12 @@ import com.vaadin.client.ui.dd.DragImageModifier; /** * This class represents a multiline textfield (textarea). - * + * * TODO consider replacing this with a RichTextArea based implementation. IE * does not support CSS height for textareas in Strict mode :-( - * + * * @author Vaadin Ltd. - * + * */ public class VTextArea extends VTextField implements DragImageModifier { diff --git a/client/src/main/java/com/vaadin/client/ui/VTextField.java b/client/src/main/java/com/vaadin/client/ui/VTextField.java index 1268b8a078..946a2b624c 100644 --- a/client/src/main/java/com/vaadin/client/ui/VTextField.java +++ b/client/src/main/java/com/vaadin/client/ui/VTextField.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -40,9 +40,9 @@ import com.vaadin.shared.ui.textfield.TextFieldConstants; /** * This class represents a basic text input field with one row. - * + * * @author Vaadin Ltd. - * + * */ public class VTextField extends TextBoxBase implements Field, ChangeHandler, FocusHandler, BlurHandler, KeyDownHandler { @@ -340,7 +340,7 @@ public class VTextField extends TextBoxBase implements Field, ChangeHandler, * This method is responsible for updating the DOM or otherwise ensuring * that the given max length is enforced. Called when the max length for the * field has changed. - * + * * @param maxLength * The new max length */ @@ -375,7 +375,7 @@ public class VTextField extends TextBoxBase implements Field, ChangeHandler, * Called when the field value might have changed and/or the field was * blurred. These are combined so the blur event is sent in the same batch * as a possible value change event (these are often connected). - * + * * @param blurred * true if the field was blurred */ @@ -418,7 +418,7 @@ public class VTextField extends TextBoxBase implements Field, ChangeHandler, /** * Updates the cursor position variable if it has changed since the last * update. - * + * * @return true iff the value was updated */ protected boolean updateCursorPosition() { diff --git a/client/src/main/java/com/vaadin/client/ui/VTextualDate.java b/client/src/main/java/com/vaadin/client/ui/VTextualDate.java index 4d80b30f4f..77a5867df7 100644 --- a/client/src/main/java/com/vaadin/client/ui/VTextualDate.java +++ b/client/src/main/java/com/vaadin/client/ui/VTextualDate.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -79,11 +79,10 @@ public class VTextualDate extends VDateField implements Field, ChangeHandler, text.setText(""); setPrompting(false); } - if (getClient() != null - && getClient().hasEventListeners(VTextualDate.this, - EventId.FOCUS)) { - getClient() - .updateVariable(getId(), EventId.FOCUS, "", true); + if (getClient() != null && getClient() + .hasEventListeners(VTextualDate.this, EventId.FOCUS)) { + getClient().updateVariable(getId(), EventId.FOCUS, "", + true); } // Needed for tooltip event handling @@ -101,9 +100,8 @@ public class VTextualDate extends VDateField implements Field, ChangeHandler, if (prompting) { text.setText(readonly ? "" : inputPrompt); } - if (getClient() != null - && getClient().hasEventListeners(VTextualDate.this, - EventId.BLUR)) { + if (getClient() != null && getClient() + .hasEventListeners(VTextualDate.this, EventId.BLUR)) { getClient().updateVariable(getId(), EventId.BLUR, "", true); } @@ -143,11 +141,13 @@ public class VTextualDate extends VDateField implements Field, ChangeHandler, } else { frmString += " HH"; } - if (currentResolution.getCalendarField() >= Resolution.MINUTE - .getCalendarField()) { + if (currentResolution + .getCalendarField() >= Resolution.MINUTE + .getCalendarField()) { frmString += ":mm"; - if (currentResolution.getCalendarField() >= Resolution.SECOND - .getCalendarField()) { + if (currentResolution + .getCalendarField() >= Resolution.SECOND + .getCalendarField()) { frmString += ":ss"; } } @@ -252,9 +252,8 @@ public class VTextualDate extends VDateField implements Field, ChangeHandler, // presentation. // FIXME: Add a description/example here of when this is // needed - text.setValue( - getDateTimeService().formatDate(getDate(), - getFormatString()), false); + text.setValue(getDateTimeService().formatDate(getDate(), + getFormatString()), false); } // remove possibly added invalid value indication @@ -274,8 +273,8 @@ public class VTextualDate extends VDateField implements Field, ChangeHandler, removeStyleName(getStylePrimaryName() + PARSE_ERROR_CLASSNAME); } // always send the date string - getClient() - .updateVariable(getId(), "dateString", text.getText(), false); + getClient().updateVariable(getId(), "dateString", text.getText(), + false); // Update variables // (only the smallest defining resolution needs to be @@ -363,12 +362,9 @@ public class VTextualDate extends VDateField implements Field, ChangeHandler, } protected void setText(String text) { - if (inputPrompt != null - && (text == null || "".equals(text)) - && !this.text.getStyleName() - .contains( - VTextField.CLASSNAME + "-" - + VTextField.CLASSNAME_FOCUS)) { + if (inputPrompt != null && (text == null || "".equals(text)) + && !this.text.getStyleName().contains(VTextField.CLASSNAME + "-" + + VTextField.CLASSNAME_FOCUS)) { text = readonly ? "" : inputPrompt; setPrompting(true); } else { @@ -381,7 +377,8 @@ public class VTextualDate extends VDateField implements Field, ChangeHandler, private final String TEXTFIELD_ID = "field"; @Override - public com.google.gwt.user.client.Element getSubPartElement(String subPart) { + public com.google.gwt.user.client.Element getSubPartElement( + String subPart) { if (subPart.equals(TEXTFIELD_ID)) { return text.getElement(); } @@ -390,7 +387,8 @@ public class VTextualDate extends VDateField implements Field, ChangeHandler, } @Override - public String getSubPartName(com.google.gwt.user.client.Element subElement) { + public String getSubPartName( + com.google.gwt.user.client.Element subElement) { if (text.getElement().isOrHasChild(subElement)) { return TEXTFIELD_ID; } diff --git a/client/src/main/java/com/vaadin/client/ui/VTree.java b/client/src/main/java/com/vaadin/client/ui/VTree.java index efbafd0cb7..7f83548010 100644 --- a/client/src/main/java/com/vaadin/client/ui/VTree.java +++ b/client/src/main/java/com/vaadin/client/ui/VTree.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -79,11 +79,11 @@ import com.vaadin.shared.ui.dd.VerticalDropLocation; import com.vaadin.shared.ui.tree.TreeConstants; /** - * + * */ -public class VTree extends FocusElementPanel implements VHasDropHandler, - FocusHandler, BlurHandler, KeyPressHandler, KeyDownHandler, - SubPartAware, ActionOwner, HandlesAriaCaption { +public class VTree extends FocusElementPanel + implements VHasDropHandler, FocusHandler, BlurHandler, KeyPressHandler, + KeyDownHandler, SubPartAware, ActionOwner, HandlesAriaCaption { private String lastNodeKey = ""; public static final String CLASSNAME = "v-tree"; @@ -237,7 +237,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, /* * (non-Javadoc) - * + * * @see * com.google.gwt.user.client.ui.Widget#onBrowserEvent(com.google.gwt.user * .client.Event) @@ -254,8 +254,8 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, } else if (event.getTypeInt() == Event.ONMOUSEUP) { // Remove IE text selection hack if (BrowserInfo.get().isIE()) { - ((Element) event.getEventTarget().cast()).setPropertyJSO( - "onselectstart", null); + ((Element) event.getEventTarget().cast()) + .setPropertyJSO("onselectstart", null); } } else if (event.getTypeInt() == Event.ONKEYUP) { if (selectionHasChanged) { @@ -289,7 +289,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, /** * Returns the first root node of the tree or null if there are no root * nodes. - * + * * @return The first root {@link TreeNode} */ protected TreeNode getFirstRootNode() { @@ -302,7 +302,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, /** * Returns the last root node of the tree or null if there are no root * nodes. - * + * * @return The last root {@link TreeNode} */ protected TreeNode getLastRootNode() { @@ -315,7 +315,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, /** * Returns a list of all root nodes in the Tree in the order they appear in * the tree. - * + * * @return A list of all root {@link TreeNode}s. */ protected List getRootNodes() { @@ -333,8 +333,8 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, drag.getDropDetails().put("itemIdOver", currentMouseOverKey); if (currentMouseOverKey != null) { TreeNode treeNode = getNodeByKey(currentMouseOverKey); - VerticalDropLocation detail = treeNode.getDropDetail(drag - .getCurrentGwtEvent()); + VerticalDropLocation detail = treeNode + .getDropDetail(drag.getCurrentGwtEvent()); Boolean overTreeNode = null; if (treeNode != null && !treeNode.isLeaf() && detail == VerticalDropLocation.MIDDLE) { @@ -370,17 +370,20 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, @Override public void dragOver(final VDragEvent currentDrag) { - final Object oldIdOver = currentDrag.getDropDetails().get( - "itemIdOver"); + final Object oldIdOver = currentDrag.getDropDetails() + .get("itemIdOver"); final VerticalDropLocation oldDetail = (VerticalDropLocation) currentDrag .getDropDetails().get("detail"); updateTreeRelatedDragData(currentDrag); final VerticalDropLocation detail = (VerticalDropLocation) currentDrag .getDropDetails().get("detail"); - boolean nodeHasChanged = (currentMouseOverKey != null && currentMouseOverKey != oldIdOver) - || (currentMouseOverKey == null && oldIdOver != null); - boolean detailHasChanded = (detail != null && detail != oldDetail) + boolean nodeHasChanged = (currentMouseOverKey != null + && currentMouseOverKey != oldIdOver) + || (currentMouseOverKey == null + && oldIdOver != null); + boolean detailHasChanded = (detail != null + && detail != oldDetail) || (detail == null && oldDetail != null); if (nodeHasChanged || detailHasChanded) { @@ -396,8 +399,8 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, public void accepted(VDragEvent event) { VerticalDropLocation curDetail = (VerticalDropLocation) event .getDropDetails().get("detail"); - if (curDetail == detail - && newKey.equals(currentMouseOverKey)) { + if (curDetail == detail && newKey + .equals(currentMouseOverKey)) { getNodeByKey(newKey).emphasis(detail); } /* @@ -511,7 +514,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, /** * Is a node selected in the tree - * + * * @param treeNode * The node to check * @return @@ -634,7 +637,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, /** * Handles mouse selection - * + * * @param ctrl * Was the ctrl-key pressed * @param shift @@ -699,7 +702,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, /* * (non-Javadoc) - * + * * @see * com.google.gwt.user.client.ui.Widget#onBrowserEvent(com.google.gwt * .user.client.Event) @@ -710,7 +713,8 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, final int type = DOM.eventGetType(event); final Element target = DOM.eventGetTarget(event); - if (type == Event.ONLOAD && icon != null && target == icon.getElement()) { + if (type == Event.ONLOAD && icon != null + && target == icon.getElement()) { iconLoaded.trigger(); } @@ -719,9 +723,8 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, } final boolean inCaption = isCaptionElement(target); - if (inCaption - && client.hasEventListeners(VTree.this, - TreeConstants.ITEM_CLICK_EVENT_ID) + if (inCaption && client.hasEventListeners(VTree.this, + TreeConstants.ITEM_CLICK_EVENT_ID) && (type == Event.ONDBLCLICK || type == Event.ONMOUSEUP)) { fireClick(event); @@ -751,11 +754,10 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, if (dragMode != 0 || dropHandler != null) { if (type == Event.ONMOUSEDOWN || type == Event.ONTOUCHSTART) { - if (nodeCaptionDiv.isOrHasChild((Node) event - .getEventTarget().cast())) { - if (dragMode > 0 - && (type == Event.ONTOUCHSTART || event - .getButton() == NativeEvent.BUTTON_LEFT)) { + if (nodeCaptionDiv.isOrHasChild( + (Node) event.getEventTarget().cast())) { + if (dragMode > 0 && (type == Event.ONTOUCHSTART || event + .getButton() == NativeEvent.BUTTON_LEFT)) { mouseDownEvent = event; // save event for possible // dd operation if (type == Event.ONMOUSEDOWN) { @@ -775,18 +777,17 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, } } } - } else if (type == Event.ONMOUSEMOVE - || type == Event.ONMOUSEOUT + } else if (type == Event.ONMOUSEMOVE || type == Event.ONMOUSEOUT || type == Event.ONTOUCHMOVE) { if (mouseDownEvent != null) { // start actual drag on slight move when mouse is down VTransferable t = new VTransferable(); - t.setDragSource(ConnectorMap.get(client).getConnector( - VTree.this)); + t.setDragSource(ConnectorMap.get(client) + .getConnector(VTree.this)); t.setData("itemId", key); - VDragEvent drag = VDragAndDropManager.get().startDrag( - t, mouseDownEvent, true); + VDragEvent drag = VDragAndDropManager.get().startDrag(t, + mouseDownEvent, true); drag.createDragImage(nodeCaptionDiv, true); event.stopPropagation(); @@ -810,14 +811,15 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, /** * Checks if the given element is the caption or the icon. - * + * * @param target * The element to check * @return true if the element is the caption or the icon */ - public boolean isCaptionElement(com.google.gwt.dom.client.Element target) { - return (target == nodeCaptionSpan || (icon != null && target == icon - .getElement())); + public boolean isCaptionElement( + com.google.gwt.dom.client.Element target) { + return (target == nodeCaptionSpan + || (icon != null && target == icon.getElement())); } private void fireClick(final Event evt) { @@ -849,8 +851,8 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, // selection event happening after this. In all other cases // we want to send it immediately. clickEventPending = false; - if ((details.getButton() == MouseButton.LEFT || details - .getButton() == MouseButton.MIDDLE) + if ((details.getButton() == MouseButton.LEFT + || details.getButton() == MouseButton.MIDDLE) && !details.isDoubleClick() && selectable) { // Probably a selection that will cause a value change // event to be sent @@ -864,7 +866,8 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, clickEventPending = false; } } - client.updateVariable(paintableId, "clickedKey", key, false); + client.updateVariable(paintableId, "clickedKey", key, + false); client.updateVariable(paintableId, "clickEvent", details.toString(), !clickEventPending); } @@ -906,8 +909,8 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, Id.of(labelId)); nodeCaptionDiv = DOM.createDiv(); - DOM.setElementProperty(nodeCaptionDiv, "className", CLASSNAME - + "-caption"); + DOM.setElementProperty(nodeCaptionDiv, "className", + CLASSNAME + "-caption"); Element wrapper = DOM.createDiv(); wrapper.setId(labelId); wrapper.setAttribute("for", treeItemId); @@ -948,8 +951,8 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, } if (state) { if (!childrenLoaded && notifyServer) { - client.updateVariable(paintableId, "requestChildTree", - true, false); + client.updateVariable(paintableId, "requestChildTree", true, + false); } if (notifyServer) { client.updateVariable(paintableId, "expand", @@ -997,7 +1000,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, /** * Returns the children of the node - * + * * @return A set of tree nodes */ public List getChildren() { @@ -1044,7 +1047,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, * Adds/removes Vaadin specific style name. *

    * For internal use only. May be removed or replaced in the future. - * + * * @param selected */ public void setSelected(boolean selected) { @@ -1058,7 +1061,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, /** * Travels up the hierarchy looking for this node - * + * * @param child * The child which grandparent this is or is not * @return True if this is a grandparent of the child node @@ -1097,7 +1100,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, /* * (non-Javadoc) - * + * * @see com.google.gwt.user.client.ui.Widget#onDetach() */ @Override @@ -1108,7 +1111,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, /* * (non-Javadoc) - * + * * @see com.google.gwt.user.client.ui.UIObject#toString() */ @Override @@ -1118,7 +1121,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, /** * Is the node focused? - * + * * @param focused * True if focused, false if not */ @@ -1160,10 +1163,10 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, public void setNodeStyleName(String styleName) { addStyleName(TreeNode.CLASSNAME + "-" + styleName); - setStyleName(nodeCaptionDiv, TreeNode.CLASSNAME + "-caption-" - + styleName, true); - childNodeContainer.addStyleName(TreeNode.CLASSNAME + "-children-" - + styleName); + setStyleName(nodeCaptionDiv, + TreeNode.CLASSNAME + "-caption-" + styleName, true); + childNodeContainer.addStyleName( + TreeNode.CLASSNAME + "-children-" + styleName); } @@ -1194,7 +1197,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, /** * Selects a range of nodes - * + * * @param startNodeKey * The start node key * @param endNodeKey @@ -1224,7 +1227,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, /** * Selects a node and deselect all other nodes - * + * * @param node * The node to select */ @@ -1243,7 +1246,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, /** * Deselects a node - * + * * @param node * The node to deselect */ @@ -1255,7 +1258,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, /** * Selects all the open children to a node - * + * * @param node * The parent node */ @@ -1278,7 +1281,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, /** * Selects all children until a stop child is reached - * + * * @param root * The root not to start from * @param stopNode @@ -1287,7 +1290,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, * Should the root node be selected * @param includeStopNode * Should the stop node be selected - * + * * @return Returns false if the stop child was found, else true if all * children was selected */ @@ -1323,7 +1326,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, /** * Select a range between two nodes which have no relation to each other - * + * * @param startNode * The start node to start the selection from * @param endNode @@ -1369,8 +1372,8 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, TreeNode currentNode = startNode; while (startParent != null && startParent != commonParent) { List startChildren = startParent.getChildren(); - for (int i = startChildren.indexOf(currentNode) + 1; i < startChildren - .size(); i++) { + for (int i = startChildren.indexOf(currentNode) + + 1; i < startChildren.size(); i++) { selectAllChildren(startChildren.get(i), true); } @@ -1393,7 +1396,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, /** * Examines the children of the branch node and returns true if a node is in * that branch - * + * * @param node * The node to search for * @param branch @@ -1418,11 +1421,12 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, } /** - * Selects a range of items which are in direct relation with each other.
    + * Selects a range of items which are in direct relation with each + * other.
    * NOTE: The start node MUST be before the end node! - * + * * @param startNode - * + * * @param endNode */ private void doRelationSelection(TreeNode startNode, TreeNode endNode) { @@ -1452,7 +1456,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, /** * Selects a range of items which have the same parent. - * + * * @param startNode * The start node * @param endNode @@ -1502,7 +1506,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, /** * Returns the first common parent of two nodes - * + * * @param node1 * The first node * @param node2 @@ -1552,7 +1556,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, /** * Sets the node currently in focus - * + * * @param node * The node to focus or null to remove the focus completely * @param scrollIntoView @@ -1575,12 +1579,12 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, /* * FIXME: This code needs to be changed when the keyboard navigation * doesn't immediately trigger a selection change anymore. - * + * * Right now this function is called before and after the Tree is * rebuilt when up/down arrow keys are pressed. This leads to the * problem, that the newly selected item is announced too often with * a screen reader. - * + * * Behaviour is different when using the Tree with and without * screen reader. */ @@ -1614,7 +1618,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, /** * Focuses a node and scrolls it into view - * + * * @param node * The node to focus */ @@ -1624,7 +1628,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.FocusHandler#onFocus(com.google.gwt.event * .dom.client.FocusEvent) @@ -1644,7 +1648,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.BlurHandler#onBlur(com.google.gwt.event * .dom.client.BlurEvent) @@ -1659,7 +1663,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.KeyPressHandler#onKeyPress(com.google * .gwt.event.dom.client.KeyPressEvent) @@ -1683,7 +1687,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.KeyDownHandler#onKeyDown(com.google.gwt * .event.dom.client.KeyDownEvent) @@ -1700,7 +1704,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, /** * Handles the keyboard navigation - * + * * @param keycode * The keycode of the pressed key * @param ctrl @@ -1820,9 +1824,9 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, // Selection if (keycode == getNavigationSelectKey()) { if (!focusedNode.isSelected()) { - selectNode( - focusedNode, - (!isMultiselect || multiSelectMode == MULTISELECT_MODE_SIMPLE) + selectNode(focusedNode, + (!isMultiselect + || multiSelectMode == MULTISELECT_MODE_SIMPLE) && selectable); } else { deselectNode(focusedNode); @@ -1881,7 +1885,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, * be at least one selection. After this the newly focused node is * selected and we've ended up with two selected nodes even though we * only navigated with the arrow keys. - * + * * Because of this, we first select the next node and later de-select * the old one. */ @@ -1893,13 +1897,14 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, /** * Traverses the tree to the bottom most child - * + * * @param root * The root of the tree * @return The bottom most child */ private TreeNode getLastVisibleChildInTree(TreeNode root) { - if (root.isLeaf() || !root.getState() || root.getChildren().size() == 0) { + if (root.isLeaf() || !root.getState() + || root.getChildren().size() == 0) { return root; } List children = root.getChildren(); @@ -1908,7 +1913,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, /** * Gets the next sibling in the tree - * + * * @param node * The node to get the sibling for * @return The sibling node or null if the node is the last sibling @@ -1932,7 +1937,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, /** * Returns the previous sibling in the tree - * + * * @param node * The node to get the sibling for * @return The sibling node or null if the node is the first sibling @@ -1958,7 +1963,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, * Add this to the element mouse down event by using element.setPropertyJSO * ("onselectstart",applyDisableTextSelectionIEHack()); Remove it then again * when the mouse is depressed in the mouse up event. - * + * * @return Returns the JSO preventing text selection */ private native JavaScriptObject applyDisableTextSelectionIEHack() @@ -1970,7 +1975,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, * Get the key that moves the selection head upwards. By default it is the * up arrow key but by overriding this you can change the key to whatever * you want. - * + * * @return The keycode of the key */ protected int getNavigationUpKey() { @@ -1981,7 +1986,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, * Get the key that moves the selection head downwards. By default it is the * down arrow key but by overriding this you can change the key to whatever * you want. - * + * * @return The keycode of the key */ protected int getNavigationDownKey() { @@ -1992,7 +1997,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, * Get the key that scrolls to the left in the table. By default it is the * left arrow key but by overriding this you can change the key to whatever * you want. - * + * * @return The keycode of the key */ protected int getNavigationLeftKey() { @@ -2003,7 +2008,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, * Get the key that scroll to the right on the table. By default it is the * right arrow key but by overriding this you can change the key to whatever * you want. - * + * * @return The keycode of the key */ protected int getNavigationRightKey() { @@ -2014,7 +2019,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, * Get the key that selects an item in the table. By default it is the space * bar key but by overriding this you can change the key to whatever you * want. - * + * * @return */ protected int getNavigationSelectKey() { @@ -2025,7 +2030,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, * Get the key the moves the selection one page up in the table. By default * this is the Page Up key but by overriding this you can change the key to * whatever you want. - * + * * @return */ protected int getNavigationPageUpKey() { @@ -2036,7 +2041,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, * Get the key the moves the selection one page down in the table. By * default this is the Page Down key but by overriding this you can change * the key to whatever you want. - * + * * @return */ protected int getNavigationPageDownKey() { @@ -2047,7 +2052,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, * Get the key the moves the selection to the beginning of the table. By * default this is the Home key but by overriding this you can change the * key to whatever you want. - * + * * @return */ protected int getNavigationStartKey() { @@ -2058,7 +2063,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, * Get the key the moves the selection to the end of the table. By default * this is the End key but by overriding this you can change the key to * whatever you want. - * + * * @return */ protected int getNavigationEndKey() { @@ -2077,12 +2082,13 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, /* * (non-Javadoc) - * + * * @see com.vaadin.client.ui.SubPartAware#getSubPartElement(java * .lang.String) */ @Override - public com.google.gwt.user.client.Element getSubPartElement(String subPart) { + public com.google.gwt.user.client.Element getSubPartElement( + String subPart) { if ("fe".equals(subPart)) { if (BrowserInfo.get().isOpera() && focusedNode != null) { return focusedNode.getElement(); @@ -2130,12 +2136,13 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, /* * (non-Javadoc) - * + * * @see com.vaadin.client.ui.SubPartAware#getSubPartName(com.google * .gwt.user.client.Element) */ @Override - public String getSubPartName(com.google.gwt.user.client.Element subElement) { + public String getSubPartName( + com.google.gwt.user.client.Element subElement) { // Supported identifiers: // // n[index]/n[index]/n[index]{/expand} diff --git a/client/src/main/java/com/vaadin/client/ui/VTreeTable.java b/client/src/main/java/com/vaadin/client/ui/VTreeTable.java index 0ba84af4bb..2538e2707c 100644 --- a/client/src/main/java/com/vaadin/client/ui/VTreeTable.java +++ b/client/src/main/java/com/vaadin/client/ui/VTreeTable.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -48,7 +48,8 @@ public class VTreeTable extends VScrollTable { public final boolean ctrl; public final boolean shift; - public PendingNavigationEvent(int keycode, boolean ctrl, boolean shift) { + public PendingNavigationEvent(int keycode, boolean ctrl, + boolean shift) { this.keycode = keycode; this.ctrl = ctrl; this.shift = shift; @@ -143,8 +144,8 @@ public class VTreeTable extends VScrollTable { return new VTreeTableRow(uidl, aligns2); } - public class VTreeTableRow extends - VScrollTable.VScrollTableBody.VScrollTableRow { + public class VTreeTableRow + extends VScrollTable.VScrollTableBody.VScrollTableRow { private boolean isTreeCellAdded = false; private SpanElement treeSpacer; @@ -163,8 +164,8 @@ public class VTreeTable extends VScrollTable { public void addCell(UIDL rowUidl, String text, char align, String style, boolean textIsHTML, boolean isSorted, String description) { - super.addCell(rowUidl, text, align, style, textIsHTML, - isSorted, description); + super.addCell(rowUidl, text, align, style, textIsHTML, isSorted, + description); addTreeSpacer(rowUidl); } @@ -175,8 +176,8 @@ public class VTreeTable extends VScrollTable { .getFirstChild(); if (rowUidl.hasAttribute("icon")) { - Icon icon = client.getIcon(rowUidl - .getStringAttribute("icon")); + Icon icon = client + .getIcon(rowUidl.getStringAttribute("icon")); icon.setAlternateText("icon"); container.insertFirst(icon.getElement()); } @@ -193,8 +194,8 @@ public class VTreeTable extends VScrollTable { treeSpacer.setClassName(classname); container.insertFirst(treeSpacer); - depth = rowUidl.hasAttribute("depth") ? rowUidl - .getIntAttribute("depth") : 0; + depth = rowUidl.hasAttribute("depth") + ? rowUidl.getIntAttribute("depth") : 0; setIndent(); isTreeCellAdded = true; return true; @@ -355,9 +356,8 @@ public class VTreeTable extends VScrollTable { if (cells.hasNext()) { final Object cell = cells.next(); if (cell instanceof String) { - addSpannedCell(uidl, cell.toString(), aligns[0], - "", htmlContentAllowed, false, null, - colCount); + addSpannedCell(uidl, cell.toString(), aligns[0], "", + htmlContentAllowed, false, null, colCount); } else { addSpannedCell(uidl, (Widget) cell, aligns[0], "", false, colCount); @@ -580,35 +580,35 @@ public class VTreeTable extends VScrollTable { /** * Animates row expansion using the GWT animation framework. - * + * * The idea is as follows: - * + * * 1. Insert all rows normally - * + * * 2. Insert a newly created DIV containing a new TABLE element below * the DIV containing the actual scroll table body. - * + * * 3. Clone the rows that were inserted in step 1 and attach the clones * to the new TABLE element created in step 2. - * + * * 4. The new DIV from step 2 is absolutely positioned so that the last * inserted row is just behind the row that was expanded. - * + * * 5. Hide the contents of the originally inserted rows by setting the * DIV.v-table-cell-wrapper to display:none;. - * + * * 6. Set the height of the originally inserted rows to 0. - * + * * 7. The animation loop slides the DIV from step 2 downwards, while at * the same pace growing the height of each of the inserted rows from 0 * to full height. The first inserted row grows from 0 to full and after * this the second row grows from 0 to full, etc until all rows are full * height. - * + * * 8. Remove the DIV from step 2 - * + * * 9. Restore display:block; to the DIV.v-table-cell-wrapper elements. - * + * * 10. DONE */ private class RowExpandAnimation extends Animation { @@ -625,7 +625,8 @@ public class VTreeTable extends VScrollTable { public RowExpandAnimation(List rows) { this.rows = rows; buildAndInsertAnimatingDiv(); - preparator = new AnimationPreparator(rows.get(0).getIndex() - 1); + preparator = new AnimationPreparator( + rows.get(0).getIndex() - 1); preparator.prepareTableForAnimation(); for (VScrollTableRow row : rows) { cloneAndAppendRow(row); @@ -724,7 +725,8 @@ public class VTreeTable extends VScrollTable { return td.getChild(0).cast(); } - private void resetCellWrapperDivsDisplayProperty(VScrollTableRow row) { + private void resetCellWrapperDivsDisplayProperty( + VScrollTableRow row) { Element tr = row.getElement(); for (int ix = 0; ix < tr.getChildCount(); ix++) { getWrapperDiv(tr, ix).getStyle().clearProperty("display"); @@ -804,8 +806,9 @@ public class VTreeTable extends VScrollTable { VTreeTableRow focusedRow = (VTreeTableRow) getFocusedRow(); if (focusedRow != null) { - if (focusedRow.canHaveChildren - && ((keycode == KeyCodes.KEY_RIGHT && !focusedRow.open) || (keycode == KeyCodes.KEY_LEFT && focusedRow.open))) { + if (focusedRow.canHaveChildren && ((keycode == KeyCodes.KEY_RIGHT + && !focusedRow.open) + || (keycode == KeyCodes.KEY_LEFT && focusedRow.open))) { if (!ctrl) { client.updateVariable(paintableId, "selectCollapsed", true, false); diff --git a/client/src/main/java/com/vaadin/client/ui/VTwinColSelect.java b/client/src/main/java/com/vaadin/client/ui/VTwinColSelect.java index 853bd8d456..6d4d15cfc9 100644 --- a/client/src/main/java/com/vaadin/client/ui/VTwinColSelect.java +++ b/client/src/main/java/com/vaadin/client/ui/VTwinColSelect.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -72,10 +72,10 @@ public class VTwinColSelect extends VOptionGroupBase implements KeyDownHandler, /** * A ListBox which catches double clicks - * + * */ - public class DoubleClickListBox extends ListBox implements - HasDoubleClickHandlers { + public class DoubleClickListBox extends ListBox + implements HasDoubleClickHandlers { public DoubleClickListBox(boolean isMultipleSelect) { super(isMultipleSelect); } @@ -170,13 +170,15 @@ public class VTwinColSelect extends VOptionGroupBase implements KeyDownHandler, /** For internal use only. May be removed or replaced in the future. */ public void updateCaptions(UIDL uidl) { String leftCaption = (uidl - .hasAttribute(TwinColSelectConstants.ATTRIBUTE_LEFT_CAPTION) ? uidl - .getStringAttribute(TwinColSelectConstants.ATTRIBUTE_LEFT_CAPTION) - : null); + .hasAttribute(TwinColSelectConstants.ATTRIBUTE_LEFT_CAPTION) + ? uidl.getStringAttribute( + TwinColSelectConstants.ATTRIBUTE_LEFT_CAPTION) + : null); String rightCaption = (uidl - .hasAttribute(TwinColSelectConstants.ATTRIBUTE_RIGHT_CAPTION) ? uidl - .getStringAttribute(TwinColSelectConstants.ATTRIBUTE_RIGHT_CAPTION) - : null); + .hasAttribute(TwinColSelectConstants.ATTRIBUTE_RIGHT_CAPTION) + ? uidl.getStringAttribute( + TwinColSelectConstants.ATTRIBUTE_RIGHT_CAPTION) + : null); boolean hasCaptions = (leftCaption != null || rightCaption != null); @@ -394,13 +396,14 @@ public class VTwinColSelect extends VOptionGroupBase implements KeyDownHandler, /** For internal use only. May be removed or replaced in the future. */ public void setInternalWidths() { getElement().getStyle().setPosition(Position.RELATIVE); - int bordersAndPaddings = WidgetUtil.measureHorizontalPaddingAndBorder( - buttons.getElement(), 0); + int bordersAndPaddings = WidgetUtil + .measureHorizontalPaddingAndBorder(buttons.getElement(), 0); int buttonWidth = WidgetUtil.getRequiredWidth(buttons); int totalWidth = getOffsetWidth(); - int spaceForSelect = (totalWidth - buttonWidth - bordersAndPaddings) / 2; + int spaceForSelect = (totalWidth - buttonWidth - bordersAndPaddings) + / 2; options.setWidth(spaceForSelect + "px"); if (optionsCaption != null) { @@ -441,7 +444,7 @@ public class VTwinColSelect extends VOptionGroupBase implements KeyDownHandler, /** * Get the key that selects an item in the table. By default it is the Enter * key but by overriding this you can change the key to whatever you want. - * + * * @return */ protected int getNavigationSelectKey() { @@ -450,7 +453,7 @@ public class VTwinColSelect extends VOptionGroupBase implements KeyDownHandler, /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.KeyDownHandler#onKeyDown(com.google.gwt * .event.dom.client.KeyDownEvent) @@ -514,7 +517,7 @@ public class VTwinColSelect extends VOptionGroupBase implements KeyDownHandler, /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.MouseDownHandler#onMouseDown(com.google * .gwt.event.dom.client.MouseDownEvent) @@ -537,7 +540,7 @@ public class VTwinColSelect extends VOptionGroupBase implements KeyDownHandler, /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.DoubleClickHandler#onDoubleClick(com. * google.gwt.event.dom.client.DoubleClickEvent) @@ -568,7 +571,8 @@ public class VTwinColSelect extends VOptionGroupBase implements KeyDownHandler, private static final String SUBPART_REMOVE_BUTTON = "remove"; @Override - public com.google.gwt.user.client.Element getSubPartElement(String subPart) { + public com.google.gwt.user.client.Element getSubPartElement( + String subPart) { if (SUBPART_OPTION_SELECT.equals(subPart)) { return options.getElement(); } else if (subPart.startsWith(SUBPART_OPTION_SELECT_ITEM)) { @@ -578,8 +582,8 @@ public class VTwinColSelect extends VOptionGroupBase implements KeyDownHandler, } else if (SUBPART_SELECTION_SELECT.equals(subPart)) { return selections.getElement(); } else if (subPart.startsWith(SUBPART_SELECTION_SELECT_ITEM)) { - String idx = subPart.substring(SUBPART_SELECTION_SELECT_ITEM - .length()); + String idx = subPart + .substring(SUBPART_SELECTION_SELECT_ITEM.length()); return (com.google.gwt.user.client.Element) selections.getElement() .getChild(Integer.parseInt(idx)); } else if (optionsCaption != null @@ -598,7 +602,8 @@ public class VTwinColSelect extends VOptionGroupBase implements KeyDownHandler, } @Override - public String getSubPartName(com.google.gwt.user.client.Element subElement) { + public String getSubPartName( + com.google.gwt.user.client.Element subElement) { if (optionsCaption != null && optionsCaption.getElement().isOrHasChild(subElement)) { return SUBPART_LEFT_CAPTION; diff --git a/client/src/main/java/com/vaadin/client/ui/VUI.java b/client/src/main/java/com/vaadin/client/ui/VUI.java index 08641ad6ba..4367603b89 100644 --- a/client/src/main/java/com/vaadin/client/ui/VUI.java +++ b/client/src/main/java/com/vaadin/client/ui/VUI.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -50,7 +50,7 @@ import com.vaadin.shared.ApplicationConstants; import com.vaadin.shared.ui.ui.UIConstants; /** - * + * */ public class VUI extends SimplePanel implements ResizeHandler, Window.ClosingHandler, ShortcutActionHandlerOwner, Focusable, @@ -85,7 +85,7 @@ public class VUI extends SimplePanel implements ResizeHandler, /** * Keep track of possible parent size changes when an embedded application. - * + * * Uses {@link #parentWidth} and {@link #parentHeight} as an optimization to * keep track of when there is a real change. */ @@ -131,14 +131,13 @@ public class VUI extends SimplePanel implements ResizeHandler, /* * Ensure the fragment is properly encoded in all browsers * (#10769) - * + * * createUrlBuilder does not properly pass an empty fragment to * UrlBuilder on Webkit browsers so do it manually (#11686) */ - String location = Window.Location - .createUrlBuilder() - .setHash( - URL.decodeQueryString(Window.Location.getHash())) + String location = Window.Location.createUrlBuilder() + .setHash(URL + .decodeQueryString(Window.Location.getHash())) .buildString(); currentFragment = newFragment; @@ -221,7 +220,7 @@ public class VUI extends SimplePanel implements ResizeHandler, /** * Called when the window or parent div might have been resized. - * + * * This immediately checks the sizes of the window and the parent div (if * monitoring it) and triggers layout recalculation if they have changed. */ @@ -232,15 +231,15 @@ public class VUI extends SimplePanel implements ResizeHandler, /** * Called when the window or parent div might have been resized. - * + * * This immediately checks the sizes of the window and the parent div (if * monitoring it) and triggers layout recalculation if they have changed. - * + * * @param newWindowWidth * The new width of the window * @param newWindowHeight * The new height of the window - * + * * @deprecated use {@link #performSizeCheck()} */ @Deprecated @@ -293,7 +292,8 @@ public class VUI extends SimplePanel implements ResizeHandler, * should shrink as the content's size is fixed and would thus not * automatically shrink.) */ - VConsole.log("Running layout functions due to window or parent resize"); + VConsole.log( + "Running layout functions due to window or parent resize"); // update size to avoid (most) redundant re-layout passes // there can still be an extra layout recalculation if webkit @@ -328,7 +328,7 @@ public class VUI extends SimplePanel implements ResizeHandler, * Returns true if the body is NOT generated, i.e if someone else has made * the page that we're running in. Otherwise we're in charge of the whole * page. - * + * * @return true if we're running embedded */ public boolean isEmbedded() { @@ -339,7 +339,7 @@ public class VUI extends SimplePanel implements ResizeHandler, /** * Returns true if the size of the parent should be checked periodically and * the application should react to its changes. - * + * * @return true if size of parent should be tracked */ protected boolean isMonitoringParentSize() { @@ -349,7 +349,7 @@ public class VUI extends SimplePanel implements ResizeHandler, /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.logical.shared.ResizeHandler#onResize(com.google * .gwt.event.logical.shared.ResizeEvent) @@ -362,7 +362,7 @@ public class VUI extends SimplePanel implements ResizeHandler, /** * Called when a resize event is received. - * + * * This may trigger a lazy refresh or perform the size check immediately * depending on the browser used and whether the server side requests * resizes to be lazy. @@ -373,7 +373,7 @@ public class VUI extends SimplePanel implements ResizeHandler, * problems with scrollbars. Firefox 3 might also produce some extra * events. We postpone both the re-layouting and the server side event * for a while to deal with these issues. - * + * * We may also postpone these events to avoid slowness when resizing the * browser window. Constantly recalculating the layout causes the resize * operation to be really slow with complex layouts. @@ -481,10 +481,10 @@ public class VUI extends SimplePanel implements ResizeHandler, /** * Allows to store the currently focused Element. - * + * * Current use case is to store the focus when a Window is opened. Does * currently handle only a single value. Needs to be extended for #12158 - * + * * @param focusedElement */ public void storeFocus() { @@ -493,10 +493,10 @@ public class VUI extends SimplePanel implements ResizeHandler, /** * Restores the previously stored focus Element. - * + * * Current use case is to restore the focus when a Window is closed. Does * currently handle only a single value. Needs to be extended for #12158 - * + * * @return the lastFocusElementBeforeDialogOpened */ public void focusStoredElement() { diff --git a/client/src/main/java/com/vaadin/client/ui/VUnknownComponent.java b/client/src/main/java/com/vaadin/client/ui/VUnknownComponent.java index 89907854de..cd1fd57727 100644 --- a/client/src/main/java/com/vaadin/client/ui/VUnknownComponent.java +++ b/client/src/main/java/com/vaadin/client/ui/VUnknownComponent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/VUpload.java b/client/src/main/java/com/vaadin/client/ui/VUpload.java index 2800acccf9..18766b32c0 100644 --- a/client/src/main/java/com/vaadin/client/ui/VUpload.java +++ b/client/src/main/java/com/vaadin/client/ui/VUpload.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -44,10 +44,10 @@ import com.vaadin.client.ui.upload.UploadIFrameOnloadStrategy; import com.vaadin.shared.ui.upload.UploadServerRpc; /** - * + * * Note, we are not using GWT FormPanel as we want to listen submitcomplete * events even though the upload component is already detached. - * + * */ public class VUpload extends SimplePanel { @@ -250,8 +250,9 @@ public class VUpload extends SimplePanel { } VConsole.log("VUpload:Submit complete"); ((UploadConnector) ConnectorMap.get(client) - .getConnector(VUpload.this)).getRpcProxy( - UploadServerRpc.class).poll(); + .getConnector(VUpload.this)) + .getRpcProxy(UploadServerRpc.class) + .poll(); } rebuildPanel(); @@ -281,7 +282,7 @@ public class VUpload extends SimplePanel { /* * Visit server a moment after upload has started to see possible * changes from UploadStarted event. Will be cleared on complete. - * + * * Must get the id here as the upload can finish before the timer * expires and in that case nextUploadId has been updated and is * wrong. @@ -293,7 +294,8 @@ public class VUpload extends SimplePanel { // Only visit the server if the upload has not already // finished if (thisUploadId == nextUploadId) { - VConsole.log("Visiting server to see if upload started event changed UI."); + VConsole.log( + "Visiting server to see if upload started event changed UI."); client.updateVariable(paintableId, "pollForStart", thisUploadId, true); } diff --git a/client/src/main/java/com/vaadin/client/ui/VVerticalLayout.java b/client/src/main/java/com/vaadin/client/ui/VVerticalLayout.java index 00ef0fc719..ba01c5330a 100644 --- a/client/src/main/java/com/vaadin/client/ui/VVerticalLayout.java +++ b/client/src/main/java/com/vaadin/client/ui/VVerticalLayout.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/VVideo.java b/client/src/main/java/com/vaadin/client/ui/VVideo.java index 023a7f9ee0..e7f86a51f4 100644 --- a/client/src/main/java/com/vaadin/client/ui/VVideo.java +++ b/client/src/main/java/com/vaadin/client/ui/VVideo.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -39,7 +39,7 @@ public class VVideo extends VMediaBase { /** * Registers a listener that updates the dimensions of the widget when the * video metadata has been loaded. - * + * * @param el */ private native void updateDimensionsWhenMetadataLoaded(Element el) @@ -53,7 +53,7 @@ public class VVideo extends VMediaBase { /** * Updates the dimensions of the widget. - * + * * @param w * @param h */ diff --git a/client/src/main/java/com/vaadin/client/ui/VWindow.java b/client/src/main/java/com/vaadin/client/ui/VWindow.java index de465f6c1f..008ea4ef83 100644 --- a/client/src/main/java/com/vaadin/client/ui/VWindow.java +++ b/client/src/main/java/com/vaadin/client/ui/VWindow.java @@ -73,7 +73,7 @@ import com.vaadin.shared.ui.window.WindowRole; /** * "Sub window" component. - * + * * @author Vaadin Ltd */ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, @@ -136,10 +136,14 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, /** For internal use only. May be removed or replaced in the future. */ public ShortcutActionHandler shortcutHandler; - /** Last known positionx read from UIDL or updated to application connection */ + /** + * Last known positionx read from UIDL or updated to application connection + */ private int uidlPositionX = -1; - /** Last known positiony read from UIDL or updated to application connection */ + /** + * Last known positiony read from UIDL or updated to application connection + */ private int uidlPositionY = -1; /** For internal use only. May be removed or replaced in the future. */ @@ -233,7 +237,7 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, /* * Stores the element that has focus in the application UI when the * window is opened, so it can be restored when the window closes. - * + * * This is currently implemented for the case when one non-modal window * can be open at the same time, and the focus is not changed while the * window is open. @@ -267,7 +271,7 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, /* * Restores the previously stored focused element. - * + * * When the focus was changed outside the window while the window was * open, the originally stored element is restored. */ @@ -309,7 +313,7 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, /** * Returns true if this window is the topmost VWindow - * + * * @return */ private boolean isActive() { @@ -334,8 +338,8 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, final int order = windowOrder.size(); setWindowOrder(order); windowOrder.add(this); - setPopupPosition(order * STACKING_OFFSET_PIXELS, order - * STACKING_OFFSET_PIXELS); + setPopupPosition(order * STACKING_OFFSET_PIXELS, + order * STACKING_OFFSET_PIXELS); } @@ -374,11 +378,12 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, footer = DOM.createDiv(); DOM.setElementProperty(footer, "className", CLASSNAME + "-footer"); resizeBox = DOM.createDiv(); - DOM.setElementProperty(resizeBox, "className", CLASSNAME + "-resizebox"); + DOM.setElementProperty(resizeBox, "className", + CLASSNAME + "-resizebox"); closeBox = DOM.createDiv(); maximizeRestoreBox = DOM.createDiv(); - DOM.setElementProperty(maximizeRestoreBox, "className", CLASSNAME - + "-maximizebox"); + DOM.setElementProperty(maximizeRestoreBox, "className", + CLASSNAME + "-maximizebox"); DOM.setElementAttribute(maximizeRestoreBox, "tabindex", "0"); DOM.setElementProperty(closeBox, "className", CLASSNAME + "-closebox"); DOM.setElementAttribute(closeBox, "tabindex", "0"); @@ -460,7 +465,7 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, * is prevented. *

    * This message is not visible on the screen. - * + * * @param topMessage * String provided when the user navigates with Shift-Tab keys to * the top of the window @@ -475,7 +480,7 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, * key is prevented. *

    * This message is not visible on the screen. - * + * * @param bottomMessage * String provided when the user navigates with the Tab key to * the bottom of the window @@ -488,7 +493,7 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, * Gets the message that is provided to users of assistive devices when the * user reaches the top of the window when leaving a window with the tab key * is prevented. - * + * * @return the top message */ public String getTabStopTopAssistiveText() { @@ -499,7 +504,7 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, * Gets the message that is provided to users of assistive devices when the * user reaches the bottom of the window when leaving a window with the tab * key is prevented. - * + * * @return the bottom message */ public String getTabStopBottomAssistiveText() { @@ -580,8 +585,8 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, super.setVisible(visible); } - if (visible - && BrowserInfo.get().requiresPositionAbsoluteOverflowAutoFix()) { + if (visible && BrowserInfo.get() + .requiresPositionAbsoluteOverflowAutoFix()) { /* * Shake up the DOM a bit to make the window shed unnecessary @@ -618,7 +623,7 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, /** * Sets the closable state of the window. Additionally hides/shows the close * button according to the new state. - * + * * @param closable * true if the window can be closed by the user */ @@ -629,8 +634,8 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, this.closable = closable; if (closable) { - DOM.setElementProperty(closeBox, "className", CLASSNAME - + "-closebox"); + DOM.setElementProperty(closeBox, "className", + CLASSNAME + "-closebox"); } else { DOM.setElementProperty(closeBox, "className", CLASSNAME @@ -644,7 +649,7 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, * Returns the closable state of the sub window. If the sub window is * closable a decoration (typically an X) is shown to the user. By clicking * on the X the user can close the window. - * + * * @return true if the sub window is closable */ protected boolean isClosable() { @@ -676,7 +681,7 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, * correctly if clicking on the "close" button in the window header but * closing the window from a button for example in the window will fail. * Symptom described in #10776 - * + * * The problematic part is that for the focus to be returned correctly * an input element needs to be focused in the root panel. Focusing some * other element apparently won't work. @@ -737,8 +742,8 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, } private void showModalityCurtain() { - getModalityCurtain().getStyle().setZIndex( - windowOrder.indexOf(this) + Z_INDEX); + getModalityCurtain().getStyle() + .setZIndex(windowOrder.indexOf(this) + Z_INDEX); if (isShowing()) { getOverlayContainer().insertBefore(getModalityCurtain(), @@ -826,11 +831,11 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, resizable = resizability; if (resizability) { DOM.setElementProperty(footer, "className", CLASSNAME + "-footer"); - DOM.setElementProperty(resizeBox, "className", CLASSNAME - + "-resizebox"); + DOM.setElementProperty(resizeBox, "className", + CLASSNAME + "-resizebox"); } else { - DOM.setElementProperty(footer, "className", CLASSNAME + "-footer " - + CLASSNAME + "-footer-noresize"); + DOM.setElementProperty(footer, "className", + CLASSNAME + "-footer " + CLASSNAME + "-footer-noresize"); DOM.setElementProperty(resizeBox, "className", CLASSNAME + "-resizebox " + CLASSNAME + "-resizebox-disabled"); } @@ -896,9 +901,8 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, } // Provide information to assistive device users that a sub window was // opened - String prefix = "" - + assistivePrefix + ""; + String prefix = "" + assistivePrefix + ""; String postfix = "" + assistivePostfix + ""; @@ -915,7 +919,7 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, /** * Setter for the text for assistive devices the window caption is prefixed * with. - * + * * @param assistivePrefix * the assistivePrefix to set */ @@ -926,7 +930,7 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, /** * Getter for the text for assistive devices the window caption is prefixed * with. - * + * * @return the assistivePrefix */ public String getAssistivePrefix() { @@ -936,7 +940,7 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, /** * Setter for the text for assistive devices the window caption is postfixed * with. - * + * * @param assistivePostfix * the assistivePostfix to set */ @@ -947,7 +951,7 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, /** * Getter for the text for assistive devices the window caption is postfixed * with. - * + * * @return the assistivePostfix */ public String getAssistivePostfix() { @@ -1112,14 +1116,14 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, /** * TODO check if we need to support this with touch based devices. - * + * * Checks if the cursor was inside the browser content area when the event * happened. - * + * * @param event * The event to be checked * @return true, if the cursor is inside the browser content area - * + * * false, otherwise */ private boolean cursorInsideBrowserContentArea(Event event) { @@ -1185,8 +1189,8 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, public void updateContentsSize() { LayoutManager layoutManager = getLayoutManager(); - layoutManager.setNeedsMeasure(ConnectorMap.get(client).getConnector( - this)); + layoutManager + .setNeedsMeasure(ConnectorMap.get(client).getConnector(this)); layoutManager.layoutNow(); } @@ -1347,8 +1351,8 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, @Override public void onScroll(ScrollEvent event) { - client.updateVariable(id, "scrollTop", - contentPanel.getScrollPosition(), false); + client.updateVariable(id, "scrollTop", contentPanel.getScrollPosition(), + false); client.updateVariable(id, "scrollLeft", contentPanel.getHorizontalScrollPosition(), false); @@ -1356,8 +1360,7 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, @Override public void onKeyDown(KeyDownEvent event) { - if (vaadinModality - && event.getNativeKeyCode() == KeyCodes.KEY_BACKSPACE + if (vaadinModality && event.getNativeKeyCode() == KeyCodes.KEY_BACKSPACE && !isFocusedElementEditable()) { event.preventDefault(); } @@ -1414,7 +1417,7 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, * assistive devices when it is opened. *

    * When the provided array is empty, an existing description is removed. - * + * * @param connectors * with the connectors of the widgets to use as description */ @@ -1423,8 +1426,8 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, assistiveConnectors = connectors; if (connectors.length == 0) { - Roles.getDialogRole().removeAriaDescribedbyProperty( - getElement()); + Roles.getDialogRole() + .removeAriaDescribedbyProperty(getElement()); } else { Id[] ids = new Id[connectors.length]; for (int index = 0; index < connectors.length; index++) { @@ -1452,7 +1455,7 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, * Gets the connectors that are used as assistive description. Text * contained in these connectors will be read by assistive devices when the * window is opened. - * + * * @return list of previously set connectors */ public List getAssistiveDescription() { @@ -1461,14 +1464,14 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, /** * Sets the WAI-ARIA role the window. - * + * * This role defines how an assistive device handles a window. Available - * roles are alertdialog and dialog (@see Roles + * roles are alertdialog and dialog (@see + * Roles * Model). - * + * * The default role is dialog. - * + * * @param role * WAI-ARIA role to set for the window */ @@ -1487,7 +1490,7 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, * The value of the parameter doTabStop is stored and used for non-modal * windows. For modal windows, the handlers are always registered, while * preserving the stored value. - * + * * @param doTabStop * true to prevent leaving the window, false to allow leaving the * window for non modal windows @@ -1504,9 +1507,9 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, /** * Adds a Handler for when user moves the window. - * + * * @since 7.1.9 - * + * * @return {@link HandlerRegistration} used to remove the handler */ public HandlerRegistration addMoveHandler(WindowMoveHandler handler) { diff --git a/client/src/main/java/com/vaadin/client/ui/absolutelayout/AbsoluteLayoutConnector.java b/client/src/main/java/com/vaadin/client/ui/absolutelayout/AbsoluteLayoutConnector.java index 19b66fb72f..477d59289e 100644 --- a/client/src/main/java/com/vaadin/client/ui/absolutelayout/AbsoluteLayoutConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/absolutelayout/AbsoluteLayoutConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -40,8 +40,8 @@ import com.vaadin.ui.AbsoluteLayout; * counterpart {@link VAbsoluteLayout} */ @Connect(AbsoluteLayout.class) -public class AbsoluteLayoutConnector extends - AbstractComponentContainerConnector implements DirectionalManagedLayout { +public class AbsoluteLayoutConnector extends AbstractComponentContainerConnector + implements DirectionalManagedLayout { private LayoutClickEventHandler clickEventHandler = new LayoutClickEventHandler( this) { @@ -77,7 +77,7 @@ public class AbsoluteLayoutConnector extends /** * Returns the deepest nested child component which contains "element". The * child component is also returned if "element" is part of its caption. - * + * * @param element * An element that is a nested sub element of the root element in * this layout @@ -96,13 +96,13 @@ public class AbsoluteLayoutConnector extends /** * Returns the deepest nested child component which contains "element". The * child component is also returned if "element" is part of its caption. - * + * * @param element * An element that is a nested sub element of the root element in * this layout * @return The Paintable which the element is a part of. Null if the element * belongs to the layout and not to a child. - * + * * @since 7.2 */ protected ComponentConnector getConnectorForElement(Element element) { @@ -111,7 +111,7 @@ public class AbsoluteLayoutConnector extends /* * (non-Javadoc) - * + * * @see com.vaadin.client.HasComponentsConnector#updateCaption(com.vaadin * .client.ComponentConnector) */ @@ -120,8 +120,8 @@ public class AbsoluteLayoutConnector extends VAbsoluteLayout absoluteLayoutWidget = getWidget(); boolean captionIsNeeded = VCaption.isNeeded(component.getState()); - VCaption caption = absoluteLayoutWidget.getWidgetCaption(component - .getWidget()); + VCaption caption = absoluteLayoutWidget + .getWidgetCaption(component.getWidget()); if (captionIsNeeded) { if (caption == null) { caption = new VCaption(component, getConnection()); @@ -135,7 +135,7 @@ public class AbsoluteLayoutConnector extends /* * (non-Javadoc) - * + * * @see com.vaadin.client.ui.AbstractComponentConnector#getWidget() */ @Override @@ -145,7 +145,7 @@ public class AbsoluteLayoutConnector extends /* * (non-Javadoc) - * + * * @see com.vaadin.client.ui.AbstractComponentConnector#getState() */ @Override @@ -155,7 +155,7 @@ public class AbsoluteLayoutConnector extends /* * (non-Javadoc) - * + * * @see * com.vaadin.client.ui.AbstractComponentConnector#onStateChanged(com.vaadin * .client.communication.StateChangeEvent) @@ -173,8 +173,8 @@ public class AbsoluteLayoutConnector extends } private void setChildWidgetPosition(ComponentConnector child) { - String position = getState().connectorToCssPosition.get(child - .getConnectorId()); + String position = getState().connectorToCssPosition + .get(child.getConnectorId()); if (position == null) { position = ""; } @@ -196,7 +196,7 @@ public class AbsoluteLayoutConnector extends * Adds default value of 0.0px for the given property if it's missing from * the position string altogether. If the property value is already set no * changes are needed. - * + * * @param position * original position styles * @param property @@ -204,7 +204,8 @@ public class AbsoluteLayoutConnector extends * @return updated position, or the original string if no updates were * needed */ - private String addDefaultPositionIfMissing(String position, String property) { + private String addDefaultPositionIfMissing(String position, + String property) { if (!position.contains(property)) { position = position + property + ":0.0px;"; } @@ -213,13 +214,14 @@ public class AbsoluteLayoutConnector extends /* * (non-Javadoc) - * + * * @see com.vaadin.client.ui.AbstractComponentContainerConnector# * onConnectorHierarchyChange * (com.vaadin.client.ConnectorHierarchyChangeEvent) */ @Override - public void onConnectorHierarchyChange(ConnectorHierarchyChangeEvent event) { + public void onConnectorHierarchyChange( + ConnectorHierarchyChangeEvent event) { for (ComponentConnector child : getChildComponents()) { if (!getWidget().contains(child.getWidget())) { getWidget().add(child.getWidget()); @@ -239,7 +241,7 @@ public class AbsoluteLayoutConnector extends /* * (non-Javadoc) - * + * * @see com.vaadin.client.DirectionalManagedLayout#layoutVertically() */ @Override @@ -255,7 +257,7 @@ public class AbsoluteLayoutConnector extends /* * (non-Javadoc) - * + * * @see com.vaadin.client.DirectionalManagedLayout#layoutHorizontally() */ @Override diff --git a/client/src/main/java/com/vaadin/client/ui/accordion/AccordionConnector.java b/client/src/main/java/com/vaadin/client/ui/accordion/AccordionConnector.java index 949e19071c..8e12af213c 100644 --- a/client/src/main/java/com/vaadin/client/ui/accordion/AccordionConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/accordion/AccordionConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -29,8 +29,8 @@ import com.vaadin.shared.ui.accordion.AccordionState; import com.vaadin.ui.Accordion; @Connect(Accordion.class) -public class AccordionConnector extends TabsheetBaseConnector implements - SimpleManagedLayout, MayScrollChildren { +public class AccordionConnector extends TabsheetBaseConnector + implements SimpleManagedLayout, MayScrollChildren { @Override protected void init() { @@ -47,8 +47,8 @@ public class AccordionConnector extends TabsheetBaseConnector implements * the content area is */ if (getWidget().selectedItemIndex >= 0) { - StackItem selectedItem = getWidget().getStackItem( - getWidget().selectedItemIndex); + StackItem selectedItem = getWidget() + .getStackItem(getWidget().selectedItemIndex); ComponentConnector contentConnector = getChildComponents().get(0); if (contentConnector != null) { @@ -106,12 +106,12 @@ public class AccordionConnector extends TabsheetBaseConnector implements usedPixels += item.getCaptionHeight(); } else { // This includes the captionNode borders - usedPixels += WidgetUtil.getRequiredHeight(item - .getElement()); + usedPixels += WidgetUtil + .getRequiredHeight(item.getElement()); } } - int rootElementInnerHeight = getLayoutManager().getInnerHeight( - getWidget().getElement()); + int rootElementInnerHeight = getLayoutManager() + .getInnerHeight(getWidget().getElement()); int spaceForOpenItem = rootElementInnerHeight - usedPixels; if (spaceForOpenItem < 0) { @@ -126,7 +126,7 @@ public class AccordionConnector extends TabsheetBaseConnector implements /* * (non-Javadoc) - * + * * @see com.vaadin.client.ConnectorHierarchyChangeEvent. * ConnectorHierarchyChangeHandler * #onConnectorHierarchyChange(com.vaadin.client diff --git a/client/src/main/java/com/vaadin/client/ui/aria/AriaHelper.java b/client/src/main/java/com/vaadin/client/ui/aria/AriaHelper.java index bf93901a33..7b8c248130 100644 --- a/client/src/main/java/com/vaadin/client/ui/aria/AriaHelper.java +++ b/client/src/main/java/com/vaadin/client/ui/aria/AriaHelper.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -32,7 +32,7 @@ public class AriaHelper { /** * Binds a caption (label in HTML speak) to the form element as required by * WAI-ARIA specification. - * + * * @param widget * Widget, that should be bound to the caption * @param captionElements @@ -47,8 +47,8 @@ public class AriaHelper { ((HandlesAriaCaption) widget).bindAriaCaption(null); } else { ensureHasId(captionElement); - ((HandlesAriaCaption) widget).bindAriaCaption(DOM - .asOld(captionElement)); + ((HandlesAriaCaption) widget) + .bindAriaCaption(DOM.asOld(captionElement)); } } else if (captionElement != null) { // Handle the default case @@ -66,7 +66,7 @@ public class AriaHelper { /** * Removes a binding to a caption added with bindCaption() from the provided * Widget. - * + * * @param widget * Widget, that was bound to a caption before */ @@ -78,7 +78,7 @@ public class AriaHelper { /** * Handles the required actions depending of the input Widget being required * or not. - * + * * @param widget * Widget, typically an input Widget like TextField * @param required @@ -97,7 +97,7 @@ public class AriaHelper { /** * Handles the required actions depending of the input element being * required or not. - * + * * @param element * Element, typically from an input Widget like TextField * @param required @@ -114,7 +114,7 @@ public class AriaHelper { /** * Handles the required actions depending of the input Widget contains * unaccepted input. - * + * * @param widget * Widget, typically an input Widget like TextField * @param invalid @@ -133,7 +133,7 @@ public class AriaHelper { /** * Handles the required actions depending of the input element contains * unaccepted input. - * + * * @param element * Element, typically an input Widget like TextField * @param invalid @@ -151,7 +151,7 @@ public class AriaHelper { /** * Makes sure that the provided element has an id attribute. Adds a new * unique id if not. - * + * * @param element * Element to check * @return String with the id of the element @@ -169,14 +169,15 @@ public class AriaHelper { /** * Allows to move an element out of the visible area of the browser window. - * + * * This makes it possible to have additional information for an assistive * device, that is not in the way for visual users. - * + * * @param element * Element to move out of sight - * @param boolean assistiveOnly true when element should only be visible for - * assistive devices, false to make the element visible for all + * @param boolean + * assistiveOnly true when element should only be visible for + * assistive devices, false to make the element visible for all */ public static void setVisibleForAssistiveDevicesOnly(Element element, boolean assistiveOnly) { diff --git a/client/src/main/java/com/vaadin/client/ui/aria/HandlesAriaCaption.java b/client/src/main/java/com/vaadin/client/ui/aria/HandlesAriaCaption.java index 369edb7d69..4f704b8c09 100644 --- a/client/src/main/java/com/vaadin/client/ui/aria/HandlesAriaCaption.java +++ b/client/src/main/java/com/vaadin/client/ui/aria/HandlesAriaCaption.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -26,10 +26,10 @@ public interface HandlesAriaCaption { /** * Called to bind the provided caption (label in HTML speak) element to the * main input element of the Widget. - * + * * Binding should be removed from the main input field when captionElement * is null. - * + * * @param captionElement * Element of the caption */ diff --git a/client/src/main/java/com/vaadin/client/ui/aria/HandlesAriaInvalid.java b/client/src/main/java/com/vaadin/client/ui/aria/HandlesAriaInvalid.java index 296e455dcd..3866c68e5e 100644 --- a/client/src/main/java/com/vaadin/client/ui/aria/HandlesAriaInvalid.java +++ b/client/src/main/java/com/vaadin/client/ui/aria/HandlesAriaInvalid.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -24,7 +24,7 @@ package com.vaadin.client.ui.aria; public interface HandlesAriaInvalid { /** * Called to set the element, typically an input element, as invalid. - * + * * @param invalid * boolean, true when the element should be marked invalid, false * otherwise diff --git a/client/src/main/java/com/vaadin/client/ui/aria/HandlesAriaRequired.java b/client/src/main/java/com/vaadin/client/ui/aria/HandlesAriaRequired.java index 95ebd7fb9a..da04d9974a 100644 --- a/client/src/main/java/com/vaadin/client/ui/aria/HandlesAriaRequired.java +++ b/client/src/main/java/com/vaadin/client/ui/aria/HandlesAriaRequired.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -24,7 +24,7 @@ package com.vaadin.client.ui.aria; public interface HandlesAriaRequired { /** * Called to set the element, typically an input element, as required. - * + * * @param required * boolean true when the element needs to be set as required */ diff --git a/client/src/main/java/com/vaadin/client/ui/audio/AudioConnector.java b/client/src/main/java/com/vaadin/client/ui/audio/AudioConnector.java index a451d117f2..108a57eca5 100644 --- a/client/src/main/java/com/vaadin/client/ui/audio/AudioConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/audio/AudioConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/browserframe/BrowserFrameConnector.java b/client/src/main/java/com/vaadin/client/ui/browserframe/BrowserFrameConnector.java index 95d64b61d0..998d822428 100644 --- a/client/src/main/java/com/vaadin/client/ui/browserframe/BrowserFrameConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/browserframe/BrowserFrameConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/button/ButtonConnector.java b/client/src/main/java/com/vaadin/client/ui/button/ButtonConnector.java index 2c2006e19b..0bd403edff 100644 --- a/client/src/main/java/com/vaadin/client/ui/button/ButtonConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/button/ButtonConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -34,8 +34,8 @@ import com.vaadin.shared.ui.button.ButtonState; import com.vaadin.ui.Button; @Connect(value = Button.class, loadStyle = LoadStyle.EAGER) -public class ButtonConnector extends AbstractComponentConnector implements - ClickHandler { +public class ButtonConnector extends AbstractComponentConnector + implements ClickHandler { @Override public boolean delegateCaptionHandling() { @@ -123,8 +123,8 @@ public class ButtonConnector extends AbstractComponentConnector implements // Add mouse details MouseEventDetails details = MouseEventDetailsBuilder - .buildMouseEventDetails(event.getNativeEvent(), getWidget() - .getElement()); + .buildMouseEventDetails(event.getNativeEvent(), + getWidget().getElement()); getRpcProxy(ButtonServerRpc.class).click(details); } diff --git a/client/src/main/java/com/vaadin/client/ui/calendar/CalendarConnector.java b/client/src/main/java/com/vaadin/client/ui/calendar/CalendarConnector.java index 58cc31a580..04c6943edc 100644 --- a/client/src/main/java/com/vaadin/client/ui/calendar/CalendarConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/calendar/CalendarConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -77,13 +77,13 @@ import com.vaadin.ui.Calendar; /** * Handles communication between Calendar on the server side and * {@link VCalendar} on the client side. - * + * * @since 7.1 * @author Vaadin Ltd. */ @Connect(value = Calendar.class, loadStyle = LoadStyle.LAZY) -public class CalendarConnector extends AbstractComponentConnector implements - ActionOwner, SimpleManagedLayout, Paintable { +public class CalendarConnector extends AbstractComponentConnector + implements ActionOwner, SimpleManagedLayout, Paintable { private CalendarServerRpc rpc = RpcProxy.create(CalendarServerRpc.class, this); @@ -94,7 +94,7 @@ public class CalendarConnector extends AbstractComponentConnector implements private static final String DROPHANDLER_ACCEPT_CRITERIA_PAINT_TAG = "-ac"; /** - * + * */ public CalendarConnector() { @@ -184,8 +184,8 @@ public class CalendarConnector extends AbstractComponentConnector implements StringBuilder sb = new StringBuilder(); sb.append(DateUtil.formatClientSideDate(event.getStart())); sb.append("-"); - sb.append(DateUtil.formatClientSideTime(event - .getStartTime())); + sb.append(DateUtil + .formatClientSideTime(event.getStartTime())); rpc.eventMove(event.getIndex(), sb.toString()); } } @@ -196,19 +196,20 @@ public class CalendarConnector extends AbstractComponentConnector implements if (hasEventListener(CalendarEventId.EVENTRESIZE)) { StringBuilder buffer = new StringBuilder(); - buffer.append(DateUtil.formatClientSideDate(event - .getStart())); + buffer.append( + DateUtil.formatClientSideDate(event.getStart())); buffer.append("-"); - buffer.append(DateUtil.formatClientSideTime(event - .getStartTime())); + buffer.append(DateUtil + .formatClientSideTime(event.getStartTime())); String newStartDate = buffer.toString(); buffer = new StringBuilder(); - buffer.append(DateUtil.formatClientSideDate(event.getEnd())); + buffer.append( + DateUtil.formatClientSideDate(event.getEnd())); buffer.append("-"); - buffer.append(DateUtil.formatClientSideTime(event - .getEndTime())); + buffer.append( + DateUtil.formatClientSideTime(event.getEndTime())); String newEndDate = buffer.toString(); @@ -233,7 +234,8 @@ public class CalendarConnector extends AbstractComponentConnector implements }); getWidget().setListener(new MouseEventListener() { @Override - public void contextMenu(ContextMenuEvent event, final Widget widget) { + public void contextMenu(ContextMenuEvent event, + final Widget widget) { final NativeEvent ne = event.getNativeEvent(); int left = ne.getClientX(); int top = ne.getClientY(); @@ -259,15 +261,15 @@ public class CalendarConnector extends AbstractComponentConnector implements */ SimpleDayCell cell = (SimpleDayCell) widget; Date start = new Date(cell.getDate().getYear(), - cell.getDate().getMonth(), cell.getDate() - .getDate(), 0, 0, 0); + cell.getDate().getMonth(), + cell.getDate().getDate(), 0, 0, 0); - Date end = new Date(cell.getDate().getYear(), cell - .getDate().getMonth(), cell.getDate() - .getDate(), 23, 59, 59); + Date end = new Date(cell.getDate().getYear(), + cell.getDate().getMonth(), + cell.getDate().getDate(), 23, 59, 59); - return CalendarConnector.this.getActionsBetween( - start, end); + return CalendarConnector.this + .getActionsBetween(start, end); } else if (widget instanceof MonthEventLabel) { MonthEventLabel mel = (MonthEventLabel) widget; @@ -285,9 +287,8 @@ public class CalendarConnector extends AbstractComponentConnector implements * Week and Day view */ DateCell cell = (DateCell) widget; - int slotIndex = DOM.getChildIndex( - cell.getElement(), (Element) ne - .getEventTarget().cast()); + int slotIndex = DOM.getChildIndex(cell.getElement(), + (Element) ne.getEventTarget().cast()); DateCellSlot slot = cell.getSlot(slotIndex); return CalendarConnector.this.getActionsBetween( slot.getFrom(), slot.getTo()); @@ -327,8 +328,10 @@ public class CalendarConnector extends AbstractComponentConnector implements VCalendar widget = getWidget(); // Enable or disable the forward and backward navigation buttons - widget.setForwardNavigationEnabled(hasEventListener(CalendarEventId.FORWARD)); - widget.setBackwardNavigationEnabled(hasEventListener(CalendarEventId.BACKWARD)); + widget.setForwardNavigationEnabled( + hasEventListener(CalendarEventId.FORWARD)); + widget.setBackwardNavigationEnabled( + hasEventListener(CalendarEventId.BACKWARD)); widget.set24HFormat(state.format24H); widget.setDayNames(state.dayNames); @@ -340,10 +343,12 @@ public class CalendarConnector extends AbstractComponentConnector implements widget.setReadOnly(state.readOnly); widget.setDisabled(!state.enabled); - widget.setRangeSelectAllowed(hasEventListener(CalendarEventId.RANGESELECT)); + widget.setRangeSelectAllowed( + hasEventListener(CalendarEventId.RANGESELECT)); widget.setRangeMoveAllowed(hasEventListener(CalendarEventId.EVENTMOVE)); widget.setEventMoveAllowed(hasEventListener(CalendarEventId.EVENTMOVE)); - widget.setEventResizeAllowed(hasEventListener(CalendarEventId.EVENTRESIZE)); + widget.setEventResizeAllowed( + hasEventListener(CalendarEventId.EVENTRESIZE)); widget.setEventCaptionAsHtml(state.eventCaptionAsHtml); @@ -373,10 +378,10 @@ public class CalendarConnector extends AbstractComponentConnector implements /* * (non-Javadoc) - * - * @see - * com.vaadin.terminal.gwt.client.Paintable#updateFromUIDL(com.vaadin.terminal - * .gwt.client.UIDL, com.vaadin.terminal.gwt.client.ApplicationConnection) + * + * @see com.vaadin.terminal.gwt.client.Paintable#updateFromUIDL(com.vaadin. + * terminal .gwt.client.UIDL, + * com.vaadin.terminal.gwt.client.ApplicationConnection) */ @Override public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { @@ -385,9 +390,9 @@ public class CalendarConnector extends AbstractComponentConnector implements UIDL child = (UIDL) childIterator.next(); if (DROPHANDLER_ACCEPT_CRITERIA_PAINT_TAG.equals(child.getTag())) { if (getWidget().getDropHandler() == null) { - getWidget().setDropHandler( - showingMonthView() ? new CalendarMonthDropHandler( - this) : new CalendarWeekDropHandler(this)); + getWidget().setDropHandler(showingMonthView() + ? new CalendarMonthDropHandler(this) + : new CalendarWeekDropHandler(this)); } getWidget().getDropHandler().updateAcceptRules(child); } else { @@ -420,7 +425,8 @@ public class CalendarConnector extends AbstractComponentConnector implements } @Override - public TooltipInfo getTooltipInfo(com.google.gwt.dom.client.Element element) { + public TooltipInfo getTooltipInfo( + com.google.gwt.dom.client.Element element) { TooltipInfo tooltipInfo = null; Widget w = WidgetUtil.findWidget(element, null); if (w instanceof HasTooltipKey) { @@ -550,7 +556,7 @@ public class CalendarConnector extends AbstractComponentConnector implements /** * Get the original action ID that was passed in from the shared state - * + * * @since 7.1.2 * @param actionKey * the unique action key @@ -562,7 +568,7 @@ public class CalendarConnector extends AbstractComponentConnector implements /** * Get the text that is displayed for a context menu item - * + * * @param actionKey * The unique action key * @return @@ -573,7 +579,7 @@ public class CalendarConnector extends AbstractComponentConnector implements /** * Get the icon url for a context menu item - * + * * @param actionKey * The unique action key * @return @@ -584,7 +590,7 @@ public class CalendarConnector extends AbstractComponentConnector implements /** * Get the start date for an action item - * + * * @param actionKey * The unique action key * @return @@ -599,7 +605,7 @@ public class CalendarConnector extends AbstractComponentConnector implements /** * Get the end date for an action item - * + * * @param actionKey * The unique action key * @return @@ -639,7 +645,7 @@ public class CalendarConnector extends AbstractComponentConnector implements /* * (non-Javadoc) - * + * * @see com.vaadin.terminal.gwt.client.ui.ActionOwner#getPaintableId() */ @Override @@ -662,10 +668,10 @@ public class CalendarConnector extends AbstractComponentConnector implements calendarEvent.setStart(getWidget().getDateFormat().parse(dateFrom)); calendarEvent.setEnd(getWidget().getDateFormat().parse(dateTo)); calendarEvent.setFormat24h(format24h); - calendarEvent.setStartTime(getWidget().getDateTimeFormat().parse( - dateFrom + " " + timeFrom)); - calendarEvent.setEndTime(getWidget().getDateTimeFormat().parse( - dateTo + " " + timeTo)); + calendarEvent.setStartTime(getWidget().getDateTimeFormat() + .parse(dateFrom + " " + timeFrom)); + calendarEvent.setEndTime(getWidget().getDateTimeFormat() + .parse(dateTo + " " + timeTo)); calendarEvent.setStyleName(event.styleName); calendarEvent.setIndex(event.index); list.add(calendarEvent); diff --git a/client/src/main/java/com/vaadin/client/ui/calendar/VCalendarAction.java b/client/src/main/java/com/vaadin/client/ui/calendar/VCalendarAction.java index 470ee3cf1a..70ecce18b6 100644 --- a/client/src/main/java/com/vaadin/client/ui/calendar/VCalendarAction.java +++ b/client/src/main/java/com/vaadin/client/ui/calendar/VCalendarAction.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,7 +25,7 @@ import com.vaadin.shared.ui.calendar.DateConstants; /** * Action performed by the calendar - * + * * @since 7.1 * @author Vaadin Ltd. */ @@ -45,7 +45,7 @@ public class VCalendarAction extends Action { .getFormat(DateConstants.ACTION_DATE_FORMAT_PATTERN); /** - * + * * @param owner */ public VCalendarAction(CalendarConnector owner) { @@ -54,7 +54,7 @@ public class VCalendarAction extends Action { /** * Constructor - * + * * @param owner * The owner who trigger this kinds of events * @param rpc @@ -71,7 +71,7 @@ public class VCalendarAction extends Action { /* * (non-Javadoc) - * + * * @see com.vaadin.terminal.gwt.client.ui.Action#execute() */ @Override @@ -91,7 +91,7 @@ public class VCalendarAction extends Action { /** * Get the date and time when the action starts - * + * * @return */ public Date getActionStartDate() { @@ -100,7 +100,7 @@ public class VCalendarAction extends Action { /** * Set the date when the actions start - * + * * @param actionStartDate * The date and time when the action starts */ @@ -110,7 +110,7 @@ public class VCalendarAction extends Action { /** * Get the date and time when the action ends - * + * * @return */ public Date getActionEndDate() { @@ -119,7 +119,7 @@ public class VCalendarAction extends Action { /** * Set the date and time when the action ends - * + * * @param actionEndDate * The date and time when the action ends */ diff --git a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/CalendarDay.java b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/CalendarDay.java index 0fceb6b6f9..7b25abdb38 100644 --- a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/CalendarDay.java +++ b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/CalendarDay.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -18,7 +18,7 @@ package com.vaadin.client.ui.calendar.schedule; /** * Utility class used to represent a day when updating views. Only used * internally. - * + * * @since 7.1 * @author Vaadin Ltd. */ diff --git a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/CalendarEvent.java b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/CalendarEvent.java index 5630db2415..21088e92e6 100644 --- a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/CalendarEvent.java +++ b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/CalendarEvent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -22,7 +22,7 @@ import com.vaadin.shared.ui.calendar.DateConstants; /** * A client side implementation of a calendar event - * + * * @since 7.1 * @author Vaadin Ltd. */ @@ -88,7 +88,7 @@ public class CalendarEvent { /** * Returns the start time of the event - * + * * @return Time embedded in the {@link Date} object */ public Date getStartTime() { @@ -97,7 +97,7 @@ public class CalendarEvent { /** * Set the start time of the event - * + * * @param startTime * The time of the event. Use the time fields in the {@link Date} * object @@ -108,7 +108,7 @@ public class CalendarEvent { /** * Get the end time of the event - * + * * @return Time embedded in the {@link Date} object */ public Date getEndTime() { @@ -117,7 +117,7 @@ public class CalendarEvent { /** * Set the end time of the event - * + * * @param endTime * Time embedded in the {@link Date} object */ @@ -127,7 +127,7 @@ public class CalendarEvent { /** * Get the (server side) index of the event - * + * * @return */ public int getIndex() { @@ -136,7 +136,7 @@ public class CalendarEvent { /** * Get the index of the slot where the event in rendered - * + * * @return */ public int getSlotIndex() { @@ -145,7 +145,7 @@ public class CalendarEvent { /** * Set the index of the slot where the event in rendered - * + * * @param index * The index of the slot */ @@ -155,7 +155,7 @@ public class CalendarEvent { /** * Set the (server side) index of the event - * + * * @param index * The index */ @@ -166,7 +166,7 @@ public class CalendarEvent { /** * Get the caption of the event. The caption is the text displayed in the * calendar on the event. - * + * * @return */ public String getCaption() { @@ -176,7 +176,7 @@ public class CalendarEvent { /** * Set the caption of the event. The caption is the text displayed in the * calendar on the event. - * + * * @param caption * The visible caption of the event */ @@ -187,7 +187,7 @@ public class CalendarEvent { /** * Get the description of the event. The description is the text displayed * when hoovering over the event with the mouse - * + * * @return */ public String getDescription() { @@ -197,7 +197,7 @@ public class CalendarEvent { /** * Set the description of the event. The description is the text displayed * when hoovering over the event with the mouse - * + * * @param description */ public void setDescription(String description) { @@ -206,7 +206,7 @@ public class CalendarEvent { /** * Does the event use the 24h time format - * + * * @param format24h * True if it uses the 24h format, false if it uses the 12h time * format @@ -217,7 +217,7 @@ public class CalendarEvent { /** * Is the event an all day event. - * + * * @param allDay * True if the event should be rendered all day */ @@ -227,7 +227,7 @@ public class CalendarEvent { /** * Is the event an all day event. - * + * * @return */ public boolean isAllDay() { @@ -236,7 +236,7 @@ public class CalendarEvent { /** * Get the time as a formatted string - * + * * @return */ public String getTimeAsText() { @@ -249,7 +249,7 @@ public class CalendarEvent { /** * Get the amount of milliseconds between the start and end of the event - * + * * @return */ public long getRangeInMilliseconds() { @@ -258,7 +258,7 @@ public class CalendarEvent { /** * Get the amount of minutes between the start and end of the event - * + * * @return */ public long getRangeInMinutes() { @@ -268,7 +268,7 @@ public class CalendarEvent { /** * Get the amount of minutes for the event on a specific day. This is useful * if the event spans several days. - * + * * @param targetDay * The date to check * @return @@ -282,10 +282,10 @@ public class CalendarEvent { if (targetDay.compareTo(getStart()) == 0) { // for first day rangeInMinutesForDay = DateConstants.DAYINMINUTES - (getStartTime().getTime() - getStart().getTime()) - / DateConstants.MINUTEINMILLIS; + / DateConstants.MINUTEINMILLIS; } else if (targetDay.compareTo(getEnd()) == 0) { // for last day - rangeInMinutesForDay = (getEndTime().getTime() - getEnd() - .getTime()) / DateConstants.MINUTEINMILLIS; + rangeInMinutesForDay = (getEndTime().getTime() + - getEnd().getTime()) / DateConstants.MINUTEINMILLIS; } else { // for in-between days rangeInMinutesForDay = DateConstants.DAYINMINUTES; } @@ -297,7 +297,7 @@ public class CalendarEvent { /** * Does the event span several days - * + * * @return */ @SuppressWarnings("deprecation") @@ -306,7 +306,8 @@ public class CalendarEvent { // if difference between start and end times is more than day - of // course it is not one day, but several days - if (getEndTime().getTime() - getStartTime().getTime() > DateConstants.DAYINMILLIS) { + if (getEndTime().getTime() + - getStartTime().getTime() > DateConstants.DAYINMILLIS) { isSeveralDays = true; } else { // if difference <= day -> there can be different cases if (getStart().compareTo(getEnd()) != 0 diff --git a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/DateCell.java b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/DateCell.java index 39d516b694..83017713d9 100644 --- a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/DateCell.java +++ b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/DateCell.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -45,9 +45,8 @@ import com.google.gwt.user.client.Event; import com.google.gwt.user.client.ui.Widget; import com.vaadin.client.WidgetUtil; -public class DateCell extends FocusableComplexPanel implements - MouseDownHandler, MouseMoveHandler, MouseUpHandler, KeyDownHandler, - ContextMenuHandler { +public class DateCell extends FocusableComplexPanel implements MouseDownHandler, + MouseMoveHandler, MouseUpHandler, KeyDownHandler, ContextMenuHandler { private static final String DRAGEMPHASISSTYLE = " dragemphasis"; private Date date; private int width; @@ -111,8 +110,8 @@ public class DateCell extends FocusableComplexPanel implements firstHour = weekgrid.getFirstHour(); lastHour = weekgrid.getLastHour(); numberOfSlots = (lastHour - firstHour + 1) * 2; - long slotTime = Math.round(((lastHour - firstHour + 1) * 3600000.0) - / numberOfSlots); + long slotTime = Math.round( + ((lastHour - firstHour + 1) * 3600000.0) / numberOfSlots); slotElements = new Element[numberOfSlots]; slotElementHeights = new int[numberOfSlots]; @@ -176,7 +175,8 @@ public class DateCell extends FocusableComplexPanel implements } } - throw new IllegalArgumentException("Element not found in this DateCell"); + throw new IllegalArgumentException( + "Element not found in this DateCell"); } public DateCellSlot getSlot(int index) { @@ -326,8 +326,8 @@ public class DateCell extends FocusableComplexPanel implements startingSlotHeight = height / numberOfSlots; for (int i = 0; i < slotElements.length; i++) { - slotElements[i].getStyle() - .setHeight(slotElementHeights[i], Unit.PX); + slotElements[i].getStyle().setHeight(slotElementHeights[i], + Unit.PX); } updateEventCellsHeight(); @@ -352,9 +352,10 @@ public class DateCell extends FocusableComplexPanel implements d.setMoveWidth(width); int freeSpaceCol = findFreeColumnSpaceOnLeft( - new WeekGridMinuteTimeRange(d.getCalendarEvent() - .getStartTime(), d.getCalendarEvent() - .getEndTime()), order, columns); + new WeekGridMinuteTimeRange( + d.getCalendarEvent().getStartTime(), + d.getCalendarEvent().getEndTime()), + order, columns); if (freeSpaceCol >= 0) { col = freeSpaceCol; columns.put(eventIndex, col); @@ -378,10 +379,8 @@ public class DateCell extends FocusableComplexPanel implements int eventWidth = (width / colCount); for (Integer index : g.getItems()) { DateCellDayEvent d = (DateCellDayEvent) getWidget(index); - d.getElement() - .getStyle() - .setMarginLeft((eventWidth * columns.get(index)), - Unit.PX); + d.getElement().getStyle().setMarginLeft( + (eventWidth * columns.get(index)), Unit.PX); d.setWidth(eventWidth + "px"); d.setSlotHeightInPX(getSlotHeight()); } @@ -404,9 +403,9 @@ public class DateCell extends FocusableComplexPanel implements } DateCellDayEvent d = (DateCellDayEvent) getWidget(eventIndex); - WeekGridMinuteTimeRange nextRange = new WeekGridMinuteTimeRange(d - .getCalendarEvent().getStartTime(), d.getCalendarEvent() - .getEndTime()); + WeekGridMinuteTimeRange nextRange = new WeekGridMinuteTimeRange( + d.getCalendarEvent().getStartTime(), + d.getCalendarEvent().getEndTime()); if (WeekGridMinuteTimeRange.doesOverlap(dateRange, nextRange)) { skipIndex = col; @@ -442,7 +441,7 @@ public class DateCell extends FocusableComplexPanel implements /** * Returns all overlapping DayEvent indexes in the Group. Including the * target. - * + * * @param targetIndex * Index of DayEvent in the current DateCell widget. * @return Group that contains all Overlapping DayEvent indexes @@ -453,8 +452,8 @@ public class DateCell extends FocusableComplexPanel implements int count = getWidgetCount(); DateCellDayEvent target = (DateCellDayEvent) getWidget(targetIndex); WeekGridMinuteTimeRange targetRange = new WeekGridMinuteTimeRange( - target.getCalendarEvent().getStartTime(), target - .getCalendarEvent().getEndTime()); + target.getCalendarEvent().getStartTime(), + target.getCalendarEvent().getEndTime()); Date groupStart = targetRange.getStart(); Date groupEnd = targetRange.getEnd(); @@ -464,9 +463,9 @@ public class DateCell extends FocusableComplexPanel implements } DateCellDayEvent d = (DateCellDayEvent) getWidget(i); - WeekGridMinuteTimeRange nextRange = new WeekGridMinuteTimeRange(d - .getCalendarEvent().getStartTime(), d.getCalendarEvent() - .getEndTime()); + WeekGridMinuteTimeRange nextRange = new WeekGridMinuteTimeRange( + d.getCalendarEvent().getStartTime(), + d.getCalendarEvent().getEndTime()); if (WeekGridMinuteTimeRange.doesOverlap(targetRange, nextRange)) { g.add(i); @@ -547,8 +546,8 @@ public class DateCell extends FocusableComplexPanel implements events.add(dayEvent.getCalendarEvent()); index = 0; - for (CalendarEvent e : weekgrid.getCalendar().sortEventsByDuration( - events)) { + for (CalendarEvent e : weekgrid.getCalendar() + .sortEventsByDuration(events)) { if (e.equals(dayEvent.getCalendarEvent())) { break; } @@ -562,10 +561,10 @@ public class DateCell extends FocusableComplexPanel implements } /** - * + * * @param event * @return - * + * * This method is not necessary in the long run.. Or here can be * various types of implementations.. */ @@ -584,7 +583,8 @@ public class DateCell extends FocusableComplexPanel implements int eventStartHours = eventStart.getHours(); int eventEndHours = eventEnd.getHours(); - display = !(eventEndHours < firstHour || eventStartHours > lastHour); + display = !(eventEndHours < firstHour + || eventStartHours > lastHour); } return display; } @@ -642,8 +642,8 @@ public class DateCell extends FocusableComplexPanel implements // and then the end for (int i = 0; i < nodes.getLength(); i++) { Element element = (Element) nodes.getItem(i); - boolean isRangeElement = element.getClassName().contains( - "v-daterange"); + boolean isRangeElement = element.getClassName() + .contains("v-daterange"); if (isRangeElement && slotStart == -1) { slotStart = i; @@ -666,10 +666,8 @@ public class DateCell extends FocusableComplexPanel implements + (currentDate.getMonth() + 1) + "-" + currentDate.getDate(); if (weekgrid.getCalendar().getRangeSelectListener() != null) { - weekgrid.getCalendar() - .getRangeSelectListener() - .rangeSelected( - yr + ":" + startMinutes + ":" + endMinutes); + weekgrid.getCalendar().getRangeSelectListener().rangeSelected( + yr + ":" + startMinutes + ":" + endMinutes); } eventRangeStart = -1; } else { @@ -792,7 +790,8 @@ public class DateCell extends FocusableComplexPanel implements * {@link #addEmphasisStyle(Element)} instead */ @Deprecated - public void addEmphasisStyle(com.google.gwt.user.client.Element elementOver) { + public void addEmphasisStyle( + com.google.gwt.user.client.Element elementOver) { String originalStylename = getStyleName(elementOver); setStyleName(elementOver, originalStylename + DRAGEMPHASISSTYLE); } @@ -812,10 +811,8 @@ public class DateCell extends FocusableComplexPanel implements public void removeEmphasisStyle( com.google.gwt.user.client.Element elementOver) { String originalStylename = getStyleName(elementOver); - setStyleName( - elementOver, - originalStylename.substring(0, originalStylename.length() - - DRAGEMPHASISSTYLE.length())); + setStyleName(elementOver, originalStylename.substring(0, + originalStylename.length() - DRAGEMPHASISSTYLE.length())); } /** @@ -830,8 +827,8 @@ public class DateCell extends FocusableComplexPanel implements if (weekgrid.getCalendar().getMouseEventListener() != null) { event.preventDefault(); event.stopPropagation(); - weekgrid.getCalendar().getMouseEventListener() - .contextMenu(event, DateCell.this); + weekgrid.getCalendar().getMouseEventListener().contextMenu(event, + DateCell.this); } } diff --git a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/DateCellContainer.java b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/DateCellContainer.java index 26f5951987..82cd26dd3c 100644 --- a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/DateCellContainer.java +++ b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/DateCellContainer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -28,11 +28,11 @@ import com.vaadin.client.ui.VCalendar; /** * Internally used class by the Calendar - * + * * since 7.1 */ -public class DateCellContainer extends FlowPanel implements MouseDownHandler, - MouseUpHandler { +public class DateCellContainer extends FlowPanel + implements MouseDownHandler, MouseUpHandler { private Date date; diff --git a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/DateCellDayEvent.java b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/DateCellDayEvent.java index 55834397d3..7d938e42be 100644 --- a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/DateCellDayEvent.java +++ b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/DateCellDayEvent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -46,12 +46,12 @@ import com.vaadin.shared.ui.calendar.DateConstants; /** * Internally used by the calendar - * + * * @since 7.1 */ -public class DateCellDayEvent extends FocusableHTML implements - MouseDownHandler, MouseUpHandler, MouseMoveHandler, KeyDownHandler, - ContextMenuHandler, HasTooltipKey { +public class DateCellDayEvent extends FocusableHTML + implements MouseDownHandler, MouseUpHandler, MouseMoveHandler, + KeyDownHandler, ContextMenuHandler, HasTooltipKey { private final DateCell dateCell; private Element caption = null; @@ -215,20 +215,24 @@ public class DateCellDayEvent extends FocusableHTML implements public void onMouseDown(MouseDownEvent event) { startX = event.getClientX(); startY = event.getClientY(); - if (isDisabled() || event.getNativeButton() != NativeEvent.BUTTON_LEFT) { + if (isDisabled() + || event.getNativeButton() != NativeEvent.BUTTON_LEFT) { return; } clickTarget = Element.as(event.getNativeEvent().getEventTarget()); mouseMoveCanceled = false; - if (weekGrid.getCalendar().isEventMoveAllowed() || clickTargetsResize()) { + if (weekGrid.getCalendar().isEventMoveAllowed() + || clickTargetsResize()) { moveRegistration = addMouseMoveHandler(this); setFocus(true); try { - startYrelative = (int) ((double) event.getRelativeY(caption) % slotHeight); - startXrelative = (event.getRelativeX(weekGrid.getElement()) - weekGrid.timebar - .getOffsetWidth()) % getDateCellWidth(); + startYrelative = (int) ((double) event.getRelativeY(caption) + % slotHeight); + startXrelative = (event.getRelativeX(weekGrid.getElement()) + - weekGrid.timebar.getOffsetWidth()) + % getDateCellWidth(); } catch (Exception e) { GWT.log("Exception calculating relative start position", e); } @@ -282,7 +286,8 @@ public class DateCellDayEvent extends FocusableHTML implements s.setZIndex(1); if (!clickTargetsResize()) { // check if mouse has moved over threshold of 3 pixels - boolean mouseMoved = (xDiff < -3 || xDiff > 3 || yDiff < -3 || yDiff > 3); + boolean mouseMoved = (xDiff < -3 || xDiff > 3 || yDiff < -3 + || yDiff > 3); if (!weekGrid.getCalendar().isDisabledOrReadOnly() && mouseMoved) { // Event Move: @@ -296,7 +301,8 @@ public class DateCellDayEvent extends FocusableHTML implements Element e = Element.as(et); if (e == caption || e == eventContent || e.getParentElement() == caption) { - if (weekGrid.getCalendar().getEventClickListener() != null) { + if (weekGrid.getCalendar() + .getEventClickListener() != null) { weekGrid.getCalendar().getEventClickListener() .eventClick(calendarEvent); } @@ -543,7 +549,7 @@ public class DateCellDayEvent extends FocusableHTML implements /** * Check if the given time range is too small for events - * + * * @param start * @param end * @return @@ -561,7 +567,7 @@ public class DateCellDayEvent extends FocusableHTML implements /** * Build the string for sending resize events to server - * + * * @param event * @return */ @@ -608,7 +614,8 @@ public class DateCellDayEvent extends FocusableHTML implements */ private boolean clickTargetsResize() { return weekGrid.getCalendar().isEventResizeAllowed() - && (clickTarget == topResizeBar || clickTarget == bottomResizeBar); + && (clickTarget == topResizeBar + || clickTarget == bottomResizeBar); } private void addGlobalResizeStyle() { diff --git a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/DateCellGroup.java b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/DateCellGroup.java index f4ef22f4ca..12fb07ea81 100644 --- a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/DateCellGroup.java +++ b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/DateCellGroup.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,7 +21,7 @@ import java.util.List; /** * Internally used by the calendar - * + * * @since 7.1 */ public class DateCellGroup { diff --git a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/DateUtil.java b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/DateUtil.java index 165bbefefc..2e7952ae18 100644 --- a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/DateUtil.java +++ b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/DateUtil.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -22,7 +22,7 @@ import com.vaadin.shared.ui.calendar.DateConstants; /** * Utility class for {@link Date} operations - * + * * @since 7.1 * @author Vaadin Ltd. */ @@ -30,7 +30,7 @@ public class DateUtil { /** * Checks if dates are same day without checking datetimes. - * + * * @param date1 * @param date2 * @return @@ -48,7 +48,7 @@ public class DateUtil { /** * @param date * the date to format - * + * * @return given Date as String, for communicating to server-side */ public static String formatClientSideDate(Date date) { diff --git a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/DayToolbar.java b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/DayToolbar.java index 10ed5bb3f9..24ad02d132 100644 --- a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/DayToolbar.java +++ b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/DayToolbar.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -27,10 +27,10 @@ import com.google.gwt.user.client.ui.Widget; import com.vaadin.client.ui.VCalendar; /** - * + * * @since 7.1 * @author Vaadin Ltd. - * + * */ public class DayToolbar extends HorizontalPanel implements ClickHandler { private int width = 0; @@ -73,8 +73,8 @@ public class DayToolbar extends HorizontalPanel implements ClickHandler { setCellHorizontalAlignment(nextLabel, ALIGN_RIGHT); int cellw = width / (count - 2); if (cellw > 0) { - int[] cellWidths = VCalendar - .distributeSize(width, count - 2, 0); + int[] cellWidths = VCalendar.distributeSize(width, count - 2, + 0); for (int i = 1; i < count - 1; i++) { Widget widget = getWidget(i); // if (remain > 0) { diff --git a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/FocusableComplexPanel.java b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/FocusableComplexPanel.java index cdad83744e..3a632bcc7f 100644 --- a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/FocusableComplexPanel.java +++ b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/FocusableComplexPanel.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -34,13 +34,13 @@ import com.vaadin.client.Focusable; /** * A ComplexPanel that can be focused - * + * * @since 7.1 * @author Vaadin Ltd. - * + * */ -public class FocusableComplexPanel extends ComplexPanel implements - HasFocusHandlers, HasBlurHandlers, HasKeyDownHandlers, +public class FocusableComplexPanel extends ComplexPanel + implements HasFocusHandlers, HasBlurHandlers, HasKeyDownHandlers, HasKeyPressHandlers, Focusable { protected void makeFocusable() { @@ -51,7 +51,7 @@ public class FocusableComplexPanel extends ComplexPanel implements /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.HasFocusHandlers#addFocusHandler(com. * google.gwt.event.dom.client.FocusHandler) @@ -63,7 +63,7 @@ public class FocusableComplexPanel extends ComplexPanel implements /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.HasBlurHandlers#addBlurHandler(com.google * .gwt.event.dom.client.BlurHandler) @@ -75,7 +75,7 @@ public class FocusableComplexPanel extends ComplexPanel implements /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.HasKeyDownHandlers#addKeyDownHandler( * com.google.gwt.event.dom.client.KeyDownHandler) @@ -87,7 +87,7 @@ public class FocusableComplexPanel extends ComplexPanel implements /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.HasKeyPressHandlers#addKeyPressHandler * (com.google.gwt.event.dom.client.KeyPressHandler) @@ -99,7 +99,7 @@ public class FocusableComplexPanel extends ComplexPanel implements /** * Sets/Removes the keyboard focus to the panel. - * + * * @param focus * If set to true then the focus is moved to the panel, if set to * false the focus is removed diff --git a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/FocusableGrid.java b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/FocusableGrid.java index 1369392656..e022c41a8b 100644 --- a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/FocusableGrid.java +++ b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/FocusableGrid.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -34,10 +34,10 @@ import com.vaadin.client.Focusable; /** * A Grid that can be focused - * + * * @since 7.1 * @author Vaadin Ltd. - * + * */ public class FocusableGrid extends Grid implements HasFocusHandlers, HasBlurHandlers, HasKeyDownHandlers, HasKeyPressHandlers, Focusable { @@ -63,7 +63,7 @@ public class FocusableGrid extends Grid implements HasFocusHandlers, /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.HasFocusHandlers#addFocusHandler(com. * google.gwt.event.dom.client.FocusHandler) @@ -75,7 +75,7 @@ public class FocusableGrid extends Grid implements HasFocusHandlers, /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.HasBlurHandlers#addBlurHandler(com.google * .gwt.event.dom.client.BlurHandler) @@ -87,7 +87,7 @@ public class FocusableGrid extends Grid implements HasFocusHandlers, /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.HasKeyDownHandlers#addKeyDownHandler( * com.google.gwt.event.dom.client.KeyDownHandler) @@ -99,7 +99,7 @@ public class FocusableGrid extends Grid implements HasFocusHandlers, /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.HasKeyPressHandlers#addKeyPressHandler * (com.google.gwt.event.dom.client.KeyPressHandler) @@ -111,7 +111,7 @@ public class FocusableGrid extends Grid implements HasFocusHandlers, /** * Sets/Removes the keyboard focus to the panel. - * + * * @param focus * If set to true then the focus is moved to the panel, if set to * false the focus is removed diff --git a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/FocusableHTML.java b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/FocusableHTML.java index 0c6ddb3697..8ca7e83ffe 100644 --- a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/FocusableHTML.java +++ b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/FocusableHTML.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -34,10 +34,10 @@ import com.vaadin.client.Focusable; /** * A HTML widget that can be focused - * + * * @since 7.1 * @author Vaadin Ltd. - * + * */ public class FocusableHTML extends HTML implements HasFocusHandlers, HasBlurHandlers, HasKeyDownHandlers, HasKeyPressHandlers, Focusable { @@ -53,7 +53,7 @@ public class FocusableHTML extends HTML implements HasFocusHandlers, /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.HasFocusHandlers#addFocusHandler(com. * google.gwt.event.dom.client.FocusHandler) @@ -65,7 +65,7 @@ public class FocusableHTML extends HTML implements HasFocusHandlers, /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.HasBlurHandlers#addBlurHandler(com.google * .gwt.event.dom.client.BlurHandler) @@ -77,7 +77,7 @@ public class FocusableHTML extends HTML implements HasFocusHandlers, /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.HasKeyDownHandlers#addKeyDownHandler( * com.google.gwt.event.dom.client.KeyDownHandler) @@ -89,7 +89,7 @@ public class FocusableHTML extends HTML implements HasFocusHandlers, /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.HasKeyPressHandlers#addKeyPressHandler * (com.google.gwt.event.dom.client.KeyPressHandler) @@ -101,7 +101,7 @@ public class FocusableHTML extends HTML implements HasFocusHandlers, /** * Sets/Removes the keyboard focus to the panel. - * + * * @param focus * If set to true then the focus is moved to the panel, if set to * false the focus is removed diff --git a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/HasTooltipKey.java b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/HasTooltipKey.java index d04ec39527..29fc825d90 100644 --- a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/HasTooltipKey.java +++ b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/HasTooltipKey.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -17,16 +17,16 @@ package com.vaadin.client.ui.calendar.schedule; /** * For Calendar client-side internal use only. - * + * * @since 7.1 * @author Vaadin Ltd. - * + * */ public interface HasTooltipKey { /** * Gets the key associated for the Widget implementing this interface. This * key is used for getting a tooltip title identified by the key - * + * * @return the tooltip key */ Object getTooltipKey(); diff --git a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/MonthEventLabel.java b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/MonthEventLabel.java index 31e600c8f9..8ee9183192 100644 --- a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/MonthEventLabel.java +++ b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/MonthEventLabel.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,7 +25,7 @@ import com.vaadin.client.ui.VCalendar; /** * The label in a month cell - * + * * @since 7.1 */ public class MonthEventLabel extends HTML implements HasTooltipKey { @@ -63,7 +63,7 @@ public class MonthEventLabel extends HTML implements HasTooltipKey { /** * Set the time of the event label - * + * * @param date * The date object that specifies the time */ @@ -74,7 +74,7 @@ public class MonthEventLabel extends HTML implements HasTooltipKey { /** * Set the caption of the event label - * + * * @param caption * The caption string, can be HTML if * {@link VCalendar#isEventCaptionAsHtml()} is true @@ -113,7 +113,7 @@ public class MonthEventLabel extends HTML implements HasTooltipKey { /** * Set the (server side) index of the event - * + * * @param index * The integer index */ @@ -123,7 +123,7 @@ public class MonthEventLabel extends HTML implements HasTooltipKey { /** * Set the Calendar instance this label belongs to - * + * * @param calendar * The calendar instance */ @@ -133,7 +133,7 @@ public class MonthEventLabel extends HTML implements HasTooltipKey { /** * Is the event bound to a specific time - * + * * @return */ public boolean isTimeSpecificEvent() { @@ -142,7 +142,7 @@ public class MonthEventLabel extends HTML implements HasTooltipKey { /** * Is the event bound to a specific time - * + * * @param timeSpecificEvent * True if the event is bound to a time, false if it is only * bound to the day @@ -153,7 +153,7 @@ public class MonthEventLabel extends HTML implements HasTooltipKey { /* * (non-Javadoc) - * + * * @see com.google.gwt.user.client.ui.HTML#setHTML(java.lang.String) */ @Override diff --git a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/MonthGrid.java b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/MonthGrid.java index 52a81d0eb9..4bd03d5dc9 100644 --- a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/MonthGrid.java +++ b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/MonthGrid.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -24,10 +24,10 @@ import com.google.gwt.event.shared.HandlerRegistration; import com.vaadin.client.ui.VCalendar; /** - * + * * @since 7.1 * @author Vaadin Ltd. - * + * */ public class MonthGrid extends FocusableGrid implements KeyDownHandler { diff --git a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/SimpleDayCell.java b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/SimpleDayCell.java index 158241337b..0ec26cda58 100644 --- a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/SimpleDayCell.java +++ b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/SimpleDayCell.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -43,12 +43,12 @@ import com.vaadin.shared.ui.calendar.DateConstants; /** * A class representing a single cell within the calendar in month-view - * + * * @since 7.1 * @author Vaadin Ltd. */ -public class SimpleDayCell extends FocusableFlowPanel implements - MouseUpHandler, MouseDownHandler, MouseOverHandler, MouseMoveHandler { +public class SimpleDayCell extends FocusableFlowPanel implements MouseUpHandler, + MouseDownHandler, MouseOverHandler, MouseMoveHandler { private static int BOTTOMSPACERHEIGHT = -1; private static int EVENTHEIGHT = -1; @@ -221,9 +221,8 @@ public class SimpleDayCell extends FocusableFlowPanel implements } } - int remainingSpace = intHeight - - ((slots * EVENTHEIGHT) + BOTTOMSPACERHEIGHT + caption - .getOffsetHeight()); + int remainingSpace = intHeight - ((slots * EVENTHEIGHT) + + BOTTOMSPACERHEIGHT + caption.getOffsetHeight()); int newHeight = remainingSpace + BOTTOMSPACERHEIGHT; if (newHeight < 0) { newHeight = EVENTHEIGHT; @@ -344,8 +343,8 @@ public class SimpleDayCell extends FocusableFlowPanel implements public void setMonthNameVisible(boolean b) { monthNameVisible = b; int dateOfMonth = date.getDate(); - caption.setText(dateOfMonth + " " - + calendar.getMonthNames()[date.getMonth()]); + caption.setText( + dateOfMonth + " " + calendar.getMonthNames()[date.getMonth()]); } public HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler) { @@ -517,9 +516,11 @@ public class SimpleDayCell extends FocusableFlowPanel implements } // Check boundaries if (relativeY < 0 - || relativeY >= (calendar.getMonthGrid().getRowCount() * dateCellHeigth) + || relativeY >= (calendar.getMonthGrid().getRowCount() + * dateCellHeigth) || relativeX < 0 - || relativeX >= (calendar.getMonthGrid().getColumnCount() * dateCellWidth)) { + || relativeX >= (calendar.getMonthGrid().getColumnCount() + * dateCellWidth)) { return; } @@ -644,7 +645,8 @@ public class SimpleDayCell extends FocusableFlowPanel implements } } - public void updateDragPosition(MonthEventLabel w, int dayDiff, int weekDiff) { + public void updateDragPosition(MonthEventLabel w, int dayDiff, + int weekDiff) { // Draw event to its new position only when position has changed if (dayDiff == prevDayDiff && weekDiff == prevWeekDiff) { return; diff --git a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/SimpleDayToolbar.java b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/SimpleDayToolbar.java index 3133341542..234dc4fbc2 100644 --- a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/SimpleDayToolbar.java +++ b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/SimpleDayToolbar.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,10 +20,10 @@ import com.google.gwt.user.client.ui.Label; import com.google.gwt.user.client.ui.Widget; /** - * + * * @since 7.1.0 * @author Vaadin Ltd. - * + * */ public class SimpleDayToolbar extends HorizontalPanel { private int width = 0; diff --git a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/SimpleWeekToolbar.java b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/SimpleWeekToolbar.java index fc79163d3e..ed1807603a 100644 --- a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/SimpleWeekToolbar.java +++ b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/SimpleWeekToolbar.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,10 +21,10 @@ import com.google.gwt.user.client.ui.FlexTable; import com.vaadin.client.ui.VCalendar; /** - * + * * @since 7.1 * @author Vaadin Ltd. - * + * */ public class SimpleWeekToolbar extends FlexTable implements ClickHandler { private int height; @@ -102,8 +102,8 @@ public class SimpleWeekToolbar extends FlexTable implements ClickHandler { public void onClick(ClickEvent event) { WeekLabel wl = (WeekLabel) event.getSource(); if (calendar.getWeekClickListener() != null) { - calendar.getWeekClickListener().weekClick( - wl.getYear() + "w" + wl.getWeek()); + calendar.getWeekClickListener() + .weekClick(wl.getYear() + "w" + wl.getWeek()); } } } diff --git a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/WeekGrid.java b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/WeekGrid.java index aecaff1931..10fb77df92 100644 --- a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/WeekGrid.java +++ b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/WeekGrid.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -36,10 +36,10 @@ import com.vaadin.client.ui.VCalendar; import com.vaadin.shared.ui.calendar.DateConstants; /** - * + * * @since 7.1 * @author Vaadin Ltd. - * + * */ public class WeekGrid extends SimplePanel { @@ -165,8 +165,8 @@ public class WeekGrid extends SimplePanel { this.width = content.getOffsetWidth() - timebar.getOffsetWidth(); } else { - this.width = (width == -1) ? width : width - - timebar.getOffsetWidth(); + this.width = (width == -1) ? width + : width - timebar.getOffsetWidth(); if (isVerticalScrollable() && width != -1) { this.width = this.width - WidgetUtil.getNativeScrollbarSize(); @@ -219,12 +219,13 @@ public class WeekGrid extends SimplePanel { int count = content.getWidgetCount(); int datesWidth = width; if (datesWidth > 0 && count > 1) { - cellWidths = VCalendar - .distributeSize(datesWidth, count - 1, -1); + cellWidths = VCalendar.distributeSize(datesWidth, count - 1, + -1); for (int i = 1; i < count; i++) { DateCell dc = (DateCell) content.getWidget(i); - dc.setHorizontalSized(isHorizontalScrollable() || width < 0); + dc.setHorizontalSized( + isHorizontalScrollable() || width < 0); dc.setWidthPX(cellWidths[i - 1]); if (dc.isToday()) { dc.setTimeBarWidth(getOffsetWidth()); @@ -237,7 +238,8 @@ public class WeekGrid extends SimplePanel { if (count > 1) { for (int i = 1; i < count; i++) { DateCell dc = (DateCell) content.getWidget(i); - dc.setHorizontalSized(isHorizontalScrollable() || width < 0); + dc.setHorizontalSized( + isHorizontalScrollable() || width < 0); } } } @@ -269,8 +271,8 @@ public class WeekGrid extends SimplePanel { if (count > 1) { DateCell first = (DateCell) content.getWidget(1); dateCellBorder = first.getSlotBorder(); - int dateHeight = (first.getOffsetHeight() / first - .getNumberOfSlots()) - dateCellBorder; + int dateHeight = (first.getOffsetHeight() + / first.getNumberOfSlots()) - dateCellBorder; cellHeights = new int[48]; Arrays.fill(cellHeights, dateHeight); @@ -291,10 +293,8 @@ public class WeekGrid extends SimplePanel { Date dcDate = dc.getDate(); int comp = dcDate.compareTo(from); int comp2 = dcDate.compareTo(toTime); - if (comp >= 0 - && comp2 < 0 - || (comp == 0 && comp2 == 0 && VCalendar - .isZeroLengthMidnightEvent(e))) { + if (comp >= 0 && comp2 < 0 || (comp == 0 && comp2 == 0 + && VCalendar.isZeroLengthMidnightEvent(e))) { // Same event may be over two DateCells if event's date // range floats over one day. It can't float over two days, // because event which range is over 24 hours, will be handled @@ -322,8 +322,8 @@ public class WeekGrid extends SimplePanel { int shownHeightInMinutes = endHourInMinutes - firstHourInMinutes + DateConstants.HOURINMINUTES; - durationInMinutes = Math.min(durationInMinutes, shownHeightInMinutes - - startFromMinutes); + durationInMinutes = Math.min(durationInMinutes, + shownHeightInMinutes - startFromMinutes); // calculate full slots to event int slotsTillEvent = startFromMinutes / slotInMinutes; @@ -353,25 +353,29 @@ public class WeekGrid extends SimplePanel { // calculate slot overflow at start if (startOverFlowTime > 0 && currentSlot < cellHeights.length) { int lastSlotHeight = cellHeights[currentSlot] + dateCellBorder; - pixelLength += (int) (((double) lastSlotHeight / (double) slotInMinutes) * startOverFlowTime); + pixelLength += (int) (((double) lastSlotHeight + / (double) slotInMinutes) * startOverFlowTime); } // calculate length in full slots int lastFullSlot = currentSlot + durationInSlots; - for (; currentSlot < lastFullSlot && currentSlot < cellHeights.length; currentSlot++) { + for (; currentSlot < lastFullSlot + && currentSlot < cellHeights.length; currentSlot++) { pixelLength += cellHeights[currentSlot] + dateCellBorder; } // calculate overflow at end if (endOverFlowTime > 0 && currentSlot < cellHeights.length) { int lastSlotHeight = cellHeights[currentSlot] + dateCellBorder; - pixelLength += (int) (((double) lastSlotHeight / (double) slotInMinutes) * endOverFlowTime); + pixelLength += (int) (((double) lastSlotHeight + / (double) slotInMinutes) * endOverFlowTime); } // reduce possible underflow at end if (endOverFlowTime < 0) { int lastSlotHeight = cellHeights[currentSlot] + dateCellBorder; - pixelLength += (int) (((double) lastSlotHeight / (double) slotInMinutes) * endOverFlowTime); + pixelLength += (int) (((double) lastSlotHeight + / (double) slotInMinutes) * endOverFlowTime); } return pixelLength; @@ -410,8 +414,8 @@ public class WeekGrid extends SimplePanel { public void eventMoved(DateCellDayEvent dayEvent) { Style s = dayEvent.getElement().getStyle(); - int left = Integer.parseInt(s.getLeft().substring(0, - s.getLeft().length() - 2)); + int left = Integer + .parseInt(s.getLeft().substring(0, s.getLeft().length() - 2)); DateCell previousParent = (DateCell) dayEvent.getParent(); DateCell newParent = (DateCell) content .getWidget((left / getDateCellWidth()) + 1); @@ -490,7 +494,7 @@ public class WeekGrid extends SimplePanel { /** * Get width of the single date cell - * + * * @return Date cell width */ public int getDateCellWidth() { diff --git a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/WeekGridMinuteTimeRange.java b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/WeekGridMinuteTimeRange.java index 07bcc1e887..fbd616e5f3 100644 --- a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/WeekGridMinuteTimeRange.java +++ b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/WeekGridMinuteTimeRange.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -19,7 +19,7 @@ import java.util.Date; /** * Internally used by the calendar - * + * * @since 7.1 */ public class WeekGridMinuteTimeRange { @@ -29,7 +29,7 @@ public class WeekGridMinuteTimeRange { /** * Creates a Date time range between start and end date. Drops seconds from * the range. - * + * * @param start * Start time of the range * @param end diff --git a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/WeekLabel.java b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/WeekLabel.java index bb0cf5d1ea..1a4b0d3bf7 100644 --- a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/WeekLabel.java +++ b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/WeekLabel.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -19,7 +19,7 @@ import com.google.gwt.user.client.ui.Label; /** * A label in the {@link SimpleWeekToolbar} - * + * * @since 7.1 */ public class WeekLabel extends Label { diff --git a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/WeeklyLongEvents.java b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/WeeklyLongEvents.java index 9488c8835a..8299f28ea0 100644 --- a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/WeeklyLongEvents.java +++ b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/WeeklyLongEvents.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -22,10 +22,10 @@ import com.google.gwt.user.client.ui.HorizontalPanel; import com.vaadin.client.ui.VCalendar; /** - * + * * @since 7.1 * @author Vaadin Ltd. - * + * */ public class WeeklyLongEvents extends HorizontalPanel implements HasTooltipKey { @@ -78,8 +78,8 @@ public class WeeklyLongEvents extends HorizontalPanel implements HasTooltipKey { Date dcDate = dc.getDate(); int comp = dcDate.compareTo(from); int comp2 = dcDate.compareTo(to); - WeeklyLongEventsDateCell eventLabel = dc.getDateCell(calendarEvent - .getSlotIndex()); + WeeklyLongEventsDateCell eventLabel = dc + .getDateCell(calendarEvent.getSlotIndex()); eventLabel.setStylePrimaryName("v-calendar-event"); if (comp >= 0 && comp2 <= 0) { eventLabel.setEvent(calendarEvent); @@ -176,8 +176,8 @@ public class WeeklyLongEvents extends HorizontalPanel implements HasTooltipKey { dc.setWidth(cellWidth + "px"); } else { - dc.setWidth(calendar.getWeekGrid().getDateCellWidths()[i] - + "px"); + dc.setWidth( + calendar.getWeekGrid().getDateCellWidths()[i] + "px"); } } } diff --git a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/WeeklyLongEventsDateCell.java b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/WeeklyLongEventsDateCell.java index 7d3dc9b89a..a097ab2a6a 100644 --- a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/WeeklyLongEventsDateCell.java +++ b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/WeeklyLongEventsDateCell.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -22,7 +22,7 @@ import com.vaadin.client.ui.VCalendar; /** * Represents a cell used in {@link WeeklyLongEvents} - * + * * @since 7.1 */ public class WeeklyLongEventsDateCell extends HTML implements HasTooltipKey { diff --git a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/dd/CalendarDropHandler.java b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/dd/CalendarDropHandler.java index 92046f96ec..821370bbce 100644 --- a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/dd/CalendarDropHandler.java +++ b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/dd/CalendarDropHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,10 +21,10 @@ import com.vaadin.client.ui.dd.VAbstractDropHandler; /** * Abstract base class for calendar drop handlers. - * + * * @since 7.1 * @author Vaadin Ltd. - * + * */ public abstract class CalendarDropHandler extends VAbstractDropHandler { @@ -32,7 +32,7 @@ public abstract class CalendarDropHandler extends VAbstractDropHandler { /** * Constructor - * + * * @param connector * The connector of the calendar */ @@ -42,7 +42,7 @@ public abstract class CalendarDropHandler extends VAbstractDropHandler { /* * (non-Javadoc) - * + * * @see * com.vaadin.terminal.gwt.client.ui.dd.VAbstractDropHandler#getConnector() */ @@ -53,10 +53,9 @@ public abstract class CalendarDropHandler extends VAbstractDropHandler { /* * (non-Javadoc) - * - * @see - * com.vaadin.terminal.gwt.client.ui.dd.VDropHandler#getApplicationConnection - * () + * + * @see com.vaadin.terminal.gwt.client.ui.dd.VDropHandler# + * getApplicationConnection () */ @Override public ApplicationConnection getApplicationConnection() { diff --git a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/dd/CalendarMonthDropHandler.java b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/dd/CalendarMonthDropHandler.java index 39e08e9d70..26491d3d01 100644 --- a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/dd/CalendarMonthDropHandler.java +++ b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/dd/CalendarMonthDropHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -27,7 +27,7 @@ import com.vaadin.client.ui.dd.VDragEvent; * Handles DD when the monthly view is showing in the Calendar. In the monthly * view, drops are only allowed in the the day cells. Only the day index is * included in the drop details sent to the server. - * + * * @since 7.1 * @author Vaadin Ltd. */ @@ -42,7 +42,7 @@ public class CalendarMonthDropHandler extends CalendarDropHandler { /* * (non-Javadoc) - * + * * @see * com.vaadin.terminal.gwt.client.ui.dd.VAbstractDropHandler#dragAccepted * (com.vaadin.terminal.gwt.client.ui.dd.VDragEvent) @@ -77,7 +77,7 @@ public class CalendarMonthDropHandler extends CalendarDropHandler { /* * (non-Javadoc) - * + * * @see * com.vaadin.terminal.gwt.client.ui.dd.VAbstractDropHandler#dragOver(com * .vaadin.terminal.gwt.client.ui.dd.VDragEvent) @@ -96,7 +96,7 @@ public class CalendarMonthDropHandler extends CalendarDropHandler { /** * Checks if the one can perform a drop in a element - * + * * @param elementOver * The element to check * @return @@ -113,7 +113,7 @@ public class CalendarMonthDropHandler extends CalendarDropHandler { /* * (non-Javadoc) - * + * * @see * com.vaadin.terminal.gwt.client.ui.dd.VAbstractDropHandler#dragEnter(com * .vaadin.terminal.gwt.client.ui.dd.VDragEvent) @@ -125,7 +125,7 @@ public class CalendarMonthDropHandler extends CalendarDropHandler { /* * (non-Javadoc) - * + * * @see * com.vaadin.terminal.gwt.client.ui.dd.VAbstractDropHandler#drop(com.vaadin * .terminal.gwt.client.ui.dd.VDragEvent) @@ -145,7 +145,7 @@ public class CalendarMonthDropHandler extends CalendarDropHandler { /** * Updates the drop details sent to the server - * + * * @param drag * The drag event */ @@ -158,7 +158,7 @@ public class CalendarMonthDropHandler extends CalendarDropHandler { /* * (non-Javadoc) - * + * * @see * com.vaadin.terminal.gwt.client.ui.dd.VAbstractDropHandler#dragLeave(com * .vaadin.terminal.gwt.client.ui.dd.VDragEvent) diff --git a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/dd/CalendarWeekDropHandler.java b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/dd/CalendarWeekDropHandler.java index e0edf21e89..9032321118 100644 --- a/client/src/main/java/com/vaadin/client/ui/calendar/schedule/dd/CalendarWeekDropHandler.java +++ b/client/src/main/java/com/vaadin/client/ui/calendar/schedule/dd/CalendarWeekDropHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -28,7 +28,7 @@ import com.vaadin.client.ui.dd.VDragEvent; * Handles DD when the weekly view is showing in the Calendar. In the weekly * view, drops are only allowed in the the time slots for each day. The slot * index and the day index are included in the drop details sent to the server. - * + * * @since 7.1 * @author Vaadin Ltd. */ @@ -43,7 +43,7 @@ public class CalendarWeekDropHandler extends CalendarDropHandler { /* * (non-Javadoc) - * + * * @see * com.vaadin.terminal.gwt.client.ui.dd.VAbstractDropHandler#dragAccepted * (com.vaadin.terminal.gwt.client.ui.dd.VDragEvent) @@ -76,7 +76,7 @@ public class CalendarWeekDropHandler extends CalendarDropHandler { /* * (non-Javadoc) - * + * * @see * com.vaadin.terminal.gwt.client.ui.dd.VAbstractDropHandler#dragOver(com * .vaadin.terminal.gwt.client.ui.dd.VDragEvent) @@ -95,7 +95,7 @@ public class CalendarWeekDropHandler extends CalendarDropHandler { /** * Checks if the location is a valid drop location - * + * * @param elementOver * The element to check * @return @@ -121,12 +121,13 @@ public class CalendarWeekDropHandler extends CalendarDropHandler { return DOM.isOrHasChild(weekGridElement, elementOver) && !DOM.isOrHasChild(timeBarElement, elementOver) && todayBarElement != elementOver - && (WidgetUtil.findWidget(elementOver, DateCellDayEvent.class) == null); + && (WidgetUtil.findWidget(elementOver, + DateCellDayEvent.class) == null); } /* * (non-Javadoc) - * + * * @see * com.vaadin.terminal.gwt.client.ui.dd.VAbstractDropHandler#dragEnter(com * .vaadin.terminal.gwt.client.ui.dd.VDragEvent) @@ -138,7 +139,7 @@ public class CalendarWeekDropHandler extends CalendarDropHandler { /* * (non-Javadoc) - * + * * @see * com.vaadin.terminal.gwt.client.ui.dd.VAbstractDropHandler#drop(com.vaadin * .terminal.gwt.client.ui.dd.VDragEvent) @@ -158,7 +159,7 @@ public class CalendarWeekDropHandler extends CalendarDropHandler { /** * Update the drop details sent to the server - * + * * @param drag * The drag event */ @@ -173,7 +174,7 @@ public class CalendarWeekDropHandler extends CalendarDropHandler { /* * (non-Javadoc) - * + * * @see * com.vaadin.terminal.gwt.client.ui.dd.VAbstractDropHandler#dragLeave(com * .vaadin.terminal.gwt.client.ui.dd.VDragEvent) diff --git a/client/src/main/java/com/vaadin/client/ui/checkbox/CheckBoxConnector.java b/client/src/main/java/com/vaadin/client/ui/checkbox/CheckBoxConnector.java index 0dc9810c51..2e58124494 100644 --- a/client/src/main/java/com/vaadin/client/ui/checkbox/CheckBoxConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/checkbox/CheckBoxConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -37,8 +37,8 @@ import com.vaadin.shared.ui.checkbox.CheckBoxState; import com.vaadin.ui.CheckBox; @Connect(CheckBox.class) -public class CheckBoxConnector extends AbstractFieldConnector implements - ClickHandler { +public class CheckBoxConnector extends AbstractFieldConnector + implements ClickHandler { @Override public boolean delegateCaptionHandling() { @@ -76,8 +76,8 @@ public class CheckBoxConnector extends AbstractFieldConnector implements getWidget().errorIndicatorElement.getStyle().clearDisplay(); } } else if (getWidget().errorIndicatorElement != null) { - getWidget().errorIndicatorElement.getStyle().setDisplay( - Display.NONE); + getWidget().errorIndicatorElement.getStyle() + .setDisplay(Display.NONE); getWidget().setAriaInvalid(false); } @@ -130,8 +130,8 @@ public class CheckBoxConnector extends AbstractFieldConnector implements // Add mouse details MouseEventDetails details = MouseEventDetailsBuilder - .buildMouseEventDetails(event.getNativeEvent(), getWidget() - .getElement()); + .buildMouseEventDetails(event.getNativeEvent(), + getWidget().getElement()); getRpcProxy(CheckBoxServerRpc.class).setChecked(getState().checked, details); if (getState().immediate) { diff --git a/client/src/main/java/com/vaadin/client/ui/colorpicker/AbstractColorPickerConnector.java b/client/src/main/java/com/vaadin/client/ui/colorpicker/AbstractColorPickerConnector.java index cba2a667ca..53cf815323 100644 --- a/client/src/main/java/com/vaadin/client/ui/colorpicker/AbstractColorPickerConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/colorpicker/AbstractColorPickerConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -24,11 +24,11 @@ import com.vaadin.shared.ui.colorpicker.ColorPickerState; /** * An abstract class that defines default implementation for a color picker * connector. - * + * * @since 7.0.0 */ -public abstract class AbstractColorPickerConnector extends - AbstractComponentConnector implements ClickHandler { +public abstract class AbstractColorPickerConnector + extends AbstractComponentConnector implements ClickHandler { private static final String DEFAULT_WIDTH_STYLE = "v-default-caption-width"; @@ -49,9 +49,8 @@ public abstract class AbstractColorPickerConnector extends if (stateChangeEvent.hasPropertyChanged("color")) { refreshColor(); - if (getState().showDefaultCaption - && (getState().caption == null || "" - .equals(getState().caption))) { + if (getState().showDefaultCaption && (getState().caption == null + || "".equals(getState().caption))) { setCaption(getState().color); } @@ -75,12 +74,12 @@ public abstract class AbstractColorPickerConnector extends /** * Get caption for the color picker widget. - * + * * @return */ protected String getCaption() { - if (getState().showDefaultCaption - && (getState().caption == null || "".equals(getState().caption))) { + if (getState().showDefaultCaption && (getState().caption == null + || "".equals(getState().caption))) { return getState().color; } return getState().caption; @@ -101,7 +100,7 @@ public abstract class AbstractColorPickerConnector extends /** * Set caption of the color picker widget. - * + * * @param caption */ protected abstract void setCaption(String caption); diff --git a/client/src/main/java/com/vaadin/client/ui/colorpicker/ColorPickerAreaConnector.java b/client/src/main/java/com/vaadin/client/ui/colorpicker/ColorPickerAreaConnector.java index 355e705581..98b6c666ad 100644 --- a/client/src/main/java/com/vaadin/client/ui/colorpicker/ColorPickerAreaConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/colorpicker/ColorPickerAreaConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -30,14 +30,14 @@ import com.vaadin.ui.ColorPickerArea; * A class that defines an implementation for a color picker connector. Connects * the server side {@link com.vaadin.ui.ColorPickerArea} with the client side * counterpart {@link VColorPickerArea} - * + * * @since 7.0.0 */ @Connect(value = ColorPickerArea.class, loadStyle = LoadStyle.LAZY) public class ColorPickerAreaConnector extends AbstractColorPickerConnector { - private ColorPickerServerRpc rpc = RpcProxy.create( - ColorPickerServerRpc.class, this); + private ColorPickerServerRpc rpc = RpcProxy + .create(ColorPickerServerRpc.class, this); @Override protected Widget createWidget() { diff --git a/client/src/main/java/com/vaadin/client/ui/colorpicker/ColorPickerConnector.java b/client/src/main/java/com/vaadin/client/ui/colorpicker/ColorPickerConnector.java index 2f0dbd5ce7..9fc25a9e19 100644 --- a/client/src/main/java/com/vaadin/client/ui/colorpicker/ColorPickerConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/colorpicker/ColorPickerConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -29,14 +29,14 @@ import com.vaadin.ui.ColorPicker; * A class that defines default implementation for a color picker connector. * Connects the server side {@link com.vaadin.ui.ColorPicker} with the client * side counterpart {@link VColorPicker} - * + * * @since 7.0.0 */ @Connect(value = ColorPicker.class, loadStyle = LoadStyle.LAZY) public class ColorPickerConnector extends AbstractColorPickerConnector { - private ColorPickerServerRpc rpc = RpcProxy.create( - ColorPickerServerRpc.class, this); + private ColorPickerServerRpc rpc = RpcProxy + .create(ColorPickerServerRpc.class, this); @Override protected Widget createWidget() { diff --git a/client/src/main/java/com/vaadin/client/ui/colorpicker/ColorPickerGradientConnector.java b/client/src/main/java/com/vaadin/client/ui/colorpicker/ColorPickerGradientConnector.java index 223675f660..3cff8a4d0d 100644 --- a/client/src/main/java/com/vaadin/client/ui/colorpicker/ColorPickerGradientConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/colorpicker/ColorPickerGradientConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -33,15 +33,15 @@ import com.vaadin.ui.components.colorpicker.ColorPickerGradient; * connector. Connects the server side * {@link com.vaadin.ui.components.colorpicker.ColorPickerGradient} with the * client side counterpart {@link VColorPickerGradient} - * + * * @since 7.0.0 */ @Connect(value = ColorPickerGradient.class, loadStyle = LoadStyle.LAZY) public class ColorPickerGradientConnector extends AbstractComponentConnector implements MouseUpHandler { - private ColorPickerGradientServerRpc rpc = RpcProxy.create( - ColorPickerGradientServerRpc.class, this); + private ColorPickerGradientServerRpc rpc = RpcProxy + .create(ColorPickerGradientServerRpc.class, this); @Override protected Widget createWidget() { diff --git a/client/src/main/java/com/vaadin/client/ui/colorpicker/ColorPickerGridConnector.java b/client/src/main/java/com/vaadin/client/ui/colorpicker/ColorPickerGridConnector.java index dc3c3ca790..b13fe8fa0e 100644 --- a/client/src/main/java/com/vaadin/client/ui/colorpicker/ColorPickerGridConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/colorpicker/ColorPickerGridConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -33,15 +33,15 @@ import com.vaadin.ui.components.colorpicker.ColorPickerGrid; * connector. Connects the server side * {@link com.vaadin.ui.components.colorpicker.ColorPickerGrid} with the client * side counterpart {@link VColorPickerGrid} - * + * * @since 7.0.0 */ @Connect(value = ColorPickerGrid.class, loadStyle = LoadStyle.LAZY) public class ColorPickerGridConnector extends AbstractComponentConnector implements ClickHandler { - private ColorPickerGridServerRpc rpc = RpcProxy.create( - ColorPickerGridServerRpc.class, this); + private ColorPickerGridServerRpc rpc = RpcProxy + .create(ColorPickerGridServerRpc.class, this); @Override protected Widget createWidget() { diff --git a/client/src/main/java/com/vaadin/client/ui/colorpicker/VColorPickerGradient.java b/client/src/main/java/com/vaadin/client/ui/colorpicker/VColorPickerGradient.java index 70ced91da4..df93d485a6 100644 --- a/client/src/main/java/com/vaadin/client/ui/colorpicker/VColorPickerGradient.java +++ b/client/src/main/java/com/vaadin/client/ui/colorpicker/VColorPickerGradient.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -29,9 +29,9 @@ import com.vaadin.client.ui.SubPartAware; /** * Client side implementation for ColorPickerGradient. - * + * * @since 7.0.0 - * + * */ public class VColorPickerGradient extends FocusPanel implements MouseDownHandler, MouseUpHandler, MouseMoveHandler, SubPartAware { @@ -120,7 +120,7 @@ public class VColorPickerGradient extends FocusPanel implements /** * Sets the given css color as the background. - * + * * @param bgColor */ protected void setBGColor(String bgColor) { @@ -161,7 +161,7 @@ public class VColorPickerGradient extends FocusPanel implements /** * Sets the latest coordinates for pressed-down mouse cursor and updates the * cross elements. - * + * * @param x * @param y */ @@ -190,7 +190,8 @@ public class VColorPickerGradient extends FocusPanel implements } @Override - public com.google.gwt.user.client.Element getSubPartElement(String subPart) { + public com.google.gwt.user.client.Element getSubPartElement( + String subPart) { if (subPart.equals(CLICKLAYER_ID)) { return clicklayer.getElement(); } @@ -199,7 +200,8 @@ public class VColorPickerGradient extends FocusPanel implements } @Override - public String getSubPartName(com.google.gwt.user.client.Element subElement) { + public String getSubPartName( + com.google.gwt.user.client.Element subElement) { if (clicklayer.getElement().isOrHasChild(subElement)) { return CLICKLAYER_ID; } diff --git a/client/src/main/java/com/vaadin/client/ui/colorpicker/VColorPickerGrid.java b/client/src/main/java/com/vaadin/client/ui/colorpicker/VColorPickerGrid.java index c407bdc5ef..316bfce504 100644 --- a/client/src/main/java/com/vaadin/client/ui/colorpicker/VColorPickerGrid.java +++ b/client/src/main/java/com/vaadin/client/ui/colorpicker/VColorPickerGrid.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -26,12 +26,12 @@ import com.google.gwt.user.client.ui.HTMLTable.Cell; /** * Client side implementation for ColorPickerGrid. - * + * * @since 7.0.0 - * + * */ -public class VColorPickerGrid extends AbsolutePanel implements ClickHandler, - HasClickHandlers { +public class VColorPickerGrid extends AbsolutePanel + implements ClickHandler, HasClickHandlers { private int rows = 1; private int columns = 1; @@ -54,7 +54,7 @@ public class VColorPickerGrid extends AbsolutePanel implements ClickHandler, /** * Creates a grid according to the current row and column count information. - * + * * @return grid */ private Grid createGrid() { @@ -68,7 +68,7 @@ public class VColorPickerGrid extends AbsolutePanel implements ClickHandler, /** * Updates the row and column count and creates a new grid based on them. * The new grid replaces the old grid if one existed. - * + * * @param rowCount * @param columnCount */ @@ -83,7 +83,7 @@ public class VColorPickerGrid extends AbsolutePanel implements ClickHandler, * Updates the changed colors within the grid based on the given x- and * y-coordinates. Nothing happens if any of the parameters is null or the * parameter lengths don't match. - * + * * @param changedColor * @param changedX * @param changedY diff --git a/client/src/main/java/com/vaadin/client/ui/combobox/ComboBoxConnector.java b/client/src/main/java/com/vaadin/client/ui/combobox/ComboBoxConnector.java index 131485bc7b..7d025f96a6 100644 --- a/client/src/main/java/com/vaadin/client/ui/combobox/ComboBoxConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/combobox/ComboBoxConnector.java @@ -35,8 +35,8 @@ import com.vaadin.shared.ui.combobox.FilteringMode; import com.vaadin.ui.ComboBox; @Connect(ComboBox.class) -public class ComboBoxConnector extends AbstractFieldConnector implements - Paintable, SimpleManagedLayout { +public class ComboBoxConnector extends AbstractFieldConnector + implements Paintable, SimpleManagedLayout { // oldSuggestionTextMatchTheOldSelection is used to detect when it's safe to // update textbox text by a changed item caption. @@ -44,7 +44,7 @@ public class ComboBoxConnector extends AbstractFieldConnector implements /* * (non-Javadoc) - * + * * @see com.vaadin.client.Paintable#updateFromUIDL(com.vaadin.client.UIDL, * com.vaadin.client.ApplicationConnection) */ @@ -65,15 +65,16 @@ public class ComboBoxConnector extends AbstractFieldConnector implements // work without additional UIDL messages boolean noTextInput = uidl .hasAttribute(ComboBoxConstants.ATTR_NO_TEXT_INPUT) - && uidl.getBooleanAttribute(ComboBoxConstants.ATTR_NO_TEXT_INPUT); + && uidl.getBooleanAttribute( + ComboBoxConstants.ATTR_NO_TEXT_INPUT); getWidget().setTextInputEnabled(!noTextInput); // not a FocusWidget -> needs own tabindex handling getWidget().tb.setTabIndex(getState().tabIndex); if (uidl.hasAttribute("filteringmode")) { - getWidget().filteringmode = FilteringMode.valueOf(uidl - .getStringAttribute("filteringmode")); + getWidget().filteringmode = FilteringMode + .valueOf(uidl.getStringAttribute("filteringmode")); } getWidget().immediate = getState().immediate; @@ -284,16 +285,16 @@ public class ComboBoxConnector extends AbstractFieldConnector implements if (!getWidget().waitingForFilteringResponse || getWidget().popupOpenerClicked) { if (!suggestionKey.equals(getWidget().selectedOptionKey) - || suggestion.getReplacementString().equals( - getWidget().tb.getText()) + || suggestion.getReplacementString() + .equals(getWidget().tb.getText()) || oldSuggestionTextMatchTheOldSelection) { // Update text field if we've got a new // selection // Also update if we've got the same text to // retain old text selection behavior // OR if selected item caption is changed. - getWidget().setPromptingOff( - suggestion.getReplacementString()); + getWidget() + .setPromptingOff(suggestion.getReplacementString()); getWidget().selectedOptionKey = suggestionKey; } } @@ -306,8 +307,8 @@ public class ComboBoxConnector extends AbstractFieldConnector implements private boolean isWidgetsCurrentSelectionTextInTextBox() { return getWidget().currentSuggestion != null - && getWidget().currentSuggestion.getReplacementString().equals( - getWidget().tb.getText()); + && getWidget().currentSuggestion.getReplacementString() + .equals(getWidget().tb.getText()); } private void resetSelection() { @@ -329,13 +330,13 @@ public class ComboBoxConnector extends AbstractFieldConnector implements // just clear the input if the value has changed from something // else to null if (getWidget().selectedOptionKey != null - || (getWidget().allowNewItem && !getWidget().tb - .getValue().isEmpty())) { + || (getWidget().allowNewItem + && !getWidget().tb.getValue().isEmpty())) { boolean openedPopupWithNonScrollingMode = (getWidget().popupOpenerClicked && getWidget().getSelectedCaption() != null); if (!openedPopupWithNonScrollingMode) { - getWidget().tb.setValue(""); + getWidget().tb.setValue(""); } else { getWidget().tb .setValue(getWidget().getSelectedCaption()); diff --git a/client/src/main/java/com/vaadin/client/ui/csslayout/CssLayoutConnector.java b/client/src/main/java/com/vaadin/client/ui/csslayout/CssLayoutConnector.java index 1ec395280d..46df5c183d 100644 --- a/client/src/main/java/com/vaadin/client/ui/csslayout/CssLayoutConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/csslayout/CssLayoutConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -63,7 +63,7 @@ public class CssLayoutConnector extends AbstractLayoutConnector { /* * (non-Javadoc) - * + * * @see com.vaadin.client.ui.AbstractLayoutConnector#getState() */ @Override @@ -73,7 +73,7 @@ public class CssLayoutConnector extends AbstractLayoutConnector { /* * (non-Javadoc) - * + * * @see * com.vaadin.client.ui.AbstractComponentConnector#onStateChanged(com.vaadin * .client.communication.StateChangeEvent) @@ -105,15 +105,17 @@ public class CssLayoutConnector extends AbstractLayoutConnector { /* * (non-Javadoc) - * + * * @see com.vaadin.client.ui.AbstractComponentContainerConnector# * onConnectorHierarchyChange * (com.vaadin.client.ConnectorHierarchyChangeEvent) */ @Override - public void onConnectorHierarchyChange(ConnectorHierarchyChangeEvent event) { + public void onConnectorHierarchyChange( + ConnectorHierarchyChangeEvent event) { Profiler.enter("CssLayoutConnector.onConnectorHierarchyChange"); - Profiler.enter("CssLayoutConnector.onConnectorHierarchyChange add children"); + Profiler.enter( + "CssLayoutConnector.onConnectorHierarchyChange add children"); int index = 0; for (ComponentConnector child : getChildComponents()) { VCaption childCaption = childIdToCaption @@ -123,10 +125,12 @@ public class CssLayoutConnector extends AbstractLayoutConnector { } getWidget().addOrMove(child.getWidget(), index++); } - Profiler.leave("CssLayoutConnector.onConnectorHierarchyChange add children"); + Profiler.leave( + "CssLayoutConnector.onConnectorHierarchyChange add children"); // Detach old child widgets and possibly their caption - Profiler.enter("CssLayoutConnector.onConnectorHierarchyChange remove old children"); + Profiler.enter( + "CssLayoutConnector.onConnectorHierarchyChange remove old children"); for (ComponentConnector child : event.getOldChildren()) { if (child.getParent() == this) { // Skip current children @@ -139,13 +143,14 @@ public class CssLayoutConnector extends AbstractLayoutConnector { getWidget().remove(vCaption); } } - Profiler.leave("CssLayoutConnector.onConnectorHierarchyChange remove old children"); + Profiler.leave( + "CssLayoutConnector.onConnectorHierarchyChange remove old children"); Profiler.leave("CssLayoutConnector.onConnectorHierarchyChange"); } /** * Converts a css property string to CamelCase - * + * * @param cssProperty * The property string * @return A string converted to camelcase @@ -164,7 +169,7 @@ public class CssLayoutConnector extends AbstractLayoutConnector { /* * (non-Javadoc) - * + * * @see com.vaadin.client.ui.AbstractComponentConnector#getWidget() */ @Override @@ -174,7 +179,7 @@ public class CssLayoutConnector extends AbstractLayoutConnector { /* * (non-Javadoc) - * + * * @see com.vaadin.client.HasComponentsConnector#updateCaption(com.vaadin * .client.ComponentConnector) */ diff --git a/client/src/main/java/com/vaadin/client/ui/customcomponent/CustomComponentConnector.java b/client/src/main/java/com/vaadin/client/ui/customcomponent/CustomComponentConnector.java index e981dc13fc..60d3a0dc82 100644 --- a/client/src/main/java/com/vaadin/client/ui/customcomponent/CustomComponentConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/customcomponent/CustomComponentConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -37,7 +37,8 @@ public class CustomComponentConnector extends AbstractHasComponentsConnector { } @Override - public void onConnectorHierarchyChange(ConnectorHierarchyChangeEvent event) { + public void onConnectorHierarchyChange( + ConnectorHierarchyChangeEvent event) { VCustomComponent customComponent = getWidget(); if (getChildComponents().size() == 1) { ComponentConnector newChild = getChildComponents().get(0); diff --git a/client/src/main/java/com/vaadin/client/ui/customfield/CustomFieldConnector.java b/client/src/main/java/com/vaadin/client/ui/customfield/CustomFieldConnector.java index d18574d010..7260599fe6 100644 --- a/client/src/main/java/com/vaadin/client/ui/customfield/CustomFieldConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/customfield/CustomFieldConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -30,8 +30,8 @@ import com.vaadin.shared.ui.Connect; import com.vaadin.ui.CustomField; @Connect(value = CustomField.class) -public class CustomFieldConnector extends AbstractFieldConnector implements - HasComponentsConnector, ConnectorHierarchyChangeHandler { +public class CustomFieldConnector extends AbstractFieldConnector + implements HasComponentsConnector, ConnectorHierarchyChangeHandler { List childComponents; @@ -53,14 +53,15 @@ public class CustomFieldConnector extends AbstractFieldConnector implements } @Override - public void onConnectorHierarchyChange(ConnectorHierarchyChangeEvent event) { + public void onConnectorHierarchyChange( + ConnectorHierarchyChangeEvent event) { // We always have 1 child, unless the child is hidden getWidget().setWidget(getContentWidget()); } /* * (non-Javadoc) - * + * * @see com.vaadin.client.HasComponentsConnector#getChildren() */ @Override @@ -74,7 +75,7 @@ public class CustomFieldConnector extends AbstractFieldConnector implements /* * (non-Javadoc) - * + * * @see com.vaadin.client.HasComponentsConnector#setChildren * (java.util.Collection) */ @@ -86,13 +87,13 @@ public class CustomFieldConnector extends AbstractFieldConnector implements @Override public HandlerRegistration addConnectorHierarchyChangeHandler( ConnectorHierarchyChangeHandler handler) { - return ensureHandlerManager().addHandler( - ConnectorHierarchyChangeEvent.TYPE, handler); + return ensureHandlerManager() + .addHandler(ConnectorHierarchyChangeEvent.TYPE, handler); } /** * Returns the content (only/first child) of the container. - * + * * @return child connector or null if none (e.g. invisible or not set on * server) */ @@ -107,7 +108,7 @@ public class CustomFieldConnector extends AbstractFieldConnector implements /** * Returns the widget (if any) of the content of the container. - * + * * @return widget of the only/first connector of the container, null if no * content or if there is no widget for the connector */ diff --git a/client/src/main/java/com/vaadin/client/ui/customlayout/CustomLayoutConnector.java b/client/src/main/java/com/vaadin/client/ui/customlayout/CustomLayoutConnector.java index abbb0ef60b..d24ecf8911 100644 --- a/client/src/main/java/com/vaadin/client/ui/customlayout/CustomLayoutConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/customlayout/CustomLayoutConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -33,8 +33,8 @@ import com.vaadin.shared.ui.customlayout.CustomLayoutState; import com.vaadin.ui.CustomLayout; @Connect(CustomLayout.class) -public class CustomLayoutConnector extends AbstractLayoutConnector implements - SimpleManagedLayout, Paintable { +public class CustomLayoutConnector extends AbstractLayoutConnector + implements SimpleManagedLayout, Paintable { private boolean templateUpdated; @@ -77,8 +77,8 @@ public class CustomLayoutConnector extends AbstractLayoutConnector implements if (templateName != null) { // Get the HTML-template from client. Overrides templateContents // (even though both can never be given at the same time) - templateContents = getConnection().getResource( - "layouts/" + templateName + ".html"); + templateContents = getConnection() + .getResource("layouts/" + templateName + ".html"); } if (templateContents != null) { @@ -88,21 +88,19 @@ public class CustomLayoutConnector extends AbstractLayoutConnector implements } else { // Template missing -> show debug notice and render components in // order. - String warning = templateName != null ? "Layout file layouts/" - + templateName + ".html is missing." + String warning = templateName != null + ? "Layout file layouts/" + templateName + + ".html is missing." : "Layout file not specified."; - getWidget() - .getElement() - .setInnerHTML( - "" - + warning - + " Components will be drawn for debug purposes."); + getWidget().getElement().setInnerHTML("" + warning + + " Components will be drawn for debug purposes."); } templateUpdated = true; } @Override - public void onConnectorHierarchyChange(ConnectorHierarchyChangeEvent event) { + public void onConnectorHierarchyChange( + ConnectorHierarchyChangeEvent event) { // Must call here in addition to onStateChanged because // onConnectorHierarchyChange is invoked before onStateChanged updateHtmlTemplate(); @@ -113,9 +111,8 @@ public class CustomLayoutConnector extends AbstractLayoutConnector implements getWidget().setWidget(child.getWidget(), location); } catch (final IllegalArgumentException e) { // If no location is found, this component is not visible - getLogger().warning( - "Child not rendered as no slot with id '" + location - + "' has been defined"); + getLogger().warning("Child not rendered as no slot with id '" + + location + "' has been defined"); } } for (ComponentConnector oldChild : event.getOldChildren()) { diff --git a/client/src/main/java/com/vaadin/client/ui/datefield/AbstractDateFieldConnector.java b/client/src/main/java/com/vaadin/client/ui/datefield/AbstractDateFieldConnector.java index 6d1c9316f6..0b855eb7d2 100644 --- a/client/src/main/java/com/vaadin/client/ui/datefield/AbstractDateFieldConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/datefield/AbstractDateFieldConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -81,19 +81,17 @@ public class AbstractDateFieldConnector extends AbstractFieldConnector // Remove old stylename that indicates current resolution setWidgetStyleName( - getWidget().getStylePrimaryName() - + "-" - + VDateField.resolutionToString(getWidget() - .getCurrentResolution()), false); + getWidget().getStylePrimaryName() + "-" + VDateField + .resolutionToString(getWidget().getCurrentResolution()), + false); getWidget().setCurrentResolution(newResolution); // Add stylename that indicates current resolution setWidgetStyleName( - getWidget().getStylePrimaryName() - + "-" - + VDateField.resolutionToString(getWidget() - .getCurrentResolution()), true); + getWidget().getStylePrimaryName() + "-" + VDateField + .resolutionToString(getWidget().getCurrentResolution()), + true); final Resolution resolution = getWidget().getCurrentResolution(); final int year = uidl.getIntVariable("year"); @@ -110,9 +108,8 @@ public class AbstractDateFieldConnector extends AbstractFieldConnector // Construct new date for this datefield (only if not null) if (year > -1) { - getWidget().setCurrentDate( - new Date((long) getWidget().getTime(year, month, day, hour, - min, sec, 0))); + getWidget().setCurrentDate(new Date((long) getWidget().getTime(year, + month, day, hour, min, sec, 0))); } else { getWidget().setCurrentDate(null); } diff --git a/client/src/main/java/com/vaadin/client/ui/datefield/DateFieldConnector.java b/client/src/main/java/com/vaadin/client/ui/datefield/DateFieldConnector.java index c6b410fa74..04868c04b9 100644 --- a/client/src/main/java/com/vaadin/client/ui/datefield/DateFieldConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/datefield/DateFieldConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -38,7 +38,7 @@ public class DateFieldConnector extends TextualDateConnector { /* * (non-Javadoc) - * + * * @see com.vaadin.client.ui.AbstractConnector#init() */ @Override @@ -51,7 +51,7 @@ public class DateFieldConnector extends TextualDateConnector { * FIXME This is a hack so we do not have to rewrite half of the * datefield so values are not sent while selecting a date * (#6252). - * + * * The datefield will now only set the date UIDL variables while * the user is selecting year/month/date/time and not send them * directly. Only when the user closes the popup (by clicking on @@ -67,7 +67,7 @@ public class DateFieldConnector extends TextualDateConnector { /* * (non-Javadoc) - * + * * @see com.vaadin.client.ui.VTextualDate#updateFromUIDL(com.vaadin * .client.UIDL, com.vaadin.client.ApplicationConnection) */ @@ -81,20 +81,20 @@ public class DateFieldConnector extends TextualDateConnector { super.updateFromUIDL(uidl, client); - getWidget().calendar.setDateTimeService(getWidget() - .getDateTimeService()); - getWidget().calendar.setShowISOWeekNumbers(getWidget() - .isShowISOWeekNumbers()); + getWidget().calendar + .setDateTimeService(getWidget().getDateTimeService()); + getWidget().calendar + .setShowISOWeekNumbers(getWidget().isShowISOWeekNumbers()); if (getWidget().calendar.getResolution() != getWidget() .getCurrentResolution()) { boolean hasSelectedDate = false; - getWidget().calendar.setResolution(getWidget() - .getCurrentResolution()); + getWidget().calendar + .setResolution(getWidget().getCurrentResolution()); if (getWidget().calendar.getDate() != null && getWidget().getCurrentDate() != null) { hasSelectedDate = true; - getWidget().calendar.setDate((Date) getWidget() - .getCurrentDate().clone()); + getWidget().calendar + .setDate((Date) getWidget().getCurrentDate().clone()); } // force re-render when changing resolution only getWidget().calendar.renderCalendar(hasSelectedDate); @@ -105,8 +105,8 @@ public class DateFieldConnector extends TextualDateConnector { getWidget().calendar.renderCalendar(); } - if (getWidget().getCurrentResolution().getCalendarField() <= Resolution.MONTH - .getCalendarField()) { + if (getWidget().getCurrentResolution() + .getCalendarField() <= Resolution.MONTH.getCalendarField()) { getWidget().calendar .setFocusChangeListener(new FocusChangeListener() { @Override @@ -123,12 +123,13 @@ public class DateFieldConnector extends TextualDateConnector { getWidget().calendar.setFocusChangeListener(null); } - if (getWidget().getCurrentResolution().getCalendarField() > Resolution.DAY - .getCalendarField()) { + if (getWidget().getCurrentResolution() + .getCalendarField() > Resolution.DAY.getCalendarField()) { getWidget().calendar .setTimeChangeListener(new TimeChangeListener() { @Override - public void changed(int hour, int min, int sec, int msec) { + public void changed(int hour, int min, int sec, + int msec) { Date d = getWidget().getDate(); if (d == null) { // date currently null, use the value from @@ -152,11 +153,11 @@ public class DateFieldConnector extends TextualDateConnector { } if (getWidget().isReadonly()) { - getWidget().calendarToggle.addStyleName(VPopupCalendar.CLASSNAME - + "-button-readonly"); + getWidget().calendarToggle.addStyleName( + VPopupCalendar.CLASSNAME + "-button-readonly"); } else { - getWidget().calendarToggle.removeStyleName(VPopupCalendar.CLASSNAME - + "-button-readonly"); + getWidget().calendarToggle.removeStyleName( + VPopupCalendar.CLASSNAME + "-button-readonly"); } getWidget().setDescriptionForAssistiveDevices( @@ -200,18 +201,20 @@ public class DateFieldConnector extends TextualDateConnector { } @Override - protected void setWidgetStyleNameWithPrefix(String prefix, - String styleName, boolean add) { + protected void setWidgetStyleNameWithPrefix(String prefix, String styleName, + boolean add) { super.setWidgetStyleNameWithPrefix(prefix, styleName, add); // update the style change to popup calendar widget with the correct // prefix if (!styleName.startsWith("-")) { - getWidget().popup.setStyleName(getWidget().getStylePrimaryName() - + "-popup-" + styleName, add); + getWidget().popup.setStyleName( + getWidget().getStylePrimaryName() + "-popup-" + styleName, + add); } else { - getWidget().popup.setStyleName(getWidget().getStylePrimaryName() - + "-popup" + styleName, add); + getWidget().popup.setStyleName( + getWidget().getStylePrimaryName() + "-popup" + styleName, + add); } } diff --git a/client/src/main/java/com/vaadin/client/ui/datefield/InlineDateFieldConnector.java b/client/src/main/java/com/vaadin/client/ui/datefield/InlineDateFieldConnector.java index 6321e1c092..eb9b017c91 100644 --- a/client/src/main/java/com/vaadin/client/ui/datefield/InlineDateFieldConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/datefield/InlineDateFieldConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -40,12 +40,12 @@ public class InlineDateFieldConnector extends AbstractDateFieldConnector { return; } - getWidget().calendarPanel.setShowISOWeekNumbers(getWidget() - .isShowISOWeekNumbers()); - getWidget().calendarPanel.setDateTimeService(getWidget() - .getDateTimeService()); - getWidget().calendarPanel.setResolution(getWidget() - .getCurrentResolution()); + getWidget().calendarPanel + .setShowISOWeekNumbers(getWidget().isShowISOWeekNumbers()); + getWidget().calendarPanel + .setDateTimeService(getWidget().getDateTimeService()); + getWidget().calendarPanel + .setResolution(getWidget().getCurrentResolution()); Date currentDate = getWidget().getCurrentDate(); if (currentDate != null) { getWidget().calendarPanel.setDate(new Date(currentDate.getTime())); @@ -53,12 +53,13 @@ public class InlineDateFieldConnector extends AbstractDateFieldConnector { getWidget().calendarPanel.setDate(null); } - if (getWidget().getCurrentResolution().getCalendarField() > Resolution.DAY - .getCalendarField()) { + if (getWidget().getCurrentResolution() + .getCalendarField() > Resolution.DAY.getCalendarField()) { getWidget().calendarPanel .setTimeChangeListener(new TimeChangeListener() { @Override - public void changed(int hour, int min, int sec, int msec) { + public void changed(int hour, int min, int sec, + int msec) { Date d = getWidget().getDate(); if (d == null) { // date currently null, use the value from @@ -79,8 +80,8 @@ public class InlineDateFieldConnector extends AbstractDateFieldConnector { }); } - if (getWidget().getCurrentResolution().getCalendarField() <= Resolution.MONTH - .getCalendarField()) { + if (getWidget().getCurrentResolution() + .getCalendarField() <= Resolution.MONTH.getCalendarField()) { getWidget().calendarPanel .setFocusChangeListener(new FocusChangeListener() { @Override diff --git a/client/src/main/java/com/vaadin/client/ui/datefield/TextualDateConnector.java b/client/src/main/java/com/vaadin/client/ui/datefield/TextualDateConnector.java index 8545c20d7d..b4845a7054 100644 --- a/client/src/main/java/com/vaadin/client/ui/datefield/TextualDateConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/datefield/TextualDateConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/dd/DDEventHandleStrategy.java b/client/src/main/java/com/vaadin/client/ui/dd/DDEventHandleStrategy.java index 7b3203f330..74bafd098c 100644 --- a/client/src/main/java/com/vaadin/client/ui/dd/DDEventHandleStrategy.java +++ b/client/src/main/java/com/vaadin/client/ui/dd/DDEventHandleStrategy.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -27,9 +27,9 @@ import com.vaadin.client.ui.dd.VDragAndDropManager.DDManagerMediator; /** * Strategy to handle native preview events for VDragAndDropManager. - * + * * The strategy could be overridden via GWT Deferred Binding mechanism. - * + * * @author Vaadin Ltd * @since 7.4.4 */ @@ -37,7 +37,7 @@ public class DDEventHandleStrategy { /** * Returns {@code true} if {@code event} interrupts Drag and Drop. - * + * * @param event * GWT event to handle * @param mediator @@ -58,9 +58,9 @@ public class DDEventHandleStrategy { /** * Handles key down {@code event}. - * + * * Default implementation doesn't do anything. - * + * * @param event * key down GWT event * @param mediator @@ -73,7 +73,7 @@ public class DDEventHandleStrategy { /** * Get target element for {@code event}. - * + * * @param event * GWT event to find target * @param mediator @@ -113,7 +113,7 @@ public class DDEventHandleStrategy { * drag image. This value will be passed to the * {@link #restoreDragImage(String, DDManagerMediator, NativePreviewEvent)} * method. - * + * * @param event * GWT event for active DnD operation * @param mediator @@ -139,7 +139,7 @@ public class DDEventHandleStrategy { /** * Restores drag image after temporary update by * {@link #updateDragImage(NativePreviewEvent, DDManagerMediator)}. - * + * * @param originalImageDisplay * original "display" CSS style property of drag image element * @param mediator @@ -151,8 +151,8 @@ public class DDEventHandleStrategy { DDManagerMediator mediator, NativePreviewEvent event) { VDragAndDropManager manager = mediator.getManager(); if (manager.getDragElement() != null) { - manager.getDragElement().getStyle() - .setProperty("display", originalImageDisplay); + manager.getDragElement().getStyle().setProperty("display", + originalImageDisplay); } } @@ -160,9 +160,9 @@ public class DDEventHandleStrategy { * Handles event when drag image element ( * {@link VDragAndDropManager#getDragElement()} return value) is not null or * {@code event} is touch event. - * + * * If method returns {@code true} then event processing will be stoped. - * + * * @param target * target element over which DnD event has happened * @param event @@ -187,7 +187,8 @@ public class DDEventHandleStrategy { // ApplicationConnection // .getConsole() // .log( - // "IGNORING proxy image event, fired because of hack or not significant"); + // "IGNORING proxy image event, fired because of hack or not + // significant"); return true; case Event.ONMOUSEMOVE: case Event.ONTOUCHMOVE: @@ -211,7 +212,7 @@ public class DDEventHandleStrategy { /** * Handles drag enter on new element. - * + * * @param mediator * VDragAndDropManager data accessor * @param target @@ -227,7 +228,7 @@ public class DDEventHandleStrategy { /** * Handles drag over on element. - * + * * @param mediator * VDragAndDropManager data accessor * @param target @@ -241,7 +242,7 @@ public class DDEventHandleStrategy { /** * Final phase of event handling. - * + * * @param targetElement * target element over which DnD event has happened * @param event @@ -273,7 +274,7 @@ public class DDEventHandleStrategy { /** * Called to handle {@link Event#ONMOUSEMOVE} event. - * + * * @param target * target element over which DnD event has happened * @param event @@ -292,7 +293,7 @@ public class DDEventHandleStrategy { /** * Called to handle {@link Event#ONTOUCHEND} event. - * + * * @param target * target element over which DnD event has happened * @param event @@ -309,7 +310,7 @@ public class DDEventHandleStrategy { /** * Called to handle {@link Event#ONMOUSEUP} event. - * + * * @param target * target element over which DnD event has happened * @param event @@ -324,7 +325,7 @@ public class DDEventHandleStrategy { /** * Called to handle {@link Event#ONMOUSEOUT} event. - * + * * @param target * target element over which DnD event has happened * @param event @@ -335,8 +336,8 @@ public class DDEventHandleStrategy { protected void handleMouseOut(Element target, NativePreviewEvent event, DDManagerMediator mediator) { VDragAndDropManager manager = mediator.getManager(); - Element relatedTarget = Element.as(event.getNativeEvent() - .getRelatedEventTarget()); + Element relatedTarget = Element + .as(event.getNativeEvent().getRelatedEventTarget()); VDropHandler newDragHanler = findDragTarget(relatedTarget, mediator); if (manager.getDragElement() != null && manager.getDragElement().isOrHasChild(relatedTarget)) { @@ -353,7 +354,7 @@ public class DDEventHandleStrategy { /** * Handles drag leave on old element. - * + * * @param mediator * VDragAndDropManager data accessor */ @@ -371,7 +372,7 @@ public class DDEventHandleStrategy { /** * Called to handle {@link Event#ONMOUSEOVER} event. - * + * * @param target * target element over which DnD event has happened * @param event @@ -403,7 +404,7 @@ public class DDEventHandleStrategy { /** * Find drag handler for the {@code target} element. - * + * * @param target * target element over which DnD event has happened * @param mediator diff --git a/client/src/main/java/com/vaadin/client/ui/dd/DDUtil.java b/client/src/main/java/com/vaadin/client/ui/dd/DDUtil.java index fdccd61767..8d8c44b460 100644 --- a/client/src/main/java/com/vaadin/client/ui/dd/DDUtil.java +++ b/client/src/main/java/com/vaadin/client/ui/dd/DDUtil.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/dd/DragAndDropHandler.java b/client/src/main/java/com/vaadin/client/ui/dd/DragAndDropHandler.java index 63c44f1fd5..82348e4901 100644 --- a/client/src/main/java/com/vaadin/client/ui/dd/DragAndDropHandler.java +++ b/client/src/main/java/com/vaadin/client/ui/dd/DragAndDropHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -33,7 +33,7 @@ import com.vaadin.client.widgets.Grid; *

    * The showing of the dragged element, drag hints and reacting to drop/cancel is * delegated to {@link DragAndDropCallback} implementation. - * + * * @since 7.5.0 * @author Vaadin Ltd */ @@ -46,7 +46,7 @@ public class DragAndDropHandler { /** * Called when the drag has started. The drag can be canceled by * returning {@code false}. - * + * * @param e * the original event that started the drag * @return {@code true} if the drag is OK to start, {@code false} to @@ -56,7 +56,7 @@ public class DragAndDropHandler { /** * Called on drag. - * + * * @param e * the event related to the drag */ @@ -150,11 +150,11 @@ public class DragAndDropHandler { /** * This method can be called to trigger drag and drop on any grid element * that can be dragged and dropped. - * + * * @param dragStartingEvent * the drag triggering event, usually a {@link Event#ONMOUSEDOWN} * or {@link Event#ONTOUCHSTART} event on the draggable element - * + * * @param callback * the callback that will handle actual drag and drop related * operations @@ -173,9 +173,8 @@ public class DragAndDropHandler { @Override public void onPreviewNativeEvent(NativePreviewEvent event) { final int typeInt = event.getTypeInt(); - if (typeInt == -1 - && event.getNativeEvent().getType() - .toLowerCase().contains("pointer")) { + if (typeInt == -1 && event.getNativeEvent().getType() + .toLowerCase().contains("pointer")) { /* * Ignore PointerEvents since IE10 and IE11 send * also MouseEvents for backwards compatibility. @@ -196,12 +195,10 @@ public class DragAndDropHandler { break; case Event.ONMOUSEMOVE: case Event.ONTOUCHMOVE: - int currentX = WidgetUtil - .getTouchOrMouseClientX(event - .getNativeEvent()); - int currentY = WidgetUtil - .getTouchOrMouseClientY(event - .getNativeEvent()); + int currentX = WidgetUtil.getTouchOrMouseClientX( + event.getNativeEvent()); + int currentY = WidgetUtil.getTouchOrMouseClientY( + event.getNativeEvent()); if (Math.abs(startX - currentX) > 3 || Math.abs(startY - currentY) > 3) { removeStartPreviewHandler(); diff --git a/client/src/main/java/com/vaadin/client/ui/dd/DragHandle.java b/client/src/main/java/com/vaadin/client/ui/dd/DragHandle.java index 77184e14af..a983337c22 100644 --- a/client/src/main/java/com/vaadin/client/ui/dd/DragHandle.java +++ b/client/src/main/java/com/vaadin/client/ui/dd/DragHandle.java @@ -31,7 +31,7 @@ import com.vaadin.client.ui.dd.DragAndDropHandler.DragAndDropCallback; * view of this component, there really is no use for that). For the more * general, event-providing interface that this component is based on, see * {@link DragAndDropHandler}. - * + * * @since 7.6 */ public class DragHandle { @@ -48,7 +48,7 @@ public class DragHandle { /** * Called when the drag handle has moved. - * + * * @param deltaX * change in X direction since start * @param deltaY @@ -80,7 +80,7 @@ public class DragHandle { /** * Creates a new DragHandle. - * + * * @param baseName * CSS style name to use for this DragHandle element. This * parameter is supplied to the constructor (rather than added @@ -158,7 +158,7 @@ public class DragHandle { /** * Returns the current parent element for this drag handle. May be null. - * + * * @return an Element or null */ public Element getParent() { @@ -167,7 +167,7 @@ public class DragHandle { /** * Gets the element used as actual drag handle. - * + * * @return an Element */ public Element getElement() { @@ -176,7 +176,7 @@ public class DragHandle { /** * Adds this drag handle to an HTML element. - * + * * @param elem * an element */ @@ -198,7 +198,7 @@ public class DragHandle { /** * Adds CSS style name to the drag handle element. - * + * * @param styleName * a CSS style name */ @@ -208,7 +208,7 @@ public class DragHandle { /** * Removes existing style name from drag handle element. - * + * * @param styleName * a CSS style name */ diff --git a/client/src/main/java/com/vaadin/client/ui/dd/DragImageModifier.java b/client/src/main/java/com/vaadin/client/ui/dd/DragImageModifier.java index 45ab5d9bb3..2402d59dd1 100644 --- a/client/src/main/java/com/vaadin/client/ui/dd/DragImageModifier.java +++ b/client/src/main/java/com/vaadin/client/ui/dd/DragImageModifier.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -22,7 +22,7 @@ import com.google.gwt.dom.client.Element; * requires additional initialization/configuration. The method * {@link #modifyDragImage(Element)} is called for each element in the * automatically generated drag image. - * + * * @since 7.2 * @author Vaadin Ltd */ @@ -32,7 +32,7 @@ public interface DragImageModifier { * This method is called for cloned element which corresponds * to the widget element. One could modify/correct this element * for drag image. - * + * * @param element * cloned element of drag image */ diff --git a/client/src/main/java/com/vaadin/client/ui/dd/VAbstractDropHandler.java b/client/src/main/java/com/vaadin/client/ui/dd/VAbstractDropHandler.java index 61708260a1..cdec7d611f 100644 --- a/client/src/main/java/com/vaadin/client/ui/dd/VAbstractDropHandler.java +++ b/client/src/main/java/com/vaadin/client/ui/dd/VAbstractDropHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -33,7 +33,7 @@ public abstract class VAbstractDropHandler implements VDropHandler { * Implementor/user of {@link VAbstractDropHandler} must pass the UIDL * painted by {@link AcceptCriterion} to this method. Practically the * details about {@link AcceptCriterion} are saved. - * + * * @param uidl */ public void updateAcceptRules(UIDL uidl) { @@ -85,7 +85,7 @@ public abstract class VAbstractDropHandler implements VDropHandler { * {@link Transferable} and others don't, one should use similar validation * logic in dragOver method and replace this method with empty * implementation. - * + * */ @Override public void dragEnter(final VDragEvent drag) { @@ -103,7 +103,7 @@ public abstract class VAbstractDropHandler implements VDropHandler { *

    * Implementations can set some hints for users here to highlight that the * drag is on a valid drop location. - * + * * @param drag */ abstract protected void dragAccepted(VDragEvent drag); @@ -122,7 +122,7 @@ public abstract class VAbstractDropHandler implements VDropHandler { boolean validated = false; /** - * The default implemmentation visits server if {@link AcceptCriterion} + * The default implemmentation visits server if {@link AcceptCriterion} * can't be verified on client or if {@link AcceptCriterion} are met on * client. */ diff --git a/client/src/main/java/com/vaadin/client/ui/dd/VAcceptAll.java b/client/src/main/java/com/vaadin/client/ui/dd/VAcceptAll.java index bb6170da45..38e306598c 100644 --- a/client/src/main/java/com/vaadin/client/ui/dd/VAcceptAll.java +++ b/client/src/main/java/com/vaadin/client/ui/dd/VAcceptAll.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -14,7 +14,7 @@ * the License. */ /** - * + * */ package com.vaadin.client.ui.dd; diff --git a/client/src/main/java/com/vaadin/client/ui/dd/VAcceptCallback.java b/client/src/main/java/com/vaadin/client/ui/dd/VAcceptCallback.java index 706abb0e05..583c1bed1f 100644 --- a/client/src/main/java/com/vaadin/client/ui/dd/VAcceptCallback.java +++ b/client/src/main/java/com/vaadin/client/ui/dd/VAcceptCallback.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/dd/VAcceptCriteria.java b/client/src/main/java/com/vaadin/client/ui/dd/VAcceptCriteria.java index 4bf23cbe7f..e5e59290de 100644 --- a/client/src/main/java/com/vaadin/client/ui/dd/VAcceptCriteria.java +++ b/client/src/main/java/com/vaadin/client/ui/dd/VAcceptCriteria.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/dd/VAcceptCriterion.java b/client/src/main/java/com/vaadin/client/ui/dd/VAcceptCriterion.java index 5205b9182b..711e030c6c 100644 --- a/client/src/main/java/com/vaadin/client/ui/dd/VAcceptCriterion.java +++ b/client/src/main/java/com/vaadin/client/ui/dd/VAcceptCriterion.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -22,7 +22,7 @@ public abstract class VAcceptCriterion { /** * Checks if current drag event has valid drop target and target accepts the * transferable. If drop target is valid, callback is used. - * + * * @param drag * @param configuration * @param callback diff --git a/client/src/main/java/com/vaadin/client/ui/dd/VAcceptCriterionFactory.java b/client/src/main/java/com/vaadin/client/ui/dd/VAcceptCriterionFactory.java index 1503b1f84d..5d0267b99f 100644 --- a/client/src/main/java/com/vaadin/client/ui/dd/VAcceptCriterionFactory.java +++ b/client/src/main/java/com/vaadin/client/ui/dd/VAcceptCriterionFactory.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/dd/VAnd.java b/client/src/main/java/com/vaadin/client/ui/dd/VAnd.java index ee4bc94f9e..2b448e3ed4 100644 --- a/client/src/main/java/com/vaadin/client/ui/dd/VAnd.java +++ b/client/src/main/java/com/vaadin/client/ui/dd/VAnd.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -14,7 +14,7 @@ * the License. */ /** - * + * */ package com.vaadin.client.ui.dd; diff --git a/client/src/main/java/com/vaadin/client/ui/dd/VContainsDataFlavor.java b/client/src/main/java/com/vaadin/client/ui/dd/VContainsDataFlavor.java index 2ad375fd77..cadfb79c20 100644 --- a/client/src/main/java/com/vaadin/client/ui/dd/VContainsDataFlavor.java +++ b/client/src/main/java/com/vaadin/client/ui/dd/VContainsDataFlavor.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -14,7 +14,7 @@ * the License. */ /** - * + * */ package com.vaadin.client.ui.dd; diff --git a/client/src/main/java/com/vaadin/client/ui/dd/VDragAndDropManager.java b/client/src/main/java/com/vaadin/client/ui/dd/VDragAndDropManager.java index 109b69f0c4..a3e3e9bcf1 100644 --- a/client/src/main/java/com/vaadin/client/ui/dd/VDragAndDropManager.java +++ b/client/src/main/java/com/vaadin/client/ui/dd/VDragAndDropManager.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -52,7 +52,7 @@ import com.vaadin.shared.ui.dd.DragEventType; *

    * Singleton. Only one drag and drop operation can be active anyways. Use * {@link #get()} to get instance. - * + * * TODO cancel drag and drop if more than one touches !? */ public class VDragAndDropManager { @@ -63,7 +63,7 @@ public class VDragAndDropManager { * Implementation if this interface is provided as a parameter to * DDEventHandleStrategy methods. The mediator instance allows to manage * DnD. - * + * * @since 7.4.4 */ public interface DDManagerMediator { @@ -83,8 +83,8 @@ public class VDragAndDropManager { void clearServerCallback(); } - private final class DefaultDragAndDropEventHandler implements - NativePreviewHandler { + private final class DefaultDragAndDropEventHandler + implements NativePreviewHandler { @Override public void onPreviewNativeEvent(NativePreviewEvent event) { @@ -110,8 +110,8 @@ public class VDragAndDropManager { String display = getEventHandleStrategy().updateDragImage(event, managerMediator); - Element targetElement = getEventHandleStrategy().getTargetElement( - event, managerMediator); + Element targetElement = getEventHandleStrategy() + .getTargetElement(event, managerMediator); try { if (handleDragImage(targetElement, event)) { @@ -130,7 +130,8 @@ public class VDragAndDropManager { managerMediator); } - private boolean handleDragImage(Element target, NativePreviewEvent event) { + private boolean handleDragImage(Element target, + NativePreviewEvent event) { if (!WidgetUtil.isTouchEvent(event.getNativeEvent()) && getDragElement() == null) { return false; @@ -198,7 +199,7 @@ public class VDragAndDropManager { * If drag and drop operation is not handled by {@link VDragAndDropManager}s * internal handler, this can be used to update current {@link VDropHandler} * . - * + * * @param currentDropHandler */ public void setCurrentDropHandler(VDropHandler currentDropHandler) { @@ -241,7 +242,7 @@ public class VDragAndDropManager { * May also be used to control the drag and drop operation. If this option * is used, {@link VDropHandler} is searched on mouse events and appropriate * methods on it called automatically. - * + * * @param transferable * @param nativeEvent * @param handleDragEvents @@ -265,8 +266,8 @@ public class VDragAndDropManager { addActiveDragSourceStyleName(); VDropHandler dh = null; if (startEvent != null) { - dh = findDragTarget(Element.as(currentDrag - .getCurrentGwtEvent().getEventTarget())); + dh = findDragTarget(Element.as( + currentDrag.getCurrentGwtEvent().getEventTarget())); } if (dh != null) { // drag has started on a DropHandler, kind of drag over @@ -276,8 +277,8 @@ public class VDragAndDropManager { } if (handleDragEvents) { - handlerRegistration = Event - .addNativePreviewHandler(defaultDragAndDropEventHandler); + handlerRegistration = Event.addNativePreviewHandler( + defaultDragAndDropEventHandler); if (dragElement != null && dragElement.getParentElement() == null) { attachDragElement(); @@ -290,32 +291,30 @@ public class VDragAndDropManager { private void addActiveDragSourceStyleName() { ComponentConnector dragSource = currentDrag.getTransferable() .getDragSource(); - dragSource.getWidget().addStyleName( - ACTIVE_DRAG_SOURCE_STYLENAME); + dragSource.getWidget() + .addStyleName(ACTIVE_DRAG_SOURCE_STYLENAME); } }; final int eventType = Event.as(startEvent).getTypeInt(); - if (handleDragEvents - && (eventType == Event.ONMOUSEDOWN || eventType == Event.ONTOUCHSTART)) { + if (handleDragEvents && (eventType == Event.ONMOUSEDOWN + || eventType == Event.ONTOUCHSTART)) { // only really start drag event on mousemove deferredStartRegistration = Event .addNativePreviewHandler(new NativePreviewHandler() { - private int startX = WidgetUtil - .getTouchOrMouseClientX(currentDrag - .getCurrentGwtEvent()); - private int startY = WidgetUtil - .getTouchOrMouseClientY(currentDrag - .getCurrentGwtEvent()); + private int startX = WidgetUtil.getTouchOrMouseClientX( + currentDrag.getCurrentGwtEvent()); + private int startY = WidgetUtil.getTouchOrMouseClientY( + currentDrag.getCurrentGwtEvent()); @Override public void onPreviewNativeEvent( NativePreviewEvent event) { int typeInt = event.getTypeInt(); - if (typeInt == -1 - && event.getNativeEvent().getType() - .toLowerCase().contains("pointer")) { + if (typeInt == -1 && event.getNativeEvent() + .getType().toLowerCase() + .contains("pointer")) { /* * Ignore PointerEvents since IE10 and IE11 send * also MouseEvents for backwards compatibility. @@ -332,8 +331,8 @@ public class VDragAndDropManager { .getNativeEvent() .getCurrentEventTarget(); if (Node.is(currentEventTarget) - && !dragElement.isOrHasChild(Node - .as(currentEventTarget))) { + && !dragElement.isOrHasChild( + Node.as(currentEventTarget))) { // drag image appeared below, ignore break; } @@ -353,24 +352,26 @@ public class VDragAndDropManager { .getNativeEvent() .getRelatedEventTarget(); if (Node.is(relatedEventTarget) - && !dragElement.isOrHasChild(Node - .as(relatedEventTarget))) { + && !dragElement.isOrHasChild( + Node.as(relatedEventTarget))) { // drag image appeared below, ignore break; } case Event.ONMOUSEMOVE: case Event.ONTOUCHMOVE: int currentX = WidgetUtil - .getTouchOrMouseClientX(event - .getNativeEvent()); + .getTouchOrMouseClientX( + event.getNativeEvent()); int currentY = WidgetUtil - .getTouchOrMouseClientY(event - .getNativeEvent()); - if (Math.abs(startX - currentX) > MINIMUM_DISTANCE_TO_START_DRAG - || Math.abs(startY - currentY) > MINIMUM_DISTANCE_TO_START_DRAG) { + .getTouchOrMouseClientY( + event.getNativeEvent()); + if (Math.abs( + startX - currentX) > MINIMUM_DISTANCE_TO_START_DRAG + || Math.abs(startY + - currentY) > MINIMUM_DISTANCE_TO_START_DRAG) { ensureDeferredRegistrationCleanup(); - currentDrag.setCurrentGwtEvent(event - .getNativeEvent()); + currentDrag.setCurrentGwtEvent( + event.getNativeEvent()); startDrag.execute(); } break; @@ -405,7 +406,7 @@ public class VDragAndDropManager { /** * First seeks the widget from this element, then iterates widgets until one * implement HasDropHandler. Returns DropHandler from that. - * + * * @param element * @return */ @@ -488,8 +489,7 @@ public class VDragAndDropManager { Scheduler.get().scheduleFixedDelay(new RepeatingCommand() { @Override public boolean execute() { - if (!client.getMessageSender() - .hasActiveRequest()) { + if (!client.getMessageSender().hasActiveRequest()) { removeActiveDragSourceStyleName(dragSource); return false; } @@ -514,8 +514,8 @@ public class VDragAndDropManager { * the server visit is done. */ if (!sendTransferableToServer && currentDrag != null) { - removeActiveDragSourceStyleName(currentDrag.getTransferable() - .getDragSource()); + removeActiveDragSourceStyleName( + currentDrag.getTransferable().getDragSource()); } currentDrag = null; @@ -541,7 +541,8 @@ public class VDragAndDropManager { } } - private void removeActiveDragSourceStyleName(ComponentConnector dragSource) { + private void removeActiveDragSourceStyleName( + ComponentConnector dragSource) { dragSource.getWidget().removeStyleName(ACTIVE_DRAG_SOURCE_STYLENAME); } @@ -560,11 +561,11 @@ public class VDragAndDropManager { /** * Visits server during drag and drop procedure. Transferable and event type * is given to server side counterpart of DropHandler. - * + * * If another server visit is started before the current is received, the * current is just dropped. TODO consider if callback should have * interrupted() method for cleanup. - * + * * @param acceptCallback */ public void visitServer(VDragEventServerCallback acceptCallback) { @@ -583,9 +584,9 @@ public class VDragAndDropManager { * For drag events we are using special id that are routed to * "drag service" which then again finds the corresponding DropHandler * on server side. - * + * * TODO add rest of the data in Transferable - * + * * TODO implement partial updates to Transferable (currently the whole * Transferable is sent on each request) */ @@ -608,8 +609,8 @@ public class VDragAndDropManager { if (currentDrag.getCurrentGwtEvent() != null) { try { MouseEventDetails mouseEventDetails = MouseEventDetailsBuilder - .buildMouseEventDetails(currentDrag - .getCurrentGwtEvent()); + .buildMouseEventDetails( + currentDrag.getCurrentGwtEvent()); currentDrag.getDropDetails().put("mouseEvent", mouseEventDetails.serialize()); } catch (Exception e) { @@ -648,10 +649,10 @@ public class VDragAndDropManager { /** * Returns DnD strategy to handle native preview events used by the manager. - * + * * Subclasses can override this method to return custom strategy or use GWT * deferred binding. - * + * * @return internal DnD native preview event handler */ protected DDEventHandleStrategy getEventHandleStrategy() { @@ -700,7 +701,8 @@ public class VDragAndDropManager { ApplicationConnection connection = getCurrentDragApplicationConnection(); Element dragImageParent; if (connection == null) { - VConsole.error("Could not determine ApplicationConnection for current drag operation. The drag image will likely look broken"); + VConsole.error( + "Could not determine ApplicationConnection for current drag operation. The drag image will likely look broken"); dragImageParent = RootPanel.getBodyElement(); } else { dragImageParent = VOverlay.getOverlayContainer(connection); @@ -731,7 +733,7 @@ public class VDragAndDropManager { /** * Method to que tasks until all dd related server visits are done - * + * * @param command */ private void defer(Command command) { @@ -747,7 +749,7 @@ public class VDragAndDropManager { *

    * TODO Optimization: consider if we actually only need to keep the last * command in queue here. - * + * * @param command */ public void executeWhenReady(Command command) { diff --git a/client/src/main/java/com/vaadin/client/ui/dd/VDragEvent.java b/client/src/main/java/com/vaadin/client/ui/dd/VDragEvent.java index c889dbf34e..210e956825 100644 --- a/client/src/main/java/com/vaadin/client/ui/dd/VDragEvent.java +++ b/client/src/main/java/com/vaadin/client/ui/dd/VDragEvent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -35,8 +35,8 @@ import com.vaadin.client.WidgetUtil; /** * DragEvent used by Vaadin client side engine. Supports components, items, * properties and custom payload (HTML5 style). - * - * + * + * */ public class VDragEvent { @@ -70,7 +70,7 @@ public class VDragEvent { * Returns the the latest {@link NativeEvent} that relates to this drag and * drop operation. For example on {@link VDropHandler#dragEnter(VDragEvent)} * this is commonly a {@link MouseOverEvent}. - * + * * @return */ public NativeEvent getCurrentGwtEvent() { @@ -95,7 +95,7 @@ public class VDragEvent { * the pointer currently is (drag image excluded). {@link VDropHandler}s can * then more easily react properly on drag events by reading the element via * this method. - * + * * @return the element in {@link VDropHandler} on which mouse cursor is on */ public com.google.gwt.user.client.Element getElementOver() { @@ -112,7 +112,8 @@ public class VDragEvent { * instead */ @Deprecated - public void setElementOver(com.google.gwt.user.client.Element targetElement) { + public void setElementOver( + com.google.gwt.user.client.Element targetElement) { elementOver = targetElement; } @@ -129,13 +130,13 @@ public class VDragEvent { *

    * The element to be used as drag image will automatically get CSS style * name "v-drag-element". - * + * * TODO decide if this method should be here or in {@link VTransferable} (in * HTML5 it is in DataTransfer) or {@link VDragAndDropManager} - * + * * TODO should be possible to override behavior. Like to proxy the element * to HTML5 DataTransfer - * + * * @param node * @deprecated As of 7.2, call or override {@link #setDragImage(Element)} * instead @@ -151,15 +152,15 @@ public class VDragEvent { *

    * The element to be used as drag image will automatically get CSS style * name "v-drag-element". - * + * * TODO decide if this method should be here or in {@link VTransferable} (in * HTML5 it is in DataTransfer) or {@link VDragAndDropManager} - * + * * TODO should be possible to override behavior. Like to proxy the element * to HTML5 DataTransfer - * + * * @param node - * + * * @since 7.2 */ public void setDragImage(Element node) { @@ -168,9 +169,9 @@ public class VDragEvent { /** * TODO consider using similar smaller (than map) api as in Transferable - * + * * TODO clean up when drop handler changes - * + * * @return */ public Map getDropDetails() { @@ -183,7 +184,7 @@ public class VDragEvent { *

    * The element to be used as drag image will automatically get CSS style * name "v-drag-element". - * + * * @param element * the dom element to be positioned next to mouse cursor * @param offsetX @@ -208,14 +209,14 @@ public class VDragEvent { *

    * The element to be used as drag image will automatically get CSS style * name "v-drag-element". - * + * * @param element * the dom element to be positioned next to mouse cursor * @param offsetX * the horizontal offset of drag image from mouse cursor * @param offsetY * the vertical offset of drag image from mouse cursor - * + * * @since 7.2 */ public void setDragImage(Element element, int offsetX, int offsetY) { @@ -232,7 +233,7 @@ public class VDragEvent { /** * Automatically tries to create a proxy image from given element. - * + * * @param element * @param alignImageToEvent * if true, proxy image is aligned to start event, else next to @@ -275,7 +276,7 @@ public class VDragEvent { /** * Automatically tries to create a proxy image from given element. - * + * * @param element * @param alignImageToEvent * if true, proxy image is aligned to start event, else next to @@ -289,7 +290,7 @@ public class VDragEvent { /** * Do additional content sync between original element and its * copy if needed. - * + * * @since 7.2 * @param original * original element diff --git a/client/src/main/java/com/vaadin/client/ui/dd/VDragEventServerCallback.java b/client/src/main/java/com/vaadin/client/ui/dd/VDragEventServerCallback.java index ba2d0f789b..bc6e325bce 100644 --- a/client/src/main/java/com/vaadin/client/ui/dd/VDragEventServerCallback.java +++ b/client/src/main/java/com/vaadin/client/ui/dd/VDragEventServerCallback.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/dd/VDragSourceIs.java b/client/src/main/java/com/vaadin/client/ui/dd/VDragSourceIs.java index 8a8d1d7bb9..26b21a2146 100644 --- a/client/src/main/java/com/vaadin/client/ui/dd/VDragSourceIs.java +++ b/client/src/main/java/com/vaadin/client/ui/dd/VDragSourceIs.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -23,7 +23,7 @@ import com.vaadin.shared.ui.dd.AcceptCriterion; /** * TODO Javadoc! - * + * * @since 6.3 */ @AcceptCriterion(SourceIs.class) diff --git a/client/src/main/java/com/vaadin/client/ui/dd/VDropHandler.java b/client/src/main/java/com/vaadin/client/ui/dd/VDropHandler.java index 96059883e7..b6fb6b370b 100644 --- a/client/src/main/java/com/vaadin/client/ui/dd/VDropHandler.java +++ b/client/src/main/java/com/vaadin/client/ui/dd/VDropHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -27,7 +27,7 @@ public interface VDropHandler { /** * Called by DragAndDropManager when a drag operation is in progress and the * cursor enters the area occupied by this Paintable. - * + * * @param dragEvent * DragEvent which contains the transferable and other * information for the operation @@ -37,7 +37,7 @@ public interface VDropHandler { /** * Called by DragAndDropManager when a drag operation is in progress and the * cursor leaves the area occupied by this Paintable. - * + * * @param dragEvent * DragEvent which contains the transferable and other * information for the operation @@ -47,12 +47,12 @@ public interface VDropHandler { /** * Called by DragAndDropManager when a drag operation was in progress and a * drop was performed on this Paintable. - * - * + * + * * @param dragEvent * DragEvent which contains the transferable and other * information for the operation - * + * * @return true if the Tranferrable of this drag event needs to be sent to * the server, false if drop is rejected or no server side event * should be sent @@ -61,11 +61,11 @@ public interface VDropHandler { /** * When drag is over current drag handler. - * + * * With drag implementation by {@link VDragAndDropManager} will be called * when mouse is moved. HTML5 implementations call this continuously even * though mouse is not moved. - * + * * @param currentDrag */ public void dragOver(VDragEvent currentDrag); diff --git a/client/src/main/java/com/vaadin/client/ui/dd/VHasDropHandler.java b/client/src/main/java/com/vaadin/client/ui/dd/VHasDropHandler.java index 4d82c5c9cf..05c6649e80 100644 --- a/client/src/main/java/com/vaadin/client/ui/dd/VHasDropHandler.java +++ b/client/src/main/java/com/vaadin/client/ui/dd/VHasDropHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -19,10 +19,10 @@ import com.vaadin.client.ComponentConnector; /** * Used to detect Widget from widget tree that has {@link #getDropHandler()} - * + * * Decide whether to get rid of this class. If so, {@link VAbstractDropHandler} * must extend {@link ComponentConnector}. - * + * */ public interface VHasDropHandler { public VDropHandler getDropHandler(); diff --git a/client/src/main/java/com/vaadin/client/ui/dd/VHtml5DragEvent.java b/client/src/main/java/com/vaadin/client/ui/dd/VHtml5DragEvent.java index 672eac9e06..785d24af74 100644 --- a/client/src/main/java/com/vaadin/client/ui/dd/VHtml5DragEvent.java +++ b/client/src/main/java/com/vaadin/client/ui/dd/VHtml5DragEvent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,7 +20,7 @@ import com.google.gwt.dom.client.NativeEvent; /** * Helper class to access html5 style drag events. - * + * * TODO Gears support ? */ public class VHtml5DragEvent extends NativeEvent { @@ -41,7 +41,7 @@ public class VHtml5DragEvent extends NativeEvent { /** * Works on FF 3.6 and possibly with gears. - * + * * @param index * @return */ diff --git a/client/src/main/java/com/vaadin/client/ui/dd/VHtml5File.java b/client/src/main/java/com/vaadin/client/ui/dd/VHtml5File.java index 6022835343..dac5d9a961 100644 --- a/client/src/main/java/com/vaadin/client/ui/dd/VHtml5File.java +++ b/client/src/main/java/com/vaadin/client/ui/dd/VHtml5File.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/dd/VIsOverId.java b/client/src/main/java/com/vaadin/client/ui/dd/VIsOverId.java index 8e8abf1a97..d3fb378b16 100644 --- a/client/src/main/java/com/vaadin/client/ui/dd/VIsOverId.java +++ b/client/src/main/java/com/vaadin/client/ui/dd/VIsOverId.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -14,7 +14,7 @@ * the License. */ /** - * + * */ package com.vaadin.client.ui.dd; diff --git a/client/src/main/java/com/vaadin/client/ui/dd/VItemIdIs.java b/client/src/main/java/com/vaadin/client/ui/dd/VItemIdIs.java index 4bfc71ab14..22ec05448d 100644 --- a/client/src/main/java/com/vaadin/client/ui/dd/VItemIdIs.java +++ b/client/src/main/java/com/vaadin/client/ui/dd/VItemIdIs.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -14,7 +14,7 @@ * the License. */ /** - * + * */ package com.vaadin.client.ui.dd; diff --git a/client/src/main/java/com/vaadin/client/ui/dd/VLazyInitItemIdentifiers.java b/client/src/main/java/com/vaadin/client/ui/dd/VLazyInitItemIdentifiers.java index f67174c1c1..270b7580e9 100644 --- a/client/src/main/java/com/vaadin/client/ui/dd/VLazyInitItemIdentifiers.java +++ b/client/src/main/java/com/vaadin/client/ui/dd/VLazyInitItemIdentifiers.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -14,7 +14,7 @@ * the License. */ /** - * + * */ package com.vaadin.client.ui.dd; @@ -26,7 +26,7 @@ import com.vaadin.ui.Table; import com.vaadin.ui.Tree; /** - * + * */ public class VLazyInitItemIdentifiers extends VAcceptCriterion { private boolean loaded = false; @@ -34,14 +34,14 @@ public class VLazyInitItemIdentifiers extends VAcceptCriterion { private VDragEvent lastDragEvent; @AcceptCriterion(Table.TableDropCriterion.class) - final public static class VTableLazyInitItemIdentifiers extends - VLazyInitItemIdentifiers { + final public static class VTableLazyInitItemIdentifiers + extends VLazyInitItemIdentifiers { // all logic in superclass } @AcceptCriterion(Tree.TreeDropCriterion.class) - final public static class VTreeLazyInitItemIdentifiers extends - VLazyInitItemIdentifiers { + final public static class VTreeLazyInitItemIdentifiers + extends VLazyInitItemIdentifiers { // all logic in superclass } diff --git a/client/src/main/java/com/vaadin/client/ui/dd/VNot.java b/client/src/main/java/com/vaadin/client/ui/dd/VNot.java index 3e931f9580..92b2de7eea 100644 --- a/client/src/main/java/com/vaadin/client/ui/dd/VNot.java +++ b/client/src/main/java/com/vaadin/client/ui/dd/VNot.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -14,7 +14,7 @@ * the License. */ /** - * + * */ package com.vaadin.client.ui.dd; @@ -25,7 +25,7 @@ import com.vaadin.shared.ui.dd.AcceptCriterion; /** * TODO implementation could now be simplified/optimized - * + * */ @AcceptCriterion(Not.class) final public class VNot extends VAcceptCriterion { diff --git a/client/src/main/java/com/vaadin/client/ui/dd/VOr.java b/client/src/main/java/com/vaadin/client/ui/dd/VOr.java index e189e22b45..98e6a08b94 100644 --- a/client/src/main/java/com/vaadin/client/ui/dd/VOr.java +++ b/client/src/main/java/com/vaadin/client/ui/dd/VOr.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -14,7 +14,7 @@ * the License. */ /** - * + * */ package com.vaadin.client.ui.dd; @@ -23,7 +23,7 @@ import com.vaadin.event.dd.acceptcriteria.Or; import com.vaadin.shared.ui.dd.AcceptCriterion; /** - * + * */ @AcceptCriterion(Or.class) final public class VOr extends VAcceptCriterion implements VAcceptCallback { diff --git a/client/src/main/java/com/vaadin/client/ui/dd/VOverTreeNode.java b/client/src/main/java/com/vaadin/client/ui/dd/VOverTreeNode.java index c7c00a6bee..a8bac3e5a7 100644 --- a/client/src/main/java/com/vaadin/client/ui/dd/VOverTreeNode.java +++ b/client/src/main/java/com/vaadin/client/ui/dd/VOverTreeNode.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -14,7 +14,7 @@ * the License. */ /** - * + * */ package com.vaadin.client.ui.dd; @@ -24,8 +24,8 @@ final public class VOverTreeNode extends VAcceptCriterion { @Override protected boolean accept(VDragEvent drag, UIDL configuration) { - Boolean containsKey = (Boolean) drag.getDropDetails().get( - "itemIdOverIsNode"); + Boolean containsKey = (Boolean) drag.getDropDetails() + .get("itemIdOverIsNode"); return containsKey != null && containsKey.booleanValue(); } } diff --git a/client/src/main/java/com/vaadin/client/ui/dd/VServerAccept.java b/client/src/main/java/com/vaadin/client/ui/dd/VServerAccept.java index 9ead6298b0..291e22e950 100644 --- a/client/src/main/java/com/vaadin/client/ui/dd/VServerAccept.java +++ b/client/src/main/java/com/vaadin/client/ui/dd/VServerAccept.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -14,7 +14,7 @@ * the License. */ /** - * + * */ package com.vaadin.client.ui.dd; diff --git a/client/src/main/java/com/vaadin/client/ui/dd/VSourceIsTarget.java b/client/src/main/java/com/vaadin/client/ui/dd/VSourceIsTarget.java index 3e453b4105..01d8fc2c6f 100644 --- a/client/src/main/java/com/vaadin/client/ui/dd/VSourceIsTarget.java +++ b/client/src/main/java/com/vaadin/client/ui/dd/VSourceIsTarget.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -14,7 +14,7 @@ * the License. */ /** - * + * */ package com.vaadin.client.ui.dd; diff --git a/client/src/main/java/com/vaadin/client/ui/dd/VTargetDetailIs.java b/client/src/main/java/com/vaadin/client/ui/dd/VTargetDetailIs.java index 9084d7df89..1ced0afc3c 100644 --- a/client/src/main/java/com/vaadin/client/ui/dd/VTargetDetailIs.java +++ b/client/src/main/java/com/vaadin/client/ui/dd/VTargetDetailIs.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -14,7 +14,7 @@ * the License. */ /** - * + * */ package com.vaadin.client.ui.dd; @@ -28,8 +28,8 @@ final public class VTargetDetailIs extends VAcceptCriterion { @Override protected boolean accept(VDragEvent drag, UIDL configuration) { String name = configuration.getStringAttribute("p"); - String t = configuration.hasAttribute("t") ? configuration - .getStringAttribute("t").intern() : "s"; + String t = configuration.hasAttribute("t") + ? configuration.getStringAttribute("t").intern() : "s"; Object value = null; if (t == "s") { value = configuration.getStringAttribute("v"); diff --git a/client/src/main/java/com/vaadin/client/ui/dd/VTargetInSubtree.java b/client/src/main/java/com/vaadin/client/ui/dd/VTargetInSubtree.java index 1641eb30f1..489a489196 100644 --- a/client/src/main/java/com/vaadin/client/ui/dd/VTargetInSubtree.java +++ b/client/src/main/java/com/vaadin/client/ui/dd/VTargetInSubtree.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -14,7 +14,7 @@ * the License. */ /** - * + * */ package com.vaadin.client.ui.dd; @@ -33,8 +33,8 @@ final public class VTargetInSubtree extends VAcceptCriterion { VTree tree = (VTree) VDragAndDropManager.get().getCurrentDropHandler() .getConnector().getWidget(); - TreeNode treeNode = tree.getNodeByKey((String) drag.getDropDetails() - .get("itemIdOver")); + TreeNode treeNode = tree + .getNodeByKey((String) drag.getDropDetails().get("itemIdOver")); if (treeNode != null) { Widget parent2 = treeNode; int depth = configuration.getIntAttribute("depth"); diff --git a/client/src/main/java/com/vaadin/client/ui/dd/VTransferable.java b/client/src/main/java/com/vaadin/client/ui/dd/VTransferable.java index b03dcbcb35..479cadb159 100644 --- a/client/src/main/java/com/vaadin/client/ui/dd/VTransferable.java +++ b/client/src/main/java/com/vaadin/client/ui/dd/VTransferable.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -24,7 +24,7 @@ import com.vaadin.event.dd.DragSource; /** * Client side counterpart for Transferable in com.vaadin.event.Transferable - * + * */ public class VTransferable { @@ -35,7 +35,7 @@ public class VTransferable { /** * Returns the component from which the transferable is created (eg. a tree * which node is dragged). - * + * * @return the component */ public ComponentConnector getDragSource() { @@ -49,7 +49,7 @@ public class VTransferable { * The server side counterpart of the component may implement * {@link DragSource} interface if it wants to translate or complement the * server side instance of this Transferable. - * + * * @param component * the component to set */ @@ -71,7 +71,7 @@ public class VTransferable { /** * This helper method should only be called by {@link VDragAndDropManager}. - * + * * @return data in this Transferable that needs to be moved to server. */ Map getVariableMap() { diff --git a/client/src/main/java/com/vaadin/client/ui/draganddropwrapper/DragAndDropWrapperConnector.java b/client/src/main/java/com/vaadin/client/ui/draganddropwrapper/DragAndDropWrapperConnector.java index 7ea9596809..f11b4a8b2d 100644 --- a/client/src/main/java/com/vaadin/client/ui/draganddropwrapper/DragAndDropWrapperConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/draganddropwrapper/DragAndDropWrapperConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -78,11 +78,13 @@ public class DragAndDropWrapperConnector extends CustomComponentConnector && !receiverUrl .equals(getWidget().fileIdToReceiver .get(fileId))) { - VConsole.error("Overwriting file receiver mapping for fileId " - + fileId - + " . Old receiver URL: " - + getWidget().fileIdToReceiver.get(fileId) - + " New receiver URL: " + receiverUrl); + VConsole.error( + "Overwriting file receiver mapping for fileId " + + fileId + " . Old receiver URL: " + + getWidget().fileIdToReceiver + .get(fileId) + + " New receiver URL: " + + receiverUrl); } getWidget().fileIdToReceiver.put(fileId, receiverUrl); } @@ -90,11 +92,11 @@ public class DragAndDropWrapperConnector extends CustomComponentConnector } getWidget().startNextUpload(); - getWidget().dragStartMode = uidl - .getIntAttribute(DragAndDropWrapperConstants.DRAG_START_MODE); + getWidget().dragStartMode = uidl.getIntAttribute( + DragAndDropWrapperConstants.DRAG_START_MODE); - String dragImageComponentConnectorId = uidl - .getStringAttribute(DragAndDropWrapperConstants.DRAG_START_COMPONENT_ATTRIBUTE); + String dragImageComponentConnectorId = uidl.getStringAttribute( + DragAndDropWrapperConstants.DRAG_START_COMPONENT_ATTRIBUTE); ComponentConnector connector = null; if (dragImageComponentConnectorId != null) { @@ -102,8 +104,7 @@ public class DragAndDropWrapperConnector extends CustomComponentConnector .getConnector(dragImageComponentConnectorId); if (connector == null) { - getLogger().log( - Level.WARNING, + getLogger().log(Level.WARNING, "DragAndDropWrapper drag image component" + " connector now found. Make sure the" + " component is attached."); @@ -112,8 +113,8 @@ public class DragAndDropWrapperConnector extends CustomComponentConnector } } getWidget().initDragStartMode(); - getWidget().html5DataFlavors = uidl - .getMapAttribute(DragAndDropWrapperConstants.HTML5_DATA_FLAVORS); + getWidget().html5DataFlavors = uidl.getMapAttribute( + DragAndDropWrapperConstants.HTML5_DATA_FLAVORS); // Used to prevent wrapper from stealing tooltips when not defined getWidget().hasTooltip = getState().description != null; diff --git a/client/src/main/java/com/vaadin/client/ui/embedded/EmbeddedConnector.java b/client/src/main/java/com/vaadin/client/ui/embedded/EmbeddedConnector.java index 7b837726a7..168f0e7f70 100644 --- a/client/src/main/java/com/vaadin/client/ui/embedded/EmbeddedConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/embedded/EmbeddedConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -44,8 +44,8 @@ import com.vaadin.shared.ui.embedded.EmbeddedState; import com.vaadin.ui.Embedded; @Connect(Embedded.class) -public class EmbeddedConnector extends AbstractComponentConnector implements - Paintable { +public class EmbeddedConnector extends AbstractComponentConnector + implements Paintable { private Element resourceElement; private ObjectElement objectElement; @@ -136,9 +136,9 @@ public class EmbeddedConnector extends AbstractComponentConnector implements setResourceUrl(getResourceUrl("src")); if (uidl.hasAttribute(EmbeddedConstants.ALTERNATE_TEXT)) { - el.setPropertyString( - EmbeddedConstants.ALTERNATE_TEXT, - uidl.getStringAttribute(EmbeddedConstants.ALTERNATE_TEXT)); + el.setPropertyString(EmbeddedConstants.ALTERNATE_TEXT, + uidl.getStringAttribute( + EmbeddedConstants.ALTERNATE_TEXT)); } if (created) { @@ -160,16 +160,16 @@ public class EmbeddedConnector extends AbstractComponentConnector implements + " allowTransparency=\"true\" src=\"\"" + " name=\"" + uidl.getId() + "\">"); - getWidget().browserElement = DOM.getFirstChild(getWidget() - .getElement()); + getWidget().browserElement = DOM + .getFirstChild(getWidget().getElement()); } resourceElement = getWidget().browserElement; objectElement = null; setResourceUrl(getResourceUrl("src")); clearBrowserElement = false; } else { - VConsole.error("Unknown Embedded type '" + getWidget().type - + "'"); + VConsole.error( + "Unknown Embedded type '" + getWidget().type + "'"); } } else if (uidl.hasAttribute("mimetype")) { // remove old style name related to type @@ -235,8 +235,8 @@ public class EmbeddedConnector extends AbstractComponentConnector implements } getWidget().getElement().appendChild(obj); if (uidl.hasAttribute(EmbeddedConstants.ALTERNATE_TEXT)) { - obj.setInnerText(uidl - .getStringAttribute(EmbeddedConstants.ALTERNATE_TEXT)); + obj.setInnerText(uidl.getStringAttribute( + EmbeddedConstants.ALTERNATE_TEXT)); } } else { VConsole.error("Unknown Embedded mimetype '" + mime + "'"); diff --git a/client/src/main/java/com/vaadin/client/ui/flash/FlashConnector.java b/client/src/main/java/com/vaadin/client/ui/flash/FlashConnector.java index e859e9cbf1..856fc776a8 100644 --- a/client/src/main/java/com/vaadin/client/ui/flash/FlashConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/flash/FlashConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/form/FormConnector.java b/client/src/main/java/com/vaadin/client/ui/form/FormConnector.java index 857c2bd40e..3c5da2bbd8 100644 --- a/client/src/main/java/com/vaadin/client/ui/form/FormConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/form/FormConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -54,8 +54,8 @@ public class FormConnector extends AbstractComponentContainerConnector } if (form.errorMessage.isVisible()) { - footerHeight += lm.getOuterHeight(form.errorMessage - .getElement()); + footerHeight += lm + .getOuterHeight(form.errorMessage.getElement()); footerHeight -= lm.getMarginTop(form.errorMessage.getElement()); form.errorMessage.getElement().getStyle() .setMarginTop(-footerHeight, Unit.PX); diff --git a/client/src/main/java/com/vaadin/client/ui/formlayout/FormLayoutConnector.java b/client/src/main/java/com/vaadin/client/ui/formlayout/FormLayoutConnector.java index 39992d91a6..682d0dfd1f 100644 --- a/client/src/main/java/com/vaadin/client/ui/formlayout/FormLayoutConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/formlayout/FormLayoutConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -45,8 +45,8 @@ import com.vaadin.shared.ui.orderedlayout.FormLayoutState; import com.vaadin.ui.FormLayout; @Connect(FormLayout.class) -public class FormLayoutConnector extends AbstractLayoutConnector implements - PostLayoutListener { +public class FormLayoutConnector extends AbstractLayoutConnector + implements PostLayoutListener { /* * Handlers & Listeners @@ -85,8 +85,8 @@ public class FormLayoutConnector extends AbstractLayoutConnector implements LayoutManager layoutManager = getLayoutManager(); double tableWidth = layoutManager .getOuterWidthDouble(getWidget().table.getElement()); - double ownWidth = layoutManager.getInnerWidthDouble(getWidget() - .getElement()); + double ownWidth = layoutManager + .getInnerWidthDouble(getWidget().getElement()); if (ownWidth < tableWidth) { // Something inside the table prevents it from shrinking, // temporarily force column widths @@ -113,8 +113,8 @@ public class FormLayoutConnector extends AbstractLayoutConnector implements // Restrict content td width // Round down to prevent interactions with fractional sizes of // other columns - int targetWidth = (int) Math.floor(componentColWidth - - excessWidth); + int targetWidth = (int) Math + .floor(componentColWidth - excessWidth); // Target might be negative if captions are wider than the total // available width @@ -152,8 +152,8 @@ public class FormLayoutConnector extends AbstractLayoutConnector implements public void onUnregister() { getLayoutManager().removeElementResizeListener( getWidget().table.getElement(), resizeListener); - getLayoutManager().removeElementResizeListener( - getWidget().getElement(), resizeListener); + getLayoutManager().removeElementResizeListener(getWidget().getElement(), + resizeListener); removeComponentCellListener(); super.onUnregister(); } @@ -176,7 +176,8 @@ public class FormLayoutConnector extends AbstractLayoutConnector implements } @Override - public void onConnectorHierarchyChange(ConnectorHierarchyChangeEvent event) { + public void onConnectorHierarchyChange( + ConnectorHierarchyChangeEvent event) { VFormLayout formLayout = getWidget(); VFormLayoutTable formLayoutTable = getWidget().table; @@ -249,7 +250,8 @@ public class FormLayoutConnector extends AbstractLayoutConnector implements // FIXME This incorrectly depends on AbstractFieldConnector if (component instanceof AbstractFieldConnector) { - hideErrors = ((AbstractFieldConnector) component).getState().hideErrors; + hideErrors = ((AbstractFieldConnector) component) + .getState().hideErrors; } getWidget().table.updateError(component.getWidget(), diff --git a/client/src/main/java/com/vaadin/client/ui/gridlayout/GridLayoutConnector.java b/client/src/main/java/com/vaadin/client/ui/gridlayout/GridLayoutConnector.java index 03beb3c1e0..1a81c657a0 100644 --- a/client/src/main/java/com/vaadin/client/ui/gridlayout/GridLayoutConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/gridlayout/GridLayoutConnector.java @@ -111,7 +111,8 @@ public class GridLayoutConnector extends AbstractComponentContainerConnector layout.colExpandRatioArray = getState().colExpand; layout.rowExpandRatioArray = getState().rowExpand; - layout.updateMarginStyleNames(new MarginInfo(getState().marginsBitmask)); + layout.updateMarginStyleNames( + new MarginInfo(getState().marginsBitmask)); layout.updateSpacingStyleName(getState().spacing); getLayoutManager().setNeedsLayout(this); } @@ -132,7 +133,8 @@ public class GridLayoutConnector extends AbstractComponentContainerConnector } @Override - public void onConnectorHierarchyChange(ConnectorHierarchyChangeEvent event) { + public void onConnectorHierarchyChange( + ConnectorHierarchyChangeEvent event) { VGridLayout layout = getWidget(); // clean non rendered components diff --git a/client/src/main/java/com/vaadin/client/ui/image/ImageConnector.java b/client/src/main/java/com/vaadin/client/ui/image/ImageConnector.java index e4ba4af070..042cbd2d40 100644 --- a/client/src/main/java/com/vaadin/client/ui/image/ImageConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/image/ImageConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/label/LabelConnector.java b/client/src/main/java/com/vaadin/client/ui/label/LabelConnector.java index fc94f27cf0..c0f1d37bdc 100644 --- a/client/src/main/java/com/vaadin/client/ui/label/LabelConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/label/LabelConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/layout/ComponentConnectorLayoutSlot.java b/client/src/main/java/com/vaadin/client/ui/layout/ComponentConnectorLayoutSlot.java index b323fde1db..3df4833772 100644 --- a/client/src/main/java/com/vaadin/client/ui/layout/ComponentConnectorLayoutSlot.java +++ b/client/src/main/java/com/vaadin/client/ui/layout/ComponentConnectorLayoutSlot.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -39,15 +39,15 @@ public class ComponentConnectorLayoutSlot extends VLayoutSlot { @Override protected int getCaptionHeight() { VCaption caption = getCaption(); - return caption != null ? getLayoutManager().getOuterHeight( - caption.getElement()) : 0; + return caption != null + ? getLayoutManager().getOuterHeight(caption.getElement()) : 0; } @Override protected int getCaptionWidth() { VCaption caption = getCaption(); - return caption != null ? getLayoutManager().getOuterWidth( - caption.getElement()) : 0; + return caption != null + ? getLayoutManager().getOuterWidth(caption.getElement()) : 0; } public LayoutManager getLayoutManager() { diff --git a/client/src/main/java/com/vaadin/client/ui/layout/ElementResizeEvent.java b/client/src/main/java/com/vaadin/client/ui/layout/ElementResizeEvent.java index a1f75baff4..91aa7850c0 100644 --- a/client/src/main/java/com/vaadin/client/ui/layout/ElementResizeEvent.java +++ b/client/src/main/java/com/vaadin/client/ui/layout/ElementResizeEvent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/layout/ElementResizeListener.java b/client/src/main/java/com/vaadin/client/ui/layout/ElementResizeListener.java index 97ca34a8a4..6a625f72d1 100644 --- a/client/src/main/java/com/vaadin/client/ui/layout/ElementResizeListener.java +++ b/client/src/main/java/com/vaadin/client/ui/layout/ElementResizeListener.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/layout/LayoutDependencyTree.java b/client/src/main/java/com/vaadin/client/ui/layout/LayoutDependencyTree.java index 27733bfbe3..5f277a903e 100644 --- a/client/src/main/java/com/vaadin/client/ui/layout/LayoutDependencyTree.java +++ b/client/src/main/java/com/vaadin/client/ui/layout/LayoutDependencyTree.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -37,7 +37,7 @@ import com.vaadin.shared.AbstractComponentState; /** * Internal class used to keep track of layout dependencies during one layout * run. This class is not intended to be used directly by applications. - * + * * @author Vaadin Ltd * @since 7.0.0 */ @@ -67,8 +67,8 @@ public class LayoutDependencyTree { layoutBlockers.add(blockerId); if (wasEmpty) { if (needsLayout) { - getLayoutQueue(direction).remove( - connector.getConnectorId()); + getLayoutQueue(direction) + .remove(connector.getConnectorId()); } else { // Propagation already done if needsLayout is set propagatePotentialLayout(); @@ -83,8 +83,8 @@ public class LayoutDependencyTree { layoutBlockers.remove(blockerId); if (layoutBlockers.isEmpty()) { if (needsLayout) { - getLayoutQueue(direction).add( - connector.getConnectorId()); + getLayoutQueue(direction) + .add(connector.getConnectorId()); } else { propagateNoUpcomingLayout(); } @@ -102,8 +102,8 @@ public class LayoutDependencyTree { measureBlockers.add(blockerId); if (wasEmpty) { if (needsMeasure) { - getMeasureQueue(direction).remove( - connector.getConnectorId()); + getMeasureQueue(direction) + .remove(connector.getConnectorId()); } else { propagatePotentialResize(); } @@ -247,7 +247,8 @@ public class LayoutDependencyTree { if (connector instanceof HasComponentsConnector) { HasComponentsConnector container = (HasComponentsConnector) connector; - for (ComponentConnector child : container.getChildComponents()) { + for (ComponentConnector child : container + .getChildComponents()) { if (!Util.shouldSkipMeasurementOfConnector(child, connector) && isRelativeInDirection(child, direction)) { resized.push(child.getConnectorId()); @@ -280,15 +281,19 @@ public class LayoutDependencyTree { LayoutDependency layoutDependency = getDependency(connectorId, direction); if (layoutDependency.connector instanceof ManagedLayout) { - Profiler.enter("LayoutDependency.markSizeAsChanged setNeedsLayout"); + Profiler.enter( + "LayoutDependency.markSizeAsChanged setNeedsLayout"); layoutDependency.setNeedsLayout(true); - Profiler.leave("LayoutDependency.markSizeAsChanged setNeedsLayout"); + Profiler.leave( + "LayoutDependency.markSizeAsChanged setNeedsLayout"); } else { - Profiler.enter("LayoutDependency.markSizeAsChanged propagatePostLayoutMeasure"); + Profiler.enter( + "LayoutDependency.markSizeAsChanged propagatePostLayoutMeasure"); // Should simulate setNeedsLayout(true) + markAsLayouted -> // propagate needs measure layoutDependency.propagatePostLayoutMeasure(); - Profiler.leave("LayoutDependency.markSizeAsChanged propagatePostLayoutMeasure"); + Profiler.leave( + "LayoutDependency.markSizeAsChanged propagatePostLayoutMeasure"); } } Profiler.leave("LayoutDependency.markSizeAsChanged phase 1"); @@ -296,7 +301,8 @@ public class LayoutDependencyTree { Profiler.enter("LayoutDependency.markSizeAsChanged scrollbars"); // Should also go through the hierarchy to discover appeared or // disappeared scrollbars - ComponentConnector scrollingBoundary = getScrollingBoundary(connector); + ComponentConnector scrollingBoundary = getScrollingBoundary( + connector); if (scrollingBoundary != null) { getDependency(scrollingBoundary.getConnectorId(), getOppositeDirection()).setNeedsMeasure(true); @@ -309,7 +315,7 @@ public class LayoutDependencyTree { * Go up the hierarchy to find a component whose size might have changed * in the other direction because changes to this component causes * scrollbars to appear or disappear. - * + * * @return */ private LayoutDependency findPotentiallyChangedScrollbar() { @@ -343,28 +349,34 @@ public class LayoutDependencyTree { } private void propagatePostLayoutMeasure() { - Profiler.enter("LayoutDependency.propagatePostLayoutMeasure getResizedByLayout"); + Profiler.enter( + "LayoutDependency.propagatePostLayoutMeasure getResizedByLayout"); JsArrayString resizedByLayout = getResizedByLayout(); - Profiler.leave("LayoutDependency.propagatePostLayoutMeasure getResizedByLayout"); + Profiler.leave( + "LayoutDependency.propagatePostLayoutMeasure getResizedByLayout"); int length = resizedByLayout.length(); for (int i = 0; i < length; i++) { - Profiler.enter("LayoutDependency.propagatePostLayoutMeasure setNeedsMeasure"); + Profiler.enter( + "LayoutDependency.propagatePostLayoutMeasure setNeedsMeasure"); String resizedId = resizedByLayout.get(i); LayoutDependency layoutDependency = getDependency(resizedId, direction); layoutDependency.setNeedsMeasure(true); - Profiler.leave("LayoutDependency.propagatePostLayoutMeasure setNeedsMeasure"); + Profiler.leave( + "LayoutDependency.propagatePostLayoutMeasure setNeedsMeasure"); } // Special case for e.g. wrapping texts - Profiler.enter("LayoutDependency.propagatePostLayoutMeasure horizontal case"); + Profiler.enter( + "LayoutDependency.propagatePostLayoutMeasure horizontal case"); if (direction == HORIZONTAL && !connector.isUndefinedWidth() && connector.isUndefinedHeight()) { LayoutDependency dependency = getDependency( connector.getConnectorId(), VERTICAL); dependency.setNeedsMeasure(true); } - Profiler.leave("LayoutDependency.propagatePostLayoutMeasure horizontal case"); + Profiler.leave( + "LayoutDependency.propagatePostLayoutMeasure horizontal case"); } @Override @@ -377,13 +389,15 @@ public class LayoutDependencyTree { } AbstractComponentState state = connector.getState(); s += " sizing: " - + getSizeDefinition(direction == VERTICAL ? state.height - : state.width) + "\n"; + + getSizeDefinition( + direction == VERTICAL ? state.height : state.width) + + "\n"; if (needsLayout) { s += "Needs layout\n"; } - if (getLayoutQueue(direction).contains(connector.getConnectorId())) { + if (getLayoutQueue(direction) + .contains(connector.getConnectorId())) { s += "In layout queue\n"; } s += "Layout blockers: " + blockersToString(layoutBlockers) + "\n"; @@ -391,7 +405,8 @@ public class LayoutDependencyTree { if (needsMeasure) { s += "Needs measure\n"; } - if (getMeasureQueue(direction).contains(connector.getConnectorId())) { + if (getMeasureQueue(direction) + .contains(connector.getConnectorId())) { s += "In measure queue\n"; } s += "Measure blockers: " + blockersToString(measureBlockers); @@ -434,15 +449,15 @@ public class LayoutDependencyTree { /** * @param connectorId * @param needsMeasure - * + * * @deprecated As of 7.4.2, use * {@link #setNeedsMeasure(ComponentConnector, boolean)} for * improved performance. */ @Deprecated public void setNeedsMeasure(String connectorId, boolean needsMeasure) { - ComponentConnector connector = (ComponentConnector) ConnectorMap.get( - connection).getConnector(connectorId); + ComponentConnector connector = (ComponentConnector) ConnectorMap + .get(connection).getConnector(connectorId); if (connector == null) { return; } @@ -459,8 +474,8 @@ public class LayoutDependencyTree { public void setNeedsHorizontalMeasure(String connectorId, boolean needsMeasure) { // Ensure connector exists - ComponentConnector connector = (ComponentConnector) ConnectorMap.get( - connection).getConnector(connectorId); + ComponentConnector connector = (ComponentConnector) ConnectorMap + .get(connection).getConnector(connectorId); if (connector == null) { return; } @@ -474,10 +489,11 @@ public class LayoutDependencyTree { dependency.setNeedsMeasure(needsMeasure); } - public void setNeedsVerticalMeasure(String connectorId, boolean needsMeasure) { + public void setNeedsVerticalMeasure(String connectorId, + boolean needsMeasure) { // Ensure connector exists - ComponentConnector connector = (ComponentConnector) ConnectorMap.get( - connection).getConnector(connectorId); + ComponentConnector connector = (ComponentConnector) ConnectorMap + .get(connection).getConnector(connectorId); if (connector == null) { return; } @@ -503,9 +519,8 @@ public class LayoutDependencyTree { connector = (ComponentConnector) ConnectorMap.get(connection) .getConnector(connectorId); if (connector == null) { - getLogger().warning( - "No connector found for id " + connectorId - + " while creating LayoutDependency"); + getLogger().warning("No connector found for id " + + connectorId + " while creating LayoutDependency"); return null; } } @@ -526,7 +541,7 @@ public class LayoutDependencyTree { /** * @param layout * @param needsLayout - * + * * @deprecated As of 7.0.1, use * {@link #setNeedsHorizontalLayout(String, boolean)} for * improved performance. @@ -537,30 +552,33 @@ public class LayoutDependencyTree { setNeedsHorizontalLayout(layout.getConnectorId(), needsLayout); } - public void setNeedsHorizontalLayout(String connectorId, boolean needsLayout) { + public void setNeedsHorizontalLayout(String connectorId, + boolean needsLayout) { LayoutDependency dependency = getDependency(connectorId, HORIZONTAL); if (dependency != null) { dependency.setNeedsLayout(needsLayout); } else { - getLogger().warning( - "No dependency found in setNeedsHorizontalLayout"); + getLogger() + .warning("No dependency found in setNeedsHorizontalLayout"); } } /** * @param layout * @param needsLayout - * + * * @deprecated As of 7.0.1, use * {@link #setNeedsVerticalLayout(String, boolean)} for improved * performance. */ @Deprecated - public void setNeedsVerticalLayout(ManagedLayout layout, boolean needsLayout) { + public void setNeedsVerticalLayout(ManagedLayout layout, + boolean needsLayout) { setNeedsVerticalLayout(layout.getConnectorId(), needsLayout); } - public void setNeedsVerticalLayout(String connectorId, boolean needsLayout) { + public void setNeedsVerticalLayout(String connectorId, + boolean needsLayout) { LayoutDependency dependency = getDependency(connectorId, VERTICAL); if (dependency != null) { dependency.setNeedsLayout(needsLayout); @@ -634,8 +652,8 @@ public class LayoutDependencyTree { ConnectorMap connectorMap = ConnectorMap.get(connection); JsArrayString blockersDump = blockers.dump(); for (int i = 0; i < blockersDump.length(); i++) { - ServerConnector blocker = connectorMap.getConnector(blockersDump - .get(i)); + ServerConnector blocker = connectorMap + .getConnector(blockersDump.get(i)); if (b.length() != 1) { b.append(", "); } @@ -678,7 +696,8 @@ public class LayoutDependencyTree { return asManagedLayoutArray(getVerticalLayoutTargetsJsArray()); } - private ManagedLayout[] asManagedLayoutArray(JsArrayString connectorIdArray) { + private ManagedLayout[] asManagedLayoutArray( + JsArrayString connectorIdArray) { int length = connectorIdArray.length(); ConnectorMap connectorMap = ConnectorMap.get(connection); ManagedLayout[] result = new ManagedLayout[length]; @@ -738,7 +757,8 @@ public class LayoutDependencyTree { .noMoreChangesExpected(); } - public ComponentConnector getScrollingBoundary(ComponentConnector connector) { + public ComponentConnector getScrollingBoundary( + ComponentConnector connector) { LayoutDependency dependency = getDependency(connector.getConnectorId(), HORIZONTAL); if (!dependency.scrollingParentCached) { @@ -746,7 +766,8 @@ public class LayoutDependencyTree { if (parent instanceof MayScrollChildren) { dependency.scrollingBoundary = connector; } else if (parent instanceof ComponentConnector) { - dependency.scrollingBoundary = getScrollingBoundary((ComponentConnector) parent); + dependency.scrollingBoundary = getScrollingBoundary( + (ComponentConnector) parent); } else { // No scrolling parent } diff --git a/client/src/main/java/com/vaadin/client/ui/layout/Margins.java b/client/src/main/java/com/vaadin/client/ui/layout/Margins.java index 75839c9ce8..a1466b9b61 100644 --- a/client/src/main/java/com/vaadin/client/ui/layout/Margins.java +++ b/client/src/main/java/com/vaadin/client/ui/layout/Margins.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/layout/MayScrollChildren.java b/client/src/main/java/com/vaadin/client/ui/layout/MayScrollChildren.java index 2a0b821646..9b9e90cefa 100644 --- a/client/src/main/java/com/vaadin/client/ui/layout/MayScrollChildren.java +++ b/client/src/main/java/com/vaadin/client/ui/layout/MayScrollChildren.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/layout/VLayoutSlot.java b/client/src/main/java/com/vaadin/client/ui/layout/VLayoutSlot.java index 5260e1866e..762056de0d 100644 --- a/client/src/main/java/com/vaadin/client/ui/layout/VLayoutSlot.java +++ b/client/src/main/java/com/vaadin/client/ui/layout/VLayoutSlot.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -52,7 +52,8 @@ public abstract class VLayoutSlot { this.caption = caption; if (caption != null) { // Physical attach. - DOM.insertBefore(wrapper, caption.getElement(), widget.getElement()); + DOM.insertBefore(wrapper, caption.getElement(), + widget.getElement()); Style style = caption.getElement().getStyle(); style.setPosition(Position.ABSOLUTE); style.setTop(0, Unit.PX); @@ -119,7 +120,8 @@ public abstract class VLayoutSlot { .getWidth(); double percentage = parsePercent(percentWidth); allocatedContentWidth = availableWidth * (percentage / 100); - reportActualRelativeWidth(Math.round((float) allocatedContentWidth)); + reportActualRelativeWidth( + Math.round((float) allocatedContentWidth)); } double usedWidth; // widget width in px @@ -191,8 +193,8 @@ public abstract class VLayoutSlot { String height = getWidget().getElement().getStyle().getHeight(); double percentage = parsePercent(height); allocatedContentHeight = contentHeight * (percentage / 100); - reportActualRelativeHeight(Math - .round((float) allocatedContentHeight)); + reportActualRelativeHeight( + Math.round((float) allocatedContentHeight)); } style.setTop(currentLocation, Unit.PX); diff --git a/client/src/main/java/com/vaadin/client/ui/link/LinkConnector.java b/client/src/main/java/com/vaadin/client/ui/link/LinkConnector.java index 1e77fb51b4..fb49db05c9 100644 --- a/client/src/main/java/com/vaadin/client/ui/link/LinkConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/link/LinkConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -80,8 +80,8 @@ public class LinkConnector extends AbstractComponentConnector { DOM.insertChild(getWidget().getElement(), getWidget().errorIndicatorElement, 0); } else if (getWidget().errorIndicatorElement != null) { - getWidget().errorIndicatorElement.getStyle().setDisplay( - Display.NONE); + getWidget().errorIndicatorElement.getStyle() + .setDisplay(Display.NONE); } if (getWidget().icon != null) { diff --git a/client/src/main/java/com/vaadin/client/ui/listselect/ListSelectConnector.java b/client/src/main/java/com/vaadin/client/ui/listselect/ListSelectConnector.java index b867a3358c..1334e92c6d 100644 --- a/client/src/main/java/com/vaadin/client/ui/listselect/ListSelectConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/listselect/ListSelectConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/loginform/LoginFormConnector.java b/client/src/main/java/com/vaadin/client/ui/loginform/LoginFormConnector.java index da80287826..e7ea956b8c 100644 --- a/client/src/main/java/com/vaadin/client/ui/loginform/LoginFormConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/loginform/LoginFormConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -41,8 +41,8 @@ import com.vaadin.shared.ui.loginform.LoginFormState; import com.google.gwt.core.client.Scheduler; @Connect(com.vaadin.ui.LoginForm.class) -public class LoginFormConnector extends - AbstractSingleComponentContainerConnector { +public class LoginFormConnector + extends AbstractSingleComponentContainerConnector { private VTextField passwordField; private VTextField userField; @@ -63,13 +63,15 @@ public class LoginFormConnector extends super.init(); loginFormRpc = getRpcProxy(LoginFormRpc.class); - getWidget().addSubmitCompleteHandler(new FormPanel.SubmitCompleteHandler() { - @Override - public void onSubmitComplete(FormPanel.SubmitCompleteEvent event) { - valuesChanged(); - loginFormRpc.submitCompleted(); - } - }); + getWidget().addSubmitCompleteHandler( + new FormPanel.SubmitCompleteHandler() { + @Override + public void onSubmitComplete( + FormPanel.SubmitCompleteEvent event) { + valuesChanged(); + loginFormRpc.submitCompleted(); + } + }); } @Override @@ -78,7 +80,8 @@ public class LoginFormConnector extends } @Override - public void onConnectorHierarchyChange(ConnectorHierarchyChangeEvent event) { + public void onConnectorHierarchyChange( + ConnectorHierarchyChangeEvent event) { ComponentConnector content = getContent(); if (content != null) { getWidget().setWidget(getContentWidget()); @@ -90,7 +93,8 @@ public class LoginFormConnector extends super.onStateChanged(stateChangeEvent); LoginFormState state = getState(); - userField = configureTextField(state.userNameFieldConnector, "username"); + userField = configureTextField(state.userNameFieldConnector, + "username"); passwordField = configureTextField(state.passwordFieldConnector, "password"); addSubmitButtonClickHandler(state.loginButtonConnector); @@ -135,11 +139,11 @@ public class LoginFormConnector extends private void addSubmitButtonClickHandler(Connector buttonConnector) { if (buttonConnector instanceof ButtonConnector) { - addSubmitButtonClickHandler(((ButtonConnector) buttonConnector) - .getWidget()); + addSubmitButtonClickHandler( + ((ButtonConnector) buttonConnector).getWidget()); } else if (buttonConnector instanceof NativeButtonConnector) { - addSubmitButtonClickHandler(((NativeButtonConnector) buttonConnector) - .getWidget()); + addSubmitButtonClickHandler( + ((NativeButtonConnector) buttonConnector).getWidget()); } } diff --git a/client/src/main/java/com/vaadin/client/ui/loginform/VLoginForm.java b/client/src/main/java/com/vaadin/client/ui/loginform/VLoginForm.java index e3dccd1ba5..d31ba55173 100644 --- a/client/src/main/java/com/vaadin/client/ui/loginform/VLoginForm.java +++ b/client/src/main/java/com/vaadin/client/ui/loginform/VLoginForm.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/menubar/MenuBar.java b/client/src/main/java/com/vaadin/client/ui/menubar/MenuBar.java index 833fb5a38a..25f2ca753f 100644 --- a/client/src/main/java/com/vaadin/client/ui/menubar/MenuBar.java +++ b/client/src/main/java/com/vaadin/client/ui/menubar/MenuBar.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -18,13 +18,13 @@ package com.vaadin.client.ui.menubar; /* * Copyright 2007 Google Inc. - * + * * Licensed under the Apache 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 @@ -51,24 +51,22 @@ import com.vaadin.client.ui.VOverlay; * A standard menu bar widget. A menu bar can contain any number of menu items, * each of which can either fire a {@link com.google.gwt.user.client.Command} or * open a cascaded menu bar. - * + * *

    * *

    - * + * *

    CSS Style Rules

    *
      *
    • .gwt-MenuBar { the menu bar itself }
    • *
    • .gwt-MenuBar .gwt-MenuItem { menu items }
    • - *
    • - * .gwt-MenuBar .gwt-MenuItem-selected { selected menu items }
    • + *
    • .gwt-MenuBar .gwt-MenuItem-selected { selected menu items }
    • *
    - * + * *

    - *

    Example

    - * {@example com.google.gwt.examples.MenuBarExample} + *

    Example

    {@example com.google.gwt.examples.MenuBarExample} *

    - * + * * @deprecated */ @Deprecated @@ -95,7 +93,7 @@ public class MenuBar extends Widget implements PopupListener { /** * Creates an empty menu bar. - * + * * @param vertical * true to orient the menu bar vertically */ @@ -123,7 +121,7 @@ public class MenuBar extends Widget implements PopupListener { /** * Adds a menu item to the bar. - * + * * @param item * the item to be added */ @@ -146,7 +144,7 @@ public class MenuBar extends Widget implements PopupListener { /** * Adds a menu item to the bar, that will fire the given command when it is * selected. - * + * * @param text * the item's text * @param asHTML @@ -164,7 +162,7 @@ public class MenuBar extends Widget implements PopupListener { /** * Adds a menu item to the bar, that will open the specified menu when it is * selected. - * + * * @param text * the item's text * @param asHTML @@ -182,7 +180,7 @@ public class MenuBar extends Widget implements PopupListener { /** * Adds a menu item to the bar, that will fire the given command when it is * selected. - * + * * @param text * the item's text * @param cmd @@ -198,7 +196,7 @@ public class MenuBar extends Widget implements PopupListener { /** * Adds a menu item to the bar, that will open the specified menu when it is * selected. - * + * * @param text * the item's text * @param popup @@ -225,7 +223,7 @@ public class MenuBar extends Widget implements PopupListener { /** * Gets whether this menu bar's child menus will open when the mouse is * moved over it. - * + * * @return true if child menus will auto-open */ public boolean getAutoOpen() { @@ -278,7 +276,7 @@ public class MenuBar extends Widget implements PopupListener { /** * Removes the specified menu item from the bar. - * + * * @param item * the item to be removed */ @@ -296,7 +294,7 @@ public class MenuBar extends Widget implements PopupListener { /** * Sets whether this menu bar's child menus will open when the mouse is * moved over it. - * + * * @param autoOpen * true to cause child menus to auto-open */ @@ -308,7 +306,7 @@ public class MenuBar extends Widget implements PopupListener { * Returns a list containing the MenuItem objects in the menu * bar. If there are no items in the menu bar, then an empty * List object will be returned. - * + * * @return a list containing the MenuItem objects in the menu * bar */ @@ -320,7 +318,7 @@ public class MenuBar extends Widget implements PopupListener { * Returns the MenuItem that is currently selected * (highlighted) by the user. If none of the items in the menu are currently * selected, then null will be returned. - * + * * @return the MenuItem that is currently selected, or * null if no items are currently selected */ @@ -330,7 +328,7 @@ public class MenuBar extends Widget implements PopupListener { /** * Gets the first item from the menu or null if no items. - * + * * @since 7.2.6 * @return the first item from the menu or null if no items. */ @@ -340,7 +338,7 @@ public class MenuBar extends Widget implements PopupListener { /** * Gest the last item from the menu or null if no items. - * + * * @since 7.2.6 * @return the last item from the menu or null if no items. */ @@ -351,7 +349,7 @@ public class MenuBar extends Widget implements PopupListener { /** * Gets the index of the selected item. - * + * * @since 7.2.6 * @return the index of the selected item. */ @@ -377,7 +375,8 @@ public class MenuBar extends Widget implements PopupListener { while (curMenu != null) { curMenu.close(); - if ((curMenu.parentMenu == null) && (curMenu.selectedItem != null)) { + if ((curMenu.parentMenu == null) + && (curMenu.selectedItem != null)) { curMenu.selectedItem.setSelectionStyle(false); curMenu.selectedItem = null; } @@ -391,7 +390,7 @@ public class MenuBar extends Widget implements PopupListener { * a popup associated with it, the popup will be shown. If it has a command * associated with it, and 'fireCommand' is true, then the command will be * fired. Popups associated with other items will be hidden. - * + * * @param item the item whose popup is to be shown. @param fireCommand * true if the item's command should be fired, * false otherwise. @@ -531,7 +530,7 @@ public class MenuBar extends Widget implements PopupListener { /** * Scroll the selected item into view. - * + * * @since 7.2.6 */ public void scrollSelectionIntoView() { @@ -540,7 +539,7 @@ public class MenuBar extends Widget implements PopupListener { /** * Sets the menu scroll enabled or disabled. - * + * * @since 7.2.6 * @param enabled * the enabled state of the scroll. @@ -564,7 +563,7 @@ public class MenuBar extends Widget implements PopupListener { /** * Gets whether the scroll is activate for this menu. - * + * * @since 7.2.6 * @return true if the scroll is active, otherwise false. */ @@ -579,7 +578,7 @@ public class MenuBar extends Widget implements PopupListener { /** * Gets the preferred height of the menu. - * + * * @since 7.2.6 */ protected int getPreferredHeight() { diff --git a/client/src/main/java/com/vaadin/client/ui/menubar/MenuBarConnector.java b/client/src/main/java/com/vaadin/client/ui/menubar/MenuBarConnector.java index 03eeb85165..c0b1c84bce 100644 --- a/client/src/main/java/com/vaadin/client/ui/menubar/MenuBarConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/menubar/MenuBarConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -36,13 +36,13 @@ import com.vaadin.shared.ui.menubar.MenuBarConstants; import com.vaadin.shared.ui.menubar.MenuBarState; @Connect(com.vaadin.ui.MenuBar.class) -public class MenuBarConnector extends AbstractComponentConnector implements - Paintable, SimpleManagedLayout { +public class MenuBarConnector extends AbstractComponentConnector + implements Paintable, SimpleManagedLayout { /** * This method must be implemented to update the client-side component from * UIDL data received from server. - * + * * This method is called when the page is loaded for the first time, and * every time UI changes in the component are received from the server. */ @@ -78,9 +78,8 @@ public class MenuBarConnector extends AbstractComponentConnector implements if (moreItemUIDL.hasAttribute("icon")) { itemHTML.append("\"\""); } @@ -97,8 +96,8 @@ public class MenuBarConnector extends AbstractComponentConnector implements getWidget().collapsedRootItems = new VMenuBar(true, getWidget()); getWidget().moreItem.setSubMenu(getWidget().collapsedRootItems); - getWidget().moreItem.addStyleName(getWidget().getStylePrimaryName() - + "-more-menuitem"); + getWidget().moreItem.addStyleName( + getWidget().getStylePrimaryName() + "-more-menuitem"); } UIDL uidlItems = uidl.getChildUIDL(1); @@ -155,7 +154,8 @@ public class MenuBarConnector extends AbstractComponentConnector implements while (!itr.hasNext() && !iteratorStack.empty()) { boolean hasCheckableItem = false; - for (VMenuBar.CustomMenuItem menuItem : currentMenu.getItems()) { + for (VMenuBar.CustomMenuItem menuItem : currentMenu + .getItems()) { hasCheckableItem = hasCheckableItem || menuItem.isCheckable(); } @@ -168,7 +168,7 @@ public class MenuBarConnector extends AbstractComponentConnector implements itr = iteratorStack.pop(); currentMenu = menuStack.pop(); } - }// while + } // while getLayoutManager().setNeedsHorizontalLayout(this); @@ -196,8 +196,8 @@ public class MenuBarConnector extends AbstractComponentConnector implements // Check content of widget to find tooltip for element if (element != getWidget().getElement()) { - VMenuBar.CustomMenuItem item = getWidget().getMenuItemWithElement( - element); + VMenuBar.CustomMenuItem item = getWidget() + .getMenuItemWithElement(element); if (item != null) { info = item.getTooltip(); } diff --git a/client/src/main/java/com/vaadin/client/ui/menubar/MenuItem.java b/client/src/main/java/com/vaadin/client/ui/menubar/MenuItem.java index bf2fbf8feb..f5dd968ad0 100644 --- a/client/src/main/java/com/vaadin/client/ui/menubar/MenuItem.java +++ b/client/src/main/java/com/vaadin/client/ui/menubar/MenuItem.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -18,13 +18,13 @@ package com.vaadin.client.ui.menubar; /* * Copyright 2007 Google Inc. - * + * * Licensed under the Apache 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 @@ -43,7 +43,7 @@ import com.google.gwt.user.client.ui.UIObject; * {@link com.google.gwt.user.client.ui.MenuBar}. Menu items can either fire a * {@link com.google.gwt.user.client.Command} when they are clicked, or open a * cascading sub-menu. - * + * * @deprecated */ @Deprecated @@ -56,7 +56,7 @@ public class MenuItem extends UIObject implements HasHTML { /** * Constructs a new menu item that fires a command when it is selected. - * + * * @param text * the item's text * @param cmd @@ -69,7 +69,7 @@ public class MenuItem extends UIObject implements HasHTML { /** * Constructs a new menu item that fires a command when it is selected. - * + * * @param text * the item's text * @param asHTML @@ -85,7 +85,7 @@ public class MenuItem extends UIObject implements HasHTML { /** * Constructs a new menu item that cascades to a sub-menu when it is * selected. - * + * * @param text * the item's text * @param subMenu @@ -99,7 +99,7 @@ public class MenuItem extends UIObject implements HasHTML { /** * Constructs a new menu item that cascades to a sub-menu when it is * selected. - * + * * @param text * the item's text * @param asHTML @@ -126,7 +126,7 @@ public class MenuItem extends UIObject implements HasHTML { /** * Gets the command associated with this item. - * + * * @return this item's command, or null if none exists */ public Command getCommand() { @@ -140,7 +140,7 @@ public class MenuItem extends UIObject implements HasHTML { /** * Gets the menu that contains this item. - * + * * @return the parent menu, or null if none exists. */ public MenuBar getParentMenu() { @@ -149,7 +149,7 @@ public class MenuItem extends UIObject implements HasHTML { /** * Gets the sub-menu associated with this item. - * + * * @return this item's sub-menu, or null if none exists */ public MenuBar getSubMenu() { @@ -163,7 +163,7 @@ public class MenuItem extends UIObject implements HasHTML { /** * Sets the command associated with this item. - * + * * @param cmd * the command to be associated with this item */ @@ -178,7 +178,7 @@ public class MenuItem extends UIObject implements HasHTML { /** * Sets the sub-menu associated with this item. - * + * * @param subMenu * this item's new sub-menu */ diff --git a/client/src/main/java/com/vaadin/client/ui/nativebutton/NativeButtonConnector.java b/client/src/main/java/com/vaadin/client/ui/nativebutton/NativeButtonConnector.java index 65d4a1eb9b..81823c3d3c 100644 --- a/client/src/main/java/com/vaadin/client/ui/nativebutton/NativeButtonConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/nativebutton/NativeButtonConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -67,8 +67,8 @@ public class NativeButtonConnector extends AbstractComponentConnector { getWidget().captionElement); } else if (getWidget().errorIndicatorElement != null) { - getWidget().getElement().removeChild( - getWidget().errorIndicatorElement); + getWidget().getElement() + .removeChild(getWidget().errorIndicatorElement); getWidget().errorIndicatorElement = null; } diff --git a/client/src/main/java/com/vaadin/client/ui/nativeselect/NativeSelectConnector.java b/client/src/main/java/com/vaadin/client/ui/nativeselect/NativeSelectConnector.java index d6ff2015b4..4adc233cdf 100644 --- a/client/src/main/java/com/vaadin/client/ui/nativeselect/NativeSelectConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/nativeselect/NativeSelectConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/optiongroup/OptionGroupBaseConnector.java b/client/src/main/java/com/vaadin/client/ui/optiongroup/OptionGroupBaseConnector.java index 0757bc395b..65135fe5e1 100644 --- a/client/src/main/java/com/vaadin/client/ui/optiongroup/OptionGroupBaseConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/optiongroup/OptionGroupBaseConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -43,8 +43,8 @@ public abstract class OptionGroupBaseConnector extends AbstractFieldConnector getWidget().selectedKeys = uidl.getStringArrayVariableAsSet("selected"); getWidget().setReadonly(isReadOnly()); - getWidget().multiselect = "multi".equals(uidl - .getStringAttribute("selectmode")); + getWidget().multiselect = "multi" + .equals(uidl.getStringAttribute("selectmode")); getWidget().immediate = getState().immediate; getWidget().nullSelectionAllowed = uidl .getBooleanAttribute("nullselect"); @@ -83,13 +83,13 @@ public abstract class OptionGroupBaseConnector extends AbstractFieldConnector getWidget().newItemField.addStyleName(StyleConstants.UI_WIDGET); } - getWidget().newItemField.setEnabled(getWidget().isEnabled() - && !getWidget().isReadonly()); - getWidget().newItemButton.setEnabled(getWidget().isEnabled() - && !getWidget().isReadonly()); + getWidget().newItemField.setEnabled( + getWidget().isEnabled() && !getWidget().isReadonly()); + getWidget().newItemButton.setEnabled( + getWidget().isEnabled() && !getWidget().isReadonly()); - if (getWidget().newItemField == null - || getWidget().newItemField.getParent() != getWidget().container) { + if (getWidget().newItemField == null || getWidget().newItemField + .getParent() != getWidget().container) { getWidget().container.add(getWidget().newItemField); getWidget().container.add(getWidget().newItemButton); final int w = getWidget().container.getOffsetWidth() diff --git a/client/src/main/java/com/vaadin/client/ui/optiongroup/OptionGroupConnector.java b/client/src/main/java/com/vaadin/client/ui/optiongroup/OptionGroupConnector.java index f9bdf455f6..2101ff5d39 100644 --- a/client/src/main/java/com/vaadin/client/ui/optiongroup/OptionGroupConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/optiongroup/OptionGroupConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -66,10 +66,10 @@ public class OptionGroupConnector extends OptionGroupBaseConnector { // add focus and blur handlers to checkboxes / radio buttons for (Widget wid : getWidget().panel) { if (wid instanceof CheckBox) { - getWidget().focusHandlers.add(((CheckBox) wid) - .addFocusHandler(getWidget())); - getWidget().blurHandlers.add(((CheckBox) wid) - .addBlurHandler(getWidget())); + getWidget().focusHandlers + .add(((CheckBox) wid).addFocusHandler(getWidget())); + getWidget().blurHandlers + .add(((CheckBox) wid).addBlurHandler(getWidget())); } } } diff --git a/client/src/main/java/com/vaadin/client/ui/orderedlayout/AbstractOrderedLayoutConnector.java b/client/src/main/java/com/vaadin/client/ui/orderedlayout/AbstractOrderedLayoutConnector.java index dbd530dde1..960bf71884 100644 --- a/client/src/main/java/com/vaadin/client/ui/orderedlayout/AbstractOrderedLayoutConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/orderedlayout/AbstractOrderedLayoutConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -52,8 +52,8 @@ import com.vaadin.shared.ui.orderedlayout.AbstractOrderedLayoutState; /** * Base class for vertical and horizontal ordered layouts */ -public abstract class AbstractOrderedLayoutConnector extends - AbstractLayoutConnector { +public abstract class AbstractOrderedLayoutConnector + extends AbstractLayoutConnector { /* * Handlers & Listeners @@ -132,11 +132,11 @@ public abstract class AbstractOrderedLayoutConnector extends String widgetWidth = widgetElement.getStyle().getWidth(); String widgetHeight = widgetElement.getStyle().getHeight(); - if (widgetHeight.endsWith("%") - && (pos == CaptionPosition.TOP || pos == CaptionPosition.BOTTOM)) { + if (widgetHeight.endsWith("%") && (pos == CaptionPosition.TOP + || pos == CaptionPosition.BOTTOM)) { getWidget().updateCaptionOffset(captionElement); - } else if (widgetWidth.endsWith("%") - && (pos == CaptionPosition.LEFT || pos == CaptionPosition.RIGHT)) { + } else if (widgetWidth.endsWith("%") && (pos == CaptionPosition.LEFT + || pos == CaptionPosition.RIGHT)) { getWidget().updateCaptionOffset(captionElement); } @@ -169,7 +169,7 @@ public abstract class AbstractOrderedLayoutConnector extends /* * (non-Javadoc) - * + * * @see com.vaadin.client.ui.AbstractComponentConnector#init() */ @Override @@ -180,7 +180,7 @@ public abstract class AbstractOrderedLayoutConnector extends /* * (non-Javadoc) - * + * * @see com.vaadin.client.ui.AbstractLayoutConnector#getState() */ @Override @@ -190,7 +190,7 @@ public abstract class AbstractOrderedLayoutConnector extends /* * (non-Javadoc) - * + * * @see com.vaadin.client.ui.AbstractComponentConnector#getWidget() */ @Override @@ -226,15 +226,15 @@ public abstract class AbstractOrderedLayoutConnector extends /** * The id of the previous response for which state changes have been * processed. If this is the same as the - * {@link ApplicationConnection#getLastSeenServerSyncId()}, it means that we can - * skip some quite expensive calculations because we know that the state + * {@link ApplicationConnection#getLastSeenServerSyncId()}, it means that we + * can skip some quite expensive calculations because we know that the state * hasn't changed since the last time the values were calculated. */ private int processedResponseId = -1; /* * (non-Javadoc) - * + * * @see com.vaadin.client.HasComponentsConnector#updateCaption(com.vaadin * .client.ComponentConnector) */ @@ -286,11 +286,11 @@ public abstract class AbstractOrderedLayoutConnector extends if (slot.hasCaption()) { CaptionPosition pos = slot.getCaptionPosition(); slot.setCaptionResizeListener(slotCaptionResizeListener); - if (child.isRelativeHeight() - && (pos == CaptionPosition.TOP || pos == CaptionPosition.BOTTOM)) { + if (child.isRelativeHeight() && (pos == CaptionPosition.TOP + || pos == CaptionPosition.BOTTOM)) { getWidget().updateCaptionOffset(slot.getCaptionElement()); - } else if (child.isRelativeWidth() - && (pos == CaptionPosition.LEFT || pos == CaptionPosition.RIGHT)) { + } else if (child.isRelativeWidth() && (pos == CaptionPosition.LEFT + || pos == CaptionPosition.RIGHT)) { getWidget().updateCaptionOffset(slot.getCaptionElement()); } } @@ -299,13 +299,14 @@ public abstract class AbstractOrderedLayoutConnector extends /* * (non-Javadoc) - * + * * @see com.vaadin.client.ui.AbstractComponentContainerConnector# * onConnectorHierarchyChange * (com.vaadin.client.ConnectorHierarchyChangeEvent) */ @Override - public void onConnectorHierarchyChange(ConnectorHierarchyChangeEvent event) { + public void onConnectorHierarchyChange( + ConnectorHierarchyChangeEvent event) { Profiler.enter("AOLC.onConnectorHierarchyChange"); List previousChildren = event.getOldChildren(); @@ -314,17 +315,21 @@ public abstract class AbstractOrderedLayoutConnector extends // remove spacing as it is exists as separate elements that cannot be // removed easily after reordering the contents - Profiler.enter("AOLC.onConnectorHierarchyChange temporarily remove spacing"); + Profiler.enter( + "AOLC.onConnectorHierarchyChange temporarily remove spacing"); layout.setSpacing(false); - Profiler.leave("AOLC.onConnectorHierarchyChange temporarily remove spacing"); + Profiler.leave( + "AOLC.onConnectorHierarchyChange temporarily remove spacing"); for (ComponentConnector child : getChildComponents()) { Profiler.enter("AOLC.onConnectorHierarchyChange add children"); Slot slot = layout.getSlot(child.getWidget()); if (slot.getParent() != layout) { - Profiler.enter("AOLC.onConnectorHierarchyChange add state change handler"); + Profiler.enter( + "AOLC.onConnectorHierarchyChange add state change handler"); child.addStateChangeHandler(childStateChangeHandler); - Profiler.leave("AOLC.onConnectorHierarchyChange add state change handler"); + Profiler.leave( + "AOLC.onConnectorHierarchyChange add state change handler"); } Profiler.enter("AOLC.onConnectorHierarchyChange addOrMoveSlot"); layout.addOrMoveSlot(slot, currentIndex++, false); @@ -362,7 +367,7 @@ public abstract class AbstractOrderedLayoutConnector extends /* * (non-Javadoc) - * + * * @see * com.vaadin.client.ui.AbstractComponentConnector#onStateChanged(com.vaadin * .client.communication.StateChangeEvent) @@ -380,20 +385,21 @@ public abstract class AbstractOrderedLayoutConnector extends /* * (non-Javadoc) - * + * * @see * com.vaadin.client.ui.AbstractComponentConnector#getTooltipInfo(com.google * .gwt.dom.client.Element) */ @Override - public TooltipInfo getTooltipInfo(com.google.gwt.dom.client.Element element) { + public TooltipInfo getTooltipInfo( + com.google.gwt.dom.client.Element element) { if (element != getWidget().getElement()) { Slot slot = WidgetUtil.findWidget(element, Slot.class); if (slot != null && slot.getCaptionElement() != null && slot.getParent() == getWidget() && slot.getCaptionElement().isOrHasChild(element)) { - ComponentConnector connector = Util.findConnectorFor(slot - .getWidget()); + ComponentConnector connector = Util + .findConnectorFor(slot.getWidget()); if (connector != null) { return connector.getTooltipInfo(element); } @@ -404,7 +410,7 @@ public abstract class AbstractOrderedLayoutConnector extends /* * (non-Javadoc) - * + * * @see com.vaadin.client.ui.AbstractComponentConnector#hasTooltip() */ @Override @@ -441,7 +447,8 @@ public abstract class AbstractOrderedLayoutConnector extends boolean onlyZeroExpands = true; if (needsExpand) { for (ComponentConnector child : getChildComponents()) { - double expandRatio = getState().childData.get(child).expandRatio; + double expandRatio = getState().childData + .get(child).expandRatio; if (expandRatio != 0) { onlyZeroExpands = false; break; @@ -478,8 +485,8 @@ public abstract class AbstractOrderedLayoutConnector extends hasChildrenWithMiddleAlignment = true; } - double expandRatio = onlyZeroExpands ? 1 : getState().childData - .get(child).expandRatio; + double expandRatio = onlyZeroExpands ? 1 + : getState().childData.get(child).expandRatio; slot.setExpandRatio(expandRatio); @@ -588,13 +595,13 @@ public abstract class AbstractOrderedLayoutConnector extends if (slot.hasCaption()) { slot.setCaptionResizeListener(slotCaptionResizeListener); } - } else if ((hasChildrenWithRelativeHeight || hasChildrenWithRelativeWidth) - && slot.hasCaption()) { + } else if ((hasChildrenWithRelativeHeight + || hasChildrenWithRelativeWidth) && slot.hasCaption()) { /* * If the slot has caption, we need to listen for its size changes * in order to update the padding/margin offset for relative sized * components. - * + * * TODO might only be needed if the caption is in the same direction * as the relative size? */ @@ -622,8 +629,8 @@ public abstract class AbstractOrderedLayoutConnector extends return; } h += getLayoutManager().getBorderHeight(getWidget().getElement()) - + getLayoutManager().getPaddingHeight( - getWidget().getElement()); + + getLayoutManager() + .getPaddingHeight(getWidget().getElement()); getWidget().getElement().getStyle().setHeight(h, Unit.PX); getLayoutManager().setNeedsMeasure(this); } @@ -644,8 +651,8 @@ public abstract class AbstractOrderedLayoutConnector extends Element captionElement = slot.getCaptionElement(); CaptionPosition captionPosition = slot.getCaptionPosition(); - int pixelHeight = layoutManager.getOuterHeight(childWidget - .getElement()); + int pixelHeight = layoutManager + .getOuterHeight(childWidget.getElement()); if (pixelHeight == -1) { // Height has not yet been measured -> postpone actions that // depend on the max height @@ -660,8 +667,7 @@ public abstract class AbstractOrderedLayoutConnector extends && captionSizeShouldBeAddedtoComponentHeight; if (includeCaptionHeight) { - int captionHeight = layoutManager - .getOuterHeight(captionElement) + int captionHeight = layoutManager.getOuterHeight(captionElement) - getLayoutManager().getMarginHeight(captionElement); if (captionHeight == -1) { // Height has not yet been measured -> postpone actions that @@ -686,7 +692,7 @@ public abstract class AbstractOrderedLayoutConnector extends /* * (non-Javadoc) - * + * * @see com.vaadin.client.ui.AbstractComponentConnector#onUnregister() */ @Override diff --git a/client/src/main/java/com/vaadin/client/ui/orderedlayout/CaptionPosition.java b/client/src/main/java/com/vaadin/client/ui/orderedlayout/CaptionPosition.java index 885dc1ecd7..6a55491639 100644 --- a/client/src/main/java/com/vaadin/client/ui/orderedlayout/CaptionPosition.java +++ b/client/src/main/java/com/vaadin/client/ui/orderedlayout/CaptionPosition.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/orderedlayout/HorizontalLayoutConnector.java b/client/src/main/java/com/vaadin/client/ui/orderedlayout/HorizontalLayoutConnector.java index 2cd1acd78b..b84be60a1a 100644 --- a/client/src/main/java/com/vaadin/client/ui/orderedlayout/HorizontalLayoutConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/orderedlayout/HorizontalLayoutConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -30,10 +30,9 @@ public class HorizontalLayoutConnector extends AbstractOrderedLayoutConnector { /* * (non-Javadoc) - * - * @see - * com.vaadin.client.ui.orderedlayout.AbstractOrderedLayoutConnector#getWidget - * () + * + * @see com.vaadin.client.ui.orderedlayout.AbstractOrderedLayoutConnector# + * getWidget () */ @Override public VHorizontalLayout getWidget() { diff --git a/client/src/main/java/com/vaadin/client/ui/orderedlayout/Slot.java b/client/src/main/java/com/vaadin/client/ui/orderedlayout/Slot.java index 564c15472f..2315f0bc4b 100644 --- a/client/src/main/java/com/vaadin/client/ui/orderedlayout/Slot.java +++ b/client/src/main/java/com/vaadin/client/ui/orderedlayout/Slot.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -90,10 +90,10 @@ public class Slot extends SimplePanel { /** * Constructs a slot. - * + * * When using this constructor, the layout and widget must be set before any * other operations are performed on the slot. - * + * * @since 7.6 */ public Slot() { @@ -103,10 +103,10 @@ public class Slot extends SimplePanel { /** * Set the layout in which this slot is. This method must be called exactly * once at slot construction time when using the default constructor. - * + * * The method should normally only be called by * {@link VAbstractOrderedLayout#createSlot(Widget)}. - * + * * @since 7.6 * @param layout * the layout containing the slot @@ -117,7 +117,7 @@ public class Slot extends SimplePanel { /** * Constructs a slot. - * + * * @param layout * The layout to which this slot belongs * @param widget @@ -134,7 +134,7 @@ public class Slot extends SimplePanel { /* * (non-Javadoc) - * + * * @see com.google.gwt.user.client.ui.SimplePanel#remove(com.google.gwt.user * .client.ui.Widget) */ @@ -146,7 +146,7 @@ public class Slot extends SimplePanel { /* * (non-Javadoc) - * + * * @see com.google.gwt.user.client.ui.SimplePanel#setWidget(com.google.gwt * .user.client.ui.Widget) */ @@ -246,7 +246,7 @@ public class Slot extends SimplePanel { /** * Returns the alignment for the slot - * + * */ public AlignmentInfo getAlignment() { return alignment; @@ -254,7 +254,7 @@ public class Slot extends SimplePanel { /** * Sets the style names for the slot containing the widget - * + * * @param stylenames * The style names for the slot */ @@ -272,7 +272,7 @@ public class Slot extends SimplePanel { /** * Sets how the widget is aligned inside the slot - * + * * @param alignment * The alignment inside the slot */ @@ -308,10 +308,10 @@ public class Slot extends SimplePanel { * the expand ratios but instead be allocated space based on its natural * size. Other values causes the slot to get a share of the otherwise * unallocated space in proportion to the slot's expand ratio value. - * + * * @param expandRatio * The ratio of the space the slot should occupy - * + * */ public void setExpandRatio(double expandRatio) { this.expandRatio = expandRatio; @@ -320,9 +320,9 @@ public class Slot extends SimplePanel { /** * Get the expand ratio for the slot. The expand ratio describes how the * slot should be resized compared to other slots in the layout - * + * * @return the expand ratio of the slot - * + * * @see #setExpandRatio(double) */ public double getExpandRatio() { @@ -332,7 +332,7 @@ public class Slot extends SimplePanel { /** * Set the spacing for the slot. The spacing determines if there should be * empty space around the slot when the slot. - * + * * @param spacing * Should spacing be enabled */ @@ -360,7 +360,7 @@ public class Slot extends SimplePanel { /** * Get the element which is added to make the spacing - * + * * @return */ public com.google.gwt.user.client.Element getSpacingElement() { @@ -388,7 +388,7 @@ public class Slot extends SimplePanel { /** * Get the horizontal amount of pixels of the spacing - * + * * @return */ protected int getHorizontalSpacing() { @@ -402,7 +402,7 @@ public class Slot extends SimplePanel { /** * Set the position of the caption relative to the slot - * + * * @param captionPosition * The position of the caption */ @@ -410,8 +410,8 @@ public class Slot extends SimplePanel { if (caption == null) { return; } - captionWrap.removeClassName("v-caption-on-" - + this.captionPosition.name().toLowerCase()); + captionWrap.removeClassName( + "v-caption-on-" + this.captionPosition.name().toLowerCase()); this.captionPosition = captionPosition; if (captionPosition == CaptionPosition.BOTTOM @@ -421,8 +421,8 @@ public class Slot extends SimplePanel { captionWrap.insertFirst(caption); } - captionWrap.addClassName("v-caption-on-" - + captionPosition.name().toLowerCase()); + captionWrap.addClassName( + "v-caption-on-" + captionPosition.name().toLowerCase()); } /** @@ -434,7 +434,7 @@ public class Slot extends SimplePanel { /** * Set the caption of the slot - * + * * @param captionText * The text of the caption * @param iconUrl @@ -449,7 +449,7 @@ public class Slot extends SimplePanel { * Is the (field) required * @param enabled * Is the component enabled - * + * * @deprecated Use * {@link #setCaption(String, Icon, List, String, boolean, boolean, boolean)} * instead @@ -472,7 +472,7 @@ public class Slot extends SimplePanel { /** * Set the caption of the slot as text - * + * * @param captionText * The text of the caption * @param icon @@ -489,14 +489,15 @@ public class Slot extends SimplePanel { * Is the component enabled */ public void setCaption(String captionText, Icon icon, List styles, - String error, boolean showError, boolean required, boolean enabled) { + String error, boolean showError, boolean required, + boolean enabled) { setCaption(captionText, icon, styles, error, showError, required, enabled, false); } /** * Set the caption of the slot - * + * * @param captionText * The text of the caption * @param icon @@ -540,8 +541,8 @@ public class Slot extends SimplePanel { // Made changes to DOM. Focus can be lost if it was in the // widget. - focusLost = (focusedElement == null ? false : widget - .getElement().isOrHasChild(focusedElement)); + focusLost = (focusedElement == null ? false + : widget.getElement().isOrHasChild(focusedElement)); } } else if (caption != null) { orphan(widget); @@ -552,8 +553,8 @@ public class Slot extends SimplePanel { captionWrap = null; // Made changes to DOM. Focus can be lost if it was in the widget. - focusLost = (focusedElement == null ? false : widget.getElement() - .isOrHasChild(focusedElement)); + focusLost = (focusedElement == null ? false + : widget.getElement().isOrHasChild(focusedElement)); } // Caption text @@ -663,8 +664,8 @@ public class Slot extends SimplePanel { // even if it does it will be stopped once something // is done with the browser. schedule(25); - } else if (WidgetUtil.getFocusedElement().equals( - Document.get().getBody())) { + } else if (WidgetUtil.getFocusedElement() + .equals(Document.get().getBody())) { // Focus found it's way to BodyElement. Now it can // be restored focusedElement.focus(); @@ -700,7 +701,7 @@ public class Slot extends SimplePanel { /** * Set if the slot has a relative width - * + * * @param relativeWidth * True if slot uses relative width, false if the slot has a * static width @@ -718,7 +719,7 @@ public class Slot extends SimplePanel { /** * Set if the slot has a relative height - * + * * @param relativeHeight * True if the slot uses a relative height, false if the slot has * a static height @@ -734,7 +735,7 @@ public class Slot extends SimplePanel { /** * Updates the captions size if the slot is relative - * + * * @param isRelativeSize * Is the slot relatively sized * @param direction @@ -765,7 +766,7 @@ public class Slot extends SimplePanel { /* * (non-Javadoc) - * + * * @see com.google.gwt.user.client.ui.Widget#onBrowserEvent(com.google.gwt * .user.client.Event) */ @@ -784,7 +785,7 @@ public class Slot extends SimplePanel { /* * (non-Javadoc) - * + * * @see com.google.gwt.user.client.ui.SimplePanel#getContainerElement() */ @Override @@ -798,7 +799,7 @@ public class Slot extends SimplePanel { /* * (non-Javadoc) - * + * * @see com.google.gwt.user.client.ui.Widget#onDetach() */ @Override @@ -811,7 +812,7 @@ public class Slot extends SimplePanel { /* * (non-Javadoc) - * + * * @see com.google.gwt.user.client.ui.Widget#onAttach() */ @Override diff --git a/client/src/main/java/com/vaadin/client/ui/orderedlayout/VAbstractOrderedLayout.java b/client/src/main/java/com/vaadin/client/ui/orderedlayout/VAbstractOrderedLayout.java index 1a36ba9c93..bea0d19d95 100644 --- a/client/src/main/java/com/vaadin/client/ui/orderedlayout/VAbstractOrderedLayout.java +++ b/client/src/main/java/com/vaadin/client/ui/orderedlayout/VAbstractOrderedLayout.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -67,10 +67,10 @@ public class VAbstractOrderedLayout extends FlowPanel { /** * See the method {@link #addOrMoveSlot(Slot, int, boolean)}. - * + * *

    * This method always adjusts spacings for the whole layout. - * + * * @param slot * The slot to move or add * @param index @@ -93,7 +93,7 @@ public class VAbstractOrderedLayout extends FlowPanel { *

    * For instance when using spacing the index converts to DOM index in the * following way: - * + * *

          * index : 0 -> DOM index: 0
          * index : 1 -> DOM index: 1
    @@ -101,16 +101,16 @@ public class VAbstractOrderedLayout extends FlowPanel {
          * index : 3 -> DOM index: 5
          * index : 4 -> DOM index: 7
          * 
    - * + * * When using this method never account for spacings. *

    * The caller should remove all spacings before calling this method and * re-add them (if necessary) after this method. This can be done before and * after all slots have been added/moved. *

    - * + * * @since 7.1.4 - * + * * @param slot * The slot to move or add * @param index @@ -120,30 +120,35 @@ public class VAbstractOrderedLayout extends FlowPanel { * operation */ public void addOrMoveSlot(Slot slot, int index, boolean adjustSpacing) { - Profiler.enter("VAOL.onConnectorHierarchyChange addOrMoveSlot find index"); + Profiler.enter( + "VAOL.onConnectorHierarchyChange addOrMoveSlot find index"); if (slot.getParent() == this) { int currentIndex = getWidgetIndex(slot); if (index == currentIndex) { - Profiler.leave("VAOL.onConnectorHierarchyChange addOrMoveSlot find index"); + Profiler.leave( + "VAOL.onConnectorHierarchyChange addOrMoveSlot find index"); return; } } - Profiler.leave("VAOL.onConnectorHierarchyChange addOrMoveSlot find index"); + Profiler.leave( + "VAOL.onConnectorHierarchyChange addOrMoveSlot find index"); Profiler.enter("VAOL.onConnectorHierarchyChange addOrMoveSlot insert"); insert(slot, index); Profiler.leave("VAOL.onConnectorHierarchyChange addOrMoveSlot insert"); if (adjustSpacing) { - Profiler.enter("VAOL.onConnectorHierarchyChange addOrMoveSlot setSpacing"); + Profiler.enter( + "VAOL.onConnectorHierarchyChange addOrMoveSlot setSpacing"); setSpacing(spacing); - Profiler.leave("VAOL.onConnectorHierarchyChange addOrMoveSlot setSpacing"); + Profiler.leave( + "VAOL.onConnectorHierarchyChange addOrMoveSlot setSpacing"); } } /** * {@inheritDoc} - * + * * @deprecated As of 7.2, use or override * {@link #insert(Widget, Element, int, boolean)} instead. */ @@ -172,11 +177,11 @@ public class VAbstractOrderedLayout extends FlowPanel { * Since the spacing elements are located at the same DOM * level as the slots we need to take them into account when * calculating the slot position. - * + * * The spacing elements are always located before the actual * slot except for the first slot which do not have a * spacing element like this - * + * * |...| */ beforeIndex = beforeIndex * 2 - 1; @@ -193,7 +198,7 @@ public class VAbstractOrderedLayout extends FlowPanel { /** * {@inheritDoc} - * + * * @since 7.2 */ @Override @@ -204,7 +209,7 @@ public class VAbstractOrderedLayout extends FlowPanel { /** * Remove a slot from the layout - * + * * @param widget * @return */ @@ -217,11 +222,11 @@ public class VAbstractOrderedLayout extends FlowPanel { /** * Remove a slot from the layout. - * + * * This method is called automatically by {@link #removeWidget(Widget)} and * should not be called directly by the user. When overridden, the super * method must be called. - * + * * @since 7.6 * @param Slot * to remove @@ -233,10 +238,10 @@ public class VAbstractOrderedLayout extends FlowPanel { /** * Get the containing slot for a widget. If no slot is found a new slot is * created and returned. - * + * * @param widget * The widget whose slot you want to get - * + * * @return */ public Slot getSlot(Widget widget) { @@ -250,11 +255,11 @@ public class VAbstractOrderedLayout extends FlowPanel { /** * Create a slot to be added to the layout. - * + * * This method is called automatically by {@link #getSlot(Widget)} when a * new slot is needed. It should not be called directly by the user, but can * be overridden to customize slot creation. - * + * * @since 7.6 * @param widget * the widget for which a slot is being created @@ -270,7 +275,7 @@ public class VAbstractOrderedLayout extends FlowPanel { /** * Gets a slot based on the widget element. If no slot is found then null is * returned. - * + * * @param widgetElement * The element of the widget ( Same as getWidget().getElement() ) * @return @@ -289,11 +294,11 @@ public class VAbstractOrderedLayout extends FlowPanel { /** * Gets a slot based on the widget element. If no slot is found then null is * returned. - * + * * @param widgetElement * The element of the widget ( Same as getWidget().getElement() ) * @return - * + * * @since 7.2 */ public Slot getSlot(Element widgetElement) { @@ -302,7 +307,7 @@ public class VAbstractOrderedLayout extends FlowPanel { /** * Set the layout manager for the layout - * + * * @param manager * The layout manager to use */ @@ -312,7 +317,7 @@ public class VAbstractOrderedLayout extends FlowPanel { /** * Get the layout manager used by this layout - * + * */ public LayoutManager getLayoutManager() { return layoutManager; @@ -322,10 +327,10 @@ public class VAbstractOrderedLayout extends FlowPanel { * Deducts the caption position by examining the wrapping element. *

    * For internal use only. May be removed or replaced in the future. - * + * * @param captionWrap * The wrapping element - * + * * @return The caption position * @deprecated As of 7.2, call or override * {@link #getCaptionPositionFromElement(Element)} instead @@ -336,14 +341,14 @@ public class VAbstractOrderedLayout extends FlowPanel { RegExp captionPositionRegexp = RegExp.compile("v-caption-on-(\\S+)"); // Get caption position from the classname - MatchResult matcher = captionPositionRegexp.exec(captionWrap - .getClassName()); + MatchResult matcher = captionPositionRegexp + .exec(captionWrap.getClassName()); if (matcher == null || matcher.getGroupCount() < 2) { return CaptionPosition.TOP; } String captionClass = matcher.getGroup(1); - CaptionPosition captionPosition = CaptionPosition.valueOf( - CaptionPosition.class, captionClass.toUpperCase()); + CaptionPosition captionPosition = CaptionPosition + .valueOf(CaptionPosition.class, captionClass.toUpperCase()); return captionPosition; } @@ -351,10 +356,10 @@ public class VAbstractOrderedLayout extends FlowPanel { * Deducts the caption position by examining the wrapping element. *

    * For internal use only. May be removed or replaced in the future. - * + * * @param captionWrap * The wrapping element - * + * * @return The caption position * @since 7.2 */ @@ -366,14 +371,15 @@ public class VAbstractOrderedLayout extends FlowPanel { * Update the offset off the caption relative to the slot *

    * For internal use only. May be removed or replaced in the future. - * + * * @param caption * The caption element * @deprecated As of 7.2, call or override * {@link #updateCaptionOffset(Element)} instead */ @Deprecated - public void updateCaptionOffset(com.google.gwt.user.client.Element caption) { + public void updateCaptionOffset( + com.google.gwt.user.client.Element caption) { Element captionWrap = caption.getParentElement(); @@ -390,7 +396,8 @@ public class VAbstractOrderedLayout extends FlowPanel { captionStyle.clearMarginLeft(); // Get caption position from the classname - CaptionPosition captionPosition = getCaptionPositionFromElement(captionWrap); + CaptionPosition captionPosition = getCaptionPositionFromElement( + captionWrap); if (captionPosition == CaptionPosition.LEFT || captionPosition == CaptionPosition.RIGHT) { @@ -436,7 +443,7 @@ public class VAbstractOrderedLayout extends FlowPanel { * Update the offset off the caption relative to the slot *

    * For internal use only. May be removed or replaced in the future. - * + * * @param caption * The caption element * @since 7.2 @@ -447,7 +454,7 @@ public class VAbstractOrderedLayout extends FlowPanel { /** * Set the margin of the layout - * + * * @param marginInfo * The margin information */ @@ -462,7 +469,7 @@ public class VAbstractOrderedLayout extends FlowPanel { /** * Turn on or off spacing in the layout - * + * * @param spacing * True if spacing should be used, false if not */ @@ -627,7 +634,7 @@ public class VAbstractOrderedLayout extends FlowPanel { * is not considered for relative sizes and a corresponding negative * margin for the unexpanded slots. We calculate the size by summing * the size of all non-expanded non-relative slots. - * + * * Relatively sized slots without expansion are considered to get * 0px, but we still keep them visible (causing overflows) to help * the developer see what's happening. Forcing them to only get 0px @@ -644,22 +651,22 @@ public class VAbstractOrderedLayout extends FlowPanel { if (layoutManager != null) { // TODO check caption position if (vertical) { - int size = layoutManager.getOuterHeight(slot - .getWidget().getElement()); + int size = layoutManager.getOuterHeight( + slot.getWidget().getElement()); if (slot.hasCaption()) { - size += layoutManager.getOuterHeight(slot - .getCaptionElement()); + size += layoutManager.getOuterHeight( + slot.getCaptionElement()); } if (size > 0) { totalSize += size; } } else { int max = -1; - max = layoutManager.getOuterWidth(slot.getWidget() - .getElement()); + max = layoutManager.getOuterWidth( + slot.getWidget().getElement()); if (slot.hasCaption()) { - int max2 = layoutManager.getOuterWidth(slot - .getCaptionElement()); + int max2 = layoutManager.getOuterWidth( + slot.getCaptionElement()); max = Math.max(max, max2); } if (max > 0) { @@ -668,13 +675,13 @@ public class VAbstractOrderedLayout extends FlowPanel { } } else { // FIXME expandRatio might be <0 - totalSize += vertical ? slot.getOffsetHeight() : slot - .getOffsetWidth(); + totalSize += vertical ? slot.getOffsetHeight() + : slot.getOffsetWidth(); } } // TODO fails in Opera, always returns 0 - int spacingSize = vertical ? slot.getVerticalSpacing() : slot - .getHorizontalSpacing(); + int spacingSize = vertical ? slot.getVerticalSpacing() + : slot.getHorizontalSpacing(); if (spacingSize > 0) { totalSize += spacingSize; } @@ -702,8 +709,8 @@ public class VAbstractOrderedLayout extends FlowPanel { // FIXME expandRatio might be <0 if (slot.getExpandRatio() != 0) { if (layoutManager != null) { - layoutManager.setNeedsMeasure(Util - .findConnectorFor(slot.getWidget())); + layoutManager.setNeedsMeasure( + Util.findConnectorFor(slot.getWidget())); } else if (slot.getWidget() instanceof RequiresResize) { ((RequiresResize) slot.getWidget()).onResize(); } @@ -726,7 +733,7 @@ public class VAbstractOrderedLayout extends FlowPanel { /** * Sets the slots style names. The style names will be prefixed with the * v-slot prefix. - * + * * @param stylenames * The style names of the slot. */ diff --git a/client/src/main/java/com/vaadin/client/ui/orderedlayout/VerticalLayoutConnector.java b/client/src/main/java/com/vaadin/client/ui/orderedlayout/VerticalLayoutConnector.java index 33ff020e89..02669c3d98 100644 --- a/client/src/main/java/com/vaadin/client/ui/orderedlayout/VerticalLayoutConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/orderedlayout/VerticalLayoutConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -30,10 +30,9 @@ public class VerticalLayoutConnector extends AbstractOrderedLayoutConnector { /* * (non-Javadoc) - * - * @see - * com.vaadin.client.ui.orderedlayout.AbstractOrderedLayoutConnector#getWidget - * () + * + * @see com.vaadin.client.ui.orderedlayout.AbstractOrderedLayoutConnector# + * getWidget () */ @Override public VVerticalLayout getWidget() { diff --git a/client/src/main/java/com/vaadin/client/ui/panel/PanelConnector.java b/client/src/main/java/com/vaadin/client/ui/panel/PanelConnector.java index 11111df602..5766851bba 100644 --- a/client/src/main/java/com/vaadin/client/ui/panel/PanelConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/panel/PanelConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -92,8 +92,8 @@ public class PanelConnector extends AbstractSingleComponentContainerConnector // Restore default stylenames getWidget().contentNode.setClassName(VPanel.CLASSNAME + "-content"); - getWidget().bottomDecoration.setClassName(VPanel.CLASSNAME - + "-deco"); + getWidget().bottomDecoration + .setClassName(VPanel.CLASSNAME + "-deco"); getWidget().captionNode.setClassName(VPanel.CLASSNAME + "-caption"); boolean hasCaption = false; if (getState().caption != null && !"".equals(getState().caption)) { @@ -101,8 +101,8 @@ public class PanelConnector extends AbstractSingleComponentContainerConnector hasCaption = true; } else { getWidget().setCaption(""); - getWidget().captionNode.setClassName(VPanel.CLASSNAME - + "-nocaption"); + getWidget().captionNode + .setClassName(VPanel.CLASSNAME + "-nocaption"); } // Add proper stylenames for all elements. This way we can prevent @@ -202,8 +202,8 @@ public class PanelConnector extends AbstractSingleComponentContainerConnector Profiler.enter("PanelConnector.layout modify style"); Style style = panel.getElement().getStyle(); - panel.captionNode.getParentElement().getStyle() - .setMarginTop(-top, Unit.PX); + panel.captionNode.getParentElement().getStyle().setMarginTop(-top, + Unit.PX); panel.bottomDecoration.getStyle().setMarginBottom(-bottom, Unit.PX); style.setPaddingTop(top, Unit.PX); style.setPaddingBottom(bottom, Unit.PX); @@ -248,7 +248,8 @@ public class PanelConnector extends AbstractSingleComponentContainerConnector } @Override - public void onConnectorHierarchyChange(ConnectorHierarchyChangeEvent event) { + public void onConnectorHierarchyChange( + ConnectorHierarchyChangeEvent event) { // We always have 1 child, unless the child is hidden getWidget().setWidget(getContentWidget()); } diff --git a/client/src/main/java/com/vaadin/client/ui/passwordfield/PasswordFieldConnector.java b/client/src/main/java/com/vaadin/client/ui/passwordfield/PasswordFieldConnector.java index 61576fac04..1465ab98fb 100644 --- a/client/src/main/java/com/vaadin/client/ui/passwordfield/PasswordFieldConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/passwordfield/PasswordFieldConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/popupview/PopupViewConnector.java b/client/src/main/java/com/vaadin/client/ui/popupview/PopupViewConnector.java index 6afceb75de..b29c22529b 100644 --- a/client/src/main/java/com/vaadin/client/ui/popupview/PopupViewConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/popupview/PopupViewConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -107,8 +107,8 @@ public class PopupViewConnector extends AbstractHasComponentsConnector styleBuf.append(primaryName); // Add "animate-in" class back if already present - boolean isAnimatingIn = getWidget().popup.getStyleName().contains( - VOverlay.ADDITIONAL_CLASSNAME_ANIMATE_IN); + boolean isAnimatingIn = getWidget().popup.getStyleName() + .contains(VOverlay.ADDITIONAL_CLASSNAME_ANIMATE_IN); if (isAnimatingIn) { styleBuf.append(" "); @@ -138,8 +138,8 @@ public class PopupViewConnector extends AbstractHasComponentsConnector @Override public void onVisibilityChange(VisibilityChangeEvent event) { - getRpcProxy(PopupViewServerRpc.class).setPopupVisibility( - event.isVisible()); + getRpcProxy(PopupViewServerRpc.class) + .setPopupVisibility(event.isVisible()); } } diff --git a/client/src/main/java/com/vaadin/client/ui/popupview/VisibilityChangeEvent.java b/client/src/main/java/com/vaadin/client/ui/popupview/VisibilityChangeEvent.java index 8db2d1cb85..0bbdd39adf 100644 --- a/client/src/main/java/com/vaadin/client/ui/popupview/VisibilityChangeEvent.java +++ b/client/src/main/java/com/vaadin/client/ui/popupview/VisibilityChangeEvent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/popupview/VisibilityChangeHandler.java b/client/src/main/java/com/vaadin/client/ui/popupview/VisibilityChangeHandler.java index 3c5e09d1fc..b557cbec4d 100644 --- a/client/src/main/java/com/vaadin/client/ui/popupview/VisibilityChangeHandler.java +++ b/client/src/main/java/com/vaadin/client/ui/popupview/VisibilityChangeHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/progressindicator/ProgressBarConnector.java b/client/src/main/java/com/vaadin/client/ui/progressindicator/ProgressBarConnector.java index 3a83430f7a..010a948b90 100644 --- a/client/src/main/java/com/vaadin/client/ui/progressindicator/ProgressBarConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/progressindicator/ProgressBarConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,7 +25,7 @@ import com.vaadin.ui.ProgressBar; /** * Connector for {@link VProgressBar}. - * + * * @since 7.1 * @author Vaadin Ltd */ diff --git a/client/src/main/java/com/vaadin/client/ui/progressindicator/ProgressIndicatorConnector.java b/client/src/main/java/com/vaadin/client/ui/progressindicator/ProgressIndicatorConnector.java index 36bb1dd6b2..bbef5a0bf2 100644 --- a/client/src/main/java/com/vaadin/client/ui/progressindicator/ProgressIndicatorConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/progressindicator/ProgressIndicatorConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -27,7 +27,7 @@ import com.vaadin.ui.ProgressIndicator; /** * Connector for {@link VProgressBar} with polling support. - * + * * @since 7.0 * @author Vaadin Ltd * @deprecated as of 7.1, use {@link ProgressBarConnector} combined with server diff --git a/client/src/main/java/com/vaadin/client/ui/richtextarea/RichTextAreaConnector.java b/client/src/main/java/com/vaadin/client/ui/richtextarea/RichTextAreaConnector.java index bcf61a9338..7b50f08231 100644 --- a/client/src/main/java/com/vaadin/client/ui/richtextarea/RichTextAreaConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/richtextarea/RichTextAreaConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -80,8 +80,8 @@ public class RichTextAreaConnector extends AbstractFieldConnector implements getWidget().setEnabled(isEnabled()); getWidget().setReadOnly(isReadOnly()); getWidget().immediate = getState().immediate; - int newMaxLength = uidl.hasAttribute("maxLength") ? uidl - .getIntAttribute("maxLength") : -1; + int newMaxLength = uidl.hasAttribute("maxLength") + ? uidl.getIntAttribute("maxLength") : -1; if (newMaxLength >= 0) { if (getWidget().maxLength == -1) { getWidget().keyPressHandler = getWidget().rta @@ -125,10 +125,10 @@ public class RichTextAreaConnector extends AbstractFieldConnector implements @Override public void layout() { if (!isUndefinedHeight()) { - int rootElementInnerHeight = getLayoutManager().getInnerHeight( - getWidget().getElement()); - int formatterHeight = getLayoutManager().getOuterHeight( - getWidget().formatter.getElement()); + int rootElementInnerHeight = getLayoutManager() + .getInnerHeight(getWidget().getElement()); + int formatterHeight = getLayoutManager() + .getOuterHeight(getWidget().formatter.getElement()); int editorHeight = rootElementInnerHeight - formatterHeight; if (editorHeight < 0) { editorHeight = 0; diff --git a/client/src/main/java/com/vaadin/client/ui/richtextarea/VRichTextToolbar.java b/client/src/main/java/com/vaadin/client/ui/richtextarea/VRichTextToolbar.java index 2e0554c499..690d8cdacf 100644 --- a/client/src/main/java/com/vaadin/client/ui/richtextarea/VRichTextToolbar.java +++ b/client/src/main/java/com/vaadin/client/ui/richtextarea/VRichTextToolbar.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -181,27 +181,27 @@ public class VRichTextToolbar extends Composite { * We use an inner EventHandler class to avoid exposing event methods on the * RichTextToolbar itself. */ - private class EventHandler implements ClickHandler, ChangeHandler, - KeyUpHandler { + private class EventHandler + implements ClickHandler, ChangeHandler, KeyUpHandler { @Override @SuppressWarnings("deprecation") public void onChange(ChangeEvent event) { Object sender = event.getSource(); if (sender == backColors) { - basic.setBackColor(backColors.getValue(backColors - .getSelectedIndex())); + basic.setBackColor( + backColors.getValue(backColors.getSelectedIndex())); backColors.setSelectedIndex(0); } else if (sender == foreColors) { - basic.setForeColor(foreColors.getValue(foreColors - .getSelectedIndex())); + basic.setForeColor( + foreColors.getValue(foreColors.getSelectedIndex())); foreColors.setSelectedIndex(0); } else if (sender == fonts) { basic.setFontName(fonts.getValue(fonts.getSelectedIndex())); fonts.setSelectedIndex(0); } else if (sender == fontSizes) { - basic.setFontSize(fontSizesConstants[fontSizes - .getSelectedIndex() - 1]); + basic.setFontSize( + fontSizesConstants[fontSizes.getSelectedIndex() - 1]); fontSizes.setSelectedIndex(0); } } @@ -239,8 +239,8 @@ public class VRichTextToolbar extends Composite { extended.insertImage(url); } } else if (sender == createLink) { - final String url = Window - .prompt("Enter a link URL:", "http://"); + final String url = Window.prompt("Enter a link URL:", + "http://"); if (url != null) { extended.createLink(url); } @@ -320,7 +320,7 @@ public class VRichTextToolbar extends Composite { /** * Creates a new toolbar that drives the given rich text area. - * + * * @param richText * the rich text area to be controlled */ @@ -339,8 +339,8 @@ public class VRichTextToolbar extends Composite { setStyleName("gwt-RichTextToolbar"); if (basic != null) { - topPanel.add(bold = createToggleButton(images.bold(), - strings.bold())); + topPanel.add( + bold = createToggleButton(images.bold(), strings.bold())); topPanel.add(italic = createToggleButton(images.italic(), strings.italic())); topPanel.add(underline = createToggleButton(images.underline(), diff --git a/client/src/main/java/com/vaadin/client/ui/slider/SliderConnector.java b/client/src/main/java/com/vaadin/client/ui/slider/SliderConnector.java index 8c3c0254d3..1128ba5100 100644 --- a/client/src/main/java/com/vaadin/client/ui/slider/SliderConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/slider/SliderConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -29,11 +29,11 @@ import com.vaadin.shared.ui.slider.SliderState; import com.vaadin.ui.Slider; @Connect(Slider.class) -public class SliderConnector extends AbstractFieldConnector implements - ValueChangeHandler { +public class SliderConnector extends AbstractFieldConnector + implements ValueChangeHandler { - protected SliderServerRpc rpc = RpcProxy - .create(SliderServerRpc.class, this); + protected SliderServerRpc rpc = RpcProxy.create(SliderServerRpc.class, + this); private final ElementResizeListener resizeListener = new ElementResizeListener() { @@ -56,8 +56,8 @@ public class SliderConnector extends AbstractFieldConnector implements @Override public void onUnregister() { super.onUnregister(); - getLayoutManager().removeElementResizeListener( - getWidget().getElement(), resizeListener); + getLayoutManager().removeElementResizeListener(getWidget().getElement(), + resizeListener); } @Override diff --git a/client/src/main/java/com/vaadin/client/ui/splitpanel/AbstractSplitPanelConnector.java b/client/src/main/java/com/vaadin/client/ui/splitpanel/AbstractSplitPanelConnector.java index 6bf03ad880..b9ae29a89e 100644 --- a/client/src/main/java/com/vaadin/client/ui/splitpanel/AbstractSplitPanelConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/splitpanel/AbstractSplitPanelConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -62,15 +62,15 @@ public abstract class AbstractSplitPanelConnector extends // Send % values as a fraction to avoid that the splitter // "jumps" when server responds with the integer pct value // (e.g. dragged 16.6% -> should not jump to 17%) - pos = Float.valueOf(position.substring(0, - position.length() - 1)); + pos = Float.valueOf( + position.substring(0, position.length() - 1)); } else { - pos = Integer.parseInt(position.substring(0, - position.length() - 2)); + pos = Integer.parseInt( + position.substring(0, position.length() - 2)); } - getRpcProxy(AbstractSplitPanelRpc.class).setSplitterPosition( - pos); + getRpcProxy(AbstractSplitPanelRpc.class) + .setSplitterPosition(pos); } }, SplitterMoveEvent.TYPE); @@ -86,8 +86,8 @@ public abstract class AbstractSplitPanelConnector extends @Override protected HandlerRegistration registerHandler( H handler, Type type) { - if ((Event.getEventsSunk(getWidget().splitter) & Event - .getTypeInt(type.getName())) != 0) { + if ((Event.getEventsSunk(getWidget().splitter) + & Event.getTypeInt(type.getName())) != 0) { // If we are already sinking the event for the splitter we do // not want to additionally sink it for the root element return getWidget().addHandler(handler, type); @@ -208,14 +208,14 @@ public abstract class AbstractSplitPanelConnector extends LayoutManager layoutManager = getLayoutManager(); if (this instanceof HorizontalSplitPanelConnector) { if (child.isRelativeHeight()) { - int height = layoutManager.getInnerHeight(getWidget() - .getElement()); + int height = layoutManager + .getInnerHeight(getWidget().getElement()); layoutManager.reportHeightAssignedToRelative(child, height); } } else { if (child.isRelativeWidth()) { - int width = layoutManager.getInnerWidth(getWidget() - .getElement()); + int width = layoutManager + .getInnerWidth(getWidget().getElement()); layoutManager.reportWidthAssignedToRelative(child, width); } } @@ -240,7 +240,8 @@ public abstract class AbstractSplitPanelConnector extends } @Override - public void onConnectorHierarchyChange(ConnectorHierarchyChangeEvent event) { + public void onConnectorHierarchyChange( + ConnectorHierarchyChangeEvent event) { handleHierarchyChange(); } diff --git a/client/src/main/java/com/vaadin/client/ui/splitpanel/HorizontalSplitPanelConnector.java b/client/src/main/java/com/vaadin/client/ui/splitpanel/HorizontalSplitPanelConnector.java index 75389b6cc4..a31cb979ad 100644 --- a/client/src/main/java/com/vaadin/client/ui/splitpanel/HorizontalSplitPanelConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/splitpanel/HorizontalSplitPanelConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/splitpanel/VerticalSplitPanelConnector.java b/client/src/main/java/com/vaadin/client/ui/splitpanel/VerticalSplitPanelConnector.java index e95f7143ba..5daf738c4e 100644 --- a/client/src/main/java/com/vaadin/client/ui/splitpanel/VerticalSplitPanelConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/splitpanel/VerticalSplitPanelConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/table/TableConnector.java b/client/src/main/java/com/vaadin/client/ui/table/TableConnector.java index cfe93b6641..87685f3e15 100644 --- a/client/src/main/java/com/vaadin/client/ui/table/TableConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/table/TableConnector.java @@ -54,9 +54,9 @@ import com.vaadin.shared.ui.table.TableServerRpc; import com.vaadin.shared.ui.table.TableState; @Connect(com.vaadin.ui.Table.class) -public class TableConnector extends AbstractFieldConnector implements - HasComponentsConnector, ConnectorHierarchyChangeHandler, Paintable, - DirectionalManagedLayout, PostLayoutListener, +public class TableConnector extends AbstractFieldConnector + implements HasComponentsConnector, ConnectorHierarchyChangeHandler, + Paintable, DirectionalManagedLayout, PostLayoutListener, HasChildMeasurementHintConnector { private List childComponents; @@ -73,7 +73,7 @@ public class TableConnector extends AbstractFieldConnector implements /* * (non-Javadoc) - * + * * @see com.vaadin.client.ui.AbstractComponentConnector#onUnregister() */ @Override @@ -113,8 +113,9 @@ public class TableConnector extends AbstractFieldConnector implements */ if (w != null) { rowKey = w.getKey(); - colKey = getWidget().tHead.getHeaderCell( - getElementIndex(e, w.getElement())).getColKey(); + colKey = getWidget().tHead + .getHeaderCell(getElementIndex(e, w.getElement())) + .getColKey(); } } } @@ -142,7 +143,7 @@ public class TableConnector extends AbstractFieldConnector implements /* * (non-Javadoc) - * + * * @see com.vaadin.client.Paintable#updateFromUIDL(com.vaadin.client.UIDL, * com.vaadin.client.ApplicationConnection) */ @@ -190,8 +191,8 @@ public class TableConnector extends AbstractFieldConnector implements getWidget().updateDragMode(uidl); // Update child measure hint - int childMeasureHint = uidl.hasAttribute("measurehint") ? uidl - .getIntAttribute("measurehint") : 0; + int childMeasureHint = uidl.hasAttribute("measurehint") + ? uidl.getIntAttribute("measurehint") : 0; getWidget().setChildMeasurementHint( ChildMeasurementHint.values()[childMeasureHint]); @@ -251,8 +252,8 @@ public class TableConnector extends AbstractFieldConnector implements // sanity check (in case the value has slipped beyond the total // amount of rows) - getWidget().scrollBody.setLastRendered(getWidget().scrollBody - .getLastRendered()); + getWidget().scrollBody + .setLastRendered(getWidget().scrollBody.getLastRendered()); getWidget().updateMaxIndent(); } else { getWidget().postponeSanityCheckForLastRendered = false; @@ -284,11 +285,11 @@ public class TableConnector extends AbstractFieldConnector implements showSavedContextMenu(contextMenuBeforeUpdate); if (!getWidget().isSelectable()) { - getWidget().scrollBody.addStyleName(getWidget() - .getStylePrimaryName() + "-body-noselection"); + getWidget().scrollBody.addStyleName( + getWidget().getStylePrimaryName() + "-body-noselection"); } else { - getWidget().scrollBody.removeStyleName(getWidget() - .getStylePrimaryName() + "-body-noselection"); + getWidget().scrollBody.removeStyleName( + getWidget().getStylePrimaryName() + "-body-noselection"); } getWidget().hideScrollPositionAnnotation(); @@ -326,21 +327,19 @@ public class TableConnector extends AbstractFieldConnector implements if (getWidget().focusedRow != null) { if (!getWidget().focusedRow.isAttached() - && !getWidget().rowRequestHandler.isRequestHandlerRunning()) { + && !getWidget().rowRequestHandler + .isRequestHandlerRunning()) { // focused row has been orphaned, can't focus - if (getWidget().selectedRowKeys.contains(getWidget().focusedRow - .getKey())) { + if (getWidget().selectedRowKeys + .contains(getWidget().focusedRow.getKey())) { // if row cache was refreshed, focused row should be // in selection and exists with same index - getWidget().setRowFocus( - getWidget().getRenderedRowByKey( - getWidget().focusedRow.getKey())); + getWidget().setRowFocus(getWidget().getRenderedRowByKey( + getWidget().focusedRow.getKey())); } else if (getWidget().selectedRowKeys.size() > 0) { // try to focus any row in selection - getWidget().setRowFocus( - getWidget().getRenderedRowByKey( - getWidget().selectedRowKeys.iterator() - .next())); + getWidget().setRowFocus(getWidget().getRenderedRowByKey( + getWidget().selectedRowKeys.iterator().next())); } else { // try to focus any row getWidget().focusRowFromBody(); @@ -356,7 +355,8 @@ public class TableConnector extends AbstractFieldConnector implements * (#8584) */ if (uidl.hasAttribute(TableConstants.ATTRIBUTE_KEY_MAPPER_RESET) - && uidl.getBooleanAttribute(TableConstants.ATTRIBUTE_KEY_MAPPER_RESET) + && uidl.getBooleanAttribute( + TableConstants.ATTRIBUTE_KEY_MAPPER_RESET) && getWidget().selectionRangeStart != null) { assert !getWidget().selectionRangeStart.isAttached(); getWidget().selectionRangeStart = getWidget().focusedRow; @@ -437,11 +437,11 @@ public class TableConnector extends AbstractFieldConnector implements getLayoutManager().setNeedsMeasure(TableConnector.this); ServerConnector parent = getParent(); if (parent instanceof ComponentConnector) { - getLayoutManager().setNeedsMeasure( - (ComponentConnector) parent); + getLayoutManager() + .setNeedsMeasure((ComponentConnector) parent); } - getLayoutManager().setNeedsVerticalLayout( - TableConnector.this); + getLayoutManager() + .setNeedsVerticalLayout(TableConnector.this); getLayoutManager().layoutNow(); } }); @@ -461,7 +461,7 @@ public class TableConnector extends AbstractFieldConnector implements /** * Shows a saved row context menu if the row for the context menu is still * visible. Does nothing if a context menu has not been saved. - * + * * @param savedContextMenu */ public void showSavedContextMenu(ContextMenuDetails savedContextMenu) { @@ -544,8 +544,8 @@ public class TableConnector extends AbstractFieldConnector implements @Override public HandlerRegistration addConnectorHierarchyChangeHandler( ConnectorHierarchyChangeHandler handler) { - return ensureHandlerManager().addHandler( - ConnectorHierarchyChangeEvent.TYPE, handler); + return ensureHandlerManager() + .addHandler(ConnectorHierarchyChangeEvent.TYPE, handler); } @Override diff --git a/client/src/main/java/com/vaadin/client/ui/tabsheet/TabsheetBaseConnector.java b/client/src/main/java/com/vaadin/client/ui/tabsheet/TabsheetBaseConnector.java index 9de415e74e..e149235b6f 100644 --- a/client/src/main/java/com/vaadin/client/ui/tabsheet/TabsheetBaseConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/tabsheet/TabsheetBaseConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -26,12 +26,12 @@ import com.vaadin.client.ui.VTabsheetBase; import com.vaadin.shared.ui.tabsheet.TabState; import com.vaadin.shared.ui.tabsheet.TabsheetState; -public abstract class TabsheetBaseConnector extends - AbstractComponentContainerConnector { +public abstract class TabsheetBaseConnector + extends AbstractComponentContainerConnector { /* * (non-Javadoc) - * + * * @see com.vaadin.client.ui.AbstractConnector#init() */ @Override @@ -43,7 +43,7 @@ public abstract class TabsheetBaseConnector extends /* * (non-Javadoc) - * + * * @see * com.vaadin.client.ui.AbstractComponentConnector#onStateChanged(com.vaadin * .client.communication.StateChangeEvent) @@ -57,8 +57,8 @@ public abstract class TabsheetBaseConnector extends // Widgets in the TabSheet before update ArrayList oldWidgets = new ArrayList(); - for (Iterator iterator = getWidget().getWidgetIterator(); iterator - .hasNext();) { + for (Iterator iterator = getWidget() + .getWidgetIterator(); iterator.hasNext();) { oldWidgets.add(iterator.next()); } diff --git a/client/src/main/java/com/vaadin/client/ui/tabsheet/TabsheetConnector.java b/client/src/main/java/com/vaadin/client/ui/tabsheet/TabsheetConnector.java index 1b043c8a51..1dcb517e96 100644 --- a/client/src/main/java/com/vaadin/client/ui/tabsheet/TabsheetConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/tabsheet/TabsheetConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -30,8 +30,8 @@ import com.vaadin.shared.ui.tabsheet.TabsheetClientRpc; import com.vaadin.ui.TabSheet; @Connect(TabSheet.class) -public class TabsheetConnector extends TabsheetBaseConnector implements - SimpleManagedLayout, MayScrollChildren { +public class TabsheetConnector extends TabsheetBaseConnector + implements SimpleManagedLayout, MayScrollChildren { public TabsheetConnector() { registerRpc(TabsheetClientRpc.class, new TabsheetClientRpc() { @@ -60,7 +60,7 @@ public class TabsheetConnector extends TabsheetBaseConnector implements /* * (non-Javadoc) - * + * * @see * com.vaadin.client.ui.AbstractComponentConnector#onStateChanged(com.vaadin * .client.communication.StateChangeEvent) diff --git a/client/src/main/java/com/vaadin/client/ui/textarea/TextAreaConnector.java b/client/src/main/java/com/vaadin/client/ui/textarea/TextAreaConnector.java index 3bc0a86df4..bf51590e64 100644 --- a/client/src/main/java/com/vaadin/client/ui/textarea/TextAreaConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/textarea/TextAreaConnector.java @@ -57,7 +57,8 @@ public class TextAreaConnector extends TextFieldConnector { updateSize(element.getStyle().getHeight(), getState().height, "height"); - updateSize(element.getStyle().getWidth(), getState().width, "width"); + updateSize(element.getStyle().getWidth(), getState().width, + "width"); } /* @@ -82,8 +83,8 @@ public class TextAreaConnector extends TextFieldConnector { return; } - getConnection().updateVariable(getConnectorId(), sizeType, - sizeText, false); + getConnection().updateVariable(getConnectorId(), sizeType, sizeText, + false); } } diff --git a/client/src/main/java/com/vaadin/client/ui/textfield/TextFieldConnector.java b/client/src/main/java/com/vaadin/client/ui/textfield/TextFieldConnector.java index 0d85e98ee3..ed47e61d27 100644 --- a/client/src/main/java/com/vaadin/client/ui/textfield/TextFieldConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/textfield/TextFieldConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -33,8 +33,8 @@ import com.vaadin.shared.ui.textfield.TextFieldConstants; import com.vaadin.ui.TextField; @Connect(value = TextField.class, loadStyle = LoadStyle.EAGER) -public class TextFieldConnector extends AbstractFieldConnector implements - Paintable, BeforeShortcutActionListener { +public class TextFieldConnector extends AbstractFieldConnector + implements Paintable, BeforeShortcutActionListener { @Override public AbstractTextFieldState getState() { @@ -59,14 +59,14 @@ public class TextFieldConnector extends AbstractFieldConnector implements getWidget().listenTextChangeEvents = hasEventListener("ie"); if (getWidget().listenTextChangeEvents) { - getWidget().textChangeEventMode = uidl - .getStringAttribute(TextFieldConstants.ATTR_TEXTCHANGE_EVENTMODE); + getWidget().textChangeEventMode = uidl.getStringAttribute( + TextFieldConstants.ATTR_TEXTCHANGE_EVENTMODE); if (getWidget().textChangeEventMode .equals(TextFieldConstants.TEXTCHANGE_MODE_EAGER)) { getWidget().textChangeEventTimeout = 1; } else { - getWidget().textChangeEventTimeout = uidl - .getIntAttribute(TextFieldConstants.ATTR_TEXTCHANGE_TIMEOUT); + getWidget().textChangeEventTimeout = uidl.getIntAttribute( + TextFieldConstants.ATTR_TEXTCHANGE_TIMEOUT); if (getWidget().textChangeEventTimeout < 1) { // Sanitize and allow lazy/timeout with timeout set to 0 to // work as eager @@ -90,7 +90,8 @@ public class TextFieldConnector extends AbstractFieldConnector implements * force updating if not focused. Lost focus issue appeared in (#15144) */ if (!(Util.getFocusedElement() == getWidget().getElement()) - || !uidl.getBooleanAttribute(TextFieldConstants.ATTR_NO_VALUE_CHANGE_BETWEEN_PAINTS) + || !uidl.getBooleanAttribute( + TextFieldConstants.ATTR_NO_VALUE_CHANGE_BETWEEN_PAINTS) || getWidget().valueBeforeEdit == null || !text.equals(getWidget().valueBeforeEdit)) { getWidget().updateFieldContent(text); diff --git a/client/src/main/java/com/vaadin/client/ui/tree/TreeConnector.java b/client/src/main/java/com/vaadin/client/ui/tree/TreeConnector.java index f49f44e802..8738120801 100644 --- a/client/src/main/java/com/vaadin/client/ui/tree/TreeConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/tree/TreeConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -43,8 +43,8 @@ import com.vaadin.shared.ui.tree.TreeState; import com.vaadin.ui.Tree; @Connect(Tree.class) -public class TreeConnector extends AbstractComponentConnector implements - Paintable { +public class TreeConnector extends AbstractComponentConnector + implements Paintable { protected final Map tooltipMap = new HashMap(); @@ -80,8 +80,8 @@ public class TreeConnector extends AbstractComponentConnector implements getWidget().disabled = !isEnabled(); getWidget().readonly = isReadOnly(); - getWidget().dragMode = uidl.hasAttribute("dragMode") ? uidl - .getIntAttribute("dragMode") : 0; + getWidget().dragMode = uidl.hasAttribute("dragMode") + ? uidl.getIntAttribute("dragMode") : 0; getWidget().isNullSelectionAllowed = uidl .getBooleanAttribute("nullselect"); @@ -133,8 +133,8 @@ public class TreeConnector extends AbstractComponentConnector implements // shift/ctrl keys (#8595) getWidget().multiSelectMode = MultiSelectMode.SIMPLE; } else { - getWidget().multiSelectMode = MultiSelectMode.valueOf(uidl - .getStringAttribute("multiselectmode")); + getWidget().multiSelectMode = MultiSelectMode + .valueOf(uidl.getStringAttribute("multiselectmode")); } } else { Roles.getTreeRole().setAriaMultiselectableProperty( @@ -148,8 +148,8 @@ public class TreeConnector extends AbstractComponentConnector implements // and keyboard navigation issues as described in #7057 and other // tickets. if (getWidget().lastSelection != null) { - getWidget().lastSelection = getWidget().getNodeByKey( - getWidget().lastSelection.key); + getWidget().lastSelection = getWidget() + .getNodeByKey(getWidget().lastSelection.key); } if (getWidget().focusedNode != null) { @@ -171,12 +171,10 @@ public class TreeConnector extends AbstractComponentConnector implements } } - if (getWidget().lastSelection == null - && getWidget().focusedNode == null + if (getWidget().lastSelection == null && getWidget().focusedNode == null && !getWidget().selectedIds.isEmpty()) { - getWidget().setFocusedNode( - getWidget().getNodeByKey( - getWidget().selectedIds.iterator().next())); + getWidget().setFocusedNode(getWidget() + .getNodeByKey(getWidget().selectedIds.iterator().next())); getWidget().focusedNode.setFocused(false); } @@ -200,8 +198,8 @@ public class TreeConnector extends AbstractComponentConnector implements } private void handleUpdate(UIDL uidl) { - final TreeNode rootNode = getWidget().getNodeByKey( - uidl.getStringAttribute("rootKey")); + final TreeNode rootNode = getWidget() + .getNodeByKey(uidl.getStringAttribute("rootKey")); if (rootNode != null) { if (!rootNode.getState()) { // expanding node happened server side @@ -224,7 +222,7 @@ public class TreeConnector extends AbstractComponentConnector implements /** * Registers action for the root and also for individual nodes - * + * * @param uidl */ private void updateActionMap(UIDL uidl) { @@ -237,8 +235,8 @@ public class TreeConnector extends AbstractComponentConnector implements String iconUrl = null; if (action.hasAttribute(TreeConstants.ATTRIBUTE_ACTION_ICON)) { iconUrl = getConnection() - .translateVaadinUri( - action.getStringAttribute(TreeConstants.ATTRIBUTE_ACTION_ICON)); + .translateVaadinUri(action.getStringAttribute( + TreeConstants.ATTRIBUTE_ACTION_ICON)); } getWidget().registerAction(key, caption, iconUrl); } @@ -283,8 +281,8 @@ public class TreeConnector extends AbstractComponentConnector implements String description = uidl.getStringAttribute("descr"); if (description != null) { - tooltipMap.put(treeNode, new TooltipInfo(description, null, - treeNode)); + tooltipMap.put(treeNode, + new TooltipInfo(description, null, treeNode)); } if (uidl.getBooleanAttribute("expanded") && !treeNode.getState()) { @@ -321,9 +319,8 @@ public class TreeConnector extends AbstractComponentConnector implements updateNodeFromUIDL(childTree, childUidl, level); containerNode.childNodeContainer.add(childTree); if (!i.hasNext()) { - childTree - .addStyleDependentName(childTree.isLeaf() ? "leaf-last" - : "last"); + childTree.addStyleDependentName( + childTree.isLeaf() ? "leaf-last" : "last"); childTree.childNodeContainer.addStyleDependentName("last"); } } diff --git a/client/src/main/java/com/vaadin/client/ui/treetable/TreeTableConnector.java b/client/src/main/java/com/vaadin/client/ui/treetable/TreeTableConnector.java index 0e0c190c11..410787fe27 100644 --- a/client/src/main/java/com/vaadin/client/ui/treetable/TreeTableConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/treetable/TreeTableConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -43,10 +43,11 @@ public class TreeTableConnector extends TableConnector { scrollPosition = widget.getScrollPosition(); } getWidget().animationsEnabled = uidl.getBooleanAttribute("animate"); - getWidget().colIndexOfHierarchy = uidl - .hasAttribute(TreeTableConstants.ATTRIBUTE_HIERARCHY_COLUMN_INDEX) ? uidl - .getIntAttribute(TreeTableConstants.ATTRIBUTE_HIERARCHY_COLUMN_INDEX) - : 0; + getWidget().colIndexOfHierarchy = uidl.hasAttribute( + TreeTableConstants.ATTRIBUTE_HIERARCHY_COLUMN_INDEX) + ? uidl.getIntAttribute( + TreeTableConstants.ATTRIBUTE_HIERARCHY_COLUMN_INDEX) + : 0; int oldTotalRows = getWidget().getTotalRows(); super.updateFromUIDL(uidl, client); @@ -57,8 +58,8 @@ public class TreeTableConnector extends TableConnector { if (getWidget().collapseRequest) { if (getWidget().collapsedRowKey != null && getWidget().scrollBody != null) { - VScrollTableRow row = getWidget().getRenderedRowByKey( - getWidget().collapsedRowKey); + VScrollTableRow row = getWidget() + .getRenderedRowByKey(getWidget().collapsedRowKey); if (row != null) { getWidget().setRowFocus(row); getWidget().focus(); @@ -76,9 +77,8 @@ public class TreeTableConnector extends TableConnector { } // Recalculate table size if collapse request, or if page length is zero // (not sent by server) and row count changes (#7908). - if (getWidget().collapseRequest - || (!uidl.hasAttribute("pagelength") && getWidget() - .getTotalRows() != oldTotalRows)) { + if (getWidget().collapseRequest || (!uidl.hasAttribute("pagelength") + && getWidget().getTotalRows() != oldTotalRows)) { /* * Ensure that possibly removed/added scrollbars are considered. * Triggers row calculations, removes cached rows etc. Basically @@ -107,8 +107,8 @@ public class TreeTableConnector extends TableConnector { // potential content changes pending PendingNavigationEvent event = getWidget().pendingNavigationEvents .removeFirst(); - getWidget() - .handleNavigation(event.keycode, event.ctrl, event.shift); + getWidget().handleNavigation(event.keycode, event.ctrl, + event.shift); } getWidget().rendering = false; } diff --git a/client/src/main/java/com/vaadin/client/ui/twincolselect/TwinColSelectConnector.java b/client/src/main/java/com/vaadin/client/ui/twincolselect/TwinColSelectConnector.java index 0994ac15c3..b0e6232f88 100644 --- a/client/src/main/java/com/vaadin/client/ui/twincolselect/TwinColSelectConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/twincolselect/TwinColSelectConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -26,8 +26,8 @@ import com.vaadin.shared.ui.twincolselect.TwinColSelectState; import com.vaadin.ui.TwinColSelect; @Connect(TwinColSelect.class) -public class TwinColSelectConnector extends OptionGroupBaseConnector implements - DirectionalManagedLayout { +public class TwinColSelectConnector extends OptionGroupBaseConnector + implements DirectionalManagedLayout { @Override public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { diff --git a/client/src/main/java/com/vaadin/client/ui/ui/UIConnector.java b/client/src/main/java/com/vaadin/client/ui/ui/UIConnector.java index ca9cb879af..d94f030d26 100644 --- a/client/src/main/java/com/vaadin/client/ui/ui/UIConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/ui/UIConnector.java @@ -161,7 +161,8 @@ public class UIConnector extends AbstractSingleComponentContainerConnector @Override public void reportLayoutProblems(String json) { - VConsole.printLayoutProblems(getValueMap(json), getConnection()); + VConsole.printLayoutProblems(getValueMap(json), + getConnection()); } private native ValueMap getValueMap(String json) @@ -239,8 +240,8 @@ public class UIConnector extends AbstractSingleComponentContainerConnector while (childIndex < uidl.getChildCount() && "open".equals(uidl.getChildUIDL(childIndex).getTag())) { final UIDL open = uidl.getChildUIDL(childIndex); - final String url = client.translateVaadinUri(open - .getStringAttribute("src")); + final String url = client + .translateVaadinUri(open.getStringAttribute("src")); final String target = open.getStringAttribute("name"); if (target == null) { // source will be opened to this browser window, but we may have @@ -265,7 +266,8 @@ public class UIConnector extends AbstractSingleComponentContainerConnector } if (alwaysAsPopup) { if (open.hasAttribute("border")) { - if (open.getStringAttribute("border").equals("minimal")) { + if (open.getStringAttribute("border") + .equals("minimal")) { options = "menubar=yes,location=no,status=no"; } else { options = "menubar=no,location=no,status=no"; @@ -350,8 +352,7 @@ public class UIConnector extends AbstractSingleComponentContainerConnector + " but it is not focusable. The widget should implement either " + com.google.gwt.user.client.ui.Focusable.class .getName() - + " or " - + Focusable.class.getName()); + + " or " + Focusable.class.getName()); } } }); @@ -378,8 +379,8 @@ public class UIConnector extends AbstractSingleComponentContainerConnector int fragmentIndex = location.indexOf('#'); if (fragmentIndex >= 0) { // Decode fragment to avoid double encoding (#10769) - newFragment = URL.decodePathSegment(location - .substring(fragmentIndex + 1)); + newFragment = URL.decodePathSegment( + location.substring(fragmentIndex + 1)); if (newFragment.isEmpty() && Location.getHref().indexOf('#') == -1) { @@ -415,7 +416,7 @@ public class UIConnector extends AbstractSingleComponentContainerConnector /** * Reads CSS strings and resources injected by {@link Styles#inject} from * the UIDL stream. - * + * * @param uidl * The uidl which contains "css-resource" and "css-string" tags */ @@ -429,11 +430,10 @@ public class UIConnector extends AbstractSingleComponentContainerConnector // Check if we have resources to inject if (cssInjectionsUidl.getTag().equals("css-resource")) { - String url = getWidget().connection - .translateVaadinUri(cssInjectionsUidl - .getStringAttribute("url")); - LinkElement link = LinkElement.as(DOM - .createElement(LinkElement.TAG)); + String url = getWidget().connection.translateVaadinUri( + cssInjectionsUidl.getStringAttribute("url")); + LinkElement link = LinkElement + .as(DOM.createElement(LinkElement.TAG)); link.setRel("stylesheet"); link.setHref(url); link.setType("text/css"); @@ -451,7 +451,7 @@ public class UIConnector extends AbstractSingleComponentContainerConnector /** * Internal helper to get the tag of the page - * + * * @since 7.3 * @return the head element */ @@ -462,14 +462,14 @@ public class UIConnector extends AbstractSingleComponentContainerConnector /** * Internal helper for removing any stylesheet with the given URL - * + * * @since 7.3 * @param url * the url to match with existing stylesheets */ private void removeStylesheet(String url) { - NodeList linkTags = getHead().getElementsByTagName( - LinkElement.TAG); + NodeList linkTags = getHead() + .getElementsByTagName(LinkElement.TAG); for (int i = 0; i < linkTags.getLength(); i++) { LinkElement link = LinkElement.as(linkTags.getItem(i)); if (!"stylesheet".equals(link.getRel())) { @@ -507,14 +507,13 @@ public class UIConnector extends AbstractSingleComponentContainerConnector @Override public void onKeyDown(KeyDownEvent event) { if (getWidget().actionHandler != null) { - Element target = Element.as(event.getNativeEvent() - .getEventTarget()); + Element target = Element + .as(event.getNativeEvent().getEventTarget()); if (target == Document.get().getBody() || getWidget().getElement().isOrHasChild(target)) { // Only react to body and elements inside the UI - getWidget().actionHandler - .handleKeyboardEvent((Event) event - .getNativeEvent().cast()); + getWidget().actionHandler.handleKeyboardEvent( + (Event) event.getNativeEvent().cast()); } } @@ -621,7 +620,7 @@ public class UIConnector extends AbstractSingleComponentContainerConnector /** * Checks if the given sub window is a child of this UI Connector - * + * * @deprecated Should be replaced by a more generic mechanism for getting * non-ComponentConnector children * @param wc @@ -635,7 +634,7 @@ public class UIConnector extends AbstractSingleComponentContainerConnector /** * Return an iterator for current subwindows. This method is meant for * testing purposes only. - * + * * @return */ public List getSubWindows() { @@ -662,7 +661,7 @@ public class UIConnector extends AbstractSingleComponentContainerConnector * public API instead of their state object directly. The page state might * not be an independent state object but can be embedded in UI state. *

    - * + * * @since 7.1 * @return state object of the page */ @@ -671,7 +670,8 @@ public class UIConnector extends AbstractSingleComponentContainerConnector } @Override - public void onConnectorHierarchyChange(ConnectorHierarchyChangeEvent event) { + public void onConnectorHierarchyChange( + ConnectorHierarchyChangeEvent event) { ComponentConnector oldChild = null; ComponentConnector newChild = getContent(); @@ -739,10 +739,10 @@ public class UIConnector extends AbstractSingleComponentContainerConnector /** * Tries to scroll the viewport so that the given connector is in view. - * + * * @param componentConnector * The connector which should be visible - * + * */ public void scrollIntoView(final ComponentConnector componentConnector) { if (componentConnector == null) { @@ -763,14 +763,14 @@ public class UIConnector extends AbstractSingleComponentContainerConnector if (stateChangeEvent.hasPropertyChanged("tooltipConfiguration")) { getConnection().getVTooltip().setCloseTimeout( getState().tooltipConfiguration.closeTimeout); - getConnection().getVTooltip().setOpenDelay( - getState().tooltipConfiguration.openDelay); + getConnection().getVTooltip() + .setOpenDelay(getState().tooltipConfiguration.openDelay); getConnection().getVTooltip().setQuickOpenDelay( getState().tooltipConfiguration.quickOpenDelay); getConnection().getVTooltip().setQuickOpenTimeout( getState().tooltipConfiguration.quickOpenTimeout); - getConnection().getVTooltip().setMaxWidth( - getState().tooltipConfiguration.maxWidth); + getConnection().getVTooltip() + .setMaxWidth(getState().tooltipConfiguration.maxWidth); } if (stateChangeEvent @@ -798,7 +798,8 @@ public class UIConnector extends AbstractSingleComponentContainerConnector getConnection().getMessageSender().setPushEnabled( getState().pushConfiguration.mode.isEnabled()); } - if (stateChangeEvent.hasPropertyChanged("reconnectDialogConfiguration")) { + if (stateChangeEvent + .hasPropertyChanged("reconnectDialogConfiguration")) { getConnection().getConnectionStateHandler().configurationUpdated(); } @@ -831,15 +832,15 @@ public class UIConnector extends AbstractSingleComponentContainerConnector pollTimer.scheduleRepeating(getState().pollInterval); } else { // Ensure no more polls are sent as polling has been disabled - getConnection().getServerRpcQueue().removeMatching( - new MethodInvocation(getConnectorId(), UIServerRpc.class - .getName(), "poll")); + getConnection().getServerRpcQueue() + .removeMatching(new MethodInvocation(getConnectorId(), + UIServerRpc.class.getName(), "poll")); } } /** * Invokes the layout analyzer on the server - * + * * @since 7.1 */ public void analyzeLayouts() { @@ -850,20 +851,20 @@ public class UIConnector extends AbstractSingleComponentContainerConnector * Sends a request to the server to print details to console that will help * the developer to locate the corresponding server-side connector in the * source code. - * + * * @since 7.1 * @param serverConnector * the connector to locate */ public void showServerDebugInfo(ServerConnector serverConnector) { - getRpcProxy(DebugWindowServerRpc.class).showServerDebugInfo( - serverConnector); + getRpcProxy(DebugWindowServerRpc.class) + .showServerDebugInfo(serverConnector); } /** * Sends a request to the server to print a design to the console for the * given component. - * + * * @since 7.5 * @param connector * the component connector to output a declarative design for @@ -908,7 +909,7 @@ public class UIConnector extends AbstractSingleComponentContainerConnector /** * Loads the new theme and removes references to the old theme - * + * * @since 7.4.3 * @param oldTheme * The name of the old theme @@ -929,11 +930,10 @@ public class UIConnector extends AbstractSingleComponentContainerConnector if (tagToReplace == null) { getLogger() - .warning( - "Did not find the link tag for the old theme (" - + oldThemeUrl - + "), adding a new stylesheet for the new theme (" - + newThemeUrl + ")"); + .warning("Did not find the link tag for the old theme (" + + oldThemeUrl + + "), adding a new stylesheet for the new theme (" + + newThemeUrl + ")"); } } @@ -950,7 +950,8 @@ public class UIConnector extends AbstractSingleComponentContainerConnector } private void updateVaadinFavicon(String newTheme) { - NodeList iconElements = querySelectorAll("link[rel~=\"icon\"]"); + NodeList iconElements = querySelectorAll( + "link[rel~=\"icon\"]"); for (int i = 0; i < iconElements.getLength(); i++) { Element iconElement = iconElements.getItem(i); @@ -971,15 +972,15 @@ public class UIConnector extends AbstractSingleComponentContainerConnector /** * Finds a link tag for a style sheet with the given URL - * + * * @since 7.3 * @param url * the URL of the style sheet * @return the link tag or null if no matching link tag was found */ private LinkElement findStylesheetTag(String url) { - NodeList linkTags = getHead().getElementsByTagName( - LinkElement.TAG); + NodeList linkTags = getHead() + .getElementsByTagName(LinkElement.TAG); for (int i = 0; i < linkTags.getLength(); i++) { final LinkElement link = LinkElement.as(linkTags.getItem(i)); if ("stylesheet".equals(link.getRel()) @@ -994,7 +995,7 @@ public class UIConnector extends AbstractSingleComponentContainerConnector /** * Loads the given theme and replaces the given link element with the new * theme link element. - * + * * @param newTheme * The name of the new theme * @param newThemeUrl @@ -1014,22 +1015,20 @@ public class UIConnector extends AbstractSingleComponentContainerConnector @Override public void onLoad(ResourceLoadEvent event) { - getLogger().info( - "Loading of " + newTheme + " from " - + newThemeUrl + " completed"); + getLogger().info("Loading of " + newTheme + " from " + + newThemeUrl + " completed"); if (tagToReplace != null) { - tagToReplace.getParentElement().removeChild( - tagToReplace); + tagToReplace.getParentElement() + .removeChild(tagToReplace); } activateTheme(newTheme); } @Override public void onError(ResourceLoadEvent event) { - getLogger().warning( - "Could not load theme from " - + getThemeUrl(newTheme)); + getLogger().warning("Could not load theme from " + + getThemeUrl(newTheme)); } }, null); @@ -1043,7 +1042,7 @@ public class UIConnector extends AbstractSingleComponentContainerConnector /** * Activates the new theme. Assumes the theme has been loaded and taken into * use in the browser. - * + * * @since 7.4.3 * @param newTheme * The name of the new theme @@ -1051,8 +1050,8 @@ public class UIConnector extends AbstractSingleComponentContainerConnector protected void activateTheme(String newTheme) { if (activeTheme != null) { getWidget().getParent().removeStyleName(activeTheme); - VOverlay.getOverlayContainer(getConnection()).removeClassName( - activeTheme); + VOverlay.getOverlayContainer(getConnection()) + .removeClassName(activeTheme); } String oldThemeBase = getConnection().translateVaadinUri("theme://"); @@ -1061,8 +1060,8 @@ public class UIConnector extends AbstractSingleComponentContainerConnector if (newTheme != null) { getWidget().getParent().addStyleName(newTheme); - VOverlay.getOverlayContainer(getConnection()).addClassName( - activeTheme); + VOverlay.getOverlayContainer(getConnection()) + .addClassName(activeTheme); updateVaadinFavicon(newTheme); @@ -1079,9 +1078,9 @@ public class UIConnector extends AbstractSingleComponentContainerConnector /** * Force a full recursive recheck of every connector's state variables. - * + * * @see #forceStateChange() - * + * * @since 7.3 */ protected static void forceStateChangeRecursively( @@ -1102,16 +1101,16 @@ public class UIConnector extends AbstractSingleComponentContainerConnector /** * Internal helper to get the theme URL for a given theme - * + * * @since 7.3 * @param theme * the name of the theme * @return The URL the theme can be loaded from */ private String getThemeUrl(String theme) { - String themeUrl = getConnection().translateVaadinUri( - ApplicationConstants.VAADIN_PROTOCOL_PREFIX + "themes/" + theme - + "/styles" + ".css"); + String themeUrl = getConnection() + .translateVaadinUri(ApplicationConstants.VAADIN_PROTOCOL_PREFIX + + "themes/" + theme + "/styles" + ".css"); // Parameter appended to bypass caches after version upgrade. themeUrl += "?v=" + Version.getFullVersion(); return themeUrl; @@ -1120,7 +1119,7 @@ public class UIConnector extends AbstractSingleComponentContainerConnector /** * Returns the name of the theme currently in used by the UI - * + * * @since 7.3 * @return the theme name used by this UI */ diff --git a/client/src/main/java/com/vaadin/client/ui/upload/UploadConnector.java b/client/src/main/java/com/vaadin/client/ui/upload/UploadConnector.java index 9e25770a17..6e05387c1d 100644 --- a/client/src/main/java/com/vaadin/client/ui/upload/UploadConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/upload/UploadConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -32,8 +32,8 @@ import com.vaadin.shared.ui.upload.UploadState; import com.vaadin.ui.Upload; @Connect(Upload.class) -public class UploadConnector extends AbstractComponentConnector implements - Paintable { +public class UploadConnector extends AbstractComponentConnector + implements Paintable { public UploadConnector() { registerRpc(UploadClientRpc.class, new UploadClientRpc() { @@ -52,8 +52,8 @@ public class UploadConnector extends AbstractComponentConnector implements @Override public void onChange(ChangeEvent event) { if (hasEventListener(EventId.CHANGE)) { - getRpcProxy(UploadServerRpc.class).change( - getWidget().fu.getFilename()); + getRpcProxy(UploadServerRpc.class) + .change(getWidget().fu.getFilename()); } } }); @@ -72,12 +72,12 @@ public class UploadConnector extends AbstractComponentConnector implements getWidget().client = client; getWidget().paintableId = uidl.getId(); getWidget().nextUploadId = uidl.getIntAttribute("nextid"); - final String action = client.translateVaadinUri(uidl - .getStringVariable("action")); + final String action = client + .translateVaadinUri(uidl.getStringVariable("action")); getWidget().element.setAction(action); if (uidl.hasAttribute("buttoncaption")) { - getWidget().submitButton.setText(uidl - .getStringAttribute("buttoncaption")); + getWidget().submitButton + .setText(uidl.getStringAttribute("buttoncaption")); getWidget().submitButton.setVisible(true); } else { getWidget().submitButton.setVisible(false); diff --git a/client/src/main/java/com/vaadin/client/ui/upload/UploadIFrameOnloadStrategy.java b/client/src/main/java/com/vaadin/client/ui/upload/UploadIFrameOnloadStrategy.java index 2c2e10594d..4563f9a137 100644 --- a/client/src/main/java/com/vaadin/client/ui/upload/UploadIFrameOnloadStrategy.java +++ b/client/src/main/java/com/vaadin/client/ui/upload/UploadIFrameOnloadStrategy.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/upload/UploadIFrameOnloadStrategyIE.java b/client/src/main/java/com/vaadin/client/ui/upload/UploadIFrameOnloadStrategyIE.java index 0c114e2ee7..071c9cfef2 100644 --- a/client/src/main/java/com/vaadin/client/ui/upload/UploadIFrameOnloadStrategyIE.java +++ b/client/src/main/java/com/vaadin/client/ui/upload/UploadIFrameOnloadStrategyIE.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,7 +20,7 @@ import com.vaadin.client.ui.VUpload; /** * IE does not have onload, detect onload via readystatechange - * + * */ public class UploadIFrameOnloadStrategyIE extends UploadIFrameOnloadStrategy { @Override diff --git a/client/src/main/java/com/vaadin/client/ui/video/VideoConnector.java b/client/src/main/java/com/vaadin/client/ui/video/VideoConnector.java index de53368d6a..ee9fba950f 100644 --- a/client/src/main/java/com/vaadin/client/ui/video/VideoConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/video/VideoConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/main/java/com/vaadin/client/ui/window/WindowConnector.java b/client/src/main/java/com/vaadin/client/ui/window/WindowConnector.java index 8ddf099e28..9160daf48a 100644 --- a/client/src/main/java/com/vaadin/client/ui/window/WindowConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/window/WindowConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -59,9 +59,8 @@ import com.vaadin.shared.ui.window.WindowState; @Connect(value = com.vaadin.ui.Window.class) public class WindowConnector extends AbstractSingleComponentContainerConnector - implements Paintable, BeforeShortcutActionListener, - SimpleManagedLayout, PostLayoutListener, MayScrollChildren, - WindowMoveHandler { + implements Paintable, BeforeShortcutActionListener, SimpleManagedLayout, + PostLayoutListener, MayScrollChildren, WindowMoveHandler { private Node windowClone; @@ -73,8 +72,8 @@ public class WindowConnector extends AbstractSingleComponentContainerConnector } }; - abstract class WindowEventHandler implements ClickHandler, - DoubleClickHandler { + abstract class WindowEventHandler + implements ClickHandler, DoubleClickHandler { } private WindowEventHandler maximizeRestoreClickHandler = new WindowEventHandler() { @@ -196,7 +195,8 @@ public class WindowConnector extends AbstractSingleComponentContainerConnector } @Override - public void onConnectorHierarchyChange(ConnectorHierarchyChangeEvent event) { + public void onConnectorHierarchyChange( + ConnectorHierarchyChangeEvent event) { // We always have 1 child, unless the child is hidden getWidget().contentPanel.setWidget(getContentWidget()); @@ -246,8 +246,8 @@ public class WindowConnector extends AbstractSingleComponentContainerConnector int minHeight = footerHeight + headerHeight; getWidget().getElement().getStyle().setPropertyPx("minWidth", minWidth); - getWidget().getElement().getStyle() - .setPropertyPx("minHeight", minHeight); + getWidget().getElement().getStyle().setPropertyPx("minHeight", + minHeight); /* * Must set absolute position if the child has relative height and @@ -289,8 +289,8 @@ public class WindowConnector extends AbstractSingleComponentContainerConnector VWindow window = getWidget(); if (!window.isAttached()) { - Logger.getLogger(WindowConnector.class.getName()).warning( - "Called postLayout to detached Window."); + Logger.getLogger(WindowConnector.class.getName()) + .warning("Called postLayout to detached Window."); return; } if (window.centered && getState().windowMode != WindowMode.MAXIMIZED) { @@ -311,8 +311,8 @@ public class WindowConnector extends AbstractSingleComponentContainerConnector // have to replace them with stubs in the clone. And we can't just // erase them, because there are corresponding player widgets to // animate - windowClone = cloneNodeFilteringMedia(getWidget().getElement() - .getFirstChild()); + windowClone = cloneNodeFilteringMedia( + getWidget().getElement().getFirstChild()); } } @@ -328,7 +328,8 @@ public class WindowConnector extends AbstractSingleComponentContainerConnector } Element newEl = DOM.createElement(old.getTagName()); if (old.hasAttribute("controls")) { - newEl.setAttribute("controls", old.getAttribute("controls")); + newEl.setAttribute("controls", + old.getAttribute("controls")); } if (old.hasAttribute("style")) { newEl.setAttribute("style", old.getAttribute("style")); @@ -373,10 +374,11 @@ public class WindowConnector extends AbstractSingleComponentContainerConnector window.resizeLazy = state.resizeLazy; - window.setDraggable(state.draggable - && state.windowMode == WindowMode.NORMAL); + window.setDraggable( + state.draggable && state.windowMode == WindowMode.NORMAL); - window.updateMaximizeRestoreClassName(state.resizable, state.windowMode); + window.updateMaximizeRestoreClassName(state.resizable, + state.windowMode); // Caption must be set before required header size is measured. If // the caption attribute is missing the caption should be cleared. @@ -394,7 +396,8 @@ public class WindowConnector extends AbstractSingleComponentContainerConnector window.setTabStopEnabled(getState().assistiveTabStop); window.setTabStopTopAssistiveText(getState().assistiveTabStopTopText); - window.setTabStopBottomAssistiveText(getState().assistiveTabStopBottomText); + window.setTabStopBottomAssistiveText( + getState().assistiveTabStopBottomText); clickEventHandler.handleEventHandlerRegistration(); @@ -459,14 +462,15 @@ public class WindowConnector extends AbstractSingleComponentContainerConnector WindowState state = getState(); // update draggable on widget - window.setDraggable(state.draggable - && state.windowMode == WindowMode.NORMAL); + window.setDraggable( + state.draggable && state.windowMode == WindowMode.NORMAL); // update resizable on widget - window.setResizable(state.resizable - && state.windowMode == WindowMode.NORMAL); + window.setResizable( + state.resizable && state.windowMode == WindowMode.NORMAL); updateComponentSize(); updateWindowPosition(); - window.updateMaximizeRestoreClassName(state.resizable, state.windowMode); + window.updateMaximizeRestoreClassName(state.resizable, + state.windowMode); window.updateContentsSize(); } @@ -483,8 +487,8 @@ public class WindowConnector extends AbstractSingleComponentContainerConnector VWindow window = getWidget(); window.bringToFront(); - getRpcProxy(WindowServerRpc.class).windowModeChanged( - state.windowMode); + getRpcProxy(WindowServerRpc.class) + .windowModeChanged(state.windowMode); } } @@ -508,8 +512,8 @@ public class WindowConnector extends AbstractSingleComponentContainerConnector @Override public void onWindowMove(WindowMoveEvent event) { - RpcProxy.create(WindowServerRpc.class, this).windowMoved( - event.getNewX(), event.getNewY()); + RpcProxy.create(WindowServerRpc.class, this) + .windowMoved(event.getNewX(), event.getNewY()); } } diff --git a/client/src/main/java/com/vaadin/client/ui/window/WindowMoveEvent.java b/client/src/main/java/com/vaadin/client/ui/window/WindowMoveEvent.java index add7ee740f..498617cd30 100644 --- a/client/src/main/java/com/vaadin/client/ui/window/WindowMoveEvent.java +++ b/client/src/main/java/com/vaadin/client/ui/window/WindowMoveEvent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -19,7 +19,7 @@ import com.google.gwt.event.shared.GwtEvent; /** * Event for window position updates - * + * * @since 7.1.9 * @author Vaadin Ltd */ @@ -32,7 +32,7 @@ public class WindowMoveEvent extends GwtEvent { /** * Creates a new event with the given parameters - * + * * @param x * The new x-position for the VWindow * @param y @@ -45,7 +45,7 @@ public class WindowMoveEvent extends GwtEvent { /** * Gets the new x position of the window - * + * * @return the new X position of the VWindow */ public int getNewX() { @@ -54,7 +54,7 @@ public class WindowMoveEvent extends GwtEvent { /** * Gets the new y position of the window - * + * * @return the new Y position of the VWindow */ public int getNewY() { @@ -63,7 +63,7 @@ public class WindowMoveEvent extends GwtEvent { /** * Gets the type of the event - * + * * @return the type of the event */ public static Type getType() { diff --git a/client/src/main/java/com/vaadin/client/ui/window/WindowMoveHandler.java b/client/src/main/java/com/vaadin/client/ui/window/WindowMoveHandler.java index 0ac348af68..381c67ba37 100644 --- a/client/src/main/java/com/vaadin/client/ui/window/WindowMoveHandler.java +++ b/client/src/main/java/com/vaadin/client/ui/window/WindowMoveHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -19,7 +19,7 @@ import com.google.gwt.event.shared.EventHandler; /** * Handler for {@link WindowMoveEvent}s - * + * * @since 7.1.9 * @author Vaadin Ltd */ @@ -27,7 +27,7 @@ public interface WindowMoveHandler extends EventHandler { /** * Called when the VWindow was moved by the user. - * + * * @param event * Contains new coordinates for the VWindow */ diff --git a/client/src/main/java/com/vaadin/client/widget/escalator/Cell.java b/client/src/main/java/com/vaadin/client/widget/escalator/Cell.java index 08dbcf6955..e965557d2c 100644 --- a/client/src/main/java/com/vaadin/client/widget/escalator/Cell.java +++ b/client/src/main/java/com/vaadin/client/widget/escalator/Cell.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,7 +25,7 @@ import com.google.gwt.dom.client.TableCellElement; *

    * Unlike the {@link FlyweightRow}, an instance of {@link Cell} can be stored in * a field. - * + * * @since 7.4 * @author Vaadin Ltd */ @@ -39,7 +39,7 @@ public class Cell { /** * Constructs a new {@link Cell}. - * + * * @param row * The index of the row * @param column @@ -56,9 +56,9 @@ public class Cell { /** * Returns the index of the row the cell resides in. - * + * * @return the row index - * + * */ public int getRow() { return row; @@ -66,7 +66,7 @@ public class Cell { /** * Returns the index of the column the cell resides in. - * + * * @return the column index */ public int getColumn() { @@ -75,7 +75,7 @@ public class Cell { /** * Returns the element of the cell. - * + * * @return the cell element */ public TableCellElement getElement() { diff --git a/client/src/main/java/com/vaadin/client/widget/escalator/ColumnConfiguration.java b/client/src/main/java/com/vaadin/client/widget/escalator/ColumnConfiguration.java index 76f6a55b8a..8e37b63b89 100644 --- a/client/src/main/java/com/vaadin/client/widget/escalator/ColumnConfiguration.java +++ b/client/src/main/java/com/vaadin/client/widget/escalator/ColumnConfiguration.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,7 +20,7 @@ import java.util.Map; /** * A representation of the columns in an instance of {@link Escalator}. - * + * * @since 7.4 * @author Vaadin Ltd * @see Escalator#getColumnConfiguration() @@ -37,7 +37,7 @@ public interface ColumnConfiguration { * do much of anything else. Especially if you have column spans, you * probably need to run {@link #refreshColumns(int, int)} or * {@link RowContainer#refreshRows(int, int)} - * + * * @param index * the index of the first column to be removed * @param numberOfColumns @@ -71,7 +71,7 @@ public interface ColumnConfiguration { * columns (e.g. you have column spans), * {@link RowContainer#refreshRows(int, int)} or * {@link #refreshColumns(int, int)} needs to be called as appropriate. - * + * * @param index * the index of the column before which new columns are inserted, * or {@link #getColumnCount()} to add new columns at the end @@ -88,7 +88,7 @@ public interface ColumnConfiguration { /** * Returns the number of columns in the escalator. - * + * * @return the number of columns in the escalator */ public int getColumnCount(); @@ -96,27 +96,27 @@ public interface ColumnConfiguration { /** * Sets the number of leftmost columns that are not affected by horizontal * scrolling. - * + * * @param count * the number of columns to freeze - * + * * @throws IllegalArgumentException * if the column count is < 0 or > the number of columns - * + * */ public void setFrozenColumnCount(int count) throws IllegalArgumentException; /** * Get the number of leftmost columns that are not affected by horizontal * scrolling. - * + * * @return the number of frozen columns */ public int getFrozenColumnCount(); /** * Sets (or unsets) an explicit width for a column. - * + * * @param index * the index of the column for which to set a width * @param px @@ -130,7 +130,7 @@ public interface ColumnConfiguration { /** * Returns the user-defined width of a column. - * + * * @param index * the index of the column for which to retrieve the width * @return the column's width in pixels, or a negative number if the width @@ -142,7 +142,7 @@ public interface ColumnConfiguration { /** * Sets widths for a set of columns. - * + * * @param indexWidthMap * a map from column index to its respective width to be set. If * the given width for a column index is negative, the column is @@ -159,7 +159,7 @@ public interface ColumnConfiguration { /** * Returns the actual width of a column. - * + * * @param index * the index of the column for which to retrieve the width * @return the column's actual width in pixels @@ -175,7 +175,7 @@ public interface ColumnConfiguration { *

    * The data for the refreshed columns is queried from the current cell * renderer. - * + * * @param index * the index of the first row that will be updated * @param numberOfRows diff --git a/client/src/main/java/com/vaadin/client/widget/escalator/EscalatorUpdater.java b/client/src/main/java/com/vaadin/client/widget/escalator/EscalatorUpdater.java index 54507a7650..c26776015e 100644 --- a/client/src/main/java/com/vaadin/client/widget/escalator/EscalatorUpdater.java +++ b/client/src/main/java/com/vaadin/client/widget/escalator/EscalatorUpdater.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -26,7 +26,7 @@ package com.vaadin.client.widget.escalator; *

    * This has a similar function to {@link Grid Grid's} {@link Renderer Renderers} * , although they operate on different abstraction levels. - * + * * @since 7.4 * @author Vaadin Ltd * @see RowContainer#setEscalatorUpdater(EscalatorUpdater) @@ -84,7 +84,7 @@ public interface EscalatorUpdater { *

    * For performance reasons, the escalator will never autonomously clear any * data in a cell. - * + * * @param row * Information about the row that is being updated. * Note: You should not store nor reuse this reference. @@ -97,7 +97,7 @@ public interface EscalatorUpdater { /** * Called before attaching new cells to the escalator. - * + * * @param row * Information about the row to which the cells will be added. * Note: You should not store nor reuse this reference. @@ -105,13 +105,13 @@ public interface EscalatorUpdater { * A collection of cells that are about to be attached. * Note: You should neither store nor reuse the * reference to the iterable, nor to the individual cells. - * + * */ public void preAttach(Row row, Iterable cellsToAttach); /** * Called after attaching new cells to the escalator. - * + * * @param row * Information about the row to which the cells were added. * Note: You should not store nor reuse this reference. @@ -119,13 +119,13 @@ public interface EscalatorUpdater { * A collection of cells that were attached. Note: You * should neither store nor reuse the reference to the iterable, * nor to the individual cells. - * + * */ public void postAttach(Row row, Iterable attachedCells); /** * Called before detaching cells from the escalator. - * + * * @param row * Information about the row from which the cells will be * removed. Note: You should not store nor reuse this @@ -134,13 +134,13 @@ public interface EscalatorUpdater { * A collection of cells that are about to be detached. * Note: You should neither store nor reuse the * reference to the iterable, nor to the individual cells. - * + * */ public void preDetach(Row row, Iterable cellsToDetach); /** * Called after detaching cells from the escalator. - * + * * @param row * Information about the row from which the cells were removed. * Note: You should not store nor reuse this reference. @@ -148,7 +148,7 @@ public interface EscalatorUpdater { * A collection of cells that were detached. Note: You * should neither store nor reuse the reference to the iterable, * nor to the individual cells. - * + * */ public void postDetach(Row row, Iterable detachedCells); diff --git a/client/src/main/java/com/vaadin/client/widget/escalator/FlyweightCell.java b/client/src/main/java/com/vaadin/client/widget/escalator/FlyweightCell.java index b77b752327..8e18c0f2c7 100644 --- a/client/src/main/java/com/vaadin/client/widget/escalator/FlyweightCell.java +++ b/client/src/main/java/com/vaadin/client/widget/escalator/FlyweightCell.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -26,13 +26,13 @@ import com.vaadin.client.widgets.Escalator; /** * A {@link FlyweightCell} represents a cell in the {@link Grid} or * {@link Escalator} at a certain point in time. - * + * *

    * Since the {@link FlyweightCell} follows the Flyweight-pattern * any instance of this object is subject to change without the user knowing it * and so should not be stored anywhere outside of the method providing these * instances. - * + * * @since 7.4 * @author Vaadin Ltd */ @@ -87,7 +87,7 @@ public class FlyweightCell { * Sets the DOM element for this FlyweightCell, either a TD or * a TH. It is the caller's responsibility to actually insert * the given element to the document when needed. - * + * * @param element * the element corresponding to this cell, cannot be null */ @@ -126,7 +126,7 @@ public class FlyweightCell { * This should only be used with asserts (" * assert flyweightCell.teardown() ") so that the code is never * run when asserts aren't enabled. - * + * * @return always true * @see FlyweightRow#teardown() */ @@ -169,8 +169,8 @@ public class FlyweightCell { } private void adjustCellWidthForSpan(final int numberOfCells) { - final int cellsToTheRight = currentIterator.rawPeekNext( - numberOfCells - 1).size(); + final int cellsToTheRight = currentIterator + .rawPeekNext(numberOfCells - 1).size(); final double selfWidth = row.getColumnWidth(column); double widthsOfColumnsToTheRight = 0; @@ -193,8 +193,8 @@ public class FlyweightCell { } } else if (prevColSpan > numberOfCells) { for (int i = 0; i < affectedCells.size(); i++) { - affectedCells.get(numberOfCells + i - 1).getElement() - .getStyle().clearDisplay(); + affectedCells.get(numberOfCells + i - 1).getElement().getStyle() + .clearDisplay(); } } } diff --git a/client/src/main/java/com/vaadin/client/widget/escalator/FlyweightRow.java b/client/src/main/java/com/vaadin/client/widget/escalator/FlyweightRow.java index 8628adb05f..f98747c3f8 100644 --- a/client/src/main/java/com/vaadin/client/widget/escalator/FlyweightRow.java +++ b/client/src/main/java/com/vaadin/client/widget/escalator/FlyweightRow.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -27,7 +27,7 @@ import com.google.gwt.dom.client.TableRowElement; *

    * There is only one instance per Escalator. This is designed to be re-used when * rendering rows. - * + * * @since 7.4 * @author Vaadin Ltd * @see Escalator.AbstractRowContainer#refreshRow(Node, int) @@ -45,7 +45,7 @@ public class FlyweightRow implements Row { * Creates a new iterator of attached flyweight cells. A cell is * attached if it has a corresponding {@link FlyweightCell#getElement() * DOM element} attached to the row element. - * + * * @param cells * the collection of cells to iterate */ @@ -59,7 +59,7 @@ public class FlyweightRow implements Row { * unattached if it does not have a corresponding * {@link FlyweightCell#getElement() DOM element} attached to the row * element. - * + * * @param cells * the collection of cells to iterate */ @@ -101,7 +101,7 @@ public class FlyweightRow implements Row { /** * Sets the number of cells to skip when {@link #next()} is called the * next time. Cell hiding is also handled eagerly in this method. - * + * * @param colspan * the number of cells to skip on next invocation of * {@link #next()} @@ -115,7 +115,7 @@ public class FlyweightRow implements Row { /** * Gets the next n cells in the iterator, ignoring any * possibly spanned cells. - * + * * @param n * the number of next cells to retrieve * @return A list of next n cells, or less if there aren't @@ -160,7 +160,7 @@ public class FlyweightRow implements Row { * This should only be used with asserts (" * assert flyweightRow.teardown() ") so that the code is never * run when asserts aren't enabled. - * + * * @return always true */ public boolean teardown() { @@ -211,9 +211,9 @@ public class FlyweightRow implements Row { * element. *

    * Precondition: each cell has a corresponding element in the row - * + * * @return an iterable of flyweight cells - * + * * @see #setup(Element, int, int[]) * @see #teardown() */ @@ -227,7 +227,7 @@ public class FlyweightRow implements Row { * from the row element. *

    * Precondition: each cell has a corresponding element in the row - * + * * @param offset * the index of the first cell to return * @param numberOfCells @@ -237,12 +237,13 @@ public class FlyweightRow implements Row { public Iterable getCells(final int offset, final int numberOfCells) { assertSetup(); - assert offset >= 0 && offset + numberOfCells <= cells.size() : "Invalid range of cells"; + assert offset >= 0 && offset + numberOfCells <= cells + .size() : "Invalid range of cells"; return new Iterable() { @Override public Iterator iterator() { - return CellIterator.attached(cells.subList(offset, offset - + numberOfCells)); + return CellIterator.attached( + cells.subList(offset, offset + numberOfCells)); } }; } @@ -255,7 +256,7 @@ public class FlyweightRow implements Row { * invoke this method with correct parameters. *

    * Precondition: the range [offset, offset + numberOfCells) must be valid - * + * * @param offset * the index of the first cell to return * @param numberOfCells @@ -265,12 +266,13 @@ public class FlyweightRow implements Row { public Iterable getUnattachedCells(final int offset, final int numberOfCells) { assertSetup(); - assert offset >= 0 && offset + numberOfCells <= cells.size() : "Invalid range of cells"; + assert offset >= 0 && offset + numberOfCells <= cells + .size() : "Invalid range of cells"; return new Iterable() { @Override public Iterator iterator() { - return CellIterator.unattached(cells.subList(offset, offset - + numberOfCells)); + return CellIterator.unattached( + cells.subList(offset, offset + numberOfCells)); } }; } @@ -280,11 +282,12 @@ public class FlyweightRow implements Row { * access any of its data. */ private void assertSetup() { - assert element != null && row != BLANK && columnWidths != null : "Flyweight row was not " - + "properly initialized. Make sure the setup-method is " - + "called before retrieving data. This is either a bug " - + "in Escalator, or the instance of the flyweight row " - + "has been stored and accessed."; + assert element != null && row != BLANK + && columnWidths != null : "Flyweight row was not " + + "properly initialized. Make sure the setup-method is " + + "called before retrieving data. This is either a bug " + + "in Escalator, or the instance of the flyweight row " + + "has been stored and accessed."; } double getColumnWidth(int column) { diff --git a/client/src/main/java/com/vaadin/client/widget/escalator/PositionFunction.java b/client/src/main/java/com/vaadin/client/widget/escalator/PositionFunction.java index 929f27df37..8ee1733c1c 100644 --- a/client/src/main/java/com/vaadin/client/widget/escalator/PositionFunction.java +++ b/client/src/main/java/com/vaadin/client/widget/escalator/PositionFunction.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,7 +21,7 @@ import com.google.gwt.dom.client.Style.Unit; /** * A functional interface that can be used for positioning elements in the DOM. - * + * * @since 7.4 * @author Vaadin Ltd */ @@ -97,7 +97,7 @@ public interface PositionFunction { /** * Position an element in an (x,y) coordinate system in the DOM. - * + * * @param e * the element to position. Never null. * @param x @@ -110,7 +110,7 @@ public interface PositionFunction { /** * Resets any previously applied positioning, clearing the used style * attributes. - * + * * @param e * the element for which to reset the positioning */ diff --git a/client/src/main/java/com/vaadin/client/widget/escalator/Row.java b/client/src/main/java/com/vaadin/client/widget/escalator/Row.java index fa89853120..936f256b92 100644 --- a/client/src/main/java/com/vaadin/client/widget/escalator/Row.java +++ b/client/src/main/java/com/vaadin/client/widget/escalator/Row.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,14 +20,14 @@ import com.google.gwt.dom.client.TableRowElement; /** * A representation of a row in an {@link Escalator}. - * + * * @since 7.4 * @author Vaadin Ltd */ public interface Row { /** * Gets the row index. - * + * * @return the row index */ public int getRow(); @@ -41,7 +41,7 @@ public interface Row { * If you wish to modify the cells within this row element, access them via * the List<{@link Cell}> objects passed in to * {@code EscalatorUpdater.updateCells(Row, List)} - * + * * @return the root element of the row */ public TableRowElement getElement(); diff --git a/client/src/main/java/com/vaadin/client/widget/escalator/RowContainer.java b/client/src/main/java/com/vaadin/client/widget/escalator/RowContainer.java index abab25046c..89da37897c 100644 --- a/client/src/main/java/com/vaadin/client/widget/escalator/RowContainer.java +++ b/client/src/main/java/com/vaadin/client/widget/escalator/RowContainer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -23,7 +23,7 @@ import com.google.gwt.dom.client.TableSectionElement; /** * A representation of the rows in each of the sections (header, body and * footer) in an {@link com.vaadin.client.widgets.Escalator}. - * + * * @since 7.4 * @author Vaadin Ltd * @see com.vaadin.client.widgets.Escalator#getHeader() @@ -38,7 +38,7 @@ public interface RowContainer { * {@link com.vaadin.client.widgets.Escalator}. *

    * The body section can contain both rows and spacers. - * + * * @since 7.5.0 * @author Vaadin Ltd * @see com.vaadin.client.widgets.Escalator#getBody() @@ -54,7 +54,7 @@ public interface RowContainer { * Note: The row index for a spacer will change if rows are * inserted or removed above the current position. Spacers will also be * removed alongside their associated rows - * + * * @param rowIndex * the row index for the spacer to modify. The affected * spacer is underneath the given index. Use -1 to insert a @@ -77,7 +77,7 @@ public interface RowContainer { * {@link SpacerUpdater#destroy(Spacer) destroyed} with the previous * one, and {@link SpacerUpdater#init(Spacer) initialized} with the new * one. - * + * * @param spacerUpdater * the new spacer updater * @throws IllegalArgumentException @@ -90,7 +90,7 @@ public interface RowContainer { * Gets the spacer updater currently in use. *

    * {@link SpacerUpdater#NULL} is the default. - * + * * @return the spacer updater currently in use. Never null */ SpacerUpdater getSpacerUpdater(); @@ -120,12 +120,12 @@ public interface RowContainer { /** * An arbitrary pixel height of a row, before any autodetection for the row * height has been made. - * */ + */ public static final double INITIAL_DEFAULT_ROW_HEIGHT = 20; /** * Returns the current {@link EscalatorUpdater} used to render cells. - * + * * @return the current escalator updater */ public EscalatorUpdater getEscalatorUpdater(); @@ -133,7 +133,7 @@ public interface RowContainer { /** * Sets the {@link EscalatorUpdater} to use when displaying data in the * escalator. - * + * * @param escalatorUpdater * the escalator updater to use to render cells. May not be * null @@ -146,7 +146,7 @@ public interface RowContainer { /** * Removes rows at a certain index in the current row container. - * + * * @param index * the index of the first row to be removed * @param numberOfRows @@ -176,7 +176,7 @@ public interface RowContainer { * If inserting new rows affects the contents of existing rows, * {@link #refreshRows(int, int)} needs to be called for those rows * separately. - * + * * @param index * the index of the row before which new rows are inserted, or * {@link #getRowCount()} to add rows at the end @@ -197,7 +197,7 @@ public interface RowContainer { *

    * The data for the refreshed rows is queried from the current cell * renderer. - * + * * @param index * the index of the first row that will be updated * @param numberOfRows @@ -215,14 +215,14 @@ public interface RowContainer { /** * Gets the number of rows in the current row container. - * + * * @return the number of rows in the current row container */ public int getRowCount(); /** * The default height of the rows in this RowContainer. - * + * * @param px * the default height in pixels of the rows in this RowContainer * @throws IllegalArgumentException @@ -237,7 +237,7 @@ public interface RowContainer { * This value will be equal to {@link #INITIAL_DEFAULT_ROW_HEIGHT} if the * {@link Escalator} has not yet had a chance to autodetect the row height, * or no explicit value has yet given via {@link #setDefaultRowHeight(int)} - * + * * @return the default height of the rows in this RowContainer, in pixels * @see #setDefaultRowHeight(int) */ @@ -246,11 +246,11 @@ public interface RowContainer { /** * Returns the cell object which contains information about the cell the * element is in. - * + * * @param element * The element to get the cell for. If element is not present in * row container then null is returned. - * + * * @return the cell of the element, or null if element is not * present in the {@link RowContainer}. */ @@ -260,7 +260,7 @@ public interface RowContainer { * Gets the row element with given logical index. For lazy loaded containers * such as Escalators BodyRowContainer visibility should be checked before * calling this function. See {@link Escalator#getVisibleRowRange()}. - * + * * @param index * the logical index of the element to retrieve * @return the element at position {@code index} @@ -274,7 +274,7 @@ public interface RowContainer { /** * Returns the root element of RowContainer - * + * * @return RowContainer root element */ public TableSectionElement getElement(); diff --git a/client/src/main/java/com/vaadin/client/widget/escalator/RowVisibilityChangeEvent.java b/client/src/main/java/com/vaadin/client/widget/escalator/RowVisibilityChangeEvent.java index 5f1531e378..2ee232aa1d 100644 --- a/client/src/main/java/com/vaadin/client/widget/escalator/RowVisibilityChangeEvent.java +++ b/client/src/main/java/com/vaadin/client/widget/escalator/RowVisibilityChangeEvent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,12 +21,12 @@ import com.vaadin.shared.ui.grid.Range; /** * Event fired when the range of visible rows changes e.g. because of scrolling. - * + * * @since 7.4 * @author Vaadin Ltd */ -public class RowVisibilityChangeEvent extends - GwtEvent { +public class RowVisibilityChangeEvent + extends GwtEvent { /** * The type of this event. */ @@ -36,7 +36,7 @@ public class RowVisibilityChangeEvent extends /** * Creates a new row visibility change event - * + * * @param firstVisibleRow * the index of the first visible row * @param visibleRowCount @@ -48,7 +48,7 @@ public class RowVisibilityChangeEvent extends /** * Gets the index of the first row that is at least partially visible. - * + * * @return the index of the first visible row */ public int getFirstVisibleRow() { @@ -57,7 +57,7 @@ public class RowVisibilityChangeEvent extends /** * Gets the number of at least partially visible rows. - * + * * @return the number of visible rows */ public int getVisibleRowCount() { @@ -66,7 +66,7 @@ public class RowVisibilityChangeEvent extends /** * Gets the range of visible rows. - * + * * @since 7.6 * @return the visible rows */ @@ -76,7 +76,7 @@ public class RowVisibilityChangeEvent extends /* * (non-Javadoc) - * + * * @see com.google.gwt.event.shared.GwtEvent#getAssociatedType() */ @Override @@ -86,7 +86,7 @@ public class RowVisibilityChangeEvent extends /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.shared.GwtEvent#dispatch(com.google.gwt.event.shared * .EventHandler) diff --git a/client/src/main/java/com/vaadin/client/widget/escalator/RowVisibilityChangeHandler.java b/client/src/main/java/com/vaadin/client/widget/escalator/RowVisibilityChangeHandler.java index 80a30184c0..2489fe6002 100644 --- a/client/src/main/java/com/vaadin/client/widget/escalator/RowVisibilityChangeHandler.java +++ b/client/src/main/java/com/vaadin/client/widget/escalator/RowVisibilityChangeHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,7 +21,7 @@ import com.google.gwt.event.shared.EventHandler; /** * Event handler that gets notified when the range of visible rows changes e.g. * because of scrolling. - * + * * @since 7.4 * @author Vaadin Ltd */ @@ -29,7 +29,7 @@ public interface RowVisibilityChangeHandler extends EventHandler { /** * Called when the range of visible rows changes e.g. because of scrolling. - * + * * @param event * the row visibility change event describing the change */ diff --git a/client/src/main/java/com/vaadin/client/widget/escalator/ScrollbarBundle.java b/client/src/main/java/com/vaadin/client/widget/escalator/ScrollbarBundle.java index 367537d20d..7443b5d315 100644 --- a/client/src/main/java/com/vaadin/client/widget/escalator/ScrollbarBundle.java +++ b/client/src/main/java/com/vaadin/client/widget/escalator/ScrollbarBundle.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -40,7 +40,7 @@ import com.vaadin.client.widget.grid.events.ScrollHandler; /** * An element-like bundle representing a configurable and visual scrollbar in * one axis. - * + * * @since 7.4 * @author Vaadin Ltd * @see VerticalScrollbarBundle @@ -60,16 +60,16 @@ public abstract class ScrollbarBundle implements DeferredWorker { * The weird thing is, that happens only once, and if you drag * scrollbar fast enough. After it has failed once, it never * fails again. - * + * * Theory: the user drags the scrollbar, and this command is * executed before the browser has a chance to fire a scroll * event (which normally would correct this situation). This * would explain why slow scrolling doesn't trigger the problem, * while fast scrolling does. - * + * * To make absolutely sure that we have the latest scroll * position, let's update the internal value. - * + * * This might lead to a slight performance hit (on my computer * it was never more than 3ms on either of Chrome 38 or Firefox * 31). It also _slightly_ counteracts the purpose of the @@ -131,15 +131,15 @@ public abstract class ScrollbarBundle implements DeferredWorker { /** * This method is called whenever the scrollbar handle's visibility is * changed in a {@link ScrollbarBundle}. - * + * * @param event * the {@link VisibilityChangeEvent} */ void visibilityChanged(VisibilityChangeEvent event); } - public static class VisibilityChangeEvent extends - GwtEvent { + public static class VisibilityChangeEvent + extends GwtEvent { public static final Type TYPE = new Type() { @Override public String toString() { @@ -155,7 +155,7 @@ public abstract class ScrollbarBundle implements DeferredWorker { /** * Checks whether the scroll handle is currently visible or not - * + * * @return true if the scroll handle is currently visible. * false if not. */ @@ -187,7 +187,7 @@ public abstract class ScrollbarBundle implements DeferredWorker { /** * A representation of a single vertical scrollbar. - * + * * @see VerticalScrollbarBundle#getElement() */ public final static class VerticalScrollbarBundle extends ScrollbarBundle { @@ -257,10 +257,11 @@ public abstract class ScrollbarBundle implements DeferredWorker { /** * A representation of a single horizontal scrollbar. - * + * * @see HorizontalScrollbarBundle#getElement() */ - public final static class HorizontalScrollbarBundle extends ScrollbarBundle { + public final static class HorizontalScrollbarBundle + extends ScrollbarBundle { @Override public void setStylePrimaryName(String primaryStyleName) { @@ -357,7 +358,7 @@ public abstract class ScrollbarBundle implements DeferredWorker { /** * Sets the primary style name - * + * * @param primaryStyleName * The primary style name to use */ @@ -367,7 +368,7 @@ public abstract class ScrollbarBundle implements DeferredWorker { /** * Gets the root element of this scrollbar-composition. - * + * * @return the root element */ public final Element getElement() { @@ -381,7 +382,7 @@ public abstract class ScrollbarBundle implements DeferredWorker { * currently only used as integers as large {@code int} (or small but fast * {@code long}). This means, all values are truncated to zero decimal * places. - * + * * @param delta * the delta in pixels to change the scroll position by */ @@ -394,7 +395,7 @@ public abstract class ScrollbarBundle implements DeferredWorker { /** * Modifies {@link #root root's} dimensions in the axis the scrollbar is * representing. - * + * * @param px * the new size of {@link #root} in the dimension this scrollbar * is representing @@ -403,7 +404,7 @@ public abstract class ScrollbarBundle implements DeferredWorker { /** * Sets the length of the scrollbar. - * + * * @param px * the length of the scrollbar in pixels */ @@ -420,12 +421,13 @@ public abstract class ScrollbarBundle implements DeferredWorker { && newOffsetSizeIsGreaterThanScrollSize; if (offsetSizeBecomesGreaterThanScrollSize && getScrollPos() != 0) { // must be a field because Java insists. - offsetSizeTemporaryScrollHandler = addScrollHandler(new ScrollHandler() { - @Override - public void onScroll(ScrollEvent event) { - setOffsetSizeNow(px); - } - }); + offsetSizeTemporaryScrollHandler = addScrollHandler( + new ScrollHandler() { + @Override + public void onScroll(ScrollEvent event) { + setOffsetSizeNow(px); + } + }); setScrollPos(0); } else { setOffsetSizeNow(px); @@ -477,7 +479,7 @@ public abstract class ScrollbarBundle implements DeferredWorker { /** * Gets the length of the scrollbar - * + * * @return the length of the scrollbar in pixels */ public double getOffsetSize() { @@ -494,7 +496,7 @@ public abstract class ScrollbarBundle implements DeferredWorker { * currently only used as integers as large {@code int} (or small but fast * {@code long}). This means, all values are truncated to zero decimal * places. - * + * * @param px * the new scroll position in pixels */ @@ -527,7 +529,7 @@ public abstract class ScrollbarBundle implements DeferredWorker { * Should be called whenever this bundle is attached to the DOM (typically, * from the onLoad of the containing widget). Used to ensure the DOM scroll * position is maintained when detaching and reattaching the bundle. - * + * * @since 7.4.1 */ public void onLoad() { @@ -538,7 +540,7 @@ public abstract class ScrollbarBundle implements DeferredWorker { * Truncates a double such that no decimal places are retained. *

    * E.g. {@code trunc(2.3d) == 2.0d} and {@code trunc(-2.3d) == -2.0d}. - * + * * @param num * the double value to be truncated * @return the {@code num} value without any decimal digits @@ -558,7 +560,7 @@ public abstract class ScrollbarBundle implements DeferredWorker { * double) by design. The browsers internally convert all double values into * an integer value. To make this fact explicit, this API has chosen to * force integers already at this level. - * + * * @param px * integer pixel value to scroll to */ @@ -567,14 +569,14 @@ public abstract class ScrollbarBundle implements DeferredWorker { /** * Gets the scroll position of the scrollbar in the axis the scrollbar is * representing. - * + * * @return the new scroll position in pixels */ public final double getScrollPos() { - assert internalGetScrollPos() == toInt32(scrollPos) : "calculated scroll position (" - + scrollPos - + ") did not match the DOM element scroll position (" - + internalGetScrollPos() + ")"; + assert internalGetScrollPos() == toInt32( + scrollPos) : "calculated scroll position (" + scrollPos + + ") did not match the DOM element scroll position (" + + internalGetScrollPos() + ")"; return scrollPos; } @@ -585,7 +587,7 @@ public abstract class ScrollbarBundle implements DeferredWorker { * double) by design. The browsers internally convert all double values into * an integer value. To make this fact explicit, this API has chosen to * force integers already at this level. - * + * * @return integer pixel value of the scroll position */ protected abstract int internalGetScrollPos(); @@ -594,7 +596,7 @@ public abstract class ScrollbarBundle implements DeferredWorker { * Modifies {@link #scrollSizeElement scrollSizeElement's} dimensions in * such a way that the scrollbar is able to scroll a certain number of * pixels in the axis it is representing. - * + * * @param px * the new size of {@link #scrollSizeElement} in the dimension * this scrollbar is representing @@ -604,7 +606,7 @@ public abstract class ScrollbarBundle implements DeferredWorker { /** * Sets the amount of pixels the scrollbar needs to be able to scroll * through. - * + * * @param px * the number of pixels the scrollbar should be able to scroll * through @@ -666,7 +668,7 @@ public abstract class ScrollbarBundle implements DeferredWorker { /** * Gets the amount of pixels the scrollbar needs to be able to scroll * through. - * + * * @return the number of pixels the scrollbar should be able to scroll * through */ @@ -677,7 +679,7 @@ public abstract class ScrollbarBundle implements DeferredWorker { /** * Modifies {@link #scrollSizeElement scrollSizeElement's} dimensions in the * opposite axis to what the scrollbar is representing. - * + * * @param px * the dimension that {@link #scrollSizeElement} should take in * the opposite axis to what the scrollbar is representing @@ -691,7 +693,7 @@ public abstract class ScrollbarBundle implements DeferredWorker { * "invisible" scrollbar. This means, the DOM structure will be given a * non-zero size, but {@link #getScrollbarThickness()} will still return the * value 0. - * + * * @param px * the scrollbar's thickness in pixels */ @@ -718,7 +720,7 @@ public abstract class ScrollbarBundle implements DeferredWorker { /** * Gets the scrollbar's thickness as defined in the DOM. - * + * * @return the scrollbar's thickness as defined in the DOM, in pixels */ protected abstract String internalGetScrollbarThickness(); @@ -729,7 +731,7 @@ public abstract class ScrollbarBundle implements DeferredWorker { * This value will differ from the value in the DOM, if the thickness was * set to 0 with {@link #setScrollbarThickness(double)}, as the scrollbar is * then treated as "invisible." - * + * * @return the scrollbar's thickness in pixels */ public final double getScrollbarThickness() { @@ -745,7 +747,7 @@ public abstract class ScrollbarBundle implements DeferredWorker { *

    * In other words, this method checks whether the contents is larger than * can visually fit in the element. - * + * * @return true iff the scrollbar's handle is visible */ public boolean showsScrollHandle() { @@ -793,7 +795,7 @@ public abstract class ScrollbarBundle implements DeferredWorker { /** * Adds handler for the scrollbar handle visibility. - * + * * @param handler * the {@link VisibilityHandler} to add * @return {@link HandlerRegistration} used to remove the handler @@ -818,7 +820,7 @@ public abstract class ScrollbarBundle implements DeferredWorker { * Converts a double into an integer by JavaScript's terms. *

    * Implementation copied from {@link Element#toInt32(double)}. - * + * * @param val * the double value to convert into an integer * @return the double value converted to an integer @@ -833,7 +835,7 @@ public abstract class ScrollbarBundle implements DeferredWorker { *

    * A locked scrollbar bundle will refuse to scroll, both programmatically * and via user-triggered events. - * + * * @param isLocked * true to lock, false to unlock */ @@ -843,7 +845,7 @@ public abstract class ScrollbarBundle implements DeferredWorker { /** * Checks whether the scrollbar bundle is locked or not. - * + * * @return true iff the scrollbar bundle is locked */ public boolean isLocked() { @@ -852,14 +854,14 @@ public abstract class ScrollbarBundle implements DeferredWorker { /** * Returns the scroll direction of this scrollbar bundle. - * + * * @return the scroll direction of this scrollbar bundle */ public abstract Direction getDirection(); /** * Adds a scroll handler to the scrollbar bundle. - * + * * @param handler * the handler to add * @return the registration object for the handler registration @@ -875,7 +877,7 @@ public abstract class ScrollbarBundle implements DeferredWorker { * element.getOffset*() because those values are 0 whenever display: * none. Because we know that all elements have populated * CSS-dimensions, it's better to do it that way. - * + * * Another solution would be to make the elements visible while * measuring and then re-hide them, but that would cause unnecessary * reflows that would probably kill the performance dead. diff --git a/client/src/main/java/com/vaadin/client/widget/escalator/Spacer.java b/client/src/main/java/com/vaadin/client/widget/escalator/Spacer.java index 789a64a21e..000cd14f6c 100644 --- a/client/src/main/java/com/vaadin/client/widget/escalator/Spacer.java +++ b/client/src/main/java/com/vaadin/client/widget/escalator/Spacer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,7 +20,7 @@ import com.google.gwt.dom.client.Element; /** * A representation of a spacer element in a * {@link com.vaadin.client.widget.escalator.RowContainer.BodyRowContainer}. - * + * * @since 7.5.0 * @author Vaadin Ltd */ @@ -28,7 +28,7 @@ public interface Spacer { /** * Gets the root element for the spacer content. - * + * * @return the root element for the spacer content */ Element getElement(); @@ -40,7 +40,7 @@ public interface Spacer { /** * Gets the row index. - * + * * @return the row index. */ int getRow(); diff --git a/client/src/main/java/com/vaadin/client/widget/escalator/SpacerUpdater.java b/client/src/main/java/com/vaadin/client/widget/escalator/SpacerUpdater.java index 49adefd536..16a385f70a 100644 --- a/client/src/main/java/com/vaadin/client/widget/escalator/SpacerUpdater.java +++ b/client/src/main/java/com/vaadin/client/widget/escalator/SpacerUpdater.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -22,7 +22,7 @@ import com.vaadin.client.widget.escalator.RowContainer.BodyRowContainer; *

    * The updater is responsible for making sure all elements are properly * constructed and cleaned up. - * + * * @since 7.5.0 * @author Vaadin Ltd * @see Spacer @@ -45,7 +45,7 @@ public interface SpacerUpdater { /** * Called whenever a spacer should be initialized with content. - * + * * @param spacer * the spacer reference that should be initialized */ @@ -56,7 +56,7 @@ public interface SpacerUpdater { *

    * The structure to clean up is the same that has been constructed by * {@link #init(Spacer)}. - * + * * @param spacer * the spacer reference that should be destroyed */ diff --git a/client/src/main/java/com/vaadin/client/widget/escalator/events/RowHeightChangedHandler.java b/client/src/main/java/com/vaadin/client/widget/escalator/events/RowHeightChangedHandler.java index 40bd380de2..205d006326 100644 --- a/client/src/main/java/com/vaadin/client/widget/escalator/events/RowHeightChangedHandler.java +++ b/client/src/main/java/com/vaadin/client/widget/escalator/events/RowHeightChangedHandler.java @@ -29,7 +29,8 @@ public interface RowHeightChangedHandler extends EventHandler { * A row height changed event, fired by Escalator when the header, body or * footer row height has changed. * - * @param event Row height changed event + * @param event + * Row height changed event */ public void onRowHeightChanged(RowHeightChangedEvent event); } diff --git a/client/src/main/java/com/vaadin/client/widget/grid/AutoScroller.java b/client/src/main/java/com/vaadin/client/widget/grid/AutoScroller.java index 9cc238ac15..1d8d2864c1 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/AutoScroller.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/AutoScroller.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -33,7 +33,7 @@ import com.vaadin.client.widgets.Grid; * A class for handling automatic scrolling vertically / horizontally in the * Grid when the cursor is close enough the edge of the body of the grid, * depending on the scroll direction chosen. - * + * * @since 7.5.0 * @author Vaadin Ltd */ @@ -50,7 +50,7 @@ public class AutoScroller { *

    * Because the auto scroller currently only supports scrolling in one * axis, this method is used for both vertical and horizontal scrolling. - * + * * @param scrollDiff * the amount of pixels that have been auto scrolled since * last call @@ -106,7 +106,7 @@ public class AutoScroller { * Something has dropped a touchend/touchcancel and the * scroller is most probably running amok. Let's cancel it * and pretend that everything's going as expected - * + * * Because this is a preview, this code is run before start * event can be passed to the start(...) method. */ @@ -159,7 +159,8 @@ public class AutoScroller { * direction has started. */ private static final int SCROLL_AREA_REBOUND_PX_PER_SEC = 1; - private static final double SCROLL_AREA_REBOUND_PX_PER_MS = SCROLL_AREA_REBOUND_PX_PER_SEC / 1000.0d; + private static final double SCROLL_AREA_REBOUND_PX_PER_MS = SCROLL_AREA_REBOUND_PX_PER_SEC + / 1000.0d; /** * The lowest y/x-coordinate on the {@link Event#getClientY() client-y} @@ -273,8 +274,8 @@ public class AutoScroller { return; } - int reboundPx = (int) Math.ceil(SCROLL_AREA_REBOUND_PX_PER_MS - * timeDiff); + int reboundPx = (int) Math + .ceil(SCROLL_AREA_REBOUND_PX_PER_MS * timeDiff); if (startBound < finalStartBound) { startBound += reboundPx; startBound = Math.min(startBound, finalStartBound); @@ -378,7 +379,8 @@ public class AutoScroller { final boolean startDidNotMove = oldTopBound == startBound; final boolean endDidNotMove = oldBottomBound == endBound; final boolean wasMovement = pageCordinate != scrollingAxisPageCoordinate; - scrollAreaShouldRebound = (startDidNotMove && endDidNotMove && wasMovement); + scrollAreaShouldRebound = (startDidNotMove && endDidNotMove + && wasMovement); } } } @@ -446,7 +448,7 @@ public class AutoScroller { /** * Creates a new instance for scrolling the given grid. - * + * * @param grid * the grid to auto scroll */ @@ -456,7 +458,7 @@ public class AutoScroller { /** * Starts the automatic scrolling detection. - * + * * @param startEvent * the event that starts the automatic scroll * @param scrollAxis @@ -497,7 +499,7 @@ public class AutoScroller { * triggered. *

    * Defaults to 100px. - * + * * @param px * the pixel height/width for the auto scroll area depending on * direction @@ -510,7 +512,7 @@ public class AutoScroller { * Returns the size of the auto scroll area in pixels. *

    * Defaults to 100px. - * + * * @return size in pixels */ public int getScrollArea() { @@ -623,7 +625,8 @@ public class AutoScroller { private int getRealFrozenColumnCount() { if (grid.getFrozenColumnCount() < 0) { return 0; - } else if (grid.getSelectionModel().getSelectionColumnRenderer() != null) { + } else if (grid.getSelectionModel() + .getSelectionColumnRenderer() != null) { // includes the selection column return grid.getFrozenColumnCount() + 1; } else { @@ -633,7 +636,8 @@ public class AutoScroller { private double getMaxScrollLeft() { return grid.getScrollWidth() - - (getTableElement().getParentElement().getOffsetWidth() - getFrozenColumnsWidth()); + - (getTableElement().getParentElement().getOffsetWidth() + - getFrozenColumnsWidth()); } private double getMaxScrollTop() { diff --git a/client/src/main/java/com/vaadin/client/widget/grid/CellReference.java b/client/src/main/java/com/vaadin/client/widget/grid/CellReference.java index e783cb92ae..17ab480d3b 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/CellReference.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/CellReference.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,7 +25,7 @@ import com.vaadin.client.widgets.Grid; * Since this class follows the Flyweight-pattern any instance of * this object is subject to change without the user knowing it and so should * not be stored anywhere outside of the method providing these instances. - * + * * @author Vaadin Ltd * @param * the type of the row object containing this cell @@ -47,7 +47,7 @@ public class CellReference { *

    * The difference between {@link #columnIndexDOM} and {@link #columnIndex} * comes from hidden columns. - * + * * @param columnIndexDOM * the index of the column in the DOM * @param columnIndex @@ -64,7 +64,7 @@ public class CellReference { /** * Gets the grid that contains the referenced cell. - * + * * @return the grid that contains referenced cell */ public Grid getGrid() { @@ -73,7 +73,7 @@ public class CellReference { /** * Gets the row index of the row. - * + * * @return the index of the row */ public int getRowIndex() { @@ -82,7 +82,7 @@ public class CellReference { /** * Gets the row data object. - * + * * @return the row object */ public T getRow() { @@ -94,7 +94,7 @@ public class CellReference { *

    * NOTE: The index includes hidden columns in the count, unlike * {@link #getColumnIndexDOM()}. - * + * * @return the index of the column */ public int getColumnIndex() { @@ -104,7 +104,7 @@ public class CellReference { /** * Gets the index of the cell in the DOM. The difference to * {@link #getColumnIndex()} is caused by hidden columns. - * + * * @since 7.5.0 * @return the index of the column in the DOM */ @@ -114,7 +114,7 @@ public class CellReference { /** * Gets the column objects. - * + * * @return the column object */ public Grid.Column getColumn() { @@ -123,7 +123,7 @@ public class CellReference { /** * Gets the value of the cell. - * + * * @return the value of the cell */ public Object getValue() { @@ -132,7 +132,7 @@ public class CellReference { /** * Get the element of the cell. - * + * * @return the element of the cell */ public TableCellElement getElement() { @@ -141,7 +141,7 @@ public class CellReference { /** * Gets the RowReference for this CellReference. - * + * * @return the row reference */ protected RowReference getRowReference() { diff --git a/client/src/main/java/com/vaadin/client/widget/grid/CellStyleGenerator.java b/client/src/main/java/com/vaadin/client/widget/grid/CellStyleGenerator.java index bbc540de64..0496001a9f 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/CellStyleGenerator.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/CellStyleGenerator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -19,7 +19,7 @@ import com.vaadin.client.widgets.Grid; /** * Callback interface for generating custom style names for cells - * + * * @author Vaadin Ltd * @param * the row type of the target grid @@ -30,7 +30,7 @@ public interface CellStyleGenerator { /** * Called by Grid to generate a style name for a column element. - * + * * @param cellReference * The cell to generate a style for * @return the style name to add to this cell, or {@code null} to not set diff --git a/client/src/main/java/com/vaadin/client/widget/grid/DataAvailableEvent.java b/client/src/main/java/com/vaadin/client/widget/grid/DataAvailableEvent.java index d88fce4e11..5379c1cfa9 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/DataAvailableEvent.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/DataAvailableEvent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,7 +20,7 @@ import com.vaadin.shared.ui.grid.Range; /** * Event object describing a change of row availability in DataSource of a Grid. - * + * * @since 7.4 * @author Vaadin Ltd */ @@ -35,7 +35,7 @@ public class DataAvailableEvent extends GwtEvent { /** * Returns the range of available rows in {@link DataSource} for this event. - * + * * @return range of available rows */ public Range getAvailableRows() { diff --git a/client/src/main/java/com/vaadin/client/widget/grid/DataAvailableHandler.java b/client/src/main/java/com/vaadin/client/widget/grid/DataAvailableHandler.java index 5e0650bc41..e4d640b952 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/DataAvailableHandler.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/DataAvailableHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -19,7 +19,7 @@ import com.google.gwt.event.shared.EventHandler; /** * Handler for {@link DataAvailableEvent}s. - * + * * @since 7.4 * @author Vaadin Ltd */ @@ -27,7 +27,7 @@ public interface DataAvailableHandler extends EventHandler { /** * Called when DataSource has data available. Supplied with row range. - * + * * @param availableRows * Range of rows available in the DataSource * @return true if the command was successfully completed, false to call diff --git a/client/src/main/java/com/vaadin/client/widget/grid/DefaultEditorEventHandler.java b/client/src/main/java/com/vaadin/client/widget/grid/DefaultEditorEventHandler.java index e4a8783f54..f5e261f901 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/DefaultEditorEventHandler.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/DefaultEditorEventHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -29,7 +29,7 @@ import com.vaadin.client.widgets.Grid.EditorDomEvent; /** * The default handler for Grid editor events. Offers several overridable * protected methods for easier customization. - * + * * @since 7.6 * @author Vaadin Ltd */ @@ -49,7 +49,7 @@ public class DefaultEditorEventHandler implements Editor.EventHandler { /** * Returns whether the given event is a touch event that should open the * editor. - * + * * @param event * the received event * @return whether the event is a touch open event @@ -85,7 +85,7 @@ public class DefaultEditorEventHandler implements Editor.EventHandler { * Returns whether the given event should open the editor. The default * implementation returns true if and only if the event is a doubleclick or * if it is a keydown event and the keycode is {@link #KEYCODE_OPEN}. - * + * * @param event * the received event * @return true if the event is an open event, false otherwise @@ -93,7 +93,8 @@ public class DefaultEditorEventHandler implements Editor.EventHandler { protected boolean isOpenEvent(EditorDomEvent event) { final Event e = event.getDomEvent(); return e.getTypeInt() == Event.ONDBLCLICK - || (e.getTypeInt() == Event.ONKEYDOWN && e.getKeyCode() == KEYCODE_OPEN) + || (e.getTypeInt() == Event.ONKEYDOWN + && e.getKeyCode() == KEYCODE_OPEN) || isTouchOpenEvent(event); } @@ -101,7 +102,7 @@ public class DefaultEditorEventHandler implements Editor.EventHandler { * Opens the editor on the appropriate row if the received event is an open * event. The default implementation uses * {@link #isOpenEvent(EditorDomEvent) isOpenEvent}. - * + * * @param event * the received event * @return true if this method handled the event and nothing else should be @@ -128,7 +129,7 @@ public class DefaultEditorEventHandler implements Editor.EventHandler { * row up or down if the shift key is pressed or not, respectively. Keydown * event with keycode {@link #KEYCODE_MOVE_HORIZONTAL} moves the editor left * or right if shift key is pressed or not, respectively. - * + * * @param event * the received event * @return true if this method handled the event and nothing else should be @@ -172,8 +173,8 @@ public class DefaultEditorEventHandler implements Editor.EventHandler { // of range. if (rowDelta == 0) { if (colIndex >= columnCount - && rowIndex < event.getGrid().getDataSource() - .size() - 1) { + && rowIndex < event.getGrid().getDataSource().size() + - 1) { rowDelta = 1; colIndex = 0; } else if (colIndex < 0 && rowIndex > 0) { @@ -196,7 +197,7 @@ public class DefaultEditorEventHandler implements Editor.EventHandler { * By default the editor is moved on a keydown event with keycode * {@link #KEYCODE_MOVE_HORIZONTAL}. This moves the editor left or right if * shift key is pressed or not, respectively. - * + * * @param event * the received event * @return true if this method handled the event and nothing else should be @@ -208,8 +209,8 @@ public class DefaultEditorEventHandler implements Editor.EventHandler { if (e.getType().equals(BrowserEvents.CLICK) && event.getRowIndex() == event.getCell().getRowIndex()) { - editRow(event, event.getRowIndex(), event.getCell() - .getColumnIndexDOM()); + editRow(event, event.getRowIndex(), + event.getCell().getColumnIndexDOM()); return true; @@ -239,7 +240,7 @@ public class DefaultEditorEventHandler implements Editor.EventHandler { * Returns whether the given event should close the editor. The default * implementation returns true if and only if the event is a keydown event * and the keycode is {@link #KEYCODE_CLOSE}. - * + * * @param event * the received event * @return true if the event is a close event, false otherwise @@ -253,7 +254,7 @@ public class DefaultEditorEventHandler implements Editor.EventHandler { /** * Closes the editor if the received event is a close event. The default * implementation uses {@link #isCloseEvent(EditorDomEvent) isCloseEvent}. - * + * * @param event * the received event * @return true if this method handled the event and nothing else should be @@ -268,7 +269,8 @@ public class DefaultEditorEventHandler implements Editor.EventHandler { return false; } - protected void editRow(EditorDomEvent event, int rowIndex, int colIndex) { + protected void editRow(EditorDomEvent event, int rowIndex, + int colIndex) { int rowCount = event.getGrid().getDataSource().size(); // Limit rowIndex between 0 and rowCount - 1 rowIndex = Math.max(0, Math.min(rowCount - 1, rowIndex)); @@ -288,7 +290,7 @@ public class DefaultEditorEventHandler implements Editor.EventHandler { * Triggers a value change event from the editor field if it has focus. This * is based on the assumption that editor field will fire the value change * when a blur event occurs. - * + * * @param event * the editor DOM event */ @@ -312,8 +314,10 @@ public class DefaultEditorEventHandler implements Editor.EventHandler { final boolean handled; if (event.getGrid().isEditorActive()) { handled = handleCloseEvent(event) - || (!editor.isBuffered() && isBody && handleMoveEvent(event)) - || (editor.isBuffered() && isBody && handleBufferedMoveEvent(event)); + || (!editor.isBuffered() && isBody + && handleMoveEvent(event)) + || (editor.isBuffered() && isBody + && handleBufferedMoveEvent(event)); } else { handled = event.getGrid().isEnabled() && isBody && handleOpenEvent(event); diff --git a/client/src/main/java/com/vaadin/client/widget/grid/DetailsGenerator.java b/client/src/main/java/com/vaadin/client/widget/grid/DetailsGenerator.java index b9427091a7..f2b75f2576 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/DetailsGenerator.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/DetailsGenerator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -19,7 +19,7 @@ import com.google.gwt.user.client.ui.Widget; /** * A callback interface for generating details for a particular row in Grid. - * + * * @since 7.5.0 * @author Vaadin Ltd */ @@ -36,7 +36,7 @@ public interface DetailsGenerator { /** * This method is called for whenever a new details row needs to be * generated. - * + * * @param rowIndex * the index of the row for which to generate details * @return the details for the given row, or null to leave the diff --git a/client/src/main/java/com/vaadin/client/widget/grid/EditorHandler.java b/client/src/main/java/com/vaadin/client/widget/grid/EditorHandler.java index 91198700ca..5bb1035bd4 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/EditorHandler.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/EditorHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -24,10 +24,10 @@ import com.vaadin.client.widgets.Grid; * An interface for binding widgets and data to the grid row editor. Used by the * editor to support different row types, data sources and custom data binding * mechanisms. - * + * * @param * the row data type - * + * * @since 7.4 * @author Vaadin Ltd */ @@ -41,35 +41,35 @@ public interface EditorHandler { * An implementation must call either {@link #success()} or {@link #fail()}, * according to whether the operation was a success or failed during * execution, respectively. - * + * * @param * the row data type */ public interface EditorRequest { /** * Returns the index of the row being requested. - * + * * @return the row index */ public int getRowIndex(); /** * Returns the index of the column being focused. - * + * * @return the column index */ public int getColumnIndex(); /** * Returns the row data related to the row being requested. - * + * * @return the row data */ public T getRow(); /** * Returns the grid instance related to this editor request. - * + * * @return the grid instance */ public Grid getGrid(); @@ -77,7 +77,7 @@ public interface EditorHandler { /** * Returns the editor widget used to edit the values of the given * column. - * + * * @param column * the column whose widget to get * @return the widget related to the column @@ -92,7 +92,7 @@ public interface EditorHandler { /** * Informs Grid that an error occurred while trying to process the * request. - * + * * @param errorMessage * and error message to show to the user, or * null to not show any message. @@ -106,7 +106,7 @@ public interface EditorHandler { /** * Checks whether the request is completed or not. - * + * * @return true iff the request is completed */ public boolean isCompleted(); @@ -120,10 +120,10 @@ public interface EditorHandler { * {@link EditorRequest#success()} or * {@link EditorRequest#failure(String, Collection)} to signal a successful * or a failed (respectively) bind action. - * + * * @param request * the data binding request - * + * * @see Grid#editRow(int) */ public void bind(EditorRequest request); @@ -138,10 +138,10 @@ public interface EditorHandler { * {@link EditorRequest#failure(String, Collection)} have no effect on the * outcome of the cancel action. The editor is already closed when this * method is called. - * + * * @param request * the cancel request - * + * * @see Grid#cancelEditor() */ public void cancel(EditorRequest request); @@ -153,10 +153,10 @@ public interface EditorHandler { * The implementation must call either * {@link EditorRequest#success()} or {@link EditorRequest#fail()} to signal * a successful or a failed (respectively) save action. - * + * * @param request * the save request - * + * * @see Grid#saveEditor() */ public void save(EditorRequest request); @@ -164,7 +164,7 @@ public interface EditorHandler { /** * Returns a widget instance that is used to edit the values in the given * column. A null return value means the column is not editable. - * + * * @param column * the column whose values should be edited * @return the editor widget for the column or null if the column is not diff --git a/client/src/main/java/com/vaadin/client/widget/grid/EventCellReference.java b/client/src/main/java/com/vaadin/client/widget/grid/EventCellReference.java index 4d37be2cc1..60a1c676e8 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/EventCellReference.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/EventCellReference.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -28,7 +28,7 @@ import com.vaadin.shared.ui.grid.GridConstants.Section; * Since this class follows the Flyweight-pattern any instance of * this object is subject to change without the user knowing it and so should * not be stored anywhere outside of the method providing these instances. - * + * * @since 7.4 * @author Vaadin Ltd */ @@ -43,7 +43,7 @@ public class EventCellReference extends CellReference { /** * Sets the RowReference and CellReference to point to given Cell. - * + * * @param targetCell * cell to point to */ @@ -85,7 +85,7 @@ public class EventCellReference extends CellReference { /** * Is the cell reference for a cell in the header of the Grid. - * + * * @since 7.5 * @return true if referenced cell is in the header, * false if not @@ -96,7 +96,7 @@ public class EventCellReference extends CellReference { /** * Is the cell reference for a cell in the body of the Grid. - * + * * @since 7.5 * @return true if referenced cell is in the body, * false if not @@ -107,7 +107,7 @@ public class EventCellReference extends CellReference { /** * Is the cell reference for a cell in the footer of the Grid. - * + * * @since 7.5 * @return true if referenced cell is in the footer, * false if not @@ -118,7 +118,7 @@ public class EventCellReference extends CellReference { /** * Gets the Grid section where the referenced cell is. - * + * * @since 7.5 * @return grid section */ diff --git a/client/src/main/java/com/vaadin/client/widget/grid/HeightAwareDetailsGenerator.java b/client/src/main/java/com/vaadin/client/widget/grid/HeightAwareDetailsGenerator.java index 5364de3411..96a92d3fc6 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/HeightAwareDetailsGenerator.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/HeightAwareDetailsGenerator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,8 +21,8 @@ package com.vaadin.client.widget.grid; * FOR INTERNAL USE ONLY! This class exists only for the sake of a * temporary workaround and might be removed or renamed at any time. *

    - * - * @since 7.6.1 + * + * @since 7.6.1 * @author Vaadin Ltd */ @Deprecated @@ -35,7 +35,7 @@ public interface HeightAwareDetailsGenerator extends DetailsGenerator { * FOR INTERNAL USE ONLY! This method exists only for the sake of a * temporary workaround and might be removed or renamed at any time. *

    - * + * * @since 7.6.1 * @param rowIndex * the index of the row for which to calculate details row height diff --git a/client/src/main/java/com/vaadin/client/widget/grid/RendererCellReference.java b/client/src/main/java/com/vaadin/client/widget/grid/RendererCellReference.java index 994db50aa0..b7aecf1aad 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/RendererCellReference.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/RendererCellReference.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -26,7 +26,7 @@ import com.vaadin.client.widgets.Grid; * Since this class follows the Flyweight-pattern any instance of * this object is subject to change without the user knowing it and so should * not be stored anywhere outside of the method providing these instances. - * + * * @since 7.4 * @author Vaadin Ltd */ @@ -34,7 +34,7 @@ public class RendererCellReference extends CellReference { /** * Creates a new renderer cell reference bound to a row reference. - * + * * @param rowReference * the row reference to bind to */ @@ -46,7 +46,7 @@ public class RendererCellReference extends CellReference { /** * Sets the identifying information for this cell. - * + * * @param cell * the flyweight cell to reference * @param columnIndex @@ -64,7 +64,7 @@ public class RendererCellReference extends CellReference { /** * Returns the element of the cell. Can be either a TD element * or a TH element. - * + * * @return the element of the cell */ @Override @@ -74,7 +74,7 @@ public class RendererCellReference extends CellReference { /** * Sets the colspan attribute of the element of this cell. - * + * * @param numberOfCells * the number of columns that the cell should span */ @@ -84,7 +84,7 @@ public class RendererCellReference extends CellReference { /** * Gets the colspan attribute of the element of this cell. - * + * * @return the number of columns that the cell should span */ public int getColSpan() { diff --git a/client/src/main/java/com/vaadin/client/widget/grid/RowReference.java b/client/src/main/java/com/vaadin/client/widget/grid/RowReference.java index 8874fcc5cc..1bbc440aba 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/RowReference.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/RowReference.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,7 +25,7 @@ import com.vaadin.client.widgets.Grid; * Since this class follows the Flyweight-pattern any instance of * this object is subject to change without the user knowing it and so should * not be stored anywhere outside of the method providing these instances. - * + * * @author Vaadin Ltd * @param * the row object type @@ -41,7 +41,7 @@ public class RowReference { /** * Creates a new row reference for the given grid. - * + * * @param grid * the grid that the row belongs to */ @@ -51,7 +51,7 @@ public class RowReference { /** * Sets the identifying information for this row. - * + * * @param rowIndex * the index of the row * @param row @@ -67,7 +67,7 @@ public class RowReference { /** * Gets the grid that contains the referenced row. - * + * * @return the grid that contains referenced row */ public Grid getGrid() { @@ -76,7 +76,7 @@ public class RowReference { /** * Gets the row index of the row. - * + * * @return the index of the row */ public int getRowIndex() { @@ -85,7 +85,7 @@ public class RowReference { /** * Gets the row data object. - * + * * @return the row object */ public T getRow() { @@ -94,7 +94,7 @@ public class RowReference { /** * Gets the table row element of the row. - * + * * @return the element of the row */ public TableRowElement getElement() { diff --git a/client/src/main/java/com/vaadin/client/widget/grid/RowStyleGenerator.java b/client/src/main/java/com/vaadin/client/widget/grid/RowStyleGenerator.java index a12a9ff47d..7bef3c58c7 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/RowStyleGenerator.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/RowStyleGenerator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -19,7 +19,7 @@ import java.io.Serializable; /** * Callback interface for generating custom style names for data rows - * + * * @author Vaadin Ltd * @param * the row type of the target grid @@ -30,7 +30,7 @@ public interface RowStyleGenerator extends Serializable { /** * Called by Grid to generate a style name for a row. - * + * * @param rowReference * The row to generate a style for * @return the style name to add to this row, or {@code null} to not set any diff --git a/client/src/main/java/com/vaadin/client/widget/grid/datasources/ListDataSource.java b/client/src/main/java/com/vaadin/client/widget/grid/datasources/ListDataSource.java index cf7ec53e68..cff544ac94 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/datasources/ListDataSource.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/datasources/ListDataSource.java @@ -34,23 +34,23 @@ import com.vaadin.shared.util.SharedUtil; * A simple list based on an in-memory data source for simply adding a list of * row pojos to the grid. Based on a wrapped list instance which supports adding * and removing of items. - * + * *

    * Usage: - * + * *

      * ListDataSource<Integer> ds = new ListDataSource<Integer>(1, 2, 3, 4);
    - * 
    + *
      * // Add item to the data source
      * ds.asList().add(5);
    - * 
    + *
      * // Remove item from the data source
      * ds.asList().remove(3);
    - * 
    + *
      * // Add multiple items
      * ds.asList().addAll(Arrays.asList(5, 6, 7));
      * 
    - * + * * @since 7.4 * @author Vaadin Ltd */ @@ -355,8 +355,8 @@ public class ListDataSource implements DataSource { * data source after the data source has been constructed. To add or remove * items to the data source after it has been constructed use * {@link ListDataSource#asList()}. - * - * + * + * * @param datasource * The list to use for providing the data to the grid */ @@ -372,7 +372,7 @@ public class ListDataSource implements DataSource { * Constructs a data source with a set of rows. You can dynamically add and * remove rows from the data source via the list you get from * {@link ListDataSource#asList()} - * + * * @param rows * The rows to initially add to the data source */ @@ -418,7 +418,7 @@ public class ListDataSource implements DataSource { *

    * Note: The list is not the same list as passed into the data source via * the constructor. - * + * * @return Returns a list implementation that wraps the real list that backs * the data source and provides events for the data source * listeners. @@ -436,7 +436,7 @@ public class ListDataSource implements DataSource { /** * Sort entire container according to a {@link Comparator}. - * + * * @param comparator * a comparator object, which compares two data source entries * (beans/pojos) @@ -453,7 +453,7 @@ public class ListDataSource implements DataSource { *

    * Note: This method does not verify that the given row object * exists at all in this DataSource. - * + * * @param row * the row object * @return index of the row; or -1 if row is not available @@ -464,7 +464,7 @@ public class ListDataSource implements DataSource { /** * Returns a {@link SelectAllHandler} for this ListDataSource. - * + * * @return select all handler */ public SelectAllHandler getSelectAllHandler() { diff --git a/client/src/main/java/com/vaadin/client/widget/grid/datasources/ListSorter.java b/client/src/main/java/com/vaadin/client/widget/grid/datasources/ListSorter.java index 69bea629b0..b0ae3ace89 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/datasources/ListSorter.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/datasources/ListSorter.java @@ -31,7 +31,7 @@ import com.vaadin.shared.data.sort.SortDirection; /** * Provides sorting facility from Grid for the {@link ListDataSource} in-memory * data source. - * + * * @author Vaadin Ltd * @param * Grid row data type @@ -75,7 +75,7 @@ public class ListSorter { * which includes all standard data classes like String, Number derivatives * and Dates). Any existing comparator can be removed by passing in a * non-null GridColumn and a null Comparator. - * + * * @param column * a grid column. May not be null. * @param comparator @@ -97,7 +97,7 @@ public class ListSorter { /** * Retrieve the comparator assigned for a specific grid column. - * + * * @param column * a grid column. May not be null. * @return a comparator, or null if no comparator for the specified grid @@ -122,15 +122,15 @@ public class ListSorter { /** * Apply sorting to the current ListDataSource. - * + * * @param order * the sort order list provided by the grid sort event */ private void sort(final List order) { DataSource ds = grid.getDataSource(); if (!(ds instanceof ListDataSource)) { - throw new IllegalStateException("Grid " + grid - + " data source is not a ListDataSource!"); + throw new IllegalStateException( + "Grid " + grid + " data source is not a ListDataSource!"); } ((ListDataSource) ds).sort(new Comparator() { @@ -158,15 +158,16 @@ public class ListSorter { } if (result != 0) { - return o.getDirection() == SortDirection.ASCENDING ? result - : -result; + return o.getDirection() == SortDirection.ASCENDING + ? result : -result; } } if (order.size() > 0) { - return order.get(0).getDirection() == SortDirection.ASCENDING ? a - .hashCode() - b.hashCode() - : b.hashCode() - a.hashCode(); + return order.get(0) + .getDirection() == SortDirection.ASCENDING + ? a.hashCode() - b.hashCode() + : b.hashCode() - a.hashCode(); } return a.hashCode() - b.hashCode(); } diff --git a/client/src/main/java/com/vaadin/client/widget/grid/events/AbstractGridKeyEventHandler.java b/client/src/main/java/com/vaadin/client/widget/grid/events/AbstractGridKeyEventHandler.java index 120c32d380..a0e1b3fa9b 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/events/AbstractGridKeyEventHandler.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/events/AbstractGridKeyEventHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,24 +20,24 @@ import com.vaadin.client.widgets.Grid.AbstractGridKeyEvent; /** * Base interface of all handlers for {@link AbstractGridKeyEvent}s. - * + * * @since 7.4 * @author Vaadin Ltd */ public abstract interface AbstractGridKeyEventHandler extends EventHandler { - public abstract interface GridKeyDownHandler extends - AbstractGridKeyEventHandler { + public abstract interface GridKeyDownHandler + extends AbstractGridKeyEventHandler { public void onKeyDown(GridKeyDownEvent event); } - public abstract interface GridKeyUpHandler extends - AbstractGridKeyEventHandler { + public abstract interface GridKeyUpHandler + extends AbstractGridKeyEventHandler { public void onKeyUp(GridKeyUpEvent event); } - public abstract interface GridKeyPressHandler extends - AbstractGridKeyEventHandler { + public abstract interface GridKeyPressHandler + extends AbstractGridKeyEventHandler { public void onKeyPress(GridKeyPressEvent event); } diff --git a/client/src/main/java/com/vaadin/client/widget/grid/events/AbstractGridMouseEventHandler.java b/client/src/main/java/com/vaadin/client/widget/grid/events/AbstractGridMouseEventHandler.java index 15e22a6d57..d3ed32978c 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/events/AbstractGridMouseEventHandler.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/events/AbstractGridMouseEventHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,19 +20,19 @@ import com.vaadin.client.widgets.Grid.AbstractGridMouseEvent; /** * Base interface of all handlers for {@link AbstractGridMouseEvent}s. - * + * * @since 7.4 * @author Vaadin Ltd */ public abstract interface AbstractGridMouseEventHandler extends EventHandler { - public abstract interface GridClickHandler extends - AbstractGridMouseEventHandler { + public abstract interface GridClickHandler + extends AbstractGridMouseEventHandler { public void onClick(GridClickEvent event); } - public abstract interface GridDoubleClickHandler extends - AbstractGridMouseEventHandler { + public abstract interface GridDoubleClickHandler + extends AbstractGridMouseEventHandler { public void onDoubleClick(GridDoubleClickEvent event); } diff --git a/client/src/main/java/com/vaadin/client/widget/grid/events/BodyClickHandler.java b/client/src/main/java/com/vaadin/client/widget/grid/events/BodyClickHandler.java index a66e170524..c14a9650a0 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/events/BodyClickHandler.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/events/BodyClickHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -19,7 +19,7 @@ import com.vaadin.client.widget.grid.events.AbstractGridMouseEventHandler.GridCl /** * Handler for {@link GridClickEvent}s that happen in the body of the Grid. - * + * * @since 7.4 * @author Vaadin Ltd */ diff --git a/client/src/main/java/com/vaadin/client/widget/grid/events/BodyDoubleClickHandler.java b/client/src/main/java/com/vaadin/client/widget/grid/events/BodyDoubleClickHandler.java index 7be29920e7..0eeb124e29 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/events/BodyDoubleClickHandler.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/events/BodyDoubleClickHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,7 +20,7 @@ import com.vaadin.client.widget.grid.events.AbstractGridMouseEventHandler.GridDo /** * Handler for {@link GridDoubleClickEvent}s that happen in the body of the * Grid. - * + * * @since 7.4 * @author Vaadin Ltd */ diff --git a/client/src/main/java/com/vaadin/client/widget/grid/events/BodyKeyDownHandler.java b/client/src/main/java/com/vaadin/client/widget/grid/events/BodyKeyDownHandler.java index ff1ae82d2e..2fdde86c6b 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/events/BodyKeyDownHandler.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/events/BodyKeyDownHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,7 +20,7 @@ import com.vaadin.client.widget.grid.events.AbstractGridKeyEventHandler.GridKeyD /** * Handler for {@link GridKeyDownEvent}s that happen when the focused cell is in * the body of the Grid. - * + * * @since 7.4 * @author Vaadin Ltd */ diff --git a/client/src/main/java/com/vaadin/client/widget/grid/events/BodyKeyPressHandler.java b/client/src/main/java/com/vaadin/client/widget/grid/events/BodyKeyPressHandler.java index 245250d4c0..b134566de1 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/events/BodyKeyPressHandler.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/events/BodyKeyPressHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,7 +20,7 @@ import com.vaadin.client.widget.grid.events.AbstractGridKeyEventHandler.GridKeyP /** * Handler for {@link GridKeyPressEvent}s that happen when the focused cell is * in the body of the Grid. - * + * * @since 7.4 * @author Vaadin Ltd */ diff --git a/client/src/main/java/com/vaadin/client/widget/grid/events/BodyKeyUpHandler.java b/client/src/main/java/com/vaadin/client/widget/grid/events/BodyKeyUpHandler.java index 2c0951ea40..2aac69a424 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/events/BodyKeyUpHandler.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/events/BodyKeyUpHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,7 +20,7 @@ import com.vaadin.client.widget.grid.events.AbstractGridKeyEventHandler.GridKeyU /** * Handler for {@link GridKeyUpEvent}s that happen when the focused cell is in * the body of the Grid. - * + * * @since 7.4 * @author Vaadin Ltd */ diff --git a/client/src/main/java/com/vaadin/client/widget/grid/events/ColumnReorderEvent.java b/client/src/main/java/com/vaadin/client/widget/grid/events/ColumnReorderEvent.java index 1712871089..54193e7a1b 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/events/ColumnReorderEvent.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/events/ColumnReorderEvent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -19,7 +19,7 @@ import com.google.gwt.event.shared.GwtEvent; /** * An event for notifying that the columns in the Grid have been reordered. - * + * * @param * The row type of the grid. The row type is the POJO type from where * the data is retrieved into the column cells. diff --git a/client/src/main/java/com/vaadin/client/widget/grid/events/ColumnReorderHandler.java b/client/src/main/java/com/vaadin/client/widget/grid/events/ColumnReorderHandler.java index 29c476058e..f46fe41afc 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/events/ColumnReorderHandler.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/events/ColumnReorderHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,7 +20,7 @@ import com.google.gwt.event.shared.EventHandler; /** * Handler for a Grid column reorder event, called when the Grid's columns has * been reordered. - * + * * @param * The row type of the grid. The row type is the POJO type from where * the data is retrieved into the column cells. @@ -32,7 +32,7 @@ public interface ColumnReorderHandler extends EventHandler { /** * A column reorder event, fired by Grid when the columns of the Grid have * been reordered. - * + * * @param event * column reorder event */ diff --git a/client/src/main/java/com/vaadin/client/widget/grid/events/ColumnResizeEvent.java b/client/src/main/java/com/vaadin/client/widget/grid/events/ColumnResizeEvent.java index f5c8c0fa83..7c449ab763 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/events/ColumnResizeEvent.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/events/ColumnResizeEvent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,7 +20,7 @@ import com.vaadin.client.widgets.Grid.Column; /** * An event for notifying that the columns in the Grid have been resized. - * + * * @param * The row type of the grid. The row type is the POJO type from where * the data is retrieved into the column cells. diff --git a/client/src/main/java/com/vaadin/client/widget/grid/events/ColumnResizeHandler.java b/client/src/main/java/com/vaadin/client/widget/grid/events/ColumnResizeHandler.java index a66dbf7bd2..c0dca31263 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/events/ColumnResizeHandler.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/events/ColumnResizeHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,7 +20,7 @@ import com.google.gwt.event.shared.EventHandler; /** * Handler for a Grid column resize event, called when the Grid's columns has * been resized. - * + * * @param * The row type of the grid. The row type is the POJO type from where * the data is retrieved into the column cells. @@ -32,7 +32,7 @@ public interface ColumnResizeHandler extends EventHandler { /** * A column resize event, fired by Grid when the columns of the Grid have * been resized. - * + * * @param event * column resize event */ diff --git a/client/src/main/java/com/vaadin/client/widget/grid/events/ColumnVisibilityChangeEvent.java b/client/src/main/java/com/vaadin/client/widget/grid/events/ColumnVisibilityChangeEvent.java index 63b788bcf2..2a94d4ec4e 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/events/ColumnVisibilityChangeEvent.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/events/ColumnVisibilityChangeEvent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,15 +21,15 @@ import com.vaadin.client.widgets.Grid.Column; /** * An event for notifying that the columns in the Grid's have changed * visibility. - * + * * @param * The row type of the grid. The row type is the POJO type from where * the data is retrieved into the column cells. * @since 7.5.0 * @author Vaadin Ltd */ -public class ColumnVisibilityChangeEvent extends - GwtEvent> { +public class ColumnVisibilityChangeEvent + extends GwtEvent> { private final static Type> TYPE = new Type>(); @@ -52,7 +52,7 @@ public class ColumnVisibilityChangeEvent extends /** * Returns the column where the visibility change occurred. - * + * * @return the column where the visibility change occurred. */ public Column getColumn() { @@ -61,7 +61,7 @@ public class ColumnVisibilityChangeEvent extends /** * Was the column set hidden or visible. - * + * * @return true if the column was hidden false if * it was set visible */ @@ -71,7 +71,7 @@ public class ColumnVisibilityChangeEvent extends /** * Is the visibility change triggered by user. - * + * * @return true if the change was triggered by user, * false if not */ diff --git a/client/src/main/java/com/vaadin/client/widget/grid/events/ColumnVisibilityChangeHandler.java b/client/src/main/java/com/vaadin/client/widget/grid/events/ColumnVisibilityChangeHandler.java index 542fe4e3c1..1cdffe59e8 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/events/ColumnVisibilityChangeHandler.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/events/ColumnVisibilityChangeHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,9 +20,11 @@ import com.google.gwt.event.shared.EventHandler; /** * Handler for a Grid column visibility change event, called when the Grid's * columns have changed visibility to hidden or visible. - * - * @param The row type of the grid. The row type is the POJO type from where - * the data is retrieved into the column cells. + * + * @param The + * row type of the grid. The row type is the POJO type from where + * the data is retrieved into the column cells. + * * @since 7.5.0 * @author Vaadin Ltd */ @@ -31,7 +33,7 @@ public interface ColumnVisibilityChangeHandler extends EventHandler { /** * A column visibility change event, fired by Grid when a column in the Grid * has changed visibility. - * + * * @param event * column visibility change event */ diff --git a/client/src/main/java/com/vaadin/client/widget/grid/events/FooterClickHandler.java b/client/src/main/java/com/vaadin/client/widget/grid/events/FooterClickHandler.java index 51fa38c948..55d8329077 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/events/FooterClickHandler.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/events/FooterClickHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -19,7 +19,7 @@ import com.vaadin.client.widget.grid.events.AbstractGridMouseEventHandler.GridCl /** * Handler for {@link GridClickEvent}s that happen in the footer of the Grid. - * + * * @since 7.4 * @author Vaadin Ltd */ diff --git a/client/src/main/java/com/vaadin/client/widget/grid/events/FooterDoubleClickHandler.java b/client/src/main/java/com/vaadin/client/widget/grid/events/FooterDoubleClickHandler.java index 2f5ba21787..7c91eef7f7 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/events/FooterDoubleClickHandler.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/events/FooterDoubleClickHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,7 +20,7 @@ import com.vaadin.client.widget.grid.events.AbstractGridMouseEventHandler.GridDo /** * Handler for {@link GridDoubleClickEvent}s that happen in the footer of the * Grid. - * + * * @since 7.4 * @author Vaadin Ltd */ diff --git a/client/src/main/java/com/vaadin/client/widget/grid/events/FooterKeyDownHandler.java b/client/src/main/java/com/vaadin/client/widget/grid/events/FooterKeyDownHandler.java index 85f83970f2..43cf6d9a69 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/events/FooterKeyDownHandler.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/events/FooterKeyDownHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,7 +20,7 @@ import com.vaadin.client.widget.grid.events.AbstractGridKeyEventHandler.GridKeyD /** * Handler for {@link GridKeyDownEvent}s that happen when the focused cell is in * the footer of the Grid. - * + * * @since 7.4 * @author Vaadin Ltd */ diff --git a/client/src/main/java/com/vaadin/client/widget/grid/events/FooterKeyPressHandler.java b/client/src/main/java/com/vaadin/client/widget/grid/events/FooterKeyPressHandler.java index 09778f6873..be0da9cb69 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/events/FooterKeyPressHandler.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/events/FooterKeyPressHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,7 +20,7 @@ import com.vaadin.client.widget.grid.events.AbstractGridKeyEventHandler.GridKeyP /** * Handler for {@link GridKeyPressEvent}s that happen when the focused cell is * in the footer of the Grid. - * + * * @since 7.4 * @author Vaadin Ltd */ diff --git a/client/src/main/java/com/vaadin/client/widget/grid/events/FooterKeyUpHandler.java b/client/src/main/java/com/vaadin/client/widget/grid/events/FooterKeyUpHandler.java index 688f89880f..9068d6c888 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/events/FooterKeyUpHandler.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/events/FooterKeyUpHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,7 +20,7 @@ import com.vaadin.client.widget.grid.events.AbstractGridKeyEventHandler.GridKeyU /** * Handler for {@link GridKeyUpEvent}s that happen when the focused cell is in * the footer of the Grid. - * + * * @since 7.4 * @author Vaadin Ltd */ diff --git a/client/src/main/java/com/vaadin/client/widget/grid/events/GridClickEvent.java b/client/src/main/java/com/vaadin/client/widget/grid/events/GridClickEvent.java index 33a4c923b7..08d08f3011 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/events/GridClickEvent.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/events/GridClickEvent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -24,7 +24,7 @@ import com.vaadin.shared.ui.grid.GridConstants.Section; /** * Represents native mouse click event in Grid. - * + * * @since 7.4 * @author Vaadin Ltd */ @@ -42,8 +42,10 @@ public class GridClickEvent extends AbstractGridMouseEvent { @Override protected void doDispatch(GridClickHandler handler, Section section) { if ((section == Section.BODY && handler instanceof BodyClickHandler) - || (section == Section.HEADER && handler instanceof HeaderClickHandler) - || (section == Section.FOOTER && handler instanceof FooterClickHandler)) { + || (section == Section.HEADER + && handler instanceof HeaderClickHandler) + || (section == Section.FOOTER + && handler instanceof FooterClickHandler)) { handler.onClick(this); } } diff --git a/client/src/main/java/com/vaadin/client/widget/grid/events/GridDoubleClickEvent.java b/client/src/main/java/com/vaadin/client/widget/grid/events/GridDoubleClickEvent.java index 64a1a88b42..55fe118426 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/events/GridDoubleClickEvent.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/events/GridDoubleClickEvent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -24,12 +24,12 @@ import com.vaadin.shared.ui.grid.GridConstants.Section; /** * Represents native mouse double click event in Grid. - * + * * @since 7.4 * @author Vaadin Ltd */ -public class GridDoubleClickEvent extends - AbstractGridMouseEvent { +public class GridDoubleClickEvent + extends AbstractGridMouseEvent { public GridDoubleClickEvent(Grid grid, CellReference targetCell) { super(grid, targetCell); @@ -42,9 +42,12 @@ public class GridDoubleClickEvent extends @Override protected void doDispatch(GridDoubleClickHandler handler, Section section) { - if ((section == Section.BODY && handler instanceof BodyDoubleClickHandler) - || (section == Section.HEADER && handler instanceof HeaderDoubleClickHandler) - || (section == Section.FOOTER && handler instanceof FooterDoubleClickHandler)) { + if ((section == Section.BODY + && handler instanceof BodyDoubleClickHandler) + || (section == Section.HEADER + && handler instanceof HeaderDoubleClickHandler) + || (section == Section.FOOTER + && handler instanceof FooterDoubleClickHandler)) { handler.onDoubleClick(this); } } diff --git a/client/src/main/java/com/vaadin/client/widget/grid/events/GridKeyDownEvent.java b/client/src/main/java/com/vaadin/client/widget/grid/events/GridKeyDownEvent.java index 9849137982..2b5b3dbeef 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/events/GridKeyDownEvent.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/events/GridKeyDownEvent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,7 +25,7 @@ import com.vaadin.shared.ui.grid.GridConstants.Section; /** * Represents native key down event in Grid. - * + * * @since 7.4 * @author Vaadin Ltd */ @@ -38,8 +38,10 @@ public class GridKeyDownEvent extends AbstractGridKeyEvent { @Override protected void doDispatch(GridKeyDownHandler handler, Section section) { if ((section == Section.BODY && handler instanceof BodyKeyDownHandler) - || (section == Section.HEADER && handler instanceof HeaderKeyDownHandler) - || (section == Section.FOOTER && handler instanceof FooterKeyDownHandler)) { + || (section == Section.HEADER + && handler instanceof HeaderKeyDownHandler) + || (section == Section.FOOTER + && handler instanceof FooterKeyDownHandler)) { handler.onKeyDown(this); } } @@ -51,7 +53,7 @@ public class GridKeyDownEvent extends AbstractGridKeyEvent { /** * Does the key code represent an arrow key? - * + * * @param keyCode * the key code * @return if it is an arrow key code @@ -71,7 +73,7 @@ public class GridKeyDownEvent extends AbstractGridKeyEvent { /** * Gets the native key code. These key codes are enumerated in the * {@link KeyCodes} class. - * + * * @return the key code */ public int getNativeKeyCode() { @@ -80,7 +82,7 @@ public class GridKeyDownEvent extends AbstractGridKeyEvent { /** * Is this a key down arrow? - * + * * @return whether this is a down arrow key event */ public boolean isDownArrow() { @@ -89,7 +91,7 @@ public class GridKeyDownEvent extends AbstractGridKeyEvent { /** * Is this a left arrow? - * + * * @return whether this is a left arrow key event */ public boolean isLeftArrow() { @@ -98,7 +100,7 @@ public class GridKeyDownEvent extends AbstractGridKeyEvent { /** * Is this a right arrow? - * + * * @return whether this is a right arrow key event */ public boolean isRightArrow() { @@ -107,7 +109,7 @@ public class GridKeyDownEvent extends AbstractGridKeyEvent { /** * Is this a up arrow? - * + * * @return whether this is a right arrow key event */ public boolean isUpArrow() { diff --git a/client/src/main/java/com/vaadin/client/widget/grid/events/GridKeyPressEvent.java b/client/src/main/java/com/vaadin/client/widget/grid/events/GridKeyPressEvent.java index 35a3af0c2e..0b6abce26b 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/events/GridKeyPressEvent.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/events/GridKeyPressEvent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -24,12 +24,12 @@ import com.vaadin.shared.ui.grid.GridConstants.Section; /** * Represents native key press event in Grid. - * + * * @since 7.4 * @author Vaadin Ltd */ -public class GridKeyPressEvent extends - AbstractGridKeyEvent { +public class GridKeyPressEvent + extends AbstractGridKeyEvent { public GridKeyPressEvent(Grid grid, CellReference targetCell) { super(grid, targetCell); @@ -38,8 +38,10 @@ public class GridKeyPressEvent extends @Override protected void doDispatch(GridKeyPressHandler handler, Section section) { if ((section == Section.BODY && handler instanceof BodyKeyPressHandler) - || (section == Section.HEADER && handler instanceof HeaderKeyPressHandler) - || (section == Section.FOOTER && handler instanceof FooterKeyPressHandler)) { + || (section == Section.HEADER + && handler instanceof HeaderKeyPressHandler) + || (section == Section.FOOTER + && handler instanceof FooterKeyPressHandler)) { handler.onKeyPress(this); } } @@ -51,7 +53,7 @@ public class GridKeyPressEvent extends /** * Gets the char code for this event. - * + * * @return the char code */ public char getCharCode() { @@ -60,7 +62,7 @@ public class GridKeyPressEvent extends /** * Gets the Unicode char code (code point) for this event. - * + * * @return the Unicode char code */ public int getUnicodeCharCode() { diff --git a/client/src/main/java/com/vaadin/client/widget/grid/events/GridKeyUpEvent.java b/client/src/main/java/com/vaadin/client/widget/grid/events/GridKeyUpEvent.java index d273835233..8cf61f9032 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/events/GridKeyUpEvent.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/events/GridKeyUpEvent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,7 +25,7 @@ import com.vaadin.shared.ui.grid.GridConstants.Section; /** * Represents native key up event in Grid. - * + * * @since 7.4 * @author Vaadin Ltd */ @@ -38,8 +38,10 @@ public class GridKeyUpEvent extends AbstractGridKeyEvent { @Override protected void doDispatch(GridKeyUpHandler handler, Section section) { if ((section == Section.BODY && handler instanceof BodyKeyUpHandler) - || (section == Section.HEADER && handler instanceof HeaderKeyUpHandler) - || (section == Section.FOOTER && handler instanceof FooterKeyUpHandler)) { + || (section == Section.HEADER + && handler instanceof HeaderKeyUpHandler) + || (section == Section.FOOTER + && handler instanceof FooterKeyUpHandler)) { handler.onKeyUp(this); } } @@ -51,7 +53,7 @@ public class GridKeyUpEvent extends AbstractGridKeyEvent { /** * Does the key code represent an arrow key? - * + * * @param keyCode * the key code * @return if it is an arrow key code @@ -71,7 +73,7 @@ public class GridKeyUpEvent extends AbstractGridKeyEvent { /** * Gets the native key code. These key codes are enumerated in the * {@link KeyCodes} class. - * + * * @return the key code */ public int getNativeKeyCode() { @@ -80,7 +82,7 @@ public class GridKeyUpEvent extends AbstractGridKeyEvent { /** * Is this a key down arrow? - * + * * @return whether this is a down arrow key event */ public boolean isDownArrow() { @@ -89,7 +91,7 @@ public class GridKeyUpEvent extends AbstractGridKeyEvent { /** * Is this a left arrow? - * + * * @return whether this is a left arrow key event */ public boolean isLeftArrow() { @@ -98,7 +100,7 @@ public class GridKeyUpEvent extends AbstractGridKeyEvent { /** * Is this a right arrow? - * + * * @return whether this is a right arrow key event */ public boolean isRightArrow() { @@ -107,7 +109,7 @@ public class GridKeyUpEvent extends AbstractGridKeyEvent { /** * Is this a up arrow? - * + * * @return whether this is a right arrow key event */ public boolean isUpArrow() { diff --git a/client/src/main/java/com/vaadin/client/widget/grid/events/HeaderClickHandler.java b/client/src/main/java/com/vaadin/client/widget/grid/events/HeaderClickHandler.java index da20e80905..6913863b19 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/events/HeaderClickHandler.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/events/HeaderClickHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -19,7 +19,7 @@ import com.vaadin.client.widget.grid.events.AbstractGridMouseEventHandler.GridCl /** * Handler for {@link GridClickEvent}s that happen in the header of the Grid. - * + * * @since 7.4 * @author Vaadin Ltd */ diff --git a/client/src/main/java/com/vaadin/client/widget/grid/events/HeaderDoubleClickHandler.java b/client/src/main/java/com/vaadin/client/widget/grid/events/HeaderDoubleClickHandler.java index 16a4cfe1f5..01a0ac300a 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/events/HeaderDoubleClickHandler.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/events/HeaderDoubleClickHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,7 +20,7 @@ import com.vaadin.client.widget.grid.events.AbstractGridMouseEventHandler.GridDo /** * Handler for {@link GridDoubleClickEvent}s that happen in the header of the * Grid. - * + * * @since 7.4 * @author Vaadin Ltd */ diff --git a/client/src/main/java/com/vaadin/client/widget/grid/events/HeaderKeyDownHandler.java b/client/src/main/java/com/vaadin/client/widget/grid/events/HeaderKeyDownHandler.java index 555eb936af..5e4e3d7893 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/events/HeaderKeyDownHandler.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/events/HeaderKeyDownHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,7 +20,7 @@ import com.vaadin.client.widget.grid.events.AbstractGridKeyEventHandler.GridKeyD /** * Handler for {@link GridKeyDownEvent}s that happen when the focused cell is in * the header of the Grid. - * + * * @since 7.4 * @author Vaadin Ltd */ diff --git a/client/src/main/java/com/vaadin/client/widget/grid/events/HeaderKeyPressHandler.java b/client/src/main/java/com/vaadin/client/widget/grid/events/HeaderKeyPressHandler.java index c4dd312f93..4bf9a64ba7 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/events/HeaderKeyPressHandler.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/events/HeaderKeyPressHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,7 +20,7 @@ import com.vaadin.client.widget.grid.events.AbstractGridKeyEventHandler.GridKeyP /** * Handler for {@link GridKeyPressEvent}s that happen when the focused cell is * in the header of the Grid. - * + * * @since 7.4 * @author Vaadin Ltd */ diff --git a/client/src/main/java/com/vaadin/client/widget/grid/events/HeaderKeyUpHandler.java b/client/src/main/java/com/vaadin/client/widget/grid/events/HeaderKeyUpHandler.java index 4dbe1c681e..365e5883f4 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/events/HeaderKeyUpHandler.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/events/HeaderKeyUpHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,7 +20,7 @@ import com.vaadin.client.widget.grid.events.AbstractGridKeyEventHandler.GridKeyU /** * Handler for {@link GridKeyUpEvent}s that happen when the focused cell is in * the header of the Grid. - * + * * @since 7.4 * @author Vaadin Ltd */ diff --git a/client/src/main/java/com/vaadin/client/widget/grid/events/ScrollEvent.java b/client/src/main/java/com/vaadin/client/widget/grid/events/ScrollEvent.java index 08e1e07eab..ed3fe3451d 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/events/ScrollEvent.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/events/ScrollEvent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -19,7 +19,7 @@ import com.google.gwt.event.shared.GwtEvent; /** * An event that signifies that a scrollbar bundle has been scrolled - * + * * @author Vaadin Ltd * @since 7.4 */ diff --git a/client/src/main/java/com/vaadin/client/widget/grid/events/ScrollHandler.java b/client/src/main/java/com/vaadin/client/widget/grid/events/ScrollHandler.java index 1ce901e707..5a106c614d 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/events/ScrollHandler.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/events/ScrollHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -19,7 +19,7 @@ import com.google.gwt.event.shared.EventHandler; /** * A handler that gets called whenever a scrollbar bundle is scrolled - * + * * @author Vaadin Ltd * @since 7.4 */ @@ -27,7 +27,7 @@ public interface ScrollHandler extends EventHandler { /** * A callback method that is called once a scrollbar bundle has been * scrolled. - * + * * @param event * the scroll event */ diff --git a/client/src/main/java/com/vaadin/client/widget/grid/events/SelectAllEvent.java b/client/src/main/java/com/vaadin/client/widget/grid/events/SelectAllEvent.java index 43c2055e95..fc317979f9 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/events/SelectAllEvent.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/events/SelectAllEvent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,7 +21,7 @@ import com.vaadin.client.widget.grid.selection.SelectionModel; /** * A select all event, fired by the Grid when it needs all rows in data source * to be selected. - * + * * @since 7.4 * @author Vaadin Ltd */ diff --git a/client/src/main/java/com/vaadin/client/widget/grid/events/SelectAllHandler.java b/client/src/main/java/com/vaadin/client/widget/grid/events/SelectAllHandler.java index 2cdee8d1b3..12622f482c 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/events/SelectAllHandler.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/events/SelectAllHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,7 +20,7 @@ import com.google.gwt.event.shared.EventHandler; /** * Handler for a Grid select all event, called when the Grid needs all rows in * data source to be selected. - * + * * @since 7.4 * @author Vaadin Ltd */ @@ -28,7 +28,7 @@ public interface SelectAllHandler extends EventHandler { /** * Called when select all value in SelectionColumn header changes value. - * + * * @param event * select all event telling that all rows should be selected */ diff --git a/client/src/main/java/com/vaadin/client/widget/grid/selection/AbstractRowHandleSelectionModel.java b/client/src/main/java/com/vaadin/client/widget/grid/selection/AbstractRowHandleSelectionModel.java index 6b7bbb6294..b47ba49baf 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/selection/AbstractRowHandleSelectionModel.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/selection/AbstractRowHandleSelectionModel.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -23,20 +23,20 @@ import com.vaadin.client.data.DataSource.RowHandle; *

    * Note: This should be an interface instead of an abstract class, if * only we could define protected methods in an interface. - * + * * @author Vaadin Ltd * @param * The grid's row type * @since 7.4 */ -public abstract class AbstractRowHandleSelectionModel implements - SelectionModel { +public abstract class AbstractRowHandleSelectionModel + implements SelectionModel { /** * Select a row, based on its * {@link com.vaadin.client.data.DataSource.RowHandle RowHandle}. *

    * Note: this method may not fire selection change events. - * + * * @param handle * the handle to select by * @return true iff the selection state was changed by this @@ -52,7 +52,7 @@ public abstract class AbstractRowHandleSelectionModel implements * {@link com.vaadin.client.data.DataSource.RowHandle RowHandle}. *

    * Note: this method may not fire selection change events. - * + * * @param handle * the handle to deselect by * @return true iff the selection state was changed by this diff --git a/client/src/main/java/com/vaadin/client/widget/grid/selection/ClickSelectHandler.java b/client/src/main/java/com/vaadin/client/widget/grid/selection/ClickSelectHandler.java index c6bc52dd1c..e7be08f141 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/selection/ClickSelectHandler.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/selection/ClickSelectHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -22,7 +22,7 @@ import com.vaadin.client.widgets.Grid; /** * Generic class to perform selections when clicking on cells in body of Grid. - * + * * @since 7.4 * @author Vaadin Ltd */ @@ -48,7 +48,7 @@ public class ClickSelectHandler { /** * Constructor for ClickSelectHandler. This constructor will add all * necessary handlers for selecting rows by clicking cells. - * + * * @param grid * grid to attach to */ @@ -66,7 +66,7 @@ public class ClickSelectHandler { /** * Sets whether clicking the currently selected row should deselect the row. - * + * * @param deselectAllowed * true to allow deselecting the selected row; * otherwise false diff --git a/client/src/main/java/com/vaadin/client/widget/grid/selection/HasSelectionHandlers.java b/client/src/main/java/com/vaadin/client/widget/grid/selection/HasSelectionHandlers.java index ffcad4c903..6690f32b4e 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/selection/HasSelectionHandlers.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/selection/HasSelectionHandlers.java @@ -19,7 +19,7 @@ import com.google.gwt.event.shared.HandlerRegistration; /** * Marker interface for widgets that fires selection events. - * + * * @author Vaadin Ltd * @since 7.4 */ @@ -31,7 +31,7 @@ public interface HasSelectionHandlers { * This handler is called whenever a * {@link com.vaadin.ui.components.grid.selection.SelectionModel * SelectionModel} detects a change in selection state. - * + * * @param handler * a {@link SelectionHandler} * @return a handler registration object, which can be used to remove the diff --git a/client/src/main/java/com/vaadin/client/widget/grid/selection/MultiSelectionRenderer.java b/client/src/main/java/com/vaadin/client/widget/grid/selection/MultiSelectionRenderer.java index f244682b49..27e6108fa6 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/selection/MultiSelectionRenderer.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/selection/MultiSelectionRenderer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -49,14 +49,14 @@ import com.vaadin.client.widgets.Grid; /** * Renderer showing multi selection check boxes. - * + * * @author Vaadin Ltd * @param * the type of the associated grid * @since 7.4 */ -public class MultiSelectionRenderer extends - ClickableRenderer { +public class MultiSelectionRenderer + extends ClickableRenderer { private static final String SELECTION_CHECKBOX_CLASSNAME = "-selection-checkbox"; @@ -74,7 +74,7 @@ public class MultiSelectionRenderer extends /** * Handler for MouseDown and TouchStart events for selection checkboxes. - * + * * @since 7.5 */ private final class CheckBoxEventHandler implements MouseDownHandler, @@ -91,16 +91,17 @@ public class MultiSelectionRenderer extends @Override public void onMouseDown(MouseDownEvent event) { - if(checkBox.isEnabled()) { + if (checkBox.isEnabled()) { if (event.getNativeButton() == NativeEvent.BUTTON_LEFT) { - startDragSelect(event.getNativeEvent(), checkBox.getElement()); + startDragSelect(event.getNativeEvent(), + checkBox.getElement()); } } } @Override public void onTouchStart(TouchStartEvent event) { - if(checkBox.isEnabled()) { + if (checkBox.isEnabled()) { startDragSelect(event.getNativeEvent(), checkBox.getElement()); } } @@ -132,7 +133,7 @@ public class MultiSelectionRenderer extends * Something has dropped a touchend/touchcancel and the * scroller is most probably running amok. Let's cancel it * and pretend that everything's going as expected - * + * * Because this is a preview, this code is run before the * event handler in MultiSelectionRenderer.onBrowserEvent. * Therefore, we can simply kill everything and let that @@ -159,8 +160,8 @@ public class MultiSelectionRenderer extends * Remember: targetElement is always where touchstart started, * not where the finger is pointing currently. */ - final Element targetElement = Element.as(event.getNativeEvent() - .getEventTarget()); + final Element targetElement = Element + .as(event.getNativeEvent().getEventTarget()); if (isInFirstColumn(targetElement)) { removeNativeHandler(); event.cancel(); @@ -222,7 +223,8 @@ public class MultiSelectionRenderer extends * direction has started. */ private static final int SCROLL_AREA_REBOUND_PX_PER_SEC = 1; - private static final double SCROLL_AREA_REBOUND_PX_PER_MS = SCROLL_AREA_REBOUND_PX_PER_SEC / 1000.0d; + private static final double SCROLL_AREA_REBOUND_PX_PER_MS = SCROLL_AREA_REBOUND_PX_PER_SEC + / 1000.0d; /** * The lowest y-coordinate on the {@link Event#getClientY() client} from @@ -317,8 +319,8 @@ public class MultiSelectionRenderer extends int constrainedPageY = Math.max(bodyAbsoluteTop, Math.min(bodyAbsoluteBottom, pageY)); - int logicalRow = getLogicalRowIndex(WidgetUtil.getElementFromPoint( - initialPageX, constrainedPageY)); + int logicalRow = getLogicalRowIndex(WidgetUtil + .getElementFromPoint(initialPageX, constrainedPageY)); int incrementOrDecrement = (logicalRow > lastModifiedLogicalRow) ? 1 : -1; @@ -346,8 +348,8 @@ public class MultiSelectionRenderer extends return; } - int reboundPx = (int) Math.ceil(SCROLL_AREA_REBOUND_PX_PER_MS - * timeDiff); + int reboundPx = (int) Math + .ceil(SCROLL_AREA_REBOUND_PX_PER_MS * timeDiff); if (topBound < finalTopBound) { topBound += reboundPx; topBound = Math.min(topBound, finalTopBound); @@ -454,7 +456,8 @@ public class MultiSelectionRenderer extends final boolean topDidNotMove = oldTopBound == topBound; final boolean bottomDidNotMove = oldBottomBound == bottomBound; final boolean wasVerticalMovement = pageY != this.pageY; - scrollAreaShouldRebound = (topDidNotMove && bottomDidNotMove && wasVerticalMovement); + scrollAreaShouldRebound = (topDidNotMove && bottomDidNotMove + && wasVerticalMovement); } } } @@ -604,8 +607,8 @@ public class MultiSelectionRenderer extends @Override public CheckBox createWidget() { final CheckBox checkBox = GWT.create(CheckBox.class); - checkBox.setStylePrimaryName(grid.getStylePrimaryName() - + SELECTION_CHECKBOX_CLASSNAME); + checkBox.setStylePrimaryName( + grid.getStylePrimaryName() + SELECTION_CHECKBOX_CLASSNAME); CheckBoxEventHandler handler = new CheckBoxEventHandler(checkBox); @@ -653,13 +656,13 @@ public class MultiSelectionRenderer extends public boolean onBrowserEvent(final CellReference cell, final NativeEvent event) { if (BrowserEvents.TOUCHSTART.equals(event.getType()) - || (BrowserEvents.MOUSEDOWN.equals(event.getType()) && event - .getButton() == NativeEvent.BUTTON_LEFT)) { + || (BrowserEvents.MOUSEDOWN.equals(event.getType()) + && event.getButton() == NativeEvent.BUTTON_LEFT)) { startDragSelect(event, Element.as(event.getEventTarget())); return true; } else { - throw new IllegalStateException("received unexpected event: " - + event.getType()); + throw new IllegalStateException( + "received unexpected event: " + event.getType()); } } diff --git a/client/src/main/java/com/vaadin/client/widget/grid/selection/SelectionEvent.java b/client/src/main/java/com/vaadin/client/widget/grid/selection/SelectionEvent.java index 528beb5809..8ea2e56420 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/selection/SelectionEvent.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/selection/SelectionEvent.java @@ -25,7 +25,7 @@ import com.vaadin.client.widgets.Grid; /** * Event object describing a change in Grid row selection state. - * + * * @since 7.4 * @author Vaadin Ltd */ @@ -41,7 +41,7 @@ public class SelectionEvent extends GwtEvent { /** * Creates an event with a single added or removed row. - * + * * @param grid * grid reference, used for getSource * @param added @@ -72,7 +72,7 @@ public class SelectionEvent extends GwtEvent { /** * Creates an event where several rows have been added or removed. - * + * * @param grid * Grid reference, used for getSource * @param added @@ -106,7 +106,7 @@ public class SelectionEvent extends GwtEvent { /** * Gets a reference to the Grid object that fired this event. - * + * * @return a grid reference */ @Override @@ -117,7 +117,7 @@ public class SelectionEvent extends GwtEvent { /** * Gets all rows added to the selection since the last * {@link SelectionEvent} . - * + * * @return a collection of added rows. Empty collection if no rows were * added. */ @@ -128,7 +128,7 @@ public class SelectionEvent extends GwtEvent { /** * Gets all rows removed from the selection since the last * {@link SelectionEvent}. - * + * * @return a collection of removed rows. Empty collection if no rows were * removed. */ @@ -138,7 +138,7 @@ public class SelectionEvent extends GwtEvent { /** * Gets currently selected rows. - * + * * @return a non-null collection containing all currently selected rows. */ public Collection getSelected() { @@ -147,7 +147,7 @@ public class SelectionEvent extends GwtEvent { /** * Gets a type identifier for this event. - * + * * @return a {@link Type} identifier. */ public static Type getType() { @@ -168,7 +168,7 @@ public class SelectionEvent extends GwtEvent { /** * Checks if this selection change event is fired during a batched * selection/deselection operation. - * + * * @return true iff this event is fired during a batched * selection/deselection operation */ diff --git a/client/src/main/java/com/vaadin/client/widget/grid/selection/SelectionHandler.java b/client/src/main/java/com/vaadin/client/widget/grid/selection/SelectionHandler.java index 4f939fa798..46cafe6bbf 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/selection/SelectionHandler.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/selection/SelectionHandler.java @@ -19,7 +19,7 @@ import com.google.gwt.event.shared.EventHandler; /** * Handler for {@link SelectionEvent}s. - * + * * @author Vaadin Ltd * @param * The row data type @@ -29,7 +29,7 @@ public interface SelectionHandler extends EventHandler { /** * Called when a selection model's selection state is changed. - * + * * @param event * a selection event, containing info about rows that have been * added to or removed from the selection. diff --git a/client/src/main/java/com/vaadin/client/widget/grid/selection/SelectionModel.java b/client/src/main/java/com/vaadin/client/widget/grid/selection/SelectionModel.java index ec36ab52e8..000aa50702 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/selection/SelectionModel.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/selection/SelectionModel.java @@ -25,7 +25,7 @@ import com.vaadin.client.widgets.Grid; *

    * Selection models perform tracking of selected rows in the Grid, as well as * dispatching events when the selection state changes. - * + * * @author Vaadin Ltd * @param * Grid's row type @@ -36,7 +36,7 @@ public interface SelectionModel { /** * Return true if the provided row is considered selected under the * implementing selection model. - * + * * @param row * row object instance * @return true, if the row given as argument is considered @@ -47,7 +47,7 @@ public interface SelectionModel { /** * Return the {@link Renderer} responsible for rendering the selection * column. - * + * * @return a renderer instance. If null is returned, a selection column will * not be drawn. */ @@ -58,7 +58,7 @@ public interface SelectionModel { *

    * Implementations are free to have this be a no-op. This method is called * internally by Grid. - * + * * @param grid * a {@link Grid} instance; null when removing from * Grid @@ -75,7 +75,7 @@ public interface SelectionModel { /** * Returns a Collection containing all selected rows. - * + * * @return a non-null collection. */ public Collection getSelectedRows(); @@ -83,7 +83,7 @@ public interface SelectionModel { /** * Selection model that allows a maximum of one row to be selected at any * one time. - * + * * @param * type parameter corresponding with Grid row type */ @@ -91,7 +91,7 @@ public interface SelectionModel { /** * Selects a row. - * + * * @param row * a {@link Grid} row object * @return true, if this row as not previously selected. @@ -102,7 +102,7 @@ public interface SelectionModel { * Deselects a row. *

    * This is a no-op unless {@link row} is the currently selected row. - * + * * @param row * a {@link Grid} row object * @return true, if the currently selected row was deselected. @@ -111,7 +111,7 @@ public interface SelectionModel { /** * Returns the currently selected row. - * + * * @return a {@link Grid} row object or null, if nothing is selected. */ public T getSelectedRow(); @@ -119,7 +119,7 @@ public interface SelectionModel { /** * Sets whether it's allowed to deselect the selected row through the * UI. Deselection is allowed by default. - * + * * @param deselectAllowed * true if the selected row can be deselected * without selecting another row instead; otherwise @@ -130,7 +130,7 @@ public interface SelectionModel { /** * Sets whether it's allowed to deselect the selected row through the * UI. - * + * * @return true if deselection is allowed; otherwise * false */ @@ -140,7 +140,7 @@ public interface SelectionModel { /** * Selection model that allows for several rows to be selected at once. - * + * * @param * type parameter corresponding with Grid row type */ @@ -149,7 +149,7 @@ public interface SelectionModel { /** * A multi selection model that can send selections and deselections in * a batch, instead of committing them one-by-one. - * + * * @param * type parameter corresponding with Grid row type */ @@ -179,21 +179,21 @@ public interface SelectionModel { /** * Checks whether or not a batch has been started. - * + * * @return true iff a batch has been started */ public boolean isBeingBatchSelected(); /** * Gets all the rows that would become selected in this batch. - * + * * @return a collection of the rows that would become selected */ public Collection getSelectedRowsBatch(); /** * Gets all the rows that would become deselected in this batch. - * + * * @return a collection of the rows that would become deselected */ public Collection getDeselectedRowsBatch(); @@ -201,7 +201,7 @@ public interface SelectionModel { /** * Selects one or more rows. - * + * * @param rows * {@link Grid} row objects * @return true, if the set of selected rows was changed. @@ -210,7 +210,7 @@ public interface SelectionModel { /** * Deselects one or more rows. - * + * * @param rows * Grid row objects * @return true, if the set of selected rows was changed. @@ -219,14 +219,14 @@ public interface SelectionModel { /** * De-selects all rows. - * + * * @return true, if any row was previously selected. */ public boolean deselectAll(); /** * Select all rows in a {@link Collection}. - * + * * @param rows * a collection of Grid row objects * @return true, if the set of selected rows was changed. @@ -235,7 +235,7 @@ public interface SelectionModel { /** * Deselect all rows in a {@link Collection}. - * + * * @param rows * a collection of Grid row objects * @return true, if the set of selected rows was changed. @@ -247,7 +247,7 @@ public interface SelectionModel { /** * Interface for a selection model that does not allow anything to be * selected. - * + * * @param * type parameter corresponding with Grid row type */ diff --git a/client/src/main/java/com/vaadin/client/widget/grid/selection/SelectionModelMulti.java b/client/src/main/java/com/vaadin/client/widget/grid/selection/SelectionModelMulti.java index d654a28b7d..00c115c5c2 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/selection/SelectionModelMulti.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/selection/SelectionModelMulti.java @@ -28,7 +28,7 @@ import com.vaadin.client.widgets.Grid; /** * Multi-row selection model. - * + * * @author Vaadin Ltd * @since 7.4 */ diff --git a/client/src/main/java/com/vaadin/client/widget/grid/selection/SelectionModelNone.java b/client/src/main/java/com/vaadin/client/widget/grid/selection/SelectionModelNone.java index 4a8b203a94..48c1e3a850 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/selection/SelectionModelNone.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/selection/SelectionModelNone.java @@ -24,7 +24,7 @@ import com.vaadin.client.widgets.Grid; /** * No-row selection model. - * + * * @author Vaadin Ltd * @since 7.4 */ @@ -59,15 +59,15 @@ public class SelectionModelNone extends AbstractRowHandleSelectionModel @Override protected boolean selectByHandle(RowHandle handle) throws UnsupportedOperationException { - throw new UnsupportedOperationException("This selection model " - + "does not support selection"); + throw new UnsupportedOperationException( + "This selection model " + "does not support selection"); } @Override protected boolean deselectByHandle(RowHandle handle) throws UnsupportedOperationException { - throw new UnsupportedOperationException("This selection model " - + "does not support deselection"); + throw new UnsupportedOperationException( + "This selection model " + "does not support deselection"); } } diff --git a/client/src/main/java/com/vaadin/client/widget/grid/selection/SelectionModelSingle.java b/client/src/main/java/com/vaadin/client/widget/grid/selection/SelectionModelSingle.java index 38605db12c..f3df892623 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/selection/SelectionModelSingle.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/selection/SelectionModelSingle.java @@ -24,7 +24,7 @@ import com.vaadin.client.widgets.Grid; /** * Single-row selection model. - * + * * @author Vaadin Ltd * @since 7.4 */ diff --git a/client/src/main/java/com/vaadin/client/widget/grid/selection/SpaceSelectHandler.java b/client/src/main/java/com/vaadin/client/widget/grid/selection/SpaceSelectHandler.java index 3e04a6dfac..456f08c5b3 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/selection/SpaceSelectHandler.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/selection/SpaceSelectHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -28,7 +28,7 @@ import com.vaadin.shared.ui.grid.ScrollDestination; /** * Generic class to perform selections when pressing space key. - * + * * @author Vaadin Ltd * @param * row data type @@ -65,8 +65,8 @@ public class SpaceSelectHandler { @Override public void onDataAvailable( DataAvailableEvent dataAvailableEvent) { - if (dataAvailableEvent.getAvailableRows().contains( - rowIndex)) { + if (dataAvailableEvent.getAvailableRows() + .contains(rowIndex)) { setSelected(grid, rowIndex); scrollHandler.removeHandler(); scrollHandler = null; @@ -96,7 +96,7 @@ public class SpaceSelectHandler { /** * Constructor for SpaceSelectHandler. This constructor will add all * necessary handlers for selecting rows with space. - * + * * @param grid * grid to attach to */ @@ -126,7 +126,7 @@ public class SpaceSelectHandler { /** * Sets whether pressing space for the currently selected row should * deselect the row. - * + * * @param deselectAllowed * true to allow deselecting the selected row; * otherwise false diff --git a/client/src/main/java/com/vaadin/client/widget/grid/sort/Sort.java b/client/src/main/java/com/vaadin/client/widget/grid/sort/Sort.java index b1f3c6e39a..6cc0e0f5ea 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/sort/Sort.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/sort/Sort.java @@ -23,7 +23,7 @@ import com.vaadin.shared.data.sort.SortDirection; /** * Fluid Sort descriptor object. - * + * * @since 7.4 * @author Vaadin Ltd */ @@ -36,7 +36,7 @@ public class Sort { /** * Basic constructor, used by the {@link #by(GridColumn)} and * {@link #by(GridColumn, SortDirection)} methods. - * + * * @param column * a grid column * @param direction @@ -54,7 +54,7 @@ public class Sort { * isn't already used earlier (which would indicate a bug). If the column * has been used before, this constructor throws an * {@link IllegalStateException}. - * + * * @param previous * the sort instance that the new sort instance is to extend * @param column @@ -81,7 +81,7 @@ public class Sort { /** * Start building a Sort order by sorting a provided column in ascending * order. - * + * * @param column * a grid column object reference * @return a sort instance, typed to the grid data type @@ -92,7 +92,7 @@ public class Sort { /** * Start building a Sort order by sorting a provided column. - * + * * @param column * a grid column object reference * @param direction @@ -107,7 +107,7 @@ public class Sort { * Continue building a Sort order. The provided column is sorted in * ascending order if the previously added columns have been evaluated as * equals. - * + * * @param column * a grid column object reference * @return a sort instance, typed to the grid data type @@ -120,7 +120,7 @@ public class Sort { * Continue building a Sort order. The provided column is sorted in * specified order if the previously added columns have been evaluated as * equals. - * + * * @param column * a grid column object reference * @param direction @@ -136,7 +136,7 @@ public class Sort { * calling {@link com.vaadin.client.ui.grid.Grid#sort(Sort)}, but can also * be called manually to create a SortOrder list, which can also be provided * directly to Grid. - * + * * @return a sort order list. */ public List build() { diff --git a/client/src/main/java/com/vaadin/client/widget/grid/sort/SortEvent.java b/client/src/main/java/com/vaadin/client/widget/grid/sort/SortEvent.java index 2aad6e4f95..fce4aeba31 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/sort/SortEvent.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/sort/SortEvent.java @@ -23,7 +23,7 @@ import com.vaadin.client.widgets.Grid; /** * A sort event, fired by the Grid when it needs its data source to provide data * sorted in a specific manner. - * + * * @since 7.4 * @author Vaadin Ltd */ @@ -38,7 +38,7 @@ public class SortEvent extends GwtEvent> { /** * Creates a new Sort Event. All provided parameters are final, and passed * on as-is. - * + * * @param grid * a grid reference * @param order @@ -46,7 +46,8 @@ public class SortEvent extends GwtEvent> { * @param originator * a value indicating where this event originated from */ - public SortEvent(Grid grid, List order, boolean userOriginated) { + public SortEvent(Grid grid, List order, + boolean userOriginated) { this.grid = grid; this.order = order; this.userOriginated = userOriginated; @@ -60,7 +61,7 @@ public class SortEvent extends GwtEvent> { /** * Static access to the GWT event type identifier associated with this Event * class - * + * * @return a type object, uniquely describing this event type. */ public static Type> getType() { @@ -69,7 +70,7 @@ public class SortEvent extends GwtEvent> { /** * Get access to the Grid that fired this event - * + * * @return the grid instance */ @Override @@ -79,7 +80,7 @@ public class SortEvent extends GwtEvent> { /** * Get access to the Grid that fired this event - * + * * @return the grid instance */ public Grid getGrid() { @@ -88,7 +89,7 @@ public class SortEvent extends GwtEvent> { /** * Get the sort ordering that is to be applied to the Grid - * + * * @return a list of sort order objects */ public List getOrder() { @@ -97,7 +98,7 @@ public class SortEvent extends GwtEvent> { /** * Returns whether this event originated from actions done by the user. - * + * * @return true if sort event originated from user interaction */ public boolean isUserOriginated() { diff --git a/client/src/main/java/com/vaadin/client/widget/grid/sort/SortHandler.java b/client/src/main/java/com/vaadin/client/widget/grid/sort/SortHandler.java index 330cbe9d58..347b0f5687 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/sort/SortHandler.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/sort/SortHandler.java @@ -20,7 +20,7 @@ import com.google.gwt.event.shared.EventHandler; /** * Handler for a Grid sort event, called when the Grid needs its data source to * provide data sorted in a specific manner. - * + * * @since 7.4 * @author Vaadin Ltd */ @@ -29,7 +29,7 @@ public interface SortHandler extends EventHandler { /** * Handle sorting of the Grid. This method is called when a re-sorting of * the Grid's data is requested. - * + * * @param event * the sort event */ diff --git a/client/src/main/java/com/vaadin/client/widget/grid/sort/SortOrder.java b/client/src/main/java/com/vaadin/client/widget/grid/sort/SortOrder.java index 8166f1e6ed..f8eb58b379 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/sort/SortOrder.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/sort/SortOrder.java @@ -20,7 +20,7 @@ import com.vaadin.shared.data.sort.SortDirection; /** * Sort order descriptor. Contains column and direction references. - * + * * @since 7.4 * @author Vaadin Ltd */ @@ -32,7 +32,7 @@ public class SortOrder { /** * Create a sort order descriptor with a default sorting direction value of * {@link SortDirection#ASCENDING}. - * + * * @param column * a grid column descriptor object */ @@ -42,7 +42,7 @@ public class SortOrder { /** * Create a sort order descriptor. - * + * * @param column * a grid column descriptor object * @param direction @@ -63,7 +63,7 @@ public class SortOrder { /** * Returns the {@link GridColumn} reference given in the constructor. - * + * * @return a grid column reference */ public Grid.Column getColumn() { @@ -72,7 +72,7 @@ public class SortOrder { /** * Returns the {@link SortDirection} value given in the constructor. - * + * * @return a sort direction value */ public SortDirection getDirection() { @@ -81,7 +81,7 @@ public class SortOrder { /** * Returns a new SortOrder object with the sort direction reversed. - * + * * @return a new sort order object */ public SortOrder getOpposite() { diff --git a/client/src/main/java/com/vaadin/client/widgets/Escalator.java b/client/src/main/java/com/vaadin/client/widgets/Escalator.java index d867907996..76b9c284db 100644 --- a/client/src/main/java/com/vaadin/client/widgets/Escalator.java +++ b/client/src/main/java/com/vaadin/client/widgets/Escalator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -187,14 +187,14 @@ import com.vaadin.shared.util.SharedUtil; * implement such an interface), makes it possible for JSNI to indirectly refer * to the inner class, by invoking methods and fields in the non-inner-class * API. - * + * * @see Escalator.Scroller */ abstract class JsniWorkaround { /** * A JavaScript function that handles the scroll DOM event, and passes it on * to Java code. - * + * * @see #createScrollListenerFunction(Escalator) * @see Escalator#onScroll() * @see Escalator.Scroller#onScroll() @@ -204,7 +204,7 @@ abstract class JsniWorkaround { /** * A JavaScript function that handles the mousewheel DOM event, and passes * it on to Java code. - * + * * @see #createMousewheelListenerFunction(Escalator) * @see Escalator#onScroll() * @see Escalator.Scroller#onScroll() @@ -214,7 +214,7 @@ abstract class JsniWorkaround { /** * A JavaScript function that handles the touch start DOM event, and passes * it on to Java code. - * + * * @see TouchHandlerBundle#touchStart(Escalator.JsniUtil.TouchHandlerBundle.CustomTouchEvent) */ protected JavaScriptObject touchStartFunction; @@ -222,7 +222,7 @@ abstract class JsniWorkaround { /** * A JavaScript function that handles the touch move DOM event, and passes * it on to Java code. - * + * * @see TouchHandlerBundle#touchMove(Escalator.JsniUtil.TouchHandlerBundle.CustomTouchEvent) */ protected JavaScriptObject touchMoveFunction; @@ -230,7 +230,7 @@ abstract class JsniWorkaround { /** * A JavaScript function that handles the touch end and cancel DOM events, * and passes them on to Java code. - * + * * @see TouchHandlerBundle#touchEnd(Escalator.JsniUtil.TouchHandlerBundle.CustomTouchEvent) */ protected JavaScriptObject touchEndFunction; @@ -239,7 +239,8 @@ abstract class JsniWorkaround { protected JsniWorkaround(final Escalator escalator) { scrollListenerFunction = createScrollListenerFunction(escalator); - mousewheelListenerFunction = createMousewheelListenerFunction(escalator); + mousewheelListenerFunction = createMousewheelListenerFunction( + escalator); touchHandlerBundle = new TouchHandlerBundle(escalator); touchStartFunction = touchHandlerBundle.getTouchStartHandler(); @@ -250,7 +251,7 @@ abstract class JsniWorkaround { /** * A method that constructs the JavaScript function that will be stored into * {@link #scrollListenerFunction}. - * + * * @param esc * a reference to the current instance of {@link Escalator} * @see Escalator#onScroll() @@ -261,7 +262,7 @@ abstract class JsniWorkaround { /** * A method that constructs the JavaScript function that will be stored into * {@link #mousewheelListenerFunction}. - * + * * @param esc * a reference to the current instance of {@link Escalator} * @see Escalator#onScroll() @@ -273,12 +274,12 @@ abstract class JsniWorkaround { /** * A low-level table-like widget that features a scrolling virtual viewport and * lazily generated rows. - * + * * @since 7.4 * @author Vaadin Ltd */ -public class Escalator extends Widget implements RequiresResize, - DeferredWorker, SubPartAware { +public class Escalator extends Widget + implements RequiresResize, DeferredWorker, SubPartAware { // todo comments legend /* @@ -310,8 +311,8 @@ public class Escalator extends Widget implements RequiresResize, /** * A JavaScriptObject overlay for the JavaScript + * >JavaScriptObject overlay for the + * JavaScript * TouchEvent object. *

    * This needs to be used in the touch event handlers, since GWT's @@ -320,8 +321,8 @@ public class Escalator extends Widget implements RequiresResize, * {@link com.google.gwt.dom.client.NativeEvent NativeEvent} isn't * properly populated with the correct values. */ - private final static class CustomTouchEvent extends - JavaScriptObject { + private final static class CustomTouchEvent + extends JavaScriptObject { protected CustomTouchEvent() { } @@ -738,8 +739,7 @@ public class Escalator extends Widget implements RequiresResize, double tableWrapperWidth = widthOfEscalator; boolean verticalScrollNeeded = scrollContentHeight > tableWrapperHeight - + WidgetUtil.PIXEL_EPSILON - - header.getHeightOfSection() + + WidgetUtil.PIXEL_EPSILON - header.getHeightOfSection() - footer.getHeightOfSection(); boolean horizontalScrollNeeded = scrollContentWidth > tableWrapperWidth + WidgetUtil.PIXEL_EPSILON; @@ -774,8 +774,8 @@ public class Escalator extends Widget implements RequiresResize, double footerHeight = footer.getHeightOfSection(); double headerHeight = header.getHeightOfSection(); - double vScrollbarHeight = Math.max(0, tableWrapperHeight - - footerHeight - headerHeight); + double vScrollbarHeight = Math.max(0, + tableWrapperHeight - footerHeight - headerHeight); verticalScrollbar.setOffsetSize(vScrollbarHeight); verticalScrollbar.setScrollSize(scrollContentHeight); @@ -795,8 +795,8 @@ public class Escalator extends Widget implements RequiresResize, double hScrollOffsetWidth = tableWrapperWidth - frozenPixels; horizontalScrollbar.setOffsetSize(hScrollOffsetWidth); horizontalScrollbar.setScrollSize(unfrozenPixels); - horizontalScrollbar.getElement().getStyle() - .setLeft(frozenPixels, Unit.PX); + horizontalScrollbar.getElement().getStyle().setLeft(frozenPixels, + Unit.PX); horizontalScrollbar.setScrollPos(prevScrollPos); /* @@ -1019,9 +1019,8 @@ public class Escalator extends Widget implements RequiresResize, + columnConfiguration.getColumnWidthActual(columnIndex); final double viewportStartPx = getScrollLeft(); - double viewportEndPx = viewportStartPx - + WidgetUtil - .getRequiredWidthBoundingClientRectDouble(getElement()) + double viewportEndPx = viewportStartPx + WidgetUtil + .getRequiredWidthBoundingClientRectDouble(getElement()) - frozenPixels; if (verticalScrollbar.showsScrollHandle()) { viewportEndPx -= WidgetUtil.getNativeScrollbarSize(); @@ -1070,7 +1069,9 @@ public class Escalator extends Widget implements RequiresResize, /** * The table section element ({@code }, {@code } or - * {@code }) the rows (i.e. {@code } tags) are contained in. + * {@code }) the rows (i.e. {@code + * + * } tags) are contained in. */ protected final TableSectionElement root; @@ -1101,7 +1102,7 @@ public class Escalator extends Widget implements RequiresResize, *

    * Note: To actually create such an element, use * {@link #createCellElement(int, int)} instead. - * + * * @return the tag name for the element to represent cells as * @see #createCellElement(int, int) */ @@ -1118,11 +1119,12 @@ public class Escalator extends Widget implements RequiresResize, * Implementation detail: This method does no DOM modifications * (i.e. is very cheap to call) if there is no data for rows or columns * when this method is called. - * + * * @see #hasColumnAndRowData() */ @Override - public void setEscalatorUpdater(final EscalatorUpdater escalatorUpdater) { + public void setEscalatorUpdater( + final EscalatorUpdater escalatorUpdater) { if (escalatorUpdater == null) { throw new IllegalArgumentException( "escalator updater cannot be null"); @@ -1141,7 +1143,7 @@ public class Escalator extends Widget implements RequiresResize, * Implementation detail: This method does no DOM modifications * (i.e. is very cheap to call) if there are no rows in the DOM when * this method is called. - * + * * @see #hasSomethingInDom() */ @Override @@ -1169,7 +1171,7 @@ public class Escalator extends Widget implements RequiresResize, *

    * The implementation must call {@link #paintRemoveRow(Element, int)} * for each row that is removed from the DOM. - * + * * @param index * the logical index of the first removed row * @param numberOfRows @@ -1187,7 +1189,7 @@ public class Escalator extends Widget implements RequiresResize, *

    * This method must be called for each removed DOM row by any * {@link #paintRemoveRows(int, int)} implementation. - * + * * @param tr * the row element to remove. */ @@ -1214,8 +1216,8 @@ public class Escalator extends Widget implements RequiresResize, } protected void assertArgumentsAreValidAndWithinRange(final int index, - final int numberOfRows) throws IllegalArgumentException, - IndexOutOfBoundsException { + final int numberOfRows) + throws IllegalArgumentException, IndexOutOfBoundsException { if (numberOfRows < 1) { throw new IllegalArgumentException( "Number of rows must be 1 or greater (was " @@ -1223,8 +1225,8 @@ public class Escalator extends Widget implements RequiresResize, } if (index < 0 || index + numberOfRows > getRowCount()) { - throw new IndexOutOfBoundsException("The given " - + "row range (" + index + ".." + (index + numberOfRows) + throw new IndexOutOfBoundsException("The given " + "row range (" + + index + ".." + (index + numberOfRows) + ") was outside of the current number of rows (" + getRowCount() + ")"); } @@ -1244,9 +1246,9 @@ public class Escalator extends Widget implements RequiresResize, *

    * Any extra content, such as spacers for the body, should not be * included in this count. - * + * * @since 7.5.0 - * + * * @return the actual DOM count of rows */ public abstract int getDomRowCount(); @@ -1257,7 +1259,7 @@ public class Escalator extends Widget implements RequiresResize, * Implementation detail: This method does no DOM modifications * (i.e. is very cheap to call) if there is no data for columns when * this method is called. - * + * * @see #hasColumnAndRowData() */ @Override @@ -1295,8 +1297,8 @@ public class Escalator extends Widget implements RequiresResize, Map colWidths = new HashMap(); for (int i = 0; i < getColumnConfiguration() .getColumnCount(); i++) { - Double width = Double.valueOf(getColumnConfiguration() - .getColumnWidth(i)); + Double width = Double.valueOf( + getColumnConfiguration().getColumnWidth(i)); Integer col = Integer.valueOf(i); colWidths.put(col, width); } @@ -1308,7 +1310,7 @@ public class Escalator extends Widget implements RequiresResize, /** * Actually add rows into the DOM, now that everything can be * calculated. - * + * * @param visualIndex * the DOM index to add rows into * @param numberOfRows @@ -1337,15 +1339,18 @@ public class Escalator extends Widget implements RequiresResize, referenceRow = null; } - for (int row = visualIndex; row < visualIndex + numberOfRows; row++) { + for (int row = visualIndex; row < visualIndex + + numberOfRows; row++) { final TableRowElement tr = TableRowElement.as(DOM.createTR()); addedRows.add(tr); tr.addClassName(getStylePrimaryName() + "-row"); - for (int col = 0; col < columnConfiguration.getColumnCount(); col++) { + for (int col = 0; col < columnConfiguration + .getColumnCount(); col++) { final double colWidth = columnConfiguration .getColumnWidthActual(col); - final TableCellElement cellElem = createCellElement(colWidth); + final TableCellElement cellElem = createCellElement( + colWidth); tr.appendChild(cellElem); // Set stylename and position if new cell is frozen @@ -1375,7 +1380,7 @@ public class Escalator extends Widget implements RequiresResize, * {@link EscalatorUpdater#postAttach(Row, Iterable) postAttach} before * and after inserting the row, respectively. The row should have its * cells already inserted. - * + * * @param referenceRow * the row after which to insert or null if insert as first * @param tr @@ -1440,15 +1445,15 @@ public class Escalator extends Widget implements RequiresResize, * Implementation detail: This method does no DOM modifications * (i.e. is very cheap to call) if there is no data for columns when * this method is called. - * + * * @see #hasColumnAndRowData() */ @Override // overridden because of JavaDoc public void refreshRows(final int index, final int numberOfRows) { Range rowRange = Range.withLength(index, numberOfRows); - Range colRange = Range.withLength(0, getColumnConfiguration() - .getColumnCount()); + Range colRange = Range.withLength(0, + getColumnConfiguration().getColumnCount()); refreshCells(rowRange, colRange); } @@ -1464,8 +1469,8 @@ public class Escalator extends Widget implements RequiresResize, Range colRange) { flyweightRow.setup(tr, logicalRowIndex, columnConfiguration.getCalculatedColumnWidths()); - Iterable cellsToUpdate = flyweightRow.getCells( - colRange.getStart(), colRange.length()); + Iterable cellsToUpdate = flyweightRow + .getCells(colRange.getStart(), colRange.length()); updater.update(flyweightRow, cellsToUpdate); /* @@ -1477,15 +1482,15 @@ public class Escalator extends Widget implements RequiresResize, /** * Create and setup an empty cell element. - * + * * @param width * the width of the cell, in pixels - * + * * @return a set-up empty cell element */ public TableCellElement createCellElement(final double width) { - final TableCellElement cellElem = TableCellElement.as(DOM - .createElement(getCellElementTagName())); + final TableCellElement cellElem = TableCellElement + .as(DOM.createElement(getCellElementTagName())); final double height = getDefaultRowHeight(); assert height >= 0 : "defaultRowHeight was negative. There's a setter leak somewhere."; @@ -1505,7 +1510,7 @@ public class Escalator extends Widget implements RequiresResize, /** * Gets the child element that is visually at a certain index - * + * * @param index * the index of the element to retrieve * @return the element at position {@code index} @@ -1522,8 +1527,8 @@ public class Escalator extends Widget implements RequiresResize, flyweightRow.setup(row, i, columnConfiguration.getCalculatedColumnWidths()); - Iterable attachedCells = flyweightRow.getCells( - offset, numberOfColumns); + Iterable attachedCells = flyweightRow + .getCells(offset, numberOfColumns); getEscalatorUpdater().preDetach(flyweightRow, attachedCells); for (int j = 0; j < numberOfColumns; j++) { @@ -1565,7 +1570,7 @@ public class Escalator extends Widget implements RequiresResize, * Precondition: The row must be already attached to the DOM and the * FlyweightCell instances corresponding to the new columns added to * {@code flyweightRow}. - * + * * @param tr * the row in which to insert the cells * @param logicalRowIndex @@ -1576,15 +1581,17 @@ public class Escalator extends Widget implements RequiresResize, * the number of cells to insert */ private void paintInsertCells(final TableRowElement tr, - int logicalRowIndex, final int offset, final int numberOfCells) { + int logicalRowIndex, final int offset, + final int numberOfCells) { - assert root.isOrHasChild(tr) : "The row must be attached to the document"; + assert root.isOrHasChild( + tr) : "The row must be attached to the document"; flyweightRow.setup(tr, logicalRowIndex, columnConfiguration.getCalculatedColumnWidths()); - Iterable cells = flyweightRow.getUnattachedCells( - offset, numberOfCells); + Iterable cells = flyweightRow + .getUnattachedCells(offset, numberOfCells); for (FlyweightCell cell : cells) { final double colWidth = columnConfiguration @@ -1664,9 +1671,9 @@ public class Escalator extends Widget implements RequiresResize, *

    * In practice, this applies for all header and footer rows. For body * rows, it applies for all rows except spacer rows. - * + * * @since 7.5.0 - * + * * @param tr * the row element to check for if it is or has elements that * can be frozen @@ -1678,14 +1685,14 @@ public class Escalator extends Widget implements RequiresResize, /** * Iterates through all the cells in a column and returns the width of * the widest element in this RowContainer. - * + * * @param index * the index of the column to inspect * @return the pixel width of the widest element in the indicated column */ public double calculateMaxColWidth(int index) { - TableRowElement row = TableRowElement.as(root - .getFirstChildElement()); + TableRowElement row = TableRowElement + .as(root.getFirstChildElement()); double maxWidth = 0; while (row != null) { final TableCellElement cell = row.getCells().getItem(index); @@ -1740,7 +1747,8 @@ public class Escalator extends Widget implements RequiresResize, * Since browsers don't explode with overflowing colspans, escalator * shouldn't either. */ - if (spannedColumns.getEnd() > columnConfiguration.getColumnCount()) { + if (spannedColumns.getEnd() > columnConfiguration + .getColumnCount()) { spannedColumns = Range.between(columnIndex, columnConfiguration.getColumnCount()); } @@ -1752,8 +1760,9 @@ public class Escalator extends Widget implements RequiresResize, * Applies the total length of the columns to each row element. *

    * Note: In contrast to {@link #reapplyColumnWidths()}, this - * method only modifies the width of the {@code } element, not the - * cells within. + * method only modifies the width of the {@code + * + * } element, not the cells within. */ protected void reapplyRowWidths() { double rowWidth = columnConfiguration.calculateRowWidth(); @@ -1776,7 +1785,7 @@ public class Escalator extends Widget implements RequiresResize, /** * The primary style name for the container. - * + * * @param primaryStyleName * the style name to use as prefix for all row and cell style * names. @@ -1796,8 +1805,8 @@ public class Escalator extends Widget implements RequiresResize, Element cell = TableRowElement.as(row).getCells().getItem(0); while (cell != null) { assert TableCellElement.is(cell); - UIObject.setStylePrimaryName(cell, primaryStyleName - + "-cell"); + UIObject.setStylePrimaryName(cell, + primaryStyleName + "-cell"); cell = cell.getNextSiblingElement(); } row = row.getNextSiblingElement(); @@ -1806,7 +1815,7 @@ public class Escalator extends Widget implements RequiresResize, /** * Returns the primary style name of the container. - * + * * @return The primary style name or null if not set. */ protected String getStylePrimaryName() { @@ -1817,8 +1826,8 @@ public class Escalator extends Widget implements RequiresResize, public void setDefaultRowHeight(double px) throws IllegalArgumentException { if (px < 1) { - throw new IllegalArgumentException("Height must be positive. " - + px + " was given."); + throw new IllegalArgumentException( + "Height must be positive. " + px + " was given."); } defaultRowHeightShouldBeAutodetected = false; @@ -1870,7 +1879,7 @@ public class Escalator extends Widget implements RequiresResize, * Note: This method does not calculate what a row's top * position should be. It just returns an assigned value, correct or * not. - * + * * @param tr * the table row element to measure * @return the current top position for {@code tr} @@ -1963,7 +1972,8 @@ public class Escalator extends Widget implements RequiresResize, * hierarchy until reaching cell element. */ Element cellElementCandidate = element; - while (cellElementCandidate.getParentElement().getParentElement() != root) { + while (cellElementCandidate.getParentElement() + .getParentElement() != root) { cellElementCandidate = cellElementCandidate.getParentElement(); } final TableCellElement cellElement = TableCellElement @@ -1990,15 +2000,15 @@ public class Escalator extends Widget implements RequiresResize, /* * To get the actual width of the contents, we need to get the cell * content without any hardcoded height or width. - * + * * But we don't want to modify the existing column, because that * might trigger some unnecessary listeners and whatnot. So, * instead, we make a deep clone of that cell, but without any * explicit dimensions, and measure that instead. */ - TableCellElement cellClone = TableCellElement.as((Element) cell - .cloneNode(withContent)); + TableCellElement cellClone = TableCellElement + .as((Element) cell.cloneNode(withContent)); cellClone.getStyle().clearHeight(); cellClone.getStyle().clearWidth(); @@ -2021,7 +2031,7 @@ public class Escalator extends Widget implements RequiresResize, /** * Gets the minimum width needed to display the cell properly. - * + * * @param colIndex * index of column to measure * @param withContent @@ -2051,8 +2061,8 @@ public class Escalator extends Widget implements RequiresResize, private boolean cellIsPartOfSpan(TableCellElement cell) { boolean cellHasColspan = cell.getColSpan() > 1; - boolean cellIsHidden = Display.NONE.getCssName().equals( - cell.getStyle().getDisplay()); + boolean cellIsHidden = Display.NONE.getCssName() + .equals(cell.getStyle().getDisplay()); return cellHasColspan || cellIsHidden; } @@ -2069,9 +2079,9 @@ public class Escalator extends Widget implements RequiresResize, *

    * Note that {@link Escalator#getBody() the body} will calculate its * height, while the others will return a precomputed value. - * + * * @since 7.5.0 - * + * * @return the height of this table section */ protected abstract double getHeightOfSection(); @@ -2082,13 +2092,14 @@ public class Escalator extends Widget implements RequiresResize, } - private abstract class AbstractStaticRowContainer extends - AbstractRowContainer { + private abstract class AbstractStaticRowContainer + extends AbstractRowContainer { /** The height of the combined rows in the DOM. Never negative. */ private double heightOfSection = 0; - public AbstractStaticRowContainer(final TableSectionElement headElement) { + public AbstractStaticRowContainer( + final TableSectionElement headElement) { super(headElement); } @@ -2098,7 +2109,8 @@ public class Escalator extends Widget implements RequiresResize, } @Override - protected void paintRemoveRows(final int index, final int numberOfRows) { + protected void paintRemoveRows(final int index, + final int numberOfRows) { for (int i = index; i < index + numberOfRows; i++) { final TableRowElement tr = root.getRows().getItem(index); paintRemoveRow(tr, index); @@ -2112,8 +2124,8 @@ public class Escalator extends Widget implements RequiresResize, if (index >= 0 && index < root.getChildCount()) { return root.getRows().getItem(index); } else { - throw new IndexOutOfBoundsException("No such visual index: " - + index); + throw new IndexOutOfBoundsException( + "No such visual index: " + index); } } @@ -2132,7 +2144,7 @@ public class Escalator extends Widget implements RequiresResize, * temporarily shrunk and then re-expanded. This leads to the fact * that the scroll position is scooted up a bit. This means that we * need to reset the position here. - * + * * If Escalator, at some point, gets a JIT evaluation functionality, * this re-setting is a strong candidate for removal. */ @@ -2151,7 +2163,8 @@ public class Escalator extends Widget implements RequiresResize, return; } - Profiler.enter("Escalator.AbstractStaticRowContainer.reapplyDefaultRowHeights"); + Profiler.enter( + "Escalator.AbstractStaticRowContainer.reapplyDefaultRowHeights"); Element tr = root.getRows().getItem(0); while (tr != null) { @@ -2166,12 +2179,14 @@ public class Escalator extends Widget implements RequiresResize, */ recalculateSectionHeight(); - Profiler.leave("Escalator.AbstractStaticRowContainer.reapplyDefaultRowHeights"); + Profiler.leave( + "Escalator.AbstractStaticRowContainer.reapplyDefaultRowHeights"); } @Override protected void recalculateSectionHeight() { - Profiler.enter("Escalator.AbstractStaticRowContainer.recalculateSectionHeight"); + Profiler.enter( + "Escalator.AbstractStaticRowContainer.recalculateSectionHeight"); double newHeight = calculateTotalRowHeight(); if (newHeight != heightOfSection) { @@ -2185,15 +2200,16 @@ public class Escalator extends Widget implements RequiresResize, * body.verifyEscalatorCount. This is because the logical row * indices are calculated from the scrollbar position. */ - verticalScrollbar.setOffsetSize(heightOfEscalator - - header.getHeightOfSection() - - footer.getHeightOfSection()); + verticalScrollbar.setOffsetSize( + heightOfEscalator - header.getHeightOfSection() + - footer.getHeightOfSection()); body.verifyEscalatorCount(); body.spacerContainer.updateSpacerDecosVisibility(); } - Profiler.leave("Escalator.AbstractStaticRowContainer.recalculateSectionHeight"); + Profiler.leave( + "Escalator.AbstractStaticRowContainer.recalculateSectionHeight"); } /** @@ -2237,7 +2253,8 @@ public class Escalator extends Widget implements RequiresResize, @Override protected boolean rowCanBeFrozen(TableRowElement tr) { - assert root.isOrHasChild(tr) : "Row does not belong to this table section"; + assert root.isOrHasChild( + tr) : "Row does not belong to this table section"; return true; } @@ -2258,8 +2275,8 @@ public class Escalator extends Widget implements RequiresResize, bodyElem.getStyle().setMarginTop(heightOfSection, Unit.PX); spacerDecoContainer.getStyle().setMarginTop(heightOfSection, Unit.PX); - verticalScrollbar.getElement().getStyle() - .setTop(heightOfSection, Unit.PX); + verticalScrollbar.getElement().getStyle().setTop(heightOfSection, + Unit.PX); headerDeco.getStyle().setHeight(heightOfSection, Unit.PX); } @@ -2295,8 +2312,8 @@ public class Escalator extends Widget implements RequiresResize, protected void sectionHeightCalculated() { double headerHeight = header.getHeightOfSection(); double footerHeight = footer.getHeightOfSection(); - int vscrollHeight = (int) Math.floor(heightOfEscalator - - headerHeight - footerHeight); + int vscrollHeight = (int) Math + .floor(heightOfEscalator - headerHeight - footerHeight); final boolean horizontalScrollbarNeeded = columnConfiguration .calculateRowWidth() > widthOfEscalator; @@ -2311,8 +2328,8 @@ public class Escalator extends Widget implements RequiresResize, } } - private class BodyRowContainerImpl extends AbstractRowContainer implements - BodyRowContainer { + private class BodyRowContainerImpl extends AbstractRowContainer + implements BodyRowContainer { /* * TODO [[optimize]]: check whether a native JsArray might be faster * than LinkedList @@ -2321,14 +2338,14 @@ public class Escalator extends Widget implements RequiresResize, * The order in which row elements are rendered visually in the browser, * with the help of CSS tricks. Usually has nothing to do with the DOM * order. - * + * * @see #sortDomElements() */ private final LinkedList visualRowOrder = new LinkedList(); /** * The logical index of the topmost row. - * + * * @deprecated Use the accessors {@link #setTopRowLogicalIndex(int)}, * {@link #updateTopRowLogicalIndex(int)} and * {@link #getTopRowLogicalIndex()} instead @@ -2338,13 +2355,14 @@ public class Escalator extends Widget implements RequiresResize, private void setTopRowLogicalIndex(int topRowLogicalIndex) { if (LogConfiguration.loggingIsEnabled(Level.INFO)) { - Logger.getLogger("Escalator.BodyRowContainer").fine( - "topRowLogicalIndex: " + this.topRowLogicalIndex + Logger.getLogger("Escalator.BodyRowContainer") + .fine("topRowLogicalIndex: " + this.topRowLogicalIndex + " -> " + topRowLogicalIndex); } assert topRowLogicalIndex >= 0 : "topRowLogicalIndex became negative (top left cell contents: " + visualRowOrder.getFirst().getCells().getItem(0) - .getInnerText() + ") "; + .getInnerText() + + ") "; /* * if there's a smart way of evaluating and asserting the max index, * this would be a nice place to put it. I haven't found out an @@ -2398,7 +2416,8 @@ public class Escalator extends Widget implements RequiresResize, private boolean sortIfConditionsMet() { boolean enoughFramesHavePassed = framesPassed >= REQUIRED_FRAMES_PASSED; - boolean enoughTimeHasPassed = (Duration.currentTimeMillis() - startTime) >= SORT_DELAY_MILLIS; + boolean enoughTimeHasPassed = (Duration.currentTimeMillis() + - startTime) >= SORT_DELAY_MILLIS; boolean notTouchActivity = !scroller.touchHandlerBundle.touching; boolean conditionsMet = enoughFramesHavePassed && enoughTimeHasPassed && notTouchActivity; @@ -2471,8 +2490,8 @@ public class Escalator extends Widget implements RequiresResize, double rowPx = getRowHeightsSumBetweenPx(scrollTop, topElementPosition); - int originalRowsToMove = (int) Math.ceil(rowPx - / getDefaultRowHeight()); + int originalRowsToMove = (int) Math + .ceil(rowPx / getDefaultRowHeight()); int rowsToMove = Math.min(originalRowsToMove, visualRowOrder.size()); @@ -2507,8 +2526,8 @@ public class Escalator extends Widget implements RequiresResize, * We scroll so little that we can just keep adding the rows * below the current escalator */ - logicalRowIndex = getLogicalRowIndex(visualRowOrder - .getLast()) + 1; + logicalRowIndex = getLogicalRowIndex( + visualRowOrder.getLast()) + 1; } else { /* * Since we're moving all escalator rows, we need to @@ -2573,8 +2592,8 @@ public class Escalator extends Widget implements RequiresResize, + originalRowsToMove; final int maxLogicalIndex = getRowCount() - visualRowOrder.size(); - setTopRowLogicalIndex(Math.min(naiveNewLogicalIndex, - maxLogicalIndex)); + setTopRowLogicalIndex( + Math.min(naiveNewLogicalIndex, maxLogicalIndex)); rowsWereMoved = true; } @@ -2602,7 +2621,8 @@ public class Escalator extends Widget implements RequiresResize, } @Override - protected void paintInsertRows(final int index, final int numberOfRows) { + protected void paintInsertRows(final int index, + final int numberOfRows) { if (numberOfRows == 0) { return; } @@ -2613,7 +2633,7 @@ public class Escalator extends Widget implements RequiresResize, * TODO: this method should probably only add physical rows, and not * populate them - let everything be populated as appropriate by the * logic that follows. - * + * * This also would lead to the fact that paintInsertRows wouldn't * need to return anything. */ @@ -2630,7 +2650,7 @@ public class Escalator extends Widget implements RequiresResize, * getDefaultRowHeight() < getScrollTop(); final boolean addedRowsBelowCurrentViewport = index * getDefaultRowHeight() > getScrollTop() - + getHeightOfSection(); + + getHeightOfSection(); if (addedRowsAboveCurrentViewport) { /* @@ -2651,13 +2671,13 @@ public class Escalator extends Widget implements RequiresResize, else { // some rows were added inside the current viewport final int unupdatedLogicalStart = index + addedRows.size(); - final int visualOffset = getLogicalRowIndex(visualRowOrder - .getFirst()); + final int visualOffset = getLogicalRowIndex( + visualRowOrder.getFirst()); /* * At this point, we have added new escalator rows, if so * needed. - * + * * If more rows were added than the new escalator rows can * account for, we need to start to spin the escalator to update * the remaining rows aswell. @@ -2665,8 +2685,9 @@ public class Escalator extends Widget implements RequiresResize, final int rowsStillNeeded = numberOfRows - addedRows.size(); if (rowsStillNeeded > 0) { - final Range unupdatedVisual = convertToVisual(Range - .withLength(unupdatedLogicalStart, rowsStillNeeded)); + final Range unupdatedVisual = convertToVisual( + Range.withLength(unupdatedLogicalStart, + rowsStillNeeded)); final int end = getDomRowCount(); final int start = end - unupdatedVisual.length(); final int visualTargetIndex = unupdatedLogicalStart @@ -2684,7 +2705,8 @@ public class Escalator extends Widget implements RequiresResize, // the order of operations is, in fact, wrong. try { final ListIterator i = visualRowOrder - .listIterator(visualTargetIndex + (end - start)); + .listIterator( + visualTargetIndex + (end - start)); int logicalRowIndexCursor = unupdatedLogicalStart; while (i.hasNext()) { @@ -2697,11 +2719,11 @@ public class Escalator extends Widget implements RequiresResize, } } catch (Exception e) { Logger logger = getLogger(); - logger.warning("Ignored out-of-bounds row element access"); + logger.warning( + "Ignored out-of-bounds row element access"); logger.warning("Escalator state: start=" + start + ", end=" + end + ", visualTargetIndex=" - + visualTargetIndex - + ", visualRowOrder.size()=" + + visualTargetIndex + ", visualRowOrder.size()=" + visualRowOrder.size()); logger.warning(e.toString()); } @@ -2715,7 +2737,7 @@ public class Escalator extends Widget implements RequiresResize, /** * Move escalator rows around, and make sure everything gets * appropriately repositioned and repainted. - * + * * @param visualSourceRange * the range of rows to move to a new place * @param visualTargetIndex @@ -2743,22 +2765,23 @@ public class Escalator extends Widget implements RequiresResize, assert visualTargetIndex <= getDomRowCount() : "Visual target " + "must not be greater than the number of escalator rows (was " - + visualTargetIndex + ", escalator rows " - + getDomRowCount() + ")"; + + visualTargetIndex + ", escalator rows " + getDomRowCount() + + ")"; - assert logicalTargetIndex + visualSourceRange.length() <= getRowCount() : "Logical " - + "target leads to rows outside of the data range (" - + Range.withLength(logicalTargetIndex, - visualSourceRange.length()) - + " goes beyond " - + Range.withLength(0, getRowCount()) + ")"; + assert logicalTargetIndex + + visualSourceRange.length() <= getRowCount() : "Logical " + + "target leads to rows outside of the data range (" + + Range.withLength(logicalTargetIndex, + visualSourceRange.length()) + + " goes beyond " + + Range.withLength(0, getRowCount()) + ")"; /* * Since we move a range into another range, the indices might move * about. Having 10 rows, if we move 0..1 to index 10 (to the end of * the collection), the target range will end up being 8..9, instead * of 10..11. - * + * * This applies only if we move elements forward in the collection, * not backward. */ @@ -2840,7 +2863,7 @@ public class Escalator extends Widget implements RequiresResize, * position with 27.5px will move the viewport 27.5px down, and place * the row at 20px. * - * + * * @param yDelta * the delta of pixels by which to move the viewport and * content. A positive value moves everything downwards, @@ -2882,7 +2905,7 @@ public class Escalator extends Widget implements RequiresResize, *

    * If Escalator already is at (or beyond) max capacity, this method does * nothing to the DOM. - * + * * @param index * the index at which to add new escalator rows. * Note:It is assumed that the index is both the @@ -2940,19 +2963,20 @@ public class Escalator extends Widget implements RequiresResize, } @Override - protected void paintRemoveRows(final int index, final int numberOfRows) { + protected void paintRemoveRows(final int index, + final int numberOfRows) { if (numberOfRows == 0) { return; } final Range viewportRange = getVisibleRowRange(); - final Range removedRowsRange = Range - .withLength(index, numberOfRows); + final Range removedRowsRange = Range.withLength(index, + numberOfRows); /* * Removing spacers as the very first step will correct the * scrollbars and row offsets right away. - * + * * TODO: actually, it kinda sounds like a Grid feature that a spacer * would be associated with a particular row. Maybe it would be * better to have a spacer separate from rows, and simply collapse @@ -2965,7 +2989,8 @@ public class Escalator extends Widget implements RequiresResize, .partitionWith(viewportRange); final Range removedAbove = partitions[0]; final Range removedLogicalInside = partitions[1]; - final Range removedVisualInside = convertToVisual(removedLogicalInside); + final Range removedVisualInside = convertToVisual( + removedLogicalInside); /* * TODO: extract the following if-block to a separate method. I'll @@ -2976,15 +3001,15 @@ public class Escalator extends Widget implements RequiresResize, /* * Adjust scroll position in one of two scenarios: - * + * * 1) Rows were removed above. Then we just need to adjust the * scrollbar by the height of the removed rows. - * + * * 2) There are no logical rows above, and at least the first (if * not more) visual row is removed. Then we need to snap the scroll * position to the first visible row (i.e. reset scroll position to * absolute 0) - * + * * The logic is optimized in such a way that the * moveViewportAndContent is called only once, to avoid extra * reflows, and thus the code might seem a bit obscure. @@ -3000,7 +3025,8 @@ public class Escalator extends Widget implements RequiresResize, .getScrollPos() - yDelta < firstLogicalRowHeight; if (removedVisualInside.isEmpty() - && (!removalScrollsToShowFirstLogicalRow || !firstVisualRowIsRemoved)) { + && (!removalScrollsToShowFirstLogicalRow + || !firstVisualRowIsRemoved)) { /* * rows were removed from above the viewport, so all we need * to do is to adjust the scroll position to account for the @@ -3066,8 +3092,8 @@ public class Escalator extends Widget implements RequiresResize, */ final int rowsToUpdateDataOn = numberOfRows - escalatorRowsToRemove; - final int start = Math.max(0, escalatorRowCount - - rowsToUpdateDataOn); + final int start = Math.max(0, + escalatorRowCount - rowsToUpdateDataOn); final int end = escalatorRowCount; for (int i = start; i < end; i++) { final TableRowElement tr = visualRowOrder.get(i); @@ -3080,17 +3106,17 @@ public class Escalator extends Widget implements RequiresResize, /* * Two things (or a combination thereof) can happen: - * + * * 1) We're scrolled to the bottom, the last rows are * removed. SOLUTION: moveAndUpdateEscalatorRows the * bottommost rows, and place them at the top to be * refreshed. - * + * * 2) We're scrolled somewhere in the middle, arbitrary rows * are removed. SOLUTION: moveAndUpdateEscalatorRows the * removed rows, and place them at the bottom to be * refreshed. - * + * * Since a combination can also happen, we need to handle * this in a smart way, all while avoiding * double-refreshing. @@ -3119,8 +3145,8 @@ public class Escalator extends Widget implements RequiresResize, */ double left = horizontalScrollbar.getScrollPos(); - double top = contentBottom - visualRowOrder.size() - * getDefaultRowHeight(); + double top = contentBottom + - visualRowOrder.size() * getDefaultRowHeight(); setBodyScrollPosition(left, top); Range allEscalatorRows = Range.withLength(0, @@ -3134,17 +3160,18 @@ public class Escalator extends Widget implements RequiresResize, * moveAndUpdateEscalatorRows recalculates the rows, but * logical top row index bookkeeping is handled in this * method. - * + * * TODO: Redesign how to keep it easy to track this. */ - updateTopRowLogicalIndex(-removedLogicalInside.length()); + updateTopRowLogicalIndex( + -removedLogicalInside.length()); /* * Scrolling the body to the correct location will be * fixed automatically. Because the amount of rows is * decreased, the viewport is pushed up as the scrollbar * shrinks. So no need to do anything there. - * + * * TODO [[optimize]]: This might lead to a double body * refresh. Needs investigation. */ @@ -3166,19 +3193,20 @@ public class Escalator extends Widget implements RequiresResize, paintRemoveRowsAtBottom(removedLogicalInside, removedVisualInside); - updateTopRowLogicalIndex(-removedLogicalInside.length()); + updateTopRowLogicalIndex( + -removedLogicalInside.length()); } else { /* * We're in a combination, where we need to both scroll * up AND show new rows at the bottom. - * + * * Example: Scrolled down to show the second to last * row. Remove two. Viewport scrolls up, revealing the * row above row. The last element collapses up and into * view. - * + * * Reminder: this use case handles only the case when * there are enough escalator rows to still render a * full view. I.e. all escalator rows will _always_ be @@ -3200,7 +3228,7 @@ public class Escalator extends Widget implements RequiresResize, /* * STEP 1: - * + * * reorganize deprecated escalator rows to bottom, but * don't re-render anything yet */ @@ -3219,17 +3247,18 @@ public class Escalator extends Widget implements RequiresResize, visualRowOrder.addLast(tr); } - for (int i = removedVisualInside.getStart(); i < escalatorRowCount; i++) { + for (int i = removedVisualInside + .getStart(); i < escalatorRowCount; i++) { final TableRowElement tr = visualRowOrder.get(i); setRowPosition(tr, 0, (int) newTop); newTop += getDefaultRowHeight(); - newTop += spacerContainer.getSpacerHeight(i - + removedLogicalInside.getStart()); + newTop += spacerContainer.getSpacerHeight( + i + removedLogicalInside.getStart()); } /* * STEP 2: - * + * * manually scroll */ /*- @@ -3254,14 +3283,14 @@ public class Escalator extends Widget implements RequiresResize, * automatically */ moveAndUpdateEscalatorRows( - Range.withOnly(escalatorRowCount - 1), - 0, - getLogicalRowIndex(visualRowOrder.getFirst()) - 1); + Range.withOnly(escalatorRowCount - 1), 0, + getLogicalRowIndex(visualRowOrder.getFirst()) + - 1); updateTopRowLogicalIndex(-1); /* * STEP 3: - * + * * update remaining escalator rows */ /*- @@ -3279,8 +3308,8 @@ public class Escalator extends Widget implements RequiresResize, - (removedVisualInside.length() - rowsScrolled); final Range visualRefreshRange = Range.between(start, escalatorRowCount); - final int logicalTargetIndex = getLogicalRowIndex(visualRowOrder - .getFirst()) + start; + final int logicalTargetIndex = getLogicalRowIndex( + visualRowOrder.getFirst()) + start; // in-place move simply re-renders the rows. moveAndUpdateEscalatorRows(visualRefreshRange, start, logicalTargetIndex); @@ -3312,10 +3341,9 @@ public class Escalator extends Widget implements RequiresResize, final int escalatorRowCount = visualRowOrder.size(); - final int logicalTargetIndex = getLogicalRowIndex(visualRowOrder - .getLast()) - - (removedVisualInside.length() - 1) - + logicalOffset; + final int logicalTargetIndex = getLogicalRowIndex( + visualRowOrder.getLast()) + - (removedVisualInside.length() - 1) + logicalOffset; moveAndUpdateEscalatorRows(removedVisualInside, escalatorRowCount, logicalTargetIndex); @@ -3323,15 +3351,15 @@ public class Escalator extends Widget implements RequiresResize, final ListIterator iterator = visualRowOrder .listIterator(removedVisualInside.getStart()); - double rowTop = getRowTop(removedLogicalInside.getStart() - + logicalOffset); + double rowTop = getRowTop( + removedLogicalInside.getStart() + logicalOffset); for (int i = removedVisualInside.getStart(); i < escalatorRowCount - removedVisualInside.length(); i++) { final TableRowElement tr = iterator.next(); setRowPosition(tr, 0, rowTop); rowTop += getDefaultRowHeight(); - rowTop += spacerContainer.getSpacerHeight(i - + removedLogicalInside.getStart()); + rowTop += spacerContainer + .getSpacerHeight(i + removedLogicalInside.getStart()); } } @@ -3345,8 +3373,8 @@ public class Escalator extends Widget implements RequiresResize, * |7| |7| */ - final int logicalTargetIndex = getLogicalRowIndex(visualRowOrder - .getFirst()) - removedVisualInside.length(); + final int logicalTargetIndex = getLogicalRowIndex( + visualRowOrder.getFirst()) - removedVisualInside.length(); moveAndUpdateEscalatorRows(removedVisualInside, 0, logicalTargetIndex); @@ -3361,14 +3389,15 @@ public class Escalator extends Widget implements RequiresResize, final TableRowElement tr = iterator.next(); setRowPosition(tr, 0, rowTop); rowTop += getDefaultRowHeight(); - rowTop += spacerContainer.getSpacerHeight(firstUpdatedIndex - + i++); + rowTop += spacerContainer + .getSpacerHeight(firstUpdatedIndex + i++); } } @Override protected int getLogicalRowIndex(final TableRowElement tr) { - assert tr.getParentNode() == root : "The given element isn't a row element in the body"; + assert tr + .getParentNode() == root : "The given element isn't a row element in the body"; int internalIndex = visualRowOrder.indexOf(tr); return getTopRowLogicalIndex() + internalIndex; } @@ -3396,7 +3425,7 @@ public class Escalator extends Widget implements RequiresResize, *

  • convertToVisual([35..1]) → [0..-1] (empty) *
  • convertToVisual([0..100]) → [0..9] * - * + * * @return a logical range converted to a visual range, truncated to the * current viewport. The first visual row has the index 0. */ @@ -3414,11 +3443,11 @@ public class Escalator extends Widget implements RequiresResize, * spacers. */ final int maxEscalatorRows = getMaxEscalatorRowCapacity(); - final int currentTopRowIndex = getLogicalRowIndex(visualRowOrder - .getFirst()); + final int currentTopRowIndex = getLogicalRowIndex( + visualRowOrder.getFirst()); - final Range[] partitions = logicalRange.partitionWith(Range - .withLength(currentTopRowIndex, maxEscalatorRows)); + final Range[] partitions = logicalRange.partitionWith( + Range.withLength(currentTopRowIndex, maxEscalatorRows)); final Range insideRange = partitions[1]; return insideRange.offsetBy(-currentTopRowIndex); } @@ -3445,10 +3474,11 @@ public class Escalator extends Widget implements RequiresResize, final Range visualRange = convertToVisual(logicalRowRange); if (!visualRange.isEmpty()) { - final int firstLogicalRowIndex = getLogicalRowIndex(visualRowOrder - .getFirst()); - for (int rowNumber = visualRange.getStart(); rowNumber < visualRange - .getEnd(); rowNumber++) { + final int firstLogicalRowIndex = getLogicalRowIndex( + visualRowOrder.getFirst()); + for (int rowNumber = visualRange + .getStart(); rowNumber < visualRange + .getEnd(); rowNumber++) { refreshRow(visualRowOrder.get(rowNumber), firstLogicalRowIndex + rowNumber, colRange); } @@ -3463,16 +3493,16 @@ public class Escalator extends Widget implements RequiresResize, if (index >= 0 && index < visualRowOrder.size()) { return visualRowOrder.get(index); } else { - throw new IndexOutOfBoundsException("No such visual index: " - + index); + throw new IndexOutOfBoundsException( + "No such visual index: " + index); } } @Override public TableRowElement getRowElement(int index) { if (index < 0 || index >= getRowCount()) { - throw new IndexOutOfBoundsException("No such logical index: " - + index); + throw new IndexOutOfBoundsException( + "No such logical index: " + index); } int visualIndex = index - getLogicalRowIndex(visualRowOrder.getFirst()); @@ -3508,14 +3538,14 @@ public class Escalator extends Widget implements RequiresResize, /* * This method indeed has a smell very similar to paintRemoveRows * and paintInsertRows. - * + * * Unfortunately, those the code can't trivially be shared, since * there are some slight differences in the respective * responsibilities. The "paint" methods fake the addition and * removal of rows, and make sure to either push existing data out * of view, or draw new data into view. Only in some special cases * will the DOM element count change. - * + * * This method, however, has the explicit responsibility to verify * that when "something" happens, we still have the correct amount * of escalator rows in the DOM, and if not, we make sure to modify @@ -3547,8 +3577,8 @@ public class Escalator extends Widget implements RequiresResize, final int index = visualRowOrder.size(); final int nextLastLogicalIndex; if (!visualRowOrder.isEmpty()) { - nextLastLogicalIndex = getLogicalRowIndex(visualRowOrder - .getLast()) + 1; + nextLastLogicalIndex = getLogicalRowIndex( + visualRowOrder.getLast()) + 1; } else { nextLastLogicalIndex = 0; } @@ -3565,7 +3595,7 @@ public class Escalator extends Widget implements RequiresResize, * index, we thank for the added escalator rows, but since * they're painted in the wrong CSS position, we need to * move them to their actual locations. - * + * * Note: this is the second (see body.paintInsertRows) * occasion where fillAndPopulateEscalatorRowsIfNeeded would * behave "more correctly" if it only would add escalator @@ -3578,17 +3608,17 @@ public class Escalator extends Widget implements RequiresResize, } else { /* * TODO [[optimize]] - * + * * We're scrolled so far down that all rows can't be simply * appended at the end, since we might start displaying * escalator rows that don't exist. To avoid the mess that * is body.paintRemoveRows, this is a dirty hack that dumbs * the problem down to a more basic and already-solved * problem: - * + * * 1) scroll all the way up 2) add the missing escalator * rows 3) scroll back to the original position. - * + * * Letting the browser scroll back to our original position * will automatically solve any possible overflow problems, * since the browser will not allow us to scroll beyond the @@ -3621,7 +3651,7 @@ public class Escalator extends Widget implements RequiresResize, * extra escalator row at the bottom, we'll probably end up with * blank space at the bottom of the escalator, and one extra row * above the header. - * + * * Experimentation idea #1: calculate "scrollbottom" vs content * bottom and remove one row from top, rest from bottom. This * FAILED, since setHeight has already happened, thus we never @@ -3630,13 +3660,13 @@ public class Escalator extends Widget implements RequiresResize, */ if (!visualRowOrder.isEmpty()) { - final double firstRowTop = getRowTop(visualRowOrder - .getFirst()); + final double firstRowTop = getRowTop( + visualRowOrder.getFirst()); final double firstRowMinTop = tBodyScrollTop - getDefaultRowHeight(); if (firstRowTop < firstRowMinTop) { - final int newLogicalIndex = getLogicalRowIndex(visualRowOrder - .getLast()) + 1; + final int newLogicalIndex = getLogicalRowIndex( + visualRowOrder.getLast()) + 1; moveAndUpdateEscalatorRows(Range.withOnly(0), visualRowOrder.size(), newLogicalIndex); } @@ -3656,7 +3686,8 @@ public class Escalator extends Widget implements RequiresResize, return; } - Profiler.enter("Escalator.BodyRowContainer.reapplyDefaultRowHeights"); + Profiler.enter( + "Escalator.BodyRowContainer.reapplyDefaultRowHeights"); /* step 1: resize and reposition rows */ for (int i = 0; i < visualRowOrder.size(); i++) { @@ -3686,18 +3717,22 @@ public class Escalator extends Widget implements RequiresResize, verticalScrollbar.getScrollPos()); scroller.onScroll(); - /* step 3: make sure we have the correct amount of escalator rows. */ + /* + * step 3: make sure we have the correct amount of escalator rows. + */ verifyEscalatorCount(); - int logicalLogical = (int) (getRowTop(visualRowOrder.getFirst()) / getDefaultRowHeight()); + int logicalLogical = (int) (getRowTop(visualRowOrder.getFirst()) + / getDefaultRowHeight()); setTopRowLogicalIndex(logicalLogical); - Profiler.leave("Escalator.BodyRowContainer.reapplyDefaultRowHeights"); + Profiler.leave( + "Escalator.BodyRowContainer.reapplyDefaultRowHeights"); } /** * Sorts the rows in the DOM to correspond to the visual order. - * + * * @see #visualRowOrder */ private void sortDomElements() { @@ -3712,20 +3747,22 @@ public class Escalator extends Widget implements RequiresResize, final TableRowElement focusedRow = getRowWithFocus(); if (focusedRow != null) { - assert focusedRow.getParentElement() == root : "Trying to sort around a row that doesn't exist in body"; + assert focusedRow + .getParentElement() == root : "Trying to sort around a row that doesn't exist in body"; assert visualRowOrder.contains(focusedRow) - || body.spacerContainer.isSpacer(focusedRow) : "Trying to sort around a row that doesn't exist in visualRowOrder or is not a spacer."; + || body.spacerContainer.isSpacer( + focusedRow) : "Trying to sort around a row that doesn't exist in visualRowOrder or is not a spacer."; } /* * Two cases handled simultaneously: - * + * * 1) No focus on rows. We iterate visualRowOrder backwards, and * take the respective element in the DOM, and place it as the first * child in the body element. Then we take the next-to-last from * visualRowOrder, and put that first, pushing the previous row as * the second child. And so on... - * + * * 2) Focus on some row within Escalator body. Again, we iterate * visualRowOrder backwards. This time, we use the focused row as a * pivot: Instead of placing rows from the bottom of visualRowOrder @@ -3745,8 +3782,8 @@ public class Escalator extends Widget implements RequiresResize, * viewport, but its parent row is still not shown */ for (int i = -1; i < visualRowOrder.size(); i++) { - SpacerContainer.SpacerImpl spacer = spacers.remove(Integer - .valueOf(getTopRowLogicalIndex() + i)); + SpacerContainer.SpacerImpl spacer = spacers + .remove(Integer.valueOf(getTopRowLogicalIndex() + i)); if (spacer != null) { orderedBodyRows.add(i + 1, spacer.getRootElement()); @@ -3789,7 +3826,7 @@ public class Escalator extends Widget implements RequiresResize, /** * Get the {@literal } row that contains (or has) focus. - * + * * @return The {@literal } row that contains a focused DOM * element, or null if focus is outside of a body * row. @@ -3855,7 +3892,7 @@ public class Escalator extends Widget implements RequiresResize, * A correct result requires that both {@link #getDefaultRowHeight()} is * consistent, and the placement and height of all spacers above the * given logical index are consistent. - * + * * @param logicalIndex * the logical index of the row for which to calculate the * top position @@ -3887,10 +3924,11 @@ public class Escalator extends Widget implements RequiresResize, } else if (noRowsAreInView) { return Collections.emptyList(); } else { - int fromIndex = (logicalRow - visibleRowLogicalRange.getStart()) + 1; + int fromIndex = (logicalRow - visibleRowLogicalRange.getStart()) + + 1; int toIndex = visibleRowLogicalRange.length(); - List sublist = visualRowOrder.subList( - fromIndex, toIndex); + List sublist = visualRowOrder + .subList(fromIndex, toIndex); return Collections.unmodifiableList(sublist); } } @@ -3948,7 +3986,7 @@ public class Escalator extends Widget implements RequiresResize, /** * Returns the actual width in the DOM. - * + * * @return the width in pixels in the DOM. Returns -1 if the column * needs measuring, but has not been yet measured */ @@ -3957,7 +3995,7 @@ public class Escalator extends Widget implements RequiresResize, * This might return an untrue value (e.g. during init/onload), * since we haven't had a proper chance to actually calculate * widths yet. - * + * * This is fixed during Escalator.onLoad, by the call to * "measureAndSetWidthIfNeeded", which fixes "everything". */ @@ -3999,7 +4037,7 @@ public class Escalator extends Widget implements RequiresResize, */ /** * A cached array of all the calculated column widths. - * + * * @see #getCalculatedColumnWidths() */ private double[] widthsArray = null; @@ -4010,7 +4048,7 @@ public class Escalator extends Widget implements RequiresResize, * Implementation detail: This method does no DOM modifications * (i.e. is very cheap to call) if there are no rows in the DOM when * this method is called. - * + * * @see #hasSomethingInDom() */ @Override @@ -4065,7 +4103,7 @@ public class Escalator extends Widget implements RequiresResize, * reveal further colspans, modifying the DOM structure once again, * ending in a cascade of updates. Because we don't know how the * data is updated. - * + * * So, instead, we don't do anything. The client code is responsible * for re-rendering the content (if so desired). Everything Just * Works (TM) if colspans aren't used. @@ -4078,16 +4116,17 @@ public class Escalator extends Widget implements RequiresResize, } } - private void removeColumnsAdjustScrollbar(int index, int numberOfColumns) { + private void removeColumnsAdjustScrollbar(int index, + int numberOfColumns) { if (horizontalScrollbar.getOffsetSize() >= horizontalScrollbar .getScrollSize()) { return; } - double leftPosOfFirstColumnToRemove = getCalculatedColumnsWidth(Range - .between(0, index)); - double widthOfColumnsToRemove = getCalculatedColumnsWidth(Range - .withLength(index, numberOfColumns)); + double leftPosOfFirstColumnToRemove = getCalculatedColumnsWidth( + Range.between(0, index)); + double widthOfColumnsToRemove = getCalculatedColumnsWidth( + Range.withLength(index, numberOfColumns)); double scrollLeft = horizontalScrollbar.getScrollPos(); @@ -4106,11 +4145,12 @@ public class Escalator extends Widget implements RequiresResize, /** * Calculate the width of a row, as the sum of columns' widths. - * + * * @return the width of a row, in pixels */ public double calculateRowWidth() { - return getCalculatedColumnsWidth(Range.between(0, getColumnCount())); + return getCalculatedColumnsWidth( + Range.between(0, getColumnCount())); } private void assertArgumentsAreValidAndWithinRange(final int index, @@ -4136,7 +4176,7 @@ public class Escalator extends Widget implements RequiresResize, * Implementation detail: This method does no DOM modifications * (i.e. is very cheap to call) if there is no data for rows when this * method is called. - * + * * @see #hasColumnAndRowData() */ @Override @@ -4172,11 +4212,11 @@ public class Escalator extends Widget implements RequiresResize, footer.paintInsertColumns(index, numberOfColumns, frozen); // this needs to be before the scrollbar adjustment. - boolean scrollbarWasNeeded = horizontalScrollbar.getOffsetSize() < horizontalScrollbar - .getScrollSize(); + boolean scrollbarWasNeeded = horizontalScrollbar + .getOffsetSize() < horizontalScrollbar.getScrollSize(); scroller.recalculateScrollbarsForVirtualViewport(); - boolean scrollbarIsNowNeeded = horizontalScrollbar.getOffsetSize() < horizontalScrollbar - .getScrollSize(); + boolean scrollbarIsNowNeeded = horizontalScrollbar + .getOffsetSize() < horizontalScrollbar.getScrollSize(); if (!scrollbarWasNeeded && scrollbarIsNowNeeded) { // This might as a side effect move rows around (when scrolled // all the way down) and require the DOM to be up to date, i.e. @@ -4204,10 +4244,10 @@ public class Escalator extends Widget implements RequiresResize, if (columnsWereAddedToTheLeftOfViewport) { double insertedColumnsWidth = columnConfiguration - .getCalculatedColumnsWidth(Range.withLength(index, - numberOfColumns)); - horizontalScrollbar.setScrollPos(scroller.lastScrollLeft - + insertedColumnsWidth); + .getCalculatedColumnsWidth( + Range.withLength(index, numberOfColumns)); + horizontalScrollbar.setScrollPos( + scroller.lastScrollLeft + insertedColumnsWidth); } /* @@ -4216,7 +4256,7 @@ public class Escalator extends Widget implements RequiresResize, * affect surrounding colspans, modifying the DOM structure once * again, ending in a cascade of updates. Because we don't know how * the data is updated. - * + * * So, instead, we don't do anything. The client code is responsible * for re-rendering the content (if so desired). Everything Just * Works (TM) if colspans aren't used. @@ -4332,7 +4372,8 @@ public class Escalator extends Widget implements RequiresResize, } @Override - public double getColumnWidth(int index) throws IllegalArgumentException { + public double getColumnWidth(int index) + throws IllegalArgumentException { checkValidColumnIndex(index); return columns.get(index).getDefinedWidth(); } @@ -4368,7 +4409,7 @@ public class Escalator extends Widget implements RequiresResize, /** * Calculates the width of the columns in a given range. - * + * * @param columns * the columns to calculate * @return the total width of the columns in the given @@ -4379,11 +4420,11 @@ public class Escalator extends Widget implements RequiresResize, * This is an assert instead of an exception, since this is an * internal method. */ - assert columns.isSubsetOf(Range.between(0, getColumnCount())) : "Range " - + "was outside of current column range (i.e.: " - + Range.between(0, getColumnCount()) - + ", but was given :" - + columns; + assert columns + .isSubsetOf(Range.between(0, getColumnCount())) : "Range " + + "was outside of current column range (i.e.: " + + Range.between(0, getColumnCount()) + + ", but was given :" + columns; double sum = 0; for (int i = columns.getStart(); i < columns.getEnd(); i++) { @@ -4413,11 +4454,11 @@ public class Escalator extends Widget implements RequiresResize, } if (index < 0 || index + numberOfColumns > getColumnCount()) { - throw new IndexOutOfBoundsException("The given " - + "column range (" + index + ".." - + (index + numberOfColumns) - + ") was outside of the current number of columns (" - + getColumnCount() + ")"); + throw new IndexOutOfBoundsException( + "The given " + "column range (" + index + ".." + + (index + numberOfColumns) + + ") was outside of the current number of columns (" + + getColumnCount() + ")"); } header.refreshColumns(index, numberOfColumns); @@ -4475,14 +4516,15 @@ public class Escalator extends Widget implements RequiresResize, public void setupDom(double height) { assert !domHasBeenSetup : "DOM can't be set up twice."; - assert RootPanel.get().getElement().isOrHasChild(root) : "Root element should've been attached to the DOM by now."; + assert RootPanel.get().getElement().isOrHasChild( + root) : "Root element should've been attached to the DOM by now."; domHasBeenSetup = true; getRootElement().getStyle().setWidth(getInnerWidth(), Unit.PX); setHeight(height); - spacerElement.setColSpan(getColumnConfiguration() - .getColumnCount()); + spacerElement + .setColSpan(getColumnConfiguration().getColumnCount()); setStylePrimaryName(getStylePrimaryName()); } @@ -4498,8 +4540,8 @@ public class Escalator extends Widget implements RequiresResize, public void setPosition(double x, double y) { positions.set(getRootElement(), x, y); - positions - .set(getDecoElement(), 0, y - getSpacerDecoTopOffset()); + positions.set(getDecoElement(), 0, + y - getSpacerDecoTopOffset()); } private double getSpacerDecoTopOffset() { @@ -4526,8 +4568,9 @@ public class Escalator extends Widget implements RequiresResize, // amount of the border thickness if (defaultCellBorderBottomSize < 0) { defaultCellBorderBottomSize = WidgetUtil - .getBorderBottomThickness(body.getRowElement( - getVisibleRowRange().getStart()) + .getBorderBottomThickness(body + .getRowElement( + getVisibleRowRange().getStart()) .getFirstChildElement()); } root.getStyle().setHeight(height + defaultCellBorderBottomSize, @@ -4543,8 +4586,8 @@ public class Escalator extends Widget implements RequiresResize, */ boolean spacerIsGrowing = heightDiff > 0; if (spacerIsGrowing) { - verticalScrollbar.setScrollSize(verticalScrollbar - .getScrollSize() + heightDiff); + verticalScrollbar.setScrollSize( + verticalScrollbar.getScrollSize() + heightDiff); } /* @@ -4561,7 +4604,7 @@ public class Escalator extends Widget implements RequiresResize, /* * We can't use adjustScrollPos here, probably because of a * bookkeeping-related race condition. - * + * * This particular situation is easier, however, since we * know exactly how many pixels we need to move (heightDiff) * and all elements below the spacer always need to move @@ -4569,8 +4612,8 @@ public class Escalator extends Widget implements RequiresResize, */ for (TableRowElement row : body.visualRowOrder) { - body.setRowPosition(row, 0, body.getRowTop(row) - + heightDiff); + body.setRowPosition(row, 0, + body.getRowTop(row) + heightDiff); } double top = getTop(); @@ -4587,7 +4630,7 @@ public class Escalator extends Widget implements RequiresResize, * If the scroll top is in the middle of the modified * spacer, we want to scroll the viewport up as usual, * but we don't want to scroll past the top of it. - * + * * Math.max ensures this (remember: the result is going * to be negative). */ @@ -4596,8 +4639,8 @@ public class Escalator extends Widget implements RequiresResize, } else { moveDiff = heightDiff; } - body.setBodyScrollPosition(tBodyScrollLeft, tBodyScrollTop - + moveDiff); + body.setBodyScrollPosition(tBodyScrollLeft, + tBodyScrollTop + moveDiff); verticalScrollbar.setScrollPosByDelta(moveDiff); } else { @@ -4605,8 +4648,8 @@ public class Escalator extends Widget implements RequiresResize, } if (!spacerIsGrowing) { - verticalScrollbar.setScrollSize(verticalScrollbar - .getScrollSize() + heightDiff); + verticalScrollbar.setScrollSize( + verticalScrollbar.getScrollSize() + heightDiff); } updateDecoratorGeometry(height); @@ -4687,7 +4730,7 @@ public class Escalator extends Widget implements RequiresResize, /** * Crop the decorator element so that it doesn't overlap the header * and footer sections. - * + * * @param bodyTop * the top cordinate of the escalator body * @param bodyBottom @@ -4701,7 +4744,7 @@ public class Escalator extends Widget implements RequiresResize, final int bottom = deco.getAbsoluteBottom(); /* * FIXME - * + * * Height and its use is a workaround for the issue where * coordinates of the deco are not calculated yet. This will * prevent a deco from being displayed when it's added to DOM @@ -4795,8 +4838,8 @@ public class Escalator extends Widget implements RequiresResize, || padding != 0 : "destination/padding check should be done before this method"; if (!rowIndexToSpacer.containsKey(spacerIndex)) { - throw new IllegalArgumentException("No spacer open at index " - + spacerIndex); + throw new IllegalArgumentException( + "No spacer open at index " + spacerIndex); } SpacerImpl spacer = rowIndexToSpacer.get(spacerIndex); @@ -4830,9 +4873,9 @@ public class Escalator extends Widget implements RequiresResize, @SuppressWarnings("boxing") public void removeSpacers(Range removedRange) { - Map removedSpacers = rowIndexToSpacer - .subMap(removedRange.getStart(), true, - removedRange.getEnd(), false); + Map removedSpacers = rowIndexToSpacer.subMap( + removedRange.getStart(), true, removedRange.getEnd(), + false); if (removedSpacers.isEmpty()) { return; @@ -4866,7 +4909,7 @@ public class Escalator extends Widget implements RequiresResize, /** * Calculates the sum of all spacers. - * + * * @return sum of all spacers, or 0 if no spacers present */ public double getSpacerHeightsSum() { @@ -4875,7 +4918,7 @@ public class Escalator extends Widget implements RequiresResize, /** * Calculates the sum of all spacers from one row index onwards. - * + * * @param logicalRowIndex * the spacer to include as the first calculated spacer * @return the sum of all spacers from {@code logicalRowIndex} and @@ -4884,14 +4927,14 @@ public class Escalator extends Widget implements RequiresResize, @SuppressWarnings("boxing") public Collection getSpacersForRowAndAfter( int logicalRowIndex) { - return new ArrayList(rowIndexToSpacer.tailMap( - logicalRowIndex, true).values()); + return new ArrayList( + rowIndexToSpacer.tailMap(logicalRowIndex, true).values()); } /** * Get all spacers from one pixel point onwards. *

    - * + * * In this method, the {@link SpacerInclusionStrategy} has the following * meaning when a spacer lies in the middle of either pixel argument: *

    @@ -4902,7 +4945,7 @@ public class Escalator extends Widget implements RequiresResize, *
    {@link SpacerInclusionStrategy#NONE NONE} *
    ignore the spacer *
    - * + * * @param px * the pixel point after which to return all spacers * @param strategy @@ -4937,7 +4980,7 @@ public class Escalator extends Widget implements RequiresResize, /** * Gets the spacers currently rendered in the DOM. - * + * * @return an unmodifiable (but live) collection of the spacers * currently in the DOM */ @@ -4960,7 +5003,7 @@ public class Escalator extends Widget implements RequiresResize, *
    {@link SpacerInclusionStrategy#NONE NONE} *
    ignore that spacer * - * + * * @param rangeTop * the top pixel point * @param topInclusion @@ -5007,7 +5050,8 @@ public class Escalator extends Widget implements RequiresResize, && bottom <= rangeBottom; boolean bottomIsBelowRange = rangeBottom < bottom; - assert topIsAboveRange ^ topIsBelowRange ^ topIsInRange : "Bad top logic"; + assert topIsAboveRange ^ topIsBelowRange + ^ topIsInRange : "Bad top logic"; assert bottomIsAboveRange ^ bottomIsBelowRange ^ bottomIsInRange : "Bad bottom logic"; @@ -5079,7 +5123,7 @@ public class Escalator extends Widget implements RequiresResize, /** * Gets the amount of pixels occupied by spacers from the top until a * certain spot from the top of the body. - * + * * @param px * pixels counted from the top * @return the pixels occupied by spacers up until {@code px} @@ -5093,15 +5137,15 @@ public class Escalator extends Widget implements RequiresResize, /** * Gets the amount of pixels occupied by spacers until a logical row * index. - * + * * @param logicalIndex * a logical row index * @return the pixels occupied by spacers up until {@code logicalIndex} */ @SuppressWarnings("boxing") public double getSpacerHeightsSumUntilIndex(int logicalIndex) { - return getHeights(rowIndexToSpacer.headMap(logicalIndex, false) - .values()); + return getHeights( + rowIndexToSpacer.headMap(logicalIndex, false).values()); } private double getHeights(Collection spacers) { @@ -5114,7 +5158,7 @@ public class Escalator extends Widget implements RequiresResize, /** * Gets the height of the spacer for a row index. - * + * * @param rowIndex * the index of the row where the spacer should be * @return the height of the spacer at index {@code rowIndex}, or 0 if @@ -5148,8 +5192,8 @@ public class Escalator extends Widget implements RequiresResize, calculateSpacerTop(rowIndex)); TableRowElement spacerRoot = spacer.getRootElement(); - spacerRoot.getStyle().setWidth( - columnConfiguration.calculateRowWidth(), Unit.PX); + spacerRoot.getStyle() + .setWidth(columnConfiguration.calculateRowWidth(), Unit.PX); body.getElement().appendChild(spacerRoot); spacer.setupDom(height); // set the deco position, requires that spacer is in the DOM @@ -5161,8 +5205,8 @@ public class Escalator extends Widget implements RequiresResize, getElement().appendChild(spacerDecoContainer); // calculate the spacer deco width, it won't change spacerDecoWidth = WidgetUtil - .getRequiredWidthBoundingClientRectDouble(spacer - .getDecoElement()); + .getRequiredWidthBoundingClientRectDouble( + spacer.getDecoElement()); } initSpacerContent(spacer); @@ -5211,11 +5255,15 @@ public class Escalator extends Widget implements RequiresResize, } private void destroySpacerContent(SpacerImpl spacer) { - assert getElement().isOrHasChild(spacer.getRootElement()) : "Spacer's root element somehow got detached from Escalator before detaching"; - assert getElement().isOrHasChild(spacer.getElement()) : "Spacer element somehow got detached from Escalator before detaching"; + assert getElement().isOrHasChild(spacer + .getRootElement()) : "Spacer's root element somehow got detached from Escalator before detaching"; + assert getElement().isOrHasChild(spacer + .getElement()) : "Spacer element somehow got detached from Escalator before detaching"; spacerUpdater.destroy(spacer); - assert getElement().isOrHasChild(spacer.getRootElement()) : "Spacer's root element somehow got detached from Escalator before detaching"; - assert getElement().isOrHasChild(spacer.getElement()) : "Spacer element somehow got detached from Escalator before detaching"; + assert getElement().isOrHasChild(spacer + .getRootElement()) : "Spacer's root element somehow got detached from Escalator before detaching"; + assert getElement().isOrHasChild(spacer + .getElement()) : "Spacer element somehow got detached from Escalator before detaching"; } private void initSpacerContent(Iterable spacers) { @@ -5225,11 +5273,15 @@ public class Escalator extends Widget implements RequiresResize, } private void initSpacerContent(SpacerImpl spacer) { - assert getElement().isOrHasChild(spacer.getRootElement()) : "Spacer's root element somehow got detached from Escalator before attaching"; - assert getElement().isOrHasChild(spacer.getElement()) : "Spacer element somehow got detached from Escalator before attaching"; + assert getElement().isOrHasChild(spacer + .getRootElement()) : "Spacer's root element somehow got detached from Escalator before attaching"; + assert getElement().isOrHasChild(spacer + .getElement()) : "Spacer element somehow got detached from Escalator before attaching"; spacerUpdater.init(spacer); - assert getElement().isOrHasChild(spacer.getRootElement()) : "Spacer's root element somehow got detached from Escalator during attaching"; - assert getElement().isOrHasChild(spacer.getElement()) : "Spacer element somehow got detached from Escalator during attaching"; + assert getElement().isOrHasChild(spacer + .getRootElement()) : "Spacer's root element somehow got detached from Escalator during attaching"; + assert getElement().isOrHasChild(spacer + .getElement()) : "Spacer element somehow got detached from Escalator during attaching"; spacer.updateVisibility(); } @@ -5259,8 +5311,8 @@ public class Escalator extends Widget implements RequiresResize, @SuppressWarnings("boxing") private void shiftSpacerPositionsAfterRow(int changedRowIndex, double diffPx) { - for (SpacerImpl spacer : rowIndexToSpacer.tailMap(changedRowIndex, - false).values()) { + for (SpacerImpl spacer : rowIndexToSpacer + .tailMap(changedRowIndex, false).values()) { spacer.setPositionDiff(0, diffPx); } } @@ -5273,7 +5325,7 @@ public class Escalator extends Widget implements RequiresResize, *

    * Note: This method does not check for the validity of any * arguments. - * + * * @param index * the index of first row to move * @param numberOfRows @@ -5282,7 +5334,8 @@ public class Escalator extends Widget implements RequiresResize, */ public void shiftSpacersByRows(int index, int numberOfRows) { final double pxDiff = numberOfRows * body.getDefaultRowHeight(); - for (SpacerContainer.SpacerImpl spacer : getSpacersForRowAndAfter(index)) { + for (SpacerContainer.SpacerImpl spacer : getSpacersForRowAndAfter( + index)) { spacer.setPositionDiff(0, pxDiff); spacer.setRowIndex(spacer.getRow() + numberOfRows); } @@ -5290,9 +5343,10 @@ public class Escalator extends Widget implements RequiresResize, private void updateSpacerDecosVisibility() { final Range visibleRowRange = getVisibleRowRange(); - Collection visibleSpacers = rowIndexToSpacer.subMap( - visibleRowRange.getStart() - 1, - visibleRowRange.getEnd() + 1).values(); + Collection visibleSpacers = rowIndexToSpacer + .subMap(visibleRowRange.getStart() - 1, + visibleRowRange.getEnd() + 1) + .values(); if (!visibleSpacers.isEmpty()) { final double top = tableWrapper.getAbsoluteTop() + header.getHeightOfSection(); @@ -5346,7 +5400,7 @@ public class Escalator extends Widget implements RequiresResize, /** * Utility class for parsing and storing SubPart request string attributes * for Grid and Escalator. - * + * * @since 7.5.0 */ public static class SubPartArguments { @@ -5386,8 +5440,8 @@ public class Escalator extends Widget implements RequiresResize, int[] indices = new int[splitArgs.length - 1]; for (int i = 0; i < indices.length; ++i) { String tmp = splitArgs[i + 1]; - indices[i] = Integer.parseInt(tmp.substring(0, - tmp.indexOf("]", 1))); + indices[i] = Integer + .parseInt(tmp.substring(0, tmp.indexOf("]", 1))); } return new SubPartArguments(type, indices); } @@ -5421,19 +5475,19 @@ public class Escalator extends Widget implements RequiresResize, private FlyweightRow flyweightRow = new FlyweightRow(); /** The {@code } tag. */ - private final TableSectionElement headElem = TableSectionElement.as(DOM - .createTHead()); + private final TableSectionElement headElem = TableSectionElement + .as(DOM.createTHead()); /** The {@code } tag. */ - private final TableSectionElement bodyElem = TableSectionElement.as(DOM - .createTBody()); + private final TableSectionElement bodyElem = TableSectionElement + .as(DOM.createTBody()); /** The {@code } tag. */ - private final TableSectionElement footElem = TableSectionElement.as(DOM - .createTFoot()); + private final TableSectionElement footElem = TableSectionElement + .as(DOM.createTFoot()); /** * TODO: investigate whether this field is now unnecessary, as * {@link ScrollbarBundle} now caches its values. - * + * * @deprecated maybe... */ @Deprecated @@ -5442,7 +5496,7 @@ public class Escalator extends Widget implements RequiresResize, /** * TODO: investigate whether this field is now unnecessary, as * {@link ScrollbarBundle} now caches its values. - * + * * @deprecated maybe... */ @Deprecated @@ -5452,7 +5506,8 @@ public class Escalator extends Widget implements RequiresResize, private final HorizontalScrollbarBundle horizontalScrollbar = new HorizontalScrollbarBundle(); private final HeaderRowContainer header = new HeaderRowContainer(headElem); - private final BodyRowContainerImpl body = new BodyRowContainerImpl(bodyElem); + private final BodyRowContainerImpl body = new BodyRowContainerImpl( + bodyElem); private final FooterRowContainer footer = new FooterRowContainer(footElem); /** @@ -5465,12 +5520,12 @@ public class Escalator extends Widget implements RequiresResize, private final ColumnConfigurationImpl columnConfiguration = new ColumnConfigurationImpl(); private final DivElement tableWrapper; - private final DivElement horizontalScrollbarDeco = DivElement.as(DOM - .createDiv()); + private final DivElement horizontalScrollbarDeco = DivElement + .as(DOM.createDiv()); private final DivElement headerDeco = DivElement.as(DOM.createDiv()); private final DivElement footerDeco = DivElement.as(DOM.createDiv()); - private final DivElement spacerDecoContainer = DivElement.as(DOM - .createDiv()); + private final DivElement spacerDecoContainer = DivElement + .as(DOM.createDiv()); private PositionFunction position; @@ -5504,9 +5559,8 @@ public class Escalator extends Widget implements RequiresResize, public Escalator() { detectAndApplyPositionFunction(); - getLogger().info( - "Using " + position.getClass().getSimpleName() - + " for position"); + getLogger().info("Using " + position.getClass().getSimpleName() + + " for position"); final Element root = DOM.createDiv(); setElement(root); @@ -5587,8 +5641,8 @@ public class Escalator extends Widget implements RequiresResize, * http://edskes.net/ie/ie8overflowandexpandingboxbugs.htm */ Style vScrollStyle = verticalScrollbar.getElement().getStyle(); - vScrollStyle.setRight( - verticalScrollbar.getScrollbarThickness() - 1, Unit.PX); + vScrollStyle.setRight(verticalScrollbar.getScrollbarThickness() - 1, + Unit.PX); } root.appendChild(horizontalScrollbar.getElement()); @@ -5625,7 +5679,7 @@ public class Escalator extends Widget implements RequiresResize, /* * Because of all the IE hacks we've done above, we now have scrollbars * hiding underneath a lot of DOM elements. - * + * * This leads to problems with OSX (and many touch-only devices) when * scrollbars are only shown when scrolling, as the scrollbar elements * are hidden underneath everything. We trust that the scrollbars behave @@ -5660,7 +5714,7 @@ public class Escalator extends Widget implements RequiresResize, * after it is first detached and then reattached to the DOM. * This only applies to a bare Escalator; inside a Grid * everything works fine either way. - * + * * The three autodetectRowHeightLater calls above seem obvious * suspects at first. However, they don't seem to have anything * to do with the issue, as they are no-ops in the @@ -5672,13 +5726,13 @@ public class Escalator extends Widget implements RequiresResize, /* * Note: There's no need to explicitly insert rows into the body. - * + * * recalculateElementSizes will recalculate the height of the body. This * has the side-effect that as the body's size grows bigger (i.e. from 0 * to its actual height), more escalator rows are populated. Those * escalator rows are then immediately rendered. This, in effect, is the * same thing as inserting those rows. - * + * * In fact, having an extra paintInsertRows here would lead to duplicate * rows. */ @@ -5774,18 +5828,19 @@ public class Escalator extends Widget implements RequiresResize, /** * Check whether there are both columns and any row data (for either * headers, body or footer). - * + * * @return true iff header, body or footer has rows && there * are columns */ private boolean hasColumnAndRowData() { - return (header.getRowCount() > 0 || body.getRowCount() > 0 || footer - .getRowCount() > 0) && columnConfiguration.getColumnCount() > 0; + return (header.getRowCount() > 0 || body.getRowCount() > 0 + || footer.getRowCount() > 0) + && columnConfiguration.getColumnCount() > 0; } /** * Check whether there are any cells in the DOM. - * + * * @return true iff header, body or footer has any child * elements */ @@ -5796,7 +5851,7 @@ public class Escalator extends Widget implements RequiresResize, /** * Returns the row container for the header in this Escalator. - * + * * @return the header. Never null */ public RowContainer getHeader() { @@ -5805,7 +5860,7 @@ public class Escalator extends Widget implements RequiresResize, /** * Returns the row container for the body in this Escalator. - * + * * @return the body. Never null */ public BodyRowContainer getBody() { @@ -5814,7 +5869,7 @@ public class Escalator extends Widget implements RequiresResize, /** * Returns the row container for the footer in this Escalator. - * + * * @return the footer. Never null */ public RowContainer getFooter() { @@ -5823,7 +5878,7 @@ public class Escalator extends Widget implements RequiresResize, /** * Returns the configuration object for the columns in this Escalator. - * + * * @return the configuration object for the columns in this Escalator. Never * null */ @@ -5847,7 +5902,7 @@ public class Escalator extends Widget implements RequiresResize, *

    * If Escalator is currently not in {@link HeightMode#CSS}, the given value * is remembered, and applied once the mode is applied. - * + * * @see #setHeightMode(HeightMode) */ @Override @@ -5902,7 +5957,7 @@ public class Escalator extends Widget implements RequiresResize, /** * Returns the vertical scroll offset. Note that this is not necessarily the * same as the {@code scrollTop} attribute in the DOM. - * + * * @return the logical vertical scroll offset */ public double getScrollTop() { @@ -5912,7 +5967,7 @@ public class Escalator extends Widget implements RequiresResize, /** * Sets the vertical scroll offset. Note that this will not necessarily * become the same as the {@code scrollTop} attribute in the DOM. - * + * * @param scrollTop * the number of pixels to scroll vertically */ @@ -5923,7 +5978,7 @@ public class Escalator extends Widget implements RequiresResize, /** * Returns the logical horizontal scroll offset. Note that this is not * necessarily the same as the {@code scrollLeft} attribute in the DOM. - * + * * @return the logical horizontal scroll offset */ public double getScrollLeft() { @@ -5933,7 +5988,7 @@ public class Escalator extends Widget implements RequiresResize, /** * Sets the logical horizontal scroll offset. Note that will not necessarily * become the same as the {@code scrollLeft} attribute in the DOM. - * + * * @param scrollLeft * the number of pixels to scroll horizontally */ @@ -5944,7 +5999,7 @@ public class Escalator extends Widget implements RequiresResize, /** * Returns the scroll width for the escalator. Note that this is not * necessary the same as {@code Element.scrollWidth} in the DOM. - * + * * @since 7.5.0 * @return the scroll width in pixels */ @@ -5955,7 +6010,7 @@ public class Escalator extends Widget implements RequiresResize, /** * Returns the scroll height for the escalator. Note that this is not * necessary the same as {@code Element.scrollHeight} in the DOM. - * + * * @since 7.5.0 * @return the scroll height in pixels */ @@ -5967,7 +6022,7 @@ public class Escalator extends Widget implements RequiresResize, * Scrolls the body horizontally so that the column at the given index is * visible and there is at least {@code padding} pixels in the direction of * the given scroll destination. - * + * * @param columnIndex * the index of the column to scroll to * @param destination @@ -5990,8 +6045,8 @@ public class Escalator extends Widget implements RequiresResize, verifyValidColumnIndex(columnIndex); if (columnIndex < columnConfiguration.frozenColumns) { - throw new IllegalArgumentException("The given column index " - + columnIndex + " is frozen."); + throw new IllegalArgumentException( + "The given column index " + columnIndex + " is frozen."); } scroller.scrollToColumn(columnIndex, destination, padding); @@ -6010,7 +6065,7 @@ public class Escalator extends Widget implements RequiresResize, * Scrolls the body vertically so that the row at the given index is visible * and there is at least {@literal padding} pixels to the given scroll * destination. - * + * * @param rowIndex * the index of the logical row to scroll to * @param destination @@ -6041,8 +6096,8 @@ public class Escalator extends Widget implements RequiresResize, private void verifyValidRowIndex(final int rowIndex) { if (rowIndex < 0 || rowIndex >= body.getRowCount()) { - throw new IndexOutOfBoundsException("The given row index " - + rowIndex + " does not exist."); + throw new IndexOutOfBoundsException( + "The given row index " + rowIndex + " does not exist."); } } @@ -6050,7 +6105,7 @@ public class Escalator extends Widget implements RequiresResize, * Scrolls the body vertically so that the spacer at the given row index is * visible and there is at least {@literal padding} pixesl to the given * scroll destination. - * + * * @since 7.5.0 * @param spacerIndex * the row index of the spacer to scroll to @@ -6078,7 +6133,7 @@ public class Escalator extends Widget implements RequiresResize, *

    * If a spacer is not open at that index, this method behaves like * {@link #scrollToRow(int, ScrollDestination, int)} - * + * * @since 7.5.0 * @param rowIndex * the index of the logical row to scroll to. -1 takes the @@ -6132,7 +6187,8 @@ public class Escalator extends Widget implements RequiresResize, final Range targetRange; if (spacer != null) { final int spacerTop = (int) Math.floor(spacer.getTop()); - final int spacerHeight = (int) Math.ceil(spacer.getHeight()); + final int spacerHeight = (int) Math + .ceil(spacer.getHeight()); Range spacerRange = Range.withLength(spacerTop, spacerHeight); @@ -6201,7 +6257,7 @@ public class Escalator extends Widget implements RequiresResize, /** * Snap deltas of x and y to the major four axes (up, down, left, right) * with a threshold of a number of degrees from those axes. - * + * * @param deltaX * the delta in the x axis * @param deltaY @@ -6210,8 +6266,8 @@ public class Escalator extends Widget implements RequiresResize, * the threshold in ratio (0..1) between x and y for when to snap * @return a two-element array: [snappedX, snappedY] */ - private static double[] snapDeltas(final double deltaX, - final double deltaY, final double thresholdRatio) { + private static double[] snapDeltas(final double deltaX, final double deltaY, + final double thresholdRatio) { final double[] array = new double[2]; if (deltaX != 0 && deltaY != 0) { @@ -6234,7 +6290,7 @@ public class Escalator extends Widget implements RequiresResize, * Adds an event handler that gets notified when the range of visible rows * changes e.g. because of scrolling, row resizing or spacers * appearing/disappearing. - * + * * @param rowVisibilityChangeHandler * the event handler * @return a handler registration for the added handler @@ -6247,10 +6303,10 @@ public class Escalator extends Widget implements RequiresResize, private void fireRowVisibilityChangeEvent() { if (!body.visualRowOrder.isEmpty()) { - int visibleRangeStart = body.getLogicalRowIndex(body.visualRowOrder - .getFirst()); - int visibleRangeEnd = body.getLogicalRowIndex(body.visualRowOrder - .getLast()) + 1; + int visibleRangeStart = body + .getLogicalRowIndex(body.visualRowOrder.getFirst()); + int visibleRangeEnd = body + .getLogicalRowIndex(body.visualRowOrder.getLast()) + 1; int visibleRowCount = visibleRangeEnd - visibleRangeStart; fireEvent(new RowVisibilityChangeEvent(visibleRangeStart, @@ -6262,7 +6318,7 @@ public class Escalator extends Widget implements RequiresResize, /** * Gets the logical index range of currently visible rows. - * + * * @return logical index range of visible rows */ public Range getVisibleRowRange() { @@ -6277,7 +6333,7 @@ public class Escalator extends Widget implements RequiresResize, /** * Returns the widget from a cell node or null if there is no * widget in the cell - * + * * @param cellNode * The cell node */ @@ -6309,10 +6365,10 @@ public class Escalator extends Widget implements RequiresResize, UIObject.setStylePrimaryName(tableWrapper, style + "-tablewrapper"); UIObject.setStylePrimaryName(headerDeco, style + "-header-deco"); UIObject.setStylePrimaryName(footerDeco, style + "-footer-deco"); - UIObject.setStylePrimaryName(horizontalScrollbarDeco, style - + "-horizontal-scrollbar-deco"); - UIObject.setStylePrimaryName(spacerDecoContainer, style - + "-spacer-deco-container"); + UIObject.setStylePrimaryName(horizontalScrollbarDeco, + style + "-horizontal-scrollbar-deco"); + UIObject.setStylePrimaryName(spacerDecoContainer, + style + "-spacer-deco-container"); header.setStylePrimaryName(style); body.setStylePrimaryName(style); @@ -6325,13 +6381,12 @@ public class Escalator extends Widget implements RequiresResize, *

    * If Escalator is currently not in {@link HeightMode#ROW}, the given value * is remembered, and applied once the mode is applied. - * + * * @param rows * the number of rows that should be visible in Escalator's body * @throws IllegalArgumentException - * if {@code rows} is ≤ 0, - * {@link Double#isInifinite(double) infinite} or - * {@link Double#isNaN(double) NaN}. + * if {@code rows} is ≤ 0, {@link Double#isInifinite(double) + * infinite} or {@link Double#isNaN(double) NaN}. * @see #setHeightMode(HeightMode) */ public void setHeightByRows(double rows) throws IllegalArgumentException { @@ -6354,7 +6409,7 @@ public class Escalator extends Widget implements RequiresResize, * {@link #getHeightMode()} is {@link HeightMode#ROW}. *

    * By default, it is 10. - * + * * @return the amount of rows that are being shown in Escalator's body * @see #setHeightByRows(double) */ @@ -6367,15 +6422,16 @@ public class Escalator extends Widget implements RequiresResize, * define its height that way. */ private void applyHeightByRows() { - if (heightMode != HeightMode.ROW && heightMode != HeightMode.UNDEFINED) { + if (heightMode != HeightMode.ROW + && heightMode != HeightMode.UNDEFINED) { return; } double headerHeight = header.getHeightOfSection(); double footerHeight = footer.getHeightOfSection(); double bodyHeight = body.getDefaultRowHeight() * heightByRows; - double scrollbar = horizontalScrollbar.showsScrollHandle() ? horizontalScrollbar - .getScrollbarThickness() : 0; + double scrollbar = horizontalScrollbar.showsScrollHandle() + ? horizontalScrollbar.getScrollbarThickness() : 0; double spacerHeight = 0; // ignored if HeightMode.ROW if (heightMode == HeightMode.UNDEFINED) { spacerHeight = body.spacerContainer.getSpacerHeightsSum(); @@ -6398,7 +6454,7 @@ public class Escalator extends Widget implements RequiresResize, * inserted or removed, the widget will resize itself to still display the * required amount of rows in its body. It also takes the horizontal * scrollbar into account. - * + * * @param heightMode * the mode in to which Escalator should be set */ @@ -6408,7 +6464,7 @@ public class Escalator extends Widget implements RequiresResize, * widget dimensions (height/width) on each state change event. The * original design was to have setHeight an setHeightByRow be equals, * and whichever was called the latest was considered in effect. - * + * * But, because of Vaadin always calling setHeight on the widget, this * approach doesn't work. */ @@ -6437,7 +6493,7 @@ public class Escalator extends Widget implements RequiresResize, * Returns the current {@link HeightMode} the Escalator is in. *

    * Defaults to {@link HeightMode#CSS}. - * + * * @return the current HeightMode */ public HeightMode getHeightMode() { @@ -6446,7 +6502,7 @@ public class Escalator extends Widget implements RequiresResize, /** * Returns the {@link RowContainer} which contains the element. - * + * * @param element * the element to check for * @return the container the element is in or null if element @@ -6471,7 +6527,7 @@ public class Escalator extends Widget implements RequiresResize, *

    * If a direction is locked, the escalator will refuse to scroll in that * direction. - * + * * @param direction * the orientation of the scroll to set the lock status * @param locked @@ -6487,14 +6543,14 @@ public class Escalator extends Widget implements RequiresResize, verticalScrollbar.setLocked(locked); break; default: - throw new UnsupportedOperationException("Unexpected value: " - + direction); + throw new UnsupportedOperationException( + "Unexpected value: " + direction); } } /** * Checks whether or not an direction is locked for scrolling. - * + * * @param direction * the direction of the scroll of which to check the lock status * @return true iff the direction is locked @@ -6506,14 +6562,14 @@ public class Escalator extends Widget implements RequiresResize, case VERTICAL: return verticalScrollbar.isLocked(); default: - throw new UnsupportedOperationException("Unexpected value: " - + direction); + throw new UnsupportedOperationException( + "Unexpected value: " + direction); } } /** * Adds a scroll handler to this escalator - * + * * @param handler * the scroll handler to add * @return a handler registration for the registered scroll handler @@ -6539,7 +6595,7 @@ public class Escalator extends Widget implements RequiresResize, /** * Gets the maximum number of body rows that can be visible on the screen at * once. - * + * * @return the maximum capacity */ public int getMaxVisibleRowCount() { @@ -6549,7 +6605,7 @@ public class Escalator extends Widget implements RequiresResize, /** * Gets the escalator's inner width. This is the entire width in pixels, * without the vertical scrollbar. - * + * * @return escalator's inner width */ public double getInnerWidth() { @@ -6581,7 +6637,8 @@ public class Escalator extends Widget implements RequiresResize, @Override @SuppressWarnings("deprecation") - public com.google.gwt.user.client.Element getSubPartElement(String subPart) { + public com.google.gwt.user.client.Element getSubPartElement( + String subPart) { SubPartArguments args = SubPartArguments.create(subPart); Element tableStructureElement = getSubPartElementTableStructure(args); @@ -6659,7 +6716,8 @@ public class Escalator extends Widget implements RequiresResize, return targetElement; } - private static Element getCellFromRow(TableRowElement rowElement, int index) { + private static Element getCellFromRow(TableRowElement rowElement, + int index) { int childCount = rowElement.getCells().getLength(); if (index < 0 || index >= childCount) { return null; @@ -6692,7 +6750,8 @@ public class Escalator extends Widget implements RequiresResize, @Override @SuppressWarnings("deprecation") - public String getSubPartName(com.google.gwt.user.client.Element subElement) { + public String getSubPartName( + com.google.gwt.user.client.Element subElement) { /* * The spacer check needs to be before table structure check, because @@ -6721,9 +6780,9 @@ public class Escalator extends Widget implements RequiresResize, for (int i = 0; i < containers.size(); ++i) { RowContainer container = containers.get(i); - boolean containerRow = (subElement.getTagName().equalsIgnoreCase( - "tr") && subElement.getParentElement() == container - .getElement()); + boolean containerRow = (subElement.getTagName() + .equalsIgnoreCase("tr") + && subElement.getParentElement() == container.getElement()); if (containerRow) { /* * Wanted SubPart is row that is a child of containers root to @@ -6753,7 +6812,7 @@ public class Escalator extends Widget implements RequiresResize, /** * This is an internal method for calculating minimum width for Column * resize. - * + * * @return minimum width for column */ double getMinCellWidth(int colIndex) { diff --git a/client/src/main/java/com/vaadin/client/widgets/Grid.java b/client/src/main/java/com/vaadin/client/widgets/Grid.java index 2b117dc8e4..76c261196e 100644 --- a/client/src/main/java/com/vaadin/client/widgets/Grid.java +++ b/client/src/main/java/com/vaadin/client/widgets/Grid.java @@ -187,7 +187,7 @@ import com.vaadin.shared.util.SharedUtil; /** * A data grid view that supports columns and lazy loading of data rows from a * data source. - * + * *

    Columns

    *

    * Each column in Grid is represented by a {@link Column}. Each @@ -207,7 +207,7 @@ import com.vaadin.shared.util.SharedUtil; * See: {@link #addColumn(Column)}, {@link #addColumn(Column, int)} and * {@link #addColumns(Column...)}. Also * {@link Column#setRenderer(Renderer)}. - * + * *

    Data Sources

    *

    * Grid gets its data from a {@link DataSource}, providing row objects to Grid @@ -216,16 +216,16 @@ import com.vaadin.shared.util.SharedUtil; * ListDataSource}) or even a remote one, retrieving data from e.g. a REST API * (see {@link com.vaadin.client.data.AbstractRemoteDataSource * AbstractRemoteDataSource}). - * - * + * + * * @param * The row type of the grid. The row type is the POJO type from where * the data is retrieved into the column cells. * @since 7.4 * @author Vaadin Ltd */ -public class Grid extends ResizeComposite implements - HasSelectionHandlers, SubPartAware, DeferredWorker, Focusable, +public class Grid extends ResizeComposite implements HasSelectionHandlers, + SubPartAware, DeferredWorker, Focusable, com.google.gwt.user.client.ui.Focusable, HasWidgets, HasEnabled { private static final String STYLE_NAME = "v-grid"; @@ -234,9 +234,9 @@ public class Grid extends ResizeComposite implements /** * Abstract base class for Grid header and footer sections. - * + * * @since 7.5.0 - * + * * @param * the type of the rows in the section */ @@ -244,7 +244,7 @@ public class Grid extends ResizeComposite implements /** * A header or footer cell. Has a simple textual caption. - * + * */ public static class StaticCell { @@ -260,7 +260,7 @@ public class Grid extends ResizeComposite implements /** * Sets the text displayed in this cell. - * + * * @param text * a plain text caption */ @@ -272,7 +272,7 @@ public class Grid extends ResizeComposite implements /** * Returns the text displayed in this cell. - * + * * @return the plain text caption */ public String getText() { @@ -294,7 +294,7 @@ public class Grid extends ResizeComposite implements /** * Returns the amount of columns the cell spans. By default is 1. - * + * * @return The amount of columns the cell spans. */ public int getColspan() { @@ -304,7 +304,7 @@ public class Grid extends ResizeComposite implements /** * Sets the amount of columns the cell spans. Must be more or equal * to 1. By default is 1. - * + * * @param colspan * the colspan to set */ @@ -320,7 +320,7 @@ public class Grid extends ResizeComposite implements /** * Returns the html inside the cell. - * + * * @throws IllegalStateException * if trying to retrive HTML from a cell with a type * other than {@link GridStaticCellType#HTML}. @@ -338,7 +338,7 @@ public class Grid extends ResizeComposite implements * Sets the content of the cell to the provided html. All previous * content is discarded and the cell type is set to * {@link GridStaticCellType#HTML}. - * + * * @param html * The html content of the cell */ @@ -350,16 +350,17 @@ public class Grid extends ResizeComposite implements /** * Returns the widget in the cell. - * + * * @throws IllegalStateException * if the cell is not {@link GridStaticCellType#WIDGET} - * + * * @return the widget in the cell */ public Widget getWidget() { if (type != GridStaticCellType.WIDGET) { throw new IllegalStateException( - "Cannot fetch Widget from a cell with type " + type); + "Cannot fetch Widget from a cell with type " + + type); } return (Widget) content; } @@ -368,7 +369,7 @@ public class Grid extends ResizeComposite implements * Set widget as the content of the cell. The type of the cell * becomes {@link GridStaticCellType#WIDGET}. All previous content * is discarded. - * + * * @param widget * The widget to add to the cell. Should not be * previously attached anywhere (widget.getParent == @@ -390,7 +391,7 @@ public class Grid extends ResizeComposite implements /** * Returns the type of the cell. - * + * * @return the type of content the cell contains. */ public GridStaticCellType getType() { @@ -399,7 +400,7 @@ public class Grid extends ResizeComposite implements /** * Returns the custom style name for this cell. - * + * * @return the style name or null if no style name has been set */ public String getStyleName() { @@ -408,7 +409,7 @@ public class Grid extends ResizeComposite implements /** * Sets a custom style name for this cell. - * + * * @param styleName * the style name to set or null to not use any style * name @@ -421,7 +422,7 @@ public class Grid extends ResizeComposite implements /** * Called when the cell is detached from the row - * + * * @since 7.6.3 */ void detach() { @@ -434,7 +435,7 @@ public class Grid extends ResizeComposite implements /** * Abstract base class for Grid header and footer rows. - * + * * @param * the type of the cells in the row */ @@ -457,7 +458,7 @@ public class Grid extends ResizeComposite implements /** * Returns the cell on given GridColumn. If the column is merged * returned cell is the cell for the whole group. - * + * * @param column * the column in grid * @return the cell on given column, merged cell for merged columns, @@ -473,7 +474,7 @@ public class Grid extends ResizeComposite implements /** * Returns true if this row contains spanned cells. - * + * * @since 7.5.0 * @return does this row contain spanned cells */ @@ -483,7 +484,7 @@ public class Grid extends ResizeComposite implements /** * Merges columns cells in a row - * + * * @param columns * the columns which header should be merged * @return the remaining visible cell after the merge, or the cell @@ -501,7 +502,8 @@ public class Grid extends ResizeComposite implements for (Column column : columns) { if (!cells.containsKey(column)) { throw new IllegalArgumentException( - "Given column does not exists on row " + column); + "Given column does not exists on row " + + column); } else if (getCellGroupForColumn(column) != null) { throw new IllegalStateException( "Column is already in a group."); @@ -520,7 +522,7 @@ public class Grid extends ResizeComposite implements /** * Merges columns cells in a row - * + * * @param cells * The cells to merge. Must be from the same row. * @return The remaining visible cell after the merge, or the first @@ -551,7 +553,8 @@ public class Grid extends ResizeComposite implements return join(columns); } - private Set> getCellGroupForColumn(Column column) { + private Set> getCellGroupForColumn( + Column column) { for (Set> group : cellGroups.keySet()) { if (group.contains(column)) { return group; @@ -631,7 +634,7 @@ public class Grid extends ResizeComposite implements /** * Returns the custom style name for this row. - * + * * @return the style name or null if no style name has been set */ public String getStyleName() { @@ -640,7 +643,7 @@ public class Grid extends ResizeComposite implements /** * Sets a custom style name for this row. - * + * * @param styleName * the style name to set or null to not use any style * name @@ -652,7 +655,7 @@ public class Grid extends ResizeComposite implements /** * Called when the row is detached from the grid - * + * * @since 7.6.3 */ void detach() { @@ -675,7 +678,7 @@ public class Grid extends ResizeComposite implements /** * Creates and returns a new instance of the row type. - * + * * @return the created row */ protected abstract ROWTYPE createRow(); @@ -691,7 +694,7 @@ public class Grid extends ResizeComposite implements /** * Sets the visibility of the whole section. - * + * * @param visible * true to show this section, false to hide */ @@ -702,7 +705,7 @@ public class Grid extends ResizeComposite implements /** * Returns the visibility of this section. - * + * * @return true if visible, false otherwise. */ public boolean isVisible() { @@ -713,11 +716,11 @@ public class Grid extends ResizeComposite implements * Inserts a new row at the given position. Shifts the row currently at * that position and any subsequent rows down (adds one to their * indices). - * + * * @param index * the position at which to insert the row * @return the new row - * + * * @throws IndexOutOfBoundsException * if the index is out of bounds * @see #appendRow() @@ -739,7 +742,7 @@ public class Grid extends ResizeComposite implements /** * Adds a new row at the top of this section. - * + * * @return the new row * @see #appendRow() * @see #addRowAt(int) @@ -752,7 +755,7 @@ public class Grid extends ResizeComposite implements /** * Adds a new row at the bottom of this section. - * + * * @return the new row * @see #prependRow() * @see #addRowAt(int) @@ -765,10 +768,10 @@ public class Grid extends ResizeComposite implements /** * Removes the row at the given position. - * + * * @param index * the position of the row - * + * * @throws IndexOutOfBoundsException * if the index is out of bounds * @see #addRowAt(int) @@ -784,10 +787,10 @@ public class Grid extends ResizeComposite implements /** * Removes the given row from the section. - * + * * @param row * the row to be removed - * + * * @throws IllegalArgumentException * if the row does not exist in this section * @see #addRowAt(int) @@ -806,11 +809,11 @@ public class Grid extends ResizeComposite implements /** * Returns the row at the given position. - * + * * @param index * the position of the row * @return the row with the given index - * + * * @throws IndexOutOfBoundsException * if the index is out of bounds */ @@ -818,14 +821,14 @@ public class Grid extends ResizeComposite implements try { return rows.get(index); } catch (IndexOutOfBoundsException e) { - throw new IllegalArgumentException("Row with index " + index - + " does not exist"); + throw new IllegalArgumentException( + "Row with index " + index + " does not exist"); } } /** * Returns the number of rows in this section. - * + * * @return the number of rows */ public int getRowCount() { @@ -892,10 +895,10 @@ public class Grid extends ResizeComposite implements /** * Sets the default row of this header. The default row is a special * header row providing a user interface for sorting columns. - * + * * @param row * the new default row, or null for no default row - * + * * @throws IllegalArgumentException * this header does not contain the row */ @@ -921,7 +924,7 @@ public class Grid extends ResizeComposite implements /** * Returns the current default row of this header. The default row is a * special header row providing a user interface for sorting columns. - * + * * @return the default row or null if no default row set */ public HeaderRow getDefaultRow() { @@ -956,7 +959,7 @@ public class Grid extends ResizeComposite implements /** * Returns the events consumed by the header - * + * * @return a collection of BrowserEvents */ public Collection getConsumedEvents() { @@ -978,7 +981,7 @@ public class Grid extends ResizeComposite implements /** * A single row in a grid header section. - * + * */ public static class HeaderRow extends StaticSection.StaticRow { @@ -1045,14 +1048,14 @@ public class Grid extends ResizeComposite implements /** * A single cell in a grid Footer row. Has a textual caption. - * + * */ public static class FooterCell extends StaticSection.StaticCell { } /** * A single row in a grid Footer section. - * + * */ public static class FooterRow extends StaticSection.StaticRow { @@ -1067,7 +1070,7 @@ public class Grid extends ResizeComposite implements /** * A callback interface used to notify the invoker of the editor handler * of completed editor requests. - * + * * @param * the row data type */ @@ -1075,7 +1078,7 @@ public class Grid extends ResizeComposite implements /** * The method that must be called when the request has been * processed correctly. - * + * * @param request * the original request object */ @@ -1084,7 +1087,7 @@ public class Grid extends ResizeComposite implements /** * The method that must be called when processing the request has * produced an aborting error. - * + * * @param request * the original request object */ @@ -1173,7 +1176,7 @@ public class Grid extends ResizeComposite implements * A wrapper for native DOM events originating from Grid. In addition to the * native event, contains a {@link CellReference} instance specifying which * cell the event originated from. - * + * * @since 7.6 * @param * The row type of the grid @@ -1189,7 +1192,7 @@ public class Grid extends ResizeComposite implements /** * Returns the wrapped DOM event. - * + * * @return the DOM event */ public Event getDomEvent() { @@ -1198,7 +1201,7 @@ public class Grid extends ResizeComposite implements /** * Returns the Grid cell this event originated from. - * + * * @return the event cell */ public EventCellReference getCell() { @@ -1207,7 +1210,7 @@ public class Grid extends ResizeComposite implements /** * Returns the Grid instance this event originated from. - * + * * @return the grid */ public Grid getGrid() { @@ -1218,7 +1221,7 @@ public class Grid extends ResizeComposite implements /** * A wrapper for native DOM events related to the {@link Editor Grid editor} * . - * + * * @since 7.6 * @param * the row type of the grid @@ -1235,7 +1238,7 @@ public class Grid extends ResizeComposite implements /** * Returns the editor of the Grid this event originated from. - * + * * @return the related editor instance */ public Editor getEditor() { @@ -1244,7 +1247,7 @@ public class Grid extends ResizeComposite implements /** * Returns the currently focused editor widget. - * + * * @return the focused editor widget or {@code null} if not editable */ public Widget getEditorWidget() { @@ -1254,7 +1257,7 @@ public class Grid extends ResizeComposite implements /** * Returns the row index the editor is open at. If the editor is not * open, returns -1. - * + * * @return the index of the edited row or -1 if editor is not open */ public int getRowIndex() { @@ -1264,7 +1267,7 @@ public class Grid extends ResizeComposite implements /** * Returns the column index the editor was opened at. If the editor is * not open, returns -1. - * + * * @return the column index or -1 if editor is not open */ public int getFocusedColumnIndex() { @@ -1275,7 +1278,7 @@ public class Grid extends ResizeComposite implements /** * An editor UI for Grid rows. A single Grid row at a time can be opened for * editing. - * + * * @since 7.6 * @param * the row type of the grid @@ -1308,7 +1311,7 @@ public class Grid extends ResizeComposite implements /** * A handler for events related to the Grid editor. Responsible for * opening, moving or closing the editor based on the received event. - * + * * @since 7.6 * @author Vaadin Ltd * @param @@ -1318,7 +1321,7 @@ public class Grid extends ResizeComposite implements /** * Handles editor-related events in an appropriate way. Opens, * moves, or closes the editor based on the given event. - * + * * @param event * the received event * @return true if the event was handled and nothing else should be @@ -1340,8 +1343,8 @@ public class Grid extends ResizeComposite implements private DivElement cellWrapper = DivElement.as(DOM.createDiv()); private DivElement frozenCellWrapper = DivElement.as(DOM.createDiv()); - private DivElement messageAndButtonsWrapper = DivElement.as(DOM - .createDiv()); + private DivElement messageAndButtonsWrapper = DivElement + .as(DOM.createDiv()); private DivElement messageWrapper = DivElement.as(DOM.createDiv()); private DivElement buttonsWrapper = DivElement.as(DOM.createDiv()); @@ -1507,10 +1510,10 @@ public class Grid extends ResizeComposite implements * If a cell of this Grid had focus once this editRow call was * triggered, the editor component at the previously focused column * index will be focused. - * + * * If a Grid cell was not focused prior to calling this method, it will * be equivalent to {@code editRow(rowIndex, -1)}. - * + * * @see #editRow(int, int) */ public void editRow(int rowIndex) { @@ -1530,19 +1533,19 @@ public class Grid extends ResizeComposite implements * Opens the editor over the row with the given index and attempts to * focus the editor widget in the given column index. Does not move * focus if the widget is not focusable or if the column index is -1. - * + * * @param rowIndex * the index of the row to be edited * @param columnIndex * the column index of the editor widget that should be * initially focused or -1 to not set focus - * + * * @throws IllegalStateException * if this editor is not enabled * @throws IllegalStateException * if this editor is already in edit mode and in buffered * mode - * + * * @since 7.5 */ public void editRow(final int rowIndex, final int columnIndex) { @@ -1571,12 +1574,13 @@ public class Grid extends ResizeComposite implements } } if (columnIndex >= grid.getVisibleColumns().size()) { - throw new IllegalArgumentException("Edited column index " - + columnIndex - + " was bigger than visible column count."); + throw new IllegalArgumentException( + "Edited column index " + columnIndex + + " was bigger than visible column count."); } - if (this.rowIndex == rowIndex && focusedColumnIndex == columnIndex) { + if (this.rowIndex == rowIndex + && focusedColumnIndex == columnIndex) { // NO-OP return; } @@ -1618,16 +1622,15 @@ public class Grid extends ResizeComposite implements } } }); - grid.scrollToRow(rowIndex, - isBuffered() ? ScrollDestination.MIDDLE - : ScrollDestination.ANY); + grid.scrollToRow(rowIndex, isBuffered() + ? ScrollDestination.MIDDLE : ScrollDestination.ANY); } } /** * Cancels the currently active edit and hides the editor. Any changes * that are not {@link #save() saved} are lost. - * + * * @throws IllegalStateException * if this editor is not enabled * @throws IllegalStateException @@ -1658,8 +1661,8 @@ public class Grid extends ResizeComposite implements private void updateSelectionCheckboxesAsNeeded(boolean isEnabled) { // FIXME: This is too much guessing. Define a better way to do this. - if (grid.selectionColumn != null - && grid.selectionColumn.getRenderer() instanceof MultiSelectionRenderer) { + if (grid.selectionColumn != null && grid.selectionColumn + .getRenderer() instanceof MultiSelectionRenderer) { grid.refreshBody(); CheckBox checkBox = (CheckBox) grid.getDefaultHeaderRow() .getCell(grid.selectionColumn).getWidget(); @@ -1669,7 +1672,7 @@ public class Grid extends ResizeComposite implements /** * Saves any unsaved changes to the data source and hides the editor. - * + * * @throws IllegalStateException * if this editor is not enabled * @throws IllegalStateException @@ -1697,7 +1700,7 @@ public class Grid extends ResizeComposite implements /** * Returns the handler responsible for binding data and editor widgets * to this editor. - * + * * @return the editor handler or null if not set */ public EditorHandler getHandler() { @@ -1707,10 +1710,10 @@ public class Grid extends ResizeComposite implements /** * Sets the handler responsible for binding data and editor widgets to * this editor. - * + * * @param rowHandler * the new editor handler - * + * * @throws IllegalStateException * if this editor is currently in edit mode */ @@ -1728,10 +1731,10 @@ public class Grid extends ResizeComposite implements /** * Sets the enabled state of this editor. - * + * * @param enabled * true if enabled, false otherwise - * + * * @throws IllegalStateException * if in edit mode and trying to disable * @throws IllegalStateException @@ -1780,7 +1783,7 @@ public class Grid extends ResizeComposite implements * Returns the editor widget associated with the given column. If the * editor is not active or the column is not * {@link Grid.Column#isEditable() editable}, returns null. - * + * * @param column * the column * @return the widget if the editor is open and the column is editable, @@ -1792,10 +1795,10 @@ public class Grid extends ResizeComposite implements /** * Equivalent to {@code showOverlay()}. The argument is ignored. - * + * * @param unused * ignored argument - * + * * @deprecated As of 7.5, use {@link #showOverlay()} instead. */ @Deprecated @@ -1806,7 +1809,7 @@ public class Grid extends ResizeComposite implements /** * Opens the editor overlay over the table row indicated by * {@link #getRow()}. - * + * * @since 7.5 */ protected void showOverlay() { @@ -1838,17 +1841,17 @@ public class Grid extends ResizeComposite implements for (int i = 0; i < tr.getCells().getLength(); i++) { Element cell = createCell(tr.getCells().getItem(i)); - cellHeight = Math.max(cellHeight, WidgetUtil - .getRequiredHeightBoundingClientRectDouble(tr - .getCells().getItem(i))); + cellHeight = Math.max(cellHeight, + WidgetUtil.getRequiredHeightBoundingClientRectDouble( + tr.getCells().getItem(i))); Column column = grid.getVisibleColumn(i); if (i < frozenColumns) { frozenCellWrapper.appendChild(cell); frozenColumnsWidth += WidgetUtil - .getRequiredWidthBoundingClientRectDouble(tr - .getCells().getItem(i)); + .getRequiredWidthBoundingClientRectDouble( + tr.getCells().getItem(i)); } else { cellWrapper.appendChild(cell); } @@ -1889,8 +1892,8 @@ public class Grid extends ResizeComposite implements // editor overlay since the original one is hidden by // the overlay final CheckBox checkBox = GWT.create(CheckBox.class); - checkBox.setValue(grid.isSelected(pinnedRowHandle - .getRow())); + checkBox.setValue( + grid.isSelected(pinnedRowHandle.getRow())); checkBox.sinkEvents(Event.ONCLICK); checkBox.addClickHandler(new ClickHandler() { @@ -1910,17 +1913,18 @@ public class Grid extends ResizeComposite implements // Only enable CheckBox in non-buffered mode checkBox.setEnabled(!isBuffered()); - } else if (!(column.getRenderer() instanceof WidgetRenderer)) { + } else if (!(column + .getRenderer() instanceof WidgetRenderer)) { // Copy non-widget content directly - cell.setInnerHTML(tr.getCells().getItem(i) - .getInnerHTML()); + cell.setInnerHTML( + tr.getCells().getItem(i).getInnerHTML()); } } } setBounds(frozenCellWrapper, 0, 0, frozenColumnsWidth, 0); - setBounds(cellWrapper, frozenColumnsWidth, 0, tr.getOffsetWidth() - - frozenColumnsWidth, cellHeight); + setBounds(cellWrapper, frozenColumnsWidth, 0, + tr.getOffsetWidth() - frozenColumnsWidth, cellHeight); // Only add these elements once if (!messageAndButtonsWrapper.isOrHasChild(messageWrapper)) { @@ -1957,10 +1961,9 @@ public class Grid extends ResizeComposite implements // overlay from the bottom editorOverlay.insertFirst(messageAndButtonsWrapper); int gridHeight = grid.getElement().getOffsetHeight(); - editorOverlay.getStyle() - .setBottom( - gridHeight - overlayTop - tr.getOffsetHeight(), - Unit.PX); + editorOverlay.getStyle().setBottom( + gridHeight - overlayTop - tr.getOffsetHeight(), + Unit.PX); editorOverlay.getStyle().clearTop(); } @@ -2076,7 +2079,7 @@ public class Grid extends ResizeComposite implements * Creates an editor cell corresponding to the given table cell. The * returned element is empty and has the same dimensions and position as * the table cell. - * + * * @param td * the table cell used as a reference * @return an editor cell corresponding to the given cell @@ -2177,7 +2180,8 @@ public class Grid extends ResizeComposite implements return cancelButton.getText(); } - public void setEditorColumnError(Column column, boolean hasError) { + public void setEditorColumnError(Column column, + boolean hasError) { if (state != State.ACTIVE && state != State.SAVING) { throw new IllegalStateException("Cannot set cell error " + "status: editor is neither active nor saving."); @@ -2236,7 +2240,7 @@ public class Grid extends ResizeComposite implements /** * Sets the event handler for this Editor. - * + * * @since 7.6 * @param handler * the new event handler @@ -2247,7 +2251,7 @@ public class Grid extends ResizeComposite implements /** * Returns the event handler of this Editor. - * + * * @since 7.6 * @return the current event handler */ @@ -2299,7 +2303,7 @@ public class Grid extends ResizeComposite implements /** * Gets the Grid instance for this event. - * + * * @return grid */ public Grid getGrid() { @@ -2308,7 +2312,7 @@ public class Grid extends ResizeComposite implements /** * Gets the focused cell for this event. - * + * * @return focused cell */ public CellReference getFocusedCell() { @@ -2349,7 +2353,8 @@ public class Grid extends ResizeComposite implements private final Type associatedType = new Type( getBrowserEventType(), this); - public AbstractGridMouseEvent(Grid grid, CellReference targetCell) { + public AbstractGridMouseEvent(Grid grid, + CellReference targetCell) { this.grid = grid; this.targetCell = targetCell; } @@ -2358,7 +2363,7 @@ public class Grid extends ResizeComposite implements /** * Gets the Grid instance for this event. - * + * * @return grid */ public Grid getGrid() { @@ -2367,7 +2372,7 @@ public class Grid extends ResizeComposite implements /** * Gets the reference of target cell for this event. - * + * * @return target cell */ public CellReference getTargetCell() { @@ -2418,7 +2423,7 @@ public class Grid extends ResizeComposite implements /** * An initial height that is given to new details rows before rendering the * appropriate widget that we then can be measure - * + * * @see GridSpacerUpdater */ private static final double DETAILS_ROW_INITIAL_HEIGHT = 50; @@ -2469,8 +2474,8 @@ public class Grid extends ResizeComposite implements // Cell is correct but it does not have focused style if (cellWithFocusStyle != null) { // Remove old focus style - setStyleName(cellWithFocusStyle, - cellFocusStyleName, false); + setStyleName(cellWithFocusStyle, cellFocusStyleName, + false); } cellWithFocusStyle = cell.getElement(); @@ -2489,7 +2494,7 @@ public class Grid extends ResizeComposite implements /** * Sets focus style for the given row if needed. - * + * * @param row * a row object */ @@ -2506,7 +2511,8 @@ public class Grid extends ResizeComposite implements setStyleName(rowWithFocusStyle, rowFocusStyleName, true); } } else if (rowWithFocusStyle == row.getElement() - || (containerWithFocus != escalator.getBody() && rowWithFocusStyle != null)) { + || (containerWithFocus != escalator.getBody() + && rowWithFocusStyle != null)) { // Remove focus style. setStyleName(rowWithFocusStyle, rowFocusStyleName, false); rowWithFocusStyle = null; @@ -2518,7 +2524,7 @@ public class Grid extends ResizeComposite implements *

    * NOTE: the column index is the index in DOM, not the logical * column index which includes hidden columns. - * + * * @param rowIndex * the index of the row having focus * @param columnIndexDOM @@ -2528,8 +2534,7 @@ public class Grid extends ResizeComposite implements */ private void setCellFocus(int rowIndex, int columnIndexDOM, RowContainer container) { - if (container == null - || rowIndex == rowWithFocus + if (container == null || rowIndex == rowWithFocus && cellFocusRange.contains(columnIndexDOM) && container == this.containerWithFocus) { return; @@ -2558,8 +2563,8 @@ public class Grid extends ResizeComposite implements ++i; } while (cell != null); } - int columnIndex = getColumns().indexOf( - getVisibleColumn(columnIndexDOM)); + int columnIndex = getColumns() + .indexOf(getVisibleColumn(columnIndexDOM)); if (columnIndex >= escalator.getColumnConfiguration() .getFrozenColumnCount()) { escalator.scrollToColumn(columnIndexDOM, ScrollDestination.ANY, @@ -2600,11 +2605,11 @@ public class Grid extends ResizeComposite implements /** * Sets focus on a cell. - * + * *

    * Note: cell focus is not the same as JavaScript's * {@code document.activeElement}. - * + * * @param cell * a cell object */ @@ -2615,7 +2620,7 @@ public class Grid extends ResizeComposite implements /** * Gets list of events that can be used for cell focusing. - * + * * @return list of navigation related event types */ public Collection getNavigationEvents() { @@ -2678,7 +2683,8 @@ public class Grid extends ResizeComposite implements case KeyCodes.KEY_PAGEDOWN: case KeyCodes.KEY_PAGEUP: if (newContainer.getRowCount() > 0) { - boolean down = event.getKeyCode() == KeyCodes.KEY_PAGEDOWN; + boolean down = event + .getKeyCode() == KeyCodes.KEY_PAGEDOWN; // If there is a visible focused cell, scroll by one // page from its position. Otherwise, use the first or // the last visible row as the scroll start position. @@ -2692,12 +2698,12 @@ public class Grid extends ResizeComposite implements // Scroll by a little less than the visible area to // account for the possibility that the top and the // bottom row are only partially visible. - int moveFocusBy = Math.max(1, lastVisible - - firstVisible - 1); + int moveFocusBy = Math.max(1, + lastVisible - firstVisible - 1); moveFocusBy *= down ? 1 : -1; newRow += moveFocusBy; - newRow = Math.max(0, Math.min( - newContainer.getRowCount() - 1, newRow)); + newRow = Math.max(0, Math + .min(newContainer.getRowCount() - 1, newRow)); } break; default: @@ -2786,7 +2792,7 @@ public class Grid extends ResizeComposite implements /** * Offsets the focused cell's range. - * + * * @param offset * offset for fixing focused cell's range */ @@ -2798,17 +2804,18 @@ public class Grid extends ResizeComposite implements * Informs {@link CellFocusHandler} that certain range of rows has been * added to the Grid body. {@link CellFocusHandler} will fix indices * accordingly. - * + * * @param added * a range of added rows */ public void rowsAddedToBody(Range added) { boolean bodyHasFocus = (containerWithFocus == escalator.getBody()); - boolean insertionIsAboveFocusedCell = (added.getStart() <= rowWithFocus); + boolean insertionIsAboveFocusedCell = (added + .getStart() <= rowWithFocus); if (bodyHasFocus && insertionIsAboveFocusedCell) { rowWithFocus += added.length(); - rowWithFocus = Math.min(rowWithFocus, escalator.getBody() - .getRowCount() - 1); + rowWithFocus = Math.min(rowWithFocus, + escalator.getBody().getRowCount() - 1); refreshRow(rowWithFocus); } } @@ -2817,7 +2824,7 @@ public class Grid extends ResizeComposite implements * Informs {@link CellFocusHandler} that certain range of rows has been * removed from the Grid body. {@link CellFocusHandler} will fix indices * accordingly. - * + * * @param removed * a range of removed rows */ @@ -2836,12 +2843,12 @@ public class Grid extends ResizeComposite implements rowWithFocus = removed.getStart() - 1; } else { if (escalator.getHeader().getRowCount() > 0) { - rowWithFocus = Math.min(lastFocusedHeaderRow, escalator - .getHeader().getRowCount() - 1); + rowWithFocus = Math.min(lastFocusedHeaderRow, + escalator.getHeader().getRowCount() - 1); containerWithFocus = escalator.getHeader(); } else if (escalator.getFooter().getRowCount() > 0) { - rowWithFocus = Math.min(lastFocusedFooterRow, escalator - .getFooter().getRowCount() - 1); + rowWithFocus = Math.min(lastFocusedFooterRow, + escalator.getFooter().getRowCount() - 1); containerWithFocus = escalator.getFooter(); } } @@ -2851,7 +2858,7 @@ public class Grid extends ResizeComposite implements } public final class SelectionColumn extends Column - implements GridEnabledHandler { + implements GridEnabledHandler { private boolean initDone = false; private boolean selected = false; @@ -2878,7 +2885,7 @@ public class Grid extends ResizeComposite implements * TODO: Currently the select all check box is shown when multi * selection is in use. This might result in malfunctions if no * SelectAllHandlers are present. - * + * * Later on this could be fixed so that it check such handlers * exist. */ @@ -2886,10 +2893,10 @@ public class Grid extends ResizeComposite implements if (selectAllCheckBox == null) { selectAllCheckBox = GWT.create(CheckBox.class); - selectAllCheckBox.setStylePrimaryName(getStylePrimaryName() - + SELECT_ALL_CHECKBOX_CLASSNAME); - selectAllCheckBox - .addValueChangeHandler(new ValueChangeHandler() { + selectAllCheckBox.setStylePrimaryName( + getStylePrimaryName() + SELECT_ALL_CHECKBOX_CLASSNAME); + selectAllCheckBox.addValueChangeHandler( + new ValueChangeHandler() { @Override public void onValueChange( @@ -2909,11 +2916,11 @@ public class Grid extends ResizeComposite implements @Override public void onClick(GridClickEvent event) { CellReference targetCell = event.getTargetCell(); - int defaultRowIndex = getHeader().getRows().indexOf( - getDefaultHeaderRow()); + int defaultRowIndex = getHeader().getRows() + .indexOf(getDefaultHeaderRow()); - if (targetCell.getColumnIndex() == 0 - && targetCell.getRowIndex() == defaultRowIndex) { + if (targetCell.getColumnIndex() == 0 && targetCell + .getRowIndex() == defaultRowIndex) { selectAllCheckBox.setValue( !selectAllCheckBox.getValue(), true); } @@ -2927,12 +2934,13 @@ public class Grid extends ResizeComposite implements if (event.getNativeKeyCode() != KeyCodes.KEY_SPACE) { return; } - HeaderRow targetHeaderRow = getHeader().getRow( - event.getFocusedCell().getRowIndex()); + HeaderRow targetHeaderRow = getHeader() + .getRow(event.getFocusedCell().getRowIndex()); if (!targetHeaderRow.isDefault()) { return; } - if (event.getFocusedCell().getColumn() == SelectionColumn.this) { + if (event.getFocusedCell() + .getColumn() == SelectionColumn.this) { // Send events to ensure state is updated selectAllCheckBox.setValue( !selectAllCheckBox.getValue(), true); @@ -2941,7 +2949,8 @@ public class Grid extends ResizeComposite implements }); } else { for (HeaderRow row : header.getRows()) { - if (row.getCell(this).getType() == GridStaticCellType.WIDGET) { + if (row.getCell(this) + .getType() == GridStaticCellType.WIDGET) { // Detach from old header. row.getCell(this).setText(""); } @@ -3015,11 +3024,12 @@ public class Grid extends ResizeComposite implements * Sets whether the selection column is enabled. * * @since 7.7 - * @param enabled true to enable the column, - * false to disable it. + * @param enabled + * true to enable the column, false + * to disable it. */ public void setEnabled(boolean enabled) { - if(selectAllCheckBox != null) { + if (selectAllCheckBox != null) { selectAllCheckBox.setEnabled(enabled); } } @@ -3058,7 +3068,7 @@ public class Grid extends ResizeComposite implements * chain. If false, the sorting order is set to ASCENDING for that * cell's column. If that column was already the only sorted column in * the Grid, the sort direction is flipped. - * + * * @param cell * a valid cell reference * @param multisort @@ -3114,7 +3124,7 @@ public class Grid extends ResizeComposite implements /** * Perform a sort after a delay. - * + * * @param delay * delay, in milliseconds */ @@ -3127,7 +3137,7 @@ public class Grid extends ResizeComposite implements /** * Check if a delayed sort command has been issued but not yet carried * out. - * + * * @return a boolean value */ public boolean isDelayedSortScheduled() { @@ -3193,7 +3203,7 @@ public class Grid extends ResizeComposite implements /** * Calculates and applies column widths, taking into account fixed * widths and column expand rules - * + * * @param immediately * true if the widths should be executed * immediately (ignoring lazy loading completely), or @@ -3249,8 +3259,8 @@ public class Grid extends ResizeComposite implements for (int index = 0; index < columns.size(); index++) { selfWidths.put(index, columns.get(index).getWidth()); } - Grid.this.escalator.getColumnConfiguration().setColumnWidths( - selfWidths); + Grid.this.escalator.getColumnConfiguration() + .setColumnWidths(selfWidths); /* * Step 2: Make sure that each column ends up obeying their min/max @@ -3275,8 +3285,8 @@ public class Grid extends ResizeComposite implements constrainedWidths.put(index, column.getMaximumWidth()); } } - Grid.this.escalator.getColumnConfiguration().setColumnWidths( - constrainedWidths); + Grid.this.escalator.getColumnConfiguration() + .setColumnWidths(constrainedWidths); } private void applyColumnWidthsWithExpansion() { @@ -3291,7 +3301,7 @@ public class Grid extends ResizeComposite implements /* * Set all fixed widths and also calculate the size-to-fit widths * for the autocalculated columns. - * + * * This way we know with how many pixels we have left to expand the * rest. */ @@ -3303,7 +3313,8 @@ public class Grid extends ResizeComposite implements Math.min(getMaxWidth(column), widthAsIs), column.getMinimumWidth()); defaultExpandRatios = defaultExpandRatios - && (column.getExpandRatio() == -1 || column == selectionColumn); + && (column.getExpandRatio() == -1 + || column == selectionColumn); if (isFixedWidth) { columnSizes.put(visibleColumns.indexOf(column), widthFixed); @@ -3317,8 +3328,8 @@ public class Grid extends ResizeComposite implements setColumnSizes(columnSizes); for (Column column : nonFixedColumns) { - final int expandRatio = (defaultExpandRatios ? 1 : column - .getExpandRatio()); + final int expandRatio = (defaultExpandRatios ? 1 + : column.getExpandRatio()); final double maxWidth = getMaxWidth(column); final double newWidth = Math.min(maxWidth, column.getWidthActual()); @@ -3365,8 +3376,8 @@ public class Grid extends ResizeComposite implements final int columnIndex = visibleColumns.indexOf(column); final double autoWidth = columnSizes.get(columnIndex); final double maxWidth = getMaxWidth(column); - double expandedWidth = autoWidth + widthPerRatio - * expandRatio; + double expandedWidth = autoWidth + + widthPerRatio * expandRatio; if (maxWidth <= expandedWidth) { i.remove(); @@ -3383,12 +3394,12 @@ public class Grid extends ResizeComposite implements return; } assert pixelsToDistribute > 0 : "We've run out of pixels to distribute (" - + pixelsToDistribute - + "px to " - + totalRatios + + pixelsToDistribute + "px to " + totalRatios + " ratios between " + columnsToExpand.size() + " columns)"; - assert totalRatios > 0 && !columnsToExpand.isEmpty() : "Bookkeeping out of sync. Ratios: " - + totalRatios + " Columns: " + columnsToExpand.size(); + assert totalRatios > 0 && !columnsToExpand + .isEmpty() : "Bookkeeping out of sync. Ratios: " + + totalRatios + " Columns: " + + columnsToExpand.size(); /* * If we still have anything left, distribute the remaining pixels @@ -3401,8 +3412,8 @@ public class Grid extends ResizeComposite implements // These browsers report subpixels as integers. this usually // results into issues.. widthPerRatio = (int) (pixelsToDistribute / totalRatios); - leftOver = (int) (pixelsToDistribute - widthPerRatio - * totalRatios); + leftOver = (int) (pixelsToDistribute + - widthPerRatio * totalRatios); } else { widthPerRatio = pixelsToDistribute / totalRatios; } @@ -3451,7 +3462,8 @@ public class Grid extends ResizeComposite implements boolean hasAutoWidth = column.getWidth() < 0; if (hasAutoWidth && currentWidth < minWidth) { columnSizes.put(columnIndex, minWidth); - pixelsToRemoveFromOtherColumns += (minWidth - currentWidth); + pixelsToRemoveFromOtherColumns += (minWidth + - currentWidth); minWidthsCausedReflows = true; /* @@ -3477,8 +3489,8 @@ public class Grid extends ResizeComposite implements final double pixelsToRemove = pixelsToRemovePerRatio * getExpandRatio(column, defaultExpandRatios); int colIndex = visibleColumns.indexOf(column); - columnSizes.put(colIndex, columnSizes.get(colIndex) - - pixelsToRemove); + columnSizes.put(colIndex, + columnSizes.get(colIndex) - pixelsToRemove); } } while (minWidthsCausedReflows); @@ -3534,7 +3546,7 @@ public class Grid extends ResizeComposite implements /** * Check whether the auto width calculation is currently scheduled. - * + * * @return true if auto width calculation is currently * scheduled */ @@ -3559,10 +3571,10 @@ public class Grid extends ResizeComposite implements try { detailsWidget = detailsGenerator.getDetails(rowIndex); } catch (Throwable e) { - getLogger().log( - Level.SEVERE, + getLogger().log(Level.SEVERE, "Exception while generating details for row " - + rowIndex, e); + + rowIndex, + e); } final double spacerHeight; @@ -3583,7 +3595,7 @@ public class Grid extends ResizeComposite implements /* * Once we have the content properly inside the DOM, we should * re-measure it to make sure that it's the correct height. - * + * * This is rather tricky, since the row (tr) will get the * height, but the spacer cell (td) has the borders, which * should go on top of the previous row and next row. @@ -3600,7 +3612,8 @@ public class Grid extends ResizeComposite implements .getBorderTopAndBottomThickness(spacerElement); double measuredHeight = contentHeight + borderTopAndBottomHeight; - assert getElement().isOrHasChild(spacerElement) : "The spacer element wasn't in the DOM during measurement, but was assumed to be."; + assert getElement().isOrHasChild( + spacerElement) : "The spacer element wasn't in the DOM during measurement, but was assumed to be."; spacerHeight = measuredHeight; } @@ -3619,8 +3632,8 @@ public class Grid extends ResizeComposite implements + "Grid's DOM. (row: " + spacer.getRow() + ", element: " + spacerElement + ")"; - Widget detailsWidget = elementToWidgetMap.remove(spacerElement - .getFirstChildElement()); + Widget detailsWidget = elementToWidgetMap + .remove(spacerElement.getFirstChildElement()); if (detailsWidget != null) { /* @@ -3631,8 +3644,8 @@ public class Grid extends ResizeComposite implements assert spacerElement.getFirstChild() != null : "The " + "details row to destroy did not contain a widget - " + "probably removed by something else without " - + "permission? (row: " + spacer.getRow() - + ", element: " + spacerElement + ")"; + + "permission? (row: " + spacer.getRow() + ", element: " + + spacerElement + ")"; setParent(detailsWidget, null); spacerElement.removeAllChildren(); @@ -3664,7 +3677,7 @@ public class Grid extends ResizeComposite implements * grid, if it contains any column hiding options or custom widgets. The * column hiding toggles and custom widgets become visible once the sidebar * has been opened. - * + * * @since 7.5.0 */ private static class Sidebar extends Composite implements HasEnabled { @@ -3749,8 +3762,8 @@ public class Grid extends ResizeComposite implements && event.getKeyCode() == KeyCodes.KEY_ENTER) { final MenuItem item = getSelectedItem(); super.onBrowserEvent(event); - Scheduler.get().scheduleDeferred( - new ScheduledCommand() { + Scheduler.get() + .scheduleDeferred(new ScheduledCommand() { @Override public void execute() { @@ -3820,7 +3833,7 @@ public class Grid extends ResizeComposite implements /** * Returns whether the sidebar is open or not. - * + * * @return true if open, false if not */ public boolean isOpen() { @@ -3858,8 +3871,8 @@ public class Grid extends ResizeComposite implements RowContainer header = grid.escalator.getHeader(); if (header.getRowCount() == 0 || !header.getRowElement(0).hasChildNodes()) { - getLogger() - .info("No header cell available when calculating sidebar button height"); + getLogger().info( + "No header cell available when calculating sidebar button height"); openCloseButton.setHeight(header.getDefaultRowHeight() + "px"); return; @@ -3944,8 +3957,8 @@ public class Grid extends ResizeComposite implements } toggle.setStyleName("hidden", column.isHidden()); } else if (columnToHidingToggleMap.containsKey(column)) { - sidebar.menuBar.removeItem((columnToHidingToggleMap - .remove(column))); + sidebar.menuBar + .removeItem((columnToHidingToggleMap.remove(column))); } updateTogglesOrder(); } @@ -4081,12 +4094,15 @@ public class Grid extends ResizeComposite implements * This is a workaround to make Chrome work like Firefox. In Chrome, * normally if you start a drag on one cell and release on: *

      - *
    • that same cell, the click event is that {@code }. - *
    • a cell on that same row, the click event is the parent {@code }. + *
    • that same cell, the click event is that {@code + * }. + *
    • a cell on that same row, the click event is the parent {@code + * + * }. *
    • a cell on another row, the click event is the table section ancestor * ({@code }, {@code } or {@code }). *
    - * + * * @see #onBrowserEvent(Event) */ private Cell cellOnPrevMouseDown; @@ -4181,8 +4197,8 @@ public class Grid extends ResizeComposite implements } // update the style names on each run in case primary name has been // modified - tableHeader.setClassName(escalator.getHeader().getElement() - .getClassName()); + tableHeader.setClassName( + escalator.getHeader().getElement().getClassName()); dropMarker.setClassName(getStylePrimaryName() + "-drop-marker"); int topOffset = 0; for (int i = 0; i < eventCell.getRowIndex(); i++) { @@ -4215,9 +4231,11 @@ public class Grid extends ResizeComposite implements .ceilingEntry(cursorXCoordinate); final Entry cellEdgeOnLeft = possibleDropPositions .floorEntry(cursorXCoordinate); - final double diffToRightEdge = cellEdgeOnRight == null ? Double.MAX_VALUE + final double diffToRightEdge = cellEdgeOnRight == null + ? Double.MAX_VALUE : cellEdgeOnRight.getKey() - cursorXCoordinate; - final double diffToLeftEdge = cellEdgeOnLeft == null ? Double.MAX_VALUE + final double diffToLeftEdge = cellEdgeOnLeft == null + ? Double.MAX_VALUE : cursorXCoordinate - cellEdgeOnLeft.getKey(); double dropMarkerLeft = 0 - scrollLeft; @@ -4233,7 +4251,8 @@ public class Grid extends ResizeComposite implements final double frozenColumnsWidth = autoScroller .getFrozenColumnsWidth(); - final double rightBoundaryForDrag = getSidebarBoundaryComparedTo(dropMarkerLeft); + final double rightBoundaryForDrag = getSidebarBoundaryComparedTo( + dropMarkerLeft); final int visibleColumns = getVisibleColumns().size(); // First check if the drop marker should move left because of the @@ -4248,7 +4267,8 @@ public class Grid extends ResizeComposite implements // Check if the drop marker shouldn't be shown at all else if (dropMarkerLeft < frozenColumnsWidth || dropMarkerLeft > Math.min(rightBoundaryForDrag, - escalator.getInnerWidth()) || dropMarkerLeft < 0) { + escalator.getInnerWidth()) + || dropMarkerLeft < 0) { dropMarkerLeft = -10000000; } dropMarker.getStyle().setLeft(dropMarkerLeft, Unit.PX); @@ -4271,8 +4291,8 @@ public class Grid extends ResizeComposite implements // Do not show the drag element beyond the grid final double sidebarBoundary = getSidebarBoundaryComparedTo(left); final double gridBoundary = escalator.getInnerWidth(); - final double rightBoundary = Math - .min(sidebarBoundary, gridBoundary); + final double rightBoundary = Math.min(sidebarBoundary, + gridBoundary); // Do not show on left of the frozen columns (even if scrolled) final int frozenColumnsWidth = (int) autoScroller @@ -4345,13 +4365,15 @@ public class Grid extends ResizeComposite implements final int colspan = header.getRow(eventCell.getRowIndex()) .getCell(eventCell.getColumn()).getColspan(); if (latestColumnDropIndex != draggedColumnIndex - && latestColumnDropIndex != (draggedColumnIndex + colspan)) { + && latestColumnDropIndex != (draggedColumnIndex + + colspan)) { List> columns = getColumns(); List> reordered = new ArrayList>(); if (draggedColumnIndex < latestColumnDropIndex) { reordered.addAll(columns.subList(0, draggedColumnIndex)); - reordered.addAll(columns.subList(draggedColumnIndex - + colspan, latestColumnDropIndex)); + reordered.addAll( + columns.subList(draggedColumnIndex + colspan, + latestColumnDropIndex)); reordered.addAll(columns.subList(draggedColumnIndex, draggedColumnIndex + colspan)); reordered.addAll(columns.subList(latestColumnDropIndex, @@ -4362,8 +4384,8 @@ public class Grid extends ResizeComposite implements draggedColumnIndex + colspan)); reordered.addAll(columns.subList(latestColumnDropIndex, draggedColumnIndex)); - reordered.addAll(columns.subList(draggedColumnIndex - + colspan, columns.size())); + reordered.addAll(columns.subList( + draggedColumnIndex + colspan, columns.size())); } reordered.remove(selectionColumn); // since setColumnOrder will // add it anyway! @@ -4372,12 +4394,12 @@ public class Grid extends ResizeComposite implements Cell focusedCell = cellFocusHandler.getFocusedCell(); if (focusedCell != null) { // take hidden columns into account - focusedColumnIndex = getColumns().indexOf( - getVisibleColumn(focusedCell.getColumn())); + focusedColumnIndex = getColumns() + .indexOf(getVisibleColumn(focusedCell.getColumn())); } - Column[] array = reordered.toArray(new Column[reordered - .size()]); + Column[] array = reordered + .toArray(new Column[reordered.size()]); setColumnOrder(array); transferCellFocusOnDrop(); } // else no reordering @@ -4394,11 +4416,11 @@ public class Grid extends ResizeComposite implements .findRowContainer(focusedCell.getElement()); if (focusedColumnIndex == draggedColumnIndex) { // move with the dragged column - int adjustedDropIndex = latestColumnDropIndex > draggedColumnIndex ? latestColumnDropIndex - 1 - : latestColumnDropIndex; + int adjustedDropIndex = latestColumnDropIndex > draggedColumnIndex + ? latestColumnDropIndex - 1 : latestColumnDropIndex; // remove hidden columns from indexing - adjustedDropIndex = getVisibleColumns().indexOf( - getColumn(adjustedDropIndex)); + adjustedDropIndex = getVisibleColumns() + .indexOf(getColumn(adjustedDropIndex)); cellFocusHandler.setCellFocus(focusedRowIndex, adjustedDropIndex, rowContainer); } else if (latestColumnDropIndex <= focusedColumnIndex @@ -4456,8 +4478,8 @@ public class Grid extends ResizeComposite implements possibleDropPositions.clear(); final int draggedColumnIndex = eventCell.getColumnIndex(); - final StaticRow draggedCellRow = header.getRow(eventCell - .getRowIndex()); + final StaticRow draggedCellRow = header + .getRow(eventCell.getRowIndex()); final int draggedColumnRightIndex = draggedColumnIndex + draggedCellRow.getCell(eventCell.getColumn()) .getColspan(); @@ -4606,10 +4628,10 @@ public class Grid extends ResizeComposite implements /** * Base class for grid columns internally used by the Grid. The user should * use {@link Column} when creating new columns. - * + * * @param * the column type - * + * * @param * the row type */ @@ -4627,9 +4649,8 @@ public class Grid extends ResizeComposite implements @Override public void render(RendererCellReference cell, Object data) { if (!warned && !(data instanceof String)) { - getLogger().warning( - Column.this.toString() + ": " - + DEFAULT_RENDERER_WARNING); + getLogger().warning(Column.this.toString() + ": " + + DEFAULT_RENDERER_WARNING); warned = true; } @@ -4687,10 +4708,10 @@ public class Grid extends ResizeComposite implements /** * Constructs a new column with a simple TextRenderer. - * + * * @param caption * The header caption for this column - * + * * @throws IllegalArgumentException * if given header caption is null */ @@ -4701,10 +4722,10 @@ public class Grid extends ResizeComposite implements /** * Constructs a new column with a custom renderer. - * + * * @param renderer * The renderer to use for rendering the cells - * + * * @throws IllegalArgumentException * if given Renderer is null */ @@ -4715,12 +4736,12 @@ public class Grid extends ResizeComposite implements /** * Constructs a new column with a custom renderer. - * + * * @param renderer * The renderer to use for rendering the cells * @param caption * The header caption for this column - * + * * @throws IllegalArgumentException * if given Renderer or header caption is null */ @@ -4732,7 +4753,7 @@ public class Grid extends ResizeComposite implements /** * Internally used by the grid to set itself - * + * * @param grid */ private void setGrid(Grid grid) { @@ -4754,11 +4775,11 @@ public class Grid extends ResizeComposite implements /** * Sets a header caption for this column. - * + * * @param caption * The header caption for this column * @return the column itself - * + * */ public Column setHeaderCaption(String caption) { if (caption == null) { @@ -4777,7 +4798,7 @@ public class Grid extends ResizeComposite implements /** * Returns the current header caption for this column - * + * * @since 7.6 * @return the header caption string */ @@ -4802,10 +4823,10 @@ public class Grid extends ResizeComposite implements *

    * To support other types you will need to pass a custom renderer to the * column via the column constructor. - * + * * @param row * The row object that provides the cell content. - * + * * @return The cell content */ public abstract C getValue(T row); @@ -4814,7 +4835,7 @@ public class Grid extends ResizeComposite implements * The renderer to render the cell with. By default renders the data as * a String or adds the widget into the cell if the column type is of * widget type. - * + * * @return The renderer to render the cell content with */ public Renderer getRenderer() { @@ -4823,11 +4844,11 @@ public class Grid extends ResizeComposite implements /** * Sets a custom {@link Renderer} for this column. - * + * * @param renderer * The renderer to use for rendering the cells * @return the column itself - * + * * @throws IllegalArgumentException * if given Renderer is null */ @@ -4844,8 +4865,8 @@ public class Grid extends ResizeComposite implements ColumnConfiguration conf = null; int index = 0; - if (grid != null - && (bodyRenderer instanceof WidgetRenderer || renderer instanceof WidgetRenderer)) { + if (grid != null && (bodyRenderer instanceof WidgetRenderer + || renderer instanceof WidgetRenderer)) { // Column needs to be recreated. index = grid.getColumns().indexOf(this); conf = grid.escalator.getColumnConfiguration(); @@ -4885,7 +4906,7 @@ public class Grid extends ResizeComposite implements *

    * If the column is currently {@link #isHidden() hidden}, then this set * width has effect only once the column has been made visible again. - * + * * @param pixels * the width in pixels or negative for auto sizing */ @@ -4917,7 +4938,7 @@ public class Grid extends ResizeComposite implements *

    * Note: Returns the value, even if the column is currently * {@link #isHidden() hidden}. - * + * * @return pixel width of the column, or a negative number if the column * width has been automatically calculated. * @see #setWidth(double) @@ -4933,16 +4954,15 @@ public class Grid extends ResizeComposite implements * This differs from {@link #getWidth()} only when the column has been * automatically resized, or when the column is currently * {@link #isHidden() hidden}, when the value is 0. - * + * * @return pixel width of the column. */ public double getWidthActual() { if (isHidden()) { return 0; } - return grid.escalator.getColumnConfiguration() - .getColumnWidthActual( - grid.getVisibleColumns().indexOf(this)); + return grid.escalator.getColumnConfiguration().getColumnWidthActual( + grid.getVisibleColumns().indexOf(this)); } void reapplyWidth() { @@ -4954,7 +4974,7 @@ public class Grid extends ResizeComposite implements * be sorted by a sortable column by clicking or tapping the column's * default header. Programmatic sorting using the Grid#sort methods is * not affected by this setting. - * + * * @param sortable * {@code true} if the user should be able to sort the * column, {@code false} otherwise @@ -4975,7 +4995,7 @@ public class Grid extends ResizeComposite implements *

    * Note: it is possible to sort by this column programmatically * using the Grid#sort methods regardless of the returned value. - * + * * @return {@code true} if the column is sortable by the user, * {@code false} otherwise */ @@ -4985,9 +5005,9 @@ public class Grid extends ResizeComposite implements /** * Sets whether this column can be resized by the user. - * + * * @since 7.6 - * + * * @param resizable * {@code true} if this column should be resizable, * {@code false} otherwise @@ -5009,9 +5029,9 @@ public class Grid extends ResizeComposite implements * Note: the column can be programmatically resized using * {@link #setWidth(double)} and {@link #setWidthUndefined()} regardless * of the returned value. - * + * * @since 7.6 - * + * * @return {@code true} if this column is resizable, {@code false} * otherwise */ @@ -5022,7 +5042,7 @@ public class Grid extends ResizeComposite implements /** * Hides or shows the column. By default columns are visible before * explicitly hiding them. - * + * * @since 7.5.0 * @param hidden * true to hide the column, false @@ -5042,10 +5062,10 @@ public class Grid extends ResizeComposite implements } else { this.hidden = hidden; - final int columnIndex = grid.getVisibleColumns().indexOf( - this); - grid.escalator.getColumnConfiguration().insertColumns( - columnIndex, 1); + final int columnIndex = grid.getVisibleColumns() + .indexOf(this); + grid.escalator.getColumnConfiguration() + .insertColumns(columnIndex, 1); // make sure column is set to frozen if it needs to be, // escalator doesn't handle situation where the added column @@ -5070,7 +5090,7 @@ public class Grid extends ResizeComposite implements /** * Returns whether this column is hidden. Default is {@code false}. - * + * * @since 7.5.0 * @return {@code true} if the column is currently hidden, {@code false} * otherwise @@ -5085,7 +5105,7 @@ public class Grid extends ResizeComposite implements *

    * Note: it is still possible to hide the column * programmatically using {@link #setHidden(boolean)}. - * + * * @since 7.5.0 * @param hidable * {@code true} the user can hide this column, {@code false} @@ -5105,7 +5125,7 @@ public class Grid extends ResizeComposite implements *

    * Note: the column can be programmatically hidden using * {@link #setHidden(boolean)} regardless of the returned value. - * + * * @since 7.5.0 * @return true if the user can hide the column, * false if not @@ -5121,7 +5141,7 @@ public class Grid extends ResizeComposite implements *

    * The default value is null. In this case the header * caption is used, see {@link #setHeaderCaption(String)}. - * + * * @since 7.5.0 * @param hidingToggleCaption * the caption for the hiding toggle for this column @@ -5136,7 +5156,7 @@ public class Grid extends ResizeComposite implements /** * Gets the hiding toggle caption for this column. - * + * * @since 7.5.0 * @see #setHidingToggleCaption(String) * @return the hiding toggle's caption for this column @@ -5180,7 +5200,7 @@ public class Grid extends ResizeComposite implements * This action is done "finally", once the current execution loop * returns. This is done to reduce overhead of unintentionally always * recalculate all columns, when modifying several columns at once. - * + * * @param pixels * the minimum width * @return this column @@ -5203,13 +5223,13 @@ public class Grid extends ResizeComposite implements /** * Sets the maximum width for this column. *

    - * This defines the maximum allowed pixel width of the column - * when it is set to expand. + * This defines the maximum allowed pixel width of the column when + * it is set to expand. *

    * This action is done "finally", once the current execution loop * returns. This is done to reduce overhead of unintentionally always * recalculate all columns, when modifying several columns at once. - * + * * @param pixels * the maximum width * @param immediately @@ -5257,7 +5277,7 @@ public class Grid extends ResizeComposite implements * This action is done "finally", once the current execution loop * returns. This is done to reduce overhead of unintentionally always * recalculate all columns, when modifying several columns at once. - * + * * @param expandRatio * the expand ratio of this column. {@code 0} to not have it * expand at all. A negative number to clear the expand @@ -5276,7 +5296,7 @@ public class Grid extends ResizeComposite implements * Clears the column's expand ratio. *

    * Same as calling {@link #setExpandRatio(int) setExpandRatio(-1)} - * + * * @return this column */ public Column clearExpandRatio() { @@ -5285,7 +5305,7 @@ public class Grid extends ResizeComposite implements /** * Gets the minimum width for this column. - * + * * @return the minimum width for this column * @see #setMinimumWidth(double) */ @@ -5295,7 +5315,7 @@ public class Grid extends ResizeComposite implements /** * Gets the maximum width for this column. - * + * * @return the maximum width for this column * @see #setMaximumWidth(double) */ @@ -5305,7 +5325,7 @@ public class Grid extends ResizeComposite implements /** * Gets the expand ratio for this column. - * + * * @return the expand ratio for this column * @see #setExpandRatio(int) */ @@ -5316,15 +5336,15 @@ public class Grid extends ResizeComposite implements /** * Sets whether the values in this column should be editable by the user * when the row editor is active. By default columns are editable. - * + * * @param editable * {@code true} to set this column editable, {@code false} * otherwise * @return this column - * + * * @throws IllegalStateException * if the editor is currently active - * + * * @see Grid#editRow(int) * @see Grid#isEditorActive() */ @@ -5340,10 +5360,10 @@ public class Grid extends ResizeComposite implements /** * Returns whether the values in this column are editable by the user * when the row editor is active. - * + * * @return {@code true} if this column is editable, {@code false} * otherwise - * + * * @see #setEditable(boolean) */ public boolean isEditable() { @@ -5356,7 +5376,7 @@ public class Grid extends ResizeComposite implements } else { /* * NOOP - * + * * Since setGrid() will call reapplyWidths as the colum is * attached to a grid, it will call setWidth, which, in turn, * will call this method again. Therefore, it's guaranteed that @@ -5368,7 +5388,7 @@ public class Grid extends ResizeComposite implements /** * Resets the default header cell contents to column header captions. - * + * * @since 7.5.1 * @param cell * default header cell for this column @@ -5389,16 +5409,17 @@ public class Grid extends ResizeComposite implements Renderer renderer = findRenderer(cell); if (renderer instanceof ComplexRenderer) { try { - Column column = getVisibleColumn(cell.getColumn()); + Column column = getVisibleColumn( + cell.getColumn()); rendererCellReference.set(cell, getColumns().indexOf(column), column); ((ComplexRenderer) renderer) .init(rendererCellReference); } catch (RuntimeException e) { - getLogger().log( - Level.SEVERE, + getLogger().log(Level.SEVERE, "Error initing cell in column " - + cell.getColumn(), e); + + cell.getColumn(), + e); } } } @@ -5414,8 +5435,10 @@ public class Grid extends ResizeComposite implements Widget widget = widgetRenderer.createWidget(); assert widget != null : "WidgetRenderer.createWidget() returned null. It should return a widget."; - assert widget.getParent() == null : "WidgetRenderer.createWidget() returned a widget which already is attached."; - assert cell.getElement().getChildCount() == 0 : "Cell content should be empty when adding Widget"; + assert widget + .getParent() == null : "WidgetRenderer.createWidget() returned a widget which already is attached."; + assert cell.getElement() + .getChildCount() == 0 : "Cell content should be empty when adding Widget"; // Physical attach cell.getElement().appendChild(widget.getElement()); @@ -5423,10 +5446,10 @@ public class Grid extends ResizeComposite implements // Logical attach setParent(widget, Grid.this); } catch (RuntimeException e) { - getLogger().log( - Level.SEVERE, + getLogger().log(Level.SEVERE, "Error attaching child widget in column " - + cell.getColumn(), e); + + cell.getColumn(), + e); } } } @@ -5469,10 +5492,10 @@ public class Grid extends ResizeComposite implements .getStyle(rowReference); setCustomStyleName(rowElement, rowStylename); } catch (RuntimeException e) { - getLogger().log( - Level.SEVERE, + getLogger().log(Level.SEVERE, "Error generating styles for row " - + row.getRow(), e); + + row.getRow(), + e); } } else { // Remove in case there was a generator previously @@ -5498,16 +5521,16 @@ public class Grid extends ResizeComposite implements if (hasData && cellStyleGenerator != null) { try { - cellReference - .set(cell.getColumn(), columnIndex, column); + cellReference.set(cell.getColumn(), columnIndex, + column); String generatedStyle = cellStyleGenerator .getStyle(cellReference); setCustomStyleName(cell.getElement(), generatedStyle); } catch (RuntimeException e) { - getLogger().log( - Level.SEVERE, + getLogger().log(Level.SEVERE, "Error generating style for cell in column " - + cell.getColumn(), e); + + cell.getColumn(), + e); } } else if (hasData || usedToHaveData) { setCustomStyleName(cell.getElement(), null); @@ -5532,8 +5555,8 @@ public class Grid extends ResizeComposite implements } else { // Prepare cell for no data - clxRenderer.setContentVisible( - rendererCellReference, false); + clxRenderer.setContentVisible(rendererCellReference, + false); } } else if (hasData) { @@ -5546,10 +5569,10 @@ public class Grid extends ResizeComposite implements cell.getElement().removeAllChildren(); } } catch (RuntimeException e) { - getLogger().log( - Level.SEVERE, + getLogger().log(Level.SEVERE, "Error rendering cell in column " - + cell.getColumn(), e); + + cell.getColumn(), + e); } } } @@ -5560,8 +5583,8 @@ public class Grid extends ResizeComposite implements Renderer renderer = findRenderer(cell); if (renderer instanceof WidgetRenderer) { try { - Widget w = WidgetUtil.findWidget(cell.getElement() - .getFirstChildElement(), null); + Widget w = WidgetUtil.findWidget( + cell.getElement().getFirstChildElement(), null); if (w != null) { // Logical detach @@ -5571,10 +5594,10 @@ public class Grid extends ResizeComposite implements cell.getElement().removeChild(w.getElement()); } } catch (RuntimeException e) { - getLogger().log( - Level.SEVERE, + getLogger().log(Level.SEVERE, "Error detaching widget in column " - + cell.getColumn(), e); + + cell.getColumn(), + e); } } } @@ -5590,16 +5613,17 @@ public class Grid extends ResizeComposite implements Renderer renderer = findRenderer(cell); if (renderer instanceof ComplexRenderer) { try { - Column column = getVisibleColumn(cell.getColumn()); + Column column = getVisibleColumn( + cell.getColumn()); rendererCellReference.set(cell, getColumns().indexOf(column), column); ((ComplexRenderer) renderer) .destroy(rendererCellReference); } catch (RuntimeException e) { - getLogger().log( - Level.SEVERE, + getLogger().log(Level.SEVERE, "Error destroying cell in column " - + cell.getColumn(), e); + + cell.getColumn(), + e); } } } @@ -5631,7 +5655,8 @@ public class Grid extends ResizeComposite implements // Decorate default row with sorting indicators if (staticRow instanceof HeaderRow) { - addSortingIndicatorsToHeaderRow((HeaderRow) staticRow, cell); + addSortingIndicatorsToHeaderRow((HeaderRow) staticRow, + cell); } // Assign colspan to cell before rendering @@ -5660,10 +5685,8 @@ public class Grid extends ResizeComposite implements content.setClassName(getStylePrimaryName() + "-column-footer-content"); } else { - getLogger().severe( - "Unhandled static row type " - + staticRow.getClass() - .getCanonicalName()); + getLogger().severe("Unhandled static row type " + + staticRow.getClass().getCanonicalName()); } td.appendChild(content); @@ -5693,11 +5716,12 @@ public class Grid extends ResizeComposite implements && ((HeaderRow) staticRow).isDefault()) { final int column = cell.getColumn(); - DragHandle dragger = new DragHandle(getStylePrimaryName() - + "-column-resize-handle", + DragHandle dragger = new DragHandle( + getStylePrimaryName() + "-column-resize-handle", new DragHandleCallback() { - private Column col = getVisibleColumn(column); + private Column col = getVisibleColumn( + column); private double initialWidth = 0; private double minCellWidth; @@ -5712,9 +5736,8 @@ public class Grid extends ResizeComposite implements public void onStart() { initialWidth = col.getWidthActual(); - minCellWidth = escalator - .getMinCellWidth(getVisibleColumns() - .indexOf(col)); + minCellWidth = escalator.getMinCellWidth( + getVisibleColumns().indexOf(col)); for (Column c : getVisibleColumns()) { if (selectionColumn == c) { // Don't modify selection column. @@ -5804,7 +5827,7 @@ public class Grid extends ResizeComposite implements /** * Sort indicator requires a bit more space from the cell than normally. * This method check that the now sorted column has enough width. - * + * * @param column * sorted column */ @@ -5850,8 +5873,8 @@ public class Grid extends ResizeComposite implements List> columns = getVisibleColumns(); for (FlyweightCell cell : attachedCells) { - StaticSection.StaticCell metadata = gridRow.getCell(columns - .get(cell.getColumn())); + StaticSection.StaticCell metadata = gridRow + .getCell(columns.get(cell.getColumn())); /* * If the cell contains widgets that are not currently attached * then attach them now. @@ -5869,12 +5892,12 @@ public class Grid extends ResizeComposite implements @Override public void preDetach(Row row, Iterable cellsToDetach) { if (section.getRowCount() > row.getRow()) { - StaticSection.StaticRow gridRow = section.getRow(row - .getRow()); + StaticSection.StaticRow gridRow = section + .getRow(row.getRow()); List> columns = getVisibleColumns(); for (FlyweightCell cell : cellsToDetach) { - StaticSection.StaticCell metadata = gridRow.getCell(columns - .get(cell.getColumn())); + StaticSection.StaticCell metadata = gridRow + .getCell(columns.get(cell.getColumn())); if (GridStaticCellType.WIDGET.equals(metadata.getType()) && metadata.getWidget() != null @@ -5928,8 +5951,8 @@ public class Grid extends ResizeComposite implements } }); - escalator - .addRowVisibilityChangeHandler(new RowVisibilityChangeHandler() { + escalator.addRowVisibilityChangeHandler( + new RowVisibilityChangeHandler() { @Override public void onRowVisibilityChange( RowVisibilityChangeEvent event) { @@ -6038,9 +6061,9 @@ public class Grid extends ResizeComposite implements * Creates the escalator updater used to update the header rows in this * grid. The updater is invoked when header rows or columns are added or * removed, or the content of existing header cells is changed. - * + * * @return the new header updater instance - * + * * @see GridHeader * @see Grid#getHeader() */ @@ -6053,7 +6076,7 @@ public class Grid extends ResizeComposite implements * The updater is invoked when body rows or columns are added or removed, * the content of body cells is changed, or the body is scrolled to expose * previously hidden content. - * + * * @return the new body updater instance */ protected EscalatorUpdater createBodyUpdater() { @@ -6064,9 +6087,9 @@ public class Grid extends ResizeComposite implements * Creates the escalator updater used to update the footer rows in this * grid. The updater is invoked when header rows or columns are added or * removed, or the content of existing header cells is changed. - * + * * @return the new footer updater instance - * + * * @see GridFooter * @see #getFooter() */ @@ -6076,7 +6099,7 @@ public class Grid extends ResizeComposite implements /** * Refreshes header or footer rows on demand - * + * * @param rows * The row container * @param firstRowIsVisible @@ -6085,7 +6108,8 @@ public class Grid extends ResizeComposite implements * true if we refreshing the header, else assumed * the footer */ - private void refreshRowContainer(RowContainer rows, StaticSection section) { + private void refreshRowContainer(RowContainer rows, + StaticSection section) { // Add or Remove rows on demand int rowDiff = section.getVisibleRowCount() - rows.getRowCount(); @@ -6103,7 +6127,7 @@ public class Grid extends ResizeComposite implements /** * Focus a body cell by row and column index. - * + * * @param rowIndex * index of row to focus * @param columnIndex @@ -6113,10 +6137,11 @@ public class Grid extends ResizeComposite implements final Range rowRange = Range.between(0, dataSource.size()); final Range columnRange = Range.between(0, getVisibleColumns().size()); - assert rowRange.contains(rowIndex) : "Illegal row index. Should be in range " - + rowRange; - assert columnRange.contains(columnIndex) : "Illegal column index. Should be in range " - + columnRange; + assert rowRange.contains( + rowIndex) : "Illegal row index. Should be in range " + rowRange; + assert columnRange.contains( + columnIndex) : "Illegal column index. Should be in range " + + columnRange; if (rowRange.contains(rowIndex) && columnRange.contains(columnIndex)) { cellFocusHandler.setCellFocus(rowIndex, columnIndex, @@ -6148,7 +6173,7 @@ public class Grid extends ResizeComposite implements /** * Adds columns as the last columns in the grid. - * + * * @param columns * the columns to add */ @@ -6161,7 +6186,7 @@ public class Grid extends ResizeComposite implements /** * Adds a column as the last column in the grid. - * + * * @param column * the column to add * @return given column @@ -6173,21 +6198,21 @@ public class Grid extends ResizeComposite implements /** * Inserts a column into a specific position in the grid. - * + * * @param index * the index where the column should be inserted into * @param column * the column to add * @return given column - * + * * @throws IllegalStateException * if Grid's current selection model renders a selection column, * and {@code index} is 0. */ public > C addColumn(C column, int index) { if (column == selectionColumn) { - throw new IllegalArgumentException("The selection column many " - + "not be added manually"); + throw new IllegalArgumentException( + "The selection column many " + "not be added manually"); } else if (selectionColumn != null && index == 0) { throw new IllegalStateException("A column cannot be inserted " + "before the selection column"); @@ -6262,7 +6287,7 @@ public class Grid extends ResizeComposite implements /** * Removes a column from the grid. - * + * * @param column * the column to remove */ @@ -6279,8 +6304,8 @@ public class Grid extends ResizeComposite implements int columnIndex = columns.indexOf(column); // Remove from column configuration - escalator.getColumnConfiguration().removeColumns( - getVisibleColumns().indexOf(column), 1); + escalator.getColumnConfiguration() + .removeColumns(getVisibleColumns().indexOf(column), 1); updateFrozenColumns(); @@ -6301,7 +6326,7 @@ public class Grid extends ResizeComposite implements * Returns the amount of columns in the grid. *

    * NOTE: this includes the hidden columns in the count. - * + * * @return The number of columns in the grid */ public int getColumnCount() { @@ -6312,7 +6337,7 @@ public class Grid extends ResizeComposite implements * Returns a list columns in the grid, including hidden columns. *

    * For currently visible columns, use {@link #getVisibleColumns()}. - * + * * @return A unmodifiable list of the columns in the grid */ public List> getColumns() { @@ -6324,7 +6349,7 @@ public class Grid extends ResizeComposite implements * Returns a list of the currently visible columns in the grid. *

    * No {@link Column#isHidden() hidden} columns included. - * + * * @since 7.5.0 * @return A unmodifiable list of the currently visible columns in the grid */ @@ -6342,7 +6367,7 @@ public class Grid extends ResizeComposite implements * Returns a column by its index in the grid. *

    * NOTE: The indexing includes hidden columns. - * + * * @param index * the index of the column * @return The column in the given index @@ -6368,7 +6393,7 @@ public class Grid extends ResizeComposite implements /** * Returns the header section of this grid. The default header contains a * single row displaying the column captions. - * + * * @return the header */ protected Header getHeader() { @@ -6377,7 +6402,7 @@ public class Grid extends ResizeComposite implements /** * Gets the header row at given index. - * + * * @param rowIndex * 0 based index for row. Counted from top to bottom * @return header row at given index @@ -6392,11 +6417,11 @@ public class Grid extends ResizeComposite implements * Inserts a new row at the given position to the header section. Shifts the * row currently at that position and any subsequent rows down (adds one to * their indices). - * + * * @param index * the position at which to insert the row * @return the new row - * + * * @throws IllegalArgumentException * if the index is less than 0 or greater than row count * @see #appendHeaderRow() @@ -6410,7 +6435,7 @@ public class Grid extends ResizeComposite implements /** * Adds a new row at the bottom of the header section. - * + * * @return the new row * @see #prependHeaderRow() * @see #addHeaderRowAt(int) @@ -6425,7 +6450,7 @@ public class Grid extends ResizeComposite implements * Returns the current default row of the header section. The default row is * a special header row providing a user interface for sorting columns. * Setting a header caption for column updates cells in the default header. - * + * * @return the default row or null if no default row set */ public HeaderRow getDefaultHeaderRow() { @@ -6434,7 +6459,7 @@ public class Grid extends ResizeComposite implements /** * Gets the row count for the header section. - * + * * @return row count */ public int getHeaderRowCount() { @@ -6443,7 +6468,7 @@ public class Grid extends ResizeComposite implements /** * Adds a new row at the top of the header section. - * + * * @return the new row * @see #appendHeaderRow() * @see #addHeaderRowAt(int) @@ -6456,10 +6481,10 @@ public class Grid extends ResizeComposite implements /** * Removes the given row from the header section. - * + * * @param row * the row to be removed - * + * * @throws IllegalArgumentException * if the row does not exist in this section * @see #removeHeaderRow(int) @@ -6473,10 +6498,10 @@ public class Grid extends ResizeComposite implements /** * Removes the row at the given position from the header section. - * + * * @param index * the position of the row - * + * * @throws IllegalArgumentException * if no row exists at given index * @see #removeHeaderRow(HeaderRow) @@ -6494,10 +6519,10 @@ public class Grid extends ResizeComposite implements *

    * Note: Setting the default header row will reset all cell contents to * Column defaults. - * + * * @param row * the new default row, or null for no default row - * + * * @throws IllegalArgumentException * header does not contain the row */ @@ -6507,7 +6532,7 @@ public class Grid extends ResizeComposite implements /** * Sets the visibility of the header section. - * + * * @param visible * true to show header section, false to hide */ @@ -6517,7 +6542,7 @@ public class Grid extends ResizeComposite implements /** * Returns the visibility of the header section. - * + * * @return true if visible, false otherwise. */ public boolean isHeaderVisible() { @@ -6528,7 +6553,7 @@ public class Grid extends ResizeComposite implements /** * Returns the footer section of this grid. The default footer is empty. - * + * * @return the footer */ protected Footer getFooter() { @@ -6537,7 +6562,7 @@ public class Grid extends ResizeComposite implements /** * Gets the footer row at given index. - * + * * @param rowIndex * 0 based index for row. Counted from top to bottom * @return footer row at given index @@ -6552,11 +6577,11 @@ public class Grid extends ResizeComposite implements * Inserts a new row at the given position to the footer section. Shifts the * row currently at that position and any subsequent rows down (adds one to * their indices). - * + * * @param index * the position at which to insert the row * @return the new row - * + * * @throws IllegalArgumentException * if the index is less than 0 or greater than row count * @see #appendFooterRow() @@ -6570,7 +6595,7 @@ public class Grid extends ResizeComposite implements /** * Adds a new row at the bottom of the footer section. - * + * * @return the new row * @see #prependFooterRow() * @see #addFooterRowAt(int) @@ -6583,7 +6608,7 @@ public class Grid extends ResizeComposite implements /** * Gets the row count for the footer. - * + * * @return row count */ public int getFooterRowCount() { @@ -6592,7 +6617,7 @@ public class Grid extends ResizeComposite implements /** * Adds a new row at the top of the footer section. - * + * * @return the new row * @see #appendFooterRow() * @see #addFooterRowAt(int) @@ -6605,10 +6630,10 @@ public class Grid extends ResizeComposite implements /** * Removes the given row from the footer section. - * + * * @param row * the row to be removed - * + * * @throws IllegalArgumentException * if the row does not exist in this section * @see #removeFooterRow(int) @@ -6622,10 +6647,10 @@ public class Grid extends ResizeComposite implements /** * Removes the row at the given position from the footer section. - * + * * @param index * the position of the row - * + * * @throws IllegalArgumentException * if no row exists at given index * @see #removeFooterRow(FooterRow) @@ -6639,7 +6664,7 @@ public class Grid extends ResizeComposite implements /** * Sets the visibility of the footer section. - * + * * @param visible * true to show footer section, false to hide */ @@ -6649,7 +6674,7 @@ public class Grid extends ResizeComposite implements /** * Returns the visibility of the footer section. - * + * * @return true if visible, false otherwise. */ public boolean isFooterVisible() { @@ -6669,7 +6694,7 @@ public class Grid extends ResizeComposite implements *

    * Note: This method will change the widget's size in the browser * only if {@link #getHeightMode()} returns {@link HeightMode#CSS}. - * + * * @see #setHeightMode(HeightMode) */ @Override @@ -6684,7 +6709,7 @@ public class Grid extends ResizeComposite implements /** * Sets the data source used by this grid. - * + * * @param dataSource * the data source to use, not null * @throws IllegalArgumentException @@ -6743,12 +6768,12 @@ public class Grid extends ResizeComposite implements if (newSize > oldSize) { body.insertRows(oldSize, newSize - oldSize); - cellFocusHandler.rowsAddedToBody(Range.withLength(oldSize, - newSize - oldSize)); + cellFocusHandler.rowsAddedToBody( + Range.withLength(oldSize, newSize - oldSize)); } else if (newSize < oldSize) { body.removeRows(newSize, oldSize - newSize); - cellFocusHandler.rowsRemovedFromBody(Range.withLength( - newSize, oldSize - newSize)); + cellFocusHandler.rowsRemovedFromBody( + Range.withLength(newSize, oldSize - newSize)); } if (newSize > 0) { @@ -6790,7 +6815,7 @@ public class Grid extends ResizeComposite implements /** * Gets the {@Link DataSource} for this Grid. - * + * * @return the data source used by this grid */ public DataSource getDataSource() { @@ -6804,10 +6829,10 @@ public class Grid extends ResizeComposite implements * -1 will also disable the selection column. *

    * The default value is 0. - * + * * @param numberOfColumns * the number of columns that should be frozen - * + * * @throws IllegalArgumentException * if the column count is < -1 or > the number of visible * columns @@ -6824,8 +6849,8 @@ public class Grid extends ResizeComposite implements } private void updateFrozenColumns() { - escalator.getColumnConfiguration().setFrozenColumnCount( - getVisibleFrozenColumnCount()); + escalator.getColumnConfiguration() + .setFrozenColumnCount(getVisibleFrozenColumnCount()); } private int getVisibleFrozenColumnCount() { @@ -6855,7 +6880,7 @@ public class Grid extends ResizeComposite implements *

    * NOTE: This includes {@link Column#isHidden() hidden columns} in * the count. - * + * * @return the number of frozen columns */ public int getFrozenColumnCount() { @@ -6877,7 +6902,7 @@ public class Grid extends ResizeComposite implements *

    * If the details for that row are visible, those will be taken into account * as well. - * + * * @param rowIndex * zero-based index of the row to scroll to. * @throws IllegalArgumentException @@ -6894,7 +6919,7 @@ public class Grid extends ResizeComposite implements *

    * If the details for that row are visible, those will be taken into account * as well. - * + * * @param rowIndex * zero-based index of the row to scroll to. * @param destination @@ -6916,7 +6941,7 @@ public class Grid extends ResizeComposite implements *

    * If the details for that row are visible, those will be taken into account * as well. - * + * * @param rowIndex * zero-based index of the row to scroll to. * @param destination @@ -6936,8 +6961,8 @@ public class Grid extends ResizeComposite implements int maxsize = escalator.getBody().getRowCount() - 1; if (rowIndex < 0) { - throw new IllegalArgumentException("Row index (" + rowIndex - + ") is below zero!"); + throw new IllegalArgumentException( + "Row index (" + rowIndex + ") is below zero!"); } if (rowIndex > maxsize) { @@ -6965,7 +6990,7 @@ public class Grid extends ResizeComposite implements /** * Sets the vertical scroll offset. - * + * * @param px * the number of pixels this grid should be scrolled down */ @@ -6975,7 +7000,7 @@ public class Grid extends ResizeComposite implements /** * Gets the vertical scroll offset - * + * * @return the number of pixels this grid is scrolled down */ public double getScrollTop() { @@ -6984,7 +7009,7 @@ public class Grid extends ResizeComposite implements /** * Sets the horizontal scroll offset - * + * * @since 7.5.0 * @param px * the number of pixels this grid should be scrolled right @@ -6995,7 +7020,7 @@ public class Grid extends ResizeComposite implements /** * Gets the horizontal scroll offset - * + * * @return the number of pixels this grid is scrolled to the right */ public double getScrollLeft() { @@ -7004,7 +7029,7 @@ public class Grid extends ResizeComposite implements /** * Returns the height of the scrollable area in pixels. - * + * * @since 7.5.0 * @return the height of the scrollable area in pixels */ @@ -7014,7 +7039,7 @@ public class Grid extends ResizeComposite implements /** * Returns the width of the scrollable area in pixels. - * + * * @since 7.5.0 * @return the width of the scrollable area in pixels. */ @@ -7032,7 +7057,7 @@ public class Grid extends ResizeComposite implements *

    * If Grid is currently not in {@link HeightMode#ROW}, the given value is * remembered, and applied once the mode is applied. - * + * * @param rows * The height in terms of number of rows displayed in Grid's * body. If Grid doesn't contain enough rows, white space is @@ -7044,7 +7069,7 @@ public class Grid extends ResizeComposite implements * infinite} * @throws IllegalArgumentException * if {@code rows} is {@link Double#isNaN(double) NaN} - * + * * @see #setHeightMode(HeightMode) */ public void setHeightByRows(double rows) throws IllegalArgumentException { @@ -7056,7 +7081,7 @@ public class Grid extends ResizeComposite implements * {@link #getHeightMode()} is {@link HeightMode#ROW}. *

    * By default, it is {@value Escalator#DEFAULT_HEIGHT_BY_ROWS}. - * + * * @return the amount of rows that should be shown in Grid's body, while in * {@link HeightMode#ROW}. * @see #setHeightByRows(double) @@ -7076,7 +7101,7 @@ public class Grid extends ResizeComposite implements * Note: If headers/footers are inserted or removed, the widget * will resize itself to still display the required amount of rows in its * body. It also takes the horizontal scrollbar into account. - * + * * @param heightMode * the mode in to which Grid should be set */ @@ -7086,7 +7111,7 @@ public class Grid extends ResizeComposite implements * widget dimensions (height/width) on each state change event. The * original design was to have setHeight an setHeightByRow be equals, * and whichever was called the latest was considered in effect. - * + * * But, because of Vaadin always calling setHeight on the widget, this * approach doesn't work. */ @@ -7098,7 +7123,7 @@ public class Grid extends ResizeComposite implements * Returns the current {@link HeightMode} the Grid is in. *

    * Defaults to {@link HeightMode#CSS}. - * + * * @return the current HeightMode */ public HeightMode getHeightMode() { @@ -7296,7 +7321,8 @@ public class Grid extends ResizeComposite implements if (gridColumn.getRenderer() instanceof ComplexRenderer) { ComplexRenderer cplxRenderer = (ComplexRenderer) gridColumn .getRenderer(); - if (cplxRenderer.getConsumedEvents().contains(event.getType())) { + if (cplxRenderer.getConsumedEvents() + .contains(event.getType())) { if (cplxRenderer.onBrowserEvent(eventCell, event)) { return true; } @@ -7395,10 +7421,10 @@ public class Grid extends ResizeComposite implements event.preventDefault(); Touch touch = event.getChangedTouches().get(0); - double diffX = Math.abs(touch.getClientX() - - rowEventTouchStartingPoint.getX()); - double diffY = Math.abs(touch.getClientY() - - rowEventTouchStartingPoint.getY()); + double diffX = Math.abs( + touch.getClientX() - rowEventTouchStartingPoint.getX()); + double diffY = Math.abs( + touch.getClientY() - rowEventTouchStartingPoint.getY()); // Cancel long tap if finger strays too far from // starting point @@ -7444,7 +7470,8 @@ public class Grid extends ResizeComposite implements @Override @SuppressWarnings("deprecation") - public com.google.gwt.user.client.Element getSubPartElement(String subPart) { + public com.google.gwt.user.client.Element getSubPartElement( + String subPart) { /* * handles details[] (translated to spacer[] for Escalator), cell[], @@ -7452,17 +7479,16 @@ public class Grid extends ResizeComposite implements */ // "#header[0][0]/DRAGhANDLE" - Element escalatorElement = escalator.getSubPartElement(subPart - .replaceFirst("^details\\[", "spacer[")); + Element escalatorElement = escalator.getSubPartElement( + subPart.replaceFirst("^details\\[", "spacer[")); if (escalatorElement != null) { int detailIdx = subPart.indexOf("/"); if (detailIdx > 0) { String detail = subPart.substring(detailIdx + 1); - getLogger().severe( - "Looking up detail from index " + detailIdx - + " onward: \"" + detail + "\""); + getLogger().severe("Looking up detail from index " + detailIdx + + " onward: \"" + detail + "\""); if (detail.equalsIgnoreCase("content")) { // XXX: Fix this to look up by class name! return DOM.asOld(Element.as(escalatorElement.getChild(0))); @@ -7516,7 +7542,8 @@ public class Grid extends ResizeComposite implements @Override @SuppressWarnings("deprecation") - public String getSubPartName(com.google.gwt.user.client.Element subElement) { + public String getSubPartName( + com.google.gwt.user.client.Element subElement) { String escalatorStructureName = escalator.getSubPartName(subElement); if (escalatorStructureName != null) { @@ -7540,7 +7567,8 @@ public class Grid extends ResizeComposite implements int i = 0; for (Column column : columns) { - if (editor.getWidget(column).getElement().isOrHasChild(subElement)) { + if (editor.getWidget(column).getElement() + .isOrHasChild(subElement)) { return "editor[" + i + "]"; } ++i; @@ -7591,7 +7619,7 @@ public class Grid extends ResizeComposite implements * Sets the current selection model. *

    * This function will call {@link SelectionModel#setGrid(Grid)}. - * + * * @param selectionModel * a selection model implementation. * @throws IllegalArgumentException @@ -7610,8 +7638,8 @@ public class Grid extends ResizeComposite implements this.selectionModel = selectionModel; selectionModel.setGrid(this); - setSelectColumnRenderer(this.selectionModel - .getSelectionColumnRenderer()); + setSelectColumnRenderer( + this.selectionModel.getSelectionColumnRenderer()); // Refresh rendered rows to update selection, if it has changed refreshBody(); @@ -7619,7 +7647,7 @@ public class Grid extends ResizeComposite implements /** * Gets a reference to the current selection model. - * + * * @return the currently used SelectionModel instance. */ public SelectionModel getSelectionModel() { @@ -7630,7 +7658,7 @@ public class Grid extends ResizeComposite implements * Sets current selection mode. *

    * This is a shorthand method for {@link Grid#setSelectionModel}. - * + * * @param mode * a selection mode value * @see {@link SelectionMode}. @@ -7642,7 +7670,7 @@ public class Grid extends ResizeComposite implements /** * Test if a row is selected. - * + * * @param row * a row object * @return true, if the current selection model considers the provided row @@ -7658,7 +7686,7 @@ public class Grid extends ResizeComposite implements * Only selection models implementing {@link SelectionModel.Single} and * {@link SelectionModel.Multi} are supported; for anything else, an * exception will be thrown. - * + * * @param row * a row object * @return true iff the current selection changed @@ -7683,7 +7711,7 @@ public class Grid extends ResizeComposite implements * Only selection models implementing {@link SelectionModel.Single} and * {@link SelectionModel.Multi} are supported; for anything else, an * exception will be thrown. - * + * * @param row * a row object * @return true iff the current selection changed @@ -7704,7 +7732,7 @@ public class Grid extends ResizeComposite implements /** * Deselect all rows using the current selection model. - * + * * @param row * a row object * @return true iff the current selection changed @@ -7733,7 +7761,7 @@ public class Grid extends ResizeComposite implements * Only selection models implementing {@link SelectionModel.Single} are * valid for this method; for anything else, use the * {@link Grid#getSelectedRows()} method. - * + * * @return a selected row reference, or null, if no row is selected * @throws IllegalStateException * if the current selection model is not an instance of @@ -7750,7 +7778,7 @@ public class Grid extends ResizeComposite implements /** * Gets currently selected rows from the current selection model. - * + * * @return a non-null collection containing all currently selected rows. */ public Collection getSelectedRows() { @@ -7766,7 +7794,7 @@ public class Grid extends ResizeComposite implements /** * Sets the current sort order using the fluid Sort API. Read the * documentation for {@link Sort} for more information. - * + * * @param s * a sort instance */ @@ -7776,7 +7804,7 @@ public class Grid extends ResizeComposite implements /** * Sorts the Grid data in ascending order along one column. - * + * * @param column * a grid column reference */ @@ -7786,7 +7814,7 @@ public class Grid extends ResizeComposite implements /** * Sorts the Grid data along one column. - * + * * @param column * a grid column reference * @param direction @@ -7799,7 +7827,7 @@ public class Grid extends ResizeComposite implements /** * Sets the sort order to use. Setting this causes the Grid to re-sort * itself. - * + * * @param order * a sort order list. If set to null, the sort order is cleared. */ @@ -7827,7 +7855,7 @@ public class Grid extends ResizeComposite implements /** * Get a copy of the current sort order array. - * + * * @return a copy of the current sort order array */ public List getSortOrder() { @@ -7850,7 +7878,7 @@ public class Grid extends ResizeComposite implements * Register a GWT event handler for a sorting event. This handler gets * called whenever this Grid needs its data source to provide data sorted in * a specific order. - * + * * @param handler * a sort event handler * @return the registration for the event @@ -7862,11 +7890,12 @@ public class Grid extends ResizeComposite implements /** * Register a GWT event handler for a select all event. This handler gets * called whenever Grid needs all rows selected. - * + * * @param handler * a select all event handler */ - public HandlerRegistration addSelectAllHandler(SelectAllHandler handler) { + public HandlerRegistration addSelectAllHandler( + SelectAllHandler handler) { return addHandler(handler, SelectAllEvent.getType()); } @@ -7877,7 +7906,7 @@ public class Grid extends ResizeComposite implements *

    * This handle will be fired with the current available data after * registration is done. - * + * * @param handler * a data available event handler * @return the registartion for the event @@ -7889,8 +7918,8 @@ public class Grid extends ResizeComposite implements @Override public void execute() { if (!dataIsBeingFetched) { - handler.onDataAvailable(new DataAvailableEvent( - currentDataAvailable)); + handler.onDataAvailable( + new DataAvailableEvent(currentDataAvailable)); } } }); @@ -7901,12 +7930,13 @@ public class Grid extends ResizeComposite implements * Register a BodyKeyDownHandler to this Grid. The event for this handler is * fired when a KeyDown event occurs while cell focus is in the Body of this * Grid. - * + * * @param handler * the key handler to register * @return the registration for the event */ - public HandlerRegistration addBodyKeyDownHandler(BodyKeyDownHandler handler) { + public HandlerRegistration addBodyKeyDownHandler( + BodyKeyDownHandler handler) { return addHandler(handler, keyDown.getAssociatedType()); } @@ -7914,7 +7944,7 @@ public class Grid extends ResizeComposite implements * Register a BodyKeyUpHandler to this Grid. The event for this handler is * fired when a KeyUp event occurs while cell focus is in the Body of this * Grid. - * + * * @param handler * the key handler to register * @return the registration for the event @@ -7927,7 +7957,7 @@ public class Grid extends ResizeComposite implements * Register a BodyKeyPressHandler to this Grid. The event for this handler * is fired when a KeyPress event occurs while cell focus is in the Body of * this Grid. - * + * * @param handler * the key handler to register * @return the registration for the event @@ -7941,7 +7971,7 @@ public class Grid extends ResizeComposite implements * Register a HeaderKeyDownHandler to this Grid. The event for this handler * is fired when a KeyDown event occurs while cell focus is in the Header of * this Grid. - * + * * @param handler * the key handler to register * @return the registration for the event @@ -7955,12 +7985,13 @@ public class Grid extends ResizeComposite implements * Register a HeaderKeyUpHandler to this Grid. The event for this handler is * fired when a KeyUp event occurs while cell focus is in the Header of this * Grid. - * + * * @param handler * the key handler to register * @return the registration for the event */ - public HandlerRegistration addHeaderKeyUpHandler(HeaderKeyUpHandler handler) { + public HandlerRegistration addHeaderKeyUpHandler( + HeaderKeyUpHandler handler) { return addHandler(handler, keyUp.getAssociatedType()); } @@ -7968,7 +7999,7 @@ public class Grid extends ResizeComposite implements * Register a HeaderKeyPressHandler to this Grid. The event for this handler * is fired when a KeyPress event occurs while cell focus is in the Header * of this Grid. - * + * * @param handler * the key handler to register * @return the registration for the event @@ -7982,7 +8013,7 @@ public class Grid extends ResizeComposite implements * Register a FooterKeyDownHandler to this Grid. The event for this handler * is fired when a KeyDown event occurs while cell focus is in the Footer of * this Grid. - * + * * @param handler * the key handler to register * @return the registration for the event @@ -7996,12 +8027,13 @@ public class Grid extends ResizeComposite implements * Register a FooterKeyUpHandler to this Grid. The event for this handler is * fired when a KeyUp event occurs while cell focus is in the Footer of this * Grid. - * + * * @param handler * the key handler to register * @return the registration for the event */ - public HandlerRegistration addFooterKeyUpHandler(FooterKeyUpHandler handler) { + public HandlerRegistration addFooterKeyUpHandler( + FooterKeyUpHandler handler) { return addHandler(handler, keyUp.getAssociatedType()); } @@ -8009,7 +8041,7 @@ public class Grid extends ResizeComposite implements * Register a FooterKeyPressHandler to this Grid. The event for this handler * is fired when a KeyPress event occurs while cell focus is in the Footer * of this Grid. - * + * * @param handler * the key handler to register * @return the registration for the event @@ -8022,7 +8054,7 @@ public class Grid extends ResizeComposite implements /** * Register a BodyClickHandler to this Grid. The event for this handler is * fired when a Click event occurs in the Body of this Grid. - * + * * @param handler * the click handler to register * @return the registration for the event @@ -8034,24 +8066,26 @@ public class Grid extends ResizeComposite implements /** * Register a HeaderClickHandler to this Grid. The event for this handler is * fired when a Click event occurs in the Header of this Grid. - * + * * @param handler * the click handler to register * @return the registration for the event */ - public HandlerRegistration addHeaderClickHandler(HeaderClickHandler handler) { + public HandlerRegistration addHeaderClickHandler( + HeaderClickHandler handler) { return addHandler(handler, clickEvent.getAssociatedType()); } /** * Register a FooterClickHandler to this Grid. The event for this handler is * fired when a Click event occurs in the Footer of this Grid. - * + * * @param handler * the click handler to register * @return the registration for the event */ - public HandlerRegistration addFooterClickHandler(FooterClickHandler handler) { + public HandlerRegistration addFooterClickHandler( + FooterClickHandler handler) { return addHandler(handler, clickEvent.getAssociatedType()); } @@ -8059,7 +8093,7 @@ public class Grid extends ResizeComposite implements * Register a BodyDoubleClickHandler to this Grid. The event for this * handler is fired when a double click event occurs in the Body of this * Grid. - * + * * @param handler * the double click handler to register * @return the registration for the event @@ -8073,7 +8107,7 @@ public class Grid extends ResizeComposite implements * Register a HeaderDoubleClickHandler to this Grid. The event for this * handler is fired when a double click event occurs in the Header of this * Grid. - * + * * @param handler * the double click handler to register * @return the registration for the event @@ -8087,7 +8121,7 @@ public class Grid extends ResizeComposite implements * Register a FooterDoubleClickHandler to this Grid. The event for this * handler is fired when a double click event occurs in the Footer of this * Grid. - * + * * @param handler * the double click handler to register * @return the registration for the event @@ -8100,7 +8134,7 @@ public class Grid extends ResizeComposite implements /** * Register a column reorder handler to this Grid. The event for this * handler is fired when the Grid's columns are reordered. - * + * * @since 7.5.0 * @param handler * the handler for the event @@ -8114,7 +8148,7 @@ public class Grid extends ResizeComposite implements /** * Register a column visibility change handler to this Grid. The event for * this handler is fired when the Grid's columns change visibility. - * + * * @since 7.5.0 * @param handler * the handler for the event @@ -8128,7 +8162,7 @@ public class Grid extends ResizeComposite implements /** * Register a column resize handler to this Grid. The event for this handler * is fired when the Grid's columns are resized. - * + * * @since 7.6 * @param handler * the handler for the event @@ -8140,10 +8174,12 @@ public class Grid extends ResizeComposite implements } /** - * Register a enabled status change handler to this Grid. - * The event for this handler is fired when the Grid changes from disabled - * to enabled and vice-versa. - * @param handler the handler for the event + * Register a enabled status change handler to this Grid. The event for this + * handler is fired when the Grid changes from disabled to enabled and + * vice-versa. + * + * @param handler + * the handler for the event * @return the registration for the event */ public HandlerRegistration addEnabledHandler(GridEnabledHandler handler) { @@ -8191,7 +8227,7 @@ public class Grid extends ResizeComposite implements /** * Adds a scroll handler to this grid - * + * * @param handler * the scroll handler to add * @return a handler registration for the registered scroll handler @@ -8209,7 +8245,7 @@ public class Grid extends ResizeComposite implements /** * Returns whether columns can be reordered with drag and drop. - * + * * @since 7.5.0 * @return true if columns can be reordered, false otherwise */ @@ -8219,7 +8255,7 @@ public class Grid extends ResizeComposite implements /** * Sets whether column reordering with drag and drop is allowed or not. - * + * * @since 7.5.0 * @param columnReorderingAllowed * specifies whether column reordering is allowed @@ -8232,7 +8268,7 @@ public class Grid extends ResizeComposite implements * Sets a new column order for the grid. All columns which are not ordered * here will remain in the order they were before as the last columns of * grid. - * + * * @param orderedColumns * array of columns in wanted order */ @@ -8292,19 +8328,20 @@ public class Grid extends ResizeComposite implements /** * Sets the style generator that is used for generating styles for cells - * + * * @param cellStyleGenerator * the cell style generator to set, or null to * remove a previously set generator */ - public void setCellStyleGenerator(CellStyleGenerator cellStyleGenerator) { + public void setCellStyleGenerator( + CellStyleGenerator cellStyleGenerator) { this.cellStyleGenerator = cellStyleGenerator; refreshBody(); } /** * Gets the style generator that is used for generating styles for cells - * + * * @return the cell style generator, or null if no generator is * set */ @@ -8314,7 +8351,7 @@ public class Grid extends ResizeComposite implements /** * Sets the style generator that is used for generating styles for rows - * + * * @param rowStyleGenerator * the row style generator to set, or null to remove * a previously set generator @@ -8326,7 +8363,7 @@ public class Grid extends ResizeComposite implements /** * Gets the style generator that is used for generating styles for rows - * + * * @return the row style generator, or null if no generator is * set */ @@ -8354,10 +8391,10 @@ public class Grid extends ResizeComposite implements /** * Opens the editor over the row with the given index. - * + * * @param rowIndex * the index of the row to be edited - * + * * @throws IllegalStateException * if the editor is not enabled * @throws IllegalStateException @@ -8369,7 +8406,7 @@ public class Grid extends ResizeComposite implements /** * Returns whether the editor is currently open on some row. - * + * * @return {@code true} if the editor is active, {@code false} otherwise. */ public boolean isEditorActive() { @@ -8378,7 +8415,7 @@ public class Grid extends ResizeComposite implements /** * Saves any unsaved changes in the editor to the data source. - * + * * @throws IllegalStateException * if the editor is not enabled * @throws IllegalStateException @@ -8391,7 +8428,7 @@ public class Grid extends ResizeComposite implements /** * Cancels the currently active edit and hides the editor. Any changes that * are not {@link #saveEditor() saved} are lost. - * + * * @throws IllegalStateException * if the editor is not enabled * @throws IllegalStateException @@ -8404,7 +8441,7 @@ public class Grid extends ResizeComposite implements /** * Returns the handler responsible for binding data and editor widgets to * the editor. - * + * * @return the editor handler or null if not set */ public EditorHandler getEditorHandler() { @@ -8414,10 +8451,10 @@ public class Grid extends ResizeComposite implements /** * Sets the handler responsible for binding data and editor widgets to the * editor. - * + * * @param rowHandler * the new editor handler - * + * * @throws IllegalStateException * if the editor is currently in edit mode */ @@ -8427,7 +8464,7 @@ public class Grid extends ResizeComposite implements /** * Returns the enabled state of the editor. - * + * * @return true if editing is enabled, false otherwise */ public boolean isEditorEnabled() { @@ -8436,10 +8473,10 @@ public class Grid extends ResizeComposite implements /** * Sets the enabled state of the editor. - * + * * @param enabled * true to enable editing, false to disable - * + * * @throws IllegalStateException * if in edit mode and trying to disable * @throws IllegalStateException @@ -8452,7 +8489,7 @@ public class Grid extends ResizeComposite implements /** * Returns the editor widget associated with the given column. If the editor * is not active, returns null. - * + * * @param column * the column * @return the widget if the editor is open, null otherwise @@ -8463,7 +8500,7 @@ public class Grid extends ResizeComposite implements /** * Sets the caption on the save button in the Grid editor. - * + * * @param saveCaption * the caption to set * @throws IllegalArgumentException @@ -8476,7 +8513,7 @@ public class Grid extends ResizeComposite implements /** * Gets the current caption on the save button in the Grid editor. - * + * * @return the current caption on the save button */ public String getEditorSaveCaption() { @@ -8485,7 +8522,7 @@ public class Grid extends ResizeComposite implements /** * Sets the caption on the cancel button in the Grid editor. - * + * * @param cancelCaption * the caption to set * @throws IllegalArgumentException @@ -8498,7 +8535,7 @@ public class Grid extends ResizeComposite implements /** * Gets the caption on the cancel button in the Grid editor. - * + * * @return the current caption on the cancel button */ public String getEditorCancelCaption() { @@ -8538,7 +8575,8 @@ public class Grid extends ResizeComposite implements @Override public void execute() { - if (escalator.getInnerWidth() != autoColumnWidthsRecalculator.lastCalculatedInnerWidth) { + if (escalator + .getInnerWidth() != autoColumnWidthsRecalculator.lastCalculatedInnerWidth) { recalculateColumnWidths(); } @@ -8561,7 +8599,7 @@ public class Grid extends ResizeComposite implements *

    * This method is implemented only because removing widgets from Grid (added * via e.g. {@link Renderer}s) requires the {@link HasWidgets} interface. - * + * * @param w * irrelevant * @throws UnsupportedOperationException @@ -8579,7 +8617,7 @@ public class Grid extends ResizeComposite implements *

    * This method is implemented only because removing widgets from Grid (added * via e.g. {@link Renderer}s) requires the {@link HasWidgets} interface. - * + * * @throws UnsupportedOperationException * always */ @@ -8595,7 +8633,7 @@ public class Grid extends ResizeComposite implements *

    * This method is implemented only because removing widgets from Grid (added * via e.g. {@link Renderer}s) requires the {@link HasWidgets} interface. - * + * * @return never * @throws UnsupportedOperationException * always @@ -8612,7 +8650,7 @@ public class Grid extends ResizeComposite implements *

    * This method is implemented only because removing widgets from Grid (added * via e.g. {@link Renderer}s) requires the {@link HasWidgets} interface. - * + * * @return always false */ @Override @@ -8624,7 +8662,7 @@ public class Grid extends ResizeComposite implements * corresponding Widget will call removeFromParent() on itself. GWT will * check there that its parent (i.e. Grid) implements HasWidgets, and * will call this remove(Widget) method. - * + * * tl;dr: all this song and dance to make sure GWT's sanity checks * aren't triggered, even though they effectively do nothing interesting * from Grid's perspective. @@ -8634,7 +8672,7 @@ public class Grid extends ResizeComposite implements /** * Accesses the package private method Widget#setParent() - * + * * @param widget * The widget to access * @param parent @@ -8696,7 +8734,7 @@ public class Grid extends ResizeComposite implements * Sets a new details generator for row details. *

    * The currently opened row details will be re-rendered. - * + * * @since 7.5.0 * @param detailsGenerator * the details generator to set @@ -8723,7 +8761,7 @@ public class Grid extends ResizeComposite implements /** * Gets the current details generator for row details. - * + * * @since 7.5.0 * @return the detailsGenerator the current details generator */ @@ -8736,7 +8774,7 @@ public class Grid extends ResizeComposite implements *

    * This method does nothing if trying to set show already-visible details, * or hide already-hidden details. - * + * * @since 7.5.0 * @param rowIndex * the index of the affected row @@ -8755,17 +8793,17 @@ public class Grid extends ResizeComposite implements /* * We want to prevent opening a details row twice, so any subsequent * openings (or closings) of details is a NOOP. - * + * * When a details row is opened, it is given an arbitrary height * (because Escalator requires a height upon opening). Only when it's * opened, Escalator will ask the generator to generate a widget, which * we then can measure. When measured, we correct the initial height by * the original height. - * + * * Without this check, we would override the measured height, and revert * back to the initial, arbitrary, height which would most probably be * wrong. - * + * * see GridSpacerUpdater.init for implementation details. */ @@ -8783,7 +8821,7 @@ public class Grid extends ResizeComposite implements /** * Check whether the details for a row is visible or not. - * + * * @since 7.5.0 * @param rowIndex * the index of the row for which to check details @@ -8800,7 +8838,7 @@ public class Grid extends ResizeComposite implements * The actual recalculation is not necessarily done immediately so you * cannot rely on the columns being the correct width after the call * returns. - * + * * @since 7.4.1 */ public void recalculateColumnWidths() { @@ -8814,7 +8852,7 @@ public class Grid extends ResizeComposite implements * the items in the beginning of the menu that control the column hiding if * any columns are marked as hidable. A toggle for opening the menu will be * displayed whenever the menu contains at least one item. - * + * * @since 7.5.0 * @return the menu bar */ @@ -8824,7 +8862,7 @@ public class Grid extends ResizeComposite implements /** * Tests whether the sidebar menu is currently open. - * + * * @since 7.5.0 * @see #getSidebarMenu() * @return true if the sidebar is open; false if @@ -8836,8 +8874,8 @@ public class Grid extends ResizeComposite implements /** * Sets whether the sidebar menu is open. - * - * + * + * * @since 7.5.0 * @see #getSidebarMenu() * @see #isSidebarOpen() @@ -8880,7 +8918,7 @@ public class Grid extends ResizeComposite implements /** * Sets the buffered editor mode. - * + * * @since 7.6 * @param editorUnbuffered * true to enable buffered editor, @@ -8892,7 +8930,7 @@ public class Grid extends ResizeComposite implements /** * Gets the buffered editor mode. - * + * * @since 7.6 * @return true if buffered editor is enabled, * false otherwise @@ -8906,7 +8944,7 @@ public class Grid extends ResizeComposite implements * this Grid. *

    * Note: This cell reference will be updated when firing the next event. - * + * * @since 7.5 * @return event cell reference */ @@ -8917,7 +8955,7 @@ public class Grid extends ResizeComposite implements /** * Returns a CellReference for the cell to which the given element belongs * to. - * + * * @since 7.6 * @param element * Element to find from the cell's content. diff --git a/client/src/main/java/com/vaadin/client/widgets/Overlay.java b/client/src/main/java/com/vaadin/client/widgets/Overlay.java index b10b1a1f3d..46a4f0bff5 100644 --- a/client/src/main/java/com/vaadin/client/widgets/Overlay.java +++ b/client/src/main/java/com/vaadin/client/widgets/Overlay.java @@ -50,7 +50,7 @@ import com.vaadin.client.WidgetUtil; *

    * Note: This class should always be constructed with * {@link GWT#create(Class)}. - * + * *

    Shadow

    *

    * The separate shadow element underneath the main overlay element is @@ -61,7 +61,7 @@ import com.vaadin.client.WidgetUtil; * supports, add -webkit-box-shadow and the standard * box-shadow properties. *

    - * + * *

    * For IE8, which doesn't support CSS box-shadow, you can use the proprietary * DropShadow filter. It doesn't provide the exact same features as box-shadow, @@ -69,13 +69,13 @@ import com.vaadin.client.WidgetUtil; * border or a pseudo-element underneath the overlay which mimics a shadow, or * any combination of these. *

    - * + * *

    - * Read more about the DropShadow filter from Microsoft Developer Network *

    - * + * * @since 7.6.1 */ public class Overlay extends PopupPanel implements CloseHandler { @@ -165,7 +165,7 @@ public class Overlay extends PopupPanel implements CloseHandler { * Shadow element style. If an extending class wishes to use a different * style of shadow, it can use setShadowStyle(String) to give the shadow * element a new style name. - * + * * @deprecated See main JavaDoc for Overlay */ @Deprecated @@ -188,9 +188,9 @@ public class Overlay extends PopupPanel implements CloseHandler { /** * The shadow element for this overlay. - * + * * @deprecated See main JavaDoc for Overlay - * + * */ @Deprecated private Element shadow; @@ -210,7 +210,7 @@ public class Overlay extends PopupPanel implements CloseHandler { /** * The HTML snippet that is used to render the actual shadow. In consists of * nine different DIV-elements with the following class names: - * + * *
          *   .v-shadow[-stylename]
          *   ----------------------------------------------
    @@ -223,9 +223,9 @@ public class Overlay extends PopupPanel implements CloseHandler {
          *   | .bottom-left  |  .bottom  |  .bottom-right |
          *   ----------------------------------------------
          * 
    - * + * * See default theme 'shadow.css' for implementation example. - * + * * @deprecated See main JavaDoc for Overlay */ @Deprecated @@ -274,7 +274,7 @@ public class Overlay extends PopupPanel implements CloseHandler { * Return true if a separate shadow div should be used. Since Vaadin 7.3, * shadows are implemented with CSS box-shadow. Thus, a shadow div is only * used for IE8 by default. - * + * * @deprecated See main JavaDoc for Overlay * @since 7.3 * @return true to use a shadow div @@ -288,10 +288,10 @@ public class Overlay extends PopupPanel implements CloseHandler { * Method to control whether DOM elements for shadow are added. With this * method subclasses can control displaying of shadow also after the * constructor. - * + * * @param enabled * true if shadow should be displayed - * + * * @deprecated See main JavaDoc for Overlay */ @Deprecated @@ -355,7 +355,7 @@ public class Overlay extends PopupPanel implements CloseHandler { /** * Set the z-index (visual stack position) for this overlay. - * + * * @param zIndex * The new z-index */ @@ -526,7 +526,7 @@ public class Overlay extends PopupPanel implements CloseHandler { * A "thread local" of sorts, set temporarily so that OverlayImpl knows * which Overlay is using it, so that it can be attached to the correct * overlay container. - * + * * TODO this is a strange pattern that we should get rid of when possible. */ protected static Overlay current; @@ -575,17 +575,20 @@ public class Overlay extends PopupPanel implements CloseHandler { if (animationName.contains(ADDITIONAL_CLASSNAME_ANIMATE_IN)) { // Disable GWT PopupPanel animation if used setAnimationEnabled(false); - AnimationUtil.addAnimationEndListener( - getElement(), new AnimationEndListener() { + AnimationUtil.addAnimationEndListener(getElement(), + new AnimationEndListener() { @Override public void onAnimationEnd(NativeEvent event) { String animationName = AnimationUtil .getAnimationName(event); - if (animationName - .contains(ADDITIONAL_CLASSNAME_ANIMATE_IN)) { - boolean removed = AnimationUtil.removeAnimationEndListener(getElement(), this); - assert removed: "Animation end listener was not removed"; - removeStyleDependentName(ADDITIONAL_CLASSNAME_ANIMATE_IN); + if (animationName.contains( + ADDITIONAL_CLASSNAME_ANIMATE_IN)) { + boolean removed = AnimationUtil + .removeAnimationEndListener( + getElement(), this); + assert removed : "Animation end listener was not removed"; + removeStyleDependentName( + ADDITIONAL_CLASSNAME_ANIMATE_IN); if (isShadowEnabled()) { shadow.removeClassName(CLASSNAME_SHADOW + "-" @@ -644,12 +647,12 @@ public class Overlay extends PopupPanel implements CloseHandler { * Sets the shadow style for this overlay. Will override any previous style * for the shadow. The default style name is defined by CLASSNAME_SHADOW. * The given style will be prefixed with CLASSNAME_SHADOW. - * + * * @param style * The new style name for the shadow element. Will be prefixed by * CLASSNAME_SHADOW, e.g. style=='foobar' -> actual style * name=='v-shadow-foobar'. - * + * * @deprecated See main JavaDoc for Overlay */ @Deprecated @@ -663,7 +666,7 @@ public class Overlay extends PopupPanel implements CloseHandler { * Extending classes should always call this method after they change the * size of overlay without using normal 'setWidth(String)' and * 'setHeight(String)' methods (if not calling super.setWidth/Height). - * + * */ public void positionOrSizeUpdated() { positionOrSizeUpdated(1.0); @@ -682,7 +685,7 @@ public class Overlay extends PopupPanel implements CloseHandler { * elements. Can be used to animate the related elements, using the * 'progress' parameter (used to animate the shadow in sync with GWT * PopupPanel's default animation 'PopupPanel.AnimationType.CENTER'). - * + * * @param progress * A value between 0.0 and 1.0, indicating the progress of the * animation (0=start, 1=end). @@ -768,18 +771,12 @@ public class Overlay extends PopupPanel implements CloseHandler { // Opera fix, part 2 (ticket #2704) if (BrowserInfo.get().isOpera()) { // We'll fix the height of all the middle elements - DOM.getChild(shadow, 3) - .getStyle() - .setPropertyPx("height", - DOM.getChild(shadow, 3).getOffsetHeight()); - DOM.getChild(shadow, 4) - .getStyle() - .setPropertyPx("height", - DOM.getChild(shadow, 4).getOffsetHeight()); - DOM.getChild(shadow, 5) - .getStyle() - .setPropertyPx("height", - DOM.getChild(shadow, 5).getOffsetHeight()); + DOM.getChild(shadow, 3).getStyle().setPropertyPx("height", + DOM.getChild(shadow, 3).getOffsetHeight()); + DOM.getChild(shadow, 4).getStyle().setPropertyPx("height", + DOM.getChild(shadow, 4).getOffsetHeight()); + DOM.getChild(shadow, 5).getStyle().setPropertyPx("height", + DOM.getChild(shadow, 5).getOffsetHeight()); } } @@ -791,7 +788,7 @@ public class Overlay extends PopupPanel implements CloseHandler { * Returns true if we should add a shim iframe below the overlay to deal * with zindex issues with PDFs and applets. Can be overriden to disable * shim iframes if they are not needed. - * + * * @return true if a shim iframe should be added, false otherwise */ protected boolean needsShimElement() { @@ -853,13 +850,13 @@ public class Overlay extends PopupPanel implements CloseHandler { /** * Enables or disables sinking the events of the shadow to the same * onBrowserEvent as events to the actual overlay goes. - * + * * Please note, that if you enable this, you can't assume that e.g. * event.getEventTarget returns an element inside the DOM structure of the * overlay - * + * * @param sinkShadowEvents - * + * * @deprecated See main JavaDoc for Overlay */ @Deprecated @@ -883,7 +880,7 @@ public class Overlay extends PopupPanel implements CloseHandler { /** * Get owner (Widget that made this Overlay, not the layout parent) of * Overlay - * + * * @return Owner (creator) or null if not defined */ public Widget getOwner() { @@ -893,7 +890,7 @@ public class Overlay extends PopupPanel implements CloseHandler { /** * Set owner (Widget that made this Overlay, not the layout parent) of * Overlay - * + * * @param owner * Owner (creator) of Overlay */ @@ -903,7 +900,7 @@ public class Overlay extends PopupPanel implements CloseHandler { /** * Gets the 'overlay container' element. - * + * * @return the overlay container element */ public com.google.gwt.user.client.Element getOverlayContainer() { @@ -929,10 +926,10 @@ public class Overlay extends PopupPanel implements CloseHandler { /** * Gets the visual viewport width, which is useful for e.g iOS where the * view can be zoomed in while keeping the layout viewport intact. - * + * * Falls back to layout viewport; for those browsers/devices the difference * is that the scrollbar with is included (if there is a scrollbar). - * + * * @since 7.0.7 * @return */ @@ -948,10 +945,10 @@ public class Overlay extends PopupPanel implements CloseHandler { /** * Gets the visual viewport height, which is useful for e.g iOS where the * view can be zoomed in while keeping the layout viewport intact. - * + * * Falls back to layout viewport; for those browsers/devices the difference * is that the scrollbar with is included (if there is a scrollbar). - * + * * @since 7.0.7 * @return */ @@ -976,7 +973,7 @@ public class Overlay extends PopupPanel implements CloseHandler { /* * (non-Javadoc) - * + * * @see com.google.gwt.user.client.ui.PopupPanel#hide() */ @Override @@ -986,7 +983,7 @@ public class Overlay extends PopupPanel implements CloseHandler { /* * (non-Javadoc) - * + * * @see com.google.gwt.user.client.ui.PopupPanel#hide(boolean) */ @Override @@ -995,13 +992,13 @@ public class Overlay extends PopupPanel implements CloseHandler { } /** - * + * * Hides the popup and detaches it from the page. This has no effect if it * is not currently showing. Animation-in, animation-out can be * enable/disabled for different use cases. - * + * * @see com.google.gwt.user.client.ui.PopupPanel#hide(boolean) - * + * * @param autoClosed * the value that will be passed to * {@link CloseHandler#onClose(CloseEvent)} when the popup is @@ -1017,18 +1014,19 @@ public class Overlay extends PopupPanel implements CloseHandler { if (BrowserInfo.get().isIE8() || BrowserInfo.get().isIE9()) { reallyHide(autoClosed); } else { - if (animateIn - && getStyleName().contains(ADDITIONAL_CLASSNAME_ANIMATE_IN)) { + if (animateIn && getStyleName() + .contains(ADDITIONAL_CLASSNAME_ANIMATE_IN)) { AnimationUtil.addAnimationEndListener(getElement(), new AnimationEndListener() { @Override public void onAnimationEnd(NativeEvent event) { - if (AnimationUtil - .getAnimationName(event) + if (AnimationUtil.getAnimationName(event) .contains( ADDITIONAL_CLASSNAME_ANIMATE_IN)) { - boolean removed = AnimationUtil.removeAnimationEndListener(getElement(), this); - assert removed: "Animation end listener was not removed"; + boolean removed = AnimationUtil + .removeAnimationEndListener( + getElement(), this); + assert removed : "Animation end listener was not removed"; reallyHide(autoClosed); } } @@ -1046,9 +1044,8 @@ public class Overlay extends PopupPanel implements CloseHandler { animationName = ""; } - if (animateOut - && animationName - .contains(ADDITIONAL_CLASSNAME_ANIMATE_OUT)) { + if (animateOut && animationName + .contains(ADDITIONAL_CLASSNAME_ANIMATE_OUT)) { // Disable GWT PopupPanel closing animation if used setAnimationEnabled(false); @@ -1058,21 +1055,25 @@ public class Overlay extends PopupPanel implements CloseHandler { public void onAnimationEnd(NativeEvent event) { String animationName = AnimationUtil .getAnimationName(event); - if (animationName - .contains(ADDITIONAL_CLASSNAME_ANIMATE_OUT)) { - boolean removed = AnimationUtil.removeAnimationEndListener(getElement(), this); - assert removed: "Animation end listener was not removed"; + if (animationName.contains( + ADDITIONAL_CLASSNAME_ANIMATE_OUT)) { + boolean removed = AnimationUtil + .removeAnimationEndListener( + getElement(), this); + assert removed : "Animation end listener was not removed"; // Remove both animation styles just in // case - removeStyleDependentName(ADDITIONAL_CLASSNAME_ANIMATE_IN); - removeStyleDependentName(ADDITIONAL_CLASSNAME_ANIMATE_OUT); + removeStyleDependentName( + ADDITIONAL_CLASSNAME_ANIMATE_IN); + removeStyleDependentName( + ADDITIONAL_CLASSNAME_ANIMATE_OUT); if (isShadowEnabled()) { - shadow.removeClassName(CLASSNAME_SHADOW - + "-" - + ADDITIONAL_CLASSNAME_ANIMATE_IN); - shadow.removeClassName(CLASSNAME_SHADOW - + "-" - + ADDITIONAL_CLASSNAME_ANIMATE_OUT); + shadow.removeClassName( + CLASSNAME_SHADOW + "-" + + ADDITIONAL_CLASSNAME_ANIMATE_IN); + shadow.removeClassName( + CLASSNAME_SHADOW + "-" + + ADDITIONAL_CLASSNAME_ANIMATE_OUT); } reallyHide(autoClosed); } @@ -1114,7 +1115,7 @@ public class Overlay extends PopupPanel implements CloseHandler { * it does not fit on either side. If the popup is larger than the window, * it will be shrunk to fit and assume that scrolling e.g. using * overflow:auto, is taken care of by the overlay user. - * + * * @since 7.6.6 * @param fitInWindow * true to ensure that no part of the popup is @@ -1128,9 +1129,9 @@ public class Overlay extends PopupPanel implements CloseHandler { /** * Checks whether the overlay should be moved or shrunk to fit inside the * window. - * + * * @see #setFitInWindow(boolean) - * + * * @since 7.6.6 * @return true if the popup will be moved and/or shrunk to fit * inside the window, false otherwise diff --git a/client/src/test/java/com/vaadin/client/ApplicationConnectionURLGenerationTest.java b/client/src/test/java/com/vaadin/client/ApplicationConnectionURLGenerationTest.java index 4dd2ddbaa4..8a84208ea8 100644 --- a/client/src/test/java/com/vaadin/client/ApplicationConnectionURLGenerationTest.java +++ b/client/src/test/java/com/vaadin/client/ApplicationConnectionURLGenerationTest.java @@ -10,10 +10,8 @@ public class ApplicationConnectionURLGenerationTest { private static final String[] URIS = new String[] { "http://demo.vaadin.com/", // - "https://demo.vaadin.com/", - "http://demo.vaadin.com/foo", - "http://demo.vaadin.com/foo?f", - "http://demo.vaadin.com/foo?f=1", + "https://demo.vaadin.com/", "http://demo.vaadin.com/foo", + "http://demo.vaadin.com/foo?f", "http://demo.vaadin.com/foo?f=1", "http://demo.vaadin.com:1234/foo?a", "http://demo.vaadin.com:1234/foo#frag?fakeparam", // Jetspeed @@ -41,8 +39,7 @@ public class ApplicationConnectionURLGenerationTest { "http://demo.vaadin.com/foo?a=b&c=d#fragment", "http://demo.vaadin.com/foo?f&a=b&c=d#fragment", "http://demo.vaadin.com/foo?f=1&a=b&c=d#fragment", - "http://demo.vaadin.com:1234/foo?a&a=b&c=d#fragment", - "", + "http://demo.vaadin.com:1234/foo?a&a=b&c=d#fragment", "", "http://localhost:8080/jetspeed/portal/_ns:Z3RlbXBsYXRlLXRvcDJfX3BhZ2UtdGVtcGxhdGVfX2RwLTFfX1AtMTJjNTRkYjdlYjUtMTAwMDJ8YzB8ZDF8aVVJREx8Zg__?a=b&c=d#fragment", "http://vaadin.com/directory?p_p_id=Directory_WAR_Directory&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&p_p_resource_id=UIDL&p_p_cacheability=cacheLevelPage&p_p_col_id=row-1&p_p_col_count=1&a=b&c=d#fragment", @@ -60,14 +57,14 @@ public class ApplicationConnectionURLGenerationTest { // Fragments if (URIS_WITH_ABCD_PARAM_AND_FRAGMENT[i].length() > 0) { - assertEquals(URIS_WITH_ABCD_PARAM_AND_FRAGMENT[i], - SharedUtil.addGetParameters(URIS[i] + "#fragment", - "a=b&c=d")); + assertEquals(URIS_WITH_ABCD_PARAM_AND_FRAGMENT[i], SharedUtil + .addGetParameters(URIS[i] + "#fragment", "a=b&c=d")); // Empty fragment - assertEquals(URIS_WITH_ABCD_PARAM_AND_FRAGMENT[i].replace( - "#fragment", "#"), SharedUtil.addGetParameters(URIS[i] - + "#", "a=b&c=d")); + assertEquals( + URIS_WITH_ABCD_PARAM_AND_FRAGMENT[i] + .replace("#fragment", "#"), + SharedUtil.addGetParameters(URIS[i] + "#", "a=b&c=d")); } } } diff --git a/client/src/test/java/com/vaadin/client/DateTimeServiceTest.java b/client/src/test/java/com/vaadin/client/DateTimeServiceTest.java index e5e6cbd7db..912abc412a 100755 --- a/client/src/test/java/com/vaadin/client/DateTimeServiceTest.java +++ b/client/src/test/java/com/vaadin/client/DateTimeServiceTest.java @@ -65,7 +65,7 @@ public class DateTimeServiceTest { /** * Test all dates from 1990-1992 + some more and see that {@link Calendar} * calculates the ISO week number like we do. - * + * */ @Test public void testISOWeekNumbers() { @@ -86,7 +86,7 @@ public class DateTimeServiceTest { /** * Verify that special cases are handled correctly by us (and * {@link Calendar}). - * + * */ @Test public void testSampleISOWeekNumbers() { @@ -94,9 +94,10 @@ public class DateTimeServiceTest { // System.out.println("Sample: " + d); int expected = isoWeekNumbers.get(d); int calculated = DateTimeService.getISOWeekNumber(d); - Assert.assertEquals(d + " should be week " + expected - + " (Java Calendar is wrong?)", expected, - getCalendarISOWeekNr(d)); + Assert.assertEquals( + d + " should be week " + expected + + " (Java Calendar is wrong?)", + expected, getCalendarISOWeekNr(d)); Assert.assertEquals(d + " should be week " + expected, expected, calculated); diff --git a/client/src/test/java/com/vaadin/client/LocatorUtilTest.java b/client/src/test/java/com/vaadin/client/LocatorUtilTest.java index 971688e1c5..64a783549a 100644 --- a/client/src/test/java/com/vaadin/client/LocatorUtilTest.java +++ b/client/src/test/java/com/vaadin/client/LocatorUtilTest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/client/src/test/java/com/vaadin/client/VBrowserDetailsUserAgentParserTest.java b/client/src/test/java/com/vaadin/client/VBrowserDetailsUserAgentParserTest.java index 41e675cb3a..c7eaf306fe 100644 --- a/client/src/test/java/com/vaadin/client/VBrowserDetailsUserAgentParserTest.java +++ b/client/src/test/java/com/vaadin/client/VBrowserDetailsUserAgentParserTest.java @@ -415,7 +415,8 @@ public class VBrowserDetailsUserAgentParserTest { @Test public void testIE9InIE8CompatibilityMode() { - VBrowserDetails bd = new VBrowserDetails(IE9_BETA_IN_IE8_MODE_WINDOWS_7); + VBrowserDetails bd = new VBrowserDetails( + IE9_BETA_IN_IE8_MODE_WINDOWS_7); // bd.setIE8InCompatibilityMode(); /* @@ -621,8 +622,8 @@ public class VBrowserDetailsUserAgentParserTest { assertFalse(browserDetails.isAndroid()); } - private void assertAndroid(VBrowserDetails browserDetails, - int majorVersion, int minorVersion) { + private void assertAndroid(VBrowserDetails browserDetails, int majorVersion, + int minorVersion) { assertFalse(browserDetails.isLinux()); assertFalse(browserDetails.isWindows()); assertFalse(browserDetails.isMacOSX()); diff --git a/client/src/test/java/com/vaadin/client/communication/ServerMessageHandlerTest.java b/client/src/test/java/com/vaadin/client/communication/ServerMessageHandlerTest.java index 7b0d886c39..8aa70bc4e9 100644 --- a/client/src/test/java/com/vaadin/client/communication/ServerMessageHandlerTest.java +++ b/client/src/test/java/com/vaadin/client/communication/ServerMessageHandlerTest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -19,7 +19,7 @@ import org.junit.Assert; import org.junit.Test; /** - * + * * @since 7.7 * @author Vaadin Ltd */ diff --git a/client/src/test/java/com/vaadin/client/ui/grid/ListDataSourceTest.java b/client/src/test/java/com/vaadin/client/ui/grid/ListDataSourceTest.java index 24ccd6c57e..89a2e80679 100644 --- a/client/src/test/java/com/vaadin/client/ui/grid/ListDataSourceTest.java +++ b/client/src/test/java/com/vaadin/client/ui/grid/ListDataSourceTest.java @@ -185,8 +185,8 @@ public class ListDataSourceTest { } }); - assertTrue(Arrays.equals(ds.asList().toArray(), new Integer[] { 1, 2, - 3, 3, 4 })); + assertTrue(Arrays.equals(ds.asList().toArray(), + new Integer[] { 1, 2, 3, 3, 4 })); } } diff --git a/client/src/test/java/com/vaadin/client/ui/grid/PartitioningTest.java b/client/src/test/java/com/vaadin/client/ui/grid/PartitioningTest.java index e97bb339e4..ac4d39006a 100644 --- a/client/src/test/java/com/vaadin/client/ui/grid/PartitioningTest.java +++ b/client/src/test/java/com/vaadin/client/ui/grid/PartitioningTest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2013 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the diff --git a/server/src/main/java/com/vaadin/annotations/AutoGenerated.java b/server/src/main/java/com/vaadin/annotations/AutoGenerated.java index 1ad9f67ad1..a20c9c99a7 100644 --- a/server/src/main/java/com/vaadin/annotations/AutoGenerated.java +++ b/server/src/main/java/com/vaadin/annotations/AutoGenerated.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -17,9 +17,9 @@ package com.vaadin.annotations; /** * Marker annotation for automatically generated code elements. - * + * * These elements may be modified or removed by code generation. - * + * * @author Vaadin Ltd. * @since 6.0 */ diff --git a/server/src/main/java/com/vaadin/annotations/DesignRoot.java b/server/src/main/java/com/vaadin/annotations/DesignRoot.java index a00a00dc0b..7a913be4fc 100644 --- a/server/src/main/java/com/vaadin/annotations/DesignRoot.java +++ b/server/src/main/java/com/vaadin/annotations/DesignRoot.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -30,7 +30,7 @@ import com.vaadin.ui.declarative.Design; * the same package as the annotated class and by default the design filename is * derived from the class name. Using the {@link #value()} parameter you can * specify another design file name. - * + * * @since 7.4 * @author Vaadin Ltd */ diff --git a/server/src/main/java/com/vaadin/annotations/JavaScript.java b/server/src/main/java/com/vaadin/annotations/JavaScript.java index 445ef75ddf..e160357558 100644 --- a/server/src/main/java/com/vaadin/annotations/JavaScript.java +++ b/server/src/main/java/com/vaadin/annotations/JavaScript.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -49,7 +49,7 @@ import com.vaadin.server.ClientConnector; * http://host.com/file1.js as is and file2.js from /com/example/file2.js on the * server's classpath using the ClassLoader that was used to load * com.example.MyConnector. - * + * * @author Vaadin Ltd * @since 7.0.0 */ @@ -58,7 +58,7 @@ import com.vaadin.server.ClientConnector; public @interface JavaScript { /** * JavaScript files to load before initializing the client-side connector. - * + * * @return an array of JavaScript file urls */ public String[] value(); diff --git a/server/src/main/java/com/vaadin/annotations/PreserveOnRefresh.java b/server/src/main/java/com/vaadin/annotations/PreserveOnRefresh.java index 86723b97fc..11f3f51d70 100644 --- a/server/src/main/java/com/vaadin/annotations/PreserveOnRefresh.java +++ b/server/src/main/java/com/vaadin/annotations/PreserveOnRefresh.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -40,7 +40,7 @@ import com.vaadin.ui.UI; * {@link UIProvider#isPreservedOnRefresh(com.vaadin.server.UICreateEvent)}, the * decision can also be made dynamically based on other parameters than only * whether this annotation is present on the UI class. - * + * * @author Vaadin Ltd * @since 7.0.0 */ diff --git a/server/src/main/java/com/vaadin/annotations/Push.java b/server/src/main/java/com/vaadin/annotations/Push.java index 736bc4488b..f382ced9d2 100644 --- a/server/src/main/java/com/vaadin/annotations/Push.java +++ b/server/src/main/java/com/vaadin/annotations/Push.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -31,9 +31,9 @@ import com.vaadin.ui.UI; * class configures the UI for automatic push. If some other push mode is * desired, it can be passed as a parameter, e.g. * @Push(PushMode.MANUAL). - * + * * @see PushMode - * + * * @author Vaadin Ltd. * @since 7.1 */ @@ -44,7 +44,7 @@ public @interface Push { /** * Returns the {@link PushMode} to use for the annotated UI. The default * push mode when this annotation is present is {@link PushMode#AUTOMATIC}. - * + * * @return the push mode to use */ public PushMode value() default PushMode.AUTOMATIC; @@ -53,7 +53,7 @@ public @interface Push { * Returns the transport type used for the push for the annotated UI. The * default transport type when this annotation is present is * {@link Transport#WEBSOCKET}. - * + * * @return the transport type to use */ public Transport transport() default Transport.WEBSOCKET; diff --git a/server/src/main/java/com/vaadin/annotations/StyleSheet.java b/server/src/main/java/com/vaadin/annotations/StyleSheet.java index 191e39ee24..a84504accc 100644 --- a/server/src/main/java/com/vaadin/annotations/StyleSheet.java +++ b/server/src/main/java/com/vaadin/annotations/StyleSheet.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -54,7 +54,7 @@ import com.vaadin.server.ClientConnector; * http://host.com/file1.css as is and file2.css from /com/example/file2.css on * the server's classpath using the ClassLoader that was used to load * com.example.MyConnector. - * + * * @author Vaadin Ltd * @since 7.0.0 */ @@ -63,7 +63,7 @@ import com.vaadin.server.ClientConnector; public @interface StyleSheet { /** * Style sheets to load before initializing the client-side connector. - * + * * @return an array of style sheet urls */ public String[] value(); diff --git a/server/src/main/java/com/vaadin/annotations/Theme.java b/server/src/main/java/com/vaadin/annotations/Theme.java index 03fa1179bc..02b8ba4b40 100644 --- a/server/src/main/java/com/vaadin/annotations/Theme.java +++ b/server/src/main/java/com/vaadin/annotations/Theme.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/server/src/main/java/com/vaadin/annotations/Title.java b/server/src/main/java/com/vaadin/annotations/Title.java index 07eaf17e33..caf4cf2c5f 100644 --- a/server/src/main/java/com/vaadin/annotations/Title.java +++ b/server/src/main/java/com/vaadin/annotations/Title.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -33,7 +33,7 @@ import com.vaadin.ui.UI; public @interface Title { /** * Gets the HTML title that should be used if the UI is used on it's own. - * + * * @return a page title string */ public String value(); diff --git a/server/src/main/java/com/vaadin/annotations/VaadinServletConfiguration.java b/server/src/main/java/com/vaadin/annotations/VaadinServletConfiguration.java index 907f2c3a0c..4cc51815a0 100644 --- a/server/src/main/java/com/vaadin/annotations/VaadinServletConfiguration.java +++ b/server/src/main/java/com/vaadin/annotations/VaadinServletConfiguration.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -39,7 +39,7 @@ import com.vaadin.ui.UI; * as well as from specific methods in {@link DeploymentConfiguration}. Init * params defined in web.xml or the @WebServlet * annotation take precedence over values defined in this annotation. - * + * * @since 7.1 * @author Vaadin Ltd */ @@ -50,7 +50,7 @@ public @interface VaadinServletConfiguration { /** * Defines the init parameter name for methods in * {@link VaadinServletConfiguration}. - * + * * @since 7.1 * @author Vaadin Ltd */ @@ -60,7 +60,7 @@ public @interface VaadinServletConfiguration { public @interface InitParameterName { /** * The name of the init parameter that the annotated method controls. - * + * * @return the parameter name */ public String value(); @@ -68,9 +68,9 @@ public @interface VaadinServletConfiguration { /** * Whether Vaadin is in production mode. - * + * * @return true if in production mode, false otherwise. - * + * * @see DeploymentConfiguration#isProductionMode() */ @InitParameterName(Constants.SERVLET_PARAMETER_PRODUCTION_MODE) @@ -78,7 +78,7 @@ public @interface VaadinServletConfiguration { /** * Gets the default UI class to use for the servlet. - * + * * @return the default UI class */ @InitParameterName(VaadinSession.UI_PARAMETER) @@ -87,9 +87,9 @@ public @interface VaadinServletConfiguration { /** * The time resources can be cached in the browser, in seconds. The default * value is 3600 seconds, i.e. one hour. - * + * * @return the resource cache time - * + * * @see DeploymentConfiguration#getResourceCacheTime() */ @InitParameterName(Constants.SERVLET_PARAMETER_RESOURCE_CACHE_TIME) @@ -99,9 +99,9 @@ public @interface VaadinServletConfiguration { * The number of seconds between heartbeat requests of a UI, or a * non-positive number if heartbeat is disabled. The default value is 300 * seconds, i.e. 5 minutes. - * + * * @return the time between heartbeats - * + * * @see DeploymentConfiguration#getHeartbeatInterval() */ @InitParameterName(Constants.SERVLET_PARAMETER_HEARTBEAT_INTERVAL) @@ -111,11 +111,11 @@ public @interface VaadinServletConfiguration { * Whether a session should be closed when all its open UIs have been idle * for longer than its configured maximum inactivity time. The default value * is false. - * + * * @return true if UIs and sessions receiving only heartbeat requests are * eventually closed; false if heartbeat requests extend UI and * session lifetime indefinitely - * + * * @see DeploymentConfiguration#isCloseIdleSessions() */ @InitParameterName(Constants.SERVLET_PARAMETER_CLOSE_IDLE_SESSIONS) @@ -124,7 +124,7 @@ public @interface VaadinServletConfiguration { /** * The default widgetset to use for the servlet. The default value is * com.vaadin.DefaultWidgetSet. - * + * * @return the default widgetset name */ @InitParameterName(VaadinServlet.PARAMETER_WIDGETSET) @@ -133,9 +133,9 @@ public @interface VaadinServletConfiguration { /** * The legacy Property.toString() mode used. The default value is * {@link LegacyProperyToStringMode#DISABLED} - * + * * @return The Property.toString() mode in use. - * + * * @deprecated as of 7.1, should only be used to ease migration */ @Deprecated diff --git a/server/src/main/java/com/vaadin/annotations/Viewport.java b/server/src/main/java/com/vaadin/annotations/Viewport.java index c5b0abd56f..e1d47a0170 100644 --- a/server/src/main/java/com/vaadin/annotations/Viewport.java +++ b/server/src/main/java/com/vaadin/annotations/Viewport.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -28,9 +28,9 @@ import java.lang.annotation.Target; *

    * If you want to dynamically provide different viewport values for different * browser, you should use {@link ViewportGeneratorClass} instead. - * + * * @since 7.4 - * + * * @author Vaadin Ltd */ @Target(ElementType.TYPE) @@ -40,7 +40,7 @@ import java.lang.annotation.Target; public @interface Viewport { /** * Gets the viewport tag content. - * + * * @return the viewport tag content */ public String value(); diff --git a/server/src/main/java/com/vaadin/annotations/ViewportGeneratorClass.java b/server/src/main/java/com/vaadin/annotations/ViewportGeneratorClass.java index aec7ac07e6..6a989af9ea 100644 --- a/server/src/main/java/com/vaadin/annotations/ViewportGeneratorClass.java +++ b/server/src/main/java/com/vaadin/annotations/ViewportGeneratorClass.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -31,11 +31,11 @@ import com.vaadin.server.ViewportGenerator; *

    * If you want to use the same viewport values for all requests, you can use the * simpler {@link Viewport} annotation instead. - * + * * @see ViewportGenerator - * + * * @since 7.4 - * + * * @author Vaadin Ltd */ @Target(ElementType.TYPE) @@ -47,7 +47,7 @@ public @interface ViewportGeneratorClass { * Gets the viewport generator class to use. Please note that the class must * be public and have a default constructor. It must additionally be * declared as static if it's declared as an inner class. - * + * * @return the viewport generator class */ public Class value(); diff --git a/server/src/main/java/com/vaadin/annotations/Widgetset.java b/server/src/main/java/com/vaadin/annotations/Widgetset.java index 2dcf93af13..06e10f7f0f 100644 --- a/server/src/main/java/com/vaadin/annotations/Widgetset.java +++ b/server/src/main/java/com/vaadin/annotations/Widgetset.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/server/src/main/java/com/vaadin/data/Buffered.java b/server/src/main/java/com/vaadin/data/Buffered.java index 469f9987a4..0fe9f40cd7 100644 --- a/server/src/main/java/com/vaadin/data/Buffered.java +++ b/server/src/main/java/com/vaadin/data/Buffered.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -24,20 +24,20 @@ import com.vaadin.data.Validator.InvalidValueException; *

    * Defines the interface to commit and discard changes to an object, supporting * buffering. - * + * *

    * In buffered mode the initial value is read from the data source and * then buffered. Any subsequential writes or reads will be done on the buffered * value. Calling {@link #commit()} will write the buffered value to the data * source while calling {@link #discard()} while discard the buffered value and * re-read the value from the data source. - * + * *

    * In non-buffered mode the value is always read directly from the data * source. Any write is done directly to the data source with no buffering in * between. Reads are also done directly from the data source. Calling * {@link #commit()} or {@link #discard()} in this mode is efficiently a no-op. - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -47,7 +47,7 @@ public interface Buffered extends Serializable { * Updates all changes since the previous commit to the data source. The * value stored in the object will always be updated into the data source * when commit is called. - * + * * @throws SourceException * if the operation fails because of an exception is thrown by * the data source. The cause is included in the exception. @@ -60,7 +60,7 @@ public interface Buffered extends Serializable { /** * Discards all changes since last commit. The object updates its value from * the data source. - * + * * @throws SourceException * if the operation fails because of an exception is thrown by * the data source. The cause is included in the exception. @@ -77,7 +77,7 @@ public interface Buffered extends Serializable { * When in non-buffered mode both read and write operations will be done * directly on the data source. In this mode the {@link #commit()} and * {@link #discard()} methods serve no purpose. - * + * * @param buffered * true if buffered mode should be turned on, false otherwise * @since 7.0 @@ -86,7 +86,7 @@ public interface Buffered extends Serializable { /** * Checks the buffered mode - * + * * @return true if buffered mode is on, false otherwise * @since 7.0 */ @@ -95,7 +95,7 @@ public interface Buffered extends Serializable { /** * Tests if the value stored in the object has been modified since it was * last updated from the data source. - * + * * @return true if the value in the object has been modified * since the last data source update, false if not. */ @@ -105,13 +105,13 @@ public interface Buffered extends Serializable { * An exception that signals that one or more exceptions occurred while a * buffered object tried to access its data source or if there is a problem * in processing a data source. - * + * * @author Vaadin Ltd. * @since 3.0 */ @SuppressWarnings("serial") - public class SourceException extends RuntimeException implements - Serializable { + public class SourceException extends RuntimeException + implements Serializable { /** Source class implementing the buffered interface */ private final Buffered source; @@ -121,7 +121,7 @@ public interface Buffered extends Serializable { /** * Creates a source exception that does not include a cause. - * + * * @param source * the source object implementing the Buffered interface. */ @@ -131,7 +131,7 @@ public interface Buffered extends Serializable { /** * Creates a source exception from multiple causes. - * + * * @param source * the source object implementing the Buffered interface. * @param causes @@ -144,7 +144,7 @@ public interface Buffered extends Serializable { /** * Gets the cause of the exception. - * + * * @return The (first) cause for the exception, null if no cause. */ @Override @@ -157,7 +157,7 @@ public interface Buffered extends Serializable { /** * Gets all the causes for this exception. - * + * * @return throwables that caused this exception */ public final Throwable[] getCauses() { @@ -166,7 +166,7 @@ public interface Buffered extends Serializable { /** * Gets a source of the exception. - * + * * @return the Buffered object which generated this exception. */ public Buffered getSource() { diff --git a/server/src/main/java/com/vaadin/data/BufferedValidatable.java b/server/src/main/java/com/vaadin/data/BufferedValidatable.java index 6f9d952d2f..1232a44b01 100644 --- a/server/src/main/java/com/vaadin/data/BufferedValidatable.java +++ b/server/src/main/java/com/vaadin/data/BufferedValidatable.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -24,12 +24,12 @@ import java.io.Serializable; * Buffered interfaces. The combination of the interfaces defines * if the invalid data is committed to datasource. *

    - * + * * @author Vaadin Ltd. * @since 3.0 */ -public interface BufferedValidatable extends Buffered, Validatable, - Serializable { +public interface BufferedValidatable + extends Buffered, Validatable, Serializable { /** * Tests if the invalid data is committed to datasource. The default is diff --git a/server/src/main/java/com/vaadin/data/Collapsible.java b/server/src/main/java/com/vaadin/data/Collapsible.java index 0ef290312d..a189c2ece8 100644 --- a/server/src/main/java/com/vaadin/data/Collapsible.java +++ b/server/src/main/java/com/vaadin/data/Collapsible.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -35,7 +35,7 @@ import com.vaadin.data.Container.Ordered; * {@linkContainer.Indexed}. From the accessors point of view, items in * collapsed subtrees don't exist. *

    - * + * */ public interface Collapsible extends Hierarchical, Ordered { @@ -44,11 +44,11 @@ public interface Collapsible extends Hierarchical, Ordered { * Collapsing the {@link Item} indicated by itemId hides all * children, and their respective children, from the {@link Container}. *

    - * + * *

    * If called on a leaf {@link Item}, this method does nothing. *

    - * + * * @param itemId * the identifier of the collapsed {@link Item} * @param collapsed @@ -63,12 +63,12 @@ public interface Collapsible extends Hierarchical, Ordered { * Checks whether the {@link Item}, identified by itemId is * collapsed or not. *

    - * + * *

    * If an {@link Item} is "collapsed" its children are not included in * methods used to list Items in this container. *

    - * + * * @param itemId * The {@link Item}'s identifier that is to be checked. * @return true iff the {@link Item} identified by diff --git a/server/src/main/java/com/vaadin/data/Container.java b/server/src/main/java/com/vaadin/data/Container.java index fb7a93e832..6832a57b06 100644 --- a/server/src/main/java/com/vaadin/data/Container.java +++ b/server/src/main/java/com/vaadin/data/Container.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -29,7 +29,7 @@ import com.vaadin.data.util.filter.UnsupportedFilterException; * {@link Item}s, but it imposes certain constraints on its contents. These * constraints state the following: *

    - * + * *
      *
    • All Items in the Container must have the same number of Properties. *
    • All Items in the Container must have the same Property ID's (see @@ -39,7 +39,7 @@ import com.vaadin.data.util.filter.UnsupportedFilterException; *
    • All Items within a container are uniquely identified by their non-null * IDs. *
    - * + * *

    * The Container can be visualized as a representation of a relational database * table. Each Item in the Container represents a row in the table, and all @@ -47,18 +47,18 @@ import com.vaadin.data.util.filter.UnsupportedFilterException; * that as with the cells in a database table, no Property in a Container may be * empty, though they may contain null values. *

    - * + * *

    * Note that though uniquely identified, the Items in a Container are not * necessarily {@link Container.Ordered ordered} or {@link Container.Indexed * indexed}. *

    - * + * *

    * Containers can derive Item ID's from the item properties or use other, * container specific or user specified identifiers. *

    - * + * *

    * If a container is {@link Filterable filtered} or {@link Sortable sorted}, * most of the the methods of the container interface and its subinterfaces @@ -67,16 +67,16 @@ import com.vaadin.data.util.filter.UnsupportedFilterException; * See individual method javadoc for exceptions to this (adding and removing * items). *

    - * + * *

    * *

    - * + * *

    * The Container interface is split to several subinterfaces so that a class can * implement only the ones it needs. *

    - * + * * @author Vaadin Ltd * @since 3.0 */ @@ -88,7 +88,7 @@ public interface Container extends Serializable { * returned. *

    * Containers should not return Items that are filtered out. - * + * * @param itemId * ID of the {@link Item} to retrieve * @return the {@link Item} with the given ID or null if the @@ -99,7 +99,7 @@ public interface Container extends Serializable { /** * Gets the ID's of all Properties stored in the Container. The ID's cannot * be modified through the returned collection. - * + * * @return unmodifiable collection of Property IDs */ public Collection getContainerPropertyIds(); @@ -115,7 +115,7 @@ public interface Container extends Serializable { *

    * Calling this method for large lazy containers can be an expensive * operation and should be avoided when practical. - * + * * @return unmodifiable collection of Item IDs */ public Collection getItemIds(); @@ -125,7 +125,7 @@ public interface Container extends Serializable { * Container. If the Container does not contain the item or it is filtered * out, or the Container does not have the Property, null is * returned. - * + * * @param itemId * ID of the visible Item which contains the Property * @param propertyId @@ -136,7 +136,7 @@ public interface Container extends Serializable { /** * Gets the data type of all Properties identified by the given Property ID. - * + * * @param propertyId * ID identifying the Properties * @return data type of the Properties @@ -148,7 +148,7 @@ public interface Container extends Serializable { *

    * Filtering can hide items so that they will not be visible through the * container API. - * + * * @return number of Items in the Container */ public int size(); @@ -160,7 +160,7 @@ public interface Container extends Serializable { * container API, and this method should respect visibility of items (i.e. * only indicate visible items as being in the container) if feasible for * the container. - * + * * @param itemId * ID the of Item to be tested * @return boolean indicating if the Container holds the specified Item @@ -169,17 +169,17 @@ public interface Container extends Serializable { /** * Creates a new Item with the given ID in the Container. - * + * *

    * The new Item is returned, and it is ready to have its Properties * modified. Returns null if the operation fails or the * Container already contains a Item with the given ID. *

    - * + * *

    * This functionality is optional. *

    - * + * * @param itemId * ID of the Item to be created * @return Created new Item, or null in case of a failure @@ -191,17 +191,17 @@ public interface Container extends Serializable { /** * Creates a new Item into the Container, and assign it an automatic ID. - * + * *

    * The new ID is returned, or null if the operation fails. * After a successful call you can use the {@link #getItem(Object ItemId) * getItem}method to fetch the Item. *

    - * + * *

    * This functionality is optional. *

    - * + * * @return ID of the newly created Item, or null in case of a * failure * @throws UnsupportedOperationException @@ -212,16 +212,16 @@ public interface Container extends Serializable { /** * Removes the Item identified by ItemId from the Container. - * + * *

    * Containers that support filtering should also allow removing an item that * is currently filtered out. *

    - * + * *

    * This functionality is optional. *

    - * + * * @param itemId * ID of the Item to remove * @return true if the operation succeeded, false @@ -237,7 +237,7 @@ public interface Container extends Serializable { * type and default value of the new Property are given as parameters. *

    * This functionality is optional. - * + * * @param propertyId * ID of the Property * @param type @@ -258,7 +258,7 @@ public interface Container extends Serializable { * Note that the Property will be removed from all Items in the Container. *

    * This functionality is optional. - * + * * @param propertyId * ID of the Property to remove * @return true if the operation succeeded, false @@ -272,12 +272,12 @@ public interface Container extends Serializable { /** * Removes all Items from the Container. - * + * *

    * Note that Property ID and type information is preserved. This * functionality is optional. *

    - * + * * @return true if the operation succeeded, false * if not * @throws UnsupportedOperationException @@ -288,7 +288,7 @@ public interface Container extends Serializable { /** * Interface for Container classes whose {@link Item}s can be traversed in * order. - * + * *

    * If the container is filtered or sorted, the traversal applies to the * filtered and sorted view. @@ -307,7 +307,7 @@ public interface Container extends Serializable { * Gets the ID of the Item following the Item that corresponds to * itemId. If the given Item is the last or not found in * the Container, null is returned. - * + * * @param itemId * ID of a visible Item in the Container * @return ID of the next visible Item or null @@ -318,7 +318,7 @@ public interface Container extends Serializable { * Gets the ID of the Item preceding the Item that corresponds to * itemId. If the given Item is the first or not found in * the Container, null is returned. - * + * * @param itemId * ID of a visible Item in the Container * @return ID of the previous visible Item or null @@ -327,14 +327,14 @@ public interface Container extends Serializable { /** * Gets the ID of the first Item in the Container. - * + * * @return ID of the first visible Item in the Container */ public Object firstItemId(); /** * Gets the ID of the last Item in the Container.. - * + * * @return ID of the last visible Item in the Container */ public Object lastItemId(); @@ -342,7 +342,7 @@ public interface Container extends Serializable { /** * Tests if the Item corresponding to the given Item ID is the first * Item in the Container. - * + * * @param itemId * ID of an Item in the Container * @return true if the Item is first visible item in the @@ -353,7 +353,7 @@ public interface Container extends Serializable { /** * Tests if the Item corresponding to the given Item ID is the last Item * in the Container. - * + * * @return true if the Item is last visible item in the * Container, false if not */ @@ -365,9 +365,9 @@ public interface Container extends Serializable { * Adding an item after null item adds the item as first item of the * ordered container. *

    - * + * * @see Ordered Ordered: adding items in filtered or sorted containers - * + * * @param previousItemId * Id of the visible item in ordered container after which to * insert the new item. @@ -385,9 +385,9 @@ public interface Container extends Serializable { * Adding an item after null item adds the item as first item of the * ordered container. *

    - * + * * @see Ordered Ordered: adding items in filtered or sorted containers - * + * * @param previousItemId * Id of the visible item in ordered container after which to * insert the new item. @@ -431,7 +431,7 @@ public interface Container extends Serializable { *

    * Sorting a container can irreversibly change the order of its items or * only change the order temporarily, depending on the container. - * + * * @param propertyId * Array of container property IDs, whose values are used to * sort the items in container as primary, secondary, ... @@ -450,7 +450,7 @@ public interface Container extends Serializable { /** * Gets the container property IDs which can be used to sort the items. - * + * * @return the IDs of the properties that can be used for sorting the * container */ @@ -474,7 +474,7 @@ public interface Container extends Serializable { * Gets the index of the Item corresponding to the itemId. The following * is true for the returned index: 0 <= index < size(), or * index = -1 if there is no visible item with that id in the container. - * + * * @param itemId * ID of an Item in the Container * @return index of the Item, or -1 if (the filtered and sorted view of) @@ -486,7 +486,7 @@ public interface Container extends Serializable { * Get the item id for the item at the position given by * index. *

    - * + * * @param index * the index of the requested item id * @return the item id of the item at the given index @@ -512,7 +512,7 @@ public interface Container extends Serializable { *

    * For quick migration to new API see: * {@link ContainerHelpers#getItemIdsUsingGetIdByIndex(int, int, Indexed)} - * + * * @param startIndex * the index for the first item which id to include * @param numberOfItems @@ -520,7 +520,7 @@ public interface Container extends Serializable { * start index, must be >= 0 * @return List containing the requested item ids or empty list if * numberOfItems == 0; not null - * + * * @throws IllegalArgumentException * if numberOfItems is < 0 * @throws IndexOutOfBoundsException @@ -528,7 +528,7 @@ public interface Container extends Serializable { * container. (i.e. * startIndex < 0 || container.size()-1 < startIndex * ) - * + * * @since 7.0 */ public List getItemIds(int startIndex, int numberOfItems); @@ -546,7 +546,7 @@ public interface Container extends Serializable { * given position. See {@link Indexed}, {@link Ordered}, * {@link Filterable} and {@link Sortable} for more information. *

    - * + * * @param index * Index (in the filtered and sorted view) to add the new * item. @@ -569,7 +569,7 @@ public interface Container extends Serializable { * given position. See {@link Indexed}, {@link Filterable} and * {@link Sortable} for more information. *

    - * + * * @param index * Index (in the filtered and sorted view) at which to add * the new item. @@ -585,28 +585,28 @@ public interface Container extends Serializable { /** * An Event object specifying information about the added * items. - * + * * @since 7.4 */ public interface ItemAddEvent extends ItemSetChangeEvent { /** * Gets the item id of the first added item. - * + * * @return item id of the first added item */ public Object getFirstItemId(); /** * Gets the index of the first added item. - * + * * @return index of the first added item */ public int getFirstIndex(); /** * Gets the number of the added items. - * + * * @return the number of added items. */ public int getAddedItemsCount(); @@ -615,27 +615,27 @@ public interface Container extends Serializable { /** * An Event object specifying information about the removed * items. - * + * * @since 7.4 */ public interface ItemRemoveEvent extends ItemSetChangeEvent { /** * Gets the item id of the first removed item. - * + * * @return item id of the first removed item */ public Object getFirstItemId(); /** * Gets the index of the first removed item. - * + * * @return index of the first removed item */ public int getFirstIndex(); /** * Gets the number of the removed items. - * + * * @return the number of removed items */ public int getRemovedItemsCount(); @@ -648,7 +648,7 @@ public interface Container extends Serializable { * hierarchically. This means that the Items in the container belong in a * tree-like structure, with the following quirks: *

    - * + * *
      *
    • The Item structure may have more than one root elements *
    • The Items in the hierarchy can be declared explicitly to be able or @@ -660,7 +660,7 @@ public interface Container extends Serializable { /** * Gets the IDs of all Items that are children of the specified Item. * The returned collection is unmodifiable. - * + * * @param itemId * ID of the Item whose children the caller is interested in * @return An unmodifiable {@link java.util.Collection collection} @@ -671,7 +671,7 @@ public interface Container extends Serializable { /** * Gets the ID of the parent Item of the specified Item. - * + * * @param itemId * ID of the Item whose parent the caller wishes to find out. * @return the ID of the parent Item. Will be null if the @@ -683,7 +683,7 @@ public interface Container extends Serializable { * Gets the IDs of all Items in the container that don't have a parent. * Such items are called root Items. The returned * collection is unmodifiable. - * + * * @return An unmodifiable {@link java.util.Collection collection} * containing IDs of all root elements of the container */ @@ -697,11 +697,11 @@ public interface Container extends Serializable { * also possible to detach a node from the hierarchy (and thus make it * root) by setting the parent null. *

      - * + * *

      * This operation is optional. *

      - * + * * @param itemId * ID of the item to be set as the child of the Item * identified with newParentId @@ -716,7 +716,7 @@ public interface Container extends Serializable { /** * Tests if the Item with given ID can have children. - * + * * @param itemId * ID of the Item in the container whose child capability is * to be tested @@ -738,12 +738,12 @@ public interface Container extends Serializable { * {@link #setParent(Object itemId, Object newParentId)}or * {@link com.vaadin.data.Container#removeItem(Object itemId)}. *

      - * + * *

      * This operation is optional. If it is not implemented, the method * always returns false. *

      - * + * * @param itemId * ID of the Item in the container whose child capability is * to be set @@ -760,9 +760,10 @@ public interface Container extends Serializable { /** * Tests if the Item specified with itemId is a root Item. * The hierarchical container can have more than one root and must have - * at least one unless it is empty. The {@link #getParent(Object itemId)} - * method always returns null for root Items. - * + * at least one unless it is empty. The + * {@link #getParent(Object itemId)} method always returns + * null for root Items. + * * @param itemId * ID of the Item whose root status is to be tested * @return true if the specified Item is a root, @@ -776,12 +777,12 @@ public interface Container extends Serializable { * or if it is a leaf. The {@link #getChildren(Object itemId)} method * always returns null for leaf Items. *

      - * + * *

      * Note that being a leaf does not imply whether or not an Item is * allowed to have children. *

      - * + * * @param itemId * ID of the Item to be tested * @return true if the specified Item has children, @@ -794,11 +795,11 @@ public interface Container extends Serializable { * Removes the Item identified by ItemId from the * Container. *

      - * + * *

      * Note that this does not remove any children the item might have. *

      - * + * * @param itemId * ID of the Item to remove * @return true if the operation succeeded, @@ -845,7 +846,7 @@ public interface Container extends Serializable { * The functionality of SimpleFilterable can be implemented using the * {@link Filterable} API and {@link SimpleStringFilter}. *

      - * + * * @since 5.0 (renamed from Filterable to SimpleFilterable in 6.6) */ public interface SimpleFilterable extends Container, Serializable { @@ -863,7 +864,7 @@ public interface Container extends Serializable { *

      * If a container has multiple filters, only items accepted by all * filters are visible. - * + * * @param propertyId * Property for which the filter is applied to. * @param filterString @@ -884,7 +885,7 @@ public interface Container extends Serializable { /** * Remove all filters from the given property. - * + * * @param propertyId * for which to remove filters */ @@ -907,16 +908,16 @@ public interface Container extends Serializable { * An {@link Filter} should implement {@link #equals(Object)} and * {@link #hashCode()} correctly to avoid duplicate filter registrations * etc. - * + * * @see Filterable - * + * * @since 6.6 */ public interface Filter extends Serializable { /** * Check if an item passes the filter (in-memory filtering). - * + * * @param itemId * identifier of the item being filtered; may be null when * the item is being added to the container @@ -932,10 +933,10 @@ public interface Container extends Serializable { /** * Check if a change in the value of a property can affect the filtering * result. May always return true, at the cost of performance. - * + * * If the filter cannot determine whether it may depend on the property * or not, should return true. - * + * * @param propertyId * @return true if the filtering result may/does change based on changes * to the property identified by propertyId @@ -976,12 +977,12 @@ public interface Container extends Serializable { * at index 0, at index {@link com.vaadin.data.Container#size()} or at an * undefined position is up to the implementation. *

      - * + * *

      * This API replaces the old Filterable interface, renamed to * {@link SimpleFilterable} in Vaadin 6.6. *

      - * + * * @since 6.6 */ public interface Filterable extends Container, Serializable { @@ -990,7 +991,7 @@ public interface Container extends Serializable { *

      * If a container has multiple filters, only items accepted by all * filters are visible. - * + * * @throws UnsupportedFilterException * if the filter is not supported by the container */ @@ -1012,7 +1013,7 @@ public interface Container extends Serializable { /** * Returns the filters which have been applied to the container - * + * * @return A collection of filters which have been applied to the * container. An empty collection if no filters have been * applied. @@ -1029,7 +1030,7 @@ public interface Container extends Serializable { /** * Sets the Container that serves as the data source of the viewer. - * + * * @param newDataSource * The new data source Item */ @@ -1037,7 +1038,7 @@ public interface Container extends Serializable { /** * Gets the Container serving as the data source of the viewer. - * + * * @return data source Container */ public Container getContainerDataSource(); @@ -1065,14 +1066,14 @@ public interface Container extends Serializable { /** * An Event object specifying the Container whose Item set has * changed (items added, removed or reordered). - * + * * A simple property value change is not an item set change. */ public interface ItemSetChangeEvent extends Serializable { /** * Gets the Property where the event occurred. - * + * * @return source of the event */ public Container getContainer(); @@ -1089,7 +1090,7 @@ public interface Container extends Serializable { /** * Lets the listener know a Containers visible (filtered and/or sorted, * if applicable) Item set has changed. - * + * * @param event * change event text */ @@ -1104,7 +1105,7 @@ public interface Container extends Serializable { *

      * An item set change refers to addition, removal or reordering of items in * the container. A simple property value change is not an item set change. - * + * *

      * Note: The general Java convention is not to explicitly declare that a * class generates events, but to directly define the @@ -1118,7 +1119,7 @@ public interface Container extends Serializable { /** * Adds an Item set change listener for the object. - * + * * @param listener * listener to be added */ @@ -1134,7 +1135,7 @@ public interface Container extends Serializable { /** * Removes the Item set change listener from the object. - * + * * @param listener * listener to be removed */ @@ -1164,7 +1165,7 @@ public interface Container extends Serializable { /** * Retrieves the Container whose contents have been modified. - * + * * @return Source Container of the event. */ public Container getContainer(); @@ -1184,7 +1185,7 @@ public interface Container extends Serializable { /** * Notifies this listener that the set of property IDs supported by the * Container has changed. - * + * * @param event * Change event. */ @@ -1199,14 +1200,14 @@ public interface Container extends Serializable { * that it will generate a PropertySetChangeEvent when the set * of property IDs supported by the container is modified. *

      - * + * *

      * A property set change means the addition, removal or other structural * changes to the properties of a container. Changes concerning the set of * items in the container and their property values are not property set * changes. *

      - * + * *

      * Note that the general Java convention is not to explicitly declare that a * class generates events, but to directly define the @@ -1220,7 +1221,7 @@ public interface Container extends Serializable { /** * Registers a new Property set change listener for this Container. - * + * * @param listener * The new Listener to be registered */ @@ -1236,7 +1237,7 @@ public interface Container extends Serializable { /** * Removes a previously registered Property set change listener. - * + * * @param listener * Listener to be removed */ @@ -1248,6 +1249,7 @@ public interface Container extends Serializable { * {@link #removePropertySetChangeListener(PropertySetChangeListener)} **/ @Deprecated - public void removeListener(Container.PropertySetChangeListener listener); + public void removeListener( + Container.PropertySetChangeListener listener); } } diff --git a/server/src/main/java/com/vaadin/data/ContainerHelpers.java b/server/src/main/java/com/vaadin/data/ContainerHelpers.java index 817bec9474..fcb5a78456 100644 --- a/server/src/main/java/com/vaadin/data/ContainerHelpers.java +++ b/server/src/main/java/com/vaadin/data/ContainerHelpers.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,7 +25,7 @@ import com.vaadin.data.Container.Indexed; /** * Contains helper methods for containers that can be used to ease development * of containers in Vaadin. - * + * * @since 7.0 */ public class ContainerHelpers implements Serializable { @@ -37,7 +37,7 @@ public class ContainerHelpers implements Serializable { * during development. This should not be used in a "finished product" * unless fetching an id for an index is very inexpensive because a separate * request will be performed for each index in the range. - * + * * @param startIndex * index of the first item id to get * @param numberOfIds @@ -88,8 +88,7 @@ public class ContainerHelpers implements Serializable { Object idByIndex = container.getIdByIndex(i); if (idByIndex == null) { throw new RuntimeException( - "Unable to get item id for index: " - + i + "Unable to get item id for index: " + i + " from container using Container.Indexed#getIdByIndex() " + "even though container.size() > endIndex. " + "Returned item id was null. " diff --git a/server/src/main/java/com/vaadin/data/Item.java b/server/src/main/java/com/vaadin/data/Item.java index 13f965f098..dbffdaa0a2 100644 --- a/server/src/main/java/com/vaadin/data/Item.java +++ b/server/src/main/java/com/vaadin/data/Item.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,7 +25,7 @@ import java.util.Collection; * locally unique non-null identifier. The interface is split into subinterfaces * to enable a class to implement only the functionalities it needs. *

      - * + * * @author Vaadin Ltd * @since 3.0 */ @@ -35,7 +35,7 @@ public interface Item extends Serializable { * Gets the Property corresponding to the given Property ID stored in the * Item. If the Item does not contain the Property, null is * returned. - * + * * @param id * identifier of the Property to get * @return the Property with the given ID or null @@ -44,7 +44,7 @@ public interface Item extends Serializable { /** * Gets the collection of IDs of all Properties stored in the Item. - * + * * @return unmodifiable collection containing IDs of the Properties stored * the Item */ @@ -52,11 +52,11 @@ public interface Item extends Serializable { /** * Tries to add a new Property into the Item. - * + * *

      * This functionality is optional. *

      - * + * * @param id * ID of the new Property * @param property @@ -71,11 +71,11 @@ public interface Item extends Serializable { /** * Removes the Property identified by ID from the Item. - * + * *

      * This functionality is optional. *

      - * + * * @param id * ID of the Property to be removed * @return true if the operation succeeded @@ -93,7 +93,7 @@ public interface Item extends Serializable { /** * Sets the Item that serves as the data source of the viewer. - * + * * @param newDataSource * The new data source Item */ @@ -101,7 +101,7 @@ public interface Item extends Serializable { /** * Gets the Item serving as the data source of the viewer. - * + * * @return data source Item */ public Item getItemDataSource(); @@ -134,7 +134,7 @@ public interface Item extends Serializable { /** * Retrieves the Item whose contents has been modified. - * + * * @return source Item of the event */ public Item getItem(); @@ -148,7 +148,7 @@ public interface Item extends Serializable { /** * Notifies this listener that the Item's property set has changed. - * + * * @param event * Property set change event object */ @@ -173,7 +173,7 @@ public interface Item extends Serializable { /** * Registers a new property set change listener for this Item. - * + * * @param listener * The new Listener to be registered. */ @@ -189,7 +189,7 @@ public interface Item extends Serializable { /** * Removes a previously registered property set change listener. - * + * * @param listener * Listener to be removed. */ diff --git a/server/src/main/java/com/vaadin/data/Property.java b/server/src/main/java/com/vaadin/data/Property.java index 74ae1f86ec..ac19f27197 100644 --- a/server/src/main/java/com/vaadin/data/Property.java +++ b/server/src/main/java/com/vaadin/data/Property.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -24,27 +24,27 @@ import java.io.Serializable; * value. This interface contains methods to inspect and modify the stored value * and its type, and the object's read-only state. *

      - * + * *

      * The Property also defines the events * ReadOnlyStatusChangeEvent and ValueChangeEvent, and * the associated listener and notifier interfaces. *

      - * + * *

      * The Property.Viewer interface should be used to attach the * Property to an external data source. This way the value in the data source * can be inspected using the Property interface. *

      - * + * *

      * The Property.editor interface should be implemented if the value * needs to be changed through the implementing class. *

      - * + * * @param T * type of values of the property - * + * * @author Vaadin Ltd * @since 3.0 */ @@ -53,7 +53,7 @@ public interface Property extends Serializable { /** * Gets the value stored in the Property. The returned object is compatible * with the class returned by getType(). - * + * * @return the value stored in the Property */ public T getValue(); @@ -65,14 +65,14 @@ public interface Property extends Serializable { * missing, one should declare the Property to be in read-only mode and * throw Property.ReadOnlyException in this function. *

      - * + * * Note : Since Vaadin 7.0, setting the value of a non-String property as a * String is no longer supported. - * + * * @param newValue * New value of the Property. This should be assignable to the * type returned by getType - * + * * @throws Property.ReadOnlyException * if the object is in read-only mode */ @@ -84,7 +84,7 @@ public interface Property extends Serializable { * to safely cast the value returned from getValue to the given * type and pass any variable assignable to this type as an argument to * setValue. - * + * * @return type of the Property */ public Class getType(); @@ -94,7 +94,7 @@ public interface Property extends Serializable { * the method setValue will throw * ReadOnlyException and will not modify the value of the * Property. - * + * * @return true if the Property is in read-only mode, * false if it's not */ @@ -102,10 +102,10 @@ public interface Property extends Serializable { /** * Sets the Property's read-only mode to the specified status. - * + * * This functionality is optional, but all properties must implement the * isReadOnly mode query correctly. - * + * * @param newStatus * new read-only status of the Property */ @@ -114,12 +114,12 @@ public interface Property extends Serializable { /** * A Property that is capable of handle a transaction that can end in commit * or rollback. - * + * * Note that this does not refer to e.g. database transactions but rather * two-phase commit that allows resetting old field values (in e.g. a * FieldGroup) if the commit of one of the properties fails after other * properties have already been committed. - * + * * @param * The type of the property * @author Vaadin Ltd @@ -129,7 +129,7 @@ public interface Property extends Serializable { /** * Starts a transaction. - * + * *

      * If the value is set during a transaction the value must not replace * the original value until {@link #commit()} is called. Still, @@ -173,7 +173,7 @@ public interface Property extends Serializable { /** * Exception object that signals that a requested Property * modification failed because it's in read-only mode. - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -190,7 +190,7 @@ public interface Property extends Serializable { /** * Constructs a new ReadOnlyException with the specified * detail message. - * + * * @param msg * the detail message */ @@ -202,7 +202,7 @@ public interface Property extends Serializable { /** * Interface implemented by the viewer classes capable of using a Property * as a data source. - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -210,7 +210,7 @@ public interface Property extends Serializable { /** * Sets the Property that serves as the data source of the viewer. - * + * * @param newDataSource * the new data source Property */ @@ -218,7 +218,7 @@ public interface Property extends Serializable { /** * Gets the Property serving as the data source of the viewer. - * + * * @return the Property serving as the viewers data source */ public Property getPropertyDataSource(); @@ -234,7 +234,7 @@ public interface Property extends Serializable { * Property is in a read-only mode, attempts to modify it will result in the * ReadOnlyException being thrown. *

      - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -247,7 +247,7 @@ public interface Property extends Serializable { /** * An Event object specifying the Property whose value has been * changed. - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -255,7 +255,7 @@ public interface Property extends Serializable { /** * Retrieves the Property that has been modified. - * + * * @return source Property of the event */ public Property getProperty(); @@ -264,7 +264,7 @@ public interface Property extends Serializable { /** * The listener interface for receiving * ValueChangeEvent objects. - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -272,7 +272,7 @@ public interface Property extends Serializable { /** * Notifies this listener that the Property's value has changed. - * + * * @param event * value change event object */ @@ -292,7 +292,7 @@ public interface Property extends Serializable { * class really will send the events, or if it just defines the methods to * be able to implement an interface. *

      - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -300,11 +300,12 @@ public interface Property extends Serializable { /** * Registers a new value change listener for this Property. - * + * * @param listener * the new Listener to be registered */ - public void addValueChangeListener(Property.ValueChangeListener listener); + public void addValueChangeListener( + Property.ValueChangeListener listener); /** * @deprecated As of 7.0, replaced by @@ -315,7 +316,7 @@ public interface Property extends Serializable { /** * Removes a previously registered value change listener. - * + * * @param listener * listener to be removed */ @@ -335,7 +336,7 @@ public interface Property extends Serializable { /** * An Event object specifying the Property whose read-only * status has been changed. - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -343,7 +344,7 @@ public interface Property extends Serializable { /** * Property whose read-only state has changed. - * + * * @return source Property of the event. */ public Property getProperty(); @@ -352,7 +353,7 @@ public interface Property extends Serializable { /** * The listener interface for receiving * ReadOnlyStatusChangeEvent objects. - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -361,7 +362,7 @@ public interface Property extends Serializable { /** * Notifies this listener that a Property's read-only status has * changed. - * + * * @param event * Read-only status change event object */ @@ -382,7 +383,7 @@ public interface Property extends Serializable { * class really will send the events, or if it just defines the methods to * be able to implement an interface. *

      - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -390,7 +391,7 @@ public interface Property extends Serializable { /** * Registers a new read-only status change listener for this Property. - * + * * @param listener * the new Listener to be registered */ @@ -406,7 +407,7 @@ public interface Property extends Serializable { /** * Removes a previously registered read-only status change listener. - * + * * @param listener * listener to be removed */ diff --git a/server/src/main/java/com/vaadin/data/Validatable.java b/server/src/main/java/com/vaadin/data/Validatable.java index 1ae7cd8cee..365f855299 100644 --- a/server/src/main/java/com/vaadin/data/Validatable.java +++ b/server/src/main/java/com/vaadin/data/Validatable.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,7 +25,7 @@ import java.util.Collection; * value is valid or not, and to add, remove and list registered validators of * the object. *

      - * + * * @author Vaadin Ltd. * @since 3.0 * @see com.vaadin.data.Validator @@ -39,7 +39,7 @@ public interface Validatable extends Serializable { * object's value needs to be verified, that is, when the {@link #isValid()} * method is called. This usually happens when the object's value changes. *

      - * + * * @param validator * the new validator */ @@ -51,7 +51,7 @@ public interface Validatable extends Serializable { * validator is removed from the object and its validate method * is no longer called in {@link #isValid()}. *

      - * + * * @param validator * the validator to remove */ @@ -72,7 +72,7 @@ public interface Validatable extends Serializable { * the collection may be unsafe (e.g. may throw * ConcurrentModificationException.) *

      - * + * * @return A collection of validators */ public Collection getValidators(); @@ -85,7 +85,7 @@ public interface Validatable extends Serializable { * throws the {@link Validator.InvalidValueException} this method returns * false. *

      - * + * * @return true if the registered validators concur that the * value is valid, false otherwise */ @@ -97,7 +97,7 @@ public interface Validatable extends Serializable { * method should do nothing, and if it's not valid, it should throw * Validator.InvalidValueException *

      - * + * * @throws Validator.InvalidValueException * if the value is not valid */ @@ -108,7 +108,7 @@ public interface Validatable extends Serializable { * Checks the validabtable object accept invalid values.The default value is * true. *

      - * + * */ public boolean isInvalidAllowed(); @@ -118,9 +118,9 @@ public interface Validatable extends Serializable { * configuration possibility is optional. By default invalid values are * allowed. *

      - * + * * @param invalidValueAllowed - * + * * @throws UnsupportedOperationException * if the setInvalidAllowed is not supported. */ diff --git a/server/src/main/java/com/vaadin/data/Validator.java b/server/src/main/java/com/vaadin/data/Validator.java index d567267338..8929843874 100644 --- a/server/src/main/java/com/vaadin/data/Validator.java +++ b/server/src/main/java/com/vaadin/data/Validator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -43,7 +43,7 @@ import com.vaadin.server.VaadinServlet; * internally implement and use isValid(Object) for convenience or to ease * migration from earlier Vaadin versions. *

      - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -53,7 +53,7 @@ public interface Validator extends Serializable { * Checks the given value against this validator. If the value is valid the * method does nothing. If the value is invalid, an * {@link InvalidValueException} is thrown. - * + * * @param value * the value to check * @throws Validator.InvalidValueException @@ -63,13 +63,13 @@ public interface Validator extends Serializable { /** * Exception that is thrown by a {@link Validator} when a value is invalid. - * + * *

      * The default implementation of InvalidValueException does not support HTML * in error messages. To enable HTML support, override * {@link #getHtmlMessage()} and use the subclass in validators. *

      - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -85,7 +85,7 @@ public interface Validator extends Serializable { /** * Constructs a new {@code InvalidValueException} with the specified * message. - * + * * @param message * The detail message of the problem. */ @@ -97,7 +97,7 @@ public interface Validator extends Serializable { * Constructs a new {@code InvalidValueException} with a set of causing * validation exceptions. The causing validation exceptions are included * when the exception is painted to the client. - * + * * @param message * The detail message of the problem. * @param causes @@ -117,10 +117,10 @@ public interface Validator extends Serializable { /** * Check if the error message should be hidden. - * + * * An empty (null or "") message is invisible unless it contains nested * exceptions that are visible. - * + * * @return true if the error message should be hidden, false otherwise */ public boolean isInvisible() { @@ -140,7 +140,7 @@ public interface Validator extends Serializable { /** * Returns the message of the error in HTML. - * + * * Note that this API may change in future versions. */ public String getHtmlMessage() { @@ -150,7 +150,7 @@ public interface Validator extends Serializable { /** * Returns the {@code InvalidValueExceptions} that caused this * exception. - * + * * @return An array containing the {@code InvalidValueExceptions} that * caused this exception. Returns an empty array if this * exception was not caused by other exceptions. @@ -165,7 +165,7 @@ public interface Validator extends Serializable { * A specific type of {@link InvalidValueException} that indicates that * validation failed because the value was empty. What empty means is up to * the thrower. - * + * * @author Vaadin Ltd. * @since 5.3.0 */ diff --git a/server/src/main/java/com/vaadin/data/fieldgroup/BeanFieldGroup.java b/server/src/main/java/com/vaadin/data/fieldgroup/BeanFieldGroup.java index 0a92c00cad..a86035fdc0 100644 --- a/server/src/main/java/com/vaadin/data/fieldgroup/BeanFieldGroup.java +++ b/server/src/main/java/com/vaadin/data/fieldgroup/BeanFieldGroup.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -54,15 +54,15 @@ public class BeanFieldGroup extends FieldGroup { propertyId.toString()); if (type == null) { throw new BindException( - "Cannot determine type of propertyId '" - + propertyId + "Cannot determine type of propertyId '" + propertyId + "'. The propertyId was not found in " + beanType.getName()); } return type; } catch (IntrospectionException e) { throw new BindException("Cannot determine type of propertyId '" - + propertyId + "'. Unable to introspect " + beanType, e); + + propertyId + "'. Unable to introspect " + beanType, + e); } } } @@ -71,7 +71,8 @@ public class BeanFieldGroup extends FieldGroup { protected Object findPropertyId(java.lang.reflect.Field memberField) { String fieldName = memberField.getName(); Item dataSource = getItemDataSource(); - if (dataSource != null && dataSource.getItemProperty(fieldName) != null) { + if (dataSource != null + && dataSource.getItemProperty(fieldName) != null) { return fieldName; } else { String minifiedFieldName = minifyFieldName(fieldName); @@ -107,7 +108,7 @@ public class BeanFieldGroup extends FieldGroup { *

      * For null values, a null item is passed to * {@link #setItemDataSource(Item)} to be properly clear fields. - * + * * @param bean * The bean to use as data source. */ @@ -190,9 +191,9 @@ public class BeanFieldGroup extends FieldGroup { /** * Checks whether a bean validation implementation (e.g. Hibernate Validator * or Apache Bean Validation) is available. - * + * * TODO move this method to some more generic location - * + * * @return true if a JSR-303 bean validation implementation is available */ protected static boolean isBeanValidationImplementationAvailable() { @@ -219,7 +220,7 @@ public class BeanFieldGroup extends FieldGroup { *

      * The returned {@link BeanFieldGroup} can be used for further * configuration. - * + * * @see #bindFieldsBuffered(Object, Object) * @see #bindMemberFields(Object) * @since 7.2 @@ -240,7 +241,7 @@ public class BeanFieldGroup extends FieldGroup { *

      * The returned {@link BeanFieldGroup} can be used for further * configuration. - * + * * @see #bindFieldsUnbuffered(Object, Object) * @see #bindMemberFields(Object) * @since 7.2 diff --git a/server/src/main/java/com/vaadin/data/fieldgroup/Caption.java b/server/src/main/java/com/vaadin/data/fieldgroup/Caption.java index efe6f99d9a..75056fbe5c 100644 --- a/server/src/main/java/com/vaadin/data/fieldgroup/Caption.java +++ b/server/src/main/java/com/vaadin/data/fieldgroup/Caption.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/server/src/main/java/com/vaadin/data/fieldgroup/DefaultFieldGroupFieldFactory.java b/server/src/main/java/com/vaadin/data/fieldgroup/DefaultFieldGroupFieldFactory.java index b6bf97e68e..14b92ff850 100644 --- a/server/src/main/java/com/vaadin/data/fieldgroup/DefaultFieldGroupFieldFactory.java +++ b/server/src/main/java/com/vaadin/data/fieldgroup/DefaultFieldGroupFieldFactory.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -40,7 +40,7 @@ import com.vaadin.ui.TextField; * This class contains a basic implementation for {@link FieldGroupFieldFactory} * .The class is singleton, use {@link #get()} method to get reference to the * instance. - * + * * @author Vaadin Ltd */ public class DefaultFieldGroupFieldFactory implements FieldGroupFieldFactory { @@ -54,9 +54,9 @@ public class DefaultFieldGroupFieldFactory implements FieldGroupFieldFactory { /** * Gets the singleton instance. - * + * * @since 7.4 - * + * * @return the singleton instance */ public static DefaultFieldGroupFieldFactory get() { @@ -74,8 +74,8 @@ public class DefaultFieldGroupFieldFactory implements FieldGroupFieldFactory { return createBooleanField(fieldType); } if (AbstractTextField.class.isAssignableFrom(fieldType)) { - return fieldType.cast(createAbstractTextField(fieldType - .asSubclass(AbstractTextField.class))); + return fieldType.cast(createAbstractTextField( + fieldType.asSubclass(AbstractTextField.class))); } else if (fieldType == RichTextArea.class) { return fieldType.cast(createRichTextArea()); } @@ -104,7 +104,8 @@ public class DefaultFieldGroupFieldFactory implements FieldGroupFieldFactory { populateWithEnumData(s, (Class) type); return (T) s; } else if (AbstractTextField.class.isAssignableFrom(fieldType)) { - return (T) createAbstractTextField((Class) fieldType); + return (T) createAbstractTextField( + (Class) fieldType); } return null; @@ -120,7 +121,8 @@ public class DefaultFieldGroupFieldFactory implements FieldGroupFieldFactory { || DateField.class.isAssignableFrom(fieldType)) { field = new PopupDateField(); } else if (AbstractTextField.class.isAssignableFrom(fieldType)) { - field = createAbstractTextField((Class) fieldType); + field = createAbstractTextField( + (Class) fieldType); } else { return null; } @@ -179,7 +181,8 @@ public class DefaultFieldGroupFieldFactory implements FieldGroupFieldFactory { cb.setImmediate(true); return (T) cb; } else if (AbstractTextField.class.isAssignableFrom(fieldType)) { - return (T) createAbstractTextField((Class) fieldType); + return (T) createAbstractTextField( + (Class) fieldType); } return null; @@ -195,15 +198,15 @@ public class DefaultFieldGroupFieldFactory implements FieldGroupFieldFactory { field.setImmediate(true); return field; } catch (Exception e) { - throw new BindException("Could not create a field of type " - + fieldType, e); + throw new BindException( + "Could not create a field of type " + fieldType, e); } } /** * Fallback when no specific field has been created. Typically returns a * TextField. - * + * * @param * The type of field to create * @param type @@ -224,7 +227,7 @@ public class DefaultFieldGroupFieldFactory implements FieldGroupFieldFactory { /** * Populates the given select with all the enums in the given {@link Enum} * class. Uses {@link Enum}.toString() for caption. - * + * * @param select * The select to populate * @param enumClass diff --git a/server/src/main/java/com/vaadin/data/fieldgroup/FieldGroup.java b/server/src/main/java/com/vaadin/data/fieldgroup/FieldGroup.java index aaaae9e4f7..85db78f50e 100644 --- a/server/src/main/java/com/vaadin/data/fieldgroup/FieldGroup.java +++ b/server/src/main/java/com/vaadin/data/fieldgroup/FieldGroup.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -50,7 +50,7 @@ import com.vaadin.util.ReflectTools; * using a FieldGroupFieldFactory but you still have to add them to the correct * position in your layout. *

      - * + * * @author Vaadin Ltd * @since 7.0 */ @@ -75,7 +75,7 @@ public class FieldGroup implements Serializable { /** * Constructs a field binder. Use {@link #setItemDataSource(Item)} to set a * data source for the field binder. - * + * */ public FieldGroup() { @@ -83,7 +83,7 @@ public class FieldGroup implements Serializable { /** * Constructs a field binder that uses the given data source. - * + * * @param itemDataSource * The data source to bind the fields to */ @@ -94,7 +94,7 @@ public class FieldGroup implements Serializable { /** * Updates the item that is used by this FieldBinder. Rebinds all fields to * the properties in the new item. - * + * * @param itemDataSource * The new item to use */ @@ -110,10 +110,10 @@ public class FieldGroup implements Serializable { * Gets the item used by this FieldBinder. Note that you must call * {@link #commit()} for the item to be updated unless buffered mode has * been switched off. - * + * * @see #setBuffered(boolean) * @see #commit() - * + * * @return The item used by this FieldBinder */ public Item getItemDataSource() { @@ -123,12 +123,12 @@ public class FieldGroup implements Serializable { /** * Checks the buffered mode for the bound fields. *

      - * + * * @see #setBuffered(boolean) for more details on buffered mode - * + * * @see Field#isBuffered() * @return true if buffered mode is on, false otherwise - * + * */ public boolean isBuffered() { return buffered; @@ -144,7 +144,7 @@ public class FieldGroup implements Serializable { *

      * The default is to use buffered mode. *

      - * + * * @see Field#setBuffered(boolean) * @param buffered * true to turn on buffered mode, false otherwise @@ -166,7 +166,7 @@ public class FieldGroup implements Serializable { * Note that this will not accurately represent the enabled status of all * fields if you change the enabled status of the fields through some other * method than {@link #setEnabled(boolean)}. - * + * * @return true if the fields are enabled, false otherwise */ public boolean isEnabled() { @@ -175,7 +175,7 @@ public class FieldGroup implements Serializable { /** * Updates the enabled state of all bound fields. - * + * * @param fieldsEnabled * true to enable all bound fields, false to disable them */ @@ -193,7 +193,7 @@ public class FieldGroup implements Serializable { * Note that this will not accurately represent the read only status of all * fields if you change the read only status of the fields through some * other method than {@link #setReadOnly(boolean)}. - * + * * @return true if the fields are set to read only, false otherwise */ public boolean isReadOnly() { @@ -204,7 +204,7 @@ public class FieldGroup implements Serializable { * Sets the read only state to the given value for all fields with writable * data source. Fields with read only data source will always be set to read * only. - * + * * @param fieldsReadOnly * true to set the fields with writable data source to read only, * false to set them to read write @@ -226,7 +226,7 @@ public class FieldGroup implements Serializable { *

      * The fields are not returned in any specific order. *

      - * + * * @return A collection with all bound Fields */ public Collection> getFields() { @@ -240,7 +240,7 @@ public class FieldGroup implements Serializable { *

      * This method also adds validators when applicable. *

      - * + * * @param field * The field to bind * @param propertyId @@ -275,7 +275,8 @@ public class FieldGroup implements Serializable { return; } - field.setPropertyDataSource(wrapInTransactionalProperty(getItemProperty(propertyId))); + field.setPropertyDataSource( + wrapInTransactionalProperty(getItemProperty(propertyId))); configureField(field); } @@ -289,14 +290,14 @@ public class FieldGroup implements Serializable { private void throwIfFieldIsNull(Field field, Object propertyId) { if (field == null) { - throw new BindException( - String.format( - "Cannot bind property id '%s' to a null field.", - propertyId)); + throw new BindException(String.format( + "Cannot bind property id '%s' to a null field.", + propertyId)); } } - private void throwIfPropertyIdAlreadyBound(Field field, Object propertyId) { + private void throwIfPropertyIdAlreadyBound(Field field, + Object propertyId) { if (propertyIdToField.containsKey(propertyId) && propertyIdToField.get(propertyId) != field) { throw new BindException("Property id " + propertyId @@ -306,7 +307,7 @@ public class FieldGroup implements Serializable { /** * Gets the property with the given property id from the item. - * + * * @param propertyId * The id if the property to find * @return The property with the given id from the item @@ -335,7 +336,7 @@ public class FieldGroup implements Serializable { * Note that the field is not detached from its property data source if it * is no longer connected to the same property id it was bound to using this * FieldBinder. - * + * * @param field * The field to detach * @throws BindException @@ -374,7 +375,7 @@ public class FieldGroup implements Serializable { * By default this updates the buffered, read only and enabled state of the * field. Also adds validators when applicable. Fields with read only data * source are always configured as read only. - * + * * @param field * The field to update */ @@ -392,24 +393,20 @@ public class FieldGroup implements Serializable { /** * Gets the type of the property with the given property id. - * + * * @param propertyId * The propertyId. Must be find * @return The type of the property */ protected Class getPropertyType(Object propertyId) throws BindException { if (getItemDataSource() == null) { - throw new BindException( - "Property type for '" - + propertyId - + "' could not be determined. No item data source has been set."); + throw new BindException("Property type for '" + propertyId + + "' could not be determined. No item data source has been set."); } Property p = getItemDataSource().getItemProperty(propertyId); if (p == null) { - throw new BindException( - "Property type for '" - + propertyId - + "' could not be determined. No property with that id was found."); + throw new BindException("Property type for '" + propertyId + + "' could not be determined. No property with that id was found."); } return p.getType(); @@ -425,7 +422,7 @@ public class FieldGroup implements Serializable { *

      * No guarantee is given for the order of the property ids *

      - * + * * @return A collection of bound property ids */ public Collection getBoundPropertyIds() { @@ -442,7 +439,7 @@ public class FieldGroup implements Serializable { *

      * No guarantee is given for the order of the property ids *

      - * + * * @return A collection of property ids that have not been bound to fields */ public Collection getUnboundPropertyIds() { @@ -463,7 +460,7 @@ public class FieldGroup implements Serializable { * restored to what it was before commit was called if any * {@link CommitHandler} throws a CommitException or there is a problem * committing the fields - * + * * @throws CommitException * If the commit was aborted */ @@ -497,7 +494,7 @@ public class FieldGroup implements Serializable { /** * Tries to commit all bound fields one by one and gathers any validation * exceptions in a map, which is returned to the caller - * + * * @return a propertyId to validation exception map which is empty if all * commits succeeded */ @@ -518,16 +515,16 @@ public class FieldGroup implements Serializable { /** * Exception which wraps InvalidValueExceptions from all invalid fields in a * FieldGroup - * + * * @since 7.4 */ - public static class FieldGroupInvalidValueException extends - InvalidValueException { + public static class FieldGroupInvalidValueException + extends InvalidValueException { private Map, InvalidValueException> invalidValueExceptions; /** * Constructs a new exception with the specified validation exceptions. - * + * * @param invalidValueExceptions * a property id to exception map */ @@ -554,9 +551,9 @@ public class FieldGroup implements Serializable { Property.Transactional property = (Property.Transactional) f .getPropertyDataSource(); if (property == null) { - throw new CommitException("Property \"" - + fieldToPropertyId.get(f) - + "\" not bound to datasource."); + throw new CommitException( + "Property \"" + fieldToPropertyId.get(f) + + "\" not bound to datasource."); } property.startTransaction(); } @@ -581,7 +578,7 @@ public class FieldGroup implements Serializable { /** * Sends a preCommit event to all registered commit handlers - * + * * @throws CommitException * If the commit should be aborted */ @@ -596,7 +593,7 @@ public class FieldGroup implements Serializable { /** * Sends a postCommit event to all registered commit handlers - * + * * @throws CommitException * If the commit should be aborted */ @@ -613,7 +610,7 @@ public class FieldGroup implements Serializable { * Discards all changes done to the bound fields. *

      * Only has effect if buffered mode is used. - * + * */ public void discard() { for (Field f : fieldToPropertyId.keySet()) { @@ -629,7 +626,7 @@ public class FieldGroup implements Serializable { /** * Returns the field that is bound to the given property id - * + * * @param propertyId * The property id to use to lookup the field * @return The field that is bound to the property id or null if no field is @@ -641,7 +638,7 @@ public class FieldGroup implements Serializable { /** * Returns the property id that is bound to the given field - * + * * @param field * The field to use to lookup the property id * @return The property id that is bound to the field or null if the field @@ -659,7 +656,7 @@ public class FieldGroup implements Serializable { * has been updated ({@link CommitHandler#postCommit(CommitEvent)}). If a * {@link CommitHandler} throws a CommitException the whole commit is * aborted and the fields retain their old values. - * + * * @param commitHandler * The commit handler to add */ @@ -669,9 +666,9 @@ public class FieldGroup implements Serializable { /** * Removes the given commit handler. - * + * * @see #addCommitHandler(CommitHandler) - * + * * @param commitHandler * The commit handler to remove */ @@ -685,7 +682,7 @@ public class FieldGroup implements Serializable { * Use {@link #addCommitHandler(CommitHandler)} and * {@link #removeCommitHandler(CommitHandler)} to register or unregister a * commit handler. - * + * * @return A collection of commit handlers */ protected Collection getCommitHandlers() { @@ -704,7 +701,7 @@ public class FieldGroup implements Serializable { * updated. *

      * Throw a {@link CommitException} to abort the commit. - * + * * @param commitEvent * An event containing information regarding the commit * @throws CommitException @@ -717,7 +714,7 @@ public class FieldGroup implements Serializable { * updated. *

      * Throw a {@link CommitException} to abort the commit. - * + * * @param commitEvent * An event containing information regarding the commit * @throws CommitException @@ -728,7 +725,7 @@ public class FieldGroup implements Serializable { /** * FIXME javadoc - * + * */ public static class CommitEvent implements Serializable { private FieldGroup fieldBinder; @@ -739,7 +736,7 @@ public class FieldGroup implements Serializable { /** * Returns the field binder that this commit relates to - * + * * @return The FieldBinder that is being committed. */ public FieldGroup getFieldBinder() { @@ -753,7 +750,7 @@ public class FieldGroup implements Serializable { *

      * Call the {@link Field#validate()} for the fields to get the individual * error messages. - * + * * @return true if all bound fields are valid, false otherwise. */ public boolean isValid() { @@ -769,7 +766,7 @@ public class FieldGroup implements Serializable { /** * Checks if any bound field has been modified. - * + * * @return true if at least one field has been modified, false otherwise */ public boolean isModified() { @@ -784,9 +781,9 @@ public class FieldGroup implements Serializable { /** * Gets the field factory for the {@link FieldGroup}. The field factory is * only used when {@link FieldGroup} creates a new field. - * + * * @return The field factory in use - * + * */ public FieldGroupFieldFactory getFieldFactory() { return fieldFactory; @@ -795,7 +792,7 @@ public class FieldGroup implements Serializable { /** * Sets the field factory for the {@link FieldGroup}. The field factory is * only used when {@link FieldGroup} creates a new field. - * + * * @param fieldFactory * The field factory to use */ @@ -814,24 +811,24 @@ public class FieldGroup implements Serializable { *

      *

      * For example: - * + * *

            * public class MyForm extends VerticalLayout {
            * private TextField firstName = new TextField("First name");
      -     * @PropertyId("last")
      +     * @PropertyId("last")
            * private TextField lastName = new TextField("Last name"); 
            * private TextField age = new TextField("Age"); ... }
      -     * 
      +     *
            * MyForm myForm = new MyForm(); 
            * ... 
            * fieldGroup.bindMemberFields(myForm);
            * 
      - * + * *

      * This binds the firstName TextField to a "firstName" property in the item, * lastName TextField to a "last" property and the age TextField to a "age" * property. - * + * * @param objectWithMemberFields * The object that contains (Java) member fields to bind * @throws BindException @@ -856,26 +853,26 @@ public class FieldGroup implements Serializable { *

      *

      * For example: - * + * *

            * public class MyForm extends VerticalLayout {
            * private TextField firstName = new TextField("First name");
      -     * @PropertyId("last")
      +     * @PropertyId("last")
            * private TextField lastName = new TextField("Last name"); 
            * private TextField age;
      -     * 
      +     *
            * MyForm myForm = new MyForm(); 
            * ... 
            * fieldGroup.buildAndBindMemberFields(myForm);
            * 
      - * + * *

      *

      * This binds the firstName TextField to a "firstName" property in the item, * lastName TextField to a "last" property and builds an age TextField using * the field factory and then binds it to the "age" property. *

      - * + * * @param objectWithMemberFields * The object that contains (Java) member fields to build and * bind @@ -899,7 +896,7 @@ public class FieldGroup implements Serializable { * field factory is buildFields is true. All non-null fields for which a * property id can be determined are bound to the property id. *

      - * + * * @param objectWithMemberFields * The object that contains (Java) member fields to build and * bind @@ -910,7 +907,8 @@ public class FieldGroup implements Serializable { boolean buildFields) throws BindException { Class objectClass = objectWithMemberFields.getClass(); - for (java.lang.reflect.Field memberField : getFieldsInDeclareOrder(objectClass)) { + for (java.lang.reflect.Field memberField : getFieldsInDeclareOrder( + objectClass)) { if (!Field.class.isAssignableFrom(memberField.getType())) { // Process next field @@ -1012,7 +1010,7 @@ public class FieldGroup implements Serializable { * buildAndBindMemberFields} can easily be customized by overriding this * method. No other changes are needed. *

      - * + * * @param memberField * The field an object id is searched for * @return @@ -1020,10 +1018,8 @@ public class FieldGroup implements Serializable { protected Object findPropertyId(java.lang.reflect.Field memberField) { String fieldName = memberField.getName(); if (getItemDataSource() == null) { - throw new SearchException( - "Property id type for field '" - + fieldName - + "' could not be determined. No item data source has been set."); + throw new SearchException("Property id type for field '" + fieldName + + "' could not be determined. No item data source has been set."); } Item dataSource = getItemDataSource(); if (dataSource.getItemProperty(fieldName) != null) { @@ -1049,11 +1045,11 @@ public class FieldGroup implements Serializable { /** * Exception thrown by a FieldGroup when the commit operation fails. - * + * * Provides information about validation errors through * {@link #getInvalidFields()} if the cause of the failure is that all bound * fields did not pass validation - * + * */ public static class CommitException extends Exception { @@ -1099,7 +1095,7 @@ public class FieldGroup implements Serializable { /** * Returns the field group where the exception occurred - * + * * @since 7.4 * @return the field group */ @@ -1136,7 +1132,7 @@ public class FieldGroup implements Serializable { /** * Builds a field and binds it to the given property id using the field * binder. - * + * * @param propertyId * The property id to bind to. Must be present in the field * finder. @@ -1153,7 +1149,7 @@ public class FieldGroup implements Serializable { /** * Builds a field using the given caption and binds it to the given property * id using the field binder. - * + * * @param caption * The caption for the field * @param propertyId @@ -1171,7 +1167,7 @@ public class FieldGroup implements Serializable { /** * Builds a field using the given caption and binds it to the given property * id using the field binder. Ensures the new field is of the given type. - * + * * @param caption * The caption for the field * @param propertyId @@ -1199,7 +1195,7 @@ public class FieldGroup implements Serializable { * type is the type of field we want to create, can be {@link Field} if any * Field is good. *

      - * + * * @param caption * The caption for the new field * @param dataType @@ -1214,9 +1210,9 @@ public class FieldGroup implements Serializable { Class fieldType) throws BindException { T field = getFieldFactory().createField(dataType, fieldType); if (field == null) { - throw new BindException("Unable to build a field of type " - + fieldType.getName() + " for editing " - + dataType.getName()); + throw new BindException( + "Unable to build a field of type " + fieldType.getName() + + " for editing " + dataType.getName()); } field.setCaption(caption); @@ -1228,7 +1224,7 @@ public class FieldGroup implements Serializable { * the class or interface represented by this Class object. The elements in * the array returned are sorted in declare order from sub class to super * class. - * + * * @param searchClass * @return */ @@ -1248,7 +1244,7 @@ public class FieldGroup implements Serializable { /** * Clears the value of all fields. - * + * * @since 7.4 */ public void clear() { diff --git a/server/src/main/java/com/vaadin/data/fieldgroup/FieldGroupFieldFactory.java b/server/src/main/java/com/vaadin/data/fieldgroup/FieldGroupFieldFactory.java index 4aad08ba8d..59782f145f 100644 --- a/server/src/main/java/com/vaadin/data/fieldgroup/FieldGroupFieldFactory.java +++ b/server/src/main/java/com/vaadin/data/fieldgroup/FieldGroupFieldFactory.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -22,14 +22,14 @@ import com.vaadin.ui.Field; /** * Factory interface for creating new Field-instances based on the data type * that should be edited. - * + * * @author Vaadin Ltd. * @since 7.0 */ public interface FieldGroupFieldFactory extends Serializable { /** * Creates a field based on the data type that we want to edit - * + * * @param dataType * The type that we want to edit using the field * @param fieldType diff --git a/server/src/main/java/com/vaadin/data/fieldgroup/PropertyId.java b/server/src/main/java/com/vaadin/data/fieldgroup/PropertyId.java index e7fe50305e..cde2c2c1bd 100644 --- a/server/src/main/java/com/vaadin/data/fieldgroup/PropertyId.java +++ b/server/src/main/java/com/vaadin/data/fieldgroup/PropertyId.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -38,18 +38,18 @@ import java.lang.annotation.Target; @PropertyId("foo") TextField myField = new TextField(); } - + class Entity { String foo; } - + { Editor e = new Editor(); BeanFieldGroup.bindFieldsUnbuffered(new Entity(), e); } * - * + * * @since 7.0 * @author Vaadin Ltd */ diff --git a/server/src/main/java/com/vaadin/data/sort/Sort.java b/server/src/main/java/com/vaadin/data/sort/Sort.java index 81e0d08c73..6daa7f16f5 100644 --- a/server/src/main/java/com/vaadin/data/sort/Sort.java +++ b/server/src/main/java/com/vaadin/data/sort/Sort.java @@ -24,7 +24,7 @@ import com.vaadin.shared.data.sort.SortDirection; /** * Fluid Sort API. Provides a convenient, human-readable way of specifying * multi-column sort order. - * + * * @since 7.4 * @author Vaadin Ltd */ @@ -35,7 +35,7 @@ public class Sort implements Serializable { /** * Initial constructor, called by the static by() methods. - * + * * @param propertyId * a property ID, corresponding to a property in the data source * @param direction @@ -49,7 +49,7 @@ public class Sort implements Serializable { /** * Chaining constructor, called by the non-static then() methods. This * constructor links to the previous Sort object. - * + * * @param previous * the sort marker that comes before this one * @param propertyId @@ -76,7 +76,7 @@ public class Sort implements Serializable { /** * Start building a Sort order by sorting a provided column in ascending * order. - * + * * @param propertyId * a property id, corresponding to a data source property * @return a sort object @@ -87,7 +87,7 @@ public class Sort implements Serializable { /** * Start building a Sort order by sorting a provided column. - * + * * @param propertyId * a property id, corresponding to a data source property * @param direction @@ -102,7 +102,7 @@ public class Sort implements Serializable { * Continue building a Sort order. The provided property is sorted in * ascending order if the previously added properties have been evaluated as * equals. - * + * * @param propertyId * a property id, corresponding to a data source property * @return a sort object @@ -115,7 +115,7 @@ public class Sort implements Serializable { * Continue building a Sort order. The provided property is sorted in * specified order if the previously added properties have been evaluated as * equals. - * + * * @param propertyId * a property id, corresponding to a data source property * @param direction @@ -128,7 +128,7 @@ public class Sort implements Serializable { /** * Build a sort order list, ready to be passed to Grid - * + * * @return a sort order list. */ public List build() { diff --git a/server/src/main/java/com/vaadin/data/sort/SortOrder.java b/server/src/main/java/com/vaadin/data/sort/SortOrder.java index 2c419f88b7..12080f0063 100644 --- a/server/src/main/java/com/vaadin/data/sort/SortOrder.java +++ b/server/src/main/java/com/vaadin/data/sort/SortOrder.java @@ -22,7 +22,7 @@ import com.vaadin.shared.data.sort.SortDirection; /** * Sort order descriptor. Links together a {@link SortDirection} value and a * Vaadin container property ID. - * + * * @since 7.4 * @author Vaadin Ltd */ @@ -33,7 +33,7 @@ public class SortOrder implements Serializable { /** * Create a SortOrder object. Both arguments must be non-null. - * + * * @param propertyId * id of the data source property to sort by * @param direction @@ -54,7 +54,7 @@ public class SortOrder implements Serializable { /** * Returns the property ID. - * + * * @return a property ID */ public Object getPropertyId() { @@ -63,7 +63,7 @@ public class SortOrder implements Serializable { /** * Returns the {@link SortDirection} value. - * + * * @return a sort direction value */ public SortDirection getDirection() { diff --git a/server/src/main/java/com/vaadin/data/util/AbstractBeanContainer.java b/server/src/main/java/com/vaadin/data/util/AbstractBeanContainer.java index 6dcfbb2b84..8599e7c900 100644 --- a/server/src/main/java/com/vaadin/data/util/AbstractBeanContainer.java +++ b/server/src/main/java/com/vaadin/data/util/AbstractBeanContainer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -39,50 +39,50 @@ import com.vaadin.data.util.filter.UnsupportedFilterException; /** * An abstract base class for in-memory containers for JavaBeans. - * + * *

      * The properties of the container are determined automatically by introspecting * the used JavaBean class and explicitly adding or removing properties is not * supported. Only beans of the same type can be added to the container. *

      - * + * *

      * Subclasses should implement any public methods adding items to the container, * typically calling the protected methods {@link #addItem(Object, Object)}, * {@link #addItemAfter(Object, Object, Object)} and * {@link #addItemAt(int, Object, Object)}. *

      - * + * * @param * The type of the item identifier * @param * The type of the Bean - * + * * @since 6.5 */ -public abstract class AbstractBeanContainer extends - AbstractInMemoryContainer> implements - Filterable, SimpleFilterable, Sortable, ValueChangeListener, +public abstract class AbstractBeanContainer + extends AbstractInMemoryContainer> + implements Filterable, SimpleFilterable, Sortable, ValueChangeListener, PropertySetChangeNotifier { /** * Resolver that maps beans to their (item) identifiers, removing the need * to explicitly specify item identifiers when there is no need to customize * this. - * + * * Note that beans can also be added with an explicit id even if a resolver * has been set. - * + * * @param * @param - * + * * @since 6.5 */ - public static interface BeanIdResolver extends - Serializable { + public static interface BeanIdResolver + extends Serializable { /** * Return the item identifier for a bean. - * + * * @param bean * @return */ @@ -91,12 +91,12 @@ public abstract class AbstractBeanContainer extends /** * A item identifier resolver that returns the value of a bean property. - * + * * The bean must have a getter for the property, and the getter must return * an object of type IDTYPE. */ - protected class PropertyBasedBeanIdResolver implements - BeanIdResolver { + protected class PropertyBasedBeanIdResolver + implements BeanIdResolver { private final Object propertyId; @@ -114,8 +114,8 @@ public abstract class AbstractBeanContainer extends throws IllegalArgumentException { VaadinPropertyDescriptor pd = model.get(propertyId); if (null == pd) { - throw new IllegalStateException("Property " + propertyId - + " not found"); + throw new IllegalStateException( + "Property " + propertyId + " not found"); } try { Property property = (Property) pd @@ -131,7 +131,7 @@ public abstract class AbstractBeanContainer extends /** * The resolver that finds the item ID for a bean, or null not to use * automatic resolving. - * + * * Methods that add a bean without specifying an ID must not be called if no * resolver has been set. */ @@ -156,7 +156,7 @@ public abstract class AbstractBeanContainer extends /** * Constructs a {@code AbstractBeanContainer} for beans of the given type. - * + * * @param type * the type of the beans that will be added to the container. * @throws IllegalArgumentException @@ -173,7 +173,7 @@ public abstract class AbstractBeanContainer extends /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container#getType(java.lang.Object) */ @Override @@ -188,7 +188,7 @@ public abstract class AbstractBeanContainer extends /** * Create a BeanItem for a bean using pre-parsed bean metadata (based on * {@link #getBeanType()}). - * + * * @param bean * @return created {@link BeanItem} or null if bean is null */ @@ -198,10 +198,10 @@ public abstract class AbstractBeanContainer extends /** * Returns the type of beans this Container can contain. - * + * * This comes from the bean type constructor parameter, and bean metadata * (including container properties) is based on this. - * + * * @return */ public Class getBeanType() { @@ -210,7 +210,7 @@ public abstract class AbstractBeanContainer extends /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container#getContainerPropertyIds() */ @Override @@ -220,7 +220,7 @@ public abstract class AbstractBeanContainer extends /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container#removeAllItems() */ @Override @@ -247,7 +247,7 @@ public abstract class AbstractBeanContainer extends /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container#getItem(java.lang.Object) */ @Override @@ -263,7 +263,7 @@ public abstract class AbstractBeanContainer extends /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container#getItemIds() */ @Override @@ -274,7 +274,7 @@ public abstract class AbstractBeanContainer extends /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container#getContainerProperty(java.lang.Object, * java.lang.Object) */ @@ -289,7 +289,7 @@ public abstract class AbstractBeanContainer extends /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container#removeItem(java.lang.Object) */ @Override @@ -329,7 +329,7 @@ public abstract class AbstractBeanContainer extends /* * (non-Javadoc) - * + * * @see * com.vaadin.data.Container.Filterable#addContainerFilter(java.lang.Object, * java.lang.String, boolean, boolean) @@ -348,7 +348,7 @@ public abstract class AbstractBeanContainer extends /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container.Filterable#removeAllContainerFilters() */ @Override @@ -363,7 +363,7 @@ public abstract class AbstractBeanContainer extends /* * (non-Javadoc) - * + * * @see * com.vaadin.data.Container.Filterable#removeContainerFilters(java.lang * .Object) @@ -392,7 +392,7 @@ public abstract class AbstractBeanContainer extends /* * (non-Javadoc) - * + * * @see com.vaadin.data.util.AbstractInMemoryContainer#hasContainerFilters() */ @Override @@ -402,7 +402,7 @@ public abstract class AbstractBeanContainer extends /* * (non-Javadoc) - * + * * @see com.vaadin.data.util.AbstractInMemoryContainer#getContainerFilters() */ @Override @@ -413,7 +413,7 @@ public abstract class AbstractBeanContainer extends /** * Make this container listen to the given property provided it notifies * when its value changes. - * + * * @param item * The {@link Item} that contains the property * @param propertyId @@ -432,7 +432,7 @@ public abstract class AbstractBeanContainer extends /** * Remove this container as a listener for the given property. - * + * * @param item * The {@link Item} that contains the property * @param propertyId @@ -448,7 +448,7 @@ public abstract class AbstractBeanContainer extends /** * Remove this contains as a listener for all the properties in the given * {@link Item}. - * + * * @param item * The {@link Item} that contains the properties */ @@ -460,7 +460,7 @@ public abstract class AbstractBeanContainer extends /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container.Sortable#getSortableContainerPropertyIds() */ @Override @@ -470,7 +470,7 @@ public abstract class AbstractBeanContainer extends /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container.Sortable#sort(java.lang.Object[], * boolean[]) */ @@ -509,7 +509,7 @@ public abstract class AbstractBeanContainer extends /** * Check that a bean can be added to the container (is of the correct type * for the container). - * + * * @param bean * @return */ @@ -519,11 +519,11 @@ public abstract class AbstractBeanContainer extends /** * Adds the bean to the Container. - * + * * Note: the behavior of this method changed in Vaadin 6.6 - now items are * added at the very end of the unfiltered container and not after the last * visible item if filtering is used. - * + * * @see com.vaadin.data.Container#addItem(Object) */ protected BeanItem addItem(IDTYPE itemId, BEANTYPE bean) { @@ -535,7 +535,7 @@ public abstract class AbstractBeanContainer extends /** * Adds the bean after the given bean. - * + * * @see com.vaadin.data.Container.Ordered#addItemAfter(Object, Object) */ protected BeanItem addItemAfter(IDTYPE previousItemId, @@ -549,16 +549,16 @@ public abstract class AbstractBeanContainer extends /** * Adds a new bean at the given index. - * + * * The bean is used both as the item contents and as the item identifier. - * + * * @param index * Index at which the bean should be added. * @param newItemId * The item id for the bean to add to the container. * @param bean * The bean to add to the container. - * + * * @return Returns the new BeanItem or null if the operation fails. */ protected BeanItem addItemAt(int index, IDTYPE newItemId, @@ -572,11 +572,11 @@ public abstract class AbstractBeanContainer extends /** * Adds a bean to the container using the bean item id resolver to find its * identifier. - * + * * A bean id resolver must be set before calling this method. - * + * * @see #addItem(Object, Object) - * + * * @param bean * the bean to add * @return BeanItem item added or null @@ -601,11 +601,11 @@ public abstract class AbstractBeanContainer extends /** * Adds a bean to the container after a specified item identifier, using the * bean item id resolver to find its identifier. - * + * * A bean id resolver must be set before calling this method. - * + * * @see #addItemAfter(Object, Object, Object) - * + * * @param previousItemId * the identifier of the bean after which this bean should be * added, null to add to the beginning @@ -618,8 +618,8 @@ public abstract class AbstractBeanContainer extends * if an identifier cannot be resolved for the bean */ protected BeanItem addBeanAfter(IDTYPE previousItemId, - BEANTYPE bean) throws IllegalStateException, - IllegalArgumentException { + BEANTYPE bean) + throws IllegalStateException, IllegalArgumentException { if (bean == null) { return null; } @@ -634,11 +634,11 @@ public abstract class AbstractBeanContainer extends /** * Adds a bean at a specified (filtered view) position in the container * using the bean item id resolver to find its identifier. - * + * * A bean id resolver must be set before calling this method. - * + * * @see #addItemAfter(Object, Object, Object) - * + * * @param index * the index (in the filtered view) at which to add the item * @param bean @@ -666,13 +666,13 @@ public abstract class AbstractBeanContainer extends * Adds all the beans from a {@link Collection} in one operation using the * bean item identifier resolver. More efficient than adding them one by * one. - * + * * A bean id resolver must be set before calling this method. - * + * * Note: the behavior of this method changed in Vaadin 6.6 - now items are * added at the very end of the unfiltered container and not after the last * visible item if filtering is used. - * + * * @param collection * The collection of beans to add. Must not be null. * @throws IllegalStateException @@ -698,7 +698,8 @@ public abstract class AbstractBeanContainer extends "Resolved identifier for a bean must not be null"); } - if (internalAddItemAtEnd(itemId, createBeanItem(bean), false) != null) { + if (internalAddItemAtEnd(itemId, createBeanItem(bean), + false) != null) { modified = true; } } @@ -724,7 +725,7 @@ public abstract class AbstractBeanContainer extends /** * Use the bean resolver to get the identifier for a bean. - * + * * @param bean * @return resolved bean identifier, null if could not be resolved * @throws IllegalStateException @@ -741,13 +742,13 @@ public abstract class AbstractBeanContainer extends /** * Sets the resolver that finds the item id for a bean, or null not to use * automatic resolving. - * + * * Methods that add a bean without specifying an id must not be called if no * resolver has been set. - * + * * Note that methods taking an explicit id can be used whether a resolver * has been defined or not. - * + * * @param beanIdResolver * to use or null to disable automatic id resolution */ @@ -758,7 +759,7 @@ public abstract class AbstractBeanContainer extends /** * Returns the resolver that finds the item ID for a bean. - * + * * @return resolver used or null if automatic item id resolving is disabled */ public BeanIdResolver getBeanIdResolver() { @@ -767,7 +768,7 @@ public abstract class AbstractBeanContainer extends /** * Create an item identifier resolver using a named bean property. - * + * * @param propertyId * property identifier, which must map to a getter in BEANTYPE * @return created resolver @@ -818,9 +819,9 @@ public abstract class AbstractBeanContainer extends /** * Adds a property for the container and all its items. - * + * * Primarily for internal use, may change in future versions. - * + * * @param propertyId * @param propertyDescriptor * @return true if the property was added @@ -851,33 +852,33 @@ public abstract class AbstractBeanContainer extends /** * Adds a nested container property for the container, e.g. * "manager.address.street". - * + * * All intermediate getters must exist and should return non-null values * when the property value is accessed. If an intermediate getter returns * null, a null value will be returned. - * + * * @see NestedMethodProperty - * + * * @param propertyId * @return true if the property was added */ public boolean addNestedContainerProperty(String propertyId) { - return addContainerProperty(propertyId, new NestedPropertyDescriptor( - propertyId, type)); + return addContainerProperty(propertyId, + new NestedPropertyDescriptor(propertyId, type)); } /** * Adds a nested container properties for all sub-properties of a named * property to the container. The named property itself is removed from the * model as its subproperties are added. - * + * * All intermediate getters must exist and should return non-null values * when the property value is accessed. If an intermediate getter returns * null, a null value will be returned. - * + * * @see NestedMethodProperty * @see #addNestedContainerProperty(String) - * + * * @param propertyId */ @SuppressWarnings("unchecked") @@ -914,7 +915,8 @@ public abstract class AbstractBeanContainer extends model.remove(propertyId); // If remove the Property from all Items - for (final Iterator i = getAllItemIds().iterator(); i.hasNext();) { + for (final Iterator i = getAllItemIds().iterator(); i + .hasNext();) { getUnfilteredItem(i.next()).removeItemProperty(propertyId); } diff --git a/server/src/main/java/com/vaadin/data/util/AbstractContainer.java b/server/src/main/java/com/vaadin/data/util/AbstractContainer.java index dafdd15b06..c95ddf0061 100644 --- a/server/src/main/java/com/vaadin/data/util/AbstractContainer.java +++ b/server/src/main/java/com/vaadin/data/util/AbstractContainer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -26,7 +26,7 @@ import com.vaadin.data.Container; /** * Abstract container class that manages event listeners and sending events to * them ({@link PropertySetChangeNotifier}, {@link ItemSetChangeNotifier}). - * + * * Note that this class provides the internal implementations for both types of * events and notifiers as protected methods, but does not implement the * {@link PropertySetChangeNotifier} and {@link ItemSetChangeNotifier} @@ -34,7 +34,7 @@ import com.vaadin.data.Container; * Subclasses implementing those interfaces should also override the * corresponding {@link #addListener()} and {@link #removeListener()} methods to * make them public. - * + * * @since 6.6 */ public abstract class AbstractContainer implements Container { @@ -52,7 +52,7 @@ public abstract class AbstractContainer implements Container { /** * An event object specifying the container whose Property set * has changed. - * + * * This class does not provide information about which properties were * concerned by the change, but subclasses can provide additional * information about the changes. @@ -73,13 +73,13 @@ public abstract class AbstractContainer implements Container { /** * An event object specifying the container whose Item set has * changed. - * + * * This class does not provide information about the exact changes * performed, but subclasses can add provide additional information about * the changes. */ - protected static class BaseItemSetChangeEvent extends EventObject implements - Container.ItemSetChangeEvent, Serializable { + protected static class BaseItemSetChangeEvent extends EventObject + implements Container.ItemSetChangeEvent, Serializable { protected BaseItemSetChangeEvent(Container source) { super(source); @@ -97,13 +97,14 @@ public abstract class AbstractContainer implements Container { * Implementation of the corresponding method in * {@link PropertySetChangeNotifier}, override with the corresponding public * method and implement the interface to use this. - * + * * @see PropertySetChangeNotifier#addListener(com.vaadin.data.Container.PropertySetChangeListener) */ protected void addPropertySetChangeListener( Container.PropertySetChangeListener listener) { if (getPropertySetChangeListeners() == null) { - setPropertySetChangeListeners(new LinkedList()); + setPropertySetChangeListeners( + new LinkedList()); } getPropertySetChangeListeners().add(listener); } @@ -121,7 +122,7 @@ public abstract class AbstractContainer implements Container { * Implementation of the corresponding method in * {@link PropertySetChangeNotifier}, override with the corresponding public * method and implement the interface to use this. - * + * * @see PropertySetChangeNotifier#removeListener(com.vaadin.data.Container. * PropertySetChangeListener) */ @@ -137,7 +138,8 @@ public abstract class AbstractContainer implements Container { * {@link #removePropertySetChangeListener(com.vaadin.data.Container.PropertySetChangeListener)} **/ @Deprecated - protected void removeListener(Container.PropertySetChangeListener listener) { + protected void removeListener( + Container.PropertySetChangeListener listener) { removePropertySetChangeListener(listener); } @@ -147,13 +149,14 @@ public abstract class AbstractContainer implements Container { * Implementation of the corresponding method in * {@link ItemSetChangeNotifier}, override with the corresponding public * method and implement the interface to use this. - * + * * @see ItemSetChangeNotifier#addListener(com.vaadin.data.Container.ItemSetChangeListener) */ protected void addItemSetChangeListener( Container.ItemSetChangeListener listener) { if (getItemSetChangeListeners() == null) { - setItemSetChangeListeners(new LinkedList()); + setItemSetChangeListeners( + new LinkedList()); } getItemSetChangeListeners().add(listener); } @@ -171,7 +174,7 @@ public abstract class AbstractContainer implements Container { * Implementation of the corresponding method in * {@link ItemSetChangeNotifier}, override with the corresponding public * method and implement the interface to use this. - * + * * @see ItemSetChangeNotifier#removeListener(com.vaadin.data.Container.ItemSetChangeListener) */ protected void removeItemSetChangeListener( @@ -199,11 +202,11 @@ public abstract class AbstractContainer implements Container { /** * Sends a Property set change event to all interested listeners. - * + * * Use {@link #fireContainerPropertySetChange()} instead of this method * unless additional information about the exact changes is available and * should be included in the event. - * + * * @param event * the property change event to send, optionally with additional * information @@ -230,7 +233,7 @@ public abstract class AbstractContainer implements Container { /** * Sends an Item set change event to all registered interested listeners. - * + * * @param event * the item set change event to send, optionally with additional * information @@ -247,7 +250,7 @@ public abstract class AbstractContainer implements Container { /** * Sets the property set change listener collection. For internal use only. - * + * * @param propertySetChangeListeners */ protected void setPropertySetChangeListeners( @@ -265,7 +268,7 @@ public abstract class AbstractContainer implements Container { /** * Sets the item set change listener collection. For internal use only. - * + * * @param itemSetChangeListeners */ protected void setItemSetChangeListeners( @@ -281,7 +284,8 @@ public abstract class AbstractContainer implements Container { } public Collection getListeners(Class eventType) { - if (Container.PropertySetChangeEvent.class.isAssignableFrom(eventType)) { + if (Container.PropertySetChangeEvent.class + .isAssignableFrom(eventType)) { if (propertySetChangeListeners == null) { return Collections.EMPTY_LIST; } else { diff --git a/server/src/main/java/com/vaadin/data/util/AbstractInMemoryContainer.java b/server/src/main/java/com/vaadin/data/util/AbstractInMemoryContainer.java index f7b1a4b0d8..44803613d6 100644 --- a/server/src/main/java/com/vaadin/data/util/AbstractInMemoryContainer.java +++ b/server/src/main/java/com/vaadin/data/util/AbstractInMemoryContainer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -36,7 +36,7 @@ import com.vaadin.data.util.filter.UnsupportedFilterException; * in-memory containers. Concrete in-memory container classes can either inherit * this class, inherit {@link AbstractContainer}, or implement the * {@link Container} interface directly. - * + * * Adding and removing items (if desired) must be implemented in subclasses by * overriding the appropriate add*Item() and remove*Item() and removeAllItems() * methods, calling the corresponding @@ -45,27 +45,27 @@ import com.vaadin.data.util.filter.UnsupportedFilterException; * {@link #internalAddItemAtEnd(Object, Item, boolean)}, * {@link #internalRemoveItem(Object)} and {@link #internalRemoveAllItems()} * methods. - * + * * By default, adding and removing container properties is not supported, and * subclasses need to implement {@link #getContainerPropertyIds()}. Optionally, * subclasses can override {@link #addContainerProperty(Object, Class, Object)} * and {@link #removeContainerProperty(Object)} to implement them. - * + * * Features: *
        - *
      • {@link Container.Ordered} - *
      • {@link Container.Indexed} - *
      • {@link Filterable} and {@link SimpleFilterable} (internal implementation, + *
      • {@link Container.Ordered} + *
      • {@link Container.Indexed} + *
      • {@link Filterable} and {@link SimpleFilterable} (internal implementation, * does not implement the interface directly) - *
      • {@link Sortable} (internal implementation, does not implement the + *
      • {@link Sortable} (internal implementation, does not implement the * interface directly) *
      - * + * * To implement {@link Sortable}, subclasses need to implement * {@link #getSortablePropertyIds()} and call the superclass method * {@link #sortContainer(Object[], boolean[])} in the method * sort(Object[], boolean[]). - * + * * To implement {@link Filterable}, subclasses need to implement the methods * {@link Filterable#addContainerFilter(com.vaadin.data.Container.Filter)} * (calling {@link #addFilter(Filter)}), @@ -73,14 +73,14 @@ import com.vaadin.data.util.filter.UnsupportedFilterException; * {@link #removeAllFilters()}) and * {@link Filterable#removeContainerFilter(com.vaadin.data.Container.Filter)} * (calling {@link #removeFilter(com.vaadin.data.Container.Filter)}). - * + * * To implement {@link SimpleFilterable}, subclasses also need to implement the * methods * {@link SimpleFilterable#addContainerFilter(Object, String, boolean, boolean)} * and {@link SimpleFilterable#removeContainerFilters(Object)} calling * {@link #addFilter(com.vaadin.data.Container.Filter)} and * {@link #removeFilters(Object)} respectively. - * + * * @param * the class of item identifiers in the container, use Object if can * be any class @@ -90,17 +90,17 @@ import com.vaadin.data.util.filter.UnsupportedFilterException; * @param * the (base) class of the Item instances in the container, use * {@link Item} if unknown - * + * * @since 6.6 */ public abstract class AbstractInMemoryContainer - extends AbstractContainer implements ItemSetChangeNotifier, - Container.Indexed { + extends AbstractContainer + implements ItemSetChangeNotifier, Container.Indexed { /** * An ordered {@link List} of all item identifiers in the container, * including those that have been filtered out. - * + * * Must not be null. */ private List allItemIds; @@ -108,10 +108,10 @@ public abstract class AbstractInMemoryContainer filteredItemIds; @@ -182,12 +182,12 @@ public abstract class AbstractInMemoryContainerEvent object specifying information about the added * items. - * + * *

      * This class provides information about the first added item and the number * of added items. *

      - * + * * @since 7.4 */ protected static class BaseItemAddEvent extends BaseItemAddOrRemoveEvent @@ -207,12 +207,12 @@ public abstract class AbstractInMemoryContainerEvent object specifying information about the removed * items. - * + * *

      * This class provides information about the first removed item and the * number of removed items. *

      - * + * * @since 7.4 */ protected static class BaseItemRemoveEvent extends BaseItemAddOrRemoveEvent @@ -231,9 +231,9 @@ public abstract class AbstractInMemoryContainer getContainerFilters() { @@ -604,7 +604,7 @@ public abstract class AbstractInMemoryContainer removed filters */ @@ -691,7 +691,7 @@ public abstract class AbstractInMemoryContainerCollections.sort(aCollection, getItemSorter()) on all arrays * (containing item ids) that need to be sorted. - * + * */ protected void doSort() { Collections.sort(getAllItemIds(), getItemSorter()); @@ -776,7 +776,7 @@ public abstract class AbstractInMemoryContainer * Caller should initiate filtering after calling this method. *

      - * + * * For internal use only - subclasses should use * {@link #internalAddItemAtEnd(Object, Item, boolean)}, * {@link #internalAddItemAt(int, Object, Item, boolean)} and * {@link #internalAddItemAfter(Object, Object, Item, boolean)} instead. - * + * * @param position * The position at which the item should be inserted in the * unfiltered collection of items @@ -836,7 +836,7 @@ public abstract class AbstractInMemoryContainer getVisibleItemIds() { @@ -1070,9 +1070,9 @@ public abstract class AbstractInMemoryContainer * For internal use only. - * + * * @since 7.4 - * + * * @return item id of the first visible item */ protected ITEMIDTYPE getFirstVisibleItem() { @@ -1084,7 +1084,7 @@ public abstract class AbstractInMemoryContainer */ protected List getFilteredItemIds() { @@ -1119,7 +1119,7 @@ public abstract class AbstractInMemoryContainer */ protected List getAllItemIds() { @@ -1140,12 +1140,12 @@ public abstract class AbstractInMemoryContainerremove*Filter* (which also re-filter the container) instead * when possible. - * + * * @param filters */ protected void setFilters(Set filters) { @@ -1155,7 +1155,7 @@ public abstract class AbstractInMemoryContainer */ protected Set getFilters() { diff --git a/server/src/main/java/com/vaadin/data/util/AbstractProperty.java b/server/src/main/java/com/vaadin/data/util/AbstractProperty.java index ee79fcd91e..bd1fcbf3fb 100644 --- a/server/src/main/java/com/vaadin/data/util/AbstractProperty.java +++ b/server/src/main/java/com/vaadin/data/util/AbstractProperty.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -24,10 +24,10 @@ import com.vaadin.data.Property; /** * Abstract base class for {@link Property} implementations. - * + * * Handles listener management for {@link ValueChangeListener}s and * {@link ReadOnlyStatusChangeListener}s. - * + * * @since 6.6 */ public abstract class AbstractProperty implements Property, @@ -51,7 +51,7 @@ public abstract class AbstractProperty implements Property, /** * {@inheritDoc} - * + * * Override for additional restrictions on what is considered a read-only * property. */ @@ -81,9 +81,9 @@ public abstract class AbstractProperty implements Property, * If legacy Property toString mode is disabled, the string representation * has no special meaning *

      - * + * * @see LegacyPropertyHelper#isLegacyToStringEnabled() - * + * * @return A string representation of the value value stored in the Property * or a string representation of the Property object. * @deprecated As of 7.0. To get the property value, use {@link #getValue()} @@ -105,12 +105,13 @@ public abstract class AbstractProperty implements Property, * An Event object specifying the Property whose read-only * status has been changed. */ - protected static class ReadOnlyStatusChangeEvent extends - java.util.EventObject implements Property.ReadOnlyStatusChangeEvent { + protected static class ReadOnlyStatusChangeEvent + extends java.util.EventObject + implements Property.ReadOnlyStatusChangeEvent { /** * Constructs a new read-only status change event for this object. - * + * * @param source * source object of the event. */ @@ -120,7 +121,7 @@ public abstract class AbstractProperty implements Property, /** * Gets the Property whose read-only state has changed. - * + * * @return source Property of the event. */ @Override @@ -132,7 +133,7 @@ public abstract class AbstractProperty implements Property, /** * Registers a new read-only status change listener for this Property. - * + * * @param listener * the new Listener to be registered. */ @@ -157,7 +158,7 @@ public abstract class AbstractProperty implements Property, /** * Removes a previously registered read-only status change listener. - * + * * @param listener * the listener to be removed. */ @@ -203,7 +204,7 @@ public abstract class AbstractProperty implements Property, /** * Constructs a new value change event for this object. - * + * * @param source * source object of the event. */ @@ -213,7 +214,7 @@ public abstract class AbstractProperty implements Property, /** * Gets the Property whose value has changed. - * + * * @return source Property of the event. */ @Override diff --git a/server/src/main/java/com/vaadin/data/util/BeanContainer.java b/server/src/main/java/com/vaadin/data/util/BeanContainer.java index 9b878d627e..a2a07c977c 100644 --- a/server/src/main/java/com/vaadin/data/util/BeanContainer.java +++ b/server/src/main/java/com/vaadin/data/util/BeanContainer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -19,25 +19,25 @@ import java.util.Collection; /** * An in-memory container for JavaBeans. - * + * *

      * The properties of the container are determined automatically by introspecting * the used JavaBean class. Only beans of the same type can be added to the * container. *

      - * + * *

      * In BeanContainer (unlike {@link BeanItemContainer}), the item IDs do not have * to be the beans themselves. The container can be used either with explicit * item IDs or the item IDs can be generated when adding beans. *

      - * + * *

      * To use explicit item IDs, use the methods {@link #addItem(Object, Object)}, * {@link #addItemAfter(Object, Object, Object)} and * {@link #addItemAt(int, Object, Object)}. *

      - * + * *

      * If a bean id resolver is set using * {@link #setBeanIdResolver(com.vaadin.data.util.AbstractBeanContainer.BeanIdResolver)} @@ -47,29 +47,29 @@ import java.util.Collection; * container. If one of these methods is called, the resolver is used to * generate an identifier for the item (must not return null). *

      - * + * *

      * Note that explicit item identifiers can also be used when a resolver has been * set by calling the addItem*() methods - the resolver is only used when adding * beans using the addBean*() or {@link #addAll(Collection)} methods. *

      - * + * *

      * It is not possible to add additional properties to the container. *

      - * + * * @param * The type of the item identifier * @param * The type of the Bean - * + * * @see AbstractBeanContainer * @see BeanItemContainer - * + * * @since 6.5 */ -public class BeanContainer extends - AbstractBeanContainer { +public class BeanContainer + extends AbstractBeanContainer { public BeanContainer(Class type) { super(type); @@ -77,7 +77,7 @@ public class BeanContainer extends /** * Adds the bean to the Container. - * + * * @see com.vaadin.data.Container#addItem(Object) */ @Override @@ -91,7 +91,7 @@ public class BeanContainer extends /** * Adds the bean after the given item id. - * + * * @see com.vaadin.data.Container.Ordered#addItemAfter(Object, Object) */ @Override @@ -106,16 +106,16 @@ public class BeanContainer extends /** * Adds a new bean at the given index. - * + * * The bean is used both as the item contents and as the item identifier. - * + * * @param index * Index at which the bean should be added. * @param newItemId * The item id for the bean to add to the container. * @param bean * The bean to add to the container. - * + * * @return Returns the new BeanItem or null if the operation fails. */ @Override @@ -133,7 +133,7 @@ public class BeanContainer extends /** * Sets the bean id resolver to use a property of the beans as the * identifier. - * + * * @param propertyId * the identifier of the property to use to find item identifiers */ diff --git a/server/src/main/java/com/vaadin/data/util/BeanItem.java b/server/src/main/java/com/vaadin/data/util/BeanItem.java index 71f51c3feb..78010a14c0 100644 --- a/server/src/main/java/com/vaadin/data/util/BeanItem.java +++ b/server/src/main/java/com/vaadin/data/util/BeanItem.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -28,7 +28,7 @@ import java.util.Set; /** * A wrapper class for adding the Item interface to any Java Bean. - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -46,16 +46,16 @@ public class BeanItem extends PropertysetItem { * of a Java Bean to it. The properties are identified by their respective * bean names. *

      - * + * *

      * Note : This version only supports introspectable bean properties and * their getter and setter methods. Stand-alone is and * are methods are not supported. *

      - * + * * @param bean * the Java Bean to copy properties from. - * + * */ public BeanItem(BT bean) { this(bean, (Class) bean.getClass()); @@ -67,20 +67,20 @@ public class BeanItem extends PropertysetItem { * of a Java Bean to it. The properties are identified by their respective * bean names. *

      - * + * *

      * Note : This version only supports introspectable bean properties and * their getter and setter methods. Stand-alone is and * are methods are not supported. *

      - * + * * @since 7.4 - * + * * @param bean * the Java Bean to copy properties from. * @param beanClass * class of the {@code bean} - * + * */ public BeanItem(BT bean, Class beanClass) { this(bean, getPropertyDescriptors(beanClass)); @@ -92,7 +92,7 @@ public class BeanItem extends PropertysetItem { * of properties. The properties are identified by their respective bean * names. *

      - * + * * @param bean * the Java Bean to copy properties from. * @param propertyDescriptors @@ -114,13 +114,13 @@ public class BeanItem extends PropertysetItem { * properties of a Java Bean to it - in specified order. The properties are * identified by their respective bean names. *

      - * + * *

      * Note : This version only supports introspectable bean properties and * their getter and setter methods. Stand-alone is and * are methods are not supported. *

      - * + * * @param bean * the Java Bean to copy properties from. * @param propertyIds @@ -131,8 +131,8 @@ public class BeanItem extends PropertysetItem { this.bean = bean; // Create bean information - LinkedHashMap> pds = getPropertyDescriptors((Class) bean - .getClass()); + LinkedHashMap> pds = getPropertyDescriptors( + (Class) bean.getClass()); // Add all the bean properties as MethodProperties to this Item for (Object id : propertyIds) { @@ -150,13 +150,13 @@ public class BeanItem extends PropertysetItem { * properties of a Java Bean to it - in specified order. The properties are * identified by their respective bean names. *

      - * + * *

      * Note : This version only supports introspectable bean properties and * their getter and setter methods. Stand-alone is and * are methods are not supported. *

      - * + * * @param bean * the Java Bean to copy properties from. * @param propertyIds @@ -170,13 +170,13 @@ public class BeanItem extends PropertysetItem { *

      * Perform introspection on a Java Bean class to find its properties. *

      - * + * *

      * Note : This version only supports introspectable bean properties and * their getter and setter methods. Stand-alone is and * are methods are not supported. *

      - * + * * @param beanClass * the Java Bean class to get properties for. * @return an ordered map from property names to property descriptors @@ -211,7 +211,7 @@ public class BeanItem extends PropertysetItem { /** * Expands nested bean properties by replacing a top-level property with * some or all of its sub-properties. The expansion is not recursive. - * + * * @param propertyId * property id for the property whose sub-properties are to be * expanded, @@ -243,18 +243,18 @@ public class BeanItem extends PropertysetItem { * item already and must of form "field1.field2" where field2 is a field in * the object referenced to by field1. If an intermediate property returns * null, the property will return a null value - * + * * @param nestedPropertyId * property id to add. */ public void addNestedProperty(String nestedPropertyId) { - addItemProperty(nestedPropertyId, new NestedMethodProperty( - getBean(), nestedPropertyId)); + addItemProperty(nestedPropertyId, + new NestedMethodProperty(getBean(), nestedPropertyId)); } /** * Gets the underlying JavaBean object. - * + * * @return the bean object. */ public BT getBean() { diff --git a/server/src/main/java/com/vaadin/data/util/BeanItemContainer.java b/server/src/main/java/com/vaadin/data/util/BeanItemContainer.java index d5d399f0f8..62cb71885c 100644 --- a/server/src/main/java/com/vaadin/data/util/BeanItemContainer.java +++ b/server/src/main/java/com/vaadin/data/util/BeanItemContainer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -19,13 +19,13 @@ import java.util.Collection; /** * An in-memory container for JavaBeans. - * + * *

      * The properties of the container are determined automatically by introspecting * the used JavaBean class. Only beans of the same type can be added to the * container. *

      - * + * *

      * BeanItemContainer uses the beans themselves as identifiers. The * {@link Object#hashCode()} of a bean is used when storing and looking up beans @@ -34,41 +34,41 @@ import java.util.Collection; * implementation of {@link Object#equals(Object)} as well in order for it to * fulfill the contract between {@code equals()} and {@code hashCode()}. *

      - * + * *

      * To add items to the container, use the methods {@link #addBean(Object)}, * {@link #addBeanAfter(Object, Object)} and {@link #addBeanAt(int, Object)}. * Also {@link #addItem(Object)}, {@link #addItemAfter(Object, Object)} and * {@link #addItemAt(int, Object)} can be used as synonyms for them. *

      - * + * *

      * It is not possible to add additional properties to the container. *

      - * + * * @param * The type of the Bean - * + * * @since 5.4 */ @SuppressWarnings("serial") -public class BeanItemContainer extends - AbstractBeanContainer { +public class BeanItemContainer + extends AbstractBeanContainer { /** * Bean identity resolver that returns the bean itself as its item * identifier. - * + * * This corresponds to the old behavior of {@link BeanItemContainer}, and * requires suitable (identity-based) equals() and hashCode() methods on the * beans. - * + * * @param - * + * * @since 6.5 */ - private static class IdentityBeanIdResolver implements - BeanIdResolver { + private static class IdentityBeanIdResolver + implements BeanIdResolver { @Override public BT getIdForBean(BT bean) { @@ -79,7 +79,7 @@ public class BeanItemContainer extends /** * Constructs a {@code BeanItemContainer} for beans of the given type. - * + * * @param type * the type of the beans that will be added to the container. * @throws IllegalArgumentException @@ -96,19 +96,19 @@ public class BeanItemContainer extends * The collection must not be empty. * {@link BeanItemContainer#BeanItemContainer(Class)} can be used for * creating an initially empty {@code BeanItemContainer}. - * + * * Note that when using this constructor, the actual class of the first item * in the collection is used to determine the bean properties supported by * the container instance, and only beans of that class or its subclasses * can be added to the collection. If this is problematic or empty * collections need to be supported, use {@link #BeanItemContainer(Class)} * and {@link #addAll(Collection)} instead. - * + * * @param collection * a non empty {@link Collection} of beans. * @throws IllegalArgumentException * If the collection is null or empty. - * + * * @deprecated As of 6.5, use {@link #BeanItemContainer(Class, Collection)} * instead */ @@ -125,7 +125,7 @@ public class BeanItemContainer extends /** * Internal helper method to support the deprecated {@link Collection} * container. - * + * * @param * @param collection * @return @@ -145,7 +145,7 @@ public class BeanItemContainer extends /** * Constructs a {@code BeanItemContainer} and adds the given beans to it. - * + * * @param type * the type of the beans that will be added to the container. * @param collection @@ -167,7 +167,7 @@ public class BeanItemContainer extends /** * Adds all the beans from a {@link Collection} in one go. More efficient * than adding them one by one. - * + * * @param collection * The collection of beans to add. Must not be null. */ @@ -178,14 +178,14 @@ public class BeanItemContainer extends /** * Adds the bean after the given bean. - * + * * The bean is used both as the item contents and as the item identifier. - * + * * @param previousItemId * the bean (of type BT) after which to add newItemId * @param newItemId * the bean (of type BT) to add (not null) - * + * * @see com.vaadin.data.Container.Ordered#addItemAfter(Object, Object) */ @Override @@ -198,9 +198,9 @@ public class BeanItemContainer extends /** * Adds a new bean at the given index. - * + * * The bean is used both as the item contents and as the item identifier. - * + * * @param index * Index at which the bean should be added. * @param newItemId @@ -216,9 +216,9 @@ public class BeanItemContainer extends /** * Adds the bean to the Container. - * + * * The bean is used both as the item contents and as the item identifier. - * + * * @see com.vaadin.data.Container#addItem(Object) */ @Override @@ -229,9 +229,9 @@ public class BeanItemContainer extends /** * Adds the bean to the Container. - * + * * The bean is used both as the item contents and as the item identifier. - * + * * @see com.vaadin.data.Container#addItem(Object) */ @Override diff --git a/server/src/main/java/com/vaadin/data/util/BeanUtil.java b/server/src/main/java/com/vaadin/data/util/BeanUtil.java index 1356cf5359..e50ca97d67 100644 --- a/server/src/main/java/com/vaadin/data/util/BeanUtil.java +++ b/server/src/main/java/com/vaadin/data/util/BeanUtil.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -26,9 +26,9 @@ import java.util.List; /** * Utility class for Java Beans information access. - * + * * @since 7.4 - * + * * @author Vaadin Ltd */ public final class BeanUtil implements Serializable { @@ -38,21 +38,21 @@ public final class BeanUtil implements Serializable { /** * Returns the property descriptors of a class or an interface. - * + * * For an interface, superinterfaces are also iterated as Introspector does * not take them into account (Oracle Java bug 4275879), but in that case, * both the setter and the getter for a property must be in the same * interface and should not be overridden in subinterfaces for the discovery * to work correctly. - * + * * NOTE : This utility method relies on introspection (and returns * PropertyDescriptor) which is a part of java.beans package. The latter * package could require bigger JDK in the future (with Java 9+). So it may * be changed in the future. - * + * * For interfaces, the iteration is depth first and the properties of * superinterfaces are returned before those of their subinterfaces. - * + * * @param beanClass * @return * @throws IntrospectionException @@ -82,7 +82,7 @@ public final class BeanUtil implements Serializable { * Returns {@code propertyId} class for property declared in {@code clazz}. * Property could be of form "property.subProperty[.subProperty2]" i.e. * refer to some nested property. - * + * * @param clazz * class where property is declared * @param propertyId @@ -100,12 +100,12 @@ public final class BeanUtil implements Serializable { // Find the rest from the sub type return getPropertyType(propertyBean, parts[1]); } else { - List descriptors = getBeanPropertyDescriptor(clazz); + List descriptors = getBeanPropertyDescriptor( + clazz); for (PropertyDescriptor descriptor : descriptors) { final Method getMethod = descriptor.getReadMethod(); - if (descriptor.getName().equals(propertyId) - && getMethod != null + if (descriptor.getName().equals(propertyId) && getMethod != null && getMethod.getDeclaringClass() != Object.class) { return descriptor.getPropertyType(); } @@ -122,8 +122,8 @@ public final class BeanUtil implements Serializable { descriptors.length); for (PropertyDescriptor descriptor : descriptors) { try { - Method readMethod = getMethodFromBridge(descriptor - .getReadMethod()); + Method readMethod = getMethodFromBridge( + descriptor.getReadMethod()); if (readMethod != null) { Method writeMethod = getMethodFromBridge( descriptor.getWriteMethod(), @@ -170,8 +170,8 @@ public final class BeanUtil implements Serializable { return null; } try { - return bridgeMethod.getDeclaringClass().getMethod( - bridgeMethod.getName(), paramTypes); + return bridgeMethod.getDeclaringClass() + .getMethod(bridgeMethod.getName(), paramTypes); } catch (NoSuchMethodException e) { return null; } diff --git a/server/src/main/java/com/vaadin/data/util/ContainerHierarchicalWrapper.java b/server/src/main/java/com/vaadin/data/util/ContainerHierarchicalWrapper.java index 8590528f43..fe768e677b 100644 --- a/server/src/main/java/com/vaadin/data/util/ContainerHierarchicalWrapper.java +++ b/server/src/main/java/com/vaadin/data/util/ContainerHierarchicalWrapper.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -36,14 +36,14 @@ import com.vaadin.data.Property; * A wrapper class for adding external hierarchy to containers not implementing * the {@link com.vaadin.data.Container.Hierarchical} interface. *

      - * + * *

      * If the wrapped container is changed directly (that is, not through the * wrapper), and does not implement Container.ItemSetChangeNotifier and/or * Container.PropertySetChangeNotifier the hierarchy information must be updated * with the {@link #updateHierarchicalWrapper()} method. *

      - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -73,8 +73,8 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, * A comparator that sorts the listed items before other items. Otherwise, * the order is undefined. */ - private static class ListedItemsFirstComparator implements - Comparator, Serializable { + private static class ListedItemsFirstComparator + implements Comparator, Serializable { private final Collection itemIds; private ListedItemsFirstComparator(Collection itemIds) { @@ -101,7 +101,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, * Constructs a new hierarchical wrapper for an existing Container. Works * even if the to-be-wrapped container already implements the * Container.Hierarchical interface. - * + * * @param toBeWrapped * the container that needs to be accessed hierarchically * @see #updateHierarchicalWrapper() @@ -201,7 +201,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, *

      * Note : The Item is not removed from the underlying Container. *

      - * + * * @param itemId * the ID of the item to remove from the hierarchy. */ @@ -231,7 +231,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, * Adds the specified Item specified to the internal hierarchy structure. * The new item is added as a root Item. The underlying container is not * modified. - * + * * @param itemId * the ID of the item to add to the hierarchy. */ @@ -358,7 +358,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, * {@link #setParent(Object itemId, Object newParentId)} or * {@link com.vaadin.data.Container#removeItem(Object itemId)}. *

      - * + * * @param itemId * the ID of the Item in the container whose child capability is * to be set. @@ -373,8 +373,8 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, // If the wrapped container implements the method directly, use it if (hierarchical) { - return ((Container.Hierarchical) container).setChildrenAllowed( - itemId, childrenAllowed); + return ((Container.Hierarchical) container) + .setChildrenAllowed(itemId, childrenAllowed); } // Check that the item is in the container @@ -399,7 +399,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, * also possible to detach a node from the hierarchy (and thus make it root) * by setting the parent null. *

      - * + * * @param itemId * the ID of the item to be set as the child of the Item * identified with newParentId. @@ -457,7 +457,8 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, // Check that the new parent exists in container and can have // children - if (!containsId(newParentId) || noChildrenAllowed.contains(newParentId)) { + if (!containsId(newParentId) + || noChildrenAllowed.contains(newParentId)) { return false; } @@ -510,7 +511,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, /** * Creates a new Item into the Container, assigns it an automatic ID, and * adds it to the hierarchy. - * + * * @return the autogenerated ID of the new Item or null if the * operation failed * @throws UnsupportedOperationException @@ -529,7 +530,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, /** * Adds a new Item by its ID to the underlying container and to the * hierarchy. - * + * * @param itemId * the ID of the Item to be created. * @return the added Item or null if the operation failed. @@ -552,7 +553,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, /** * Removes all items from the underlying container and from the hierarcy. - * + * * @return true if the operation succeeded, false * if not * @throws UnsupportedOperationException @@ -575,7 +576,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, /** * Removes an Item specified by the itemId from the underlying container and * from the hierarchy. - * + * * @param itemId * the ID of the Item to be removed. * @return true if the operation succeeded, false @@ -598,7 +599,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, /** * Removes the Item identified by given itemId and all its children. - * + * * @see #removeItem(Object) * @param itemId * the identifier of the Item to be removed @@ -610,7 +611,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, /** * Adds a new Property to all Items in the Container. - * + * * @param propertyId * the ID of the new Property. * @param type @@ -635,7 +636,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, *

      * Note : The Property will be removed from all Items in the Container. *

      - * + * * @param propertyId * the ID of the Property to remove. * @return true if the operation succeeded, false @@ -753,7 +754,8 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, Container.ItemSetChangeListener listener) { if (container instanceof Container.ItemSetChangeNotifier) { ((Container.ItemSetChangeNotifier) container) - .removeItemSetChangeListener(new PiggybackListener(listener)); + .removeItemSetChangeListener( + new PiggybackListener(listener)); } } @@ -777,8 +779,8 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, Container.PropertySetChangeListener listener) { if (container instanceof Container.PropertySetChangeNotifier) { ((Container.PropertySetChangeNotifier) container) - .addPropertySetChangeListener(new PiggybackListener( - listener)); + .addPropertySetChangeListener( + new PiggybackListener(listener)); } } @@ -802,8 +804,8 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, Container.PropertySetChangeListener listener) { if (container instanceof Container.PropertySetChangeNotifier) { ((Container.PropertySetChangeNotifier) container) - .removePropertySetChangeListener(new PiggybackListener( - listener)); + .removePropertySetChangeListener( + new PiggybackListener(listener)); } } @@ -821,10 +823,10 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, * This listener 'piggybacks' on the real listener in order to update the * wrapper when needed. It proxies equals() and hashCode() to the real * listener so that the correct listener gets removed. - * + * */ - private class PiggybackListener implements - Container.PropertySetChangeListener, + private class PiggybackListener + implements Container.PropertySetChangeListener, Container.ItemSetChangeListener { Object listener; diff --git a/server/src/main/java/com/vaadin/data/util/ContainerOrderedWrapper.java b/server/src/main/java/com/vaadin/data/util/ContainerOrderedWrapper.java index 53f4840322..fef43caf17 100644 --- a/server/src/main/java/com/vaadin/data/util/ContainerOrderedWrapper.java +++ b/server/src/main/java/com/vaadin/data/util/ContainerOrderedWrapper.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -32,14 +32,14 @@ import com.vaadin.data.Property; * A wrapper class for adding external ordering to containers not implementing * the {@link com.vaadin.data.Container.Ordered} interface. *

      - * + * *

      * If the wrapped container is changed directly (that is, not through the * wrapper), and does not implement Container.ItemSetChangeNotifier and/or * Container.PropertySetChangeNotifier the hierarchy information must be updated * with the {@link #updateOrderWrapper()} method. *

      - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -92,7 +92,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, * Constructs a new ordered wrapper for an existing Container. Works even if * the to-be-wrapped container already implements the Container.Ordered * interface. - * + * * @param toBeWrapped * the container whose contents need to be ordered. */ @@ -116,7 +116,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, *

      * Note : The Item is not removed from the underlying Container. *

      - * + * * @param id * the ID of the Item to be removed from the ordering. */ @@ -152,7 +152,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, /** * Registers the specified Item to the last position in the wrapper's * internal ordering. The underlying container is not modified. - * + * * @param id * the ID of the Item to be added to the ordering. */ @@ -172,7 +172,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, * Registers the specified Item after the specified itemId in the wrapper's * internal ordering. The underlying container is not modified. Given item * id must be in the container, or must be null. - * + * * @param id * the ID of the Item to be added to the ordering. * @param previousItemId @@ -324,7 +324,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, /** * Registers a new Property to all Items in the Container. - * + * * @param propertyId * the ID of the new Property. * @param type @@ -344,7 +344,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, /** * Creates a new Item into the Container, assigns it an automatic ID, and * adds it to the ordering. - * + * * @return the autogenerated ID of the new Item or null if the * operation failed * @throws UnsupportedOperationException @@ -363,7 +363,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, /** * Registers a new Item by its ID to the underlying container and to the * ordering. - * + * * @param itemId * the ID of the Item to be created. * @return the added Item or null if the operation failed @@ -381,7 +381,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, /** * Removes all items from the underlying container and from the ordering. - * + * * @return true if the operation succeeded, otherwise * false * @throws UnsupportedOperationException @@ -401,7 +401,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, /** * Removes an Item specified by the itemId from the underlying container and * from the ordering. - * + * * @param itemId * the ID of the Item to be removed. * @return true if the operation succeeded, false @@ -426,7 +426,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, *

      * Note : The Property will be removed from all the Items in the Container. *

      - * + * * @param propertyId * the ID of the Property to remove. * @return true if the operation succeeded, false @@ -565,7 +565,8 @@ public class ContainerOrderedWrapper implements Container.Ordered, Container.ItemSetChangeListener listener) { if (container instanceof Container.ItemSetChangeNotifier) { ((Container.ItemSetChangeNotifier) container) - .removeItemSetChangeListener(new PiggybackListener(listener)); + .removeItemSetChangeListener( + new PiggybackListener(listener)); } } @@ -589,8 +590,8 @@ public class ContainerOrderedWrapper implements Container.Ordered, Container.PropertySetChangeListener listener) { if (container instanceof Container.PropertySetChangeNotifier) { ((Container.PropertySetChangeNotifier) container) - .addPropertySetChangeListener(new PiggybackListener( - listener)); + .addPropertySetChangeListener( + new PiggybackListener(listener)); } } @@ -614,8 +615,8 @@ public class ContainerOrderedWrapper implements Container.Ordered, Container.PropertySetChangeListener listener) { if (container instanceof Container.PropertySetChangeNotifier) { ((Container.PropertySetChangeNotifier) container) - .removePropertySetChangeListener(new PiggybackListener( - listener)); + .removePropertySetChangeListener( + new PiggybackListener(listener)); } } @@ -631,7 +632,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container.Ordered#addItemAfter(java.lang.Object, * java.lang.Object) */ @@ -657,7 +658,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container.Ordered#addItemAfter(java.lang.Object) */ @Override @@ -684,10 +685,10 @@ public class ContainerOrderedWrapper implements Container.Ordered, * This listener 'piggybacks' on the real listener in order to update the * wrapper when needed. It proxies equals() and hashCode() to the real * listener so that the correct listener gets removed. - * + * */ - private class PiggybackListener implements - Container.PropertySetChangeListener, + private class PiggybackListener + implements Container.PropertySetChangeListener, Container.ItemSetChangeListener { Object listener; diff --git a/server/src/main/java/com/vaadin/data/util/DefaultItemSorter.java b/server/src/main/java/com/vaadin/data/util/DefaultItemSorter.java index 9728ccbd51..c35a3a6325 100644 --- a/server/src/main/java/com/vaadin/data/util/DefaultItemSorter.java +++ b/server/src/main/java/com/vaadin/data/util/DefaultItemSorter.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -36,7 +36,7 @@ import com.vaadin.data.Property; * A Comparator is used for comparing the individual Property * values. The comparator can be set using the constructor. If no comparator is * provided a default comparator is used. - * + * */ public class DefaultItemSorter implements ItemSorter { @@ -48,7 +48,7 @@ public class DefaultItemSorter implements ItemSorter { /** * Constructs a DefaultItemSorter using the default Comparator * for comparing Propertyvalues. - * + * */ public DefaultItemSorter() { this(new DefaultPropertyValueComparator()); @@ -58,7 +58,7 @@ public class DefaultItemSorter implements ItemSorter { * Constructs a DefaultItemSorter which uses the Comparator * indicated by the propertyValueComparator parameter for * comparing Propertyvalues. - * + * * @param propertyValueComparator * The comparator to use when comparing individual * Property values @@ -69,7 +69,7 @@ public class DefaultItemSorter implements ItemSorter { /* * (non-Javadoc) - * + * * @see com.vaadin.data.util.ItemSorter#compare(java.lang.Object, * java.lang.Object) */ @@ -117,7 +117,7 @@ public class DefaultItemSorter implements ItemSorter { *

      * The comparator set for this DefaultItemSorter is used for * comparing the two property values. - * + * * @param propertyId * The property id for the property that is used for comparison. * @param sortDirection @@ -155,10 +155,9 @@ public class DefaultItemSorter implements ItemSorter { /* * (non-Javadoc) - * - * @see - * com.vaadin.data.util.ItemSorter#setSortProperties(com.vaadin.data.Container - * .Sortable, java.lang.Object[], boolean[]) + * + * @see com.vaadin.data.util.ItemSorter#setSortProperties(com.vaadin.data. + * Container .Sortable, java.lang.Object[], boolean[]) */ @Override public void setSortProperties(Container.Sortable container, @@ -173,8 +172,8 @@ public class DefaultItemSorter implements ItemSorter { for (int i = 0; i < propertyId.length; i++) { if (sortable.contains(propertyId[i])) { ids.add(propertyId[i]); - orders.add(Boolean.valueOf(i < ascending.length ? ascending[i] - : true)); + orders.add(Boolean + .valueOf(i < ascending.length ? ascending[i] : true)); } } @@ -190,10 +189,10 @@ public class DefaultItemSorter implements ItemSorter { * Provides a default comparator used for comparing {@link Property} values. * The DefaultPropertyValueComparator assumes all objects it * compares can be cast to Comparable. - * + * */ - public static class DefaultPropertyValueComparator implements - Comparator, Serializable { + public static class DefaultPropertyValueComparator + implements Comparator, Serializable { @Override @SuppressWarnings("unchecked") diff --git a/server/src/main/java/com/vaadin/data/util/FilesystemContainer.java b/server/src/main/java/com/vaadin/data/util/FilesystemContainer.java index 7ceda49918..d6e24fd02e 100644 --- a/server/src/main/java/com/vaadin/data/util/FilesystemContainer.java +++ b/server/src/main/java/com/vaadin/data/util/FilesystemContainer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -38,7 +38,7 @@ import com.vaadin.util.FileTypeResolver; /** * A hierarchical container wrapper for a filesystem. - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -107,7 +107,7 @@ public class FilesystemContainer implements Container.Hierarchical { /** * Constructs a new FileSystemContainer with the specified file * as the root of the filesystem. The files are included recursively. - * + * * @param root * the root file for the new file-system container. Null values * are ignored. @@ -121,7 +121,7 @@ public class FilesystemContainer implements Container.Hierarchical { /** * Constructs a new FileSystemContainer with the specified file * as the root of the filesystem. The files are included recursively. - * + * * @param root * the root file for the new file-system container. * @param recursive @@ -135,7 +135,7 @@ public class FilesystemContainer implements Container.Hierarchical { /** * Constructs a new FileSystemContainer with the specified file * as the root of the filesystem. - * + * * @param root * the root file for the new file-system container. * @param extension @@ -153,7 +153,7 @@ public class FilesystemContainer implements Container.Hierarchical { /** * Constructs a new FileSystemContainer with the specified root * and recursivity status. - * + * * @param root * the root file for the new file-system container. * @param filter @@ -171,7 +171,7 @@ public class FilesystemContainer implements Container.Hierarchical { /** * Adds new root file directory. Adds a file to be included as root file * directory in the FilesystemContainer. - * + * * @param root * the File to be added as root directory. Null values are * ignored. @@ -191,7 +191,7 @@ public class FilesystemContainer implements Container.Hierarchical { * Tests if the specified Item in the container may have children. Since a * FileSystemContainer contains files and directories, this * method returns true for directory Items only. - * + * * @param itemId * the id of the item. * @return true if the specified Item is a directory, @@ -316,7 +316,7 @@ public class FilesystemContainer implements Container.Hierarchical { /** * Returns false when conversion from files to directories is * not supported. - * + * * @param itemId * the ID of the item. * @param areChildrenAllowed @@ -338,7 +338,7 @@ public class FilesystemContainer implements Container.Hierarchical { /** * Returns false when moving files around in the filesystem is * not supported. - * + * * @param itemId * the ID of the item. * @param newParentId @@ -372,8 +372,8 @@ public class FilesystemContainer implements Container.Hierarchical { // Try to match all roots for (int i = 0; i < roots.length; i++) { try { - val |= ((File) itemId).getCanonicalPath().startsWith( - roots[i].getCanonicalPath()); + val |= ((File) itemId).getCanonicalPath() + .startsWith(roots[i].getCanonicalPath()); } catch (final IOException e) { // Exception ignored } @@ -402,7 +402,7 @@ public class FilesystemContainer implements Container.Hierarchical { /** * Internal recursive method to add the files under the specified directory * to the collection. - * + * * @param col * the collection where the found items are added * @param f @@ -473,7 +473,7 @@ public class FilesystemContainer implements Container.Hierarchical { * Gets the specified property of the specified file Item. The available * file properties are "Name", "Size" and "Last Modified". If propertyId is * not one of those, null is returned. - * + * * @param itemId * the ID of the file whose property is requested. * @param propertyId @@ -512,7 +512,7 @@ public class FilesystemContainer implements Container.Hierarchical { /** * Gets the collection of available file properties. - * + * * @return Unmodifiable collection containing all available file properties. */ @Override @@ -524,7 +524,7 @@ public class FilesystemContainer implements Container.Hierarchical { * Gets the specified property's data type. "Name" is a String, * "Size" is a Long, "Last Modified" is a Date. If * propertyId is not one of those, null is returned. - * + * * @param propertyId * the ID of the property whose type is requested. * @return data type of the requested property, or null @@ -550,7 +550,7 @@ public class FilesystemContainer implements Container.Hierarchical { /** * Internal method to recursively calculate the number of files under a root * directory. - * + * * @param f * the root to start counting from. */ @@ -577,7 +577,7 @@ public class FilesystemContainer implements Container.Hierarchical { /** * Gets the number of Items in the container. In effect, this is the * combined amount of files and directories. - * + * * @return Number of Items in the container. */ @Override @@ -610,7 +610,7 @@ public class FilesystemContainer implements Container.Hierarchical { /** * A Item wrapper for files in a filesystem. - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -653,7 +653,7 @@ public class FilesystemContainer implements Container.Hierarchical { * same Item contained in the same list always have different * hash-codes, though Properties in different Items may have identical * hash-codes. - * + * * @return A locally unique hash-code as integer */ @Override @@ -664,7 +664,7 @@ public class FilesystemContainer implements Container.Hierarchical { /** * Tests if the given object is the same as the this object. Two * Properties got from an Item with the same ID are equal. - * + * * @param obj * an object to compare with this object. * @return true if the given object is the same as this @@ -688,7 +688,7 @@ public class FilesystemContainer implements Container.Hierarchical { /** * Gets the last modified date of this file. - * + * * @return Date */ public Date lastModified() { @@ -697,7 +697,7 @@ public class FilesystemContainer implements Container.Hierarchical { /** * Gets the name of this file. - * + * * @return file name of this file. */ public String getName() { @@ -706,7 +706,7 @@ public class FilesystemContainer implements Container.Hierarchical { /** * Gets the icon of this file. - * + * * @return the icon of this file. */ public Resource getIcon() { @@ -715,7 +715,7 @@ public class FilesystemContainer implements Container.Hierarchical { /** * Gets the size of this file. - * + * * @return size */ public long getSize() { @@ -738,7 +738,7 @@ public class FilesystemContainer implements Container.Hierarchical { /** * Filesystem container does not support adding new properties. - * + * * @see com.vaadin.data.Item#addItemProperty(Object, Property) */ @Override @@ -750,7 +750,7 @@ public class FilesystemContainer implements Container.Hierarchical { /** * Filesystem container does not support removing properties. - * + * * @see com.vaadin.data.Item#removeItemProperty(Object) */ @Override @@ -765,7 +765,7 @@ public class FilesystemContainer implements Container.Hierarchical { /** * Generic file extension filter for displaying only files having certain * extension. - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -775,7 +775,7 @@ public class FilesystemContainer implements Container.Hierarchical { /** * Constructs a new FileExtensionFilter using given extension. - * + * * @param fileExtension * the File extension without the separator (dot). */ @@ -785,7 +785,7 @@ public class FilesystemContainer implements Container.Hierarchical { /** * Allows only files with the extension and directories. - * + * * @see java.io.FilenameFilter#accept(File, String) */ @Override @@ -800,7 +800,7 @@ public class FilesystemContainer implements Container.Hierarchical { /** * Returns the file filter used to limit the files in this container. - * + * * @return Used filter instance or null if no filter is assigned. */ public FilenameFilter getFilter() { @@ -809,7 +809,7 @@ public class FilesystemContainer implements Container.Hierarchical { /** * Sets the file filter used to limit the files in this container. - * + * * @param filter * The filter to set. null disables filtering. */ @@ -819,7 +819,7 @@ public class FilesystemContainer implements Container.Hierarchical { /** * Sets the file filter used to limit the files in this container. - * + * * @param extension * the Filename extension (w/o separator) to limit the files in * container. @@ -830,7 +830,7 @@ public class FilesystemContainer implements Container.Hierarchical { /** * Is this container recursive filesystem. - * + * * @return true if container is recursive, false * otherwise. */ @@ -844,7 +844,7 @@ public class FilesystemContainer implements Container.Hierarchical { *

      * Note : This is meaningful only if the root really is a directory. *

      - * + * * @param recursive * the New value for recursive property. */ @@ -854,7 +854,7 @@ public class FilesystemContainer implements Container.Hierarchical { /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container#addContainerProperty(java.lang.Object, * java.lang.Class, java.lang.Object) */ @@ -867,7 +867,7 @@ public class FilesystemContainer implements Container.Hierarchical { /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container#addItem() */ @Override @@ -878,7 +878,7 @@ public class FilesystemContainer implements Container.Hierarchical { /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container#addItem(java.lang.Object) */ @Override @@ -889,7 +889,7 @@ public class FilesystemContainer implements Container.Hierarchical { /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container#removeAllItems() */ @Override @@ -900,7 +900,7 @@ public class FilesystemContainer implements Container.Hierarchical { /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container#removeItem(java.lang.Object) */ @Override @@ -912,7 +912,7 @@ public class FilesystemContainer implements Container.Hierarchical { /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container#removeContainerProperty(java.lang.Object ) */ @Override diff --git a/server/src/main/java/com/vaadin/data/util/GeneratedPropertyContainer.java b/server/src/main/java/com/vaadin/data/util/GeneratedPropertyContainer.java index 1fbca5f817..3dae54ff27 100644 --- a/server/src/main/java/com/vaadin/data/util/GeneratedPropertyContainer.java +++ b/server/src/main/java/com/vaadin/data/util/GeneratedPropertyContainer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -38,29 +38,29 @@ import com.vaadin.shared.data.sort.SortDirection; * Container wrapper that adds support for generated properties. This container * only supports adding new generated properties. Adding new normal properties * should be done for the wrapped container. - * + * *

      * Removing properties from this container does not remove anything from the * wrapped container but instead only hides them from the results. These * properties can be returned to this container by calling * {@link #addContainerProperty(Object, Class, Object)} with same property id * which was removed. - * + * *

      * If wrapped container is Filterable and/or Sortable it should only be handled * through this container as generated properties need to be handled in a * specific way when sorting/filtering. - * + * *

      * Items returned by this container do not support adding or removing * properties. Generated properties are always read-only. Trying to make them * editable throws an exception. - * + * * @since 7.4 * @author Vaadin Ltd */ -public class GeneratedPropertyContainer extends AbstractContainer implements - Container.Indexed, Container.Sortable, Container.Filterable, +public class GeneratedPropertyContainer extends AbstractContainer + implements Container.Indexed, Container.Sortable, Container.Filterable, Container.PropertySetChangeNotifier, Container.ItemSetChangeNotifier { private final Container.Indexed wrappedContainer; @@ -171,7 +171,7 @@ public class GeneratedPropertyContainer extends AbstractContainer implements /** * Tests if the given object is the same as the this object. Two Items * from the same container with the same ID are equal. - * + * * @param obj * an object to compare with this object * @return true if the given object is the same as this @@ -203,7 +203,7 @@ public class GeneratedPropertyContainer extends AbstractContainer implements /** * Returns the wrapped Item that belongs to the wrapped container - * + * * @return wrapped item. * @since 7.6.8 */ @@ -217,8 +217,8 @@ public class GeneratedPropertyContainer extends AbstractContainer implements * event is fired from wrapped container and needs to be reconstructed to * act like it actually came from this container. */ - protected abstract class GeneratedItemAddOrRemoveEvent implements - Serializable { + protected abstract class GeneratedItemAddOrRemoveEvent + implements Serializable { private Object firstItemId; private int firstIndex; @@ -248,12 +248,12 @@ public class GeneratedPropertyContainer extends AbstractContainer implements } }; - protected class GeneratedItemRemoveEvent extends - GeneratedItemAddOrRemoveEvent implements ItemRemoveEvent { + protected class GeneratedItemRemoveEvent + extends GeneratedItemAddOrRemoveEvent implements ItemRemoveEvent { protected GeneratedItemRemoveEvent(ItemRemoveEvent event) { - super(event.getFirstItemId(), event.getFirstIndex(), event - .getRemovedItemsCount()); + super(event.getFirstItemId(), event.getFirstIndex(), + event.getRemovedItemsCount()); } @Override @@ -266,8 +266,8 @@ public class GeneratedPropertyContainer extends AbstractContainer implements implements ItemAddEvent { protected GeneratedItemAddEvent(ItemAddEvent event) { - super(event.getFirstItemId(), event.getFirstIndex(), event - .getAddedItemsCount()); + super(event.getFirstItemId(), event.getFirstIndex(), + event.getAddedItemsCount()); } @Override @@ -279,7 +279,7 @@ public class GeneratedPropertyContainer extends AbstractContainer implements /** * Constructor for GeneratedPropertyContainer. - * + * * @param container * underlying indexed container */ @@ -308,8 +308,8 @@ public class GeneratedPropertyContainer extends AbstractContainer implements ItemSetChangeEvent event) { if (event instanceof ItemAddEvent) { final ItemAddEvent addEvent = (ItemAddEvent) event; - fireItemSetChange(new GeneratedItemAddEvent( - addEvent)); + fireItemSetChange( + new GeneratedItemAddEvent(addEvent)); } else if (event instanceof ItemRemoveEvent) { final ItemRemoveEvent removeEvent = (ItemRemoveEvent) event; fireItemSetChange(new GeneratedItemRemoveEvent( @@ -324,14 +324,15 @@ public class GeneratedPropertyContainer extends AbstractContainer implements // PropertySetChangeEvents if (wrappedContainer instanceof PropertySetChangeNotifier) { ((PropertySetChangeNotifier) wrappedContainer) - .addPropertySetChangeListener(new PropertySetChangeListener() { + .addPropertySetChangeListener( + new PropertySetChangeListener() { - @Override - public void containerPropertySetChange( - PropertySetChangeEvent event) { - fireContainerPropertySetChange(); - } - }); + @Override + public void containerPropertySetChange( + PropertySetChangeEvent event) { + fireContainerPropertySetChange(); + } + }); } } @@ -341,7 +342,7 @@ public class GeneratedPropertyContainer extends AbstractContainer implements * Add a new PropertyValueGenerator with given property id. This will * override any existing properties with the same property id. Fires a * PropertySetChangeEvent. - * + * * @param propertyId * property id * @param generator @@ -356,7 +357,7 @@ public class GeneratedPropertyContainer extends AbstractContainer implements /** * Removes any possible PropertyValueGenerator with given property id. Fires * a PropertySetChangeEvent. - * + * * @param propertyId * property id */ @@ -401,7 +402,8 @@ public class GeneratedPropertyContainer extends AbstractContainer implements } @Override - public void addPropertySetChangeListener(PropertySetChangeListener listener) { + public void addPropertySetChangeListener( + PropertySetChangeListener listener) { super.addPropertySetChangeListener(listener); } @@ -520,7 +522,8 @@ public class GeneratedPropertyContainer extends AbstractContainer implements // modify sort orders to work with original properties in the // container. for (SortOrder s : propertyGenerators.get(property) - .getSortProperties(new SortOrder(property, direction))) { + .getSortProperties( + new SortOrder(property, direction))) { actualSortProperties.add(s.getPropertyId()); actualSortDirections .add(s.getDirection() == SortDirection.ASCENDING); @@ -764,7 +767,7 @@ public class GeneratedPropertyContainer extends AbstractContainer implements /** * Returns the original underlying container. - * + * * @return the original underlying container */ public Container.Indexed getWrappedContainer() { diff --git a/server/src/main/java/com/vaadin/data/util/HierarchicalContainer.java b/server/src/main/java/com/vaadin/data/util/HierarchicalContainer.java index 2235e77b34..0615f41b2b 100644 --- a/server/src/main/java/com/vaadin/data/util/HierarchicalContainer.java +++ b/server/src/main/java/com/vaadin/data/util/HierarchicalContainer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -32,13 +32,13 @@ import com.vaadin.data.Item; /** * A specialized Container whose contents can be accessed like it was a * tree-like structure. - * + * * @author Vaadin Ltd. * @since 3.0 */ @SuppressWarnings("serial") -public class HierarchicalContainer extends IndexedContainer implements - Container.Hierarchical { +public class HierarchicalContainer extends IndexedContainer + implements Container.Hierarchical { /** * Set of IDs of those contained Items that can't have children. @@ -83,7 +83,7 @@ public class HierarchicalContainer extends IndexedContainer implements /** * Counts how many nested contents change disable calls are in progress. - * + * * Pending events are only fired when the counter reaches zero again. */ private int contentChangedEventsDisabledCount = 0; @@ -196,7 +196,7 @@ public class HierarchicalContainer extends IndexedContainer implements * {@link #setParent(Object itemId, Object newParentId)} or * {@link com.vaadin.data.Container#removeItem(Object itemId)}. *

      - * + * * @param itemId * the ID of the Item in the container whose child capability is * to be set. @@ -231,7 +231,7 @@ public class HierarchicalContainer extends IndexedContainer implements * also possible to detach a node from the hierarchy (and thus make it root) * by setting the parent null. *

      - * + * * @param itemId * the ID of the item to be set as the child of the Item * identified with newParentId. @@ -304,7 +304,8 @@ public class HierarchicalContainer extends IndexedContainer implements // Checks that the new parent exists in container and can have // children - if (!containsId(newParentId) || noChildrenAllowed.contains(newParentId)) { + if (!containsId(newParentId) + || noChildrenAllowed.contains(newParentId)) { return false; } @@ -360,7 +361,7 @@ public class HierarchicalContainer extends IndexedContainer implements /** * Moves a node (an Item) in the container immediately after a sibling node. * The two nodes must have the same parent in the container. - * + * * @param itemId * the identifier of the moved node (Item) * @param siblingId @@ -402,7 +403,7 @@ public class HierarchicalContainer extends IndexedContainer implements /* * (non-Javadoc) - * + * * @see com.vaadin.data.util.IndexedContainer#addItem() */ @Override @@ -448,9 +449,8 @@ public class HierarchicalContainer extends IndexedContainer implements private void enableAndFireContentsChangeEvents() { if (contentChangedEventsDisabledCount <= 0) { - getLogger() - .log(Level.WARNING, - "Mismatched calls to disable and enable contents change events in HierarchicalContainer"); + getLogger().log(Level.WARNING, + "Mismatched calls to disable and enable contents change events in HierarchicalContainer"); contentChangedEventsDisabledCount = 0; } else { contentChangedEventsDisabledCount--; @@ -465,7 +465,7 @@ public class HierarchicalContainer extends IndexedContainer implements /* * (non-Javadoc) - * + * * @see com.vaadin.data.util.IndexedContainer#addItem(java.lang.Object) */ @Override @@ -492,7 +492,7 @@ public class HierarchicalContainer extends IndexedContainer implements /* * (non-Javadoc) - * + * * @see com.vaadin.data.util.IndexedContainer#removeAllItems() */ @Override @@ -524,7 +524,7 @@ public class HierarchicalContainer extends IndexedContainer implements /* * (non-Javadoc) - * + * * @see com.vaadin.data.util.IndexedContainer#removeItem(java.lang.Object ) */ @Override @@ -599,7 +599,7 @@ public class HierarchicalContainer extends IndexedContainer implements /** * Removes the Item identified by given itemId and all its children. - * + * * @see #removeItem(Object) * @param itemId * the identifier of the Item to be removed @@ -618,7 +618,7 @@ public class HierarchicalContainer extends IndexedContainer implements /** * Removes the Item identified by given itemId and all its children from the * given Container. - * + * * @param container * the container where the item is to be removed * @param itemId @@ -632,8 +632,8 @@ public class HierarchicalContainer extends IndexedContainer implements if (children2 != null) { Object[] array = children2.toArray(); for (int i = 0; i < array.length; i++) { - boolean removeItemRecursively = removeItemRecursively( - container, array[i]); + boolean removeItemRecursively = removeItemRecursively(container, + array[i]); if (!removeItemRecursively) { success = false; } @@ -649,7 +649,7 @@ public class HierarchicalContainer extends IndexedContainer implements /* * (non-Javadoc) - * + * * @see com.vaadin.data.util.IndexedContainer#doSort() */ @Override @@ -665,7 +665,7 @@ public class HierarchicalContainer extends IndexedContainer implements /** * Used to control how filtering works. @see * {@link #setIncludeParentsWhenFiltering(boolean)} for more information. - * + * * @return true if all parents for items that match the filter are included * when filtering, false if only the matching items are included */ @@ -679,7 +679,7 @@ public class HierarchicalContainer extends IndexedContainer implements * items themselves. Setting this to false causes the filtering to only * include the matching items and make items with excluded parents into root * items. - * + * * @param includeParentsWhenFiltering * true to include all parents for items that match the filter, * false to only include the matching items @@ -695,9 +695,9 @@ public class HierarchicalContainer extends IndexedContainer implements /* * Overridden to provide filtering for root & children items. - * + * * (non-Javadoc) - * + * * @see com.vaadin.data.util.IndexedContainer#updateContainerFiltering() */ @Override @@ -746,7 +746,8 @@ public class HierarchicalContainer extends IndexedContainer implements for (Object itemId : filteredItemIds) { Object itemParent = parent.get(itemId); - if (itemParent == null || !filteredItemIds.contains(itemParent)) { + if (itemParent == null + || !filteredItemIds.contains(itemParent)) { // Parent is not included or this was a root, in both cases // this should be a filtered root filteredRoots.add(itemId); @@ -764,7 +765,7 @@ public class HierarchicalContainer extends IndexedContainer implements /** * Adds the given childItemId as a filteredChildren for the parentItemId and * sets it filteredParent. - * + * * @param parentItemId * @param childItemId */ @@ -785,7 +786,7 @@ public class HierarchicalContainer extends IndexedContainer implements * filteredChildren map in the same order as they are in the children map. * Starts from parentItemId and recurses down as long as child items that * should be included are found. - * + * * @param parentItemId * The item id to start recurse from. Not added to a * filteredChildren list @@ -813,7 +814,7 @@ public class HierarchicalContainer extends IndexedContainer implements * when filtering. All items which passes the filters are included. * Additionally all items that have a child node that should be included are * also themselves included. - * + * * @param itemId * @param includedItems * @return true if the itemId should be included in the filtered container. @@ -840,7 +841,7 @@ public class HierarchicalContainer extends IndexedContainer implements /* * (non-Javadoc) - * + * * @see * com.vaadin.data.util.IndexedContainer#passesFilters(java.lang.Object) */ diff --git a/server/src/main/java/com/vaadin/data/util/HierarchicalContainerOrderedWrapper.java b/server/src/main/java/com/vaadin/data/util/HierarchicalContainerOrderedWrapper.java index 1c7960f954..d02c7e49c4 100644 --- a/server/src/main/java/com/vaadin/data/util/HierarchicalContainerOrderedWrapper.java +++ b/server/src/main/java/com/vaadin/data/util/HierarchicalContainerOrderedWrapper.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -23,12 +23,12 @@ import com.vaadin.data.Container.Hierarchical; * A wrapper class for adding external ordering to containers not implementing * the {@link com.vaadin.data.Container.Ordered} interface while retaining * {@link Hierarchical} features. - * + * * @see ContainerOrderedWrapper */ @SuppressWarnings({ "serial" }) -public class HierarchicalContainerOrderedWrapper extends - ContainerOrderedWrapper implements Hierarchical { +public class HierarchicalContainerOrderedWrapper extends ContainerOrderedWrapper + implements Hierarchical { private Hierarchical hierarchical; diff --git a/server/src/main/java/com/vaadin/data/util/IndexedContainer.java b/server/src/main/java/com/vaadin/data/util/IndexedContainer.java index c281fb35c1..c41319a79d 100644 --- a/server/src/main/java/com/vaadin/data/util/IndexedContainer.java +++ b/server/src/main/java/com/vaadin/data/util/IndexedContainer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -38,20 +38,21 @@ import com.vaadin.data.util.filter.UnsupportedFilterException; /** * An implementation of the {@link Container.Indexed} interface - * with all important features.

      - * + * with all important features. + *

      + * * Features: *
        - *
      • {@link Container.Indexed} - *
      • {@link Container.Ordered} - *
      • {@link Container.Sortable} - *
      • {@link Container.Filterable} - *
      • {@link Cloneable} (deprecated, might be removed in the future) + *
      • {@link Container.Indexed} + *
      • {@link Container.Ordered} + *
      • {@link Container.Sortable} + *
      • {@link Container.Filterable} + *
      • {@link Cloneable} (deprecated, might be removed in the future) *
      • Sends all needed events on content changes. *
      - * + * * @see com.vaadin.data.Container - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -59,11 +60,11 @@ import com.vaadin.data.util.filter.UnsupportedFilterException; @SuppressWarnings("serial") // item type is really IndexedContainerItem, but using Item not to show it in // public API -public class IndexedContainer extends - AbstractInMemoryContainer implements - Container.PropertySetChangeNotifier, Property.ValueChangeNotifier, - Container.Sortable, Cloneable, Container.Filterable, - Container.SimpleFilterable { +public class IndexedContainer + extends AbstractInMemoryContainer + implements Container.PropertySetChangeNotifier, + Property.ValueChangeNotifier, Container.Sortable, Cloneable, + Container.Filterable, Container.SimpleFilterable { /* Internal structure */ @@ -136,7 +137,7 @@ public class IndexedContainer extends /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container#getContainerPropertyIds() */ @Override @@ -146,7 +147,7 @@ public class IndexedContainer extends /** * Gets the type of a Property stored in the list. - * + * * @param id * the ID of the Property. * @return Type of the requested Property @@ -158,7 +159,7 @@ public class IndexedContainer extends /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container#getContainerProperty(java.lang.Object, * java.lang.Object) */ @@ -176,7 +177,7 @@ public class IndexedContainer extends /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container#addContainerProperty(java.lang.Object, * java.lang.Class, java.lang.Object) */ @@ -201,9 +202,10 @@ public class IndexedContainer extends // If default value is given, set it if (defaultValue != null) { // for existing rows - for (final Iterator i = getAllItemIds().iterator(); i.hasNext();) { - getItem(i.next()).getItemProperty(propertyId).setValue( - defaultValue); + for (final Iterator i = getAllItemIds().iterator(); i + .hasNext();) { + getItem(i.next()).getItemProperty(propertyId) + .setValue(defaultValue); } // store for next rows if (defaultPropertyValues == null) { @@ -220,7 +222,7 @@ public class IndexedContainer extends /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container#removeAllItems() */ @Override @@ -262,13 +264,13 @@ public class IndexedContainer extends /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container#addItem(java.lang.Object) */ @Override public Item addItem(Object itemId) { - Item item = internalAddItemAtEnd(itemId, new IndexedContainerItem( - itemId), false); + Item item = internalAddItemAtEnd(itemId, + new IndexedContainerItem(itemId), false); if (item == null) { return null; } else if (!isFiltered()) { @@ -284,7 +286,7 @@ public class IndexedContainer extends /** * Helper method to add default values for items if available - * + * * @param t * data table of added item */ @@ -298,7 +300,7 @@ public class IndexedContainer extends /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container#removeItem(java.lang.Object) */ @Override @@ -323,7 +325,7 @@ public class IndexedContainer extends /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container#removeContainerProperty(java.lang.Object ) */ @Override @@ -342,7 +344,8 @@ public class IndexedContainer extends } // If remove the Property from all Items - for (final Iterator i = getAllItemIds().iterator(); i.hasNext();) { + for (final Iterator i = getAllItemIds().iterator(); i + .hasNext();) { items.get(i.next()).remove(propertyId); } @@ -356,7 +359,7 @@ public class IndexedContainer extends /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container.Ordered#addItemAfter(java.lang.Object, * java.lang.Object) */ @@ -387,13 +390,13 @@ public class IndexedContainer extends /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container.Indexed#addItemAt(int, java.lang.Object) */ @Override public Item addItemAt(int index, Object newItemId) { - return internalAddItemAt(index, newItemId, new IndexedContainerItem( - newItemId), true); + return internalAddItemAt(index, newItemId, + new IndexedContainerItem(newItemId), true); } /** @@ -417,7 +420,7 @@ public class IndexedContainer extends /** * Generates an unique identifier for use as an item id. Guarantees that the * generated id is not currently used as an id. - * + * * @return */ private Serializable generateId() { @@ -441,7 +444,7 @@ public class IndexedContainer extends /** * An event object specifying the list whose Item set has * changed. - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -449,14 +452,15 @@ public class IndexedContainer extends private final int addedItemIndex; - private ItemSetChangeEvent(IndexedContainer source, int addedItemIndex) { + private ItemSetChangeEvent(IndexedContainer source, + int addedItemIndex) { super(source); this.addedItemIndex = addedItemIndex; } /** * Iff one item is added, gives its index. - * + * * @return -1 if either multiple items are changed or some other change * than add is done. */ @@ -469,12 +473,12 @@ public class IndexedContainer extends /** * An event object specifying the Property in a list whose * value has changed. - * + * * @author Vaadin Ltd. * @since 3.0 */ - private static class PropertyValueChangeEvent extends EventObject implements - Property.ValueChangeEvent, Serializable { + private static class PropertyValueChangeEvent extends EventObject + implements Property.ValueChangeEvent, Serializable { private PropertyValueChangeEvent(Property source) { super(source); @@ -482,7 +486,7 @@ public class IndexedContainer extends /* * (non-Javadoc) - * + * * @see com.vaadin.data.Property.ValueChangeEvent#getProperty() */ @Override @@ -526,7 +530,7 @@ public class IndexedContainer extends /* * (non-Javadoc) - * + * * @see com.vaadin.data.Property.ValueChangeNotifier#addListener(com. * vaadin.data.Property.ValueChangeListener) */ @@ -550,12 +554,13 @@ public class IndexedContainer extends /* * (non-Javadoc) - * + * * @see com.vaadin.data.Property.ValueChangeNotifier#removeListener(com * .vaadin.data.Property.ValueChangeListener) */ @Override - public void removeValueChangeListener(Property.ValueChangeListener listener) { + public void removeValueChangeListener( + Property.ValueChangeListener listener) { if (propertyValueChangeListeners != null) { propertyValueChangeListeners.remove(listener); } @@ -573,7 +578,7 @@ public class IndexedContainer extends /** * Sends a Property value change event to all interested listeners. - * + * * @param source * the IndexedContainerProperty object. */ @@ -637,7 +642,7 @@ public class IndexedContainer extends /** * Adds new single Property change listener. - * + * * @param propertyId * the ID of the Property to add. * @param itemId @@ -670,7 +675,7 @@ public class IndexedContainer extends /** * Removes a previously registered single Property change listener. - * + * * @param propertyId * the ID of the Property to remove. * @param itemId @@ -707,10 +712,10 @@ public class IndexedContainer extends /* * A class implementing the com.vaadin.data.Item interface to be contained * in the list. - * + * * @author Vaadin Ltd. - * - * + * + * * @since 3.0 */ class IndexedContainerItem implements Item { @@ -723,7 +728,7 @@ public class IndexedContainer extends /** * Constructs a new ListItem instance and connects it to a host * container. - * + * * @param itemId * the Item ID of the new Item. */ @@ -733,7 +738,7 @@ public class IndexedContainer extends /* * (non-Javadoc) - * + * * @see com.vaadin.data.Item#getItemProperty(java.lang.Object) */ @Override @@ -755,7 +760,7 @@ public class IndexedContainer extends * Item. The format of the string is a space separated catenation of the * String representations of the values of the Properties * contained by the Item. - * + * * @return String representation of the Item contents */ @Override @@ -778,7 +783,7 @@ public class IndexedContainer extends * list. Two Items inside the same list have always different * hash-codes, though Items in different lists may have identical * hash-codes. - * + * * @return A locally unique hash-code as integer */ @Override @@ -789,7 +794,7 @@ public class IndexedContainer extends /** * Tests if the given object is the same as the this object. Two Items * got from a list container with the same ID are equal. - * + * * @param obj * an object to compare with this object * @return true if the given object is the same as this @@ -813,7 +818,7 @@ public class IndexedContainer extends * IndexedContainerItem does not support adding new properties. Add * properties at container level. See * {@link IndexedContainer#addContainerProperty(Object, Class, Object)} - * + * * @see com.vaadin.data.Item#addProperty(Object, Property) */ @Override @@ -827,7 +832,7 @@ public class IndexedContainer extends * Indexed container does not support removing properties. Remove * properties at container level. See * {@link IndexedContainer#removeContainerProperty(Object)} - * + * * @see com.vaadin.data.Item#removeProperty(Object) */ @Override @@ -843,13 +848,13 @@ public class IndexedContainer extends * A class implementing the {@link Property} interface to be contained in * the {@link IndexedContainerItem} contained in the * {@link IndexedContainer}. - * + * * @author Vaadin Ltd. - * + * * @since 3.0 */ - private class IndexedContainerProperty implements Property, - Property.ValueChangeNotifier { + private class IndexedContainerProperty + implements Property, Property.ValueChangeNotifier { /** * ID of the Item, where this property resides. @@ -863,7 +868,7 @@ public class IndexedContainer extends /** * Constructs a new {@link IndexedContainerProperty} object. - * + * * @param itemId * the ID of the Item to connect the new Property to. * @param propertyId @@ -884,7 +889,7 @@ public class IndexedContainer extends /* * (non-Javadoc) - * + * * @see com.vaadin.data.Property#getType() */ @Override @@ -894,7 +899,7 @@ public class IndexedContainer extends /* * (non-Javadoc) - * + * * @see com.vaadin.data.Property#getValue() */ @Override @@ -904,7 +909,7 @@ public class IndexedContainer extends /* * (non-Javadoc) - * + * * @see com.vaadin.data.Property#isReadOnly() */ @Override @@ -914,7 +919,7 @@ public class IndexedContainer extends /* * (non-Javadoc) - * + * * @see com.vaadin.data.Property#setReadOnly(boolean) */ @Override @@ -928,11 +933,12 @@ public class IndexedContainer extends /* * (non-Javadoc) - * + * * @see com.vaadin.data.Property#setValue(java.lang.Object) */ @Override - public void setValue(Object newValue) throws Property.ReadOnlyException { + public void setValue(Object newValue) + throws Property.ReadOnlyException { // Gets the Property set final Map propertySet = items.get(itemId); @@ -968,7 +974,7 @@ public class IndexedContainer extends * If legacy Property toString mode is disabled, the string * representation has no special meaning *

      - * + * * @return A string representation of the value value stored in the * Property or a string representation of the Property object. * @deprecated As of 7.0. To get the property value, use @@ -995,7 +1001,7 @@ public class IndexedContainer extends * same Item contained in the same list always have different * hash-codes, though Properties in different Items may have identical * hash-codes. - * + * * @return A locally unique hash-code as integer */ @Override @@ -1006,7 +1012,7 @@ public class IndexedContainer extends /** * Tests if the given object is the same as the this object. Two * Properties got from an Item with the same ID are equal. - * + * * @param obj * an object to compare with this object * @return true if the given object is the same as this @@ -1019,19 +1025,19 @@ public class IndexedContainer extends return false; } final IndexedContainerProperty lp = (IndexedContainerProperty) obj; - return lp.getHost() == getHost() - && lp.propertyId.equals(propertyId) + return lp.getHost() == getHost() && lp.propertyId.equals(propertyId) && lp.itemId.equals(itemId); } /* * (non-Javadoc) - * + * * @see com.vaadin.data.Property.ValueChangeNotifier#addListener( * com.vaadin.data.Property.ValueChangeListener) */ @Override - public void addValueChangeListener(Property.ValueChangeListener listener) { + public void addValueChangeListener( + Property.ValueChangeListener listener) { addSinglePropertyChangeListener(propertyId, itemId, listener); } @@ -1047,7 +1053,7 @@ public class IndexedContainer extends /* * (non-Javadoc) - * + * * @see com.vaadin.data.Property.ValueChangeNotifier#removeListener * (com.vaadin.data.Property.ValueChangeListener) */ @@ -1075,7 +1081,7 @@ public class IndexedContainer extends /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container.Sortable#sort(java.lang.Object[], * boolean[]) */ @@ -1086,7 +1092,7 @@ public class IndexedContainer extends /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container.Sortable#getSortableContainerPropertyIds * () */ @@ -1107,10 +1113,10 @@ public class IndexedContainer extends /** * Supports cloning of the IndexedContainer cleanly. - * + * * @throws CloneNotSupportedException * if an object cannot be cloned. . - * + * * @deprecated As of 6.6. Cloning support might be removed from * IndexedContainer in the future */ @@ -1122,26 +1128,35 @@ public class IndexedContainer extends final IndexedContainer nc = new IndexedContainer(); // Clone the shallow properties - nc.setAllItemIds(getAllItemIds() != null ? (ListSet) ((ListSet) getAllItemIds()) - .clone() : null); - nc.setItemSetChangeListeners(getItemSetChangeListeners() != null ? new LinkedList( - getItemSetChangeListeners()) : null); - nc.propertyIds = propertyIds != null ? (ArrayList) propertyIds - .clone() : null; - nc.setPropertySetChangeListeners(getPropertySetChangeListeners() != null ? new LinkedList( - getPropertySetChangeListeners()) : null); - nc.propertyValueChangeListeners = propertyValueChangeListeners != null ? (LinkedList) propertyValueChangeListeners - .clone() : null; - nc.readOnlyProperties = readOnlyProperties != null ? (HashSet>) readOnlyProperties - .clone() : null; - nc.singlePropertyValueChangeListeners = singlePropertyValueChangeListeners != null ? (Hashtable>>) singlePropertyValueChangeListeners - .clone() : null; + nc.setAllItemIds(getAllItemIds() != null + ? (ListSet) ((ListSet) getAllItemIds()).clone() + : null); + nc.setItemSetChangeListeners(getItemSetChangeListeners() != null + ? new LinkedList( + getItemSetChangeListeners()) + : null); + nc.propertyIds = propertyIds != null + ? (ArrayList) propertyIds.clone() : null; + nc.setPropertySetChangeListeners(getPropertySetChangeListeners() != null + ? new LinkedList( + getPropertySetChangeListeners()) + : null); + nc.propertyValueChangeListeners = propertyValueChangeListeners != null + ? (LinkedList) propertyValueChangeListeners + .clone() + : null; + nc.readOnlyProperties = readOnlyProperties != null + ? (HashSet>) readOnlyProperties.clone() : null; + nc.singlePropertyValueChangeListeners = singlePropertyValueChangeListeners != null + ? (Hashtable>>) singlePropertyValueChangeListeners + .clone() + : null; nc.types = types != null ? (Hashtable>) types.clone() : null; - nc.setFilters((HashSet) ((HashSet) getFilters()) - .clone()); + nc.setFilters( + (HashSet) ((HashSet) getFilters()).clone()); nc.setFilteredItemIds(getFilteredItemIds() == null ? null : (ListSet) ((ListSet) getFilteredItemIds()) @@ -1152,7 +1167,8 @@ public class IndexedContainer extends nc.items = null; } else { nc.items = new Hashtable>(); - for (final Iterator i = items.keySet().iterator(); i.hasNext();) { + for (final Iterator i = items.keySet().iterator(); i + .hasNext();) { final Object id = i.next(); final Hashtable it = (Hashtable) items .get(id); @@ -1198,7 +1214,7 @@ public class IndexedContainer extends /* * (non-Javadoc) - * + * * @see com.vaadin.data.util.AbstractInMemoryContainer#getContainerFilters() */ @Override @@ -1208,7 +1224,7 @@ public class IndexedContainer extends /* * (non-Javadoc) - * + * * @see com.vaadin.data.util.AbstractInMemoryContainer#getContainerFilters() */ @Override diff --git a/server/src/main/java/com/vaadin/data/util/ItemSorter.java b/server/src/main/java/com/vaadin/data/util/ItemSorter.java index 141f84ad43..b3a1b63417 100644 --- a/server/src/main/java/com/vaadin/data/util/ItemSorter.java +++ b/server/src/main/java/com/vaadin/data/util/ItemSorter.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -26,13 +26,14 @@ import com.vaadin.data.Container.Sortable; * The ItemSorter interface can be used in Sortable * implementations to provide a custom sorting method. */ -public interface ItemSorter extends Comparator, Cloneable, Serializable { +public interface ItemSorter + extends Comparator, Cloneable, Serializable { /** * Sets the parameters for an upcoming sort operation. The parameters * determine what container to sort and how the ItemSorter * sorts the container. - * + * * @param container * The container that will be sorted. The container must contain * the propertyIds given in the propertyId @@ -60,7 +61,7 @@ public interface ItemSorter extends Comparator, Cloneable, Serializable * The parameters for the ItemSorter compare() * method must always be item ids which exist in the container set using * {@link #setSortProperties(Sortable, Object[], boolean[])}. - * + * * @see Comparator#compare(Object, Object) */ @Override diff --git a/server/src/main/java/com/vaadin/data/util/LegacyPropertyHelper.java b/server/src/main/java/com/vaadin/data/util/LegacyPropertyHelper.java index 7432d036fb..795d2039af 100644 --- a/server/src/main/java/com/vaadin/data/util/LegacyPropertyHelper.java +++ b/server/src/main/java/com/vaadin/data/util/LegacyPropertyHelper.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -27,7 +27,7 @@ import com.vaadin.server.VaadinService; /** * Helper class which provides methods for handling Property.toString in a * Vaadin 6 compatible way - * + * * @author Vaadin Ltd * @since 7.1 * @deprecated This is only used internally for backwards compatibility @@ -37,7 +37,7 @@ public class LegacyPropertyHelper implements Serializable { /** * Returns the property value converted to a String. - * + * * @param p * The property * @return A string representation of the property value, compatible with @@ -76,7 +76,7 @@ public class LegacyPropertyHelper implements Serializable { * The legacy toString mode can be toggled using the * "legacyPropertyToString" init parameter *

      - * + * * @return true if legacy Property.toString() mode is enabled, false * otherwise */ diff --git a/server/src/main/java/com/vaadin/data/util/ListSet.java b/server/src/main/java/com/vaadin/data/util/ListSet.java index ccc9e0dbfd..b03a0422f3 100644 --- a/server/src/main/java/com/vaadin/data/util/ListSet.java +++ b/server/src/main/java/com/vaadin/data/util/ListSet.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -29,7 +29,7 @@ import java.util.Iterator; * specified by {@link #equals(Object)}). The {@link #set(int, Object)} method * allows duplicates because of the way {@link Collections#sort(java.util.List)} * works. - * + * * This class is subject to change and should not be used outside Vaadin core. */ public class ListSet extends ArrayList { @@ -220,7 +220,7 @@ public class ListSet extends ArrayList { /** * Removes "e" from the set if it no longer exists in the list. - * + * * @param e */ private void removeFromSet(E e) { @@ -245,7 +245,7 @@ public class ListSet extends ArrayList { /** * Marks the "element" can be found more than once from the list. Allowed in * {@link #set(int, Object)} to make sorting work. - * + * * @param element */ private void addDuplicate(E element) { diff --git a/server/src/main/java/com/vaadin/data/util/MethodProperty.java b/server/src/main/java/com/vaadin/data/util/MethodProperty.java index 83279afa53..70ee735d96 100644 --- a/server/src/main/java/com/vaadin/data/util/MethodProperty.java +++ b/server/src/main/java/com/vaadin/data/util/MethodProperty.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -36,26 +36,26 @@ import com.vaadin.util.SerializerHelper; * attached to a field of an object. Accessing the object through the Property * interface directly manipulates the underlying field. *

      - * + * *

      * It's assumed that the return value returned by the getter method is * assignable to the type of the property, and the setter method parameter is * assignable to that value. *

      - * + * *

      * A valid getter method must always be available, but instance of this class * can be constructed with a null setter method in which case the * resulting MethodProperty is read-only. *

      - * + * *

      * MethodProperty implements Property.ValueChangeNotifier, but does not * automatically know whether or not the getter method will actually return a * new value - value change listeners are always notified when setValue is * called, without verifying what the getter returns. *

      - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -94,7 +94,8 @@ public class MethodProperty extends AbstractProperty { private static final Object[] DEFAULT_SET_ARGS = new Object[1]; /* Special serialization to handle method references */ - private void writeObject(java.io.ObjectOutputStream out) throws IOException { + private void writeObject(java.io.ObjectOutputStream out) + throws IOException { out.defaultWriteObject(); SerializerHelper.writeClass(out, type); out.writeObject(instance); @@ -102,16 +103,16 @@ public class MethodProperty extends AbstractProperty { out.writeObject(getArgs); if (setMethod != null) { out.writeObject(setMethod.getName()); - SerializerHelper - .writeClassArray(out, setMethod.getParameterTypes()); + SerializerHelper.writeClassArray(out, + setMethod.getParameterTypes()); } else { out.writeObject(null); out.writeObject(null); } if (getMethod != null) { out.writeObject(getMethod.getName()); - SerializerHelper - .writeClassArray(out, getMethod.getParameterTypes()); + SerializerHelper.writeClassArray(out, + getMethod.getParameterTypes()); } else { out.writeObject(null); out.writeObject(null); @@ -119,8 +120,8 @@ public class MethodProperty extends AbstractProperty { } /* Special serialization to handle method references */ - private void readObject(java.io.ObjectInputStream in) throws IOException, - ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) + throws IOException, ClassNotFoundException { in.defaultReadObject(); try { @SuppressWarnings("unchecked") @@ -165,19 +166,19 @@ public class MethodProperty extends AbstractProperty { * constructor will be called with no arguments, and the setter method with * only the new value as the sole argument. *

      - * + * *

      * If the setter method is unavailable, the resulting * MethodProperty will be read-only, otherwise it will be * read-write. *

      - * + * *

      * Method names are constructed from the bean property by adding * get/is/are/set prefix and capitalising the first character in the name of * the given bean property. *

      - * + * * @param instance * the object that includes the property. * @param beanPropertyName @@ -197,8 +198,8 @@ public class MethodProperty extends AbstractProperty { try { getMethod = initGetterMethod(beanPropertyName, beanClass); } catch (final java.lang.NoSuchMethodException ignored) { - throw new MethodException(this, "Bean property " + beanPropertyName - + " can not be found"); + throw new MethodException(this, + "Bean property " + beanPropertyName + " can not be found"); } // In case the get method is found, resolve the type @@ -216,9 +217,9 @@ public class MethodProperty extends AbstractProperty { if (returnType.isPrimitive()) { type = (Class) convertPrimitiveType(returnType); if (type.isPrimitive()) { - throw new MethodException(this, "Bean property " - + beanPropertyName - + " getter return type must not be void"); + throw new MethodException(this, + "Bean property " + beanPropertyName + + " getter return type must not be void"); } } else { type = (Class) returnType; @@ -235,13 +236,13 @@ public class MethodProperty extends AbstractProperty { * instantiated with this constructor will be called with no arguments, and * the setter method with only the new value as the sole argument. *

      - * + * *

      * If the setter method is null, the resulting * MethodProperty will be read-only, otherwise it will be * read-write. *

      - * + * * @param type * the type of the property. * @param instance @@ -250,7 +251,7 @@ public class MethodProperty extends AbstractProperty { * the name of the getter method. * @param setMethodName * the name of the setter method. - * + * */ public MethodProperty(Class type, Object instance, String getMethodName, String setMethodName) { @@ -265,13 +266,13 @@ public class MethodProperty extends AbstractProperty { * instantiated with this constructor will be called with no arguments, and * the setter method with only the new value as the sole argument. *

      - * + * *

      * If the setter method is null, the resulting * MethodProperty will be read-only, otherwise it will be * read-write. *

      - * + * * @param type * the type of the property. * @param instance @@ -297,7 +298,7 @@ public class MethodProperty extends AbstractProperty { * setArgumentIndex will be replaced with the argument passed to the * {@link #setValue(Object newValue)} method. *

      - * + * *

      * For example, if the setArgs contains A, * B and C, and setArgumentIndex = @@ -305,7 +306,7 @@ public class MethodProperty extends AbstractProperty { * in the setter method to be called with the parameter set of * {A, X, C} *

      - * + * * @param type * the type of the property. * @param instance @@ -332,8 +333,8 @@ public class MethodProperty extends AbstractProperty { if (setMethodName != null && setArgs == null) { throw new IndexOutOfBoundsException("The setArgs can not be null"); } - if (setMethodName != null - && (setArgumentIndex < 0 || setArgumentIndex >= setArgs.length)) { + if (setMethodName != null && (setArgumentIndex < 0 + || setArgumentIndex >= setArgs.length)) { throw new IndexOutOfBoundsException( "The setArgumentIndex must be >= 0 and < setArgs.length"); } @@ -391,8 +392,8 @@ public class MethodProperty extends AbstractProperty { } } if (found != true) { - throw new MethodException(this, "Could not find " + getMethodName - + "-method"); + throw new MethodException(this, + "Could not find " + getMethodName + "-method"); } // Finds set method @@ -444,8 +445,8 @@ public class MethodProperty extends AbstractProperty { } } if (found != true) { - throw new MethodException(this, "Could not identify " - + setMethodName + "-method"); + throw new MethodException(this, + "Could not identify " + setMethodName + "-method"); } } @@ -467,7 +468,7 @@ public class MethodProperty extends AbstractProperty { * except that instead of names of the getter and setter methods this * constructor is given the actual methods themselves. *

      - * + * * @param type * the type of the property. * @param instance @@ -509,7 +510,8 @@ public class MethodProperty extends AbstractProperty { } // Gets the return type from get method - Class convertedType = (Class) convertPrimitiveType(type); + Class convertedType = (Class) convertPrimitiveType( + type); this.getMethod = getMethod; this.setMethod = setMethod; @@ -520,7 +522,7 @@ public class MethodProperty extends AbstractProperty { /** * Find a getter method for a property (getXyz(), isXyz() or areXyz()). - * + * * @param propertyName * name of the property * @param beanClass @@ -529,8 +531,8 @@ public class MethodProperty extends AbstractProperty { * @throws NoSuchMethodException * if no getter found */ - static Method initGetterMethod(String propertyName, final Class beanClass) - throws NoSuchMethodException { + static Method initGetterMethod(String propertyName, + final Class beanClass) throws NoSuchMethodException { propertyName = SharedUtil.capitalize(propertyName); Method getMethod = null; @@ -555,7 +557,7 @@ public class MethodProperty extends AbstractProperty { * to safely cast the value returned from getValue to the given * type and pass any variable assignable to this type as an argument to * setValue. - * + * * @return type of the Property */ @Override @@ -567,7 +569,7 @@ public class MethodProperty extends AbstractProperty { * Tests if the object is in read-only mode. In read-only mode calls to * setValue will throw ReadOnlyException and will * not modify the value of the Property. - * + * * @return true if the object is in read-only mode, * false if it's not */ @@ -579,7 +581,7 @@ public class MethodProperty extends AbstractProperty { /** * Gets the value stored in the Property. The value is resolved by calling * the specified getter method with the argument specified at instantiation. - * + * * @return the value of the Property */ @Override @@ -599,7 +601,7 @@ public class MethodProperty extends AbstractProperty { *

      * Sets the setter method and getter method argument lists. *

      - * + * * @param getArgs * the fixed argument list to be passed to the getter method. * @param setArgs @@ -626,14 +628,14 @@ public class MethodProperty extends AbstractProperty { /** * Sets the value of the property. - * + * * Note that since Vaadin 7, no conversions are performed and the value must * be of the correct type. - * + * * @param newValue * the New value of the property. - * @throws Property.ReadOnlyException if the object is in - * read-only mode. + * @throws Property.ReadOnlyException + * if the object is in read-only mode. * @see #invokeSetMethod(Object) */ @Override @@ -651,7 +653,7 @@ public class MethodProperty extends AbstractProperty { /** * Internal method to actually call the setter method of the wrapped * property. - * + * * @param value */ protected void invokeSetMethod(T value) { @@ -681,7 +683,7 @@ public class MethodProperty extends AbstractProperty { * Exception object that signals that there were problems * calling or finding the specified getter or setter methods of the * property. - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -702,7 +704,7 @@ public class MethodProperty extends AbstractProperty { /** * Constructs a new MethodException with the specified * detail message. - * + * * @param property * the property. * @param msg @@ -715,7 +717,7 @@ public class MethodProperty extends AbstractProperty { /** * Constructs a new MethodException from another exception. - * + * * @param property * the property. * @param cause @@ -736,17 +738,17 @@ public class MethodProperty extends AbstractProperty { /** * Gets the method property this exception originates from. - * + * * @return MethodProperty or null if not a valid MethodProperty */ public MethodProperty getMethodProperty() { - return (property instanceof MethodProperty) ? (MethodProperty) property - : null; + return (property instanceof MethodProperty) + ? (MethodProperty) property : null; } /** * Gets the method property this exception originates from. - * + * * @return Property from which the exception originates */ public Property getProperty() { @@ -756,7 +758,7 @@ public class MethodProperty extends AbstractProperty { /** * Sends a value change event to all registered listeners. - * + * * Public for backwards compatibility, visibility may be reduced in future * versions. */ diff --git a/server/src/main/java/com/vaadin/data/util/MethodPropertyDescriptor.java b/server/src/main/java/com/vaadin/data/util/MethodPropertyDescriptor.java index f94ee75ac3..8c5c028a86 100644 --- a/server/src/main/java/com/vaadin/data/util/MethodPropertyDescriptor.java +++ b/server/src/main/java/com/vaadin/data/util/MethodPropertyDescriptor.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -27,14 +27,14 @@ import com.vaadin.util.SerializerHelper; /** * Property descriptor that is able to create simple {@link MethodProperty} * instances for a bean, using given accessors. - * + * * @param * bean type - * + * * @since 6.6 */ -public class MethodPropertyDescriptor implements - VaadinPropertyDescriptor { +public class MethodPropertyDescriptor + implements VaadinPropertyDescriptor { private final String name; private Class propertyType; @@ -44,7 +44,7 @@ public class MethodPropertyDescriptor implements /** * Creates a property descriptor that can create MethodProperty instances to * access the underlying bean property. - * + * * @param name * of the property * @param propertyType @@ -64,7 +64,8 @@ public class MethodPropertyDescriptor implements } /* Special serialization to handle method references */ - private void writeObject(java.io.ObjectOutputStream out) throws IOException { + private void writeObject(java.io.ObjectOutputStream out) + throws IOException { out.defaultWriteObject(); SerializerHelper.writeClass(out, propertyType); @@ -92,8 +93,8 @@ public class MethodPropertyDescriptor implements } /* Special serialization to handle method references */ - private void readObject(java.io.ObjectInputStream in) throws IOException, - ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) + throws IOException, ClassNotFoundException { in.defaultReadObject(); try { @SuppressWarnings("unchecked") diff --git a/server/src/main/java/com/vaadin/data/util/NestedMethodProperty.java b/server/src/main/java/com/vaadin/data/util/NestedMethodProperty.java index 29fe62f845..0b39efef5c 100644 --- a/server/src/main/java/com/vaadin/data/util/NestedMethodProperty.java +++ b/server/src/main/java/com/vaadin/data/util/NestedMethodProperty.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -30,16 +30,16 @@ import com.vaadin.shared.util.SharedUtil; /** * Nested accessor based property for a bean. - * + * * The property is specified in the dotted notation, e.g. "address.street", and * can contain multiple levels of nesting. - * + * * When accessing the property value, all intermediate getters must exist and * should return non-null values when the property value is accessed. If an * intermediate getter returns null, a null value will be returned. - * + * * @see MethodProperty - * + * * @since 6.6 */ public class NestedMethodProperty extends AbstractProperty { @@ -62,15 +62,16 @@ public class NestedMethodProperty extends AbstractProperty { private Class type; /* Special serialization to handle method references */ - private void writeObject(java.io.ObjectOutputStream out) throws IOException { + private void writeObject(java.io.ObjectOutputStream out) + throws IOException { out.defaultWriteObject(); // getMethods and setMethod are reconstructed on read based on // propertyName } /* Special serialization to handle method references */ - private void readObject(java.io.ObjectInputStream in) throws IOException, - ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) + throws IOException, ClassNotFoundException { in.defaultReadObject(); initialize(instance.getClass(), propertyName); @@ -82,7 +83,7 @@ public class NestedMethodProperty extends AbstractProperty { * e.g. "manager.address.street". *

      * Calling getValue will return null if any intermediate getter returns null - * + * * @param instance * top-level bean to which the property applies * @param propertyName @@ -99,7 +100,7 @@ public class NestedMethodProperty extends AbstractProperty { * For internal use to deduce property type etc. without a bean instance. * Calling {@link #setValue(Object)} or {@link #getValue()} on properties * constructed this way is not supported. - * + * * @param instanceClass * class of the top-level bean * @param propertyName @@ -112,7 +113,7 @@ public class NestedMethodProperty extends AbstractProperty { /** * Initializes most of the internal fields based on the top-level bean * instance and property name (dot-separated string). - * + * * @param beanClass * class of the top-level bean to which the property applies * @param propertyName @@ -132,8 +133,8 @@ public class NestedMethodProperty extends AbstractProperty { Class propertyClass = beanClass; String[] simplePropertyNames = propertyName.split("\\."); if (propertyName.endsWith(".") || 0 == simplePropertyNames.length) { - throw new IllegalArgumentException("Invalid property name '" - + propertyName + "'"); + throw new IllegalArgumentException( + "Invalid property name '" + propertyName + "'"); } for (int i = 0; i < simplePropertyNames.length; i++) { String simplePropertyName = simplePropertyNames[i].trim(); @@ -192,7 +193,7 @@ public class NestedMethodProperty extends AbstractProperty { /** * Gets the value stored in the Property. The value is resolved by calling * the specified getter method with the argument specified at instantiation. - * + * * @return the value of the Property */ @Override @@ -214,11 +215,11 @@ public class NestedMethodProperty extends AbstractProperty { /** * Sets the value of the property. The new value must be assignable to the * type of this property. - * + * * @param newValue * the New value of the property. - * @throws Property.ReadOnlyException if the object is in - * read-only mode. + * @throws Property.ReadOnlyException + * if the object is in read-only mode. * @see #invokeSetMethod(Object) */ @Override @@ -235,7 +236,7 @@ public class NestedMethodProperty extends AbstractProperty { /** * Internal method to actually call the setter method of the wrapped * property. - * + * * @param value */ protected void invokeSetMethod(T value) { @@ -255,9 +256,9 @@ public class NestedMethodProperty extends AbstractProperty { /** * Returns an unmodifiable list of getter methods to call in sequence to get * the property value. - * + * * This API may change in future versions. - * + * * @return unmodifiable list of getter methods corresponding to each segment * of the property name */ diff --git a/server/src/main/java/com/vaadin/data/util/NestedPropertyDescriptor.java b/server/src/main/java/com/vaadin/data/util/NestedPropertyDescriptor.java index ca423b34ed..cbe38a922d 100644 --- a/server/src/main/java/com/vaadin/data/util/NestedPropertyDescriptor.java +++ b/server/src/main/java/com/vaadin/data/util/NestedPropertyDescriptor.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,17 +20,17 @@ import com.vaadin.data.Property; /** * Property descriptor that is able to create nested property instances for a * bean. - * + * * The property is specified in the dotted notation, e.g. "address.street", and * can contain multiple levels of nesting. - * + * * @param * bean type - * + * * @since 6.6 */ -public class NestedPropertyDescriptor implements - VaadinPropertyDescriptor { +public class NestedPropertyDescriptor + implements VaadinPropertyDescriptor { private final String name; private final Class propertyType; @@ -38,7 +38,7 @@ public class NestedPropertyDescriptor implements /** * Creates a property descriptor that can create MethodProperty instances to * access the underlying bean property. - * + * * @param name * of the property in a dotted path format, e.g. "address.street" * @param beanType diff --git a/server/src/main/java/com/vaadin/data/util/ObjectProperty.java b/server/src/main/java/com/vaadin/data/util/ObjectProperty.java index 8a2daa443c..2a87956a97 100644 --- a/server/src/main/java/com/vaadin/data/util/ObjectProperty.java +++ b/server/src/main/java/com/vaadin/data/util/ObjectProperty.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -22,7 +22,7 @@ import com.vaadin.data.Property; * A simple data object containing one typed value. This class is a * straightforward implementation of the the {@link com.vaadin.data.Property} * interface. - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -43,7 +43,7 @@ public class ObjectProperty extends AbstractProperty { * Creates a new instance of ObjectProperty with the given value. The type * of the property is automatically initialized to be the type of the given * value. - * + * * @param value * the Initial value of the Property. */ @@ -55,10 +55,10 @@ public class ObjectProperty extends AbstractProperty { /** * Creates a new instance of ObjectProperty with the given value and type. - * + * * Since Vaadin 7, only values of the correct type are accepted, and no * automatic conversions are performed. - * + * * @param value * the Initial value of the Property. * @param type @@ -75,10 +75,10 @@ public class ObjectProperty extends AbstractProperty { /** * Creates a new instance of ObjectProperty with the given value, type and * read-only mode status. - * + * * Since Vaadin 7, only the correct type of values is accepted, see * {@link #ObjectProperty(Object, Class)}. - * + * * @param value * the Initial value of the property. * @param type @@ -98,7 +98,7 @@ public class ObjectProperty extends AbstractProperty { * able to safely cast the value returned from getValue to the * given type and pass any variable assignable to this type as an argument * to setValue. - * + * * @return type of the Property */ @Override @@ -108,7 +108,7 @@ public class ObjectProperty extends AbstractProperty { /** * Gets the value stored in the Property. - * + * * @return the value stored in the Property */ @Override @@ -118,14 +118,14 @@ public class ObjectProperty extends AbstractProperty { /** * Sets the value of the property. - * + * * Note that since Vaadin 7, no conversions are performed and the value must * be of the correct type. - * + * * @param newValue * the New value of the property. - * @throws Property.ReadOnlyException if the object is in - * read-only mode + * @throws Property.ReadOnlyException + * if the object is in read-only mode */ @Override public void setValue(T newValue) throws Property.ReadOnlyException { diff --git a/server/src/main/java/com/vaadin/data/util/PropertyFormatter.java b/server/src/main/java/com/vaadin/data/util/PropertyFormatter.java index e188ce8bc3..6fa502300b 100644 --- a/server/src/main/java/com/vaadin/data/util/PropertyFormatter.java +++ b/server/src/main/java/com/vaadin/data/util/PropertyFormatter.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,13 +20,13 @@ import com.vaadin.data.util.converter.Converter; /** * Formatting proxy for a {@link Property}. - * + * *

      * This class can be used to implement formatting for any type of Property * datasources. The idea is to connect this as proxy between UI component and * the original datasource. *

      - * + * *

      * For example *

      textfield.setPropertyDataSource(new PropertyFormatter(property) {
      @@ -41,11 +41,11 @@ import com.vaadin.data.util.converter.Converter;
               });
      adds formatter for Double-typed property that extends * standard "1.0" notation with more zeroes. *

      - * + * * @param T * type of the underlying property (a PropertyFormatter is always a * Property<String>) - * + * * @deprecated As of 7.0, replaced by {@link Converter} * @author Vaadin Ltd. * @since 5.3.0 @@ -63,7 +63,7 @@ public abstract class PropertyFormatter extends AbstractProperty * Construct a new {@code PropertyFormatter} that is not connected to any * data source. Call {@link #setPropertyDataSource(Property)} later on to * attach it to a property. - * + * */ protected PropertyFormatter() { } @@ -72,7 +72,7 @@ public abstract class PropertyFormatter extends AbstractProperty * Construct a new formatter that is connected to given data source. Calls * {@link #format(Object)} which can be a problem if the formatter has not * yet been initialized. - * + * * @param propertyDataSource * to connect this property to. */ @@ -83,7 +83,7 @@ public abstract class PropertyFormatter extends AbstractProperty /** * Gets the current data source of the formatter, if any. - * + * * @return the current data source as a Property, or null if * none defined. */ @@ -94,13 +94,13 @@ public abstract class PropertyFormatter extends AbstractProperty /** * Sets the specified Property as the data source for the formatter. - * - * + * + * *

      * Remember that new data sources getValue() must return objects that are * compatible with parse() and format() methods. *

      - * + * * @param newDataSource * the new data source Property. */ @@ -153,7 +153,7 @@ public abstract class PropertyFormatter extends AbstractProperty /** * Get the formatted value. - * + * * @return If the datasource returns null, this is null. Otherwise this is * String given by format(). */ @@ -175,7 +175,7 @@ public abstract class PropertyFormatter extends AbstractProperty /** * This method must be implemented to format the values received from * DataSource. - * + * * @param value * Value object got from the datasource. This is guaranteed to be * non-null and of the type compatible with getType() of the @@ -186,9 +186,9 @@ public abstract class PropertyFormatter extends AbstractProperty /** * Parse string and convert it to format compatible with datasource. - * + * * The method is required to assure that parse(format(x)) equals x. - * + * * @param formattedValue * This is guaranteed to be non-null string. * @return Non-null value compatible with datasource. @@ -200,7 +200,7 @@ public abstract class PropertyFormatter extends AbstractProperty /** * Sets the Property's read-only mode to the specified status. - * + * * @param newStatus * the new read-only status of the Property. */ @@ -235,7 +235,7 @@ public abstract class PropertyFormatter extends AbstractProperty /** * Listens for changes in the datasource. - * + * * This should not be called directly. */ @Override @@ -245,7 +245,7 @@ public abstract class PropertyFormatter extends AbstractProperty /** * Listens for changes in the datasource. - * + * * This should not be called directly. */ @Override diff --git a/server/src/main/java/com/vaadin/data/util/PropertyValueGenerator.java b/server/src/main/java/com/vaadin/data/util/PropertyValueGenerator.java index a09ab33d2d..e4b678d9a7 100644 --- a/server/src/main/java/com/vaadin/data/util/PropertyValueGenerator.java +++ b/server/src/main/java/com/vaadin/data/util/PropertyValueGenerator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,7 +25,7 @@ import com.vaadin.data.util.filter.UnsupportedFilterException; /** * PropertyValueGenerator for GeneratedPropertyContainer. - * + * * @param * Property data type * @since 7.4 @@ -36,7 +36,7 @@ public abstract class PropertyValueGenerator implements Serializable { /** * Returns value for given Item. Used by GeneratedPropertyContainer when * generating new properties. - * + * * @param item * currently handled item * @param itemId @@ -50,7 +50,7 @@ public abstract class PropertyValueGenerator implements Serializable { /** * Return Property type for this generator. This function is called when * {@link Property#getType()} is called for generated property. - * + * * @return type of generated property */ public abstract Class getType(); @@ -66,9 +66,9 @@ public abstract class PropertyValueGenerator implements Serializable { * means that the property will not be included in * getSortableContainerPropertyIds(). Attempting to sort by that column * throws UnsupportedOperationException. - * + * * Returning null is not allowed. - * + * * @param order * a sort order for this property * @return an array of sort orders describing how this property is sorted @@ -86,7 +86,7 @@ public abstract class PropertyValueGenerator implements Serializable { * GeneratedPropertyContainer to discard the filter and not use it. *

      * By default this function throws UnsupportedFilterException. - * + * * @param filter * original filter for this property * @return modified filter that is compatible with the underlying container @@ -94,9 +94,10 @@ public abstract class PropertyValueGenerator implements Serializable { * if the implementation doesn't support modifying the provided * filter */ - public Filter modifyFilter(Filter filter) throws UnsupportedFilterException { - throw new UnsupportedFilterException("Filter" + filter - + " is not supported"); + public Filter modifyFilter(Filter filter) + throws UnsupportedFilterException { + throw new UnsupportedFilterException( + "Filter" + filter + " is not supported"); } } diff --git a/server/src/main/java/com/vaadin/data/util/PropertysetItem.java b/server/src/main/java/com/vaadin/data/util/PropertysetItem.java index f463a52f54..92b6f5eccd 100644 --- a/server/src/main/java/com/vaadin/data/util/PropertysetItem.java +++ b/server/src/main/java/com/vaadin/data/util/PropertysetItem.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -31,13 +31,13 @@ import com.vaadin.data.Property; * a MapItem can be referenced using locally unique identifiers. * The class supports listeners who are interested in changes to the Property * set managed by the class. - * + * * @author Vaadin Ltd. * @since 3.0 */ @SuppressWarnings("serial") -public class PropertysetItem implements Item, Item.PropertySetChangeNotifier, - Cloneable { +public class PropertysetItem + implements Item, Item.PropertySetChangeNotifier, Cloneable { /* Private representation of the item */ @@ -62,7 +62,7 @@ public class PropertysetItem implements Item, Item.PropertySetChangeNotifier, * Gets the Property corresponding to the given Property ID stored in the * Item. If the Item does not contain the Property, null is * returned. - * + * * @param id * the identifier of the Property to get. * @return the Property with the given ID or null @@ -74,7 +74,7 @@ public class PropertysetItem implements Item, Item.PropertySetChangeNotifier, /** * Gets the collection of IDs of all Properties stored in the Item. - * + * * @return unmodifiable collection containing IDs of the Properties stored * the Item */ @@ -89,7 +89,7 @@ public class PropertysetItem implements Item, Item.PropertySetChangeNotifier, * Removes the Property identified by ID from the Item. This functionality * is optional. If the method is not implemented, the method always returns * false. - * + * * @param id * the ID of the Property to be removed. * @return true if the operation succeeded false @@ -112,7 +112,7 @@ public class PropertysetItem implements Item, Item.PropertySetChangeNotifier, /** * Tries to add a new Property into the Item. - * + * * @param id * the ID of the new Property. * @param property @@ -148,14 +148,15 @@ public class PropertysetItem implements Item, Item.PropertySetChangeNotifier, * The format of the string is a space separated catenation of the * String representations of the Properties contained by the * Item. - * + * * @return String representation of the Item contents */ @Override public String toString() { String retValue = ""; - for (final Iterator i = getItemPropertyIds().iterator(); i.hasNext();) { + for (final Iterator i = getItemPropertyIds().iterator(); i + .hasNext();) { final Object propertyId = i.next(); retValue += getItemProperty(propertyId).getValue(); if (i.hasNext()) { @@ -171,12 +172,12 @@ public class PropertysetItem implements Item, Item.PropertySetChangeNotifier, /** * An event object specifying an Item whose Property set has * changed. - * + * * @author Vaadin Ltd. * @since 3.0 */ - private static class PropertySetChangeEvent extends EventObject implements - Item.PropertySetChangeEvent { + private static class PropertySetChangeEvent extends EventObject + implements Item.PropertySetChangeEvent { private PropertySetChangeEvent(Item source) { super(source); @@ -184,7 +185,7 @@ public class PropertysetItem implements Item, Item.PropertySetChangeNotifier, /** * Gets the Item whose Property set has changed. - * + * * @return source object of the event as an Item */ @Override @@ -195,7 +196,7 @@ public class PropertysetItem implements Item, Item.PropertySetChangeNotifier, /** * Registers a new property set change listener for this Item. - * + * * @param listener * the new Listener to be registered. */ @@ -220,7 +221,7 @@ public class PropertysetItem implements Item, Item.PropertySetChangeNotifier, /** * Removes a previously registered property set change listener. - * + * * @param listener * the Listener to be removed. */ @@ -284,11 +285,11 @@ public class PropertysetItem implements Item, Item.PropertySetChangeNotifier, * the fields are not themselves cloned. Thus, this method performs a * "shallow copy" of this object, not a "deep copy" operation. *

      - * + * * @throws CloneNotSupportedException * if the object's class does not support the Cloneable * interface. - * + * * @see java.lang.Object#clone() */ @Override @@ -297,8 +298,10 @@ public class PropertysetItem implements Item, Item.PropertySetChangeNotifier, final PropertysetItem npsi = new PropertysetItem(); npsi.list = list != null ? (LinkedList) list.clone() : null; - npsi.propertySetChangeListeners = propertySetChangeListeners != null ? (LinkedList) propertySetChangeListeners - .clone() : null; + npsi.propertySetChangeListeners = propertySetChangeListeners != null + ? (LinkedList) propertySetChangeListeners + .clone() + : null; npsi.map = (HashMap>) map.clone(); return npsi; @@ -306,7 +309,7 @@ public class PropertysetItem implements Item, Item.PropertySetChangeNotifier, /* * (non-Javadoc) - * + * * @see java.lang.Object#equals(java.lang.Object) */ @Override @@ -335,10 +338,10 @@ public class PropertysetItem implements Item, Item.PropertySetChangeNotifier, } } if (other.propertySetChangeListeners != propertySetChangeListeners) { - boolean thisEmpty = (propertySetChangeListeners == null || propertySetChangeListeners - .isEmpty()); - boolean otherEmpty = (other.propertySetChangeListeners == null || other.propertySetChangeListeners - .isEmpty()); + boolean thisEmpty = (propertySetChangeListeners == null + || propertySetChangeListeners.isEmpty()); + boolean otherEmpty = (other.propertySetChangeListeners == null + || other.propertySetChangeListeners.isEmpty()); if (thisEmpty && otherEmpty) { return true; } @@ -356,7 +359,7 @@ public class PropertysetItem implements Item, Item.PropertySetChangeNotifier, /* * (non-Javadoc) - * + * * @see java.lang.Object#hashCode() */ @Override @@ -364,7 +367,8 @@ public class PropertysetItem implements Item, Item.PropertySetChangeNotifier, return (list == null ? 0 : list.hashCode()) ^ (map == null ? 0 : map.hashCode()) - ^ ((propertySetChangeListeners == null || propertySetChangeListeners - .isEmpty()) ? 0 : propertySetChangeListeners.hashCode()); + ^ ((propertySetChangeListeners == null + || propertySetChangeListeners.isEmpty()) ? 0 + : propertySetChangeListeners.hashCode()); } } diff --git a/server/src/main/java/com/vaadin/data/util/TextFileProperty.java b/server/src/main/java/com/vaadin/data/util/TextFileProperty.java index 22fd8168a1..1ce1262350 100644 --- a/server/src/main/java/com/vaadin/data/util/TextFileProperty.java +++ b/server/src/main/java/com/vaadin/data/util/TextFileProperty.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -29,13 +29,13 @@ import java.nio.charset.Charset; /** * Property implementation for wrapping a text file. - * + * * Supports reading and writing of a File from/to String. - * + * * {@link ValueChangeListener}s are supported, but only fire when * setValue(Object) is explicitly called. {@link ReadOnlyStatusChangeListener}s * are supported but only fire when setReadOnly(boolean) is explicitly called. - * + * */ @SuppressWarnings("serial") public class TextFileProperty extends AbstractProperty { @@ -45,9 +45,9 @@ public class TextFileProperty extends AbstractProperty { /** * Wrap given file with property interface. - * + * * Setting the file to null works, but getValue() will return null. - * + * * @param file * File to be wrapped. */ @@ -58,9 +58,9 @@ public class TextFileProperty extends AbstractProperty { /** * Wrap the given file with the property interface and specify character * set. - * + * * Setting the file to null works, but getValue() will return null. - * + * * @param file * File to be wrapped. * @param charset @@ -73,7 +73,7 @@ public class TextFileProperty extends AbstractProperty { /* * (non-Javadoc) - * + * * @see com.vaadin.data.Property#getType() */ @Override @@ -83,7 +83,7 @@ public class TextFileProperty extends AbstractProperty { /* * (non-Javadoc) - * + * * @see com.vaadin.data.Property#getValue() */ @Override @@ -115,7 +115,7 @@ public class TextFileProperty extends AbstractProperty { /* * (non-Javadoc) - * + * * @see com.vaadin.data.Property#isReadOnly() */ @Override @@ -125,7 +125,7 @@ public class TextFileProperty extends AbstractProperty { /* * (non-Javadoc) - * + * * @see com.vaadin.data.Property#setValue(java.lang.Object) */ @Override @@ -139,8 +139,9 @@ public class TextFileProperty extends AbstractProperty { try { FileOutputStream fos = new FileOutputStream(file); - OutputStreamWriter osw = charset == null ? new OutputStreamWriter( - fos) : new OutputStreamWriter(fos, charset); + OutputStreamWriter osw = charset == null + ? new OutputStreamWriter(fos) + : new OutputStreamWriter(fos, charset); BufferedWriter w = new BufferedWriter(osw); w.append(newValue.toString()); w.flush(); diff --git a/server/src/main/java/com/vaadin/data/util/TransactionalPropertyWrapper.java b/server/src/main/java/com/vaadin/data/util/TransactionalPropertyWrapper.java index c3cef6a0ec..dbfbee5e12 100644 --- a/server/src/main/java/com/vaadin/data/util/TransactionalPropertyWrapper.java +++ b/server/src/main/java/com/vaadin/data/util/TransactionalPropertyWrapper.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -22,23 +22,23 @@ import com.vaadin.data.Property.ValueChangeNotifier; /** * Wrapper class that helps implement two-phase commit for a non-transactional * property. - * + * * When accessing the property through the wrapper, getting and setting the * property value take place immediately. However, the wrapper keeps track of * the old value of the property so that it can be set for the property in case * of a roll-back. This can result in the underlying property value changing * multiple times (first based on modifications made by the application, then * back upon roll-back). - * + * * Value change events on the {@link TransactionalPropertyWrapper} are only * fired at the end of a successful transaction, whereas listeners attached to * the underlying property may receive multiple value change events. - * + * * @see com.vaadin.data.Property.Transactional - * + * * @author Vaadin Ltd * @since 7.0 - * + * * @param */ public class TransactionalPropertyWrapper extends AbstractProperty @@ -67,7 +67,7 @@ public class TransactionalPropertyWrapper extends AbstractProperty /** * Removes the ValueChangeListener from wrapped Property that was added by * TransactionalPropertyWrapper. - * + * * @since 7.1.15 */ public void detachFromProperty() { diff --git a/server/src/main/java/com/vaadin/data/util/VaadinPropertyDescriptor.java b/server/src/main/java/com/vaadin/data/util/VaadinPropertyDescriptor.java index 51084d9115..e5f1a474eb 100644 --- a/server/src/main/java/com/vaadin/data/util/VaadinPropertyDescriptor.java +++ b/server/src/main/java/com/vaadin/data/util/VaadinPropertyDescriptor.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,33 +21,33 @@ import com.vaadin.data.Property; /** * Property descriptor that can create a property instance for a bean. - * + * * Used by {@link BeanItem} and {@link AbstractBeanContainer} to keep track of * the set of properties of items. - * + * * @param * bean type - * + * * @since 6.6 */ public interface VaadinPropertyDescriptor extends Serializable { /** * Returns the name of the property. - * + * * @return */ public String getName(); /** * Returns the type of the property. - * + * * @return Class */ public Class getPropertyType(); /** * Creates a new {@link Property} instance for this property for a bean. - * + * * @param bean * @return */ diff --git a/server/src/main/java/com/vaadin/data/util/converter/AbstractStringToNumberConverter.java b/server/src/main/java/com/vaadin/data/util/converter/AbstractStringToNumberConverter.java index 81f1a85f89..a2c726d7b7 100644 --- a/server/src/main/java/com/vaadin/data/util/converter/AbstractStringToNumberConverter.java +++ b/server/src/main/java/com/vaadin/data/util/converter/AbstractStringToNumberConverter.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -28,17 +28,17 @@ import java.util.Locale; *

      * Override and overwrite {@link #getFormat(Locale)} to use a different format. *

      - * + * * @author Vaadin Ltd * @since 7.1 */ -public abstract class AbstractStringToNumberConverter implements - Converter { +public abstract class AbstractStringToNumberConverter + implements Converter { /** * Returns the format used by {@link #convertToPresentation(Object, Locale)} * and {@link #convertToModel(Object, Locale)}. - * + * * @param locale * The locale to use * @return A NumberFormat instance @@ -55,7 +55,7 @@ public abstract class AbstractStringToNumberConverter implements /** * Convert the value to a Number using the given locale and * {@link #getFormat(Locale)}. - * + * * @param value * The value to convert * @param locale @@ -94,7 +94,7 @@ public abstract class AbstractStringToNumberConverter implements /* * (non-Javadoc) - * + * * @see * com.vaadin.data.util.converter.Converter#convertToPresentation(java.lang * .Object, java.util.Locale) @@ -112,7 +112,7 @@ public abstract class AbstractStringToNumberConverter implements /* * (non-Javadoc) - * + * * @see com.vaadin.data.util.converter.Converter#getPresentationType() */ @Override diff --git a/server/src/main/java/com/vaadin/data/util/converter/Converter.java b/server/src/main/java/com/vaadin/data/util/converter/Converter.java index a7188ebb33..26abb4f47d 100644 --- a/server/src/main/java/com/vaadin/data/util/converter/Converter.java +++ b/server/src/main/java/com/vaadin/data/util/converter/Converter.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -37,7 +37,7 @@ import java.util.Locale; *

      * If conversion of a value fails, a {@link ConversionException} is thrown. *

      - * + * * @param * The presentation type. Must be compatible with what * {@link #getPresentationType()} returns. @@ -58,7 +58,7 @@ public interface Converter extends Serializable { * {@link #convertToPresentation(Object, Class, Locale)} and * {@link #convertToModel(Object, Class, Locale)} should return the original * value. - * + * * @param value * The value to convert, compatible with the target type. Can be * null @@ -83,7 +83,7 @@ public interface Converter extends Serializable { * {@link #convertToPresentation(Object, Class, Locale)} and * {@link #convertToModel(Object, Class, Locale)} should return the original * value. - * + * * @param value * The value to convert, compatible with the target type. Can be * null @@ -101,20 +101,20 @@ public interface Converter extends Serializable { /** * The source type of the converter. - * + * * Values of this type can be passed to * {@link #convertToPresentation(Object, Class, Locale)}. - * + * * @return The source type */ public Class getModelType(); /** * The target type of the converter. - * + * * Values of this type can be passed to * {@link #convertToModel(Object, Class, Locale)}. - * + * * @return The target type */ public Class getPresentationType(); @@ -124,7 +124,7 @@ public interface Converter extends Serializable { * {@link Converter#convertToPresentation(Object, Class, Locale)} or * {@link Converter#convertToModel(Object, Class, Locale)} could not be * converted. - * + * * @author Vaadin Ltd * @since 7.0 */ @@ -140,7 +140,7 @@ public interface Converter extends Serializable { /** * Constructs a new ConversionException with the specified * detail message. - * + * * @param msg * the detail message */ @@ -151,7 +151,7 @@ public interface Converter extends Serializable { /** * Constructs a new {@code ConversionException} with the specified * cause. - * + * * @param cause * The cause of the the exception */ @@ -162,7 +162,7 @@ public interface Converter extends Serializable { /** * Constructs a new ConversionException with the specified * detail message and cause. - * + * * @param message * the detail message * @param cause diff --git a/server/src/main/java/com/vaadin/data/util/converter/ConverterFactory.java b/server/src/main/java/com/vaadin/data/util/converter/ConverterFactory.java index 0280be4a73..637ee303cb 100644 --- a/server/src/main/java/com/vaadin/data/util/converter/ConverterFactory.java +++ b/server/src/main/java/com/vaadin/data/util/converter/ConverterFactory.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,10 +21,10 @@ import java.io.Serializable; /** * Factory interface for providing Converters based on a presentation type and a * model type. - * + * * @author Vaadin Ltd. * @since 7.0 - * + * */ public interface ConverterFactory extends Serializable { public Converter createConverter( diff --git a/server/src/main/java/com/vaadin/data/util/converter/ConverterUtil.java b/server/src/main/java/com/vaadin/data/util/converter/ConverterUtil.java index 91e11a6222..f7a1e6d5d3 100644 --- a/server/src/main/java/com/vaadin/data/util/converter/ConverterUtil.java +++ b/server/src/main/java/com/vaadin/data/util/converter/ConverterUtil.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -27,7 +27,7 @@ public class ConverterUtil implements Serializable { * the given model type and back. Uses the given application to find a * {@link ConverterFactory} or, if application is null, uses the * {@link VaadinSession#getCurrent()}. - * + * * @param * the presentation type * @param @@ -60,7 +60,7 @@ public class ConverterUtil implements Serializable { /** * Convert the given value from the data source type to the UI type. - * + * * @param modelValue * the model value to convert * @param presentationType @@ -73,7 +73,7 @@ public class ConverterUtil implements Serializable { * the presentation type * @param * the model type - * + * * @return the converted value, compatible with the presentation type, or * the original value if its type is compatible and no converter is * set. @@ -116,8 +116,7 @@ public class ConverterUtil implements Serializable { throw new Converter.ConversionException( "Unable to convert value of type " + modelValue.getClass().getName() - + " to presentation type " - + presentationType + + " to presentation type " + presentationType + ". No converter is set and the types are not compatible."); } } @@ -125,7 +124,7 @@ public class ConverterUtil implements Serializable { /** * Convert the given value from the presentation (UI) type to model (data * source) type. - * + * * @param presentationValue * the presentation value to convert * @param modelType @@ -138,7 +137,7 @@ public class ConverterUtil implements Serializable { * the presentation type * @param * the model type - * + * * @return the converted value, compatible with the model type, or the * original value if its type is compatible and no converter is set. * @throws Converter.ConversionException @@ -181,8 +180,7 @@ public class ConverterUtil implements Serializable { throw new Converter.ConversionException( "Unable to convert value of type " + presentationValue.getClass().getName() - + " to model type " - + modelType + + " to model type " + modelType + ". No converter is set and the types are not compatible."); } @@ -192,9 +190,9 @@ public class ConverterUtil implements Serializable { * Checks if the given converter can handle conversion between the given * presentation and model type. Does strict type checking and only returns * true if the converter claims it can handle exactly the given types. - * + * * @see #canConverterPossiblyHandle(Converter, Class, Class) - * + * * @param converter * The converter to check. If this is null the result is always * false. @@ -224,7 +222,7 @@ public class ConverterUtil implements Serializable { /** * Checks if it possible that the given converter can handle conversion * between the given presentation and model type somehow. - * + * * @param converter * The converter to check. If this is null the result is always * false. diff --git a/server/src/main/java/com/vaadin/data/util/converter/DateToLongConverter.java b/server/src/main/java/com/vaadin/data/util/converter/DateToLongConverter.java index fffe80352e..6282554a62 100644 --- a/server/src/main/java/com/vaadin/data/util/converter/DateToLongConverter.java +++ b/server/src/main/java/com/vaadin/data/util/converter/DateToLongConverter.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,7 +21,7 @@ import java.util.Locale; /** * A converter that converts from {@link Long} to {@link Date} and back. - * + * * @author Vaadin Ltd * @since 7.0 */ @@ -29,7 +29,7 @@ public class DateToLongConverter implements Converter { /* * (non-Javadoc) - * + * * @see * com.vaadin.data.util.converter.Converter#convertToModel(java.lang.Object, * java.lang.Class, java.util.Locale) @@ -46,7 +46,7 @@ public class DateToLongConverter implements Converter { /* * (non-Javadoc) - * + * * @see * com.vaadin.data.util.converter.Converter#convertToPresentation(java.lang * .Object, java.lang.Class, java.util.Locale) @@ -55,9 +55,9 @@ public class DateToLongConverter implements Converter { public Date convertToPresentation(Long value, Class targetType, Locale locale) { if (targetType != getPresentationType()) { - throw new ConversionException("Converter only supports " - + getPresentationType().getName() + " (targetType was " - + targetType.getName() + ")"); + throw new ConversionException( + "Converter only supports " + getPresentationType().getName() + + " (targetType was " + targetType.getName() + ")"); } if (value == null) { return null; @@ -68,7 +68,7 @@ public class DateToLongConverter implements Converter { /* * (non-Javadoc) - * + * * @see com.vaadin.data.util.converter.Converter#getModelType() */ @Override @@ -78,7 +78,7 @@ public class DateToLongConverter implements Converter { /* * (non-Javadoc) - * + * * @see com.vaadin.data.util.converter.Converter#getPresentationType() */ @Override diff --git a/server/src/main/java/com/vaadin/data/util/converter/DateToSqlDateConverter.java b/server/src/main/java/com/vaadin/data/util/converter/DateToSqlDateConverter.java index 6a7e8327a1..de40ac5216 100644 --- a/server/src/main/java/com/vaadin/data/util/converter/DateToSqlDateConverter.java +++ b/server/src/main/java/com/vaadin/data/util/converter/DateToSqlDateConverter.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -15,7 +15,7 @@ */ /** - * + * */ package com.vaadin.data.util.converter; @@ -28,7 +28,7 @@ import java.util.Locale; * is connected to a java.sql.Date property, typically through a JPAContainer or * SQLContainer. Note that information (time information) is lost when * converting from {@link java.util.Date} to {@link java.sql.Date}. - * + * * @since 7.1 * @author Vaadin Ltd */ @@ -39,9 +39,9 @@ public class DateToSqlDateConverter implements Converter { Class targetType, Locale locale) throws ConversionException { if (targetType != getModelType()) { - throw new ConversionException("Converter only supports " - + getModelType().getName() + " (targetType was " - + targetType.getName() + ")"); + throw new ConversionException( + "Converter only supports " + getModelType().getName() + + " (targetType was " + targetType.getName() + ")"); } if (value == null) { @@ -56,9 +56,9 @@ public class DateToSqlDateConverter implements Converter { Class targetType, Locale locale) throws ConversionException { if (targetType != getPresentationType()) { - throw new ConversionException("Converter only supports " - + getPresentationType().getName() + " (targetType was " - + targetType.getName() + ")"); + throw new ConversionException( + "Converter only supports " + getPresentationType().getName() + + " (targetType was " + targetType.getName() + ")"); } if (value == null) { diff --git a/server/src/main/java/com/vaadin/data/util/converter/DefaultConverterFactory.java b/server/src/main/java/com/vaadin/data/util/converter/DefaultConverterFactory.java index 3a1f1a4252..e2f75a67d2 100644 --- a/server/src/main/java/com/vaadin/data/util/converter/DefaultConverterFactory.java +++ b/server/src/main/java/com/vaadin/data/util/converter/DefaultConverterFactory.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,12 +25,13 @@ import com.vaadin.server.VaadinSession; /** * Default implementation of {@link ConverterFactory}. Provides converters for - * standard types like {@link String}, {@link Double} and {@link Date}.

      + * standard types like {@link String}, {@link Double} and {@link Date}. + *

      *

      * Custom converters can be provided by extending this class and using * {@link VaadinSession#setConverterFactory(ConverterFactory)}. *

      - * + * * @author Vaadin Ltd * @since 7.0 */ @@ -70,13 +71,15 @@ public class DefaultConverterFactory implements ConverterFactory { Class presentationType, Class modelType) { if (presentationType == String.class) { // TextField converters and more - Converter converter = (Converter) createStringConverter(modelType); + Converter converter = (Converter) createStringConverter( + modelType); if (converter != null) { return converter; } } else if (presentationType == Date.class) { // DateField converters and more - Converter converter = (Converter) createDateConverter(modelType); + Converter converter = (Converter) createDateConverter( + modelType); if (converter != null) { return converter; } diff --git a/server/src/main/java/com/vaadin/data/util/converter/ReverseConverter.java b/server/src/main/java/com/vaadin/data/util/converter/ReverseConverter.java index 2495dc631a..0e8741e242 100644 --- a/server/src/main/java/com/vaadin/data/util/converter/ReverseConverter.java +++ b/server/src/main/java/com/vaadin/data/util/converter/ReverseConverter.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,24 +21,24 @@ import java.util.Locale; /** * A converter that wraps another {@link Converter} and reverses source and * target types. - * + * * @param * The source type * @param * The target type - * + * * @author Vaadin Ltd * @since 7.0 */ -public class ReverseConverter implements - Converter { +public class ReverseConverter + implements Converter { private Converter realConverter; /** * Creates a converter from source to target based on a converter that * converts from target to source. - * + * * @param converter * The converter to use in a reverse fashion */ @@ -48,7 +48,7 @@ public class ReverseConverter implements /* * (non-Javadoc) - * + * * @see com.vaadin.data.util.converter.Converter#convertToModel(java * .lang.Object, java.util.Locale) */ @@ -61,7 +61,7 @@ public class ReverseConverter implements /* * (non-Javadoc) - * + * * @see * com.vaadin.data.util.converter.Converter#convertToPresentation(java.lang * .Object, java.util.Locale) @@ -75,7 +75,7 @@ public class ReverseConverter implements /* * (non-Javadoc) - * + * * @see com.vaadin.data.util.converter.Converter#getSourceType() */ @Override @@ -85,7 +85,7 @@ public class ReverseConverter implements /* * (non-Javadoc) - * + * * @see com.vaadin.data.util.converter.Converter#getTargetType() */ @Override diff --git a/server/src/main/java/com/vaadin/data/util/converter/StringToBigDecimalConverter.java b/server/src/main/java/com/vaadin/data/util/converter/StringToBigDecimalConverter.java index 549f156f61..a5dd5c9ae0 100644 --- a/server/src/main/java/com/vaadin/data/util/converter/StringToBigDecimalConverter.java +++ b/server/src/main/java/com/vaadin/data/util/converter/StringToBigDecimalConverter.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -30,12 +30,12 @@ import java.util.Locale; *

      * Override and overwrite {@link #getFormat(Locale)} to use a different format. *

      - * + * * @author Vaadin Ltd * @since 7.2 */ -public class StringToBigDecimalConverter extends - AbstractStringToNumberConverter { +public class StringToBigDecimalConverter + extends AbstractStringToNumberConverter { @Override protected NumberFormat getFormat(Locale locale) { NumberFormat numberFormat = super.getFormat(locale); diff --git a/server/src/main/java/com/vaadin/data/util/converter/StringToBigIntegerConverter.java b/server/src/main/java/com/vaadin/data/util/converter/StringToBigIntegerConverter.java index adaa8c6111..1b5f88a4d6 100644 --- a/server/src/main/java/com/vaadin/data/util/converter/StringToBigIntegerConverter.java +++ b/server/src/main/java/com/vaadin/data/util/converter/StringToBigIntegerConverter.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -31,12 +31,12 @@ import java.util.Locale; *

      * Override and overwrite {@link #getFormat(Locale)} to use a different format. *

      - * + * * @author Vaadin Ltd * @since 7.4 */ -public class StringToBigIntegerConverter extends - AbstractStringToNumberConverter { +public class StringToBigIntegerConverter + extends AbstractStringToNumberConverter { @Override protected NumberFormat getFormat(Locale locale) { diff --git a/server/src/main/java/com/vaadin/data/util/converter/StringToBooleanConverter.java b/server/src/main/java/com/vaadin/data/util/converter/StringToBooleanConverter.java index f965cfcc6a..4061591c0f 100644 --- a/server/src/main/java/com/vaadin/data/util/converter/StringToBooleanConverter.java +++ b/server/src/main/java/com/vaadin/data/util/converter/StringToBooleanConverter.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -19,10 +19,16 @@ package com.vaadin.data.util.converter; import java.util.Locale; /** - * A converter that converts from {@link String} to {@link Boolean} and back. The String representation is given by - * {@link Boolean#toString()} or provided in constructor {@link #StringToBooleanConverter(String, String)}. - *

      Leading and trailing white spaces are ignored when converting from a String.

      - *

      For language-dependent representation, subclasses should overwrite {@link #getFalseString(Locale)} and {@link #getTrueString(Locale)}

      + * A converter that converts from {@link String} to {@link Boolean} and back. + * The String representation is given by {@link Boolean#toString()} or provided + * in constructor {@link #StringToBooleanConverter(String, String)}. + *

      + * Leading and trailing white spaces are ignored when converting from a String. + *

      + *

      + * For language-dependent representation, subclasses should overwrite + * {@link #getFalseString(Locale)} and {@link #getTrueString(Locale)} + *

      * * @author Vaadin Ltd * @since 7.0 @@ -34,7 +40,8 @@ public class StringToBooleanConverter implements Converter { private final String falseString; /** - * Creates converter with default string representations - "true" and "false" + * Creates converter with default string representations - "true" and + * "false" * */ public StringToBooleanConverter() { @@ -45,8 +52,10 @@ public class StringToBooleanConverter implements Converter { * Creates converter with custom string representation. * * @since 7.5.4 - * @param falseString string representation for false - * @param trueString string representation for true + * @param falseString + * string representation for false + * @param trueString + * string representation for true */ public StringToBooleanConverter(String trueString, String falseString) { this.trueString = trueString; @@ -82,7 +91,8 @@ public class StringToBooleanConverter implements Converter { } /** - * Gets the string representation for true. Default is "true", if not set in constructor. + * Gets the string representation for true. Default is "true", if not set in + * constructor. * * @return the string representation for true */ @@ -91,7 +101,8 @@ public class StringToBooleanConverter implements Converter { } /** - * Gets the string representation for false. Default is "false", if not set in constructor. + * Gets the string representation for false. Default is "false", if not set + * in constructor. * * @return the string representation for false */ @@ -121,11 +132,12 @@ public class StringToBooleanConverter implements Converter { } /** - * Gets the locale-depended string representation for false. - * Default is locale-independent value provided by {@link #getFalseString()} + * Gets the locale-depended string representation for false. Default is + * locale-independent value provided by {@link #getFalseString()} * * @since 7.5.4 - * @param locale to be used + * @param locale + * to be used * @return the string representation for false */ protected String getFalseString(Locale locale) { @@ -133,11 +145,12 @@ public class StringToBooleanConverter implements Converter { } /** - * Gets the locale-depended string representation for true. - * Default is locale-independent value provided by {@link #getTrueString()} + * Gets the locale-depended string representation for true. Default is + * locale-independent value provided by {@link #getTrueString()} * * @since 7.5.4 - * @param locale to be used + * @param locale + * to be used * @return the string representation for true */ protected String getTrueString(Locale locale) { diff --git a/server/src/main/java/com/vaadin/data/util/converter/StringToByteConverter.java b/server/src/main/java/com/vaadin/data/util/converter/StringToByteConverter.java index 719fced0ed..1e8767daf0 100644 --- a/server/src/main/java/com/vaadin/data/util/converter/StringToByteConverter.java +++ b/server/src/main/java/com/vaadin/data/util/converter/StringToByteConverter.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -26,18 +26,18 @@ import java.util.Locale; *

      * Override and overwrite {@link #getFormat(Locale)} to use a different format. *

      - * + * * @author Vaadin Ltd * @since 7.4 */ -public class StringToByteConverter extends - AbstractStringToNumberConverter { +public class StringToByteConverter + extends AbstractStringToNumberConverter { /** * Returns the format used by * {@link #convertToPresentation(Byte, Class, Locale)} and * {@link #convertToModel(String, Class, Locale)} - * + * * @param locale * The locale to use * @return A NumberFormat instance @@ -52,7 +52,7 @@ public class StringToByteConverter extends /* * (non-Javadoc) - * + * * @see * com.vaadin.data.util.converter.Converter#convertToModel(java.lang.Object, * java.lang.Class, java.util.Locale) @@ -78,7 +78,7 @@ public class StringToByteConverter extends /* * (non-Javadoc) - * + * * @see com.vaadin.data.util.converter.Converter#getModelType() */ @Override diff --git a/server/src/main/java/com/vaadin/data/util/converter/StringToCollectionConverter.java b/server/src/main/java/com/vaadin/data/util/converter/StringToCollectionConverter.java index 6930b6da06..89699a2f2c 100644 --- a/server/src/main/java/com/vaadin/data/util/converter/StringToCollectionConverter.java +++ b/server/src/main/java/com/vaadin/data/util/converter/StringToCollectionConverter.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -33,13 +33,13 @@ import java.util.Locale; * Default constructor uses ", " as delimiter string and * {@link String} for token types. Other constructors allow to configure * delimiter and token types. - * + * * @since 7.5.0 - * + * * @author Vaadin Ltd */ -public class StringToCollectionConverter implements - Converter { +public class StringToCollectionConverter + implements Converter { private final String delimiter; private final Converter tokenConverter; @@ -57,7 +57,7 @@ public class StringToCollectionConverter implements /** * Creates converter with given {@code delimiter} and {@link String} as * token model type in collection. - * + * * @param delimiter * custom delimiter */ @@ -71,7 +71,7 @@ public class StringToCollectionConverter implements *

      * If {@code tokenConverter} is null then no conversation is done and * {@link String} is used as token type in resulting model collection. - * + * * @param tokenConverter * converter for token * @param tokenType @@ -88,7 +88,7 @@ public class StringToCollectionConverter implements *

      * If {@code tokenConverter} is null then no conversation is done and * {@link String} is used as token type in resulting model collection. - * + * * @param tokenConverter * converter for token * @param tokenType @@ -108,7 +108,7 @@ public class StringToCollectionConverter implements *

      * If {@code tokenConverter} is null then no conversation is done and * {@link String} is used as token type in resulting model collection. - * + * * @param tokenConverter * converter for token * @param tokenType @@ -199,13 +199,14 @@ public class StringToCollectionConverter implements /** * Default collection factory implementation. - * + * * @author Vaadin Ltd */ public static class DefaultCollectionFactory implements CollectionFactory { @Override - public Collection createCollection(Class type) { + public Collection createCollection( + Class type) { if (type.isAssignableFrom(ArrayList.class)) { return new ArrayList(); } else if (type.isAssignableFrom(HashSet.class)) { @@ -226,14 +227,14 @@ public class StringToCollectionConverter implements /** * Collection factory. Defines a strategy to create collection by collection * class. - * + * * @author Vaadin Ltd */ public interface CollectionFactory extends Serializable { /** * Create collection by its {@code type}. - * + * * @param type * collection type * @return instantiated collection with given {@code type} diff --git a/server/src/main/java/com/vaadin/data/util/converter/StringToDateConverter.java b/server/src/main/java/com/vaadin/data/util/converter/StringToDateConverter.java index 8f0db24caf..6060a17a16 100644 --- a/server/src/main/java/com/vaadin/data/util/converter/StringToDateConverter.java +++ b/server/src/main/java/com/vaadin/data/util/converter/StringToDateConverter.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -30,7 +30,7 @@ import java.util.Locale; *

      * Override and overwrite {@link #getFormat(Locale)} to use a different format. *

      - * + * * @author Vaadin Ltd * @since 7.0 */ @@ -40,7 +40,7 @@ public class StringToDateConverter implements Converter { * Returns the format used by * {@link #convertToPresentation(Date, Class,Locale)} and * {@link #convertToModel(String, Class, Locale)}. - * + * * @param locale * The locale to use * @return A DateFormat instance @@ -58,7 +58,7 @@ public class StringToDateConverter implements Converter { /* * (non-Javadoc) - * + * * @see * com.vaadin.data.util.converter.Converter#convertToModel(java.lang.Object, * java.lang.Class, java.util.Locale) @@ -68,9 +68,9 @@ public class StringToDateConverter implements Converter { Locale locale) throws com.vaadin.data.util.converter.Converter.ConversionException { if (targetType != getModelType()) { - throw new ConversionException("Converter only supports " - + getModelType().getName() + " (targetType was " - + targetType.getName() + ")"); + throw new ConversionException( + "Converter only supports " + getModelType().getName() + + " (targetType was " + targetType.getName() + ")"); } if (value == null) { @@ -92,7 +92,7 @@ public class StringToDateConverter implements Converter { /* * (non-Javadoc) - * + * * @see * com.vaadin.data.util.converter.Converter#convertToPresentation(java.lang * .Object, java.lang.Class, java.util.Locale) @@ -110,7 +110,7 @@ public class StringToDateConverter implements Converter { /* * (non-Javadoc) - * + * * @see com.vaadin.data.util.converter.Converter#getModelType() */ @Override @@ -120,7 +120,7 @@ public class StringToDateConverter implements Converter { /* * (non-Javadoc) - * + * * @see com.vaadin.data.util.converter.Converter#getPresentationType() */ @Override diff --git a/server/src/main/java/com/vaadin/data/util/converter/StringToDoubleConverter.java b/server/src/main/java/com/vaadin/data/util/converter/StringToDoubleConverter.java index f514eac648..990b74a3ca 100644 --- a/server/src/main/java/com/vaadin/data/util/converter/StringToDoubleConverter.java +++ b/server/src/main/java/com/vaadin/data/util/converter/StringToDoubleConverter.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -29,16 +29,16 @@ import java.util.Locale; *

      * Override and overwrite {@link #getFormat(Locale)} to use a different format. *

      - * + * * @author Vaadin Ltd * @since 7.0 */ -public class StringToDoubleConverter extends - AbstractStringToNumberConverter { +public class StringToDoubleConverter + extends AbstractStringToNumberConverter { /* * (non-Javadoc) - * + * * @see * com.vaadin.data.util.converter.Converter#convertToModel(java.lang.Object, * java.util.Locale) @@ -53,7 +53,7 @@ public class StringToDoubleConverter extends /* * (non-Javadoc) - * + * * @see com.vaadin.data.util.converter.Converter#getModelType() */ @Override diff --git a/server/src/main/java/com/vaadin/data/util/converter/StringToEnumConverter.java b/server/src/main/java/com/vaadin/data/util/converter/StringToEnumConverter.java index 7b2f43f972..c4d61a9c54 100644 --- a/server/src/main/java/com/vaadin/data/util/converter/StringToEnumConverter.java +++ b/server/src/main/java/com/vaadin/data/util/converter/StringToEnumConverter.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -32,7 +32,7 @@ import java.util.Locale; * * Will not necessarily work correctly for other cases. *

      - * + * * @author Vaadin Ltd * @since 7.4 */ @@ -52,7 +52,7 @@ public class StringToEnumConverter implements Converter { * Converts the given string to the given enum type using the given locale *

      * Compatible with {@link #enumToString(Enum, Locale)} - * + * * @param value * The string value to convert * @param enumType @@ -71,8 +71,8 @@ public class StringToEnumConverter implements Converter { } if (!enumType.isEnum()) { - throw new ConversionException(enumType.getName() - + " is not an enum type"); + throw new ConversionException( + enumType.getName() + " is not an enum type"); } // First test for the human-readable value since that's the more likely @@ -107,7 +107,7 @@ public class StringToEnumConverter implements Converter { * Converts the given enum to a human readable string using the given locale *

      * Compatible with {@link #stringToEnum(String, Class, Locale)} - * + * * @param value * The enum value to convert * @param locale @@ -128,8 +128,8 @@ public class StringToEnumConverter implements Converter { // FOO_BAR -> Foo bar // _FOO -> _foo String result = enumString.substring(0, 1).toUpperCase(locale); - result += enumString.substring(1).toLowerCase(locale) - .replace('_', ' '); + result += enumString.substring(1).toLowerCase(locale).replace('_', + ' '); return result; } else { return enumString; diff --git a/server/src/main/java/com/vaadin/data/util/converter/StringToFloatConverter.java b/server/src/main/java/com/vaadin/data/util/converter/StringToFloatConverter.java index f4d7f97853..d49decf1f1 100644 --- a/server/src/main/java/com/vaadin/data/util/converter/StringToFloatConverter.java +++ b/server/src/main/java/com/vaadin/data/util/converter/StringToFloatConverter.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -29,31 +29,30 @@ import java.util.Locale; *

      * Override and overwrite {@link #getFormat(Locale)} to use a different format. *

      - * + * * @author Vaadin Ltd * @since 7.0 */ -public class StringToFloatConverter extends - AbstractStringToNumberConverter { +public class StringToFloatConverter + extends AbstractStringToNumberConverter { /* * (non-Javadoc) - * + * * @see * com.vaadin.data.util.converter.Converter#convertToModel(java.lang.Object, * java.util.Locale) */ @Override - public Float convertToModel(String value, - Class targetType, Locale locale) - throws ConversionException { + public Float convertToModel(String value, Class targetType, + Locale locale) throws ConversionException { Number n = convertToNumber(value, targetType, locale); return n == null ? null : n.floatValue(); } /* * (non-Javadoc) - * + * * @see com.vaadin.data.util.converter.Converter#getModelType() */ @Override diff --git a/server/src/main/java/com/vaadin/data/util/converter/StringToIntegerConverter.java b/server/src/main/java/com/vaadin/data/util/converter/StringToIntegerConverter.java index 59a46babe1..1936cc9c9b 100644 --- a/server/src/main/java/com/vaadin/data/util/converter/StringToIntegerConverter.java +++ b/server/src/main/java/com/vaadin/data/util/converter/StringToIntegerConverter.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -26,18 +26,18 @@ import java.util.Locale; *

      * Override and overwrite {@link #getFormat(Locale)} to use a different format. *

      - * + * * @author Vaadin Ltd * @since 7.0 */ -public class StringToIntegerConverter extends - AbstractStringToNumberConverter { +public class StringToIntegerConverter + extends AbstractStringToNumberConverter { /** * Returns the format used by * {@link #convertToPresentation(Integer, Class, Locale)} and * {@link #convertToModel(String, Class, Locale)} - * + * * @param locale * The locale to use * @return A NumberFormat instance @@ -52,7 +52,7 @@ public class StringToIntegerConverter extends /* * (non-Javadoc) - * + * * @see * com.vaadin.data.util.converter.Converter#convertToModel(java.lang.Object, * java.lang.Class, java.util.Locale) @@ -83,7 +83,7 @@ public class StringToIntegerConverter extends /* * (non-Javadoc) - * + * * @see com.vaadin.data.util.converter.Converter#getModelType() */ @Override diff --git a/server/src/main/java/com/vaadin/data/util/converter/StringToLongConverter.java b/server/src/main/java/com/vaadin/data/util/converter/StringToLongConverter.java index cd7cf49042..91cfd65835 100644 --- a/server/src/main/java/com/vaadin/data/util/converter/StringToLongConverter.java +++ b/server/src/main/java/com/vaadin/data/util/converter/StringToLongConverter.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -26,18 +26,18 @@ import java.util.Locale; *

      * Override and overwrite {@link #getFormat(Locale)} to use a different format. *

      - * + * * @author Vaadin Ltd * @since 7.2 */ -public class StringToLongConverter extends - AbstractStringToNumberConverter { +public class StringToLongConverter + extends AbstractStringToNumberConverter { /** * Returns the format used by * {@link #convertToPresentation(Long, Class, Locale)} and * {@link #convertToModel(String, Class, Locale)} - * + * * @param locale * The locale to use * @return A NumberFormat instance @@ -52,7 +52,7 @@ public class StringToLongConverter extends /* * (non-Javadoc) - * + * * @see * com.vaadin.data.util.converter.Converter#convertToModel(java.lang.Object, * java.lang.Class, java.util.Locale) @@ -67,7 +67,7 @@ public class StringToLongConverter extends /* * (non-Javadoc) - * + * * @see com.vaadin.data.util.converter.Converter#getModelType() */ @Override diff --git a/server/src/main/java/com/vaadin/data/util/converter/StringToShortConverter.java b/server/src/main/java/com/vaadin/data/util/converter/StringToShortConverter.java index 554b958ee0..5637326e4d 100644 --- a/server/src/main/java/com/vaadin/data/util/converter/StringToShortConverter.java +++ b/server/src/main/java/com/vaadin/data/util/converter/StringToShortConverter.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -26,18 +26,18 @@ import java.util.Locale; *

      * Override and overwrite {@link #getFormat(Locale)} to use a different format. *

      - * + * * @author Vaadin Ltd * @since 7.4 */ -public class StringToShortConverter extends - AbstractStringToNumberConverter { +public class StringToShortConverter + extends AbstractStringToNumberConverter { /** * Returns the format used by * {@link #convertToPresentation(Short, Class, Locale)} and * {@link #convertToModel(String, Class, Locale)} - * + * * @param locale * The locale to use * @return A NumberFormat instance @@ -52,15 +52,14 @@ public class StringToShortConverter extends /* * (non-Javadoc) - * + * * @see * com.vaadin.data.util.converter.Converter#convertToModel(java.lang.Object, * java.lang.Class, java.util.Locale) */ @Override - public Short convertToModel(String value, - Class targetType, Locale locale) - throws ConversionException { + public Short convertToModel(String value, Class targetType, + Locale locale) throws ConversionException { Number n = convertToNumber(value, targetType, locale); if (n == null) { @@ -79,7 +78,7 @@ public class StringToShortConverter extends /* * (non-Javadoc) - * + * * @see com.vaadin.data.util.converter.Converter#getModelType() */ @Override diff --git a/server/src/main/java/com/vaadin/data/util/filter/AbstractJunctionFilter.java b/server/src/main/java/com/vaadin/data/util/filter/AbstractJunctionFilter.java index 28e6cda34e..9c43a3853d 100644 --- a/server/src/main/java/com/vaadin/data/util/filter/AbstractJunctionFilter.java +++ b/server/src/main/java/com/vaadin/data/util/filter/AbstractJunctionFilter.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -23,10 +23,10 @@ import com.vaadin.data.Container.Filter; /** * Abstract base class for filters that are composed of multiple sub-filters. - * + * * The method {@link #appliesToProperty(Object)} is provided to help * implementing {@link Filter} for in-memory filters. - * + * * @since 6.6 */ public abstract class AbstractJunctionFilter implements Filter { @@ -34,14 +34,14 @@ public abstract class AbstractJunctionFilter implements Filter { protected final Collection filters; public AbstractJunctionFilter(Filter... filters) { - this.filters = Collections.unmodifiableCollection(Arrays - .asList(filters)); + this.filters = Collections + .unmodifiableCollection(Arrays.asList(filters)); } /** * Returns an unmodifiable collection of the sub-filters of this composite * filter. - * + * * @return */ public Collection getFilters() { @@ -52,7 +52,7 @@ public abstract class AbstractJunctionFilter implements Filter { * Returns true if a change in the named property may affect the filtering * result. If some of the sub-filters are not in-memory filters, true is * returned. - * + * * By default, all sub-filters are iterated to check if any of them applies. * If there are no sub-filters, false is returned - override in subclasses * to change this behavior. diff --git a/server/src/main/java/com/vaadin/data/util/filter/And.java b/server/src/main/java/com/vaadin/data/util/filter/And.java index 938aedae95..86202db393 100644 --- a/server/src/main/java/com/vaadin/data/util/filter/And.java +++ b/server/src/main/java/com/vaadin/data/util/filter/And.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,20 +21,20 @@ import com.vaadin.data.Item; /** * A compound {@link Filter} that accepts an item if all of its filters accept * the item. - * + * * If no filters are given, the filter should accept all items. - * + * * This filter also directly supports in-memory filtering when all sub-filters * do so. - * + * * @see Or - * + * * @since 6.6 */ public final class And extends AbstractJunctionFilter { /** - * + * * @param filters * filters of which the And filter will be composed */ diff --git a/server/src/main/java/com/vaadin/data/util/filter/Between.java b/server/src/main/java/com/vaadin/data/util/filter/Between.java index c50488c521..2874026cb7 100644 --- a/server/src/main/java/com/vaadin/data/util/filter/Between.java +++ b/server/src/main/java/com/vaadin/data/util/filter/Between.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/server/src/main/java/com/vaadin/data/util/filter/Compare.java b/server/src/main/java/com/vaadin/data/util/filter/Compare.java index 60523f2d42..baab7fb2b8 100644 --- a/server/src/main/java/com/vaadin/data/util/filter/Compare.java +++ b/server/src/main/java/com/vaadin/data/util/filter/Compare.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -24,13 +24,13 @@ import com.vaadin.data.Property; * constant value. Use the nested classes {@link Equal}, {@link Greater}, * {@link Less}, {@link GreaterOrEqual} and {@link LessOrEqual} instead of this * class directly. - * + * * This filter also directly supports in-memory filtering. - * + * * The reference and actual values must implement {@link Comparable} and the * class of the actual property value must be assignable from the class of the * reference value. - * + * * @since 6.6 */ public abstract class Compare implements Filter { @@ -46,23 +46,23 @@ public abstract class Compare implements Filter { /** * A {@link Compare} filter that accepts items for which the identified * property value is equal to value. - * + * * For in-memory filters, {@link Comparable#compareTo(Object)} or, if not * Comparable, {@link #equals(Object)} is used for the comparison. For other * containers, the comparison implementation is container dependent and may * use e.g. database comparison operations. - * + * * @since 6.6 */ public static final class Equal extends Compare { /** * Construct a filter that accepts items for which the identified * property value is equal to value. - * + * * For in-memory filters, equals() is used for the comparison. For other * containers, the comparison implementation is container dependent and * may use e.g. database comparison operations. - * + * * @param propertyId * the identifier of the property whose value to compare * against value, not null @@ -78,24 +78,24 @@ public abstract class Compare implements Filter { /** * A {@link Compare} filter that accepts items for which the identified * property value is greater than value. - * + * * For in-memory filters, the values must implement {@link Comparable} and * {@link Comparable#compareTo(Object)} is used for the comparison. For * other containers, the comparison implementation is container dependent * and may use e.g. database comparison operations. - * + * * @since 6.6 */ public static final class Greater extends Compare { /** * Construct a filter that accepts items for which the identified * property value is greater than value. - * + * * For in-memory filters, the values must implement {@link Comparable} * and {@link Comparable#compareTo(Object)} is used for the comparison. * For other containers, the comparison implementation is container * dependent and may use e.g. database comparison operations. - * + * * @param propertyId * the identifier of the property whose value to compare * against value, not null @@ -111,24 +111,24 @@ public abstract class Compare implements Filter { /** * A {@link Compare} filter that accepts items for which the identified * property value is less than value. - * + * * For in-memory filters, the values must implement {@link Comparable} and * {@link Comparable#compareTo(Object)} is used for the comparison. For * other containers, the comparison implementation is container dependent * and may use e.g. database comparison operations. - * + * * @since 6.6 */ public static final class Less extends Compare { /** * Construct a filter that accepts items for which the identified * property value is less than value. - * + * * For in-memory filters, the values must implement {@link Comparable} * and {@link Comparable#compareTo(Object)} is used for the comparison. * For other containers, the comparison implementation is container * dependent and may use e.g. database comparison operations. - * + * * @param propertyId * the identifier of the property whose value to compare * against value, not null @@ -144,24 +144,24 @@ public abstract class Compare implements Filter { /** * A {@link Compare} filter that accepts items for which the identified * property value is greater than or equal to value. - * + * * For in-memory filters, the values must implement {@link Comparable} and * {@link Comparable#compareTo(Object)} is used for the comparison. For * other containers, the comparison implementation is container dependent * and may use e.g. database comparison operations. - * + * * @since 6.6 */ public static final class GreaterOrEqual extends Compare { /** * Construct a filter that accepts items for which the identified * property value is greater than or equal to value. - * + * * For in-memory filters, the values must implement {@link Comparable} * and {@link Comparable#compareTo(Object)} is used for the comparison. * For other containers, the comparison implementation is container * dependent and may use e.g. database comparison operations. - * + * * @param propertyId * the identifier of the property whose value to compare * against value, not null @@ -177,24 +177,24 @@ public abstract class Compare implements Filter { /** * A {@link Compare} filter that accepts items for which the identified * property value is less than or equal to value. - * + * * For in-memory filters, the values must implement {@link Comparable} and * {@link Comparable#compareTo(Object)} is used for the comparison. For * other containers, the comparison implementation is container dependent * and may use e.g. database comparison operations. - * + * * @since 6.6 */ public static final class LessOrEqual extends Compare { /** * Construct a filter that accepts items for which the identified * property value is less than or equal to value. - * + * * For in-memory filters, the values must implement {@link Comparable} * and {@link Comparable#compareTo(Object)} is used for the comparison. * For other containers, the comparison implementation is container * dependent and may use e.g. database comparison operations. - * + * * @param propertyId * the identifier of the property whose value to compare * against value, not null @@ -210,21 +210,21 @@ public abstract class Compare implements Filter { /** * Constructor for a {@link Compare} filter that compares the value of an * item property with the given constant value. - * + * * This constructor is intended to be used by the nested static classes only * ({@link Equal}, {@link Greater}, {@link Less}, {@link GreaterOrEqual}, * {@link LessOrEqual}). - * + * * For in-memory filtering, comparisons except EQUAL require that the values * implement {@link Comparable} and {@link Comparable#compareTo(Object)} is * used for the comparison. The equality comparison is performed using * {@link Object#equals(Object)}. - * + * * For other containers, the comparison implementation is container * dependent and may use e.g. database comparison operations. Therefore, the * behavior of comparisons might differ in some cases between in-memory and * other containers. - * + * * @param propertyId * the identifier of the property whose value to compare against * value, not null @@ -267,7 +267,7 @@ public abstract class Compare implements Filter { * Checks if the this value equals the given value. Favors Comparable over * equals to better support e.g. BigDecimal where equals is stricter than * compareTo. - * + * * @param otherValue * The value to compare to * @return true if the values are equal, false otherwise @@ -277,9 +277,8 @@ public abstract class Compare implements Filter { return (otherValue == value); } else if (value == otherValue) { return true; - } else if (value instanceof Comparable - && otherValue.getClass() - .isAssignableFrom(getValue().getClass())) { + } else if (value instanceof Comparable && otherValue.getClass() + .isAssignableFrom(getValue().getClass())) { return ((Comparable) value).compareTo(otherValue) == 0; } else { return value.equals(otherValue); @@ -331,8 +330,8 @@ public abstract class Compare implements Filter { if (getOperation() != o.getOperation()) { return false; } - return (null == getValue()) ? null == o.getValue() : getValue().equals( - o.getValue()); + return (null == getValue()) ? null == o.getValue() + : getValue().equals(o.getValue()); } @Override @@ -344,7 +343,7 @@ public abstract class Compare implements Filter { /** * Returns the property id of the property to compare against the fixed * value. - * + * * @return property id (not null) */ public Object getPropertyId() { @@ -353,7 +352,7 @@ public abstract class Compare implements Filter { /** * Returns the comparison operation. - * + * * @return {@link Operation} */ public Operation getOperation() { @@ -362,7 +361,7 @@ public abstract class Compare implements Filter { /** * Returns the value to compare the property against. - * + * * @return comparison reference value */ public Object getValue() { diff --git a/server/src/main/java/com/vaadin/data/util/filter/IsNull.java b/server/src/main/java/com/vaadin/data/util/filter/IsNull.java index 9bcfe40c03..39e15536c1 100644 --- a/server/src/main/java/com/vaadin/data/util/filter/IsNull.java +++ b/server/src/main/java/com/vaadin/data/util/filter/IsNull.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,9 +21,9 @@ import com.vaadin.data.Property; /** * Simple container filter checking whether an item property value is null. - * + * * This filter also directly supports in-memory filtering. - * + * * @since 6.6 */ public final class IsNull implements Filter { @@ -33,11 +33,11 @@ public final class IsNull implements Filter { /** * Constructor for a filter that compares the value of an item property with * null. - * + * * For in-memory filtering, a simple == check is performed. For other * containers, the comparison implementation is container dependent but * should correspond to the in-memory null check. - * + * * @param propertyId * the identifier (not null) of the property whose value to check */ @@ -73,8 +73,9 @@ public final class IsNull implements Filter { final IsNull o = (IsNull) obj; // Checks the properties one by one - return (null != getPropertyId()) ? getPropertyId().equals( - o.getPropertyId()) : null == o.getPropertyId(); + return (null != getPropertyId()) + ? getPropertyId().equals(o.getPropertyId()) + : null == o.getPropertyId(); } @Override @@ -85,7 +86,7 @@ public final class IsNull implements Filter { /** * Returns the property id of the property tested by the filter, not null * for valid filters. - * + * * @return property id (not null) */ public Object getPropertyId() { diff --git a/server/src/main/java/com/vaadin/data/util/filter/Like.java b/server/src/main/java/com/vaadin/data/util/filter/Like.java index 9b7b2af292..81bdf74e04 100644 --- a/server/src/main/java/com/vaadin/data/util/filter/Like.java +++ b/server/src/main/java/com/vaadin/data/util/filter/Like.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -95,10 +95,11 @@ public class Like implements Filter { final Like o = (Like) obj; // Checks the properties one by one - boolean propertyIdEqual = (null != getPropertyId()) ? getPropertyId() - .equals(o.getPropertyId()) : null == o.getPropertyId(); - boolean valueEqual = (null != getValue()) ? getValue().equals( - o.getValue()) : null == o.getValue(); + boolean propertyIdEqual = (null != getPropertyId()) + ? getPropertyId().equals(o.getPropertyId()) + : null == o.getPropertyId(); + boolean valueEqual = (null != getValue()) + ? getValue().equals(o.getValue()) : null == o.getValue(); return propertyIdEqual && valueEqual; } } diff --git a/server/src/main/java/com/vaadin/data/util/filter/Not.java b/server/src/main/java/com/vaadin/data/util/filter/Not.java index a677e7f752..eba7a6c417 100644 --- a/server/src/main/java/com/vaadin/data/util/filter/Not.java +++ b/server/src/main/java/com/vaadin/data/util/filter/Not.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,10 +20,10 @@ import com.vaadin.data.Item; /** * Negating filter that accepts the items rejected by another filter. - * + * * This filter directly supports in-memory filtering when the negated filter * does so. - * + * * @since 6.6 */ public final class Not implements Filter { @@ -31,7 +31,7 @@ public final class Not implements Filter { /** * Constructs a filter that negates a filter. - * + * * @param filter * {@link Filter} to negate, not-null */ @@ -41,7 +41,7 @@ public final class Not implements Filter { /** * Returns the negated filter. - * + * * @return Filter */ public Filter getFilter() { @@ -58,7 +58,7 @@ public final class Not implements Filter { * Returns true if a change in the named property may affect the filtering * result. Return value is the same as {@link #appliesToProperty(Object)} * for the negated filter. - * + * * @return boolean */ @Override diff --git a/server/src/main/java/com/vaadin/data/util/filter/Or.java b/server/src/main/java/com/vaadin/data/util/filter/Or.java index 69d20513a2..df5b89e991 100644 --- a/server/src/main/java/com/vaadin/data/util/filter/Or.java +++ b/server/src/main/java/com/vaadin/data/util/filter/Or.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,20 +21,20 @@ import com.vaadin.data.Item; /** * A compound {@link Filter} that accepts an item if any of its filters accept * the item. - * + * * If no filters are given, the filter should reject all items. - * + * * This filter also directly supports in-memory filtering when all sub-filters * do so. - * + * * @see And - * + * * @since 6.6 */ public final class Or extends AbstractJunctionFilter { /** - * + * * @param filters * filters of which the Or filter will be composed */ @@ -57,7 +57,7 @@ public final class Or extends AbstractJunctionFilter { * Returns true if a change in the named property may affect the filtering * result. If some of the sub-filters are not in-memory filters, true is * returned. - * + * * By default, all sub-filters are iterated to check if any of them applies. * If there are no sub-filters, true is returned as an empty Or rejects all * items. diff --git a/server/src/main/java/com/vaadin/data/util/filter/SimpleStringFilter.java b/server/src/main/java/com/vaadin/data/util/filter/SimpleStringFilter.java index ea5e93277e..d7be64f9a6 100644 --- a/server/src/main/java/com/vaadin/data/util/filter/SimpleStringFilter.java +++ b/server/src/main/java/com/vaadin/data/util/filter/SimpleStringFilter.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -22,17 +22,17 @@ import com.vaadin.data.Property; /** * Simple string filter for matching items that start with or contain a * specified string. The matching can be case-sensitive or case-insensitive. - * + * * This filter also directly supports in-memory filtering. When performing * in-memory filtering, values of other types are converted using toString(), * but other (lazy container) implementations do not need to perform such * conversions and might not support values of different types. - * + * * Note that this filter is modeled after the pre-6.6 filtering mechanisms, and * might not be very efficient e.g. for database filtering. - * + * * TODO this might still change - * + * * @since 6.6 */ public final class SimpleStringFilter implements Filter { @@ -61,8 +61,8 @@ public final class SimpleStringFilter implements Filter { if (propertyValue == null) { return false; } - final String value = ignoreCase ? propertyValue.toString() - .toLowerCase() : propertyValue.toString(); + final String value = ignoreCase ? propertyValue.toString().toLowerCase() + : propertyValue.toString(); if (onlyMatchPrefix) { if (!value.startsWith(filterString)) { return false; @@ -119,7 +119,7 @@ public final class SimpleStringFilter implements Filter { /** * Returns the property identifier to which this filter applies. - * + * * @return property id */ public Object getPropertyId() { @@ -128,10 +128,10 @@ public final class SimpleStringFilter implements Filter { /** * Returns the filter string. - * + * * Note: this method is intended only for implementations of lazy string * filters and may change in the future. - * + * * @return filter string given to the constructor */ public String getFilterString() { @@ -140,10 +140,10 @@ public final class SimpleStringFilter implements Filter { /** * Returns whether the filter is case-insensitive or case-sensitive. - * + * * Note: this method is intended only for implementations of lazy string * filters and may change in the future. - * + * * @return true if performing case-insensitive filtering, false for * case-sensitive */ @@ -154,10 +154,10 @@ public final class SimpleStringFilter implements Filter { /** * Returns true if the filter only applies to the beginning of the value * string, false for any location in the value. - * + * * Note: this method is intended only for implementations of lazy string * filters and may change in the future. - * + * * @return true if checking for matches at the beginning of the value only, * false if matching any part of value */ diff --git a/server/src/main/java/com/vaadin/data/util/filter/UnsupportedFilterException.java b/server/src/main/java/com/vaadin/data/util/filter/UnsupportedFilterException.java index 42a7784da8..1257977136 100644 --- a/server/src/main/java/com/vaadin/data/util/filter/UnsupportedFilterException.java +++ b/server/src/main/java/com/vaadin/data/util/filter/UnsupportedFilterException.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,16 +20,16 @@ import java.io.Serializable; /** * Exception for cases where a container does not support a specific type of * filters. - * + * * If possible, this should be thrown already when adding a filter to a * container. If a problem is not detected at that point, an * {@link UnsupportedOperationException} can be throws when attempting to * perform filtering. - * + * * @since 6.6 */ -public class UnsupportedFilterException extends RuntimeException implements - Serializable { +public class UnsupportedFilterException extends RuntimeException + implements Serializable { public UnsupportedFilterException() { } diff --git a/server/src/main/java/com/vaadin/data/util/sqlcontainer/CacheFlushNotifier.java b/server/src/main/java/com/vaadin/data/util/sqlcontainer/CacheFlushNotifier.java index 12d806a8d5..f0a41ed288 100644 --- a/server/src/main/java/com/vaadin/data/util/sqlcontainer/CacheFlushNotifier.java +++ b/server/src/main/java/com/vaadin/data/util/sqlcontainer/CacheFlushNotifier.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -39,7 +39,7 @@ class CacheFlushNotifier implements Serializable { /** * Adds the given SQLContainer to the cache flush notification receiver list - * + * * @param c * Container to add */ @@ -65,7 +65,7 @@ class CacheFlushNotifier implements Serializable { /** * Iterates through the instances and notifies containers which are * connected to the same table or are using the same query string. - * + * * @param c * SQLContainer that issued the cache flush notification */ @@ -87,10 +87,9 @@ class CacheFlushNotifier implements Serializable { /* Compare QueryDelegate types and tableName/queryString */ QueryDelegate wrQd = wrc.getQueryDelegate(); QueryDelegate qd = c.getQueryDelegate(); - if (wrQd instanceof TableQuery - && qd instanceof TableQuery - && ((TableQuery) wrQd).getTableName().equals( - ((TableQuery) qd).getTableName())) { + if (wrQd instanceof TableQuery && qd instanceof TableQuery + && ((TableQuery) wrQd).getTableName() + .equals(((TableQuery) qd).getTableName())) { wrc.refresh(); } else if (wrQd instanceof FreeformQuery && qd instanceof FreeformQuery diff --git a/server/src/main/java/com/vaadin/data/util/sqlcontainer/CacheMap.java b/server/src/main/java/com/vaadin/data/util/sqlcontainer/CacheMap.java index cdeff873d0..846abf68b0 100644 --- a/server/src/main/java/com/vaadin/data/util/sqlcontainer/CacheMap.java +++ b/server/src/main/java/com/vaadin/data/util/sqlcontainer/CacheMap.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/server/src/main/java/com/vaadin/data/util/sqlcontainer/ColumnProperty.java b/server/src/main/java/com/vaadin/data/util/sqlcontainer/ColumnProperty.java index e89b8c02a8..9ee94647bc 100644 --- a/server/src/main/java/com/vaadin/data/util/sqlcontainer/ColumnProperty.java +++ b/server/src/main/java/com/vaadin/data/util/sqlcontainer/ColumnProperty.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -28,7 +28,7 @@ import com.vaadin.data.util.converter.Converter.ConversionException; * ColumnProperty represents the value of one column in a RowItem. In addition * to the value, ColumnProperty also contains some basic column attributes such * as nullability status, read-only status and data type. - * + * * Note that depending on the QueryDelegate in use this does not necessarily map * into an actual column in a database table. */ @@ -63,14 +63,14 @@ final public class ColumnProperty implements Property { * Deprecated constructor for ColumnProperty. If this is used the primary * keys are not identified correctly in some cases for some databases (i.e. * Oracle). See http://dev.vaadin.com/ticket/9145. - * + * * @param propertyId * @param readOnly * @param allowReadOnlyChange * @param nullable * @param value * @param type - * + * * @deprecated As of 7.0. Use * {@link #ColumnProperty(String, boolean, boolean, boolean, boolean, Object, Class) * instead @@ -85,7 +85,7 @@ final public class ColumnProperty implements Property { /** * Creates a new ColumnProperty instance. - * + * * @param propertyId * The ID of this property. * @param readOnly @@ -124,7 +124,7 @@ final public class ColumnProperty implements Property { /** * Returns the current value for this property. To get the previous value * (if one exists) for a modified property use {@link #getOldValue()}. - * + * * @return */ @Override @@ -138,7 +138,7 @@ final public class ColumnProperty implements Property { /** * Returns the original non-modified value of this property if it has been * modified. - * + * * @return The original value if isModified() is true, * getValue() otherwise. */ @@ -147,8 +147,8 @@ final public class ColumnProperty implements Property { } @Override - public void setValue(Object newValue) throws ReadOnlyException, - ConversionException { + public void setValue(Object newValue) + throws ReadOnlyException, ConversionException { if (newValue == null && !nullable) { throw new NotNullableException( "Null values are not allowed for this property."); @@ -232,7 +232,7 @@ final public class ColumnProperty implements Property { * to be written by the underlying database. Also used for values like * VERSION and AUTO_INCREMENT fields that might be set to read-only by the * container but the database still allows writes. - * + * * @return true if the read-only status can be changed, false otherwise. */ public boolean isReadOnlyChangeAllowed() { @@ -266,9 +266,9 @@ final public class ColumnProperty implements Property { * If legacy Property toString mode is disabled, the string representation * has no special meaning *

      - * + * * @see LegacyPropertyHelper#isLegacyToStringEnabled() - * + * * @return A string representation of the value value stored in the Property * or a string representation of the Property object. * @deprecated As of 7.0. To get the property value, use {@link #getValue()} @@ -318,7 +318,7 @@ final public class ColumnProperty implements Property { /** * Return whether the value of this property should be persisted to the * database. - * + * * @return true if the value should be written to the database, false * otherwise. */ @@ -334,7 +334,7 @@ final public class ColumnProperty implements Property { /** * Returns whether or not this property is used as a row identifier. - * + * * @return true if the property is a row identifier, false otherwise. */ public boolean isRowIdentifier() { @@ -359,7 +359,7 @@ final public class ColumnProperty implements Property { /** * Constructs a new NotNullableException with the specified * detail message. - * + * * @param msg * the detail message */ @@ -370,7 +370,7 @@ final public class ColumnProperty implements Property { /** * Constructs a new NotNullableException from another * exception. - * + * * @param cause * The cause of the failure */ diff --git a/server/src/main/java/com/vaadin/data/util/sqlcontainer/OptimisticLockException.java b/server/src/main/java/com/vaadin/data/util/sqlcontainer/OptimisticLockException.java index ed8eb3c0ff..3c918a2e7b 100644 --- a/server/src/main/java/com/vaadin/data/util/sqlcontainer/OptimisticLockException.java +++ b/server/src/main/java/com/vaadin/data/util/sqlcontainer/OptimisticLockException.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,14 +20,14 @@ import com.vaadin.data.util.sqlcontainer.query.TableQuery; /** * An OptimisticLockException is thrown when trying to update or delete a row * that has been changed since last read from the database. - * + * * OptimisticLockException is a runtime exception because optimistic locking is * turned off by default, and as such will never be thrown in a default * configuration. In order to turn on optimistic locking, you need to specify * the version column in your TableQuery instance. - * + * * @see TableQuery#setVersionColumn(String) - * + * * @author Jonatan Kronqvist / Vaadin Ltd */ public class OptimisticLockException extends RuntimeException { diff --git a/server/src/main/java/com/vaadin/data/util/sqlcontainer/ReadOnlyRowId.java b/server/src/main/java/com/vaadin/data/util/sqlcontainer/ReadOnlyRowId.java index c845cadc7a..4f3ec470de 100644 --- a/server/src/main/java/com/vaadin/data/util/sqlcontainer/ReadOnlyRowId.java +++ b/server/src/main/java/com/vaadin/data/util/sqlcontainer/ReadOnlyRowId.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/server/src/main/java/com/vaadin/data/util/sqlcontainer/Reference.java b/server/src/main/java/com/vaadin/data/util/sqlcontainer/Reference.java index e82f63ad2f..933f70fbe7 100644 --- a/server/src/main/java/com/vaadin/data/util/sqlcontainer/Reference.java +++ b/server/src/main/java/com/vaadin/data/util/sqlcontainer/Reference.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/server/src/main/java/com/vaadin/data/util/sqlcontainer/RowId.java b/server/src/main/java/com/vaadin/data/util/sqlcontainer/RowId.java index 79c16b0f60..571bb48711 100644 --- a/server/src/main/java/com/vaadin/data/util/sqlcontainer/RowId.java +++ b/server/src/main/java/com/vaadin/data/util/sqlcontainer/RowId.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,7 +20,7 @@ import java.util.Arrays; /** * RowId represents identifiers of a single database result set row. - * + * * The data structure of a RowId is an Object array which contains the values of * the primary key columns of the identified row. This allows easy equals() * -comparison of RowItems. @@ -37,7 +37,8 @@ public class RowId implements Serializable { public RowId(Object... id) { if (id == null) { - throw new IllegalArgumentException("id parameter must not be null!"); + throw new IllegalArgumentException( + "id parameter must not be null!"); } this.id = id; } diff --git a/server/src/main/java/com/vaadin/data/util/sqlcontainer/RowItem.java b/server/src/main/java/com/vaadin/data/util/sqlcontainer/RowItem.java index ddb5de1d31..e0d07f2ab1 100644 --- a/server/src/main/java/com/vaadin/data/util/sqlcontainer/RowItem.java +++ b/server/src/main/java/com/vaadin/data/util/sqlcontainer/RowItem.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -24,7 +24,7 @@ import com.vaadin.data.Property; /** * RowItem represents one row of a result set obtained from a QueryDelegate. - * + * * Note that depending on the QueryDelegate in use this does not necessarily map * into an actual row in a database table. */ diff --git a/server/src/main/java/com/vaadin/data/util/sqlcontainer/SQLContainer.java b/server/src/main/java/com/vaadin/data/util/sqlcontainer/SQLContainer.java index 86e9069e90..189e77abb5 100644 --- a/server/src/main/java/com/vaadin/data/util/sqlcontainer/SQLContainer.java +++ b/server/src/main/java/com/vaadin/data/util/sqlcontainer/SQLContainer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -100,7 +100,9 @@ public class SQLContainer implements Container, Container.Filterable, /** ItemSetChangeListeners */ private LinkedList itemSetChangeListeners; - /** Temporary storage for modified items and items to be removed and added */ + /** + * Temporary storage for modified items and items to be removed and added + */ private final Map removedItems = new HashMap(); private final List addedItems = new ArrayList(); private final List modifiedItems = new ArrayList(); @@ -120,7 +122,7 @@ public class SQLContainer implements Container, Container.Filterable, /** * Creates and initializes SQLContainer using the given QueryDelegate - * + * * @param delegate * QueryDelegate implementation * @throws SQLException @@ -144,7 +146,7 @@ public class SQLContainer implements Container, Container.Filterable, * temporary row ID assigned for the item. Implement * QueryDelegate.RowIdChangeListener to receive the actual Row ID value * after the addition has been committed. - * + * * {@inheritDoc} */ @@ -205,7 +207,7 @@ public class SQLContainer implements Container, Container.Filterable, /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container#containsId(java.lang.Object) */ @@ -235,8 +237,8 @@ public class SQLContainer implements Container, Container.Filterable, if (itemId instanceof RowId && !(itemId instanceof TemporaryRowId)) { try { - return queryDelegate.containsRowWithKey(((RowId) itemId) - .getId()); + return queryDelegate + .containsRowWithKey(((RowId) itemId).getId()); } catch (Exception e) { /* Query failed, just return false. */ getLogger().log(Level.WARNING, "containsId query failed", e); @@ -247,7 +249,7 @@ public class SQLContainer implements Container, Container.Filterable, /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container#getContainerProperty(java.lang.Object, * java.lang.Object) */ @@ -263,7 +265,7 @@ public class SQLContainer implements Container, Container.Filterable, /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container#getContainerPropertyIds() */ @@ -274,7 +276,7 @@ public class SQLContainer implements Container, Container.Filterable, /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container#getItem(java.lang.Object) */ @@ -302,7 +304,7 @@ public class SQLContainer implements Container, Container.Filterable, /** * Bypasses in-memory filtering to return items that are cached in memory. * NOTE: This does not bypass database-level filtering. - * + * * @param itemId * the id of the item to retrieve. * @return the item represented by itemId. @@ -322,7 +324,7 @@ public class SQLContainer implements Container, Container.Filterable, * NOTE! Do not use this method if in any way avoidable. This method doesn't * (and cannot) use lazy loading, which means that all rows in the database * will be loaded into memory. - * + * * {@inheritDoc} */ @@ -357,8 +359,8 @@ public class SQLContainer implements Container, Container.Filterable, rs.close(); queryDelegate.commit(); } catch (SQLException e) { - getLogger().log(Level.WARNING, - "getItemIds() failed, rolling back.", e); + getLogger().log(Level.WARNING, "getItemIds() failed, rolling back.", + e); try { queryDelegate.rollback(); } catch (SQLException e1) { @@ -380,7 +382,7 @@ public class SQLContainer implements Container, Container.Filterable, /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container#getType(java.lang.Object) */ @@ -394,7 +396,7 @@ public class SQLContainer implements Container, Container.Filterable, /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container#size() */ @@ -406,7 +408,7 @@ public class SQLContainer implements Container, Container.Filterable, /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container#removeItem(java.lang.Object) */ @@ -475,7 +477,7 @@ public class SQLContainer implements Container, Container.Filterable, /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container#removeAllItems() */ @@ -570,8 +572,8 @@ public class SQLContainer implements Container, Container.Filterable, } /* Generate Filter -object */ - String likeStr = onlyMatchPrefix ? filterString + "%" : "%" - + filterString + "%"; + String likeStr = onlyMatchPrefix ? filterString + "%" + : "%" + filterString + "%"; Like like = new Like(propertyId.toString(), likeStr); like.setCaseSensitive(!ignoreCase); filters.add(like); @@ -603,7 +605,7 @@ public class SQLContainer implements Container, Container.Filterable, /** * Returns true if any filters have been applied to the container. - * + * * @return true if the container has filters applied, false otherwise * @since 7.1 */ @@ -613,7 +615,7 @@ public class SQLContainer implements Container, Container.Filterable, /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container.Filterable#getContainerFilters() */ @Override @@ -627,7 +629,7 @@ public class SQLContainer implements Container, Container.Filterable, /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container.Indexed#indexOfId(java.lang.Object) */ @@ -686,15 +688,15 @@ public class SQLContainer implements Container, Container.Filterable, /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container.Indexed#getIdByIndex(int) */ @Override public Object getIdByIndex(int index) { if (index < 0) { - throw new IndexOutOfBoundsException("Index is negative! index=" - + index); + throw new IndexOutOfBoundsException( + "Index is negative! index=" + index); } // make sure the size field is valid updateCount(); @@ -716,8 +718,8 @@ public class SQLContainer implements Container, Container.Filterable, @Override public List getItemIds(int startIndex, int numberOfIds) { // TODO create a better implementation - return (List) ContainerHelpers.getItemIdsUsingGetIdByIndex( - startIndex, numberOfIds, this); + return (List) ContainerHelpers + .getItemIdsUsingGetIdByIndex(startIndex, numberOfIds, this); } /**********************************************/ @@ -726,7 +728,7 @@ public class SQLContainer implements Container, Container.Filterable, /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container.Ordered#nextItemId(java.lang.Object) */ @@ -742,7 +744,7 @@ public class SQLContainer implements Container, Container.Filterable, /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container.Ordered#prevItemId(java.lang.Object) */ @@ -758,7 +760,7 @@ public class SQLContainer implements Container, Container.Filterable, /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container.Ordered#firstItemId() */ @@ -787,7 +789,7 @@ public class SQLContainer implements Container, Container.Filterable, /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container.Ordered#lastItemId() */ @@ -814,7 +816,7 @@ public class SQLContainer implements Container, Container.Filterable, /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container.Ordered#isFirstId(java.lang.Object) */ @@ -825,7 +827,7 @@ public class SQLContainer implements Container, Container.Filterable, /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container.Ordered#isLastId(java.lang.Object) */ @@ -840,7 +842,7 @@ public class SQLContainer implements Container, Container.Filterable, /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container.Sortable#sort(java.lang.Object[], * boolean[]) */ @@ -871,7 +873,7 @@ public class SQLContainer implements Container, Container.Filterable, /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container.Sortable#getSortableContainerPropertyIds() */ @@ -897,7 +899,7 @@ public class SQLContainer implements Container, Container.Filterable, * false, assumes that the current size is up to date. This is * used in {@link #updateCount()} to refresh the contents when we know the * size was just updated. - * + * * @param setSizeDirty */ private void refresh(boolean setSizeDirty) { @@ -912,7 +914,7 @@ public class SQLContainer implements Container, Container.Filterable, /** * Returns modify state of the container. - * + * * @return true if contents of this container have been modified */ public boolean isModified() { @@ -924,7 +926,7 @@ public class SQLContainer implements Container, Container.Filterable, * Set auto commit mode enabled or disabled. Auto commit mode means that all * changes made to items of this container will be immediately written to * the underlying data source. - * + * * @param autoCommitEnabled * true to enable auto commit mode */ @@ -934,7 +936,7 @@ public class SQLContainer implements Container, Container.Filterable, /** * Returns status of the auto commit mode. - * + * * @return true if auto commit mode is enabled */ public boolean isAutoCommit() { @@ -943,7 +945,7 @@ public class SQLContainer implements Container, Container.Filterable, /** * Returns the currently set page length. - * + * * @return current page length */ public int getPageLength() { @@ -953,9 +955,9 @@ public class SQLContainer implements Container, Container.Filterable, /** * Sets the page length used in lazy fetching of items from the data source. * Also resets the cache size to match the new page length. - * + * * As a side effect the container will be refreshed. - * + * * @param pageLength * new page length */ @@ -966,7 +968,7 @@ public class SQLContainer implements Container, Container.Filterable, /** * Sets the page length internally, without refreshing the container. - * + * * @param pageLength * the new page length */ @@ -979,10 +981,10 @@ public class SQLContainer implements Container, Container.Filterable, /** * Adds the given OrderBy to this container and refreshes the container * contents with the new sorting rules. - * + * * Note that orderBy.getColumn() must return a column name that exists in * this container. - * + * * @param orderBy * OrderBy to be added to the container sorting rules */ @@ -1001,7 +1003,7 @@ public class SQLContainer implements Container, Container.Filterable, /** * Commits all the changes, additions and removals made to the items of this * container. - * + * * @throws UnsupportedOperationException * @throws SQLException */ @@ -1019,8 +1021,9 @@ public class SQLContainer implements Container, Container.Filterable, + item.getId()); } } catch (IllegalArgumentException e) { - throw new SQLException("Removal failed for row with ID: " - + item.getId(), e); + throw new SQLException( + "Removal failed for row with ID: " + item.getId(), + e); } } /* Perform buffered modifications */ @@ -1065,7 +1068,7 @@ public class SQLContainer implements Container, Container.Filterable, /** * Rolls back all the changes, additions and removals made to the items of * this container. - * + * * @throws UnsupportedOperationException * @throws SQLException */ @@ -1081,7 +1084,7 @@ public class SQLContainer implements Container, Container.Filterable, * Notifies this container that a property in the given item has been * modified. The change will be buffered or made instantaneously depending * on auto commit mode. - * + * * @param changedItem * item that has a modified property */ @@ -1124,7 +1127,7 @@ public class SQLContainer implements Container, Container.Filterable, * Determines a new offset for updating the row cache. The offset is * calculated from the given index, and will be fixed to match the start of * a page, based on the value of pageLength. - * + * * @param index * Index of the item that was requested, but not found in cache */ @@ -1149,9 +1152,8 @@ public class SQLContainer implements Container, Container.Filterable, * Fetches new count of rows from the data source, if needed. */ private void updateCount() { - if (!sizeDirty - && new Date().getTime() < sizeUpdated.getTime() - + sizeValidMilliSeconds) { + if (!sizeDirty && new Date().getTime() < sizeUpdated.getTime() + + sizeValidMilliSeconds) { return; } try { @@ -1175,8 +1177,8 @@ public class SQLContainer implements Container, Container.Filterable, // Size is up to date so don't set it back to dirty in refresh() refresh(false); } - getLogger().log(Level.FINER, - "Updated row count. New count is: {0}", size); + getLogger().log(Level.FINER, "Updated row count. New count is: {0}", + size); } catch (SQLException e) { throw new RuntimeException("Failed to update item set size.", e); } @@ -1185,7 +1187,7 @@ public class SQLContainer implements Container, Container.Filterable, /** * Fetches property id's (column names and their types) from the data * source. - * + * * @throws SQLException */ private void getPropertyIds() throws SQLException { @@ -1247,9 +1249,9 @@ public class SQLContainer implements Container, Container.Filterable, propertyPersistable.put(colName, persistable); propertyNullable.put(colName, rsmd.isNullable(i) == ResultSetMetaData.columnNullable); - propertyPrimaryKey.put(colName, queryDelegate - .getPrimaryKeyColumns() - .contains(rsmd.getColumnLabel(i))); + propertyPrimaryKey.put(colName, + queryDelegate.getPrimaryKeyColumns() + .contains(rsmd.getColumnLabel(i))); propertyTypes.put(colName, type); } rs.getStatement().close(); @@ -1371,8 +1373,8 @@ public class SQLContainer implements Container, Container.Filterable, if (modifiedIndex != -1) { cachedItems.put(id, modifiedItems.get(modifiedIndex)); } else { - cachedItems.put(id, new RowItem(this, id, - itemProperties)); + cachedItems.put(id, + new RowItem(this, id, itemProperties)); } rowCount++; @@ -1384,8 +1386,8 @@ public class SQLContainer implements Container, Container.Filterable, getLogger().log(Level.FINER, "Fetched {0} rows starting from {1}", new Object[] { fetchedRows, currentOffset }); } catch (SQLException e) { - getLogger().log(Level.WARNING, - "Failed to fetch rows, rolling back", e); + getLogger().log(Level.WARNING, "Failed to fetch rows, rolling back", + e); try { queryDelegate.rollback(); } catch (SQLException e1) { @@ -1408,7 +1410,7 @@ public class SQLContainer implements Container, Container.Filterable, /** * Returns the index of the item with the given itemId for the modified * cache. - * + * * @param itemId * @return the index of the item with the itemId in the modified cache. Or * -1 if not found. @@ -1453,7 +1455,7 @@ public class SQLContainer implements Container, Container.Filterable, * Currently the only non-valid identifier is "rownum" when MSSQL or Oracle * is used. This is due to the way the SELECT queries are constructed in * order to implement paging in these databases. - * + * * @param identifier * Column identifier * @return true if the identifier is valid @@ -1472,7 +1474,7 @@ public class SQLContainer implements Container, Container.Filterable, /** * Returns the QueryDelegate set for this SQLContainer. - * + * * @return current querydelegate */ protected QueryDelegate getQueryDelegate() { @@ -1485,7 +1487,7 @@ public class SQLContainer implements Container, Container.Filterable, /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container#addContainerProperty(java.lang.Object, * java.lang.Class, java.lang.Object) */ @@ -1498,7 +1500,7 @@ public class SQLContainer implements Container, Container.Filterable, /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container#removeContainerProperty(java.lang.Object) */ @@ -1510,7 +1512,7 @@ public class SQLContainer implements Container, Container.Filterable, /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container#addItem(java.lang.Object) */ @@ -1521,7 +1523,7 @@ public class SQLContainer implements Container, Container.Filterable, /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container.Ordered#addItemAfter(java.lang.Object, * java.lang.Object) */ @@ -1534,7 +1536,7 @@ public class SQLContainer implements Container, Container.Filterable, /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container.Indexed#addItemAt(int, java.lang.Object) */ @@ -1546,7 +1548,7 @@ public class SQLContainer implements Container, Container.Filterable, /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container.Indexed#addItemAt(int) */ @@ -1557,7 +1559,7 @@ public class SQLContainer implements Container, Container.Filterable, /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container.Ordered#addItemAfter(java.lang.Object) */ @@ -1573,7 +1575,7 @@ public class SQLContainer implements Container, Container.Filterable, /* * (non-Javadoc) - * + * * @see * com.vaadin.data.Container.ItemSetChangeNotifier#addListener(com.vaadin * .data.Container.ItemSetChangeListener) @@ -1600,7 +1602,7 @@ public class SQLContainer implements Container, Container.Filterable, /* * (non-Javadoc) - * + * * @see * com.vaadin.data.Container.ItemSetChangeNotifier#removeListener(com.vaadin * .data.Container.ItemSetChangeListener) @@ -1640,8 +1642,8 @@ public class SQLContainer implements Container, Container.Filterable, * Simple ItemSetChangeEvent implementation. */ @SuppressWarnings("serial") - public static class ItemSetChangeEvent extends EventObject implements - Container.ItemSetChangeEvent { + public static class ItemSetChangeEvent extends EventObject + implements Container.ItemSetChangeEvent { private ItemSetChangeEvent(SQLContainer source) { super(source); @@ -1659,7 +1661,7 @@ public class SQLContainer implements Container, Container.Filterable, /** * Adds a RowIdChangeListener to the QueryDelegate - * + * * @param listener */ public void addRowIdChangeListener(RowIdChangeListener listener) { @@ -1680,7 +1682,7 @@ public class SQLContainer implements Container, Container.Filterable, /** * Removes a RowIdChangeListener from the QueryDelegate - * + * * @param listener */ public void removeRowIdChangeListener(RowIdChangeListener listener) { @@ -1718,10 +1720,10 @@ public class SQLContainer implements Container, Container.Filterable, * Adds a new reference to the given SQLContainer. In addition to the * container you must provide the column (property) names used for the * reference in both this and the referenced SQLContainer. - * + * * Note that multiple references pointing to the same SQLContainer are not * supported. - * + * * @param refdCont * Target SQLContainer of the new reference * @param refingCol @@ -1758,7 +1760,7 @@ public class SQLContainer implements Container, Container.Filterable, /** * Removes the reference pointing to the given SQLContainer. - * + * * @param refdCont * Target SQLContainer of the reference * @return true if successful, false if the reference did not exist @@ -1774,7 +1776,7 @@ public class SQLContainer implements Container, Container.Filterable, /** * Sets the referenced item. The referencing column of the item in this * container is updated accordingly. - * + * * @param itemId * Item Id of the reference source (from this container) * @param refdItemId @@ -1796,20 +1798,20 @@ public class SQLContainer implements Container, Container.Filterable, "Reference to the given SQLContainer not defined."); } try { - getContainerProperty(itemId, r.getReferencingColumn()).setValue( - refdCont.getContainerProperty(refdItemId, + getContainerProperty(itemId, r.getReferencingColumn()) + .setValue(refdCont.getContainerProperty(refdItemId, r.getReferencedColumn())); return true; } catch (Exception e) { - getLogger() - .log(Level.WARNING, "Setting referenced item failed.", e); + getLogger().log(Level.WARNING, "Setting referenced item failed.", + e); return false; } } /** * Fetches the Item Id of the referenced item from the target SQLContainer. - * + * * @param itemId * Item Id of the reference source (from this container) * @param refdCont @@ -1838,7 +1840,7 @@ public class SQLContainer implements Container, Container.Filterable, /** * Fetches the referenced item from the target SQLContainer. - * + * * @param itemId * Item Id of the reference source (from this container) * @param refdCont @@ -1849,12 +1851,13 @@ public class SQLContainer implements Container, Container.Filterable, return refdCont.getItem(getReferencedItemId(itemId, refdCont)); } - private void writeObject(java.io.ObjectOutputStream out) throws IOException { + private void writeObject(java.io.ObjectOutputStream out) + throws IOException { out.defaultWriteObject(); } - private void readObject(java.io.ObjectInputStream in) throws IOException, - ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) + throws IOException, ClassNotFoundException { in.defaultReadObject(); if (notificationsEnabled) { /* diff --git a/server/src/main/java/com/vaadin/data/util/sqlcontainer/SQLUtil.java b/server/src/main/java/com/vaadin/data/util/sqlcontainer/SQLUtil.java index e5282c867a..1058828002 100644 --- a/server/src/main/java/com/vaadin/data/util/sqlcontainer/SQLUtil.java +++ b/server/src/main/java/com/vaadin/data/util/sqlcontainer/SQLUtil.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,15 +21,18 @@ public class SQLUtil implements Serializable { /** * Escapes different special characters in strings that are passed to SQL. * Replaces the following: - * - *
    • ' is replaced with ''
    • \x00 is removed
    • \ is - * replaced with \\
    • " is replaced with \"
    • - * \x1a is removed
    • - * + * + * + *
    • ' is replaced with ''
    • + *
    • \x00 is removed
    • + *
    • \ is replaced with \\
    • + *
    • " is replaced with \"
    • + *
    • \x1a is removed
    • + * * Also note! The escaping done here may or may not be enough to prevent any * and all SQL injections so it is recommended to check user input before * giving it to the SQLContainer/TableQuery. - * + * * @param constant * @return \\\'\' */ diff --git a/server/src/main/java/com/vaadin/data/util/sqlcontainer/TemporaryRowId.java b/server/src/main/java/com/vaadin/data/util/sqlcontainer/TemporaryRowId.java index ca2f25963e..3781451b9f 100644 --- a/server/src/main/java/com/vaadin/data/util/sqlcontainer/TemporaryRowId.java +++ b/server/src/main/java/com/vaadin/data/util/sqlcontainer/TemporaryRowId.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/server/src/main/java/com/vaadin/data/util/sqlcontainer/connection/J2EEConnectionPool.java b/server/src/main/java/com/vaadin/data/util/sqlcontainer/connection/J2EEConnectionPool.java index acad5beed9..b4c63cabc0 100644 --- a/server/src/main/java/com/vaadin/data/util/sqlcontainer/connection/J2EEConnectionPool.java +++ b/server/src/main/java/com/vaadin/data/util/sqlcontainer/connection/J2EEConnectionPool.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -70,8 +70,8 @@ public class J2EEConnectionPool implements JDBCConnectionPool { try { conn.close(); } catch (SQLException e) { - Logger.getLogger(J2EEConnectionPool.class.getName()).log( - Level.FINE, "Could not release SQL connection", e); + Logger.getLogger(J2EEConnectionPool.class.getName()) + .log(Level.FINE, "Could not release SQL connection", e); } } } diff --git a/server/src/main/java/com/vaadin/data/util/sqlcontainer/connection/JDBCConnectionPool.java b/server/src/main/java/com/vaadin/data/util/sqlcontainer/connection/JDBCConnectionPool.java index 11669075a3..969aa35eca 100644 --- a/server/src/main/java/com/vaadin/data/util/sqlcontainer/connection/JDBCConnectionPool.java +++ b/server/src/main/java/com/vaadin/data/util/sqlcontainer/connection/JDBCConnectionPool.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,7 +25,7 @@ import java.sql.SQLException; public interface JDBCConnectionPool extends Serializable { /** * Retrieves a connection. - * + * * @return a usable connection to the database * @throws SQLException */ @@ -33,10 +33,10 @@ public interface JDBCConnectionPool extends Serializable { /** * Releases a connection that was retrieved earlier. - * + * * Note that depending on implementation, the transaction possibly open in * the connection may or may not be rolled back. - * + * * @param conn * Connection to be released */ @@ -45,7 +45,7 @@ public interface JDBCConnectionPool extends Serializable { /** * Destroys the connection pool: close() is called an all the connections in * the pool, whether available or reserved. - * + * * This method was added to fix PostgreSQL -related issues with connections * that were left hanging 'idle'. */ diff --git a/server/src/main/java/com/vaadin/data/util/sqlcontainer/connection/SimpleJDBCConnectionPool.java b/server/src/main/java/com/vaadin/data/util/sqlcontainer/connection/SimpleJDBCConnectionPool.java index 57ea188cb4..da797f98ef 100644 --- a/server/src/main/java/com/vaadin/data/util/sqlcontainer/connection/SimpleJDBCConnectionPool.java +++ b/server/src/main/java/com/vaadin/data/util/sqlcontainer/connection/SimpleJDBCConnectionPool.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -172,7 +172,8 @@ public class SimpleJDBCConnectionPool implements JDBCConnectionPool { } - private void writeObject(java.io.ObjectOutputStream out) throws IOException { + private void writeObject(java.io.ObjectOutputStream out) + throws IOException { initialized = false; out.defaultWriteObject(); } diff --git a/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/AbstractTransactionalQuery.java b/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/AbstractTransactionalQuery.java index e7fd9f4aa4..9094feec4f 100644 --- a/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/AbstractTransactionalQuery.java +++ b/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/AbstractTransactionalQuery.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -27,7 +27,7 @@ import com.vaadin.data.util.sqlcontainer.connection.JDBCConnectionPool; /** * Common base class for database query classes that handle connections and * transactions. - * + * * @author Vaadin Ltd * @since 6.8.9 */ @@ -46,14 +46,14 @@ public abstract class AbstractTransactionalQuery implements Serializable { /** * Reserves a connection with auto-commit off if no transaction is in * progress. - * + * * @throws IllegalStateException * if a transaction is already open * @throws SQLException * if a connection could not be obtained or configured */ - public void beginTransaction() throws UnsupportedOperationException, - SQLException { + public void beginTransaction() + throws UnsupportedOperationException, SQLException { if (isInTransaction()) { throw new IllegalStateException("A transaction is already active!"); } @@ -63,7 +63,7 @@ public abstract class AbstractTransactionalQuery implements Serializable { /** * Commits (if not in auto-commit mode) and releases the active connection. - * + * * @throws SQLException * if not in a transaction managed by this query */ @@ -80,7 +80,7 @@ public abstract class AbstractTransactionalQuery implements Serializable { /** * Rolls back and releases the active connection. - * + * * @throws SQLException * if not in a transaction managed by this query */ @@ -95,7 +95,7 @@ public abstract class AbstractTransactionalQuery implements Serializable { /** * Check that a transaction is active. - * + * * @throws SQLException * if no active transaction */ @@ -109,17 +109,17 @@ public abstract class AbstractTransactionalQuery implements Serializable { * Closes a statement and a resultset, then releases the connection if it is * not part of an active transaction. A failure in closing one of the * parameters does not prevent closing the rest. - * + * * If the statement is a {@link PreparedStatement}, its parameters are * cleared prior to closing the statement. - * + * * Although JDBC specification does state that closing a statement closes * its result set and closing a connection closes statements and result * sets, this method does try to close the result set and statement * explicitly whenever not null. This can guard against bugs in certain JDBC * drivers and reduce leaks in case e.g. closing the result set succeeds but * closing the statement or connection fails. - * + * * @param conn * the connection to release * @param statement @@ -156,7 +156,7 @@ public abstract class AbstractTransactionalQuery implements Serializable { /** * Returns the currently active connection, reserves and returns a new * connection if no active connection. - * + * * @return previously active or newly reserved connection * @throws SQLException */ @@ -173,7 +173,7 @@ public abstract class AbstractTransactionalQuery implements Serializable { /** * Releases the connection if it is not part of an active transaction. - * + * * @param conn * the connection to release */ diff --git a/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/FreeformQuery.java b/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/FreeformQuery.java index 6b800cb965..a86aacaee7 100644 --- a/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/FreeformQuery.java +++ b/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/FreeformQuery.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -34,8 +34,8 @@ import com.vaadin.data.util.sqlcontainer.query.generator.StatementHelper; import com.vaadin.data.util.sqlcontainer.query.generator.filter.QueryBuilder; @SuppressWarnings("serial") -public class FreeformQuery extends AbstractTransactionalQuery implements - QueryDelegate { +public class FreeformQuery extends AbstractTransactionalQuery + implements QueryDelegate { FreeformQueryDelegate delegate = null; private String queryString; @@ -51,7 +51,7 @@ public class FreeformQuery extends AbstractTransactionalQuery implements /** * Creates a new freeform query delegate to be used with the * {@link SQLContainer}. - * + * * @param queryString * The actual query to perform. * @param primaryKeyColumns @@ -88,7 +88,7 @@ public class FreeformQuery extends AbstractTransactionalQuery implements /** * Creates a new freeform query delegate to be used with the * {@link SQLContainer}. - * + * * @param queryString * The actual query to perform. * @param connectionPool @@ -107,7 +107,7 @@ public class FreeformQuery extends AbstractTransactionalQuery implements * This implementation of getCount() actually fetches all records from the * database, which might be a performance issue. Override this method with a * SELECT COUNT(*) ... query if this is too slow for your needs. - * + * * {@inheritDoc} */ @Override @@ -204,14 +204,15 @@ public class FreeformQuery extends AbstractTransactionalQuery implements * order to support lazy loading of records, you must supply a * FreeformQueryDelegate that implements the * FreeformQueryDelegate.getQueryString(int,int) method. - * + * * @throws SQLException - * + * * @see FreeformQueryDelegate#getQueryString(int, int) */ @Override @SuppressWarnings({ "deprecation", "finally" }) - public ResultSet getResults(int offset, int pagelength) throws SQLException { + public ResultSet getResults(int offset, int pagelength) + throws SQLException { ensureTransaction(); String query = queryString; if (delegate != null) { @@ -220,8 +221,8 @@ public class FreeformQuery extends AbstractTransactionalQuery implements try { StatementHelper sh = ((FreeformStatementDelegate) delegate) .getQueryStatement(offset, pagelength); - PreparedStatement pstmt = getConnection().prepareStatement( - sh.getQueryString()); + PreparedStatement pstmt = getConnection() + .prepareStatement(sh.getQueryString()); sh.setParameterValuesToStatement(pstmt); return pstmt.executeQuery(); } catch (UnsupportedOperationException e) { @@ -279,7 +280,7 @@ public class FreeformQuery extends AbstractTransactionalQuery implements /* * (non-Javadoc) - * + * * @see * com.vaadin.data.util.sqlcontainer.query.QueryDelegate#setFilters(java * .util.List) @@ -297,7 +298,7 @@ public class FreeformQuery extends AbstractTransactionalQuery implements /* * (non-Javadoc) - * + * * @see * com.vaadin.data.util.sqlcontainer.query.QueryDelegate#setOrderBy(java * .util.List) @@ -315,7 +316,7 @@ public class FreeformQuery extends AbstractTransactionalQuery implements /* * (non-Javadoc) - * + * * @see * com.vaadin.data.util.sqlcontainer.query.QueryDelegate#storeRow(com.vaadin * .data.util.sqlcontainer.RowItem) @@ -338,10 +339,9 @@ public class FreeformQuery extends AbstractTransactionalQuery implements /* * (non-Javadoc) - * - * @see - * com.vaadin.data.util.sqlcontainer.query.QueryDelegate#removeRow(com.vaadin - * .data.util.sqlcontainer.RowItem) + * + * @see com.vaadin.data.util.sqlcontainer.query.QueryDelegate#removeRow(com. + * vaadin .data.util.sqlcontainer.RowItem) */ @Override public boolean removeRow(RowItem row) throws SQLException { @@ -366,23 +366,22 @@ public class FreeformQuery extends AbstractTransactionalQuery implements } @Override - public synchronized void commit() throws UnsupportedOperationException, - SQLException { + public synchronized void commit() + throws UnsupportedOperationException, SQLException { super.commit(); } @Override - public synchronized void rollback() throws UnsupportedOperationException, - SQLException { + public synchronized void rollback() + throws UnsupportedOperationException, SQLException { super.rollback(); } /* * (non-Javadoc) - * - * @see - * com.vaadin.data.util.sqlcontainer.query.QueryDelegate#getPrimaryKeyColumns - * () + * + * @see com.vaadin.data.util.sqlcontainer.query.QueryDelegate# + * getPrimaryKeyColumns () */ @Override public List getPrimaryKeyColumns() { @@ -408,9 +407,9 @@ public class FreeformQuery extends AbstractTransactionalQuery implements * situations where this logic is not enough, you can implement the * getContainsRowQueryString method in FreeformQueryDelegate and this will * be used instead of the logic. - * + * * @see FreeformQueryDelegate#getContainsRowQueryString(Object...) - * + * */ @Override @SuppressWarnings("deprecation") @@ -485,7 +484,8 @@ public class FreeformQuery extends AbstractTransactionalQuery implements return queryString + " WHERE " + where; } - private void writeObject(java.io.ObjectOutputStream out) throws IOException { + private void writeObject(java.io.ObjectOutputStream out) + throws IOException { try { rollback(); } catch (SQLException ignored) { diff --git a/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/FreeformQueryDelegate.java b/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/FreeformQueryDelegate.java index b6fa56055d..3830170eba 100644 --- a/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/FreeformQueryDelegate.java +++ b/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/FreeformQueryDelegate.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -28,7 +28,7 @@ public interface FreeformQueryDelegate extends Serializable { * Should return the SQL query string to be performed. This method is * responsible for gluing together the select query from the filters and the * order by conditions if these are supported. - * + * * @param offset * the first record (row) to fetch. * @param pagelength @@ -45,7 +45,7 @@ public interface FreeformQueryDelegate extends Serializable { * Generates and executes a query to determine the current row count from * the DB. Row count will be fetched using filters that are currently set to * the QueryDelegate. - * + * * @return row count * @throws SQLException * @deprecated As of 6.7. Implement {@link FreeformStatementDelegate} @@ -57,7 +57,7 @@ public interface FreeformQueryDelegate extends Serializable { /** * Sets the filters to apply when performing the SQL query. These are * translated into a WHERE clause. Default filtering mode will be used. - * + * * @param filters * The filters to apply. * @throws UnsupportedOperationException @@ -71,7 +71,7 @@ public interface FreeformQueryDelegate extends Serializable { * can be ordered by zero or more columns and each column can be in * ascending or descending order. These are translated into an ORDER BY * clause in the SQL query. - * + * * @param orderBys * A list of the OrderBy conditions. * @throws UnsupportedOperationException @@ -84,7 +84,7 @@ public interface FreeformQueryDelegate extends Serializable { * Stores a row in the database. The implementation of this interface * decides how to identify whether to store a new row or update an existing * one. - * + * * @param conn * the JDBC connection to use * @param row @@ -98,7 +98,7 @@ public interface FreeformQueryDelegate extends Serializable { /** * Removes the given RowItem from the database. - * + * * @param conn * the JDBC connection to use * @param row @@ -116,7 +116,7 @@ public interface FreeformQueryDelegate extends Serializable { * FreeformQuery.containsRowWithKeys() method. This is useful for cases when * the logic in the containsRowWithKeys method is not enough to support more * complex free form queries. - * + * * @param keys * the values of the primary keys * @throws UnsupportedOperationException diff --git a/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/FreeformStatementDelegate.java b/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/FreeformStatementDelegate.java index 9df72f5b98..1c666dd259 100644 --- a/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/FreeformStatementDelegate.java +++ b/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/FreeformStatementDelegate.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -22,7 +22,7 @@ import com.vaadin.data.util.sqlcontainer.query.generator.StatementHelper; * provides definitions for methods that produce StatementHelper objects instead * of basic query strings. This allows the FreeformQuery query delegate to use * PreparedStatements instead of regular Statement when accessing the database. - * + * * Due to the injection protection and other benefits of prepared statements, it * is advisable to implement this interface instead of the FreeformQueryDelegate * whenever possible. @@ -33,7 +33,7 @@ public interface FreeformStatementDelegate extends FreeformQueryDelegate { * string and parameter values required to create a PreparedStatement. This * method is responsible for gluing together the select query from the * filters and the order by conditions if these are supported. - * + * * @param offset * the first record (row) to fetch. * @param pagelength @@ -58,7 +58,7 @@ public interface FreeformStatementDelegate extends FreeformQueryDelegate { * by the FreeformQuery.containsRowWithKeys() method. This is useful for * cases when the default logic in said method is not enough to support more * complex free form queries. - * + * * @param keys * the values of the primary keys * @throws UnsupportedOperationException diff --git a/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/OrderBy.java b/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/OrderBy.java index 2bafa5dc0c..1b014bdda1 100644 --- a/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/OrderBy.java +++ b/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/OrderBy.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,7 +20,7 @@ import java.io.Serializable; /** * OrderBy represents a sorting rule to be applied to a query made by the * SQLContainer's QueryDelegate. - * + * * The sorting rule is simple and contains only the affected column's name and * the direction of the sort. */ diff --git a/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/QueryDelegate.java b/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/QueryDelegate.java index 413dd55ab9..ab4cf0cd90 100644 --- a/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/QueryDelegate.java +++ b/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/QueryDelegate.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -29,7 +29,7 @@ public interface QueryDelegate extends Serializable { * Generates and executes a query to determine the current row count from * the DB. Row count will be fetched using filters that are currently set to * the QueryDelegate. - * + * * @return row count * @throws SQLException */ @@ -38,7 +38,7 @@ public interface QueryDelegate extends Serializable { /** * Executes a paged SQL query and returns the ResultSet. The query is * defined through implementations of this QueryDelegate interface. - * + * * @param offset * the first item of the page to load * @param pagelength @@ -52,9 +52,9 @@ public interface QueryDelegate extends Serializable { /** * Allows the SQLContainer implementation to check whether the QueryDelegate * implementation implements paging in the getResults method. - * + * * @see QueryDelegate#getResults(int, int) - * + * * @return true if the delegate implements paging */ public boolean implementationRespectsPagingLimits(); @@ -62,7 +62,7 @@ public interface QueryDelegate extends Serializable { /** * Sets the filters to apply when performing the SQL query. These are * translated into a WHERE clause. Default filtering mode will be used. - * + * * @param filters * The filters to apply. * @throws UnsupportedOperationException @@ -76,7 +76,7 @@ public interface QueryDelegate extends Serializable { * can be ordered by zero or more columns and each column can be in * ascending or descending order. These are translated into an ORDER BY * clause in the SQL query. - * + * * @param orderBys * A list of the OrderBy conditions. * @throws UnsupportedOperationException @@ -89,7 +89,7 @@ public interface QueryDelegate extends Serializable { * Stores a row in the database. The implementation of this interface * decides how to identify whether to store a new row or update an existing * one. - * + * * @param columnToValueMap * A map containing the values for all columns to be stored or * updated. @@ -97,27 +97,27 @@ public interface QueryDelegate extends Serializable { * @throws UnsupportedOperationException * if the implementation is read only. */ - public int storeRow(RowItem row) throws UnsupportedOperationException, - SQLException; + public int storeRow(RowItem row) + throws UnsupportedOperationException, SQLException; /** * Removes the given RowItem from the database. - * + * * @param row * RowItem to be removed * @return true on success * @throws UnsupportedOperationException * @throws SQLException */ - public boolean removeRow(RowItem row) throws UnsupportedOperationException, - SQLException; + public boolean removeRow(RowItem row) + throws UnsupportedOperationException, SQLException; /** * Starts a new database transaction. Used when storing multiple changes. - * + * * Note that if a transaction is already open, it will be rolled back when a * new transaction is started. - * + * * @throws SQLException * if the database access fails. */ @@ -126,7 +126,7 @@ public interface QueryDelegate extends Serializable { /** * Commits a transaction. If a transaction is not open nothing should * happen. - * + * * @throws SQLException * if the database access fails. */ @@ -135,7 +135,7 @@ public interface QueryDelegate extends Serializable { /** * Rolls a transaction back. If a transaction is not open nothing should * happen. - * + * * @throws SQLException * if the database access fails. */ @@ -145,7 +145,7 @@ public interface QueryDelegate extends Serializable { * Returns a list of primary key column names. The list is either fetched * from the database (TableQuery) or given as an argument depending on * implementation. - * + * * @return */ public List getPrimaryKeyColumns(); @@ -153,7 +153,7 @@ public interface QueryDelegate extends Serializable { /** * Performs a query to find out whether the SQL table contains a row with * the given set of primary keys. - * + * * @param keys * the primary keys * @return true if the SQL table contains a row with the provided keys @@ -173,7 +173,7 @@ public interface QueryDelegate extends Serializable { /** * Gets the old (temporary) RowId of the added row that raised this * event. - * + * * @return old RowId */ public RowId getOldRowId(); @@ -181,7 +181,7 @@ public interface QueryDelegate extends Serializable { /** * Gets the new, possibly database assigned RowId of the added row that * raised this event. - * + * * @return new RowId */ public RowId getNewRowId(); @@ -191,7 +191,7 @@ public interface QueryDelegate extends Serializable { public interface RowIdChangeListener extends Serializable { /** * Lets the listener know that a RowId has been changed. - * + * * @param event */ public void rowIdChange(QueryDelegate.RowIdChangeEvent event); @@ -206,7 +206,7 @@ public interface QueryDelegate extends Serializable { public interface RowIdChangeNotifier extends Serializable { /** * Adds a RowIdChangeListener for the object. - * + * * @param listener * listener to be added */ @@ -222,7 +222,7 @@ public interface QueryDelegate extends Serializable { /** * Removes the specified RowIdChangeListener from the object. - * + * * @param listener * listener to be removed */ diff --git a/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/TableQuery.java b/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/TableQuery.java index 9a41766a31..4e28b5d4e4 100644 --- a/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/TableQuery.java +++ b/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/TableQuery.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -47,8 +47,8 @@ import com.vaadin.data.util.sqlcontainer.query.generator.SQLGenerator; import com.vaadin.data.util.sqlcontainer.query.generator.StatementHelper; @SuppressWarnings("serial") -public class TableQuery extends AbstractTransactionalQuery implements - QueryDelegate, QueryDelegate.RowIdChangeNotifier { +public class TableQuery extends AbstractTransactionalQuery + implements QueryDelegate, QueryDelegate.RowIdChangeNotifier { /** * Table name (without catalog or schema information). @@ -87,12 +87,12 @@ public class TableQuery extends AbstractTransactionalQuery implements /** * Creates a new TableQuery using the given connection pool, SQL generator * and table name to fetch the data from. All parameters must be non-null. - * + * * The table name must be a simple name with no catalog or schema * information. If those are needed, use * {@link #TableQuery(String, String, String, JDBCConnectionPool, SQLGenerator)} * . - * + * * @param tableName * Name of the database table to connect to * @param connectionPool @@ -109,7 +109,7 @@ public class TableQuery extends AbstractTransactionalQuery implements * Creates a new TableQuery using the given connection pool, SQL generator * and table name to fetch the data from. Catalog and schema names can be * null, all other parameters must be non-null. - * + * * @param catalogName * Name of the database catalog (can be null) * @param schemaName @@ -132,12 +132,12 @@ public class TableQuery extends AbstractTransactionalQuery implements * Creates a new TableQuery using the given connection pool and table name * to fetch the data from. All parameters must be non-null. The default SQL * generator will be used for queries. - * + * * The table name must be a simple name with no catalog or schema * information. If those are needed, use * {@link #TableQuery(String, String, String, JDBCConnectionPool, SQLGenerator)} * . - * + * * @param tableName * Name of the database table to connect to * @param connectionPool @@ -151,7 +151,7 @@ public class TableQuery extends AbstractTransactionalQuery implements * Creates a new TableQuery using the given connection pool, SQL generator * and table name to fetch the data from. Catalog and schema names can be * null, all other parameters must be non-null. - * + * * @param catalogName * Name of the database catalog (can be null) * @param schemaName @@ -191,7 +191,7 @@ public class TableQuery extends AbstractTransactionalQuery implements /* * (non-Javadoc) - * + * * @see com.vaadin.addon.sqlcontainer.query.QueryDelegate#getCount() */ @Override @@ -227,12 +227,13 @@ public class TableQuery extends AbstractTransactionalQuery implements /* * (non-Javadoc) - * + * * @see com.vaadin.addon.sqlcontainer.query.QueryDelegate#getResults(int, * int) */ @Override - public ResultSet getResults(int offset, int pagelength) throws SQLException { + public ResultSet getResults(int offset, int pagelength) + throws SQLException { StatementHelper sh; /* * If no ordering is explicitly set, results will be ordered by the @@ -254,7 +255,7 @@ public class TableQuery extends AbstractTransactionalQuery implements /* * (non-Javadoc) - * + * * @see com.vaadin.addon.sqlcontainer.query.QueryDelegate# * implementationRespectsPagingLimits() */ @@ -265,16 +266,17 @@ public class TableQuery extends AbstractTransactionalQuery implements /* * (non-Javadoc) - * + * * @see * com.vaadin.addon.sqlcontainer.query.QueryDelegate#storeRow(com.vaadin * .addon.sqlcontainer.RowItem) */ @Override - public int storeRow(RowItem row) throws UnsupportedOperationException, - SQLException { + public int storeRow(RowItem row) + throws UnsupportedOperationException, SQLException { if (row == null) { - throw new IllegalArgumentException("Row argument must be non-null."); + throw new IllegalArgumentException( + "Row argument must be non-null."); } StatementHelper sh; int result = 0; @@ -309,7 +311,7 @@ public class TableQuery extends AbstractTransactionalQuery implements * solve the problem of returning the final RowId immediately on the * SQLContainer.addItem() call when auto commit mode is enabled in the * SQLContainer. - * + * * @param row * RowItem to add to the database * @return Final RowId of the added row @@ -320,8 +322,8 @@ public class TableQuery extends AbstractTransactionalQuery implements /* Set version column, if one is provided */ setVersionColumnFlagInProperty(row); /* Generate query */ - StatementHelper sh = sqlGenerator.generateInsertQuery( - getFullTableName(), row); + StatementHelper sh = sqlGenerator + .generateInsertQuery(getFullTableName(), row); Connection connection = null; PreparedStatement pstmt = null; ResultSet generatedKeys = null; @@ -351,7 +353,7 @@ public class TableQuery extends AbstractTransactionalQuery implements /* * (non-Javadoc) - * + * * @see * com.vaadin.addon.sqlcontainer.query.QueryDelegate#setFilters(java.util * .List) @@ -368,7 +370,7 @@ public class TableQuery extends AbstractTransactionalQuery implements /* * (non-Javadoc) - * + * * @see * com.vaadin.addon.sqlcontainer.query.QueryDelegate#setOrderBy(java.util * .List) @@ -385,19 +387,19 @@ public class TableQuery extends AbstractTransactionalQuery implements /* * (non-Javadoc) - * + * * @see com.vaadin.addon.sqlcontainer.query.QueryDelegate#beginTransaction() */ @Override - public void beginTransaction() throws UnsupportedOperationException, - SQLException { + public void beginTransaction() + throws UnsupportedOperationException, SQLException { getLogger().log(Level.FINE, "DB -> begin transaction"); super.beginTransaction(); } /* * (non-Javadoc) - * + * * @see com.vaadin.addon.sqlcontainer.query.QueryDelegate#commit() */ @Override @@ -420,7 +422,7 @@ public class TableQuery extends AbstractTransactionalQuery implements /* * (non-Javadoc) - * + * * @see com.vaadin.addon.sqlcontainer.query.QueryDelegate#rollback() */ @Override @@ -431,7 +433,7 @@ public class TableQuery extends AbstractTransactionalQuery implements /* * (non-Javadoc) - * + * * @see * com.vaadin.addon.sqlcontainer.query.QueryDelegate#getPrimaryKeyColumns() */ @@ -451,7 +453,7 @@ public class TableQuery extends AbstractTransactionalQuery implements /** * Returns the table name for the query without catalog and schema * information. - * + * * @return table name, not null */ public String getTableName() { @@ -460,7 +462,7 @@ public class TableQuery extends AbstractTransactionalQuery implements /** * Returns the catalog name for the query. - * + * * @return catalog name, can be null * @since 7.1 */ @@ -470,7 +472,7 @@ public class TableQuery extends AbstractTransactionalQuery implements /** * Returns the catalog name for the query. - * + * * @return catalog name, can be null * @since 7.1 */ @@ -481,9 +483,9 @@ public class TableQuery extends AbstractTransactionalQuery implements /** * Returns the complete table name obtained by concatenation of the catalog * and schema names (if any) and the table name. - * + * * This method can be overridden if customization is needed. - * + * * @return table name in the form it should be used in query and update * statements * @since 7.1 @@ -511,7 +513,7 @@ public class TableQuery extends AbstractTransactionalQuery implements * Executes the given query string using either the active connection if a * transaction is already open, or a new connection from this query's * connection pool. - * + * * @param sh * an instance of StatementHelper, containing the query string * and parameter values. @@ -537,7 +539,7 @@ public class TableQuery extends AbstractTransactionalQuery implements * Executes the given update query string using either the active connection * if a transaction is already open, or a new connection from this query's * connection pool. - * + * * @param sh * an instance of StatementHelper, containing the query string * and parameter values. @@ -563,9 +565,9 @@ public class TableQuery extends AbstractTransactionalQuery implements * Executes the given update query string using either the active connection * if a transaction is already open, or a new connection from this query's * connection pool. - * + * * Additionally adds a new RowIdChangeEvent to the event buffer. - * + * * @param sh * an instance of StatementHelper, containing the query string * and parameter values. @@ -597,7 +599,7 @@ public class TableQuery extends AbstractTransactionalQuery implements /** * Fetches name(s) of primary key column(s) from DB metadata. - * + * * Also tries to get the escape string to be used in search strings. */ private void fetchMetaData() { @@ -611,16 +613,15 @@ public class TableQuery extends AbstractTransactionalQuery implements tables = dbmd.getTables(catalogName, schemaName, tableName, null); if (!tables.next()) { - String catalog = (catalogName != null) ? catalogName - .toUpperCase() : null; - String schema = (schemaName != null) ? schemaName - .toUpperCase() : null; + String catalog = (catalogName != null) + ? catalogName.toUpperCase() : null; + String schema = (schemaName != null) + ? schemaName.toUpperCase() : null; tables = dbmd.getTables(catalog, schema, tableName.toUpperCase(), null); if (!tables.next()) { throw new IllegalArgumentException( - "Table with the name \"" - + getFullTableName() + "Table with the name \"" + getFullTableName() + "\" was not found. Check your database contents."); } else { catalogName = catalog; @@ -692,8 +693,8 @@ public class TableQuery extends AbstractTransactionalQuery implements for (String s : primaryKeyColumns) { if (!((ColumnProperty) row.getItemProperty(s)) .isReadOnlyChangeAllowed()) { - newRowId.add(values.get(values.keySet().iterator() - .next())); + newRowId.add(values + .get(values.keySet().iterator().next())); } else { newRowId.add(values.get(s)); } @@ -706,24 +707,23 @@ public class TableQuery extends AbstractTransactionalQuery implements } return new RowId(newRowId.toArray()); } catch (Exception e) { - getLogger() - .log(Level.FINE, - "Failed to fetch key values on insert: {0}", - e.getMessage()); + getLogger().log(Level.FINE, + "Failed to fetch key values on insert: {0}", + e.getMessage()); return null; } } /* * (non-Javadoc) - * + * * @see * com.vaadin.addon.sqlcontainer.query.QueryDelegate#removeRow(com.vaadin * .addon.sqlcontainer.RowItem) */ @Override - public boolean removeRow(RowItem row) throws UnsupportedOperationException, - SQLException { + public boolean removeRow(RowItem row) + throws UnsupportedOperationException, SQLException { if (getLogger().isLoggable(Level.FINE)) { getLogger().log(Level.FINE, "Removing row with id: {0}", row.getId().getId()[0]); @@ -742,7 +742,7 @@ public class TableQuery extends AbstractTransactionalQuery implements /* * (non-Javadoc) - * + * * @see * com.vaadin.addon.sqlcontainer.query.QueryDelegate#containsRowWithKey( * java.lang.Object[]) @@ -788,7 +788,8 @@ public class TableQuery extends AbstractTransactionalQuery implements /** * Custom writeObject to call rollback() if object is serialized. */ - private void writeObject(java.io.ObjectOutputStream out) throws IOException { + private void writeObject(java.io.ObjectOutputStream out) + throws IOException { try { rollback(); } catch (SQLException ignored) { @@ -799,8 +800,8 @@ public class TableQuery extends AbstractTransactionalQuery implements /** * Simple RowIdChangeEvent implementation. */ - public static class RowIdChangeEvent extends EventObject implements - QueryDelegate.RowIdChangeEvent { + public static class RowIdChangeEvent extends EventObject + implements QueryDelegate.RowIdChangeEvent { private final RowId oldId; private final RowId newId; diff --git a/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/DefaultSQLGenerator.java b/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/DefaultSQLGenerator.java index 2fc7ebd544..95e772b2f2 100644 --- a/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/DefaultSQLGenerator.java +++ b/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/DefaultSQLGenerator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -30,7 +30,7 @@ import com.vaadin.data.util.sqlcontainer.query.generator.filter.StringDecorator; /** * Generates generic SQL that is supported by HSQLDB, MySQL and PostgreSQL. - * + * * @author Jonatan Kronqvist / Vaadin Ltd */ @SuppressWarnings("serial") @@ -45,7 +45,7 @@ public class DefaultSQLGenerator implements SQLGenerator { /** * Create a new DefaultSqlGenerator instance that uses the given * implementation of {@link StatementHelper} - * + * * @param statementHelper */ public DefaultSQLGenerator( @@ -58,7 +58,7 @@ public class DefaultSQLGenerator implements SQLGenerator { * Construct a DefaultSQLGenerator with the specified identifiers for start * and end of quoted strings. The identifiers may be different depending on * the database engine and it's settings. - * + * * @param quoteStart * the identifier (character) denoting the start of a quoted * string @@ -66,14 +66,14 @@ public class DefaultSQLGenerator implements SQLGenerator { * the identifier (character) denoting the end of a quoted string */ public DefaultSQLGenerator(String quoteStart, String quoteEnd) { - QueryBuilder.setStringDecorator(new StringDecorator(quoteStart, - quoteEnd)); + QueryBuilder + .setStringDecorator(new StringDecorator(quoteStart, quoteEnd)); } /** * Same as {@link #DefaultSQLGenerator(String, String)} but with support for * custom {@link StatementHelper} implementation. - * + * * @param quoteStart * @param quoteEnd * @param statementHelperClazz @@ -86,7 +86,7 @@ public class DefaultSQLGenerator implements SQLGenerator { /* * (non-Javadoc) - * + * * @see com.vaadin.addon.sqlcontainer.query.generator.SQLGenerator# * generateSelectQuery(java.lang.String, java.util.List, java.util.List, * int, int, java.lang.String) @@ -101,8 +101,8 @@ public class DefaultSQLGenerator implements SQLGenerator { toSelect = toSelect == null ? "*" : toSelect; StatementHelper sh = getStatementHelper(); StringBuffer query = new StringBuffer(); - query.append("SELECT " + toSelect + " FROM ").append( - SQLUtil.escapeSQL(tableName)); + query.append("SELECT " + toSelect + " FROM ") + .append(SQLUtil.escapeSQL(tableName)); if (filters != null) { query.append(QueryBuilder.getWhereStringForFilters(filters, sh)); } @@ -120,7 +120,7 @@ public class DefaultSQLGenerator implements SQLGenerator { /* * (non-Javadoc) - * + * * @see com.vaadin.addon.sqlcontainer.query.generator.SQLGenerator# * generateUpdateQuery(java.lang.String, * com.vaadin.addon.sqlcontainer.RowItem) @@ -148,8 +148,8 @@ public class DefaultSQLGenerator implements SQLGenerator { } else { query.append(", " + QueryBuilder.quote(column) + " = ?"); } - sh.addParameterValue(columnToValueMap.get(column), item - .getItemProperty(column).getType()); + sh.addParameterValue(columnToValueMap.get(column), + item.getItemProperty(column).getType()); first = false; } /* Generate identifiers for the row to be updated */ @@ -160,8 +160,8 @@ public class DefaultSQLGenerator implements SQLGenerator { } else { query.append(" AND " + QueryBuilder.quote(column) + " = ?"); } - sh.addParameterValue(rowIdentifiers.get(column), item - .getItemProperty(column).getType()); + sh.addParameterValue(rowIdentifiers.get(column), + item.getItemProperty(column).getType()); first = false; } sh.setQueryString(query.toString()); @@ -170,7 +170,7 @@ public class DefaultSQLGenerator implements SQLGenerator { /* * (non-Javadoc) - * + * * @see com.vaadin.addon.sqlcontainer.query.generator.SQLGenerator# * generateInsertQuery(java.lang.String, * com.vaadin.addon.sqlcontainer.RowItem) @@ -211,8 +211,8 @@ public class DefaultSQLGenerator implements SQLGenerator { query.append(", "); } query.append("?"); - sh.addParameterValue(columnToValueMap.get(column), item - .getItemProperty(column).getType()); + sh.addParameterValue(columnToValueMap.get(column), + item.getItemProperty(column).getType()); first = false; } query.append(")"); @@ -222,14 +222,15 @@ public class DefaultSQLGenerator implements SQLGenerator { /* * (non-Javadoc) - * + * * @see com.vaadin.addon.sqlcontainer.query.generator.SQLGenerator# * generateDeleteQuery(java.lang.String, * com.vaadin.addon.sqlcontainer.RowItem) */ @Override public StatementHelper generateDeleteQuery(String tableName, - List primaryKeyColumns, String versionColumn, RowItem item) { + List primaryKeyColumns, String versionColumn, + RowItem item) { if (tableName == null || tableName.trim().equals("")) { throw new IllegalArgumentException("Table name must be given."); } @@ -246,7 +247,8 @@ public class DefaultSQLGenerator implements SQLGenerator { query.append("DELETE FROM ").append(tableName).append(" WHERE "); int count = 1; for (String keyColName : primaryKeyColumns) { - if ((this instanceof MSSQLGenerator || this instanceof OracleGenerator) + if ((this instanceof MSSQLGenerator + || this instanceof OracleGenerator) && keyColName.equalsIgnoreCase("rownum")) { count++; continue; @@ -256,8 +258,9 @@ public class DefaultSQLGenerator implements SQLGenerator { } if (item.getItemProperty(keyColName).getValue() != null) { query.append(QueryBuilder.quote(keyColName) + " = ?"); - sh.addParameterValue(item.getItemProperty(keyColName) - .getValue(), item.getItemProperty(keyColName).getType()); + sh.addParameterValue( + item.getItemProperty(keyColName).getValue(), + item.getItemProperty(keyColName).getType()); } count++; } @@ -270,9 +273,8 @@ public class DefaultSQLGenerator implements SQLGenerator { query.append(String.format(" AND %s = ?", QueryBuilder.quote(versionColumn))); - sh.addParameterValue( - item.getItemProperty(versionColumn).getValue(), item - .getItemProperty(versionColumn).getType()); + sh.addParameterValue(item.getItemProperty(versionColumn).getValue(), + item.getItemProperty(versionColumn).getType()); } sh.setQueryString(query.toString()); @@ -281,7 +283,7 @@ public class DefaultSQLGenerator implements SQLGenerator { /** * Generates sorting rules as an ORDER BY -clause - * + * * @param sb * StringBuffer to which the clause is appended. * @param o @@ -308,7 +310,7 @@ public class DefaultSQLGenerator implements SQLGenerator { /** * Generates the LIMIT and OFFSET clause. - * + * * @param sb * StringBuffer to which the clause is appended. * @param offset @@ -329,7 +331,8 @@ public class DefaultSQLGenerator implements SQLGenerator { for (Object id : item.getItemPropertyIds()) { ColumnProperty cp = (ColumnProperty) item.getItemProperty(id); /* Prevent "rownum" usage as a column name if MSSQL or ORACLE */ - if ((this instanceof MSSQLGenerator || this instanceof OracleGenerator) + if ((this instanceof MSSQLGenerator + || this instanceof OracleGenerator) && cp.getPropertyId().equalsIgnoreCase("rownum")) { continue; } @@ -345,7 +348,8 @@ public class DefaultSQLGenerator implements SQLGenerator { for (Object id : item.getItemPropertyIds()) { ColumnProperty cp = (ColumnProperty) item.getItemProperty(id); /* Prevent "rownum" usage as a column name if MSSQL or ORACLE */ - if ((this instanceof MSSQLGenerator || this instanceof OracleGenerator) + if ((this instanceof MSSQLGenerator + || this instanceof OracleGenerator) && cp.getPropertyId().equalsIgnoreCase("rownum")) { continue; } @@ -368,7 +372,7 @@ public class DefaultSQLGenerator implements SQLGenerator { /** * Returns the statement helper for the generator. Override this to handle * platform specific data types. - * + * * @see http://dev.vaadin.com/ticket/9148 * @return a new instance of the statement helper */ diff --git a/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/MSSQLGenerator.java b/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/MSSQLGenerator.java index 5a1f2003cd..754aa08689 100644 --- a/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/MSSQLGenerator.java +++ b/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/MSSQLGenerator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -32,7 +32,7 @@ public class MSSQLGenerator extends DefaultSQLGenerator { * Construct a MSSQLGenerator with the specified identifiers for start and * end of quoted strings. The identifiers may be different depending on the * database engine and it's settings. - * + * * @param quoteStart * the identifier (character) denoting the start of a quoted * string @@ -45,7 +45,7 @@ public class MSSQLGenerator extends DefaultSQLGenerator { /* * (non-Javadoc) - * + * * @see com.vaadin.addon.sqlcontainer.query.generator.DefaultSQLGenerator# * generateSelectQuery(java.lang.String, java.util.List, * com.vaadin.addon.sqlcontainer.query.FilteringMode, java.util.List, int, @@ -71,7 +71,8 @@ public class MSSQLGenerator extends DefaultSQLGenerator { "SELECT COUNT(*) AS %s FROM (SELECT * FROM %s", QueryBuilder.quote("rowcount"), tableName)); if (filters != null && !filters.isEmpty()) { - query.append(QueryBuilder.getWhereStringForFilters(filters, sh)); + query.append( + QueryBuilder.getWhereStringForFilters(filters, sh)); } query.append(") AS t"); sh.setQueryString(query.toString()); @@ -83,7 +84,8 @@ public class MSSQLGenerator extends DefaultSQLGenerator { query.append("SELECT ").append(toSelect).append(" FROM ") .append(tableName); if (filters != null) { - query.append(QueryBuilder.getWhereStringForFilters(filters, sh)); + query.append( + QueryBuilder.getWhereStringForFilters(filters, sh)); } if (orderBys != null) { for (OrderBy o : orderBys) { diff --git a/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/OracleGenerator.java b/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/OracleGenerator.java index 86508d37c4..a9a98d98a7 100644 --- a/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/OracleGenerator.java +++ b/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/OracleGenerator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -28,7 +28,8 @@ public class OracleGenerator extends DefaultSQLGenerator { } - public OracleGenerator(Class statementHelperClazz) { + public OracleGenerator( + Class statementHelperClazz) { super(statementHelperClazz); } @@ -36,7 +37,7 @@ public class OracleGenerator extends DefaultSQLGenerator { * Construct an OracleSQLGenerator with the specified identifiers for start * and end of quoted strings. The identifiers may be different depending on * the database engine and it's settings. - * + * * @param quoteStart * the identifier (character) denoting the start of a quoted * string @@ -54,7 +55,7 @@ public class OracleGenerator extends DefaultSQLGenerator { /* * (non-Javadoc) - * + * * @see com.vaadin.addon.sqlcontainer.query.generator.DefaultSQLGenerator# * generateSelectQuery(java.lang.String, java.util.List, * com.vaadin.addon.sqlcontainer.query.FilteringMode, java.util.List, int, @@ -80,7 +81,8 @@ public class OracleGenerator extends DefaultSQLGenerator { "SELECT COUNT(*) AS %s FROM (SELECT * FROM %s", QueryBuilder.quote("rowcount"), tableName)); if (filters != null && !filters.isEmpty()) { - query.append(QueryBuilder.getWhereStringForFilters(filters, sh)); + query.append( + QueryBuilder.getWhereStringForFilters(filters, sh)); } query.append(")"); sh.setQueryString(query.toString()); @@ -92,7 +94,8 @@ public class OracleGenerator extends DefaultSQLGenerator { query.append("SELECT ").append(toSelect).append(" FROM ") .append(tableName); if (filters != null) { - query.append(QueryBuilder.getWhereStringForFilters(filters, sh)); + query.append( + QueryBuilder.getWhereStringForFilters(filters, sh)); } if (orderBys != null) { for (OrderBy o : orderBys) { @@ -104,9 +107,9 @@ public class OracleGenerator extends DefaultSQLGenerator { } /* Remaining SELECT cases are handled here */ - query.append(String - .format("SELECT * FROM (SELECT x.*, ROWNUM AS %s FROM (SELECT %s FROM %s", - QueryBuilder.quote("rownum"), toSelect, tableName)); + query.append(String.format( + "SELECT * FROM (SELECT x.*, ROWNUM AS %s FROM (SELECT %s FROM %s", + QueryBuilder.quote("rownum"), toSelect, tableName)); if (filters != null) { query.append(QueryBuilder.getWhereStringForFilters(filters, sh)); } diff --git a/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/SQLGenerator.java b/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/SQLGenerator.java index 53ff924a36..bdc3d1fdf1 100644 --- a/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/SQLGenerator.java +++ b/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/SQLGenerator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -26,14 +26,14 @@ import com.vaadin.data.util.sqlcontainer.query.OrderBy; * The SQLGenerator interface is meant to be implemented for each different SQL * syntax that is to be supported. By default there are implementations for * HSQLDB, MySQL, PostgreSQL, MSSQL and Oracle syntaxes. - * + * * @author Jonatan Kronqvist / Vaadin Ltd */ public interface SQLGenerator extends Serializable { /** * Generates a SELECT query with the provided parameters. Uses default * filtering mode (INCLUSIVE). - * + * * @param tableName * Name of the table queried * @param filters @@ -55,7 +55,7 @@ public interface SQLGenerator extends Serializable { /** * Generates an UPDATE query with the provided parameters. - * + * * @param tableName * Name of the table queried * @param item @@ -68,7 +68,7 @@ public interface SQLGenerator extends Serializable { /** * Generates an INSERT query for inserting a new row with the provided * values. - * + * * @param tableName * Name of the table queried * @param item @@ -81,7 +81,7 @@ public interface SQLGenerator extends Serializable { /** * Generates a DELETE query for deleting data related to the given RowItem * from the database. - * + * * @param tableName * Name of the table queried * @param primaryKeyColumns diff --git a/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/StatementHelper.java b/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/StatementHelper.java index 5a9fcb17c0..78371f31ce 100644 --- a/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/StatementHelper.java +++ b/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/StatementHelper.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -33,7 +33,7 @@ import java.util.Map; * query generators in filling a PreparedStatement. The actual statement is * generated by the query generator methods, but the resulting statement and all * the parameter values are stored in an instance of StatementHelper. - * + * * This class will also fill the values with correct setters into the * PreparedStatement on request. */ @@ -84,35 +84,35 @@ public class StatementHelper implements Serializable { /* * The following list contains the data types supported by * PreparedStatement but not supported by SQLContainer: - * + * * [The list is provided as PreparedStatement method signatures] - * + * * setNCharacterStream(int parameterIndex, Reader value) - * + * * setNClob(int parameterIndex, NClob value) - * + * * setNString(int parameterIndex, String value) - * + * * setRef(int parameterIndex, Ref x) - * + * * setRowId(int parameterIndex, RowId x) - * + * * setSQLXML(int parameterIndex, SQLXML xmlObject) - * + * * setBytes(int parameterIndex, byte[] x) - * + * * setCharacterStream(int parameterIndex, Reader reader) - * + * * setClob(int parameterIndex, Clob x) - * + * * setURL(int parameterIndex, URL x) - * + * * setArray(int parameterIndex, Array x) - * + * * setAsciiStream(int parameterIndex, InputStream x) - * + * * setBinaryStream(int parameterIndex, InputStream x) - * + * * setBlob(int parameterIndex, Blob x) */ } @@ -162,13 +162,13 @@ public class StatementHelper implements Serializable { * Handle unrecognized null values. Override this to handle null values for * platform specific data types that are not handled by the default * implementation of the {@link StatementHelper}. - * + * * @param i * @param pstmt * @param dataTypes2 - * + * * @return true if handled, false otherwise - * + * * @see {@link http://dev.vaadin.com/ticket/9148} */ protected boolean handleUnrecognizedTypeNullValue(int i, diff --git a/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/filter/AndTranslator.java b/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/filter/AndTranslator.java index a3d9b90705..325764f563 100644 --- a/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/filter/AndTranslator.java +++ b/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/filter/AndTranslator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -28,8 +28,8 @@ public class AndTranslator implements FilterTranslator { @Override public String getWhereStringForFilter(Filter filter, StatementHelper sh) { - return QueryBuilder.group(QueryBuilder.getJoinedFilterString( - ((And) filter).getFilters(), "AND", sh)); + return QueryBuilder.group(QueryBuilder + .getJoinedFilterString(((And) filter).getFilters(), "AND", sh)); } } diff --git a/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/filter/BetweenTranslator.java b/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/filter/BetweenTranslator.java index 13d3553742..40c04e60d7 100644 --- a/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/filter/BetweenTranslator.java +++ b/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/filter/BetweenTranslator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/filter/CompareTranslator.java b/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/filter/CompareTranslator.java index d8d5cc61fb..d3e408f938 100644 --- a/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/filter/CompareTranslator.java +++ b/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/filter/CompareTranslator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/filter/FilterTranslator.java b/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/filter/FilterTranslator.java index 0ece263ef4..3dda38a8a4 100644 --- a/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/filter/FilterTranslator.java +++ b/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/filter/FilterTranslator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/filter/IsNullTranslator.java b/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/filter/IsNullTranslator.java index 764a04eece..a371be454e 100644 --- a/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/filter/IsNullTranslator.java +++ b/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/filter/IsNullTranslator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/filter/LikeTranslator.java b/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/filter/LikeTranslator.java index 07e544d40b..0250589621 100644 --- a/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/filter/LikeTranslator.java +++ b/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/filter/LikeTranslator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/filter/NotTranslator.java b/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/filter/NotTranslator.java index 1bbc2a8e7e..cf50618bf4 100644 --- a/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/filter/NotTranslator.java +++ b/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/filter/NotTranslator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/filter/OrTranslator.java b/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/filter/OrTranslator.java index 00b4d5421b..17d27f7dbe 100644 --- a/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/filter/OrTranslator.java +++ b/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/filter/OrTranslator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -28,8 +28,8 @@ public class OrTranslator implements FilterTranslator { @Override public String getWhereStringForFilter(Filter filter, StatementHelper sh) { - return QueryBuilder.group(QueryBuilder.getJoinedFilterString( - ((Or) filter).getFilters(), "OR", sh)); + return QueryBuilder.group(QueryBuilder + .getJoinedFilterString(((Or) filter).getFilters(), "OR", sh)); } } diff --git a/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/filter/QueryBuilder.java b/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/filter/QueryBuilder.java index b277551209..38843e9497 100644 --- a/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/filter/QueryBuilder.java +++ b/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/filter/QueryBuilder.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -49,7 +49,7 @@ public class QueryBuilder implements Serializable { /** * Allows specification of a custom ColumnQuoter instance that handles * quoting of column names for the current DB dialect. - * + * * @param decorator * the ColumnQuoter instance to use. */ @@ -68,7 +68,7 @@ public class QueryBuilder implements Serializable { /** * Constructs and returns a string representing the filter that can be used * in a WHERE clause. - * + * * @param filter * the filter to translate * @param sh diff --git a/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/filter/SimpleStringTranslator.java b/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/filter/SimpleStringTranslator.java index 9bfda5fb34..7084c82bbd 100644 --- a/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/filter/SimpleStringTranslator.java +++ b/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/filter/SimpleStringTranslator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/filter/StringDecorator.java b/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/filter/StringDecorator.java index 0132260a0c..210bcffa29 100644 --- a/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/filter/StringDecorator.java +++ b/server/src/main/java/com/vaadin/data/util/sqlcontainer/query/generator/filter/StringDecorator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,10 +21,10 @@ import java.io.Serializable; * The StringDecorator knows how to produce a quoted string using the specified * quote start and quote end characters. It also handles grouping of a string * (surrounding it in parenthesis). - * + * * Extend this class if you need to support special characters for grouping * (parenthesis). - * + * * @author Vaadin Ltd */ public class StringDecorator implements Serializable { @@ -35,7 +35,7 @@ public class StringDecorator implements Serializable { /** * Constructs a StringDecorator that uses the quoteStart and quoteEnd * characters to create quoted strings. - * + * * @param quoteStart * the character denoting the start of a quote. * @param quoteEnd @@ -48,7 +48,7 @@ public class StringDecorator implements Serializable { /** * Surround a string with quote characters. - * + * * @param str * the string to quote * @return the quoted string @@ -59,7 +59,7 @@ public class StringDecorator implements Serializable { /** * Groups a string by surrounding it in parenthesis - * + * * @param str * the string to group * @return the grouped string diff --git a/server/src/main/java/com/vaadin/data/validator/AbstractStringValidator.java b/server/src/main/java/com/vaadin/data/validator/AbstractStringValidator.java index 70227afa67..997e322545 100644 --- a/server/src/main/java/com/vaadin/data/validator/AbstractStringValidator.java +++ b/server/src/main/java/com/vaadin/data/validator/AbstractStringValidator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -23,25 +23,26 @@ package com.vaadin.data.validator; * (converted to string using {@link #toString()}) or "null" if the value is * null. *

      - * + * * @author Vaadin Ltd. * @since 5.4 */ @SuppressWarnings("serial") -public abstract class AbstractStringValidator extends AbstractValidator { +public abstract class AbstractStringValidator + extends AbstractValidator { /** * Constructs a validator for strings. - * + * *

      * Null and empty string values are always accepted. To reject empty values, * set the field being validated as required. *

      - * + * * @param errorMessage * the message to be included in an {@link InvalidValueException} * (with "{0}" replaced by the value that failed validation). - * */ + */ public AbstractStringValidator(String errorMessage) { super(errorMessage); } diff --git a/server/src/main/java/com/vaadin/data/validator/AbstractValidator.java b/server/src/main/java/com/vaadin/data/validator/AbstractValidator.java index b0894bbdbf..10e122bff5 100644 --- a/server/src/main/java/com/vaadin/data/validator/AbstractValidator.java +++ b/server/src/main/java/com/vaadin/data/validator/AbstractValidator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -38,7 +38,7 @@ import com.vaadin.data.Validator; * directly or implement {@link #isValidValue(Object)} when migrating legacy * applications. To check validity, {@link #validate(Object)} should be used. *

      - * + * * @param * The type * @author Vaadin Ltd. @@ -54,7 +54,7 @@ public abstract class AbstractValidator implements Validator { /** * Constructs a validator with the given error message. - * + * * @param errorMessage * the message to be included in an {@link InvalidValueException} * (with "{0}" replaced by the value that failed validation). @@ -68,7 +68,7 @@ public abstract class AbstractValidator implements Validator { * {@link #isValidValue(Object)} or {@link #validate(Object)} instead of * {@link #isValid(Object)}. {@link #validate(Object)} should normally be * used to check values. - * + * * @param value * @return true if the value is valid */ @@ -86,9 +86,9 @@ public abstract class AbstractValidator implements Validator { * perform validation in subclasses if customization of the error message is * not needed. Otherwise, subclasses should override * {@link #validate(Object)} and the return value of this method is ignored. - * + * * This method should not be called from outside the validator class itself. - * + * * @param value * @return */ @@ -108,7 +108,7 @@ public abstract class AbstractValidator implements Validator { * Checks the type of the value to validate to ensure it conforms with * getType. Enables sub classes to handle the specific type instead of * Object. - * + * * @param value * The value to check * @return true if the value can safely be cast to the type specified by @@ -125,7 +125,7 @@ public abstract class AbstractValidator implements Validator { /** * Returns the message to be included in the exception in case the value * does not validate. - * + * * @return the error message provided in the constructor or using * {@link #setErrorMessage(String)}. */ @@ -136,7 +136,7 @@ public abstract class AbstractValidator implements Validator { /** * Sets the message to be included in the exception in case the value does * not validate. The exception message is typically shown to the end user. - * + * * @param errorMessage * the error message. "{0}" is automatically replaced by the * value that did not validate. diff --git a/server/src/main/java/com/vaadin/data/validator/BeanValidator.java b/server/src/main/java/com/vaadin/data/validator/BeanValidator.java index b25f7e687c..9336a7bdfb 100644 --- a/server/src/main/java/com/vaadin/data/validator/BeanValidator.java +++ b/server/src/main/java/com/vaadin/data/validator/BeanValidator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -31,16 +31,16 @@ import com.vaadin.data.Validator; /** * Vaadin {@link Validator} using the JSR-303 (javax.validation) * annotation-based bean validation. - * + * * The annotations of the fields of the beans are used to determine the * validation to perform. - * + * * Note that a JSR-303 implementation (e.g. Hibernate Validator or Apache Bean * Validation - formerly agimatec validation) must be present on the project * classpath when using bean validation. - * + * * @since 7.0 - * + * * @author Petri Hakala * @author Henri Sara */ @@ -65,7 +65,7 @@ public class BeanValidator implements Validator { /** * Create a simple immutable message interpolator context. - * + * * @param value * value being validated * @param descriptor @@ -91,7 +91,7 @@ public class BeanValidator implements Validator { /** * Creates a Vaadin {@link Validator} utilizing JSR-303 bean validation. - * + * * @param beanClass * bean class based on which the validation should be performed * @param propertyName @@ -105,7 +105,7 @@ public class BeanValidator implements Validator { /* * (non-Javadoc) - * + * * @see com.vaadin.data.Validator#validate(java.lang.Object) */ @Override @@ -119,10 +119,11 @@ public class BeanValidator implements Validator { for (Object v : violations) { final ConstraintViolation violation = (ConstraintViolation) v; String msg = getJavaxBeanValidatorFactory() - .getMessageInterpolator().interpolate( - violation.getMessageTemplate(), - new SimpleContext(value, violation - .getConstraintDescriptor()), locale); + .getMessageInterpolator() + .interpolate(violation.getMessageTemplate(), + new SimpleContext(value, + violation.getConstraintDescriptor()), + locale); causes[i] = new InvalidValueException(msg); ++i; } @@ -133,9 +134,9 @@ public class BeanValidator implements Validator { /** * Sets the locale used for validation error messages. - * + * * Revalidation is not automatically triggered by setting the locale. - * + * * @param locale */ public void setLocale(Locale locale) { @@ -144,7 +145,7 @@ public class BeanValidator implements Validator { /** * Gets the locale used for validation error messages. - * + * * @return locale used for validation */ public Locale getLocale() { @@ -154,7 +155,7 @@ public class BeanValidator implements Validator { /** * Returns the underlying JSR-303 bean validator factory used. A factory is * created using {@link Validation} if necessary. - * + * * @return {@link ValidatorFactory} to use */ protected static ValidatorFactory getJavaxBeanValidatorFactory() { @@ -169,7 +170,7 @@ public class BeanValidator implements Validator { * Returns a shared Validator instance to use. An instance is created using * the validator factory if necessary and thereafter reused by the * {@link BeanValidator} instance. - * + * * @return the JSR-303 {@link javax.validation.Validator} to use */ protected javax.validation.Validator getJavaxBeanValidator() { diff --git a/server/src/main/java/com/vaadin/data/validator/BigDecimalRangeValidator.java b/server/src/main/java/com/vaadin/data/validator/BigDecimalRangeValidator.java index 1363d230f6..54daa45625 100644 --- a/server/src/main/java/com/vaadin/data/validator/BigDecimalRangeValidator.java +++ b/server/src/main/java/com/vaadin/data/validator/BigDecimalRangeValidator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -19,7 +19,7 @@ import java.math.BigDecimal; /** * Validator for validating that an {@link BigDecimal} is inside a given range. - * + * * @author Vaadin Ltd. * @since 7.4 */ @@ -29,12 +29,12 @@ public class BigDecimalRangeValidator extends RangeValidator { /** * Creates a validator for checking that an BigDecimal is within a given * range. - * + * * By default the range is inclusive i.e. both minValue and maxValue are * valid values. Use {@link #setMinValueIncluded(boolean)} or * {@link #setMaxValueIncluded(boolean)} to change it. - * - * + * + * * @param errorMessage * the message to display in case the value does not validate. * @param minValue diff --git a/server/src/main/java/com/vaadin/data/validator/BigIntegerRangeValidator.java b/server/src/main/java/com/vaadin/data/validator/BigIntegerRangeValidator.java index ecf1990192..cd1934e14a 100644 --- a/server/src/main/java/com/vaadin/data/validator/BigIntegerRangeValidator.java +++ b/server/src/main/java/com/vaadin/data/validator/BigIntegerRangeValidator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -19,7 +19,7 @@ import java.math.BigInteger; /** * Validator for validating that an {@link BigInteger} is inside a given range. - * + * * @author Vaadin Ltd. * @since 7.4 */ @@ -29,12 +29,12 @@ public class BigIntegerRangeValidator extends RangeValidator { /** * Creates a validator for checking that an BigInteger is within a given * range. - * + * * By default the range is inclusive i.e. both minValue and maxValue are * valid values. Use {@link #setMinValueIncluded(boolean)} or * {@link #setMaxValueIncluded(boolean)} to change it. - * - * + * + * * @param errorMessage * the message to display in case the value does not validate. * @param minValue diff --git a/server/src/main/java/com/vaadin/data/validator/ByteRangeValidator.java b/server/src/main/java/com/vaadin/data/validator/ByteRangeValidator.java index b147212c06..0211aa32d5 100644 --- a/server/src/main/java/com/vaadin/data/validator/ByteRangeValidator.java +++ b/server/src/main/java/com/vaadin/data/validator/ByteRangeValidator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -17,7 +17,7 @@ package com.vaadin.data.validator; /** * Validator for validating that an {@link Byte} is inside a given range. - * + * * @author Vaadin Ltd. * @since 7.4 */ @@ -26,12 +26,12 @@ public class ByteRangeValidator extends RangeValidator { /** * Creates a validator for checking that an Byte is within a given range. - * + * * By default the range is inclusive i.e. both minValue and maxValue are * valid values. Use {@link #setMinValueIncluded(boolean)} or * {@link #setMaxValueIncluded(boolean)} to change it. - * - * + * + * * @param errorMessage * the message to display in case the value does not validate. * @param minValue @@ -39,7 +39,8 @@ public class ByteRangeValidator extends RangeValidator { * @param maxValue * The maximum value to accept or null for no limit */ - public ByteRangeValidator(String errorMessage, Byte minValue, Byte maxValue) { + public ByteRangeValidator(String errorMessage, Byte minValue, + Byte maxValue) { super(errorMessage, Byte.class, minValue, maxValue); } diff --git a/server/src/main/java/com/vaadin/data/validator/CompositeValidator.java b/server/src/main/java/com/vaadin/data/validator/CompositeValidator.java index f3b7133b9d..e5ccbccab7 100644 --- a/server/src/main/java/com/vaadin/data/validator/CompositeValidator.java +++ b/server/src/main/java/com/vaadin/data/validator/CompositeValidator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -29,7 +29,7 @@ import com.vaadin.data.Validator; * all validate the value to validate or it may be enough that one contained * validator validates the value. This behaviour is controlled by the modes * AND and OR. - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -84,7 +84,7 @@ public class CompositeValidator implements Validator { /** * Constructs a composite validator in given mode. - * + * * @param mode * @param errorMessage */ @@ -101,12 +101,12 @@ public class CompositeValidator implements Validator { *
    • MODE_AND: All of the sub-validators are valid *
    • MODE_OR: Any of the sub-validators are valid * - * + * * If the value is invalid, validation error is thrown. If the error message * is set (non-null), it is used. If the error message has not been set, the * first error occurred is thrown. *

      - * + * * @param value * the value to check. * @throws Validator.InvalidValueException @@ -147,7 +147,7 @@ public class CompositeValidator implements Validator { /** * Gets the mode of the validator. - * + * * @return Operation mode of the validator: {@link CombinationMode#AND} or * {@link CombinationMode#OR}. */ @@ -161,7 +161,7 @@ public class CompositeValidator implements Validator { *
    • {@link CombinationMode#AND} (default) *
    • {@link CombinationMode#OR} * - * + * * @param mode * the mode to set. */ @@ -189,7 +189,7 @@ public class CompositeValidator implements Validator { /** * Adds validator to the interface. - * + * * @param validator * the Validator object which performs validation checks on this * set of data field values. @@ -203,7 +203,7 @@ public class CompositeValidator implements Validator { /** * Removes a validator from the composite. - * + * * @param validator * the Validator object which performs validation checks on this * set of data field values. @@ -214,22 +214,22 @@ public class CompositeValidator implements Validator { /** * Gets sub-validators by class. - * + * *

      * If the component contains directly or recursively (it contains another * composite containing the validator) validators compatible with given type * they are returned. This only applies to AND mode composite * validators. *

      - * + * *

      * If the validator is in OR mode or does not contain any * validators of given type null is returned. *

      - * + * * @param validatorType * The type of validators to return - * + * * @return Collection of validators compatible with given type * that must apply or null if none found. */ @@ -259,7 +259,7 @@ public class CompositeValidator implements Validator { /** * Sets the message to be included in the exception in case the value does * not validate. The exception message is typically shown to the end user. - * + * * @param errorMessage * the error message. */ diff --git a/server/src/main/java/com/vaadin/data/validator/DateRangeValidator.java b/server/src/main/java/com/vaadin/data/validator/DateRangeValidator.java index 3add69c207..aba28f5f42 100644 --- a/server/src/main/java/com/vaadin/data/validator/DateRangeValidator.java +++ b/server/src/main/java/com/vaadin/data/validator/DateRangeValidator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,13 +21,13 @@ import com.vaadin.shared.ui.datefield.Resolution; /** * Validator for validating that a Date is inside a given range. - * + * *

      * Note that the comparison is done directly on the Date object so take care * that the hours/minutes/seconds/milliseconds of the min/max values are * properly set. *

      - * + * * @author Vaadin Ltd. * @since 7.0 */ @@ -45,7 +45,7 @@ public class DateRangeValidator extends RangeValidator { * that the hours/minutes/seconds/milliseconds of the min/max values are * properly set. *

      - * + * * @param errorMessage * the message to display in case the value does not validate. * @param minValue @@ -53,8 +53,8 @@ public class DateRangeValidator extends RangeValidator { * @param maxValue * The maximum value to accept or null for no limit */ - public DateRangeValidator(String errorMessage, Date minValue, - Date maxValue, Resolution resolution) { + public DateRangeValidator(String errorMessage, Date minValue, Date maxValue, + Resolution resolution) { super(errorMessage, Date.class, minValue, maxValue); } diff --git a/server/src/main/java/com/vaadin/data/validator/DoubleRangeValidator.java b/server/src/main/java/com/vaadin/data/validator/DoubleRangeValidator.java index 8992e2644a..dc61286499 100644 --- a/server/src/main/java/com/vaadin/data/validator/DoubleRangeValidator.java +++ b/server/src/main/java/com/vaadin/data/validator/DoubleRangeValidator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -17,7 +17,7 @@ package com.vaadin.data.validator; /** * Validator for validating that a {@link Double} is inside a given range. - * + * * @author Vaadin Ltd. * @since 7.0 */ @@ -26,12 +26,12 @@ public class DoubleRangeValidator extends RangeValidator { /** * Creates a validator for checking that an Double is within a given range. - * + * * By default the range is inclusive i.e. both minValue and maxValue are * valid values. Use {@link #setMinValueIncluded(boolean)} or * {@link #setMaxValueIncluded(boolean)} to change it. - * - * + * + * * @param errorMessage * the message to display in case the value does not validate. * @param minValue diff --git a/server/src/main/java/com/vaadin/data/validator/DoubleValidator.java b/server/src/main/java/com/vaadin/data/validator/DoubleValidator.java index e40cf3eecf..2f5a3e8127 100644 --- a/server/src/main/java/com/vaadin/data/validator/DoubleValidator.java +++ b/server/src/main/java/com/vaadin/data/validator/DoubleValidator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -22,7 +22,7 @@ import com.vaadin.data.util.converter.StringToDoubleConverter; * String validator for a double precision floating point number. See * {@link com.vaadin.data.validator.AbstractStringValidator} for more * information. - * + * * @author Vaadin Ltd. * @since 5.4 * @deprecated As of 7.0. Use a {@link StringToDoubleConverter} converter on the @@ -36,7 +36,7 @@ public class DoubleValidator extends AbstractStringValidator { /** * Creates a validator for checking that a string can be parsed as an * double. - * + * * @param errorMessage * the message to display in case the value does not validate. * @deprecated As of 7.0. Use a Double converter on the field instead and/or diff --git a/server/src/main/java/com/vaadin/data/validator/EmailValidator.java b/server/src/main/java/com/vaadin/data/validator/EmailValidator.java index 853c855a37..54ff2984b7 100644 --- a/server/src/main/java/com/vaadin/data/validator/EmailValidator.java +++ b/server/src/main/java/com/vaadin/data/validator/EmailValidator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -19,16 +19,16 @@ package com.vaadin.data.validator; * String validator for e-mail addresses. The e-mail address syntax is not * complete according to RFC 822 but handles the vast majority of valid e-mail * addresses correctly. - * + * * See {@link com.vaadin.data.validator.AbstractStringValidator} for more * information. - * + * *

      * An empty string or a null is always accepted - use the required flag on * fields or a separate validator (or override {@link #isValidValue(String)}) to * fail on empty values. *

      - * + * * @author Vaadin Ltd. * @since 5.4 */ @@ -38,13 +38,12 @@ public class EmailValidator extends RegexpValidator { /** * Creates a validator for checking that a string is a syntactically valid * e-mail address. - * + * * @param errorMessage * the message to display in case the value does not validate. */ public EmailValidator(String errorMessage) { - super( - "^([a-zA-Z0-9_\\.\\-+])+@(([a-zA-Z0-9-])+\\.)+([a-zA-Z0-9]{2,4})+$", + super("^([a-zA-Z0-9_\\.\\-+])+@(([a-zA-Z0-9-])+\\.)+([a-zA-Z0-9]{2,4})+$", true, errorMessage); } } diff --git a/server/src/main/java/com/vaadin/data/validator/FloatRangeValidator.java b/server/src/main/java/com/vaadin/data/validator/FloatRangeValidator.java index ee29cf16b1..d509a47799 100644 --- a/server/src/main/java/com/vaadin/data/validator/FloatRangeValidator.java +++ b/server/src/main/java/com/vaadin/data/validator/FloatRangeValidator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -17,7 +17,7 @@ package com.vaadin.data.validator; /** * Validator for validating that a {@link Float} is inside a given range. - * + * * @author Vaadin Ltd. * @since 7.4 */ @@ -26,12 +26,12 @@ public class FloatRangeValidator extends RangeValidator { /** * Creates a validator for checking that an Float is within a given range. - * + * * By default the range is inclusive i.e. both minValue and maxValue are * valid values. Use {@link #setMinValueIncluded(boolean)} or * {@link #setMaxValueIncluded(boolean)} to change it. - * - * + * + * * @param errorMessage * the message to display in case the value does not validate. * @param minValue diff --git a/server/src/main/java/com/vaadin/data/validator/IntegerRangeValidator.java b/server/src/main/java/com/vaadin/data/validator/IntegerRangeValidator.java index 6ef848bed3..c63ee1f627 100644 --- a/server/src/main/java/com/vaadin/data/validator/IntegerRangeValidator.java +++ b/server/src/main/java/com/vaadin/data/validator/IntegerRangeValidator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -17,7 +17,7 @@ package com.vaadin.data.validator; /** * Validator for validating that an {@link Integer} is inside a given range. - * + * * @author Vaadin Ltd. * @since 5.4 */ @@ -26,12 +26,12 @@ public class IntegerRangeValidator extends RangeValidator { /** * Creates a validator for checking that an Integer is within a given range. - * + * * By default the range is inclusive i.e. both minValue and maxValue are * valid values. Use {@link #setMinValueIncluded(boolean)} or * {@link #setMaxValueIncluded(boolean)} to change it. - * - * + * + * * @param errorMessage * the message to display in case the value does not validate. * @param minValue diff --git a/server/src/main/java/com/vaadin/data/validator/IntegerValidator.java b/server/src/main/java/com/vaadin/data/validator/IntegerValidator.java index f52ba0ab3a..fddeef6dec 100644 --- a/server/src/main/java/com/vaadin/data/validator/IntegerValidator.java +++ b/server/src/main/java/com/vaadin/data/validator/IntegerValidator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -22,7 +22,7 @@ import com.vaadin.data.util.converter.StringToIntegerConverter; * String validator for integers. See * {@link com.vaadin.data.validator.AbstractStringValidator} for more * information. - * + * * @author Vaadin Ltd. * @since 5.4 * @deprecated As of 7.0. Use a {@link StringToIntegerConverter} converter on @@ -36,7 +36,7 @@ public class IntegerValidator extends AbstractStringValidator { /** * Creates a validator for checking that a string can be parsed as an * integer. - * + * * @param errorMessage * the message to display in case the value does not validate. * @deprecated As of 7.0. Use an Integer converter on the field instead diff --git a/server/src/main/java/com/vaadin/data/validator/LongRangeValidator.java b/server/src/main/java/com/vaadin/data/validator/LongRangeValidator.java index c4d8a9c9ca..a4ddd96d14 100644 --- a/server/src/main/java/com/vaadin/data/validator/LongRangeValidator.java +++ b/server/src/main/java/com/vaadin/data/validator/LongRangeValidator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -17,7 +17,7 @@ package com.vaadin.data.validator; /** * Validator for validating that an {@link Long} is inside a given range. - * + * * @author Vaadin Ltd. * @since 7.4 */ @@ -26,12 +26,12 @@ public class LongRangeValidator extends RangeValidator { /** * Creates a validator for checking that an Long is within a given range. - * + * * By default the range is inclusive i.e. both minValue and maxValue are * valid values. Use {@link #setMinValueIncluded(boolean)} or * {@link #setMaxValueIncluded(boolean)} to change it. - * - * + * + * * @param errorMessage * the message to display in case the value does not validate. * @param minValue @@ -39,7 +39,8 @@ public class LongRangeValidator extends RangeValidator { * @param maxValue * The maximum value to accept or null for no limit */ - public LongRangeValidator(String errorMessage, Long minValue, Long maxValue) { + public LongRangeValidator(String errorMessage, Long minValue, + Long maxValue) { super(errorMessage, Long.class, minValue, maxValue); } diff --git a/server/src/main/java/com/vaadin/data/validator/NullValidator.java b/server/src/main/java/com/vaadin/data/validator/NullValidator.java index 42cf419973..0253c3d75e 100644 --- a/server/src/main/java/com/vaadin/data/validator/NullValidator.java +++ b/server/src/main/java/com/vaadin/data/validator/NullValidator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,7 +21,7 @@ import com.vaadin.data.Validator; /** * This validator is used for validating properties that do or do not allow null * values. By default, nulls are not allowed. - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -34,7 +34,7 @@ public class NullValidator implements Validator { /** * Creates a new NullValidator. - * + * * @param errorMessage * the error message to display on invalidation. * @param onlyNullAllowed @@ -47,7 +47,7 @@ public class NullValidator implements Validator { /** * Validates the data given in value. - * + * * @param value * the value to validate. * @throws Validator.InvalidValueException @@ -71,7 +71,7 @@ public class NullValidator implements Validator { /** * Sets if nulls (and only nulls) are to be allowed. - * + * * @param onlyNullAllowed * If true, only nulls are allowed. If false only non-nulls are * allowed. Do we allow nulls? @@ -82,7 +82,7 @@ public class NullValidator implements Validator { /** * Gets the error message that is displayed in case the value is invalid. - * + * * @return the Error Message. */ public String getErrorMessage() { @@ -91,7 +91,7 @@ public class NullValidator implements Validator { /** * Sets the error message to be displayed on invalid value. - * + * * @param errorMessage * the Error Message to set. */ diff --git a/server/src/main/java/com/vaadin/data/validator/RangeValidator.java b/server/src/main/java/com/vaadin/data/validator/RangeValidator.java index 5ba3aef363..8bd52c477b 100644 --- a/server/src/main/java/com/vaadin/data/validator/RangeValidator.java +++ b/server/src/main/java/com/vaadin/data/validator/RangeValidator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -18,7 +18,7 @@ package com.vaadin.data.validator; /** * An base implementation for validating any objects that implement * {@link Comparable}. - * + * * Verifies that the value is of the given type and within the (optionally) * given limits. Typically you want to use a sub class of this like * {@link IntegerRangeValidator}, {@link DoubleRangeValidator} or @@ -28,7 +28,7 @@ package com.vaadin.data.validator; * required to ensure that no empty values are accepted or override * {@link #isValidValue(Comparable)}. *

      - * + * * @param * The type of Number to validate. Must implement Comparable so that * minimum and maximum checks work. @@ -45,7 +45,7 @@ public class RangeValidator extends AbstractValidator { /** * Creates a new range validator of the given type. - * + * * @param errorMessage * The error message to use if validation fails * @param type @@ -65,7 +65,7 @@ public class RangeValidator extends AbstractValidator { /** * Checks if the minimum value is part of the accepted range - * + * * @return true if the minimum value is part of the range, false otherwise */ public boolean isMinValueIncluded() { @@ -74,7 +74,7 @@ public class RangeValidator extends AbstractValidator { /** * Sets if the minimum value is part of the accepted range - * + * * @param minValueIncluded * true if the minimum value should be part of the range, false * otherwise @@ -85,7 +85,7 @@ public class RangeValidator extends AbstractValidator { /** * Checks if the maximum value is part of the accepted range - * + * * @return true if the maximum value is part of the range, false otherwise */ public boolean isMaxValueIncluded() { @@ -94,7 +94,7 @@ public class RangeValidator extends AbstractValidator { /** * Sets if the maximum value is part of the accepted range - * + * * @param maxValueIncluded * true if the maximum value should be part of the range, false * otherwise @@ -105,7 +105,7 @@ public class RangeValidator extends AbstractValidator { /** * Gets the minimum value of the range - * + * * @return the minimum value */ public T getMinValue() { @@ -116,7 +116,7 @@ public class RangeValidator extends AbstractValidator { * Sets the minimum value of the range. Use * {@link #setMinValueIncluded(boolean)} to control whether this value is * part of the range or not. - * + * * @param minValue * the minimum value */ @@ -126,7 +126,7 @@ public class RangeValidator extends AbstractValidator { /** * Gets the maximum value of the range - * + * * @return the maximum value */ public T getMaxValue() { @@ -137,7 +137,7 @@ public class RangeValidator extends AbstractValidator { * Sets the maximum value of the range. Use * {@link #setMaxValueIncluded(boolean)} to control whether this value is * part of the range or not. - * + * * @param maxValue * the maximum value */ @@ -147,7 +147,7 @@ public class RangeValidator extends AbstractValidator { /* * (non-Javadoc) - * + * * @see * com.vaadin.data.validator.AbstractValidator#isValidValue(java.lang.Object * ) @@ -186,7 +186,7 @@ public class RangeValidator extends AbstractValidator { /* * (non-Javadoc) - * + * * @see com.vaadin.data.validator.AbstractValidator#getType() */ @Override diff --git a/server/src/main/java/com/vaadin/data/validator/RegexpValidator.java b/server/src/main/java/com/vaadin/data/validator/RegexpValidator.java index 74e1f89253..43c8ad49b1 100644 --- a/server/src/main/java/com/vaadin/data/validator/RegexpValidator.java +++ b/server/src/main/java/com/vaadin/data/validator/RegexpValidator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,7 +21,7 @@ import java.util.regex.Pattern; /** * String validator comparing the string against a Java regular expression. Both * complete matches and substring matches are supported. - * + * *

      * For the Java regular expression syntax, see * {@link java.util.regex.Pattern#sum} @@ -35,7 +35,7 @@ import java.util.regex.Pattern; * fields or a separate validator (or override {@link #isValidValue(String)}) to * fail on empty values. *

      - * + * * @author Vaadin Ltd. * @since 5.4 */ @@ -49,7 +49,7 @@ public class RegexpValidator extends AbstractStringValidator { /** * Creates a validator for checking that the regular expression matches the * complete string to validate. - * + * * @param regexp * a Java regular expression * @param errorMessage @@ -62,7 +62,7 @@ public class RegexpValidator extends AbstractStringValidator { /** * Creates a validator for checking that the regular expression matches the * string to validate. - * + * * @param regexp * a Java regular expression * @param complete @@ -71,7 +71,8 @@ public class RegexpValidator extends AbstractStringValidator { * @param errorMessage * the message to display in case the value does not validate. */ - public RegexpValidator(String regexp, boolean complete, String errorMessage) { + public RegexpValidator(String regexp, boolean complete, + String errorMessage) { super(errorMessage); pattern = Pattern.compile(regexp); this.complete = complete; @@ -79,7 +80,7 @@ public class RegexpValidator extends AbstractStringValidator { /* * (non-Javadoc) - * + * * @see * com.vaadin.data.validator.AbstractValidator#isValidValue(java.lang.Object * ) @@ -98,7 +99,7 @@ public class RegexpValidator extends AbstractStringValidator { /** * Get a new or reused matcher for the pattern - * + * * @param value * the string to find matches in * @return Matcher for the string diff --git a/server/src/main/java/com/vaadin/data/validator/ShortRangeValidator.java b/server/src/main/java/com/vaadin/data/validator/ShortRangeValidator.java index a8b0d3aeb4..5027efa2c6 100644 --- a/server/src/main/java/com/vaadin/data/validator/ShortRangeValidator.java +++ b/server/src/main/java/com/vaadin/data/validator/ShortRangeValidator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -17,7 +17,7 @@ package com.vaadin.data.validator; /** * Validator for validating that an {@link Short} is inside a given range. - * + * * @author Vaadin Ltd. * @since 7.4 */ @@ -26,12 +26,12 @@ public class ShortRangeValidator extends RangeValidator { /** * Creates a validator for checking that an Short is within a given range. - * + * * By default the range is inclusive i.e. both minValue and maxValue are * valid values. Use {@link #setMinValueIncluded(boolean)} or * {@link #setMaxValueIncluded(boolean)} to change it. - * - * + * + * * @param errorMessage * the message to display in case the value does not validate. * @param minValue diff --git a/server/src/main/java/com/vaadin/data/validator/StringLengthValidator.java b/server/src/main/java/com/vaadin/data/validator/StringLengthValidator.java index efb551c614..c036422476 100644 --- a/server/src/main/java/com/vaadin/data/validator/StringLengthValidator.java +++ b/server/src/main/java/com/vaadin/data/validator/StringLengthValidator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -19,7 +19,7 @@ package com.vaadin.data.validator; /** * This StringLengthValidator is used to validate the length of * strings. - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -34,7 +34,7 @@ public class StringLengthValidator extends AbstractStringValidator { /** * Creates a new StringLengthValidator with a given error message. - * + * * @param errorMessage * the message to display in case the value does not validate. */ @@ -45,7 +45,7 @@ public class StringLengthValidator extends AbstractStringValidator { /** * Creates a new StringLengthValidator with a given error message and * minimum and maximum length limits. - * + * * @param errorMessage * the message to display in case the value does not validate. * @param minLength @@ -70,7 +70,7 @@ public class StringLengthValidator extends AbstractStringValidator { /** * Checks if the given value is valid. - * + * * @param value * the value to validate. * @return true for valid value, otherwise false. @@ -90,7 +90,7 @@ public class StringLengthValidator extends AbstractStringValidator { /** * Returns true if null strings are allowed. - * + * * @return true if allows null string, otherwise * false. */ @@ -101,7 +101,7 @@ public class StringLengthValidator extends AbstractStringValidator { /** * Gets the maximum permissible length of the string. - * + * * @return the maximum length of the string or null if there is no limit */ public Integer getMaxLength() { @@ -110,7 +110,7 @@ public class StringLengthValidator extends AbstractStringValidator { /** * Gets the minimum permissible length of the string. - * + * * @return the minimum length of the string or null if there is no limit */ public Integer getMinLength() { @@ -128,7 +128,7 @@ public class StringLengthValidator extends AbstractStringValidator { /** * Sets the maximum permissible length of the string. - * + * * @param maxLength * the maximum length to accept or null for no limit */ @@ -138,7 +138,7 @@ public class StringLengthValidator extends AbstractStringValidator { /** * Sets the minimum permissible length. - * + * * @param minLength * the minimum length to accept or null for no limit */ diff --git a/server/src/main/java/com/vaadin/event/Action.java b/server/src/main/java/com/vaadin/event/Action.java index 1af1de6e6d..95b2a896f1 100644 --- a/server/src/main/java/com/vaadin/event/Action.java +++ b/server/src/main/java/com/vaadin/event/Action.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -24,7 +24,7 @@ import com.vaadin.server.Resource; * Implements the action framework. This class contains subinterfaces for action * handling and listing, and for action handler registrations and * unregistration. - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -43,7 +43,7 @@ public class Action implements Serializable { /** * Constructs a new action with the given caption. - * + * * @param caption * the caption for the new action. */ @@ -53,7 +53,7 @@ public class Action implements Serializable { /** * Constructs a new action with the given caption string and icon. - * + * * @param caption * the caption for the new action. * @param icon @@ -66,7 +66,7 @@ public class Action implements Serializable { /** * Returns the action's caption. - * + * * @return the action's caption as a String. */ public String getCaption() { @@ -75,7 +75,7 @@ public class Action implements Serializable { /** * Returns the action's icon. - * + * * @return the action's Icon. */ public Resource getIcon() { @@ -87,7 +87,7 @@ public class Action implements Serializable { * Action.Notifier (or NotifierProxy) via the addAction() * -method, which in many cases is easier than implementing the * Action.Handler interface.
      - * + * */ public interface Listener extends Serializable { public void handleAction(Object sender, Object target); @@ -97,7 +97,7 @@ public class Action implements Serializable { * Action.Containers implementing this support an easier way of adding * single Actions than the more involved Action.Handler. The added actions * must be Action.Listeners, thus handling the action themselves. - * + * */ public interface Notifier extends Container { public void addAction(T action); @@ -113,7 +113,7 @@ public class Action implements Serializable { /** * Interface implemented by classes who wish to handle actions. - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -121,7 +121,7 @@ public class Action implements Serializable { /** * Gets the list of actions applicable to this handler. - * + * * @param target * the target handler to list actions for. For item * containers this is the item id. @@ -135,7 +135,7 @@ public class Action implements Serializable { /** * Handles an action for the given target. The handler method may just * discard the action if it's not suitable. - * + * * @param action * the action to be handled. * @param sender @@ -154,7 +154,7 @@ public class Action implements Serializable { * to it. When the component receives an action targeting its contents it * should loop all action handlers registered to it and let them handle the * action. - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -162,7 +162,7 @@ public class Action implements Serializable { /** * Registers a new action handler for this container - * + * * @param actionHandler * the new handler to be added. */ @@ -171,7 +171,7 @@ public class Action implements Serializable { /** * Removes a previously registered action handler for the contents of * this container. - * + * * @param actionHandler * the handler to be removed. */ @@ -180,7 +180,7 @@ public class Action implements Serializable { /** * Sets the caption. - * + * * @param caption * the caption to set. */ @@ -190,7 +190,7 @@ public class Action implements Serializable { /** * Sets the icon. - * + * * @param icon * the icon to set. */ diff --git a/server/src/main/java/com/vaadin/event/ActionManager.java b/server/src/main/java/com/vaadin/event/ActionManager.java index 6eb698d08a..85355cb653 100644 --- a/server/src/main/java/com/vaadin/event/ActionManager.java +++ b/server/src/main/java/com/vaadin/event/ActionManager.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -29,18 +29,18 @@ import com.vaadin.ui.Component; /** * Javadoc TODO - * + * * Notes: *

      * Empties the keymapper for each repaint to avoid leaks; can cause problems in * the future if the client assumes key don't change. (if lazyloading, one must * not cache results) *

      - * - * + * + * */ -public class ActionManager implements Action.Container, Action.Handler, - Action.Notifier { +public class ActionManager + implements Action.Container, Action.Handler, Action.Notifier { private static final long serialVersionUID = 1641868163608066491L; @@ -227,8 +227,8 @@ public class ActionManager implements Action.Container, Action.Handler, @Override public void handleAction(Action action, Object sender, Object target) { if (actionHandlers != null) { - Handler[] array = actionHandlers.toArray(new Handler[actionHandlers - .size()]); + Handler[] array = actionHandlers + .toArray(new Handler[actionHandlers.size()]); for (Handler handler : array) { handler.handleAction(action, sender, target); } diff --git a/server/src/main/java/com/vaadin/event/ConnectorActionManager.java b/server/src/main/java/com/vaadin/event/ConnectorActionManager.java index 0816ba48df..8bed286d24 100644 --- a/server/src/main/java/com/vaadin/event/ConnectorActionManager.java +++ b/server/src/main/java/com/vaadin/event/ConnectorActionManager.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -29,7 +29,7 @@ import com.vaadin.ui.Component; *

      * This is mostly a workaround until shortcut actions are re-implemented in a * more sensible way. - * + * * @since 7.1.8 * @author Vaadin Ltd */ @@ -39,7 +39,7 @@ public class ConnectorActionManager extends ActionManager { /** * Initialize an action manager for the given connector. - * + * * @param connector * the owner of this action manager */ @@ -51,7 +51,7 @@ public class ConnectorActionManager extends ActionManager { /** * Initialize an action manager for the given connector using the given * viewer. - * + * * @param connector * the owner of this action manager * @param viewer @@ -65,16 +65,15 @@ public class ConnectorActionManager extends ActionManager { /* * (non-Javadoc) - * + * * @see com.vaadin.event.ActionManager#handleAction(com.vaadin.event.Action, * java.lang.Object, java.lang.Object) */ @Override public void handleAction(Action action, Object sender, Object target) { if (!connector.isConnectorEnabled()) { - getLogger().warning( - ServerRpcHandler.getIgnoredDisabledError("action", - connector)); + getLogger().warning(ServerRpcHandler + .getIgnoredDisabledError("action", connector)); return; } diff --git a/server/src/main/java/com/vaadin/event/ConnectorEvent.java b/server/src/main/java/com/vaadin/event/ConnectorEvent.java index 3dc73b864a..5c27bc7517 100644 --- a/server/src/main/java/com/vaadin/event/ConnectorEvent.java +++ b/server/src/main/java/com/vaadin/event/ConnectorEvent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/server/src/main/java/com/vaadin/event/ConnectorEventListener.java b/server/src/main/java/com/vaadin/event/ConnectorEventListener.java index e3cb9c283b..06e99fc204 100644 --- a/server/src/main/java/com/vaadin/event/ConnectorEventListener.java +++ b/server/src/main/java/com/vaadin/event/ConnectorEventListener.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/server/src/main/java/com/vaadin/event/ContextClickEvent.java b/server/src/main/java/com/vaadin/event/ContextClickEvent.java index 5b15634105..4b88aad50e 100644 --- a/server/src/main/java/com/vaadin/event/ContextClickEvent.java +++ b/server/src/main/java/com/vaadin/event/ContextClickEvent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -26,15 +26,15 @@ import com.vaadin.util.ReflectTools; /** * Context click event fired by a {@link Component}. ContextClickEvent happens * when context click happens on the client-side inside the Component. - * + * * @since 7.6 * @author Vaadin Ltd */ public class ContextClickEvent extends ClickEvent { - public static final Method CONTEXT_CLICK_METHOD = ReflectTools - .findMethod(ContextClickListener.class, "contextClick", - ContextClickEvent.class); + public static final Method CONTEXT_CLICK_METHOD = ReflectTools.findMethod( + ContextClickListener.class, "contextClick", + ContextClickEvent.class); public ContextClickEvent(Component source, MouseEventDetails mouseEventDetails) { @@ -48,7 +48,7 @@ public class ContextClickEvent extends ClickEvent { /** * Called when the context click happens. - * + * * @param event * the context click event */ @@ -63,7 +63,7 @@ public class ContextClickEvent extends ClickEvent { /** * Adds a context click listener that gets notified when a context click * happens. - * + * * @param listener * the context click listener to add */ @@ -72,7 +72,7 @@ public class ContextClickEvent extends ClickEvent { /** * Removes a context click listener that was previously added with * {@link #addContextClickListener(ContextClickListener)}. - * + * * @param listener * the context click listener to remove */ diff --git a/server/src/main/java/com/vaadin/event/DataBoundTransferable.java b/server/src/main/java/com/vaadin/event/DataBoundTransferable.java index d461692b2e..c11c38a381 100644 --- a/server/src/main/java/com/vaadin/event/DataBoundTransferable.java +++ b/server/src/main/java/com/vaadin/event/DataBoundTransferable.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,13 +25,13 @@ import com.vaadin.ui.Component; * container as a data source. The transfer is associated with an item * (identified by its Id) and optionally also a property identifier (e.g. a * table column identifier when transferring a single table cell). - * + * * The component must implement the interface * {@link com.vaadin.data.Container.Viewer}. - * + * * In most cases, receivers of data transfers should depend on this class * instead of its concrete subclasses. - * + * * @since 6.3 */ public abstract class DataBoundTransferable extends TransferableImpl { @@ -43,26 +43,26 @@ public abstract class DataBoundTransferable extends TransferableImpl { /** * Returns the identifier of the item being transferred. - * + * * @return item identifier */ public abstract Object getItemId(); /** * Returns the optional property identifier that the transfer concerns. - * + * * This can be e.g. the table column from which a drag operation originated. - * + * * @return property identifier */ public abstract Object getPropertyId(); /** * Returns the container data source from which the transfer occurs. - * + * * {@link com.vaadin.data.Container.Viewer#getContainerDataSource()} is used * to obtain the underlying container of the source component. - * + * * @return Container */ public Container getSourceContainer() { diff --git a/server/src/main/java/com/vaadin/event/EventRouter.java b/server/src/main/java/com/vaadin/event/EventRouter.java index b662dfcb36..2ca65a61ec 100644 --- a/server/src/main/java/com/vaadin/event/EventRouter.java +++ b/server/src/main/java/com/vaadin/event/EventRouter.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -32,7 +32,7 @@ import com.vaadin.server.ErrorHandler; * EventRouter class implementing the inheritable event listening * model. For more information on the event model see the * {@link com.vaadin.event package documentation}. - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -63,7 +63,8 @@ public class EventRouter implements MethodEventSource { * here, we use the default documentation from implemented interface. */ @Override - public void addListener(Class eventType, Object object, String methodName) { + public void addListener(Class eventType, Object object, + String methodName) { if (listenerList == null) { listenerList = new LinkedHashSet(); } @@ -95,7 +96,8 @@ public class EventRouter implements MethodEventSource { * implemented interface. */ @Override - public void removeListener(Class eventType, Object target, Method method) { + public void removeListener(Class eventType, Object target, + Method method) { if (listenerList != null) { final Iterator i = listenerList.iterator(); while (i.hasNext()) { @@ -153,7 +155,7 @@ public class EventRouter implements MethodEventSource { /** * Sends an event to all registered listeners. The listeners will decide if * the activation method should be called or not. - * + * * @param event * the Event to be sent to all listeners. */ @@ -168,7 +170,7 @@ public class EventRouter implements MethodEventSource { * If an error handler is set, the processing of other listeners will * continue after the error handler method call unless the error handler * itself throws an exception. - * + * * @param event * the Event to be sent to all listeners. * @param errorHandler @@ -205,7 +207,7 @@ public class EventRouter implements MethodEventSource { /** * Checks if the given Event type is listened by a listener registered to * this router. - * + * * @param eventType * the event type to be checked * @return true if a listener is registered for the given event type @@ -223,7 +225,7 @@ public class EventRouter implements MethodEventSource { /** * Returns all listeners that match or extend the given event type. - * + * * @param eventType * The type of event to return listeners for. * @return A collection with all registered listeners. Empty if no listeners diff --git a/server/src/main/java/com/vaadin/event/FieldEvents.java b/server/src/main/java/com/vaadin/event/FieldEvents.java index 364ac76ffd..cebd8ba077 100644 --- a/server/src/main/java/com/vaadin/event/FieldEvents.java +++ b/server/src/main/java/com/vaadin/event/FieldEvents.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -45,7 +45,7 @@ public interface FieldEvents { * class really will send the events, or if it just defines the methods to * be able to implement an interface. *

      - * + * * @since 6.2 * @see FocusListener * @see FocusEvent @@ -54,7 +54,7 @@ public interface FieldEvents { /** * Adds a FocusListener to the Component which gets fired * when a Field receives keyboard focus. - * + * * @param listener * @see FocusListener * @since 6.2 @@ -70,7 +70,7 @@ public interface FieldEvents { /** * Removes a FocusListener from the Component. - * + * * @param listener * @see FocusListener * @since 6.2 @@ -97,7 +97,7 @@ public interface FieldEvents { * class really will send the events, or if it just defines the methods to * be able to implement an interface. *

      - * + * * @since 6.2 * @see BlurListener * @see BlurEvent @@ -106,7 +106,7 @@ public interface FieldEvents { /** * Adds a BlurListener to the Component which gets fired * when a Field loses keyboard focus. - * + * * @param listener * @see BlurListener * @since 6.2 @@ -122,7 +122,7 @@ public interface FieldEvents { /** * Removes a BlurListener from the Component. - * + * * @param listener * @see BlurListener * @since 6.2 @@ -140,7 +140,7 @@ public interface FieldEvents { /** * FocusEvent class for holding additional event information. * Fired when a Field receives keyboard focus. - * + * * @since 6.2 */ @SuppressWarnings("serial") @@ -159,18 +159,18 @@ public interface FieldEvents { /** * FocusListener interface for listening for * FocusEvent fired by a Field. - * + * * @see FocusEvent * @since 6.2 */ public interface FocusListener extends ConnectorEventListener { - public static final Method focusMethod = ReflectTools.findMethod( - FocusListener.class, "focus", FocusEvent.class); + public static final Method focusMethod = ReflectTools + .findMethod(FocusListener.class, "focus", FocusEvent.class); /** * Component has been focused - * + * * @param event * Component focus event. */ @@ -180,7 +180,7 @@ public interface FieldEvents { /** * BlurEvent class for holding additional event information. * Fired when a Field loses keyboard focus. - * + * * @since 6.2 */ @SuppressWarnings("serial") @@ -199,18 +199,18 @@ public interface FieldEvents { /** * BlurListener interface for listening for * BlurEvent fired by a Field. - * + * * @see BlurEvent * @since 6.2 */ public interface BlurListener extends ConnectorEventListener { - public static final Method blurMethod = ReflectTools.findMethod( - BlurListener.class, "blur", BlurEvent.class); + public static final Method blurMethod = ReflectTools + .findMethod(BlurListener.class, "blur", BlurEvent.class); /** * Component has been blurred - * + * * @param event * Component blur event. */ @@ -236,7 +236,7 @@ public interface FieldEvents { * example on each key press, but buffered with a small delay. The * {@link TextField} component supports different modes for triggering * TextChangeEvents. - * + * * @see TextChangeListener * @see TextChangeNotifier * @see TextField#setTextChangeEventMode(com.vaadin.ui.TextField.TextChangeEventMode) @@ -262,7 +262,7 @@ public interface FieldEvents { /** * A listener for {@link TextChangeEvent}s. - * + * * @since 6.5 */ public interface TextChangeListener extends ConnectorEventListener { @@ -273,7 +273,7 @@ public interface FieldEvents { /** * This method is called repeatedly while the text is edited by a user. - * + * * @param event * the event providing details of the text change */ @@ -305,8 +305,8 @@ public interface FieldEvents { public void removeListener(TextChangeListener listener); } - public static abstract class FocusAndBlurServerRpcImpl implements - FocusAndBlurServerRpc { + public static abstract class FocusAndBlurServerRpcImpl + implements FocusAndBlurServerRpc { private Component component; diff --git a/server/src/main/java/com/vaadin/event/ItemClickEvent.java b/server/src/main/java/com/vaadin/event/ItemClickEvent.java index 1280c16872..ebcae610f3 100644 --- a/server/src/main/java/com/vaadin/event/ItemClickEvent.java +++ b/server/src/main/java/com/vaadin/event/ItemClickEvent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,14 +25,14 @@ import com.vaadin.shared.MouseEventDetails; import com.vaadin.ui.Component; /** - * + * * Click event fired by a {@link Component} implementing * {@link com.vaadin.data.Container} interface. ItemClickEvents happens on an * {@link Item} rendered somehow on terminal. Event may also contain a specific * {@link Property} on which the click event happened. - * + * * @since 5.3 - * + * */ @SuppressWarnings("serial") public class ItemClickEvent extends ClickEvent implements Serializable { @@ -50,7 +50,7 @@ public class ItemClickEvent extends ClickEvent implements Serializable { /** * Gets the item on which the click event occurred. - * + * * @return item which was clicked */ public Item getItem() { @@ -59,7 +59,7 @@ public class ItemClickEvent extends ClickEvent implements Serializable { /** * Gets a possible identifier in source for clicked Item - * + * * @return */ public Object getItemId() { @@ -70,7 +70,7 @@ public class ItemClickEvent extends ClickEvent implements Serializable { * Returns property on which click event occurred. Returns null if source * cannot be resolved at property level. For example if clicked a cell in * table, the "column id" is returned. - * + * * @return a property id of clicked property or null if click didn't occur * on any distinct property. */ @@ -107,7 +107,7 @@ public class ItemClickEvent extends ClickEvent implements Serializable { * class really will send the events, or if it just defines the methods to * be able to implement an interface. *

      - * + * * @since 6.5 * @see ItemClickListener * @see ItemClickEvent @@ -115,7 +115,7 @@ public class ItemClickEvent extends ClickEvent implements Serializable { public interface ItemClickNotifier extends Serializable { /** * Register a listener to handle {@link ItemClickEvent}s. - * + * * @param listener * ItemClickListener to be registered */ @@ -130,7 +130,7 @@ public class ItemClickEvent extends ClickEvent implements Serializable { /** * Removes an ItemClickListener. - * + * * @param listener * ItemClickListener to be removed */ diff --git a/server/src/main/java/com/vaadin/event/LayoutEvents.java b/server/src/main/java/com/vaadin/event/LayoutEvents.java index e4432b7c7a..d3894ad617 100644 --- a/server/src/main/java/com/vaadin/event/LayoutEvents.java +++ b/server/src/main/java/com/vaadin/event/LayoutEvents.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -35,7 +35,7 @@ public interface LayoutEvents { /** * Layout has been clicked - * + * * @param event * Component click event. */ @@ -56,7 +56,7 @@ public interface LayoutEvents { * class really will send the events, or if it just defines the methods to * be able to implement an interface. *

      - * + * * @since 6.5.2 * @see LayoutClickListener * @see LayoutClickEvent @@ -68,13 +68,13 @@ public interface LayoutEvents { * the click targets a component inside a nested layout or Panel, * provided the targeted component does not prevent the click event from * propagating. A caption is not considered part of a component. - * + * * The child component that was clicked is included in the * {@link LayoutClickEvent}. - * + * * Use {@link #removeListener(LayoutClickListener)} to remove the * listener. - * + * * @param listener * The listener to add */ @@ -89,7 +89,7 @@ public interface LayoutEvents { /** * Removes an LayoutClickListener. - * + * * @param listener * LayoutClickListener to be removed */ @@ -114,8 +114,8 @@ public interface LayoutEvents { private final Component childComponent; public LayoutClickEvent(Component source, - MouseEventDetails mouseEventDetails, - Component clickedComponent, Component childComponent) { + MouseEventDetails mouseEventDetails, Component clickedComponent, + Component childComponent) { super(source, mouseEventDetails); this.clickedComponent = clickedComponent; this.childComponent = childComponent; @@ -124,10 +124,10 @@ public interface LayoutEvents { /** * Returns the component that was clicked, which is somewhere inside the * parent layout on which the listener was registered. - * + * * For the direct child component of the layout, see * {@link #getChildComponent()}. - * + * * @return clicked {@link Component}, null if none found */ public Component getClickedComponent() { @@ -137,10 +137,10 @@ public interface LayoutEvents { /** * Returns the direct child component of the layout which contains the * clicked component. - * + * * For the clicked component inside that child component of the layout, * see {@link #getClickedComponent()}. - * + * * @return direct child {@link Component} of the layout which contains * the clicked Component, null if none found */ diff --git a/server/src/main/java/com/vaadin/event/ListenerMethod.java b/server/src/main/java/com/vaadin/event/ListenerMethod.java index 3311ed705e..478690b652 100644 --- a/server/src/main/java/com/vaadin/event/ListenerMethod.java +++ b/server/src/main/java/com/vaadin/event/ListenerMethod.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -33,20 +33,20 @@ import java.util.logging.Logger; * fires, and the optional argument list to pass to the method and the index of * the argument to replace with the event object. *

      - * + * *

      * This Class provides several constructors that allow omission of the optional * arguments, and giving the listener method directly, or having the constructor * to reflect it using merely the name of the method. *

      - * + * *

      * It should be pointed out that the method * {@link #receiveEvent(EventObject event)} is the one that filters out the * events that do not match with the given event type and thus do not result in * calling of the trigger method. *

      - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -83,7 +83,8 @@ public class ListenerMethod implements EventListener, Serializable { private int eventArgumentIndex; /* Special serialization to handle method references */ - private void writeObject(java.io.ObjectOutputStream out) throws IOException { + private void writeObject(java.io.ObjectOutputStream out) + throws IOException { try { out.defaultWriteObject(); String name = method.getName(); @@ -91,18 +92,17 @@ public class ListenerMethod implements EventListener, Serializable { out.writeObject(name); out.writeObject(paramTypes); } catch (NotSerializableException e) { - getLogger() - .log(Level.WARNING, - "Error in serialization of the application: Class {0} must implement serialization.", - target.getClass().getName()); + getLogger().log(Level.WARNING, + "Error in serialization of the application: Class {0} must implement serialization.", + target.getClass().getName()); throw e; } } /* Special serialization to handle method references */ - private void readObject(java.io.ObjectInputStream in) throws IOException, - ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) + throws IOException, ClassNotFoundException { in.defaultReadObject(); try { String name = (String) in.readObject(); @@ -126,8 +126,8 @@ public class ListenerMethod implements EventListener, Serializable { } } if (cls.getSuperclass() != null) { - Method parentMethod = findHighestMethod(cls.getSuperclass(), - method, paramTypes); + Method parentMethod = findHighestMethod(cls.getSuperclass(), method, + paramTypes); if (parentMethod != null) { return parentMethod; } @@ -148,12 +148,12 @@ public class ListenerMethod implements EventListener, Serializable { * the argument index specifying which one is replaced with the event object * when the trigger method is called. *

      - * + * *

      * This constructor gets the trigger method as a parameter so it does not * need to reflect to find it out. *

      - * + * * @param eventType * the event type that is listener listens to. All events of this * kind (or its subclasses) result in calling the trigger method. @@ -180,26 +180,26 @@ public class ListenerMethod implements EventListener, Serializable { // Checks that the object is of correct type if (!method.getDeclaringClass().isAssignableFrom(target.getClass())) { - throw new java.lang.IllegalArgumentException("The method " - + method.getName() - + " cannot be used for the given target: " - + target.getClass().getName()); + throw new java.lang.IllegalArgumentException( + "The method " + method.getName() + + " cannot be used for the given target: " + + target.getClass().getName()); } // Checks that the event argument is null if (eventArgumentIndex >= 0 && arguments[eventArgumentIndex] != null) { - throw new java.lang.IllegalArgumentException("argument[" - + eventArgumentIndex + "] must be null"); + throw new java.lang.IllegalArgumentException( + "argument[" + eventArgumentIndex + "] must be null"); } // Checks the event type is supported by the method if (eventArgumentIndex >= 0 && !method.getParameterTypes()[eventArgumentIndex] .isAssignableFrom(eventType)) { - throw new java.lang.IllegalArgumentException("The method " - + method.getName() - + " does not accept the given eventType: " - + eventType.getName()); + throw new java.lang.IllegalArgumentException( + "The method " + method.getName() + + " does not accept the given eventType: " + + eventType.getName()); } this.eventType = eventType; @@ -217,7 +217,7 @@ public class ListenerMethod implements EventListener, Serializable { * object, and java.lang.IllegalArgumentException * is thrown unless exactly one match is found. *

      - * + * * @param eventType * the event type that is listener listens to. All events of this * kind (or its subclasses) result in calling the trigger method. @@ -259,18 +259,18 @@ public class ListenerMethod implements EventListener, Serializable { // Checks that the event argument is null if (eventArgumentIndex >= 0 && arguments[eventArgumentIndex] != null) { - throw new java.lang.IllegalArgumentException("argument[" - + eventArgumentIndex + "] must be null"); + throw new java.lang.IllegalArgumentException( + "argument[" + eventArgumentIndex + "] must be null"); } // Checks the event type is supported by the method if (eventArgumentIndex >= 0 && !method.getParameterTypes()[eventArgumentIndex] .isAssignableFrom(eventType)) { - throw new java.lang.IllegalArgumentException("The method " - + method.getName() - + " does not accept the given eventType: " - + eventType.getName()); + throw new java.lang.IllegalArgumentException( + "The method " + method.getName() + + " does not accept the given eventType: " + + eventType.getName()); } this.eventType = eventType; @@ -287,12 +287,12 @@ public class ListenerMethod implements EventListener, Serializable { * the event triggering this listener will not be passed to the trigger * method. *

      - * + * *

      * This constructor gets the trigger method as a parameter so it does not * need to reflect to find it out. *

      - * + * * @param eventType * the event type that is listener listens to. All events of this * kind (or its subclasses) result in calling the trigger method. @@ -311,10 +311,10 @@ public class ListenerMethod implements EventListener, Serializable { // Check that the object is of correct type if (!method.getDeclaringClass().isAssignableFrom(target.getClass())) { - throw new java.lang.IllegalArgumentException("The method " - + method.getName() - + " cannot be used for the given target: " - + target.getClass().getName()); + throw new java.lang.IllegalArgumentException( + "The method " + method.getName() + + " cannot be used for the given target: " + + target.getClass().getName()); } this.eventType = eventType; @@ -331,13 +331,13 @@ public class ListenerMethod implements EventListener, Serializable { * the event triggering this listener will not be passed to the trigger * method. *

      - * + * *

      * The actual trigger method is reflected from target, and * java.lang.IllegalArgumentException is thrown unless exactly * one match is found. *

      - * + * * @param eventType * the event type that is listener listens to. All events of this * kind (or its subclasses) result in calling the trigger method. @@ -382,12 +382,12 @@ public class ListenerMethod implements EventListener, Serializable { * list is unspecified no parameters are passed to the trigger method when * the listener is triggered. *

      - * + * *

      * This constructor gets the trigger method as a parameter so it does not * need to reflect to find it out. *

      - * + * * @param eventType * the event type that is listener listens to. All events of this * kind (or its subclasses) result in calling the trigger method. @@ -404,10 +404,10 @@ public class ListenerMethod implements EventListener, Serializable { // Checks that the object is of correct type if (!method.getDeclaringClass().isAssignableFrom(target.getClass())) { - throw new java.lang.IllegalArgumentException("The method " - + method.getName() - + " cannot be used for the given target: " - + target.getClass().getName()); + throw new java.lang.IllegalArgumentException( + "The method " + method.getName() + + " cannot be used for the given target: " + + target.getClass().getName()); } this.eventType = eventType; @@ -419,7 +419,8 @@ public class ListenerMethod implements EventListener, Serializable { if (params.length == 0) { arguments = new Object[0]; - } else if (params.length == 1 && params[0].isAssignableFrom(eventType)) { + } else if (params.length == 1 + && params[0].isAssignableFrom(eventType)) { arguments = new Object[] { null }; eventArgumentIndex = 0; } else { @@ -434,13 +435,13 @@ public class ListenerMethod implements EventListener, Serializable { * argument list is unspecified no parameters are passed to the trigger * method when the listener is triggered. *

      - * + * *

      * The actual trigger method is reflected from object, and * java.lang.IllegalArgumentException is thrown unless exactly * one match is found. *

      - * + * * @param eventType * the event type that is listener listens to. All events of this * kind (or its subclasses) result in calling the trigger method. @@ -479,7 +480,8 @@ public class ListenerMethod implements EventListener, Serializable { if (params.length == 0) { arguments = new Object[0]; - } else if (params.length == 1 && params[0].isAssignableFrom(eventType)) { + } else if (params.length == 1 + && params[0].isAssignableFrom(eventType)) { arguments = new Object[] { null }; eventArgumentIndex = 0; } else { @@ -493,7 +495,7 @@ public class ListenerMethod implements EventListener, Serializable { * trigger method if it matches with the criteria defined for the listener. * Only the events of the same or subclass of the specified event class * result in the trigger method to be called. - * + * * @param event * the fired event. Unless the trigger method's argument list and * the index to the to be replaced argument is specified, this @@ -525,9 +527,9 @@ public class ListenerMethod implements EventListener, Serializable { } catch (final java.lang.reflect.InvocationTargetException e) { // An exception was thrown by the invocation target. Throw it // forwards. - throw new MethodException("Invocation of method " - + method.getName() + " in " - + target.getClass().getName() + " failed.", + throw new MethodException( + "Invocation of method " + method.getName() + " in " + + target.getClass().getName() + " failed.", e.getTargetException()); } } @@ -536,7 +538,7 @@ public class ListenerMethod implements EventListener, Serializable { /** * Checks if the given object and event match with the ones stored in this * listener. - * + * * @param target * the object to be matched against the object stored by this * listener. @@ -554,7 +556,7 @@ public class ListenerMethod implements EventListener, Serializable { /** * Checks if the given object, event and method match with the ones stored * in this listener. - * + * * @param target * the object to be matched against the object stored by this * listener. @@ -570,9 +572,8 @@ public class ListenerMethod implements EventListener, Serializable { * equals with the method stored in this object */ public boolean matches(Class eventType, Object target, Method method) { - return (this.target == target) - && (eventType.equals(this.eventType) && method - .equals(this.method)); + return (this.target == target) && (eventType.equals(this.eventType) + && method.equals(this.method)); } @Override @@ -603,14 +604,14 @@ public class ListenerMethod implements EventListener, Serializable { ListenerMethod t = (ListenerMethod) obj; return eventArgumentIndex == t.eventArgumentIndex - && (eventType == t.eventType || (eventType != null && eventType - .equals(t.eventType))) - && (target == t.target || (target != null && target - .equals(t.target))) - && (method == t.method || (method != null && method - .equals(t.method))) - && (arguments == t.arguments || (Arrays.equals(arguments, - t.arguments))); + && (eventType == t.eventType + || (eventType != null && eventType.equals(t.eventType))) + && (target == t.target + || (target != null && target.equals(t.target))) + && (method == t.method + || (method != null && method.equals(t.method))) + && (arguments == t.arguments + || (Arrays.equals(arguments, t.arguments))); } /** @@ -618,12 +619,12 @@ public class ListenerMethod implements EventListener, Serializable { * ListenerMethod invokes the target method, it may throw * arbitrary exception. The original exception is wrapped into * MethodException instance and rethrown by the ListenerMethod. - * + * * @author Vaadin Ltd. * @since 3.0 */ - public class MethodException extends RuntimeException implements - Serializable { + public class MethodException extends RuntimeException + implements Serializable { private MethodException(String message, Throwable cause) { super(message, cause); @@ -633,7 +634,7 @@ public class ListenerMethod implements EventListener, Serializable { /** * Compares the type of this ListenerMethod to the given type - * + * * @param eventType * The type to compare with * @return true if this type of this ListenerMethod matches the given type, @@ -645,7 +646,7 @@ public class ListenerMethod implements EventListener, Serializable { /** * Compares the type of this ListenerMethod to the given type - * + * * @param eventType * The type to compare with * @return true if this event type can be assigned to the given type, false @@ -657,7 +658,7 @@ public class ListenerMethod implements EventListener, Serializable { /** * Returns the target object which contains the trigger method. - * + * * @return The target object */ public Object getTarget() { diff --git a/server/src/main/java/com/vaadin/event/MethodEventSource.java b/server/src/main/java/com/vaadin/event/MethodEventSource.java index ddfc87ca8c..b1aaa29670 100644 --- a/server/src/main/java/com/vaadin/event/MethodEventSource.java +++ b/server/src/main/java/com/vaadin/event/MethodEventSource.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -23,12 +23,12 @@ import java.lang.reflect.Method; *

      * Interface for classes supporting registration of methods as event receivers. *

      - * + * *

      * For more information on the inheritable event mechanism see the * {@link com.vaadin.event com.vaadin.event package documentation}. *

      - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -41,12 +41,12 @@ public interface MethodEventSource extends Serializable { * not have any arguments the event object will not be passed to it when * it's called. *

      - * + * *

      * For more information on the inheritable event mechanism see the * {@link com.vaadin.event com.vaadin.event package documentation}. *

      - * + * * @param eventType * the type of the listened event. Events of this type or its * subclasses activate the listener. @@ -67,19 +67,19 @@ public interface MethodEventSource extends Serializable { * have any arguments the event object will not be passed to it when it's * called. *

      - * + * *

      * This version of addListener gets the name of the activation * method as a parameter. The actual method is reflected from * object, and unless exactly one match is found, * java.lang.IllegalArgumentException is thrown. *

      - * + * *

      * For more information on the inheritable event mechanism see the * {@link com.vaadin.event com.vaadin.event package documentation}. *

      - * + * * @param eventType * the type of the listened event. Events of this type or its * subclasses activate the listener. @@ -91,7 +91,8 @@ public interface MethodEventSource extends Serializable { * unless method has exactly one match in * object */ - public void addListener(Class eventType, Object object, String methodName); + public void addListener(Class eventType, Object object, + String methodName); /** * Removes all registered listeners matching the given parameters. Since @@ -99,12 +100,12 @@ public interface MethodEventSource extends Serializable { * parameters, it will unregister all object's methods that are * registered to listen to events of type eventType generated * by this component. - * + * *

      * For more information on the inheritable event mechanism see the * {@link com.vaadin.event com.vaadin.event package documentation}. *

      - * + * * @param eventType * the exact event type the object listens to. * @param target @@ -117,12 +118,12 @@ public interface MethodEventSource extends Serializable { * Removes one registered listener method. The given method owned by the * given object will no longer be called when the specified events are * generated by this component. - * + * *

      * For more information on the inheritable event mechanism see the * {@link com.vaadin.event com.vaadin.event package documentation}. *

      - * + * * @param eventType * the exact event type the object listens to. * @param target @@ -132,7 +133,8 @@ public interface MethodEventSource extends Serializable { * the method owned by the target that's registered to listen to * events of type eventType. */ - public void removeListener(Class eventType, Object target, Method method); + public void removeListener(Class eventType, Object target, + Method method); /** *

      @@ -140,19 +142,19 @@ public interface MethodEventSource extends Serializable { * given object will no longer be called when the specified events are * generated by this component. *

      - * + * *

      * This version of removeListener gets the name of the * activation method as a parameter. The actual method is reflected from the * target, and unless exactly one match is found, * java.lang.IllegalArgumentException is thrown. *

      - * + * *

      * For more information on the inheritable event mechanism see the * {@link com.vaadin.event com.vaadin.event package documentation}. *

      - * + * * @param eventType * the exact event type the object listens to. * @param target diff --git a/server/src/main/java/com/vaadin/event/MouseEvents.java b/server/src/main/java/com/vaadin/event/MouseEvents.java index b32ce06587..49bbc0d9d8 100644 --- a/server/src/main/java/com/vaadin/event/MouseEvents.java +++ b/server/src/main/java/com/vaadin/event/MouseEvents.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,7 +25,7 @@ import com.vaadin.util.ReflectTools; /** * Interface that serves as a wrapper for mouse related events. - * + * * @author Vaadin Ltd. * @see ClickListener * @since 6.2 @@ -36,10 +36,10 @@ public interface MouseEvents { * Class for holding information about a mouse click event. A * {@link ClickEvent} is fired when the user clicks on a * Component. - * + * * The information available for click events are terminal dependent. * Correct values for all event details cannot be guaranteed. - * + * * @author Vaadin Ltd. * @see ClickListener * @since 6.2 @@ -62,7 +62,8 @@ public interface MouseEvents { public static final MouseButton BUTTON_RIGHT = MouseButton.RIGHT; private MouseEventDetails details; - public ClickEvent(Component source, MouseEventDetails mouseEventDetails) { + public ClickEvent(Component source, + MouseEventDetails mouseEventDetails) { super(source); details = mouseEventDetails; } @@ -71,7 +72,7 @@ public interface MouseEvents { * Returns an identifier describing which mouse button the user pushed. * Compare with {@link MouseButton#LEFT},{@link MouseButton#MIDDLE}, * {@link Button#RIGHT} to find out which button it is. - * + * * @return one of {@link MouseButton#LEFT}, {@link MouseButton#MIDDLE}, * {@link MouseButton#RIGHT}. */ @@ -82,7 +83,7 @@ public interface MouseEvents { /** * Returns the mouse position (x coordinate) when the click took place. * The position is relative to the browser client area. - * + * * @return The mouse cursor x position */ public int getClientX() { @@ -92,7 +93,7 @@ public interface MouseEvents { /** * Returns the mouse position (y coordinate) when the click took place. * The position is relative to the browser client area. - * + * * @return The mouse cursor y position */ public int getClientY() { @@ -102,7 +103,7 @@ public interface MouseEvents { /** * Returns the relative mouse position (x coordinate) when the click * took place. The position is relative to the clicked component. - * + * * @return The mouse cursor x position relative to the clicked layout * component or -1 if no x coordinate available */ @@ -113,7 +114,7 @@ public interface MouseEvents { /** * Returns the relative mouse position (y coordinate) when the click * took place. The position is relative to the clicked component. - * + * * @return The mouse cursor y position relative to the clicked layout * component or -1 if no y coordinate available */ @@ -123,7 +124,7 @@ public interface MouseEvents { /** * Checks if the event is a double click event. - * + * * @return true if the event is a double click event, false otherwise */ public boolean isDoubleClick() { @@ -132,7 +133,7 @@ public interface MouseEvents { /** * Checks if the Alt key was down when the mouse event took place. - * + * * @return true if Alt was down when the event occured, false otherwise */ public boolean isAltKey() { @@ -141,7 +142,7 @@ public interface MouseEvents { /** * Checks if the Ctrl key was down when the mouse event took place. - * + * * @return true if Ctrl was pressed when the event occured, false * otherwise */ @@ -151,7 +152,7 @@ public interface MouseEvents { /** * Checks if the Meta key was down when the mouse event took place. - * + * * @return true if Meta was pressed when the event occured, false * otherwise */ @@ -161,7 +162,7 @@ public interface MouseEvents { /** * Checks if the Shift key was down when the mouse event took place. - * + * * @return true if Shift was pressed when the event occured, false * otherwise */ @@ -174,7 +175,7 @@ public interface MouseEvents { * pushed. This is meant for debug purposes only and the string returned * could change. Use {@link #getButton()} to check which button was * pressed. - * + * * @since 6.3 * @return A string representation of which button was pushed. */ @@ -186,20 +187,20 @@ public interface MouseEvents { /** * Interface for listening for a {@link ClickEvent} fired by a * {@link Component}. - * + * * @see ClickEvent * @author Vaadin Ltd. * @since 6.2 */ public interface ClickListener extends ConnectorEventListener { - public static final Method clickMethod = ReflectTools.findMethod( - ClickListener.class, "click", ClickEvent.class); + public static final Method clickMethod = ReflectTools + .findMethod(ClickListener.class, "click", ClickEvent.class); /** * Called when a {@link Component} has been clicked. A reference to the * component is given by {@link ClickEvent#getComponent()}. - * + * * @param event * An event containing information about the click. */ @@ -209,7 +210,7 @@ public interface MouseEvents { /** * Class for holding additional event information for DoubleClick events. * Fired when the user double-clicks on a Component. - * + * * @see ClickEvent * @author Vaadin Ltd. * @since 6.2 @@ -224,7 +225,7 @@ public interface MouseEvents { /** * Interface for listening for a {@link DoubleClickEvent} fired by a * {@link Component}. - * + * * @see DoubleClickEvent * @author Vaadin Ltd. * @since 6.2 @@ -238,7 +239,7 @@ public interface MouseEvents { /** * Called when a {@link Component} has been double clicked. A reference * to the component is given by {@link DoubleClickEvent#getComponent()}. - * + * * @param event * An event containing information about the double click. */ diff --git a/server/src/main/java/com/vaadin/event/SelectionEvent.java b/server/src/main/java/com/vaadin/event/SelectionEvent.java index 09cf57167f..b8fdbeec14 100644 --- a/server/src/main/java/com/vaadin/event/SelectionEvent.java +++ b/server/src/main/java/com/vaadin/event/SelectionEvent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,7 +25,7 @@ import java.util.Set; /** * An event that specifies what in a selection has changed, and where the * selection took place. - * + * * @since 7.4 * @author Vaadin Ltd */ @@ -46,7 +46,7 @@ public class SelectionEvent extends EventObject { *

      * Note: this excludes all itemIds that might have been previously * selected. - * + * * @return a Collection of the itemIds that became selected */ public Set getAdded() { @@ -58,7 +58,7 @@ public class SelectionEvent extends EventObject { *

      * Note: this excludes all itemIds that might have been previously * deselected. - * + * * @return a Collection of the itemIds that became deselected */ public Set getRemoved() { @@ -87,7 +87,7 @@ public class SelectionEvent extends EventObject { /** * A {@link Collection} of all the itemIds that are currently selected. - * + * * @return a Collection of the itemIds that are currently selected */ public Set getSelected() { @@ -101,7 +101,7 @@ public class SelectionEvent extends EventObject { public interface SelectionListener extends Serializable { /** * Notifies the listener that the selection state has changed. - * + * * @param event * the selection change event */ @@ -109,13 +109,13 @@ public class SelectionEvent extends EventObject { } /** - * The interface for adding and removing listeners for - * {@link SelectionEvent SelectionEvents}. + * The interface for adding and removing listeners for {@link SelectionEvent + * SelectionEvents}. */ public interface SelectionNotifier extends Serializable { /** * Registers a new selection listener - * + * * @param listener * the listener to register */ @@ -123,7 +123,7 @@ public class SelectionEvent extends EventObject { /** * Removes a previously registered selection change listener - * + * * @param listener * the listener to remove */ diff --git a/server/src/main/java/com/vaadin/event/ShortcutAction.java b/server/src/main/java/com/vaadin/event/ShortcutAction.java index dd511c23c0..15b5056f9a 100644 --- a/server/src/main/java/com/vaadin/event/ShortcutAction.java +++ b/server/src/main/java/com/vaadin/event/ShortcutAction.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -47,7 +47,7 @@ import com.vaadin.ui.Window; * very well supported yet, but it might still be a good idea to give a caption * to the shortcut. *

      - * + * * @author Vaadin Ltd. * @since 4.0.1 */ @@ -63,7 +63,7 @@ public class ShortcutAction extends Action { * (optionally) {@link ModifierKey}s.
      * The shortcut might be shown in the UI (e.g context menu), in which case * the caption will be used. - * + * * @param caption * used when displaying the shortcut visually * @param kc @@ -82,7 +82,7 @@ public class ShortcutAction extends Action { * (optionally) {@link ModifierKey}s.
      * The shortcut might be shown in the UI (e.g context menu), in which case * the caption and icon will be used. - * + * * @param caption * used when displaying the shortcut visually * @param icon @@ -112,21 +112,21 @@ public class ShortcutAction extends Action { public static final char SHORTHAND_CHAR_CTRL = '^'; // regex-quote (escape) the characters - private static final String SHORTHAND_ALT = Pattern.quote(Character - .toString(SHORTHAND_CHAR_ALT)); - private static final String SHORTHAND_SHIFT = Pattern.quote(Character - .toString(SHORTHAND_CHAR_SHIFT)); - private static final String SHORTHAND_CTRL = Pattern.quote(Character - .toString(SHORTHAND_CHAR_CTRL)); + private static final String SHORTHAND_ALT = Pattern + .quote(Character.toString(SHORTHAND_CHAR_ALT)); + private static final String SHORTHAND_SHIFT = Pattern + .quote(Character.toString(SHORTHAND_CHAR_SHIFT)); + private static final String SHORTHAND_CTRL = Pattern + .quote(Character.toString(SHORTHAND_CHAR_CTRL)); // Used for replacing escaped chars, e.g && with & - private static final Pattern SHORTHAND_ESCAPE = Pattern.compile("(" - + SHORTHAND_ALT + "?)" + SHORTHAND_ALT + "|(" + SHORTHAND_SHIFT - + "?)" + SHORTHAND_SHIFT + "|(" + SHORTHAND_CTRL + "?)" - + SHORTHAND_CTRL); + private static final Pattern SHORTHAND_ESCAPE = Pattern + .compile("(" + SHORTHAND_ALT + "?)" + SHORTHAND_ALT + "|(" + + SHORTHAND_SHIFT + "?)" + SHORTHAND_SHIFT + "|(" + + SHORTHAND_CTRL + "?)" + SHORTHAND_CTRL); // Used for removing escaped chars, only leaving real shorthands - private static final Pattern SHORTHAND_REMOVE = Pattern.compile("([" - + SHORTHAND_ALT + "|" + SHORTHAND_SHIFT + "|" + SHORTHAND_CTRL - + "])\\1"); + private static final Pattern SHORTHAND_REMOVE = Pattern + .compile("([" + SHORTHAND_ALT + "|" + SHORTHAND_SHIFT + "|" + + SHORTHAND_CTRL + "])\\1"); // Mnemonic char, optionally followed by another, and optionally a third private static final Pattern SHORTHANDS = Pattern.compile("(" + SHORTHAND_ALT + "|" + SHORTHAND_SHIFT + "|" + SHORTHAND_CTRL @@ -151,7 +151,7 @@ public class ShortcutAction extends Action { * "Save&&&close" will respond to ALT-C, and the caption will * say "Save&close". *

      - * + * * @param shorthandCaption * the caption in modifier shorthand */ @@ -171,7 +171,7 @@ public class ShortcutAction extends Action { * new ShortcutAction("Do &stuff", new int[]{ShortcutAction.ModifierKey.CTRL})); * will respond to CTRL-S. *

      - * + * * @param shorthandCaption * @param modifierKeys */ @@ -186,8 +186,8 @@ public class ShortcutAction extends Action { String match = matcher.group(); // KeyCode from last char in match, uppercase - keyCode = Character.toUpperCase(matcher.group().charAt( - match.length() - 1)); + keyCode = Character + .toUpperCase(matcher.group().charAt(match.length() - 1)); // Given modifiers override this indicated in the caption if (modifierKeys != null) { @@ -222,7 +222,7 @@ public class ShortcutAction extends Action { /** * When setting modifiers, make sure that modifiers is a valid array AND * that it's sorted. - * + * * @param modifiers * the modifier keys for this shortcut */ @@ -238,7 +238,7 @@ public class ShortcutAction extends Action { /** * Get the {@link KeyCode} that this shortcut reacts to (in combination with * the {@link ModifierKey}s). - * + * * @return keycode for this shortcut */ public int getKeyCode() { @@ -247,7 +247,7 @@ public class ShortcutAction extends Action { /** * Get the {@link ModifierKey}s required for the shortcut to react. - * + * * @return modifier keys for this shortcut */ public int[] getModifiers() { @@ -256,7 +256,7 @@ public class ShortcutAction extends Action { /** * Key codes that can be used for shortcuts - * + * */ public interface KeyCode extends Serializable { public static final int ENTER = 13; @@ -388,7 +388,7 @@ public class ShortcutAction extends Action { /** * Modifier key constants - * + * */ public interface ModifierKey extends Serializable { public static final int SHIFT = 16; diff --git a/server/src/main/java/com/vaadin/event/ShortcutListener.java b/server/src/main/java/com/vaadin/event/ShortcutListener.java index ccfe68d6fb..2c9fb97d9e 100644 --- a/server/src/main/java/com/vaadin/event/ShortcutListener.java +++ b/server/src/main/java/com/vaadin/event/ShortcutListener.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -18,8 +18,8 @@ package com.vaadin.event; import com.vaadin.event.Action.Listener; import com.vaadin.server.Resource; -public abstract class ShortcutListener extends ShortcutAction implements - Listener { +public abstract class ShortcutListener extends ShortcutAction + implements Listener { private static final long serialVersionUID = 1L; diff --git a/server/src/main/java/com/vaadin/event/SortEvent.java b/server/src/main/java/com/vaadin/event/SortEvent.java index f303e47781..645ae18c17 100644 --- a/server/src/main/java/com/vaadin/event/SortEvent.java +++ b/server/src/main/java/com/vaadin/event/SortEvent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -24,9 +24,9 @@ import com.vaadin.ui.Component; /** * Event describing a change in sorting of a {@link Container}. Fired by * {@link SortNotifier SortNotifiers}. - * + * * @see SortListener - * + * * @since 7.4 * @author Vaadin Ltd */ @@ -37,7 +37,7 @@ public class SortEvent extends Component.Event { /** * Creates a new sort order change event with a sort order list. - * + * * @param source * the component from which the event originates * @param sortOrder @@ -55,7 +55,7 @@ public class SortEvent extends Component.Event { /** * Gets the sort order list. - * + * * @return the sort order list */ public List getSortOrder() { @@ -64,7 +64,7 @@ public class SortEvent extends Component.Event { /** * Returns whether this event originated from actions done by the user. - * + * * @return true if sort event originated from user interaction */ public boolean isUserOriginated() { @@ -77,7 +77,7 @@ public class SortEvent extends Component.Event { public interface SortListener extends Serializable { /** * Called when the sort order has changed. - * + * * @param event * the sort order change event */ @@ -92,7 +92,7 @@ public class SortEvent extends Component.Event { /** * Adds a sort order change listener that gets notified when the sort * order changes. - * + * * @param listener * the sort order change listener to add */ @@ -101,7 +101,7 @@ public class SortEvent extends Component.Event { /** * Removes a sort order change listener previously added using * {@link #addSortListener(SortListener)}. - * + * * @param listener * the sort order change listener to remove */ diff --git a/server/src/main/java/com/vaadin/event/Transferable.java b/server/src/main/java/com/vaadin/event/Transferable.java index 9cfbba5161..a0361e0bbb 100644 --- a/server/src/main/java/com/vaadin/event/Transferable.java +++ b/server/src/main/java/com/vaadin/event/Transferable.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -23,7 +23,7 @@ import com.vaadin.ui.Component; /** * Transferable wraps the data that is to be imported into another component. * Currently Transferable is only used for drag and drop. - * + * * @since 6.3 */ public interface Transferable extends Serializable { @@ -35,7 +35,7 @@ public interface Transferable extends Serializable { *

      * Note, implementations of {@link Transferable} often provide a better * typed API for accessing data. - * + * * @param dataFlavor * the data flavor to be returned from Transferable * @return the data stored in the Transferable or null if Transferable @@ -46,7 +46,7 @@ public interface Transferable extends Serializable { /** * Stores data of given data flavor to Transferable. Possibly existing value * of the same data flavor will be replaced. - * + * * @param dataFlavor * the data flavor * @param value diff --git a/server/src/main/java/com/vaadin/event/TransferableImpl.java b/server/src/main/java/com/vaadin/event/TransferableImpl.java index 9c8e79f1bf..6ec867daf0 100644 --- a/server/src/main/java/com/vaadin/event/TransferableImpl.java +++ b/server/src/main/java/com/vaadin/event/TransferableImpl.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -23,7 +23,7 @@ import com.vaadin.ui.Component; /** * TODO Javadoc! - * + * * @since 6.3 */ public class TransferableImpl implements Transferable { diff --git a/server/src/main/java/com/vaadin/event/UIEvents.java b/server/src/main/java/com/vaadin/event/UIEvents.java index e986386da8..83e24887f7 100644 --- a/server/src/main/java/com/vaadin/event/UIEvents.java +++ b/server/src/main/java/com/vaadin/event/UIEvents.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,7 +25,7 @@ import com.vaadin.util.ReflectTools; /** * A class that contains events, listeners and handlers specific to the * {@link UI} class. - * + * * @since 7.2 * @author Vaadin Ltd */ @@ -34,17 +34,17 @@ public interface UIEvents { /** * A {@link PollListener} receives and handles {@link PollEvent PollEvents} * fired by {@link PollNotifier PollNotifiers}. - * + * * @since 7.2 * @author Vaadin Ltd */ public interface PollListener extends Serializable { - public static final Method POLL_METHOD = ReflectTools.findMethod( - PollListener.class, "poll", PollEvent.class); + public static final Method POLL_METHOD = ReflectTools + .findMethod(PollListener.class, "poll", PollEvent.class); /** * A poll request has been received by the server. - * + * * @param event * poll event */ @@ -54,7 +54,7 @@ public interface UIEvents { /** * An event that is fired whenever a client polls the server for * asynchronous UI updates. - * + * * @since 7.2 * @author Vaadin Ltd */ @@ -65,7 +65,7 @@ public interface UIEvents { /** * Get the {@link UI} instance that received the poll request. - * + * * @return the {@link UI} that received the poll request. Never * null. */ @@ -85,7 +85,7 @@ public interface UIEvents { * able to send {@link PollEvent PollEvents} whenever the client sends a * periodic poll message to the client, to check for asynchronous * server-side modifications. - * + * * @since 7.2 * @see UI#setPollInterval(int) */ @@ -95,7 +95,7 @@ public interface UIEvents { *

      * The listener is called whenever the client polls the server for * asynchronous UI updates. - * + * * @see UI#setPollInterval(int) * @see #removePollListener(PollListener) * @param listener @@ -105,7 +105,7 @@ public interface UIEvents { /** * Remove a poll listener. - * + * * @see #addPollListener(PollListener) * @param listener * the listener to be removed diff --git a/server/src/main/java/com/vaadin/event/dd/DragAndDropEvent.java b/server/src/main/java/com/vaadin/event/dd/DragAndDropEvent.java index 661c7ed1cc..a2668b67b6 100644 --- a/server/src/main/java/com/vaadin/event/dd/DragAndDropEvent.java +++ b/server/src/main/java/com/vaadin/event/dd/DragAndDropEvent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -29,9 +29,9 @@ import com.vaadin.event.dd.acceptcriteria.AcceptCriterion; * DragAndDropEvent instances contains both the dragged data in * {@link Transferable} (generated by {@link DragSource} and details about the * current drop event in {@link TargetDetails} (generated by {@link DropTarget}. - * + * * @since 6.3 - * + * */ public class DragAndDropEvent implements Serializable { private Transferable transferable; diff --git a/server/src/main/java/com/vaadin/event/dd/DragSource.java b/server/src/main/java/com/vaadin/event/dd/DragSource.java index 8e4d43bfc4..db576906e7 100644 --- a/server/src/main/java/com/vaadin/event/dd/DragSource.java +++ b/server/src/main/java/com/vaadin/event/dd/DragSource.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -33,16 +33,16 @@ import com.vaadin.ui.Tree; * implementation lets it create the {@link Transferable} instance from the raw * client side "seed data". This way server side implementation may translate or * extend the data that will be available for {@link DropHandler}. - * + * * @since 6.3 - * + * */ public interface DragSource extends Component { /** * DragSource may convert data added by client side component to meaningful * values for server side developer or add other data based on it. - * + * *

      * For example Tree converts item identifiers to generated string keys for * the client side. Vaadin developer don't and can't know anything about @@ -51,7 +51,7 @@ public interface DragSource extends Component { * counterpart. In {@link Tree#getTransferable(Map)} the key is converted * back to item identifier that the server side developer can use. *

      - * + * * @since 6.3 * @param rawVariables * the data that client side initially included in diff --git a/server/src/main/java/com/vaadin/event/dd/DropHandler.java b/server/src/main/java/com/vaadin/event/dd/DropHandler.java index c45ae7e7d3..0e0387741a 100644 --- a/server/src/main/java/com/vaadin/event/dd/DropHandler.java +++ b/server/src/main/java/com/vaadin/event/dd/DropHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -29,9 +29,9 @@ import com.vaadin.event.dd.acceptcriteria.ServerSideCriterion; * data and the {@link #getAcceptCriterion()} method contains the (possibly * client side verifiable) criterion whether the dragged data will be handled at * all. - * + * * @since 6.3 - * + * */ public interface DropHandler extends Serializable { @@ -41,7 +41,7 @@ public interface DropHandler extends Serializable { * {@link AcceptCriterion} defined by {@link #getAcceptCriterion()} method. * The actual business logic of drag and drop operation is implemented into * this method. - * + * * @param event * the event related to this drop */ @@ -65,7 +65,7 @@ public interface DropHandler extends Serializable { * If developer wants to handle everything in the * {@link #drop(DragAndDropEvent)} method, {@link AcceptAll} instance can be * returned. - * + * * @return the {@link AcceptCriterion} */ public AcceptCriterion getAcceptCriterion(); diff --git a/server/src/main/java/com/vaadin/event/dd/DropTarget.java b/server/src/main/java/com/vaadin/event/dd/DropTarget.java index f96170cf98..41e2c10b99 100644 --- a/server/src/main/java/com/vaadin/event/dd/DropTarget.java +++ b/server/src/main/java/com/vaadin/event/dd/DropTarget.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -23,7 +23,7 @@ import com.vaadin.ui.Component; * DropTarget is an interface for components supporting drop operations. A * component that wants to receive drop events should implement this interface * and provide a {@link DropHandler} which will handle the actual drop event. - * + * * @since 6.3 */ public interface DropTarget extends Component { @@ -40,9 +40,9 @@ public interface DropTarget extends Component { * target details provided by the client side (drop target) to meaningful * server side values. If null is returned the terminal implementation will * automatically create a {@link TargetDetails} with raw client side data. - * + * * @see DragSource#getTransferable(Map) - * + * * @param clientVariables * data passed from the DropTargets client side counterpart. * @return A DropTargetDetails object with the translated data or null to diff --git a/server/src/main/java/com/vaadin/event/dd/TargetDetails.java b/server/src/main/java/com/vaadin/event/dd/TargetDetails.java index b5635bc2a8..0e1b07b7c9 100644 --- a/server/src/main/java/com/vaadin/event/dd/TargetDetails.java +++ b/server/src/main/java/com/vaadin/event/dd/TargetDetails.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -27,15 +27,15 @@ import com.vaadin.ui.Tree.TreeTargetDetails; * preferable to cast the TargetDetails to an implementation provided by * DropTarget like {@link TreeTargetDetails}. They often provide a better typed, * drop target specific API. - * + * * @since 6.3 - * + * */ public interface TargetDetails extends Serializable { /** * Gets target data associated with the given string key - * + * * @param key * @return The data associated with the key */ diff --git a/server/src/main/java/com/vaadin/event/dd/TargetDetailsImpl.java b/server/src/main/java/com/vaadin/event/dd/TargetDetailsImpl.java index 8a6ec506ba..26ca938cac 100644 --- a/server/src/main/java/com/vaadin/event/dd/TargetDetailsImpl.java +++ b/server/src/main/java/com/vaadin/event/dd/TargetDetailsImpl.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -23,9 +23,9 @@ import com.vaadin.shared.MouseEventDetails; /** * A HashMap backed implementation of {@link TargetDetails} for terminal * implementation and for extension. - * + * * @since 6.3 - * + * */ @SuppressWarnings("serial") public class TargetDetailsImpl implements TargetDetails { diff --git a/server/src/main/java/com/vaadin/event/dd/acceptcriteria/AcceptAll.java b/server/src/main/java/com/vaadin/event/dd/acceptcriteria/AcceptAll.java index fa6a4c2b9a..f698a64652 100644 --- a/server/src/main/java/com/vaadin/event/dd/acceptcriteria/AcceptAll.java +++ b/server/src/main/java/com/vaadin/event/dd/acceptcriteria/AcceptAll.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -14,7 +14,7 @@ * the License. */ /** - * + * */ package com.vaadin.event.dd.acceptcriteria; @@ -24,10 +24,10 @@ import com.vaadin.event.dd.DragAndDropEvent; * Criterion that accepts all drops anywhere on the component. *

      * Note! Class is singleton, use {@link #get()} method to get the instance. - * - * + * + * * @since 6.3 - * + * */ public final class AcceptAll extends ClientSideCriterion { diff --git a/server/src/main/java/com/vaadin/event/dd/acceptcriteria/AcceptCriterion.java b/server/src/main/java/com/vaadin/event/dd/acceptcriteria/AcceptCriterion.java index a968cd8741..a5ef7fc896 100644 --- a/server/src/main/java/com/vaadin/event/dd/acceptcriteria/AcceptCriterion.java +++ b/server/src/main/java/com/vaadin/event/dd/acceptcriteria/AcceptCriterion.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -14,7 +14,7 @@ * the License. */ /** - * + * */ package com.vaadin.event.dd.acceptcriteria; @@ -29,23 +29,23 @@ import com.vaadin.server.PaintTarget; /** * Criterion that can be used create policy to accept/discard dragged content * (presented by {@link Transferable}). - * + * * The drag and drop mechanism will verify the criteria returned by * {@link DropHandler#getAcceptCriterion()} before calling * {@link DropHandler#drop(DragAndDropEvent)}. - * + * * The criteria can be evaluated either on the client (browser - see * {@link ClientSideCriterion}) or on the server (see * {@link ServerSideCriterion}). If no constraints are needed, an * {@link AcceptAll} can be used. - * + * * In addition to accepting or rejecting a possible drop, criteria can provide * additional hints for client side painting. - * + * * @see DropHandler * @see ClientSideCriterion * @see ServerSideCriterion - * + * * @since 6.3 */ public interface AcceptCriterion extends Serializable { @@ -53,7 +53,7 @@ public interface AcceptCriterion extends Serializable { /** * Returns whether the criteria can be checked on the client or whether a * server request is needed to check the criteria. - * + * * This requirement may depend on the state of the criterion (e.g. logical * operations between criteria), so this cannot be based on a marker * interface. @@ -67,7 +67,7 @@ public interface AcceptCriterion extends Serializable { * initialization. The UIDL painted in this method will be passed to client * side drop handler implementation. Implementation can assume that * {@link #accept(DragAndDropEvent)} is called before this method. - * + * * @param target * @throws PaintException */ @@ -79,7 +79,7 @@ public interface AcceptCriterion extends Serializable { *

      * Note that even if your criterion is validated on client side, you should * always validate the data on server side too. - * + * * @param dragEvent * @return */ diff --git a/server/src/main/java/com/vaadin/event/dd/acceptcriteria/And.java b/server/src/main/java/com/vaadin/event/dd/acceptcriteria/And.java index b2fc1b1b94..01bc354ae8 100644 --- a/server/src/main/java/com/vaadin/event/dd/acceptcriteria/And.java +++ b/server/src/main/java/com/vaadin/event/dd/acceptcriteria/And.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -14,7 +14,7 @@ * the License. */ /** - * + * */ package com.vaadin.event.dd.acceptcriteria; @@ -25,11 +25,11 @@ import com.vaadin.server.PaintTarget; /** * A compound criterion that accepts the drag if all of its criteria accepts the * drag. - * + * * @see Or - * + * * @since 6.3 - * + * */ public class And extends ClientSideCriterion { @@ -37,7 +37,7 @@ public class And extends ClientSideCriterion { protected ClientSideCriterion[] criteria; /** - * + * * @param criteria * criteria of which the And criterion will be composed */ diff --git a/server/src/main/java/com/vaadin/event/dd/acceptcriteria/ClientSideCriterion.java b/server/src/main/java/com/vaadin/event/dd/acceptcriteria/ClientSideCriterion.java index 6bb227a95e..8ce8f04773 100644 --- a/server/src/main/java/com/vaadin/event/dd/acceptcriteria/ClientSideCriterion.java +++ b/server/src/main/java/com/vaadin/event/dd/acceptcriteria/ClientSideCriterion.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -24,23 +24,23 @@ import com.vaadin.server.PaintTarget; * Parent class for criteria that can be completely validated on client side. * All classes that provide criteria that can be completely validated on client * side should extend this class. - * + * * It is recommended that subclasses of ClientSideCriterion re-validate the * condition on the server side in * {@link AcceptCriterion#accept(com.vaadin.event.dd.DragAndDropEvent)} after * the client side validation has accepted a transfer. - * + * * @since 6.3 */ -public abstract class ClientSideCriterion implements Serializable, - AcceptCriterion { +public abstract class ClientSideCriterion + implements Serializable, AcceptCriterion { /* * All criteria that extend this must be completely validatable on client * side. - * + * * (non-Javadoc) - * + * * @see * com.vaadin.event.dd.acceptCriteria.AcceptCriterion#isClientSideVerifiable * () diff --git a/server/src/main/java/com/vaadin/event/dd/acceptcriteria/ContainsDataFlavor.java b/server/src/main/java/com/vaadin/event/dd/acceptcriteria/ContainsDataFlavor.java index 57f4d8253b..28285647ca 100644 --- a/server/src/main/java/com/vaadin/event/dd/acceptcriteria/ContainsDataFlavor.java +++ b/server/src/main/java/com/vaadin/event/dd/acceptcriteria/ContainsDataFlavor.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -14,7 +14,7 @@ * the License. */ /** - * + * */ package com.vaadin.event.dd.acceptcriteria; @@ -27,7 +27,7 @@ import com.vaadin.server.PaintTarget; * A Criterion that checks whether {@link Transferable} contains given data * flavor. The developer might for example accept the incoming data only if it * contains "Url" or "Text". - * + * * @since 6.3 */ public class ContainsDataFlavor extends ClientSideCriterion { @@ -36,7 +36,7 @@ public class ContainsDataFlavor extends ClientSideCriterion { /** * Constructs a new instance of {@link ContainsDataFlavor}. - * + * * @param dataFlawor * the type of data that will be checked from * {@link Transferable} diff --git a/server/src/main/java/com/vaadin/event/dd/acceptcriteria/Not.java b/server/src/main/java/com/vaadin/event/dd/acceptcriteria/Not.java index 95f96bbf08..da50d7f3e3 100644 --- a/server/src/main/java/com/vaadin/event/dd/acceptcriteria/Not.java +++ b/server/src/main/java/com/vaadin/event/dd/acceptcriteria/Not.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -14,7 +14,7 @@ * the License. */ /** - * + * */ package com.vaadin.event.dd.acceptcriteria; @@ -24,9 +24,9 @@ import com.vaadin.server.PaintTarget; /** * Criterion that wraps another criterion and inverts its return value. - * + * * @since 6.3 - * + * */ public class Not extends ClientSideCriterion { diff --git a/server/src/main/java/com/vaadin/event/dd/acceptcriteria/Or.java b/server/src/main/java/com/vaadin/event/dd/acceptcriteria/Or.java index e300606464..842df2ca20 100644 --- a/server/src/main/java/com/vaadin/event/dd/acceptcriteria/Or.java +++ b/server/src/main/java/com/vaadin/event/dd/acceptcriteria/Or.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -14,7 +14,7 @@ * the License. */ /** - * + * */ package com.vaadin.event.dd.acceptcriteria; @@ -25,11 +25,11 @@ import com.vaadin.server.PaintTarget; /** * A compound criterion that accepts the drag if any of its criterion accepts * it. - * + * * @see And - * + * * @since 6.3 - * + * */ public class Or extends ClientSideCriterion { private static final long serialVersionUID = 1L; diff --git a/server/src/main/java/com/vaadin/event/dd/acceptcriteria/ServerSideCriterion.java b/server/src/main/java/com/vaadin/event/dd/acceptcriteria/ServerSideCriterion.java index 8b769ee031..dc54231f87 100644 --- a/server/src/main/java/com/vaadin/event/dd/acceptcriteria/ServerSideCriterion.java +++ b/server/src/main/java/com/vaadin/event/dd/acceptcriteria/ServerSideCriterion.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -32,14 +32,14 @@ import com.vaadin.server.PaintTarget; * As all server side state can be used to make a decision, this is more * flexible than {@link ClientSideCriterion}. However, this does require * additional requests from the browser to the server during a drag operation. - * + * * @see AcceptCriterion * @see ClientSideCriterion - * + * * @since 6.3 */ -public abstract class ServerSideCriterion implements Serializable, - AcceptCriterion { +public abstract class ServerSideCriterion + implements Serializable, AcceptCriterion { private static final long serialVersionUID = 2128510128911628902L; diff --git a/server/src/main/java/com/vaadin/event/dd/acceptcriteria/SourceIs.java b/server/src/main/java/com/vaadin/event/dd/acceptcriteria/SourceIs.java index 8e9fdecdae..c7da61739b 100644 --- a/server/src/main/java/com/vaadin/event/dd/acceptcriteria/SourceIs.java +++ b/server/src/main/java/com/vaadin/event/dd/acceptcriteria/SourceIs.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -14,7 +14,7 @@ * the License. */ /** - * + * */ package com.vaadin.event.dd.acceptcriteria; @@ -30,7 +30,7 @@ import com.vaadin.ui.Component; /** * Client side criteria that checks if the drag source is one of the given * components. - * + * * @since 6.3 */ @SuppressWarnings("serial") @@ -51,11 +51,10 @@ public class SourceIs extends ClientSideCriterion { if (c.isAttached()) { target.addAttribute("component" + paintedComponents++, c); } else { - Logger.getLogger(SourceIs.class.getName()) - .log(Level.WARNING, - "SourceIs component {0} at index {1} is not attached to the component hierachy and will thus be ignored", - new Object[] { c.getClass().getName(), - Integer.valueOf(i) }); + Logger.getLogger(SourceIs.class.getName()).log(Level.WARNING, + "SourceIs component {0} at index {1} is not attached to the component hierachy and will thus be ignored", + new Object[] { c.getClass().getName(), + Integer.valueOf(i) }); } } target.addAttribute("c", paintedComponents); diff --git a/server/src/main/java/com/vaadin/event/dd/acceptcriteria/SourceIsTarget.java b/server/src/main/java/com/vaadin/event/dd/acceptcriteria/SourceIsTarget.java index c49f126941..07199ab7d5 100644 --- a/server/src/main/java/com/vaadin/event/dd/acceptcriteria/SourceIsTarget.java +++ b/server/src/main/java/com/vaadin/event/dd/acceptcriteria/SourceIsTarget.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -14,7 +14,7 @@ * the License. */ /** - * + * */ package com.vaadin.event.dd.acceptcriteria; @@ -27,15 +27,15 @@ import com.vaadin.ui.Table; import com.vaadin.ui.Tree; /** - * + * * A criterion that ensures the drag source is the same as drop target. Eg. * {@link Tree} or {@link Table} could support only re-ordering of items, but no * {@link Transferable}s coming outside. *

      * Note! Class is singleton, use {@link #get()} method to get the instance. - * + * * @since 6.3 - * + * */ public class SourceIsTarget extends ClientSideCriterion { diff --git a/server/src/main/java/com/vaadin/event/dd/acceptcriteria/TargetDetailIs.java b/server/src/main/java/com/vaadin/event/dd/acceptcriteria/TargetDetailIs.java index 42fb5dfa11..289db3f1e3 100644 --- a/server/src/main/java/com/vaadin/event/dd/acceptcriteria/TargetDetailIs.java +++ b/server/src/main/java/com/vaadin/event/dd/acceptcriteria/TargetDetailIs.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -14,7 +14,7 @@ * the License. */ /** - * + * */ package com.vaadin.event.dd.acceptcriteria; @@ -26,11 +26,11 @@ import com.vaadin.server.PaintTarget; /** * Criterion for checking if drop target details contains the specific property * with the specific value. Currently only String values are supported. - * + * * @since 6.3 - * + * * TODO add support for other basic data types that we support in UIDL. - * + * */ public class TargetDetailIs extends ClientSideCriterion { @@ -41,7 +41,7 @@ public class TargetDetailIs extends ClientSideCriterion { /** * Constructs a criterion which ensures that the value there is a value in * {@link TargetDetails} that equals the reference value. - * + * * @param dataFlavor * the type of data to be checked * @param value diff --git a/server/src/main/java/com/vaadin/navigator/NavigationStateManager.java b/server/src/main/java/com/vaadin/navigator/NavigationStateManager.java index 3e9c54c961..cb0996b7fc 100644 --- a/server/src/main/java/com/vaadin/navigator/NavigationStateManager.java +++ b/server/src/main/java/com/vaadin/navigator/NavigationStateManager.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -28,7 +28,7 @@ import java.io.Serializable; * portlet URL navigation and other similar systems. *

      * This interface is mostly for internal use by Navigator. - * + * * @author Vaadin Ltd * @since 7.0 */ @@ -36,7 +36,7 @@ public interface NavigationStateManager extends Serializable { /** * Returns the current navigation state including view name and any optional * parameters. - * + * * @return current view and parameter string, not null */ public String getState(); @@ -46,7 +46,7 @@ public interface NavigationStateManager extends Serializable { * location, including view name and any optional parameters. *

      * This method should be only called by a Navigator. - * + * * @param fragment * new view and parameter string, not null */ diff --git a/server/src/main/java/com/vaadin/navigator/Navigator.java b/server/src/main/java/com/vaadin/navigator/Navigator.java index 1fb18adde1..88f25d112b 100644 --- a/server/src/main/java/com/vaadin/navigator/Navigator.java +++ b/server/src/main/java/com/vaadin/navigator/Navigator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -17,13 +17,13 @@ package com.vaadin.navigator; /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -62,7 +62,7 @@ import com.vaadin.ui.UI; *

      * Note that {@link Navigator} is not a component itself but uses a * {@link ViewDisplay} to update contents based on the state. - * + * * @author Vaadin Ltd * @since 7.0 */ @@ -100,15 +100,15 @@ public class Navigator implements Serializable { * This class is mostly for internal use by Navigator, and is only public * and static to enable testing. */ - public static class UriFragmentManager implements NavigationStateManager, - UriFragmentChangedListener { + public static class UriFragmentManager + implements NavigationStateManager, UriFragmentChangedListener { private final Page page; private Navigator navigator; /** * Creates a new URIFragmentManager and attach it to listen to URI * fragment changes of a {@link Page}. - * + * * @param page * page whose URI fragment to get and modify */ @@ -148,7 +148,7 @@ public class Navigator implements Serializable { /** * Returns the current URI fragment tracked by this UriFragentManager. - * + * * @return The URI fragment. */ protected String getFragment() { @@ -157,7 +157,7 @@ public class Navigator implements Serializable { /** * Sets the URI fragment to the given string. - * + * * @param fragment * The new URI fragment. */ @@ -195,8 +195,8 @@ public class Navigator implements Serializable { container.removeAllComponents(); container.addComponent((Component) view); } else { - throw new IllegalArgumentException("View is not a component: " - + view); + throw new IllegalArgumentException( + "View is not a component: " + view); } } } @@ -209,8 +209,8 @@ public class Navigator implements Serializable { * Attempting to display a view that is not a component causes an exception * to be thrown. */ - public static class SingleComponentContainerViewDisplay implements - ViewDisplay { + public static class SingleComponentContainerViewDisplay + implements ViewDisplay { private final SingleComponentContainer container; @@ -228,8 +228,8 @@ public class Navigator implements Serializable { if (view instanceof Component) { container.setContent((Component) view); } else { - throw new IllegalArgumentException("View is not a component: " - + view); + throw new IllegalArgumentException( + "View is not a component: " + view); } } } @@ -237,7 +237,7 @@ public class Navigator implements Serializable { /** * A ViewProvider which supports mapping a single view name to a single * pre-initialized view instance. - * + * * For most cases, ClassBasedViewProvider should be used instead of this. */ public static class StaticViewProvider implements ViewProvider { @@ -247,7 +247,7 @@ public class Navigator implements Serializable { /** * Creates a new view provider which returns a pre-created view * instance. - * + * * @param viewName * name of the view (not null) * @param view @@ -281,7 +281,7 @@ public class Navigator implements Serializable { /** * Get the view name for this provider. - * + * * @return view name for this provider */ public String getViewName() { @@ -306,7 +306,7 @@ public class Navigator implements Serializable { /** * Create a new view provider which creates new view instances based on * a view class. - * + * * @param viewName * name of the views to create (not null) * @param viewClass @@ -353,7 +353,7 @@ public class Navigator implements Serializable { /** * Get the view name for this provider. - * + * * @return view name for this provider */ public String getViewName() { @@ -362,7 +362,7 @@ public class Navigator implements Serializable { /** * Get the view class for this provider. - * + * * @return {@link View} class */ public Class getViewClass() { @@ -393,7 +393,7 @@ public class Navigator implements Serializable { * navigator, {@code navigator.navigateTo(navigator.getState())} may need to * be explicitly called to ensure the current view matches the navigation * state. - * + * * @param ui * The UI to which this Navigator is attached. * @param container @@ -416,7 +416,7 @@ public class Navigator implements Serializable { * navigator, {@code navigator.navigateTo(navigator.getState())} may need to * be explicitly called to ensure the current view matches the navigation * state. - * + * * @param ui * The UI to which this Navigator is attached. * @param container @@ -436,7 +436,7 @@ public class Navigator implements Serializable { * navigator, {@code navigator.navigateTo(navigator.getState())} may need to * be explicitly called to ensure the current view matches the navigation * state. - * + * * @param ui * The UI to which this Navigator is attached. * @param display @@ -457,7 +457,7 @@ public class Navigator implements Serializable { * navigator, {@code navigator.navigateTo(navigator.getState())} may need to * be explicitly called to ensure the current view matches the navigation * state. - * + * * @param ui * The UI to which this Navigator is attached. * @param stateManager @@ -477,7 +477,7 @@ public class Navigator implements Serializable { * Creates a navigator. This method is for use by dependency injection * frameworks etc. and must be followed by a call to * {@link #init(UI, NavigationStateManager, ViewDisplay)} before use. - * + * * @since 7.6 */ protected Navigator() { @@ -535,10 +535,10 @@ public class Navigator implements Serializable { *

      * Registered {@link ViewChangeListener}s are called upon successful view * change. - * + * * @param navigationState * view name and parameters - * + * * @throws IllegalArgumentException * if navigationState does not map to a known view * and no error view is registered @@ -561,8 +561,7 @@ public class Navigator implements Serializable { if (viewWithLongestName == null) { throw new IllegalArgumentException( - "Trying to navigate to an unknown state '" - + navigationState + "Trying to navigate to an unknown state '" + navigationState + "' and an error view provider not present"); } @@ -576,7 +575,8 @@ public class Navigator implements Serializable { } if (getCurrentView() == null || !SharedUtil.equals(getCurrentView(), viewWithLongestName) - || !SharedUtil.equals(currentNavigationState, navigationState)) { + || !SharedUtil.equals(currentNavigationState, + navigationState)) { navigateTo(viewWithLongestName, longestViewName, parameters); } else { updateNavigationState(new ViewChangeEvent(this, getCurrentView(), @@ -590,7 +590,7 @@ public class Navigator implements Serializable { *

      * This method also verifies that the user is allowed to perform the * navigation operation. - * + * * @param view * view to activate * @param viewName @@ -626,10 +626,10 @@ public class Navigator implements Serializable { /** * Check whether view change is allowed by view change listeners ( * {@link ViewChangeListener#beforeViewChange(ViewChangeEvent)}). - * + * * This method can be overridden to extend the behavior, and should not be * called directly except by {@link #navigateTo(View, String, String)}. - * + * * @since 7.6 * @param event * the event to fire as the before view change event @@ -644,12 +644,12 @@ public class Navigator implements Serializable { * method can be called by {@link #navigateTo(View, String, String)} to * revert the URL fragment to point to the previous view to which navigation * succeeded. - * + * * This method should only be called by * {@link #navigateTo(View, String, String)}. Normally it should not be * overridden, but can be by frameworks that need to hook into view change * cancellations of this type. - * + * * @since 7.6 */ protected void revertNavigation() { @@ -661,11 +661,11 @@ public class Navigator implements Serializable { /** * Update the internal state of the navigator (parameters, previous * successful URL fragment navigated to) when navigation succeeds. - * + * * Normally this method should not be overridden nor called directly from * application code, but it can be called by a custom implementation of * {@link #navigateTo(View, String, String)}. - * + * * @since 7.6 * @param event * a view change event with details of the change @@ -688,12 +688,12 @@ public class Navigator implements Serializable { /** * Update the internal state of the navigator to reflect the actual * switching of views. - * + * * This method should only be called by * {@link #navigateTo(View, String, String)} between showing the view and * calling {@link View#enter(ViewChangeEvent)}. If this method is * overridden, the overriding version must call the super method. - * + * * @since 7.6 * @param event * a view change event with details of the change @@ -712,7 +712,7 @@ public class Navigator implements Serializable { * The view change listeners may also e.g. open a warning or question dialog * and save the parameters to re-initiate the navigation operation upon user * action. - * + * * @param event * view change event (not null, view change not yet performed) * @return true if the view change should be allowed, false to silently @@ -722,7 +722,8 @@ public class Navigator implements Serializable { // a copy of the listener list is needed to avoid // ConcurrentModificationException as a listener can add/remove // listeners - for (ViewChangeListener l : new ArrayList(listeners)) { + for (ViewChangeListener l : new ArrayList( + listeners)) { if (!l.beforeViewChange(event)) { return false; } @@ -733,7 +734,7 @@ public class Navigator implements Serializable { /** * Returns the {@link NavigationStateManager} that is used to get, listen to * and manipulate the navigation state used by this Navigator. - * + * * @return NavigationStateManager in use */ protected NavigationStateManager getStateManager() { @@ -743,7 +744,7 @@ public class Navigator implements Serializable { /** * Returns the current navigation state reported by this Navigator's * {@link NavigationStateManager}. - * + * * @return The navigation state. */ public String getState() { @@ -752,7 +753,7 @@ public class Navigator implements Serializable { /** * Return the {@link ViewDisplay} used by the navigator. - * + * * @return the ViewDisplay used for displaying views */ public ViewDisplay getDisplay() { @@ -777,7 +778,7 @@ public class Navigator implements Serializable { * Fires an event after the current view has changed. *

      * Listeners are called in registration order. - * + * * @param event * view change event (not null) */ @@ -785,7 +786,8 @@ public class Navigator implements Serializable { // a copy of the listener list is needed to avoid // ConcurrentModificationException as a listener can add/remove // listeners - for (ViewChangeListener l : new ArrayList(listeners)) { + for (ViewChangeListener l : new ArrayList( + listeners)) { l.afterViewChange(event); } } @@ -798,7 +800,7 @@ public class Navigator implements Serializable { *

      * Note that a view should not be shared between UIs (for instance, it * should not be a static field in a UI subclass). - * + * * @param viewName * String that identifies a view (not null nor empty string) * @param view @@ -823,7 +825,7 @@ public class Navigator implements Serializable { * overwrites the old registration of the same type. *

      * A new view instance is created every time a view is requested. - * + * * @param viewName * String that identifies a view (not null nor empty string) * @param viewClass @@ -847,7 +849,7 @@ public class Navigator implements Serializable { *

      * This method only applies to views registered using * {@link #addView(String, View)} or {@link #addView(String, Class)}. - * + * * @param viewName * name of the view to remove */ @@ -874,7 +876,7 @@ public class Navigator implements Serializable { *

      * Providers are called in order of registration until one that can handle * the requested view name is found. - * + * * @param provider * provider to register, not null * @throws IllegalArgumentException @@ -890,7 +892,7 @@ public class Navigator implements Serializable { /** * Unregister a view provider (factory). - * + * * @param provider * provider to unregister */ @@ -906,7 +908,7 @@ public class Navigator implements Serializable { *

      * Note that an error view should not be shared between UIs (for instance, * it should not be a static field in a UI subclass). - * + * * @param viewClass * The View class whose instance should be used as the error * view. @@ -933,7 +935,7 @@ public class Navigator implements Serializable { * Registers a view that is displayed when no other view matches the * navigation state. This implicitly sets an appropriate error view provider * and overrides any previous {@link #setErrorProvider(ViewProvider)} call. - * + * * @param view * The View that should be used as the error view. */ @@ -957,7 +959,7 @@ public class Navigator implements Serializable { * navigation state, but could return different views for different states. * Its getViewName(String navigationState) should return * navigationState. - * + * * @param provider */ public void setErrorProvider(ViewProvider provider) { @@ -972,7 +974,7 @@ public class Navigator implements Serializable { * beforeViewChange()}) and after ( * {@link ViewChangeListener#afterViewChange(ViewChangeEvent) * afterViewChange()}) a view change occurs. - * + * * @param listener * Listener to invoke during a view change. */ @@ -982,7 +984,7 @@ public class Navigator implements Serializable { /** * Removes a view change listener. - * + * * @param listener * Listener to remove. */ @@ -992,7 +994,7 @@ public class Navigator implements Serializable { /** * Get view provider that handles the given {@code state}. - * + * * @param state * state string * @return suitable provider @@ -1002,9 +1004,8 @@ public class Navigator implements Serializable { ViewProvider longestViewNameProvider = null; for (ViewProvider provider : providers) { String viewName = provider.getViewName(state); - if (null != viewName - && (longestViewName == null || viewName.length() > longestViewName - .length())) { + if (null != viewName && (longestViewName == null + || viewName.length() > longestViewName.length())) { longestViewName = viewName; longestViewNameProvider = provider; } @@ -1015,7 +1016,7 @@ public class Navigator implements Serializable { /** * Creates view change event for given {@code view}, {@code viewName} and * {@code parameters}. - * + * * @since 7.6.7 * @return view change event */ diff --git a/server/src/main/java/com/vaadin/navigator/View.java b/server/src/main/java/com/vaadin/navigator/View.java index 76b76f5520..826a199fc3 100644 --- a/server/src/main/java/com/vaadin/navigator/View.java +++ b/server/src/main/java/com/vaadin/navigator/View.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -23,10 +23,10 @@ import com.vaadin.ui.Component; /** * Interface for all views controlled by the navigator. - * + * * Each view added to the navigator must implement this interface. Typically, a * view is a {@link Component}. - * + * * @author Vaadin Ltd * @since 7.0 */ @@ -34,16 +34,16 @@ public interface View extends Serializable { /** * This view is navigated to. - * + * * This method is always called before the view is shown on screen. * {@link ViewChangeEvent#getParameters() event.getParameters()} may contain * extra parameters relevant to the view. - * + * * @param event * ViewChangeEvent representing the view change that is * occurring. {@link ViewChangeEvent#getNewView() * event.getNewView()} returns this. - * + * */ public void enter(ViewChangeEvent event); } diff --git a/server/src/main/java/com/vaadin/navigator/ViewChangeListener.java b/server/src/main/java/com/vaadin/navigator/ViewChangeListener.java index 7d3f2b6044..18859d8c9e 100644 --- a/server/src/main/java/com/vaadin/navigator/ViewChangeListener.java +++ b/server/src/main/java/com/vaadin/navigator/ViewChangeListener.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,10 +21,10 @@ import java.util.EventObject; /** * Interface for listening to View changes before and after they occur. - * + * * Implementations of this interface can also block navigation between views * before it is performed. - * + * * @author Vaadin Ltd * @since 7.0 */ @@ -41,7 +41,7 @@ public interface ViewChangeListener extends Serializable { /** * Create a new view change event. - * + * * @param navigator * Navigator that triggered the event, not null */ @@ -56,7 +56,7 @@ public interface ViewChangeListener extends Serializable { /** * Returns the navigator that triggered this event. - * + * * @return Navigator (not null) */ public Navigator getNavigator() { @@ -65,7 +65,7 @@ public interface ViewChangeListener extends Serializable { /** * Returns the view being deactivated. - * + * * @return old View */ public View getOldView() { @@ -74,7 +74,7 @@ public interface ViewChangeListener extends Serializable { /** * Returns the view being activated. - * + * * @return new View */ public View getNewView() { @@ -83,7 +83,7 @@ public interface ViewChangeListener extends Serializable { /** * Returns the view name of the view being activated. - * + * * @return view name of the new View */ public String getViewName() { @@ -92,7 +92,7 @@ public interface ViewChangeListener extends Serializable { /** * Returns the parameters for the view being activated. - * + * * @return navigation parameters (potentially bookmarkable) for the new * view */ @@ -111,7 +111,7 @@ public interface ViewChangeListener extends Serializable { * know the view in question), it should return true. If any listener * returns false, the view change is not allowed and * afterViewChange() methods are not called. - * + * * @param event * view change event * @return true if the view change should be allowed or this listener does @@ -124,7 +124,7 @@ public interface ViewChangeListener extends Serializable { * method blocked the view change, this method is not called. Be careful of * unbounded recursion if you decide to change the view again in the * listener. - * + * * @param event * view change event */ diff --git a/server/src/main/java/com/vaadin/navigator/ViewDisplay.java b/server/src/main/java/com/vaadin/navigator/ViewDisplay.java index 36aa5dadc2..a5700ebbdd 100644 --- a/server/src/main/java/com/vaadin/navigator/ViewDisplay.java +++ b/server/src/main/java/com/vaadin/navigator/ViewDisplay.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,10 +20,10 @@ import java.io.Serializable; /** * Interface for displaying a view in an appropriate location. - * + * * The view display can be a component/layout itself or can modify a separate * layout. - * + * * @author Vaadin Ltd * @since 7.0 */ @@ -31,9 +31,9 @@ public interface ViewDisplay extends Serializable { /** * Remove previously shown view and show the newly selected view in its * place. - * + * * The parameters for the view have been set before this method is called. - * + * * @param view * new view to show */ diff --git a/server/src/main/java/com/vaadin/navigator/ViewProvider.java b/server/src/main/java/com/vaadin/navigator/ViewProvider.java index ecf4e51073..6846e63b60 100644 --- a/server/src/main/java/com/vaadin/navigator/ViewProvider.java +++ b/server/src/main/java/com/vaadin/navigator/ViewProvider.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,11 +21,11 @@ import java.io.Serializable; /** * A provider for view instances that can return pre-registered views or * dynamically create new views. - * + * * If multiple providers are used, {@link #getViewName(String)} of each is * called (in registration order) until one of them returns a non-null value. * The {@link #getView(String)} method of that provider is then used. - * + * * @author Vaadin Ltd * @since 7.0 */ @@ -34,7 +34,7 @@ public interface ViewProvider extends Serializable { * Extract the view name from a combined view name and parameter string. * This method should return a view name if and only if this provider * handles creation of such views. - * + * * @param viewAndParameters * string with view name and its fragment parameters (if given), * not null @@ -44,10 +44,10 @@ public interface ViewProvider extends Serializable { /** * Create or return a pre-created instance of a view. - * + * * The parameters for the view are set separately by the navigator when the * view is activated. - * + * * @param viewName * name of the view, not null * @return newly created view (null if none available for the view name) diff --git a/server/src/main/java/com/vaadin/server/AbstractClientConnector.java b/server/src/main/java/com/vaadin/server/AbstractClientConnector.java index c624663d50..ca850e4a66 100644 --- a/server/src/main/java/com/vaadin/server/AbstractClientConnector.java +++ b/server/src/main/java/com/vaadin/server/AbstractClientConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -50,12 +50,12 @@ import elemental.json.JsonObject; /** * 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, - MethodEventSource { +public abstract class AbstractClientConnector + implements ClientConnector, MethodEventSource { /** * A map from client to server RPC interface class name to the RPC call * manager that handles incoming RPC calls for that interface. @@ -135,7 +135,9 @@ public abstract class AbstractClientConnector implements ClientConnector, /* Documentation copied from interface */ @Override public void markAsDirty() { - assert getSession() == null || getSession().hasLock() : buildLockAssertMessage("markAsDirty()"); + assert getSession() == null + || getSession().hasLock() : buildLockAssertMessage( + "markAsDirty()"); UI uI = getUI(); if (uI != null) { uI.getConnectorTracker().markDirty(this); @@ -153,12 +155,12 @@ public abstract class AbstractClientConnector implements ClientConnector, /** * 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 @@ -167,18 +169,18 @@ public abstract class AbstractClientConnector implements ClientConnector, */ protected void registerRpc(T implementation, Class rpcInterfaceType) { - rpcManagerMap.put(rpcInterfaceType.getName(), new ServerRpcManager( - implementation, rpcInterfaceType)); + rpcManagerMap.put(rpcInterfaceType.getName(), + 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. */ @@ -202,7 +204,8 @@ public abstract class AbstractClientConnector implements ClientConnector, } @SuppressWarnings("unchecked") - private Class getServerRpcInterface(Class implementationClass) { + private Class getServerRpcInterface( + Class implementationClass) { Class serverRpcClass = null; if (implementationClass != null) { for (Class candidateInterface : implementationClass @@ -229,7 +232,7 @@ public abstract class AbstractClientConnector implements ClientConnector, * state will be sent to the client. Use {@code getState(false)} to avoid * marking the connector as dirty. *

      - * + * * @return The shared state for this connector. Never null. */ protected SharedState getState() { @@ -238,16 +241,18 @@ public abstract class AbstractClientConnector implements ClientConnector, /** * Returns the shared state for this connector. - * + * * @param markAsDirty * true if the connector should automatically be marked dirty, * false otherwise - * + * * @return The shared state for this connector. Never null. * @see #getState() */ protected SharedState getState(boolean markAsDirty) { - assert getSession() == null || getSession().hasLock() : buildLockAssertMessage("getState()"); + assert getSession() == null + || getSession().hasLock() : buildLockAssertMessage( + "getState()"); if (null == sharedState) { sharedState = createState(); @@ -279,18 +284,18 @@ public abstract class AbstractClientConnector implements ClientConnector, *

      * 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); + throw new RuntimeException("Error creating state of type " + + getStateType().getName() + " for " + getClass().getName(), + e); } } @@ -326,23 +331,23 @@ public abstract class AbstractClientConnector implements ClientConnector, // Try in superclass instead class1 = class1.getSuperclass(); } - throw new NoSuchMethodException(getClass().getCanonicalName() - + ".getState()"); + throw new NoSuchMethodException( + getClass().getCanonicalName() + ".getState()"); } catch (Exception e) { - throw new RuntimeException("Error finding state type for " - + getClass().getName(), 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 */ protected T getRpcProxy(final Class rpcInterface) { @@ -365,8 +370,8 @@ public abstract class AbstractClientConnector implements ClientConnector, } } - private class RpcInvocationHandler implements InvocationHandler, - Serializable { + private class RpcInvocationHandler + implements InvocationHandler, Serializable { private String rpcInterfaceName; @@ -390,14 +395,14 @@ public abstract class AbstractClientConnector implements ClientConnector, /** * 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, @@ -440,7 +445,7 @@ public abstract class AbstractClientConnector implements ClientConnector, /** * Finds the {@link VaadinSession} to which this connector belongs. If the * connector has not been attached, null is returned. - * + * * @return The connector's session, or null if not attached */ protected VaadinSession getSession() { @@ -456,7 +461,7 @@ public abstract class AbstractClientConnector implements ClientConnector, * 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. */ @@ -497,7 +502,7 @@ public abstract class AbstractClientConnector implements ClientConnector, /** * 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. @@ -568,7 +573,7 @@ public abstract class AbstractClientConnector implements ClientConnector, /** * 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 */ @@ -601,7 +606,7 @@ public abstract class AbstractClientConnector implements ClientConnector, /* * (non-Javadoc) - * + * * @see com.vaadin.server.ClientConnector#isAttached() */ @Override @@ -624,7 +629,7 @@ public abstract class AbstractClientConnector implements ClientConnector, /** * {@inheritDoc} - * + * *

      * The {@link #getSession()} and {@link #getUI()} methods might return * null after this method is called. @@ -681,12 +686,12 @@ public abstract class AbstractClientConnector implements ClientConnector, /** * Gets a resource defined using {@link #setResource(String, Resource)} with * the corresponding key. - * + * * @param key * the string identifier of the resource * @return a resource, or null if there's no resource * associated with the given key - * + * * @see #setResource(String, Resource) */ protected Resource getResource(String key) { @@ -700,7 +705,7 @@ public abstract class AbstractClientConnector implements ClientConnector, * connector using * {@link com.vaadin.terminal.gwt.client.ui.AbstractConnector#getResourceUrl(String)} * with the same key. - * + * * @param key * the string key to associate the resource with * @param resource @@ -708,8 +713,8 @@ public abstract class AbstractClientConnector implements ClientConnector, * association. */ protected void setResource(String key, Resource resource) { - ResourceReference resourceReference = ResourceReference.create( - resource, this, key); + ResourceReference resourceReference = ResourceReference.create(resource, + this, key); if (resourceReference == null) { getState().resources.remove(key); @@ -727,17 +732,17 @@ public abstract class AbstractClientConnector implements ClientConnector, * have any arguments the event object will not be passed to it when it's * called. *

      - * + * *

      * This method additionally informs the event-api to route events with the * given eventIdentifier to the components handleEvent function call. *

      - * + * *

      * For more information on the inheritable event mechanism see the * {@link com.vaadin.event com.vaadin.event package documentation}. *

      - * + * * @param eventIdentifier * the identifier of the event to listen for * @param eventType @@ -747,7 +752,7 @@ public abstract class AbstractClientConnector implements ClientConnector, * the object instance who owns the activation method. * @param method * the activation method. - * + * * @since 6.2 */ protected void addListener(String eventIdentifier, Class eventType, @@ -766,7 +771,7 @@ public abstract class AbstractClientConnector implements ClientConnector, /** * Checks if the given {@link Event} type is listened for this component. - * + * * @param eventType * the event type to be checked * @return true if a listener is registered for the given event type @@ -781,18 +786,18 @@ public abstract class AbstractClientConnector implements ClientConnector, * parameters, it will unregister all object's methods that are * registered to listen to events of type eventType generated * by this component. - * + * *

      * This method additionally informs the event-api to stop routing events * with the given eventIdentifier to the components handleEvent function * call. *

      - * + * *

      * For more information on the inheritable event mechanism see the * {@link com.vaadin.event com.vaadin.event package documentation}. *

      - * + * * @param eventIdentifier * the identifier of the event to stop listening for * @param eventType @@ -800,7 +805,7 @@ public abstract class AbstractClientConnector implements ClientConnector, * @param target * the target object that has registered to listen to events of * type eventType with one or more methods. - * + * * @since 6.2 */ protected void removeListener(String eventIdentifier, Class eventType, @@ -821,12 +826,12 @@ public abstract class AbstractClientConnector implements ClientConnector, * have any arguments the event object will not be passed to it when it's * called. *

      - * + * *

      * For more information on the inheritable event mechanism see the * {@link com.vaadin.event com.vaadin.event package documentation}. *

      - * + * * @param eventType * the type of the listened event. Events of this type or its * subclasses activate the listener. @@ -834,7 +839,7 @@ public abstract class AbstractClientConnector implements ClientConnector, * the object instance who owns the activation method. * @param method * the activation method. - * + * */ @Override public void addListener(Class eventType, Object target, Method method) { @@ -851,25 +856,25 @@ public abstract class AbstractClientConnector implements ClientConnector, * activation method does not have any arguments the event object will not * be passed to it when it's called. *

      - * + * *

      * This version of addListener gets the name of the activation * method as a parameter. The actual method is reflected from * object, and unless exactly one match is found, * java.lang.IllegalArgumentException is thrown. *

      - * + * *

      * For more information on the inheritable event mechanism see the * {@link com.vaadin.event com.vaadin.event package documentation}. *

      - * + * *

      * Note: Using this method is discouraged because it cannot be checked * during compilation. Use {@link #addListener(Class, Object, Method)} or * {@link #addListener(com.vaadin.ui.Component.Listener)} instead. *

      - * + * * @param eventType * the type of the listened event. Events of this type or its * subclasses activate the listener. @@ -883,7 +888,8 @@ public abstract class AbstractClientConnector implements ClientConnector, */ @Override @Deprecated - public void addListener(Class eventType, Object target, String methodName) { + public void addListener(Class eventType, Object target, + String methodName) { if (eventRouter == null) { eventRouter = new EventRouter(); } @@ -896,12 +902,12 @@ public abstract class AbstractClientConnector implements ClientConnector, * parameters, it will unregister all object's methods that are * registered to listen to events of type eventType generated * by this component. - * + * *

      * For more information on the inheritable event mechanism see the * {@link com.vaadin.event com.vaadin.event package documentation}. *

      - * + * * @param eventType * the exact event type the object listens to. * @param target @@ -919,12 +925,12 @@ public abstract class AbstractClientConnector implements ClientConnector, * Removes one registered listener method. The given method owned by the * given object will no longer be called when the specified events are * generated by this component. - * + * *

      * For more information on the inheritable event mechanism see the * {@link com.vaadin.event com.vaadin.event package documentation}. *

      - * + * * @param eventType * the exact event type the object listens to. * @param target @@ -935,7 +941,8 @@ public abstract class AbstractClientConnector implements ClientConnector, * listen to events of type eventType. */ @Override - public void removeListener(Class eventType, Object target, Method method) { + public void removeListener(Class eventType, Object target, + Method method) { if (eventRouter != null) { eventRouter.removeListener(eventType, target, method); } @@ -947,19 +954,19 @@ public abstract class AbstractClientConnector implements ClientConnector, * given object will no longer be called when the specified events are * generated by this component. *

      - * + * *

      * This version of removeListener gets the name of the * activation method as a parameter. The actual method is reflected from * target, and unless exactly one match is found, * java.lang.IllegalArgumentException is thrown. *

      - * + * *

      * For more information on the inheritable event mechanism see the * {@link com.vaadin.event com.vaadin.event package documentation}. *

      - * + * * @param eventType * the exact event type the object listens to. * @param target @@ -983,7 +990,7 @@ public abstract class AbstractClientConnector implements ClientConnector, /** * Returns all listeners that are registered for the given event type or one * of its subclasses. - * + * * @param eventType * The type of event to return listeners for. * @return A collection with all registered listeners. Empty if no listeners @@ -999,7 +1006,7 @@ public abstract class AbstractClientConnector implements ClientConnector, /** * Sends the event to all listeners. - * + * * @param event * the Event to be sent to all listeners. */ @@ -1011,7 +1018,7 @@ public abstract class AbstractClientConnector implements ClientConnector, /* * (non-Javadoc) - * + * * @see com.vaadin.server.ClientConnector#getErrorHandler() */ @Override @@ -1021,7 +1028,7 @@ public abstract class AbstractClientConnector implements ClientConnector, /* * (non-Javadoc) - * + * * @see com.vaadin.server.ClientConnector#setErrorHandler(com.vaadin.server. * ErrorHandler) */ @@ -1032,7 +1039,7 @@ public abstract class AbstractClientConnector implements ClientConnector, /* * (non-Javadoc) - * + * * @see java.lang.Object#equals(java.lang.Object) */ @Override @@ -1059,7 +1066,7 @@ public abstract class AbstractClientConnector implements ClientConnector, * by the proxy to actually be called on the underlying instance. *

      * See #14639 - * + * * @deprecated only defined for framework hacks, do not use. */ @Deprecated @@ -1069,7 +1076,7 @@ public abstract class AbstractClientConnector implements ClientConnector, /* * (non-Javadoc) - * + * * @see java.lang.Object#hashCode() */ @Override diff --git a/server/src/main/java/com/vaadin/server/AbstractDeploymentConfiguration.java b/server/src/main/java/com/vaadin/server/AbstractDeploymentConfiguration.java index 2554e421c8..b1e4413508 100644 --- a/server/src/main/java/com/vaadin/server/AbstractDeploymentConfiguration.java +++ b/server/src/main/java/com/vaadin/server/AbstractDeploymentConfiguration.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -18,13 +18,13 @@ package com.vaadin.server; /** * An abstract base class for DeploymentConfiguration implementations. This * class provides default implementation for common config properties. - * + * * @since 7.4 - * + * * @author Vaadin Ltd */ -public abstract class AbstractDeploymentConfiguration implements - DeploymentConfiguration { +public abstract class AbstractDeploymentConfiguration + implements DeploymentConfiguration { @Override public String getUIClassName() { diff --git a/server/src/main/java/com/vaadin/server/AbstractErrorMessage.java b/server/src/main/java/com/vaadin/server/AbstractErrorMessage.java index b56521993a..bbf0fa7240 100644 --- a/server/src/main/java/com/vaadin/server/AbstractErrorMessage.java +++ b/server/src/main/java/com/vaadin/server/AbstractErrorMessage.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -26,10 +26,10 @@ import com.vaadin.data.Validator; /** * 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 { @@ -46,7 +46,7 @@ public abstract class AbstractErrorMessage implements ErrorMessage { /** * Content mode, where the error contains HTML. - * + * */ HTML, } diff --git a/server/src/main/java/com/vaadin/server/AbstractExtension.java b/server/src/main/java/com/vaadin/server/AbstractExtension.java index c72cc9cb39..513084c179 100644 --- a/server/src/main/java/com/vaadin/server/AbstractExtension.java +++ b/server/src/main/java/com/vaadin/server/AbstractExtension.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,7 +25,7 @@ package com.vaadin.server; * 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 */ @@ -44,9 +44,9 @@ public abstract class AbstractExtension extends AbstractClientConnector /** * Creates a new extension instance that extends the provided connector. - * + * * @since 7.4 - * + * * @param target * the connector to extend */ @@ -59,7 +59,7 @@ public abstract class AbstractExtension extends AbstractClientConnector * 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() { @@ -69,7 +69,7 @@ public abstract class AbstractExtension extends AbstractClientConnector /** * 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 */ @@ -103,7 +103,7 @@ public abstract class AbstractExtension extends AbstractClientConnector /** * Actually sets the parent and calls required listeners. - * + * * @since 7.1 * @param parent * The parent to set diff --git a/server/src/main/java/com/vaadin/server/AbstractJavaScriptExtension.java b/server/src/main/java/com/vaadin/server/AbstractJavaScriptExtension.java index 0bfee4c20f..56e258ded8 100644 --- a/server/src/main/java/com/vaadin/server/AbstractJavaScriptExtension.java +++ b/server/src/main/java/com/vaadin/server/AbstractJavaScriptExtension.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -39,7 +39,7 @@ import elemental.json.JsonValue; * , 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. Please note that * in JavaScript, this is not necessarily defined inside callback @@ -92,16 +92,18 @@ import elemental.json.JsonValue; * the field, that function is called whenever the contents of the shared state * is changed. *

    • onUnregister - If the JavaScript code assigns a function to - * the field, that function is called when the connector has been unregistered.
    • + * the field, that function is called when the connector has been + * unregistered. *
    • 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.
    • + * 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: *

        @@ -113,7 +115,8 @@ import elemental.json.JsonValue; *
      • Java Strings are represented by JavaScript strings.
      • *
      • Java Dates are represented by JavaScript numbers containing the timestamp *
      • - *
      • List, Set and all arrays in Java are represented by JavaScript arrays.
      • + *
      • List, Set and all arrays in Java are represented by JavaScript + * arrays.
      • *
      • Map<String, ?> 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 @@ -127,7 +130,7 @@ import elemental.json.JsonValue; * here. Please refer to the documentation for specific types for serialization * information.
      • *
      - * + * * @author Vaadin Ltd * @since 7.0.0 */ @@ -145,9 +148,9 @@ public abstract class AbstractJavaScriptExtension extends AbstractExtension { /** * Creates a new JavaScript extension extending the provided connector. - * + * * @since 7.4 - * + * * @param target * the connector to extend */ @@ -170,14 +173,15 @@ public abstract class AbstractJavaScriptExtension extends AbstractExtension { * 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) { + protected void addFunction(String functionName, + JavaScriptFunction function) { callbackHelper.registerCallback(functionName, function); } @@ -190,7 +194,7 @@ public abstract class AbstractJavaScriptExtension extends AbstractExtension { * before sending. This can be done either with * {@link JsonCodec#encode(Object, JsonValue, java.lang.reflect.Type, com.vaadin.ui.ConnectorTracker)} * or using the factory methods in {@link Json}. - * + * * @param name * the name of the function * @param arguments diff --git a/server/src/main/java/com/vaadin/server/BootstrapFragmentResponse.java b/server/src/main/java/com/vaadin/server/BootstrapFragmentResponse.java index 14a12a20ec..050645f524 100644 --- a/server/src/main/java/com/vaadin/server/BootstrapFragmentResponse.java +++ b/server/src/main/java/com/vaadin/server/BootstrapFragmentResponse.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -26,7 +26,7 @@ import com.vaadin.ui.UI; * A representation of a bootstrap fragment being generated. The bootstrap * fragment is the HTML code that will make up the actual application. This also * includes the JavaScript that initializes the application. - * + * * @author Vaadin Ltd * @since 7.0.0 */ @@ -35,10 +35,10 @@ public class BootstrapFragmentResponse extends BootstrapResponse { /** * Crate a new bootstrap fragment response. - * + * * @see BootstrapResponse#BootstrapResponse(BootstrapHandler, VaadinRequest, * VaadinSession, Class) - * + * * @param handler * the bootstrap handler that is firing the event * @param request @@ -67,7 +67,7 @@ public class BootstrapFragmentResponse extends BootstrapResponse { * Gets the list of DOM nodes that will be used to generate the fragment * HTML. Changes to the returned list will be reflected in the generated * HTML. - * + * * @return the current list of DOM nodes that makes up the application * fragment */ diff --git a/server/src/main/java/com/vaadin/server/BootstrapHandler.java b/server/src/main/java/com/vaadin/server/BootstrapHandler.java index c139d5443c..74707842d8 100644 --- a/server/src/main/java/com/vaadin/server/BootstrapHandler.java +++ b/server/src/main/java/com/vaadin/server/BootstrapHandler.java @@ -134,8 +134,8 @@ public abstract class BootstrapHandler extends SynchronizedRequestHandler { UICreateEvent event = new UICreateEvent(getRequest(), getUIClass()); - pushMode = getBootstrapResponse().getUIProvider().getPushMode( - event); + pushMode = getBootstrapResponse().getUIProvider() + .getPushMode(event); if (pushMode == null) { pushMode = getRequest().getService() .getDeploymentConfiguration().getPushMode(); @@ -192,8 +192,8 @@ public abstract class BootstrapHandler extends SynchronizedRequestHandler { @Override protected String getVaadinDirUrl() { - return context.getApplicationParameters().getString( - ApplicationConstants.VAADIN_DIR_URL); + return context.getApplicationParameters() + .getString(ApplicationConstants.VAADIN_DIR_URL); } @Override @@ -203,12 +203,14 @@ public abstract class BootstrapHandler extends SynchronizedRequestHandler { @Override protected String getServiceUrlParameterName() { - return getConfigOrNull(ApplicationConstants.SERVICE_URL_PARAMETER_NAME); + return getConfigOrNull( + ApplicationConstants.SERVICE_URL_PARAMETER_NAME); } @Override protected String getServiceUrl() { - String serviceUrl = getConfigOrNull(ApplicationConstants.SERVICE_URL); + String serviceUrl = getConfigOrNull( + ApplicationConstants.SERVICE_URL); if (serviceUrl == null) { return "./"; } else if (!serviceUrl.endsWith("/")) { @@ -303,8 +305,8 @@ public abstract class BootstrapHandler extends SynchronizedRequestHandler { if (vaadinService.isStandalone(request)) { Map headers = new LinkedHashMap(); Document document = Document.createShell(""); - BootstrapPageResponse pageResponse = new BootstrapPageResponse( - this, request, context.getSession(), context.getUIClass(), + BootstrapPageResponse pageResponse = new BootstrapPageResponse(this, + request, context.getSession(), context.getUIClass(), document, headers, fragmentResponse.getUIProvider()); List fragmentNodes = fragmentResponse.getFragmentNodes(); Element body = document.body(); @@ -342,7 +344,8 @@ public abstract class BootstrapHandler extends SynchronizedRequestHandler { response.setDateHeader(header.getKey(), ((Long) value).longValue()); } else { - throw new RuntimeException("Unsupported header value: " + value); + throw new RuntimeException( + "Unsupported header value: " + value); } } } @@ -350,8 +353,8 @@ public abstract class BootstrapHandler extends SynchronizedRequestHandler { private void writeBootstrapPage(VaadinResponse response, String html) throws IOException { response.setContentType("text/html"); - BufferedWriter writer = new BufferedWriter(new OutputStreamWriter( - response.getOutputStream(), "UTF-8")); + BufferedWriter writer = new BufferedWriter( + new OutputStreamWriter(response.getOutputStream(), "UTF-8")); writer.append(html); writer.close(); } @@ -403,13 +406,14 @@ public abstract class BootstrapHandler extends SynchronizedRequestHandler { } catch (Exception e) { throw new RuntimeException( "Error processing viewport generator " - + viewportGeneratorClass.getCanonicalName(), e); + + viewportGeneratorClass.getCanonicalName(), + e); } } if (viewportContent != null) { - head.appendElement("meta").attr("name", "viewport") - .attr("content", viewportContent); + head.appendElement("meta").attr("name", "viewport").attr("content", + viewportContent); } String title = response.getUIProvider().getPageTitle( @@ -477,12 +481,12 @@ public abstract class BootstrapHandler extends SynchronizedRequestHandler { UICreateEvent event = new UICreateEvent(context.getRequest(), context.getUIClass()); - WidgetsetInfo widgetset = context.getBootstrapResponse() - .getUIProvider().getWidgetsetInfo(event); + WidgetsetInfo widgetset = context.getBootstrapResponse().getUIProvider() + .getWidgetsetInfo(event); if (widgetset == null) { // TODO do we want to move WidgetsetInfoImpl elsewhere? - widgetset = new WidgetsetInfoImpl(request.getService() - .getConfiguredWidgetset(request)); + widgetset = new WidgetsetInfoImpl( + request.getService().getConfiguredWidgetset(request)); } return widgetset; @@ -523,8 +527,8 @@ public abstract class BootstrapHandler extends SynchronizedRequestHandler { mainDiv.attr("style", style); } mainDiv.appendElement("div").addClass("v-app-loading"); - mainDiv.appendElement("noscript") - .append("You have to enable javascript in your browser to use an application built with Vaadin."); + mainDiv.appendElement("noscript").append( + "You have to enable javascript in your browser to use an application built with Vaadin."); fragmentNodes.add(mainDiv); VaadinRequest request = context.getRequest(); @@ -548,28 +552,29 @@ public abstract class BootstrapHandler extends SynchronizedRequestHandler { pushJS += versionQueryParam; - fragmentNodes.add(new Element(Tag.valueOf("script"), "").attr( - "type", "text/javascript").attr("src", pushJS)); + fragmentNodes.add(new Element(Tag.valueOf("script"), "") + .attr("type", "text/javascript").attr("src", pushJS)); } String bootstrapLocation = vaadinLocation + ApplicationConstants.VAADIN_BOOTSTRAP_JS + versionQueryParam; - fragmentNodes.add(new Element(Tag.valueOf("script"), "").attr("type", - "text/javascript").attr("src", bootstrapLocation)); - Element mainScriptTag = new Element(Tag.valueOf("script"), "").attr( - "type", "text/javascript"); + fragmentNodes.add(new Element(Tag.valueOf("script"), "") + .attr("type", "text/javascript") + .attr("src", bootstrapLocation)); + Element mainScriptTag = new Element(Tag.valueOf("script"), "") + .attr("type", "text/javascript"); StringBuilder builder = new StringBuilder(); builder.append("//"); - mainScriptTag.appendChild(new DataNode(builder.toString(), - mainScriptTag.baseUri())); + mainScriptTag.appendChild( + new DataNode(builder.toString(), mainScriptTag.baseUri())); fragmentNodes.add(mainScriptTag); } @@ -587,9 +592,11 @@ public abstract class BootstrapHandler extends SynchronizedRequestHandler { * side Profiler if another implementation hasn't already been * added. */ - builder.append("if (typeof window.__gwtStatsEvent != 'function') {\n"); + builder.append( + "if (typeof window.__gwtStatsEvent != 'function') {\n"); builder.append("vaadin.gwtStatsEvents = [];\n"); - builder.append("window.__gwtStatsEvent = function(event) {vaadin.gwtStatsEvents.push(event); return true;};\n"); + builder.append( + "window.__gwtStatsEvent = function(event) {vaadin.gwtStatsEvents.push(event); return true;};\n"); builder.append("}\n"); } @@ -622,8 +629,8 @@ public abstract class BootstrapHandler extends SynchronizedRequestHandler { } // Ignore restartApplication that might be passed to UI init - if (request - .getParameter(VaadinService.URL_PARAMETER_RESTART_APPLICATION) != null) { + if (request.getParameter( + VaadinService.URL_PARAMETER_RESTART_APPLICATION) != null) { appConfig.put("extraParams", "&" + IGNORE_RESTART_PARAM + "=1"); } diff --git a/server/src/main/java/com/vaadin/server/BootstrapListener.java b/server/src/main/java/com/vaadin/server/BootstrapListener.java index 374268dbdc..fbd1357632 100644 --- a/server/src/main/java/com/vaadin/server/BootstrapListener.java +++ b/server/src/main/java/com/vaadin/server/BootstrapListener.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -26,7 +26,7 @@ import javax.portlet.RenderResponse; * send to the client. The bootstrap HTML is first constructed as an in-memory * DOM representation which registered listeners can modify before the final * HTML is generated. - * + * * @author Vaadin Ltd * @since 7.0.0 */ @@ -36,7 +36,7 @@ public interface BootstrapListener extends EventListener, Serializable { * Vaadin application. In a typical Servlet deployment, this is the contents * of the HTML body tag. In a typical Portlet deployment, this is the HTML * that will be returned in a {@link RenderResponse}. - * + * * @param response * the bootstrap response that can modified to cause changes in * the generated HTML. @@ -52,7 +52,7 @@ public interface BootstrapListener extends EventListener, Serializable { * If a full page is being generated, this method is invoked after * {@link #modifyBootstrapFragment(BootstrapFragmentResponse)} has been * invoked for all registered listeners. - * + * * @param response * the bootstrap response that can be modified to cause change in * the generate HTML and in the HTTP headers of the response. diff --git a/server/src/main/java/com/vaadin/server/BootstrapPageResponse.java b/server/src/main/java/com/vaadin/server/BootstrapPageResponse.java index e57ed413f0..9583783fd1 100644 --- a/server/src/main/java/com/vaadin/server/BootstrapPageResponse.java +++ b/server/src/main/java/com/vaadin/server/BootstrapPageResponse.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -26,7 +26,7 @@ import com.vaadin.ui.UI; * A representation of a bootstrap page being generated. The bootstrap page * contains of the full DOM of the HTML document as well as the HTTP headers * that will be included in the corresponding HTTP response. - * + * * @author Vaadin Ltd * @since 7.0.0 */ @@ -37,10 +37,10 @@ public class BootstrapPageResponse extends BootstrapResponse { /** * Crate a new bootstrap page response. - * + * * @see BootstrapResponse#BootstrapResponse(BootstrapHandler, VaadinRequest, * VaadinSession, Class) - * + * * @param handler * the bootstrap handler that is firing the event * @param request @@ -70,9 +70,9 @@ public class BootstrapPageResponse extends BootstrapResponse { /** * Sets a header value that will be added to the HTTP response. If the * header had already been set, the new value overwrites the previous one. - * + * * @see VaadinResponse#setHeader(String, String) - * + * * @param name * the name of the header * @param value @@ -86,10 +86,10 @@ public class BootstrapPageResponse extends BootstrapResponse { * Properly formats a timestamp as a date in a header that will be included * in the HTTP response. If the header had already been set, the new value * overwrites the previous one. - * + * * @see #setHeader(String, String) * @see VaadinResponse#setDateHeader(String, long) - * + * * @param name * the name of the header * @param timestamp @@ -103,7 +103,7 @@ public class BootstrapPageResponse extends BootstrapResponse { * Gets the document node representing the root of the DOM hierarchy that * will be used to generate the HTML page. Changes to the document will be * reflected in the HTML. - * + * * @return the document node */ public Document getDocument() { diff --git a/server/src/main/java/com/vaadin/server/BootstrapResponse.java b/server/src/main/java/com/vaadin/server/BootstrapResponse.java index 59e18d4c8a..84c395d003 100644 --- a/server/src/main/java/com/vaadin/server/BootstrapResponse.java +++ b/server/src/main/java/com/vaadin/server/BootstrapResponse.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -23,7 +23,7 @@ import com.vaadin.ui.UI; /** * Base class providing common functionality used in different bootstrap * modification events. - * + * * @author Vaadin Ltd * @since 7.0.0 */ @@ -35,7 +35,7 @@ public abstract class BootstrapResponse extends EventObject { /** * Creates a new bootstrap event. - * + * * @param handler * the bootstrap handler that is firing the event * @param request @@ -60,7 +60,7 @@ public abstract class BootstrapResponse extends EventObject { /** * Gets the bootstrap handler that fired this event - * + * * @return the bootstrap handler that fired this event */ public BootstrapHandler getBootstrapHandler() { @@ -74,7 +74,7 @@ public abstract class BootstrapResponse extends EventObject { * will not be available because the bootstrap page is generated before the * bootstrap javascript has had a chance to send any information back to the * server. - * + * * @return the Vaadin request that is being handled */ public VaadinRequest getRequest() { @@ -83,7 +83,7 @@ public abstract class BootstrapResponse extends EventObject { /** * Gets the service session to which the rendered view belongs. - * + * * @return the Vaadin service session */ public VaadinSession getSession() { @@ -93,7 +93,7 @@ public abstract class BootstrapResponse extends EventObject { /** * Gets the class of the UI that will be displayed on the generated * bootstrap page. - * + * * @return the class of the UI */ public Class getUiClass() { @@ -103,7 +103,7 @@ public abstract class BootstrapResponse extends EventObject { /** * Gets the UI provider that is used to provide information about the * bootstapped UI. - * + * * @return the UI provider */ public UIProvider getUIProvider() { diff --git a/server/src/main/java/com/vaadin/server/BrowserWindowOpener.java b/server/src/main/java/com/vaadin/server/BrowserWindowOpener.java index c1b8cbe91e..df490cfd74 100644 --- a/server/src/main/java/com/vaadin/server/BrowserWindowOpener.java +++ b/server/src/main/java/com/vaadin/server/BrowserWindowOpener.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -27,7 +27,7 @@ import com.vaadin.ui.UI; /** * Component extension that opens a browser popup window when the extended * component is clicked. - * + * * @author Vaadin Ltd * @since 7.0.0 */ @@ -70,7 +70,7 @@ public class BrowserWindowOpener extends AbstractExtension { /** * Creates a window opener that will open windows containing the provided UI * class - * + * * @param uiClass * the UI class that should be opened when the extended component * is clicked @@ -82,7 +82,7 @@ public class BrowserWindowOpener extends AbstractExtension { /** * Creates a window opener that will open windows containing the provided UI * using the provided path - * + * * @param uiClass * the UI class that should be opened when the extended component * is clicked @@ -91,13 +91,14 @@ public class BrowserWindowOpener extends AbstractExtension { */ public BrowserWindowOpener(Class uiClass, String path) { // Create a Resource with a translated URL going to the VaadinService - this(new ExternalResource(ApplicationConstants.APP_PROTOCOL_PREFIX - + path), new BrowserWindowOpenerUIProvider(uiClass, path)); + this(new ExternalResource( + ApplicationConstants.APP_PROTOCOL_PREFIX + path), + new BrowserWindowOpenerUIProvider(uiClass, path)); } /** * Creates a window opener that will open windows to the provided URL - * + * * @param url * the URL to open in the window */ @@ -107,7 +108,7 @@ public class BrowserWindowOpener extends AbstractExtension { /** * Creates a window opener that will open window to the provided resource - * + * * @param resource * the resource to open in the window */ @@ -129,9 +130,9 @@ public class BrowserWindowOpener extends AbstractExtension { * Sets the provided URL {@code url} for this instance. The {@code url} will * be opened in a new browser window/tab when the extended component is * clicked. - * + * * @since 7.4 - * + * * @param url * URL to open */ @@ -143,9 +144,9 @@ public class BrowserWindowOpener extends AbstractExtension { * Sets the provided {@code resource} for this instance. The * {@code resource} will be opened in a new browser window/tab when the * extended component is clicked. - * + * * @since 7.4 - * + * * @param resource * resource to open */ @@ -155,9 +156,9 @@ public class BrowserWindowOpener extends AbstractExtension { /** * Returns the resource for this instance. - * + * * @since 7.4 - * + * * @return resource to open browser window */ public Resource getResource() { @@ -168,9 +169,9 @@ public class BrowserWindowOpener extends AbstractExtension { * Returns the URL for this BrowserWindowOpener instance. Returns * {@code null} if this instance is not URL resource based (a non URL based * resource has been set for it). - * + * * @since 7.4 - * + * * @return URL to open in the new browser window/tab when the extended * component is clicked */ @@ -188,7 +189,7 @@ public class BrowserWindowOpener extends AbstractExtension { * replaced instead of opening a new window. If the name is * null or "_blank", a new window will always be * opened. - * + * * @param windowName * the target name for the window */ @@ -198,9 +199,9 @@ public class BrowserWindowOpener extends AbstractExtension { /** * Gets the target window name. - * + * * @see #setWindowName(String) - * + * * @return the window target string */ public String getWindowName() { @@ -213,7 +214,7 @@ public class BrowserWindowOpener extends AbstractExtension { * Sets the features for opening the window. See e.g. * {@link https://developer.mozilla.org/en-US/docs/DOM/window.open#Position_and_size_features} * for a description of the commonly supported features. - * + * * @param features a string with window features, or null to use the default features. */ // @formatter:on @@ -223,7 +224,7 @@ public class BrowserWindowOpener extends AbstractExtension { /** * Gets the window features. - * + * * @see #setFeatures(String) * @return */ @@ -269,7 +270,7 @@ public class BrowserWindowOpener extends AbstractExtension { * new UI. *

      * The default value is null. - * + * * @param uriFragment * the URI fragment string that should be included in the opened * URI, or null to preserve the original fragment of @@ -281,10 +282,10 @@ public class BrowserWindowOpener extends AbstractExtension { /** * Gets that URI fragment configured for opened windows. - * + * * @return the URI fragment string, or null if no fragment is * configured. - * + * * @see #setUriFragment(String) */ public String getUriFragment() { @@ -299,12 +300,12 @@ public class BrowserWindowOpener extends AbstractExtension { *

      * Setting a parameter with the same name as a previously set parameter will * replace the previous value. - * + * * @param name * the name of the parameter to add, not null * @param value * the value of the parameter to add, not null - * + * * @see #removeParameter(String) * @see #getParameterNames() * @see #getParameter(String) @@ -320,10 +321,10 @@ public class BrowserWindowOpener extends AbstractExtension { * Removes a parameter that has been set using * {@link #setParameter(String, String)}. Removing a parameter that has not * been set has no effect. - * + * * @param name * the name of the parameter to remove, not null - * + * * @see #setParameter(String, String) */ public void removeParameter(String name) { @@ -336,9 +337,9 @@ public class BrowserWindowOpener extends AbstractExtension { /** * Gets the names of all parameters set using * {@link #setParameter(String, String)}. - * + * * @return an unmodifiable set of parameter names - * + * * @see #setParameter(String, String) * @see #getParameter(String) */ @@ -350,12 +351,12 @@ public class BrowserWindowOpener extends AbstractExtension { * Gets the value of a parameter set using * {@link #setParameter(String, String)}. If there is no parameter with the * given name, null is returned. - * + * * @param name * the name of the parameter to get, not null * @return the value of the parameter, or null there is no * parameter - * + * * @see #setParameter(String, String) * @see #getParameter(String) */ diff --git a/server/src/main/java/com/vaadin/server/ClassResource.java b/server/src/main/java/com/vaadin/server/ClassResource.java index 5fb30095ed..86d66eade8 100644 --- a/server/src/main/java/com/vaadin/server/ClassResource.java +++ b/server/src/main/java/com/vaadin/server/ClassResource.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,11 +25,11 @@ import com.vaadin.util.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 */ @@ -60,7 +60,7 @@ public class ClassResource implements ConnectorResource, Serializable { * Creates a new application resource instance. The resource id is relative * to the location of the UI of the component using this resource (or the * Application if using LegacyWindow). - * + * * @param resourceName * the Unique identifier of the resource within the application. */ @@ -70,7 +70,7 @@ public class ClassResource implements ConnectorResource, Serializable { /** * Creates a new application resource instance. - * + * * @param associatedClass * the class of the which the resource is associated. * @param resourceName @@ -86,7 +86,7 @@ public class ClassResource implements ConnectorResource, Serializable { /** * Gets the MIME type of this resource. - * + * * @see com.vaadin.server.Resource#getMIMEType() */ @Override @@ -102,9 +102,9 @@ public class ClassResource implements ConnectorResource, Serializable { @Override public DownloadStream getStream() { - final DownloadStream ds = new DownloadStream(getAssociatedClass() - .getResourceAsStream(resourceName), getMIMEType(), - getFilename()); + final DownloadStream ds = new DownloadStream( + getAssociatedClass().getResourceAsStream(resourceName), + getMIMEType(), getFilename()); ds.setBufferSize(getBufferSize()); ds.setCacheTime(getCacheTime()); return ds; @@ -125,12 +125,12 @@ public class ClassResource implements ConnectorResource, Serializable { /** * 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 the size of the buffer in bytes. */ public int getBufferSize() { @@ -139,10 +139,10 @@ public class ClassResource implements ConnectorResource, Serializable { /** * Sets the size of the download buffer used for this resource. - * + * * @param bufferSize * the size of the buffer in bytes. - * + * * @see #getBufferSize() */ public void setBufferSize(int bufferSize) { @@ -151,13 +151,13 @@ public class ClassResource implements ConnectorResource, Serializable { /** * 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 {@link DownloadStream#DEFAULT_CACHETIME}. *

      - * + * * @return Cache time in milliseconds */ public long getCacheTime() { @@ -166,17 +166,17 @@ public class ClassResource implements ConnectorResource, Serializable { /** * 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 negative value disables 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/main/java/com/vaadin/server/ClientConnector.java b/server/src/main/java/com/vaadin/server/ClientConnector.java index ae988457c0..d357d85624 100644 --- a/server/src/main/java/com/vaadin/server/ClientConnector.java +++ b/server/src/main/java/com/vaadin/server/ClientConnector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -32,10 +32,10 @@ import elemental.json.JsonObject; /** * Interface implemented by all connectors that are capable of communicating * with the client side - * + * * @author Vaadin Ltd * @since 7.0.0 - * + * */ public interface ClientConnector extends Connector { @@ -52,15 +52,15 @@ public interface ClientConnector extends Connector { /** * Interface for listening {@link AttachEvent connector attach events}. - * + * */ public static interface AttachListener extends ConnectorEventListener { - public static final Method attachMethod = ReflectTools.findMethod( - AttachListener.class, "attach", AttachEvent.class); + public static final Method attachMethod = ReflectTools + .findMethod(AttachListener.class, "attach", AttachEvent.class); /** * Called when a AttachListener is notified of a AttachEvent. - * + * * @param event * The attach event that was fired. */ @@ -80,15 +80,15 @@ public interface ClientConnector extends Connector { /** * Interface for listening {@link DetachEvent connector detach events}. - * + * */ public static interface DetachListener extends ConnectorEventListener { - public static final Method detachMethod = ReflectTools.findMethod( - DetachListener.class, "detach", DetachEvent.class); + public static final Method detachMethod = ReflectTools + .findMethod(DetachListener.class, "detach", DetachEvent.class); /** * Called when a DetachListener is notified of a DetachEvent. - * + * * @param event * The detach event that was fired. */ @@ -108,8 +108,8 @@ public interface ClientConnector extends Connector { * to find the connector where the error occurred or {@link #getComponent()} * to find the nearest parent component. */ - public static class ConnectorErrorEvent extends - com.vaadin.server.ErrorEvent { + public static class ConnectorErrorEvent + extends com.vaadin.server.ErrorEvent { private Connector connector; @@ -120,7 +120,7 @@ public interface ClientConnector extends Connector { /** * Gets the connector for which this error occurred. - * + * * @return The connector for which the error occurred */ public Connector getConnector() { @@ -132,7 +132,7 @@ public interface ClientConnector extends Connector { /** * Returns the list of pending server to client RPC calls and clears the * list. - * + * * @return an unmodifiable ordered list of pending server to client method * calls (not null) */ @@ -141,14 +141,14 @@ public interface ClientConnector extends Connector { /** * Checks if the communicator is enabled. An enabled communicator is allowed * to receive messages from its counter-part. - * + * * @return true if the connector can receive messages, false otherwise */ public boolean isConnectorEnabled(); /** * Returns the type of the shared state for this connector - * + * * @return The type of the state. Must never return null. */ public Class getStateType(); @@ -168,7 +168,7 @@ public interface ClientConnector extends Connector { * {@link #beforeClientResponse(boolean)} followed by {@link #encodeState()} * for all connectors that are marked as dirty and send any updated state * info to the client. - * + * * @since 7.0.0 */ public void markAsDirty(); @@ -184,16 +184,16 @@ public interface ClientConnector extends Connector { *

      * This should only be used in special cases, e.g when the state of a * descendant depends on the state of an ancestor. - * + * * @see #markAsDirty() - * + * * @since 7.0.0 */ public void markAsDirtyRecursive(); /** * Checks if the connector is attached to a VaadinSession. - * + * * @since 7.1 * @return true if the connector is attached to a session, false otherwise */ @@ -209,7 +209,7 @@ public interface ClientConnector extends Connector { * the session. This method is always called before the connector's data is * sent to the client-side for the first time. *

      - * + * *

      * The attachment logic is implemented in {@link AbstractClientConnector}. *

      @@ -218,26 +218,26 @@ public interface ClientConnector extends Connector { /** * Notifies the connector that it is detached from its VaadinSession. - * + * *

      * The caller of this method is {@link #setParent(ClientConnector)} if the * parent is in the session. When the parent is detached from the session it * is its responsibility to call {@link #detach()} for each of its children. - * + * *

      */ public void detach(); /** * Get a read-only collection of all extensions attached to this connector. - * + * * @return a collection of extensions */ public Collection getExtensions(); /** * Remove an extension from this connector. - * + * * @param extension * the extension to remove. */ @@ -245,7 +245,7 @@ public interface ClientConnector extends Connector { /** * Returns the UI this connector is attached to - * + * * @return The UI this connector is attached to or null if it is not * attached to any UI */ @@ -256,13 +256,13 @@ public interface ClientConnector extends Connector { * client. Gives the connector an opportunity to set computed/dynamic state * values or to invoke last minute RPC methods depending on other component * features. - * + * * @param initial * true if the client-side connector will be created * and initialized after this method has been invoked. * false if there is already an initialized * client-side connector. - * + * * @since 7.0 */ public void beforeClientResponse(boolean initial); @@ -272,7 +272,7 @@ public interface ClientConnector extends Connector { * typically done by calling the static method * {@link LegacyCommunicationManager#encodeState(ClientConnector, SharedState)} * . - * + * * @return a JSON object with the encoded connector state */ public JsonObject encodeState(); @@ -292,7 +292,7 @@ public interface ClientConnector extends Connector { * the session should be unlocked before writing a large response to the * client. *

      - * + * * @param request * the request that should be handled * @param response @@ -310,7 +310,7 @@ public interface ClientConnector extends Connector { /** * Returns the RPC manager instance to use when receiving calls for an RPC * interface. - * + * * @param rpcInterfaceName * name of the interface for which the call was made * @return ServerRpcManager or null if none found for the interface @@ -319,20 +319,20 @@ public interface ClientConnector extends Connector { /** * Gets the error handler for the connector. - * + * * The error handler is dispatched whenever there is an error processing the * data coming from the client to this connector. - * + * * @return The error handler or null if not set */ public ErrorHandler getErrorHandler(); /** * Sets the error handler for the connector. - * + * * The error handler is dispatched whenever there is an error processing the * data coming from the client for this connector. - * + * * @param errorHandler * The error handler for this connector */ diff --git a/server/src/main/java/com/vaadin/server/ClientMethodInvocation.java b/server/src/main/java/com/vaadin/server/ClientMethodInvocation.java index 77849c83df..67bac57300 100644 --- a/server/src/main/java/com/vaadin/server/ClientMethodInvocation.java +++ b/server/src/main/java/com/vaadin/server/ClientMethodInvocation.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -30,11 +30,11 @@ import elemental.json.impl.JsonUtil; /** * Internal class for keeping track of pending server to client method * invocations for a Connector. - * + * * @since 7.0 */ -public class ClientMethodInvocation implements Serializable, - Comparable { +public class ClientMethodInvocation + implements Serializable, Comparable { private final ClientConnector connector; private final String interfaceName; private final String methodName; @@ -121,8 +121,8 @@ public class ClientMethodInvocation implements Serializable, stream.writeObject(serializedParameters); } - private void readObject(ObjectInputStream stream) throws IOException, - ClassNotFoundException { + private void readObject(ObjectInputStream stream) + throws IOException, ClassNotFoundException { // Reverses the serialization done in writeObject. Basically just // parsing the serialized type back to the non-serializable type. stream.defaultReadObject(); diff --git a/server/src/main/java/com/vaadin/server/ComponentSizeValidator.java b/server/src/main/java/com/vaadin/server/ComponentSizeValidator.java index b8b06c780f..14839a62ba 100644 --- a/server/src/main/java/com/vaadin/server/ComponentSizeValidator.java +++ b/server/src/main/java/com/vaadin/server/ComponentSizeValidator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -52,7 +52,7 @@ public class ComponentSizeValidator implements Serializable { /** * Recursively checks given component and its subtree for invalid layout * setups. Prints errors to std err stream. - * + * * @param component * component to check * @return set of first level errors found @@ -127,7 +127,8 @@ public class ComponentSizeValidator implements Serializable { err.append("Layout problem detected: "); err.append(msg); err.append("\n"); - err.append("Relative sizes were replaced by undefined sizes, components may not render as expected.\n"); + err.append( + "Relative sizes were replaced by undefined sizes, components may not render as expected.\n"); errorStream.println(err); } @@ -181,7 +182,8 @@ public class ComponentSizeValidator implements Serializable { private final Vector subErrors = new Vector(); - public InvalidLayout(Component component, boolean height, boolean width) { + public InvalidLayout(Component component, boolean height, + boolean width) { this.component = component; invalidHeight = height; invalidWidth = width; @@ -289,7 +291,8 @@ public class ComponentSizeValidator implements Serializable { } - private static Stack getHeightAttributes(Component component) { + private static Stack getHeightAttributes( + Component component) { Stack attributes = new Stack(); attributes .add(new ComponentInfo(component, getHeightString(component))); @@ -303,7 +306,8 @@ public class ComponentSizeValidator implements Serializable { return attributes; } - private static Stack getWidthAttributes(Component component) { + private static Stack getWidthAttributes( + Component component) { Stack attributes = new Stack(); attributes.add(new ComponentInfo(component, getWidthString(component))); Component parent = component.getParent(); @@ -320,7 +324,8 @@ public class ComponentSizeValidator implements Serializable { String width = "width: "; if (hasRelativeWidth(component)) { width += "RELATIVE, " + component.getWidth() + " %"; - } else if (component instanceof Window && component.getParent() == null) { + } else if (component instanceof Window + && component.getParent() == null) { width += "MAIN WINDOW"; } else if (component.getWidth() >= 0) { width += "ABSOLUTE, " + component.getWidth() + " " @@ -336,7 +341,8 @@ public class ComponentSizeValidator implements Serializable { String height = "height: "; if (hasRelativeHeight(component)) { height += "RELATIVE, " + component.getHeight() + " %"; - } else if (component instanceof Window && component.getParent() == null) { + } else if (component instanceof Window + && component.getParent() == null) { height += "MAIN WINDOW"; } else if (component.getHeight() > 0) { height += "ABSOLUTE, " + component.getHeight() + " " @@ -427,8 +433,8 @@ public class ComponentSizeValidator implements Serializable { if (parent instanceof VerticalLayout) { horizontal = false; } - if (horizontal - && hasNonRelativeHeightComponent((AbstractOrderedLayout) parent)) { + if (horizontal && hasNonRelativeHeightComponent( + (AbstractOrderedLayout) parent)) { return true; } else { return false; @@ -484,11 +490,12 @@ public class ComponentSizeValidator implements Serializable { } private static boolean hasRelativeHeight(Component component) { - return (component.getHeightUnits() == Unit.PERCENTAGE && component - .getHeight() > 0); + return (component.getHeightUnits() == Unit.PERCENTAGE + && component.getHeight() > 0); } - private static boolean hasNonRelativeWidthComponent(AbstractOrderedLayout ol) { + private static boolean hasNonRelativeWidthComponent( + AbstractOrderedLayout ol) { Iterator it = ol.getComponentIterator(); while (it.hasNext()) { if (!hasRelativeWidth(it.next())) { @@ -536,7 +543,8 @@ public class ComponentSizeValidator implements Serializable { boolean columnHasWidth = false; for (int col = componentArea.getColumn1(); !columnHasWidth && col <= componentArea.getColumn2(); col++) { - for (int row = 0; !columnHasWidth && row < gl.getRows(); row++) { + for (int row = 0; !columnHasWidth + && row < gl.getRows(); row++) { Component c = gl.getComponent(col, row); if (c != null) { columnHasWidth = !hasRelativeWidth(c); @@ -638,7 +646,8 @@ public class ComponentSizeValidator implements Serializable { setLocation(heightLocations, object); } - private static void setLocation(Map map, Object object) { + private static void setLocation(Map map, + Object object) { StackTraceElement[] traceLines = Thread.currentThread().getStackTrace(); for (StackTraceElement traceElement : traceLines) { Class cls; @@ -650,7 +659,8 @@ public class ComponentSizeValidator implements Serializable { } cls = Class.forName(className); - if (cls == ComponentSizeValidator.class || cls == Thread.class) { + if (cls == ComponentSizeValidator.class + || cls == Thread.class) { continue; } @@ -675,7 +685,7 @@ public class ComponentSizeValidator implements Serializable { /** * Validates the layout and returns a collection of errors - * + * * @since 7.1 * @param ui * The UI to validate diff --git a/server/src/main/java/com/vaadin/server/CompositeErrorMessage.java b/server/src/main/java/com/vaadin/server/CompositeErrorMessage.java index ee2af74994..de5b932d0e 100644 --- a/server/src/main/java/com/vaadin/server/CompositeErrorMessage.java +++ b/server/src/main/java/com/vaadin/server/CompositeErrorMessage.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,7 +21,7 @@ import java.util.Iterator; /** * Class for combining multiple error messages together. - * + * * @author Vaadin Ltd * @since 3.0 */ @@ -30,7 +30,7 @@ public class CompositeErrorMessage extends AbstractErrorMessage { /** * Constructor for CompositeErrorMessage. - * + * * @param errorMessages * the array of error messages that are listed together. Nulls * are ignored, but at least one message is required. @@ -52,7 +52,7 @@ public class CompositeErrorMessage extends AbstractErrorMessage { /** * Constructor for CompositeErrorMessage. - * + * * @param errorMessages * the Collection of error messages that are listed together. At * least one message is required. @@ -76,7 +76,7 @@ public class CompositeErrorMessage extends AbstractErrorMessage { /** * Adds a error message into this composite message. Updates the level * field. - * + * * @param error * the error message to be added. Duplicate errors are ignored. */ @@ -91,7 +91,7 @@ public class CompositeErrorMessage extends AbstractErrorMessage { /** * Gets Error Iterator. - * + * * @return the error iterator. */ public Iterator iterator() { @@ -100,7 +100,7 @@ public class CompositeErrorMessage extends AbstractErrorMessage { /** * Returns a comma separated list of the error messages. - * + * * @return String, comma separated list of error messages. */ @Override diff --git a/server/src/main/java/com/vaadin/server/ConnectorResource.java b/server/src/main/java/com/vaadin/server/ConnectorResource.java index 3c4fb1955f..53225087d6 100644 --- a/server/src/main/java/com/vaadin/server/ConnectorResource.java +++ b/server/src/main/java/com/vaadin/server/ConnectorResource.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -18,9 +18,9 @@ package com.vaadin.server; /** * A resource that is served through the Connector that is using the resource. - * + * * @see AbstractClientConnector#setResource(String, Resource) - * + * * @author Vaadin Ltd * @version @VERSION@ * @since 7.0.0 @@ -37,14 +37,14 @@ public interface ConnectorResource extends Resource { * holding session locks (to prevent locking the session during long file * downloads). *

      - * + * * @return A download stream which produces the resource content */ public DownloadStream getStream(); /** * Gets the virtual filename for this resource. - * + * * @return the file name associated to this resource. */ public String getFilename(); diff --git a/server/src/main/java/com/vaadin/server/ConnectorResourceHandler.java b/server/src/main/java/com/vaadin/server/ConnectorResourceHandler.java index 8715134773..a07380a521 100644 --- a/server/src/main/java/com/vaadin/server/ConnectorResourceHandler.java +++ b/server/src/main/java/com/vaadin/server/ConnectorResourceHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -88,11 +88,11 @@ public class ConnectorResourceHandler implements RequestHandler { .setCurrent(ui); try { if (!connector.handleConnectorRequest(request, response, key)) { - return error(request, response, connector.getClass() - .getSimpleName() - + " (" - + connector.getConnectorId() - + ") did not handle connector request for " + key); + return error(request, response, + connector.getClass().getSimpleName() + " (" + + connector.getConnectorId() + + ") did not handle connector request for " + + key); } } catch (Exception e) { session.lock(); @@ -120,16 +120,15 @@ public class ConnectorResourceHandler implements RequestHandler { if (!loggedDecodingWarning) { loggedDecodingWarning = true; - getLogger() - .warning( - "Request path contains a new line character. This typically means that the server is incorrectly configured to use something else than UTF-8 for URL decoding (requestPath: " - + requestPath + ")"); + getLogger().warning( + "Request path contains a new line character. This typically means that the server is incorrectly configured to use something else than UTF-8 for URL decoding (requestPath: " + + requestPath + ")"); } } } - private static boolean error(VaadinRequest request, - VaadinResponse response, String logMessage) throws IOException { + private static boolean error(VaadinRequest request, VaadinResponse response, + String logMessage) throws IOException { getLogger().log(Level.WARNING, logMessage); response.sendError(HttpServletResponse.SC_NOT_FOUND, request.getPathInfo() + " can not be found"); diff --git a/server/src/main/java/com/vaadin/server/Constants.java b/server/src/main/java/com/vaadin/server/Constants.java index 5efe6accb1..77653b8bec 100644 --- a/server/src/main/java/com/vaadin/server/Constants.java +++ b/server/src/main/java/com/vaadin/server/Constants.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,9 +20,9 @@ import com.vaadin.ui.declarative.DesignContext; /** * Internal constants used by both the client and the server side framework - * + * * @since 6.2 - * + * */ public interface Constants { @@ -62,8 +62,7 @@ public interface Constants { + "The widgetset in use does not seem to be built for the Vaadin\n" + "version in use. This might cause strange problems - a\n" + "recompile/deploy is strongly recommended.\n" - + " Vaadin version: %s\n" - + " Widgetset version: %s\n" + + " Vaadin version: %s\n" + " Widgetset version: %s\n" + "================================================================="; // Keep the version number in sync with pom.xml @@ -83,21 +82,15 @@ public interface Constants { + "to vaadin-push.\n" + "If managing dependencies manually, please make sure Atmosphere\n" + REQUIRED_ATMOSPHERE_RUNTIME_VERSION - + " is included on the classpath.\n" - + "Will fall back to using " - + PushMode.class.getSimpleName() - + "." - + PushMode.DISABLED.name() + + " is included on the classpath.\n" + "Will fall back to using " + + PushMode.class.getSimpleName() + "." + PushMode.DISABLED.name() + ".\n" + "================================================================="; static final String PUSH_NOT_SUPPORTED_ERROR = "\n" + "=================================================================\n" - + "Push is not supported for {0}\n" - + "Will fall back to using " - + PushMode.class.getSimpleName() - + "." - + PushMode.DISABLED.name() + + "Push is not supported for {0}\n" + "Will fall back to using " + + PushMode.class.getSimpleName() + "." + PushMode.DISABLED.name() + ".\n" + "================================================================="; @@ -142,7 +135,7 @@ public interface Constants { * Name of system or context property to write declarative syntax with the * old "v-" prefix or with the new "vaadin-" prefix. The default value * depends on the Vaadin branch used. - * + * * @see DesignContext * @since 7.5.7 */ diff --git a/server/src/main/java/com/vaadin/server/CustomizedSystemMessages.java b/server/src/main/java/com/vaadin/server/CustomizedSystemMessages.java index 0a7f864f40..0c1da79ec4 100644 --- a/server/src/main/java/com/vaadin/server/CustomizedSystemMessages.java +++ b/server/src/main/java/com/vaadin/server/CustomizedSystemMessages.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -49,12 +49,12 @@ import java.io.Serializable; *

      */ -public class CustomizedSystemMessages extends SystemMessages implements - Serializable { +public class CustomizedSystemMessages extends SystemMessages + implements Serializable { /** * Sets the URL to go to when the session has expired. - * + * * @param sessionExpiredURL * the URL to go to, or null to reload current */ @@ -66,7 +66,7 @@ public class CustomizedSystemMessages extends SystemMessages implements * Enables or disables the notification. If disabled, the set URL (or * current) is loaded directly when next transaction between server and * client happens. - * + * * @param sessionExpiredNotificationEnabled * true = enabled, false = disabled */ @@ -80,7 +80,7 @@ public class CustomizedSystemMessages extends SystemMessages implements * caption and message are null, client automatically forwards to * sessionExpiredUrl after timeout timer expires. Timer uses value read from * HTTPSession.getMaxInactiveInterval() - * + * * @param sessionExpiredCaption * the caption */ @@ -93,7 +93,7 @@ public class CustomizedSystemMessages extends SystemMessages implements * caption and message are null, client automatically forwards to * sessionExpiredUrl after timeout timer expires. Timer uses value read from * HTTPSession.getMaxInactiveInterval() - * + * * @param sessionExpiredMessage * the message */ @@ -103,7 +103,7 @@ public class CustomizedSystemMessages extends SystemMessages implements /** * Sets the URL to go to when there is a authentication error. - * + * * @param authenticationErrorURL * the URL to go to, or null to reload current */ @@ -114,7 +114,7 @@ public class CustomizedSystemMessages extends SystemMessages implements /** * Enables or disables the notification. If disabled, the set URL (or * current) is loaded directly. - * + * * @param authenticationErrorNotificationEnabled * true = enabled, false = disabled */ @@ -126,28 +126,30 @@ public class CustomizedSystemMessages extends SystemMessages implements /** * Sets the caption of the notification. Set to null for no caption. If both * caption and message is null, the notification is disabled; - * + * * @param authenticationErrorCaption * the caption */ - public void setAuthenticationErrorCaption(String authenticationErrorCaption) { + public void setAuthenticationErrorCaption( + String authenticationErrorCaption) { this.authenticationErrorCaption = authenticationErrorCaption; } /** * Sets the message of the notification. Set to null for no message. If both * caption and message is null, the notification is disabled; - * + * * @param authenticationErrorMessage * the message */ - public void setAuthenticationErrorMessage(String authenticationErrorMessage) { + public void setAuthenticationErrorMessage( + String authenticationErrorMessage) { this.authenticationErrorMessage = authenticationErrorMessage; } /** * Sets the URL to go to when there is a communication error. - * + * * @param communicationErrorURL * the URL to go to, or null to reload current */ @@ -158,7 +160,7 @@ public class CustomizedSystemMessages extends SystemMessages implements /** * Enables or disables the notification. If disabled, the set URL (or * current) is loaded directly. - * + * * @param communicationErrorNotificationEnabled * true = enabled, false = disabled */ @@ -170,7 +172,7 @@ public class CustomizedSystemMessages extends SystemMessages implements /** * Sets the caption of the notification. Set to null for no caption. If both * caption and message is null, the notification is disabled; - * + * * @param communicationErrorCaption * the caption */ @@ -181,7 +183,7 @@ public class CustomizedSystemMessages extends SystemMessages implements /** * Sets the message of the notification. Set to null for no message. If both * caption and message is null, the notification is disabled; - * + * * @param communicationErrorMessage * the message */ @@ -191,7 +193,7 @@ public class CustomizedSystemMessages extends SystemMessages implements /** * Sets the URL to go to when an internal error occurs. - * + * * @param internalErrorURL * the URL to go to, or null to reload current */ @@ -202,7 +204,7 @@ public class CustomizedSystemMessages extends SystemMessages implements /** * Enables or disables the notification. If disabled, the set URL (or * current) is loaded directly. - * + * * @param internalErrorNotificationEnabled * true = enabled, false = disabled */ @@ -214,7 +216,7 @@ public class CustomizedSystemMessages extends SystemMessages implements /** * Sets the caption of the notification. Set to null for no caption. If both * caption and message is null, the notification is disabled; - * + * * @param internalErrorCaption * the caption */ @@ -225,7 +227,7 @@ public class CustomizedSystemMessages extends SystemMessages implements /** * Sets the message of the notification. Set to null for no message. If both * caption and message is null, the notification is disabled; - * + * * @param internalErrorMessage * the message */ @@ -235,7 +237,7 @@ public class CustomizedSystemMessages extends SystemMessages implements /** * Sets the URL to redirect to when the browser has cookies disabled. - * + * * @param cookiesDisabledURL * the URL to redirect to, or null to reload the current URL */ @@ -247,7 +249,7 @@ public class CustomizedSystemMessages extends SystemMessages implements * Enables or disables the notification for "cookies disabled" messages. If * disabled, the URL returned by {@link #getCookiesDisabledURL()} is loaded * directly. - * + * * @param cookiesDisabledNotificationEnabled * true to enable "cookies disabled" messages, false otherwise */ @@ -260,7 +262,7 @@ public class CustomizedSystemMessages extends SystemMessages implements * Sets the caption of the "cookies disabled" notification. Set to null for * no caption. If both caption and message is null, the notification is * disabled. - * + * * @param cookiesDisabledCaption * the caption for the "cookies disabled" notification */ @@ -272,7 +274,7 @@ public class CustomizedSystemMessages extends SystemMessages implements * Sets the message of the "cookies disabled" notification. Set to null for * no message. If both caption and message is null, the notification is * disabled. - * + * * @param cookiesDisabledMessage * the message for the "cookies disabled" notification */ diff --git a/server/src/main/java/com/vaadin/server/DefaultDeploymentConfiguration.java b/server/src/main/java/com/vaadin/server/DefaultDeploymentConfiguration.java index 1f22a9e33d..d4014d9289 100644 --- a/server/src/main/java/com/vaadin/server/DefaultDeploymentConfiguration.java +++ b/server/src/main/java/com/vaadin/server/DefaultDeploymentConfiguration.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,12 +25,12 @@ import com.vaadin.shared.communication.PushMode; /** * The default implementation of {@link DeploymentConfiguration} based on a base * class for resolving system properties and a set of init parameters. - * + * * @author Vaadin Ltd * @since 7.0.0 */ -public class DefaultDeploymentConfiguration extends - AbstractDeploymentConfiguration { +public class DefaultDeploymentConfiguration + extends AbstractDeploymentConfiguration { /** * Default value for {@link #getResourceCacheTime()} = {@value} . */ @@ -54,7 +54,7 @@ public class DefaultDeploymentConfiguration extends /** * Default value for {@link #isSyncIdCheckEnabled()} = {@value} . - * + * * @since 7.3 */ public static final boolean DEFAULT_SYNC_ID_CHECK = true; @@ -75,7 +75,7 @@ public class DefaultDeploymentConfiguration extends /** * Create a new deployment configuration instance. - * + * * @param systemPropertyBaseClass * the class that should be used as a basis when reading system * properties @@ -112,10 +112,9 @@ public class DefaultDeploymentConfiguration extends } } - getLogger() - .log(Level.WARNING, - Constants.WARNING_UNKNOWN_LEGACY_PROPERTY_TOSTRING_VALUE, - param); + getLogger().log(Level.WARNING, + Constants.WARNING_UNKNOWN_LEGACY_PROPERTY_TOSTRING_VALUE, + param); legacyPropertyToStringMode = DEFAULT_LEGACY_PROPERTY_TO_STRING; } @@ -142,7 +141,7 @@ public class DefaultDeploymentConfiguration extends /** * Gets an system property value. - * + * * @param parameterName * the Name or the parameter. * @return String value or null if not found @@ -186,7 +185,7 @@ public class DefaultDeploymentConfiguration extends /** * Gets an application property value. - * + * * @param parameterName * the Name or the parameter. * @return String value or null if not found @@ -207,7 +206,7 @@ public class DefaultDeploymentConfiguration extends /** * {@inheritDoc} - * + * * The default is false. */ @Override @@ -295,8 +294,8 @@ public class DefaultDeploymentConfiguration extends */ private void checkProductionMode() { productionMode = getApplicationOrSystemProperty( - Constants.SERVLET_PARAMETER_PRODUCTION_MODE, "false").equals( - "true"); + Constants.SERVLET_PARAMETER_PRODUCTION_MODE, "false") + .equals("true"); if (!productionMode) { getLogger().warning(Constants.NOT_PRODUCTION_MODE_INFO); } @@ -308,7 +307,7 @@ public class DefaultDeploymentConfiguration extends private void checkXsrfProtection() { xsrfProtectionEnabled = !getApplicationOrSystemProperty( Constants.SERVLET_PARAMETER_DISABLE_XSRF_PROTECTION, "false") - .equals("true"); + .equals("true"); if (!xsrfProtectionEnabled) { getLogger().warning(Constants.WARNING_XSRF_PROTECTION_DISABLED); } @@ -319,10 +318,9 @@ public class DefaultDeploymentConfiguration extends */ private void checkResourceCacheTime() { try { - resourceCacheTime = Integer - .parseInt(getApplicationOrSystemProperty( - Constants.SERVLET_PARAMETER_RESOURCE_CACHE_TIME, - Integer.toString(DEFAULT_RESOURCE_CACHE_TIME))); + resourceCacheTime = Integer.parseInt(getApplicationOrSystemProperty( + Constants.SERVLET_PARAMETER_RESOURCE_CACHE_TIME, + Integer.toString(DEFAULT_RESOURCE_CACHE_TIME))); } catch (NumberFormatException e) { getLogger().warning( Constants.WARNING_RESOURCE_CACHING_TIME_NOT_NUMERIC); @@ -332,13 +330,12 @@ public class DefaultDeploymentConfiguration extends private void checkHeartbeatInterval() { try { - heartbeatInterval = Integer - .parseInt(getApplicationOrSystemProperty( - Constants.SERVLET_PARAMETER_HEARTBEAT_INTERVAL, - Integer.toString(DEFAULT_HEARTBEAT_INTERVAL))); + heartbeatInterval = Integer.parseInt(getApplicationOrSystemProperty( + Constants.SERVLET_PARAMETER_HEARTBEAT_INTERVAL, + Integer.toString(DEFAULT_HEARTBEAT_INTERVAL))); } catch (NumberFormatException e) { - getLogger().warning( - Constants.WARNING_HEARTBEAT_INTERVAL_NOT_NUMERIC); + getLogger() + .warning(Constants.WARNING_HEARTBEAT_INTERVAL_NOT_NUMERIC); heartbeatInterval = DEFAULT_HEARTBEAT_INTERVAL; } } @@ -370,8 +367,8 @@ public class DefaultDeploymentConfiguration extends private void checkSendUrlsAsParameters() { sendUrlsAsParameters = getApplicationOrSystemProperty( Constants.SERVLET_PARAMETER_SENDURLSASPARAMETERS, - Boolean.toString(DEFAULT_SEND_URLS_AS_PARAMETERS)).equals( - "true"); + Boolean.toString(DEFAULT_SEND_URLS_AS_PARAMETERS)) + .equals("true"); } private Logger getLogger() { diff --git a/server/src/main/java/com/vaadin/server/DefaultErrorHandler.java b/server/src/main/java/com/vaadin/server/DefaultErrorHandler.java index fa0729e011..ad0234c4e8 100644 --- a/server/src/main/java/com/vaadin/server/DefaultErrorHandler.java +++ b/server/src/main/java/com/vaadin/server/DefaultErrorHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -38,9 +38,8 @@ public class DefaultErrorHandler implements ErrorHandler { Throwable t = event.getThrowable(); if (t instanceof SocketException) { // Most likely client browser closed socket - getLogger().info( - "SocketException in CommunicationManager." - + " Most likely client (browser) closed socket."); + getLogger().info("SocketException in CommunicationManager." + + " Most likely client (browser) closed socket."); return; } @@ -64,7 +63,7 @@ public class DefaultErrorHandler implements ErrorHandler { * might be also other irrelevant exceptions that make no sense for Vaadin * users (~developers using Vaadin). This method tries to choose the * relevant one to be reported. - * + * * @since 7.2 * @param t * a throwable passed to ErrorHandler @@ -100,7 +99,7 @@ public class DefaultErrorHandler implements ErrorHandler { /** * Returns the AbstractComponent associated with the given error if such can * be found - * + * * @param event * The error to investigate * @return The {@link AbstractComponent} to error relates to or null if @@ -110,8 +109,8 @@ public class DefaultErrorHandler implements ErrorHandler { public static AbstractComponent findAbstractComponent( com.vaadin.server.ErrorEvent event) { if (event instanceof ConnectorErrorEvent) { - Component c = findComponent(((ConnectorErrorEvent) event) - .getConnector()); + Component c = findComponent( + ((ConnectorErrorEvent) event).getConnector()); if (c instanceof AbstractComponent) { return (AbstractComponent) c; } @@ -124,7 +123,7 @@ public class DefaultErrorHandler implements ErrorHandler { * Finds the nearest component by traversing upwards in the hierarchy. If * connector is a Component, that Component is returned. Otherwise, looks * upwards in the hierarchy until it finds a {@link Component}. - * + * * @return A Component or null if no component was found */ public static Component findComponent(Connector connector) { diff --git a/server/src/main/java/com/vaadin/server/DefaultSystemMessagesProvider.java b/server/src/main/java/com/vaadin/server/DefaultSystemMessagesProvider.java index 17177c36ca..9bd6e1232f 100644 --- a/server/src/main/java/com/vaadin/server/DefaultSystemMessagesProvider.java +++ b/server/src/main/java/com/vaadin/server/DefaultSystemMessagesProvider.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -19,7 +19,7 @@ package com.vaadin.server; /** * System messages provider using the built-in default system messages. This * singleton is accessed using {@link #get()}. - * + * * @author Vaadin Ltd * @since 7.0.0 */ @@ -39,7 +39,7 @@ public class DefaultSystemMessagesProvider implements SystemMessagesProvider { /** * Gets the instance. - * + * * @return the default system messages provider. */ public static SystemMessagesProvider get() { diff --git a/server/src/main/java/com/vaadin/server/DefaultUIProvider.java b/server/src/main/java/com/vaadin/server/DefaultUIProvider.java index 38525fc020..e264a053e5 100644 --- a/server/src/main/java/com/vaadin/server/DefaultUIProvider.java +++ b/server/src/main/java/com/vaadin/server/DefaultUIProvider.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -29,8 +29,9 @@ public class DefaultUIProvider extends UIProvider { if (uiClassName != null) { ClassLoader classLoader = request.getService().getClassLoader(); try { - Class uiClass = Class.forName(uiClassName, true, - classLoader).asSubclass(UI.class); + Class uiClass = Class + .forName(uiClassName, true, classLoader) + .asSubclass(UI.class); return uiClass; } catch (ClassNotFoundException e) { diff --git a/server/src/main/java/com/vaadin/server/DeploymentConfiguration.java b/server/src/main/java/com/vaadin/server/DeploymentConfiguration.java index 968ec7c0c3..ad4d3db577 100644 --- a/server/src/main/java/com/vaadin/server/DeploymentConfiguration.java +++ b/server/src/main/java/com/vaadin/server/DeploymentConfiguration.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,7 +25,7 @@ import com.vaadin.shared.communication.PushMode; /** * A collection of properties configured at deploy time as well as a way of * accessing third party properties not explicitly supported by this class. - * + * * @author Vaadin Ltd * @version @VERSION@ * @since 7.0.0 @@ -34,7 +34,7 @@ public interface DeploymentConfiguration extends Serializable { /** * Determines the mode of the "legacyPropertyToString" parameter. - * + * * @author Vaadin Ltd * @since 7.1 */ @@ -51,7 +51,7 @@ public interface DeploymentConfiguration extends Serializable { /** * Gets the string that should be used in e.g. web.xml for selecting * this mode. - * + * * @return the property value */ public String getPropertyString() { @@ -72,14 +72,14 @@ public interface DeploymentConfiguration extends Serializable { /** * Returns whether Vaadin is in production mode. - * + * * @return true if in production mode, false otherwise. */ public boolean isProductionMode(); /** * Returns whether cross-site request forgery protection is enabled. - * + * * @return true if XSRF protection is enabled, false otherwise. */ public boolean isXsrfProtectionEnabled(); @@ -88,7 +88,7 @@ public interface DeploymentConfiguration extends Serializable { * Returns whether sync id checking is enabled. The sync id is used to * gracefully handle situations when the client sends a message to a * connector that has recently been removed on the server. - * + * * @since 7.3 * @return true if sync id checking is enabled; * false otherwise @@ -97,7 +97,7 @@ public interface DeploymentConfiguration extends Serializable { /** * Returns the time resources can be cached in the browsers, in seconds. - * + * * @return The resource cache time. */ public int getResourceCacheTime(); @@ -105,7 +105,7 @@ public interface DeploymentConfiguration extends Serializable { /** * Returns the number of seconds between heartbeat requests of a UI, or a * non-positive number if heartbeat is disabled. - * + * * @return The time between heartbeats. */ public int getHeartbeatInterval(); @@ -114,7 +114,7 @@ public interface DeploymentConfiguration extends Serializable { * Returns whether the sending of URL's as GET and POST parameters in * requests with content-type application/x-www-form-urlencoded * is enabled or not. - * + * * @return false if set to false or true otherwise */ public boolean isSendUrlsAsParameters(); @@ -128,11 +128,11 @@ public interface DeploymentConfiguration extends Serializable { * heartbeat requests cause the session to stay open for as long as there * are open UIs on the client side. If it is {@code true}, the session is * eventually closed if the open UIs do not have any user interaction. - * + * * @see WrappedSession#getMaxInactiveInterval() - * + * * @since 7.0.0 - * + * * @return True if UIs and sessions receiving only heartbeat requests are * eventually closed; false if heartbeat requests extend UI and * session lifetime indefinitely. @@ -142,7 +142,7 @@ public interface DeploymentConfiguration extends Serializable { /** * Returns the mode of bidirectional ("push") client-server communication * that should be used. - * + * * @return The push mode in use. */ public PushMode getPushMode(); @@ -150,7 +150,7 @@ public interface DeploymentConfiguration extends Serializable { /** * 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(); @@ -158,7 +158,7 @@ public interface DeploymentConfiguration extends Serializable { /** * 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. @@ -173,18 +173,18 @@ public interface DeploymentConfiguration extends Serializable { /** * Gets UI class configuration option value. - * + * * @return UI class name - * + * * @since 7.4 */ public String getUIClassName(); /** * Gets UI provider class configuration option value. - * + * * @since 7.4 - * + * * @return UI class name */ public String getUIProviderClassName(); @@ -192,23 +192,23 @@ public interface DeploymentConfiguration extends Serializable { /** * Gets Widgetset configuration option value. {@code defaultValue} is * returned if widgetset parameter is not configured. - * + * * @since 7.4 - * + * * @return UI class name */ public String getWidgetset(String defaultValue); /** * Gets resources path configuration option value. - * + * * @since 7.4 */ public String getResourcesPath(); /** * Gets class loader configuration option value. - * + * * @since 7.4 */ public String getClassLoaderName(); @@ -216,7 +216,7 @@ public interface DeploymentConfiguration extends Serializable { /** * Returns to legacy Property.toString() mode used. See * {@link AbstractProperty#isLegacyToStringEnabled()} for more information. - * + * * @return The Property.toString() mode in use. */ @Deprecated diff --git a/server/src/main/java/com/vaadin/server/DownloadStream.java b/server/src/main/java/com/vaadin/server/DownloadStream.java index 65ef560974..fdc757bd5e 100644 --- a/server/src/main/java/com/vaadin/server/DownloadStream.java +++ b/server/src/main/java/com/vaadin/server/DownloadStream.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -35,7 +35,7 @@ import javax.servlet.http.HttpServletResponse; * session to prevent locking the session during long file downloads. If your * DownloadStream uses anything from the session, you must handle the locking. *

      - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -78,7 +78,7 @@ public class DownloadStream implements Serializable { /** * Gets downloadable stream. - * + * * @return output stream. */ public InputStream getStream() { @@ -87,7 +87,7 @@ public class DownloadStream implements Serializable { /** * Sets the stream. - * + * * @param stream * The stream to set */ @@ -97,7 +97,7 @@ public class DownloadStream implements Serializable { /** * Gets stream content type. - * + * * @return type of the stream content. */ public String getContentType() { @@ -106,7 +106,7 @@ public class DownloadStream implements Serializable { /** * Sets stream content type. - * + * * @param contentType * the contentType to set */ @@ -116,7 +116,7 @@ public class DownloadStream implements Serializable { /** * Returns the file name. - * + * * @return the name of the file. */ public String getFileName() { @@ -125,7 +125,7 @@ public class DownloadStream implements Serializable { /** * Sets the file name. - * + * * @param fileName * the file name to set. */ @@ -138,9 +138,9 @@ public class DownloadStream implements Serializable { * 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 @@ -158,7 +158,7 @@ public class DownloadStream implements Serializable { * 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. @@ -172,7 +172,7 @@ public class DownloadStream implements Serializable { /** * Gets the names of the parameters. - * + * * @return Iterator of names or null if no parameters are set. */ public Iterator getParameterNames() { @@ -187,7 +187,7 @@ public class DownloadStream implements Serializable { * 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() { @@ -199,7 +199,7 @@ public class DownloadStream implements Serializable { * 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. */ @@ -209,7 +209,7 @@ public class DownloadStream implements Serializable { /** * Gets the size of the download buffer. - * + * * @return int The size of the buffer in bytes. */ public int getBufferSize() { @@ -218,10 +218,10 @@ public class DownloadStream implements Serializable { /** * Sets the size of the download buffer. - * + * * @param bufferSize * the size of the buffer in bytes. - * + * * @since 7.0 */ public void setBufferSize(int bufferSize) { @@ -238,15 +238,15 @@ public class DownloadStream implements Serializable { * response. If there's is a parameter named Location, a * redirect (302 Moved temporarily) is sent instead of the contents of this * stream. - * + * * @param request * the request for which the response should be written * @param response * the Vaadin response to write this download stream to - * + * * @throws IOException * passed through from the Vaadin response - * + * * @since 7.0 */ public void writeResponse(VaadinRequest request, VaadinResponse response) @@ -287,7 +287,8 @@ public class DownloadStream implements Serializable { // Content-Disposition: attachment generally forces download String contentDisposition = getParameter(CONTENT_DISPOSITION); if (contentDisposition == null) { - contentDisposition = getContentDispositionFilename(getFileName()); + contentDisposition = getContentDispositionFilename( + getFileName()); } response.setHeader(CONTENT_DISPOSITION, contentDisposition); @@ -321,7 +322,7 @@ public class DownloadStream implements Serializable { /** * Returns the filename formatted for inclusion in a Content-Disposition * header. Includes both a plain version of the name and a UTF-8 version - * + * * @since 7.4.8 * @param filename * The filename to include @@ -340,7 +341,7 @@ public class DownloadStream implements Serializable { /** * Helper method that tries to close an output stream and ignores any * exceptions. - * + * * @param out * the output stream to close, null is also * supported @@ -359,7 +360,7 @@ public class DownloadStream implements Serializable { /** * Helper method that tries to close an input stream and ignores any * exceptions. - * + * * @param in * the input stream to close, null is also supported */ diff --git a/server/src/main/java/com/vaadin/server/DragAndDropService.java b/server/src/main/java/com/vaadin/server/DragAndDropService.java index 4a894b3bff..61fd1fefbd 100644 --- a/server/src/main/java/com/vaadin/server/DragAndDropService.java +++ b/server/src/main/java/com/vaadin/server/DragAndDropService.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -67,17 +67,15 @@ public class DragAndDropService implements VariableOwner, ClientConnector { .get("component"); if (sourceComponent != null && !sourceComponent.isConnectorEnabled()) { // source component not supposed to be enabled - getLogger().warning( - "Client dropped from " + sourceComponent - + " even though it's disabled"); + getLogger().warning("Client dropped from " + sourceComponent + + " even though it's disabled"); return; } // Validate drop handler owner if (!(owner instanceof DropTarget)) { - getLogger() - .severe("DropHandler owner " + owner - + " must implement DropTarget"); + getLogger().severe("DropHandler owner " + owner + + " must implement DropTarget"); return; } // owner cannot be null here @@ -85,10 +83,8 @@ public class DragAndDropService implements VariableOwner, ClientConnector { DropTarget dropTarget = (DropTarget) owner; if (!dropTarget.isConnectorEnabled()) { - getLogger() - .warning( - "Client dropped on " + owner - + " even though it's disabled"); + getLogger().warning("Client dropped on " + owner + + " even though it's disabled"); return; } @@ -107,7 +103,7 @@ public class DragAndDropService implements VariableOwner, ClientConnector { /** * Handles a drop request from the VDragAndDropManager. - * + * * @param dropTarget * @param variables */ @@ -127,8 +123,10 @@ public class DragAndDropService implements VariableOwner, ClientConnector { * operation based on the info passed from the client widgets (drag * source for Transferable, drop target for DragDropDetails). */ - Transferable transferable = constructTransferable(dropTarget, variables); - TargetDetails dropData = constructDragDropDetails(dropTarget, variables); + Transferable transferable = constructTransferable(dropTarget, + variables); + TargetDetails dropData = constructDragDropDetails(dropTarget, + variables); DragAndDropEvent dropEvent = new DragAndDropEvent(transferable, dropData); if (dropHandler.getAcceptCriterion().accept(dropEvent)) { @@ -138,7 +136,7 @@ public class DragAndDropService implements VariableOwner, ClientConnector { /** * Handles a drag/move request from the VDragAndDropManager. - * + * * @param dropTarget * @param variables */ @@ -153,7 +151,8 @@ public class DragAndDropService implements VariableOwner, ClientConnector { * operation based on the info passed from the client widgets (drag * source for Transferable, current target for DragDropDetails). */ - Transferable transferable = constructTransferable(dropTarget, variables); + Transferable transferable = constructTransferable(dropTarget, + variables); TargetDetails dragDropDetails = constructDragDropDetails(dropTarget, variables); @@ -166,7 +165,7 @@ public class DragAndDropService implements VariableOwner, ClientConnector { * Construct DragDropDetails based on variables from client drop target. * Uses DragDropDetailsTranslator if available, otherwise a default * DragDropDetails implementation is used. - * + * * @param dropTarget * @param variables * @return @@ -378,7 +377,7 @@ public class DragAndDropService implements VariableOwner, ClientConnector { /* * (non-Javadoc) - * + * * @see com.vaadin.server.ClientConnector#isAttached() */ @Override diff --git a/server/src/main/java/com/vaadin/server/EncodeResult.java b/server/src/main/java/com/vaadin/server/EncodeResult.java index bf4fd48438..a6647b1c5a 100644 --- a/server/src/main/java/com/vaadin/server/EncodeResult.java +++ b/server/src/main/java/com/vaadin/server/EncodeResult.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/server/src/main/java/com/vaadin/server/ErrorEvent.java b/server/src/main/java/com/vaadin/server/ErrorEvent.java index 5f8cb4eaca..b886c30afb 100644 --- a/server/src/main/java/com/vaadin/server/ErrorEvent.java +++ b/server/src/main/java/com/vaadin/server/ErrorEvent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,7 +25,7 @@ import com.vaadin.ui.UI; * Typically handled by {@link VaadinSession#getErrorHandler()} but can also be * handled by a {@link Connector} specific handler, set using * {@link ClientConnector#setErrorHandler(ErrorHandler)}. - * + * */ public class ErrorEvent implements Serializable { @@ -37,7 +37,7 @@ public class ErrorEvent implements Serializable { /** * Gets the contained throwable, the cause of the error. - * + * * @return */ public Throwable getThrowable() { @@ -56,7 +56,7 @@ public class ErrorEvent implements Serializable { *

      * Returns a {@link DefaultErrorHandler} if no error handler was found *

      - * + * * @param connector * The target connector * @return An ErrorHandler for the connector @@ -108,10 +108,10 @@ public class ErrorEvent implements Serializable { /** * Method for finding the error handler for the given session. - * + * * @param connector * The target connector - * + * * @return An ErrorHandler for the session or null if none was found */ public static ErrorHandler findErrorHandler(VaadinSession session) { diff --git a/server/src/main/java/com/vaadin/server/ErrorHandler.java b/server/src/main/java/com/vaadin/server/ErrorHandler.java index 9c3af4c999..dc58348db1 100644 --- a/server/src/main/java/com/vaadin/server/ErrorHandler.java +++ b/server/src/main/java/com/vaadin/server/ErrorHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -24,7 +24,7 @@ public interface ErrorHandler extends Serializable { /** * Invoked when an error occurs. - * + * * @param event * the fired event. */ diff --git a/server/src/main/java/com/vaadin/server/ErrorHandlingRunnable.java b/server/src/main/java/com/vaadin/server/ErrorHandlingRunnable.java index 8ec24c0bcb..0b8f21c008 100644 --- a/server/src/main/java/com/vaadin/server/ErrorHandlingRunnable.java +++ b/server/src/main/java/com/vaadin/server/ErrorHandlingRunnable.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,7 +20,7 @@ import java.io.Serializable; /** * Defines the interface to handle exceptions thrown during the execution of a * FutureAccess. - * + * * @since 7.1.8 * @author Vaadin Ltd */ @@ -28,7 +28,7 @@ public interface ErrorHandlingRunnable extends Runnable, Serializable { /** * Handles exceptions thrown during the execution of a FutureAccess. - * + * * @since 7.1.8 * @param exception * the thrown exception. diff --git a/server/src/main/java/com/vaadin/server/ErrorMessage.java b/server/src/main/java/com/vaadin/server/ErrorMessage.java index 0171b95e54..26bdb123ef 100644 --- a/server/src/main/java/com/vaadin/server/ErrorMessage.java +++ b/server/src/main/java/com/vaadin/server/ErrorMessage.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,7 +21,7 @@ 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 */ @@ -59,7 +59,7 @@ public interface ErrorMessage extends Serializable { /** * Textual representation for server-client communication of level - * + * * @return String for error severity */ public String getText() { @@ -68,7 +68,7 @@ public interface ErrorMessage extends Serializable { /** * Integer representation of error severity for comparison - * + * * @return integer for error severity */ public int intValue() { @@ -115,7 +115,7 @@ public interface ErrorMessage extends Serializable { /** * Gets the errors level. - * + * * @return the level of error as an integer. */ public ErrorLevel getErrorLevel(); @@ -123,11 +123,11 @@ public interface ErrorMessage extends Serializable { /** * 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 */ diff --git a/server/src/main/java/com/vaadin/server/Extension.java b/server/src/main/java/com/vaadin/server/Extension.java index b27c58b4bc..ca6c048d91 100644 --- a/server/src/main/java/com/vaadin/server/Extension.java +++ b/server/src/main/java/com/vaadin/server/Extension.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -24,7 +24,7 @@ package com.vaadin.server; * 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 */ @@ -38,7 +38,7 @@ public interface Extension extends ClientConnector { /** * Sets the parent connector of the connector. - * + * * This method automatically calls {@link #attach()} if the connector * becomes attached to the session. *

      @@ -47,7 +47,7 @@ public interface Extension extends ClientConnector { * for adding extensions to a parent and it will call this method * implicitly. *

      - * + * * @param parent * the parent connector * @throws IllegalStateException diff --git a/server/src/main/java/com/vaadin/server/ExternalResource.java b/server/src/main/java/com/vaadin/server/ExternalResource.java index e3b026dde8..2eed5b7ab5 100644 --- a/server/src/main/java/com/vaadin/server/ExternalResource.java +++ b/server/src/main/java/com/vaadin/server/ExternalResource.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,7 +25,7 @@ import com.vaadin.util.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 */ @@ -44,7 +44,7 @@ public class ExternalResource implements Resource, Serializable { /** * Creates a new download component for downloading directly from given URL. - * + * * @param sourceURL * the source URL. */ @@ -58,7 +58,7 @@ public class ExternalResource implements Resource, Serializable { /** * Creates a new download component for downloading directly from given URL. - * + * * @param sourceURL * the source URL. * @param mimeType @@ -71,7 +71,7 @@ public class ExternalResource implements Resource, Serializable { /** * Creates a new download component for downloading directly from given URL. - * + * * @param sourceURL * the source URL. */ @@ -85,7 +85,7 @@ public class ExternalResource implements Resource, Serializable { /** * Creates a new download component for downloading directly from given URL. - * + * * @param sourceURL * the source URL. * @param mimeType @@ -98,7 +98,7 @@ public class ExternalResource implements Resource, Serializable { /** * Gets the URL of the external resource. - * + * * @return the URL of the external resource. */ public String getURL() { @@ -107,7 +107,7 @@ public class ExternalResource implements Resource, Serializable { /** * Gets the MIME type of the resource. - * + * * @see com.vaadin.server.Resource#getMIMEType() */ @Override diff --git a/server/src/main/java/com/vaadin/server/FileDownloader.java b/server/src/main/java/com/vaadin/server/FileDownloader.java index b0c3bb1120..adb526219b 100644 --- a/server/src/main/java/com/vaadin/server/FileDownloader.java +++ b/server/src/main/java/com/vaadin/server/FileDownloader.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -41,7 +41,7 @@ import com.vaadin.ui.AbstractComponent; * while files served in other ways, (e.g. {@link ExternalResource} or * {@link ThemeResource}) will not automatically get this treatment. *

      - * + * * @author Vaadin Ltd * @since 7.0.0 */ @@ -53,7 +53,7 @@ public class FileDownloader extends AbstractExtension { * Creates a new file downloader for the given resource. To use the * downloader, you should also {@link #extend(AbstractClientConnector)} the * component. - * + * * @param resource * the resource to download when the user clicks the extended * component. @@ -71,7 +71,7 @@ public class FileDownloader extends AbstractExtension { /** * Gets the resource set for download. - * + * * @return the resource that will be downloaded if clicking the extended * component */ @@ -82,7 +82,7 @@ public class FileDownloader extends AbstractExtension { /** * Sets the resource that is downloaded when the extended component is * clicked. - * + * * @param resource * the resource to download */ @@ -100,7 +100,7 @@ public class FileDownloader extends AbstractExtension { * {@link FileResource} and {@link ClassResource}) but not other resource * types (e.g. {@link ExternalResource} or {@link ThemeResource}). *

      - * + * * @param overrideContentType * true to override the content type if possible; * false to use the original content type. @@ -111,9 +111,9 @@ public class FileDownloader extends AbstractExtension { /** * Checks whether the content type should be overridden. - * + * * @see #setOverrideContentType(boolean) - * + * * @return true if the content type will be overridden when * possible; false if the original content type will be * used. @@ -144,9 +144,8 @@ public class FileDownloader extends AbstractExtension { String contentDisposition = stream .getParameter(DownloadStream.CONTENT_DISPOSITION); if (contentDisposition == null) { - contentDisposition = "attachment; " - + DownloadStream.getContentDispositionFilename(stream - .getFileName()); + contentDisposition = "attachment; " + DownloadStream + .getContentDispositionFilename(stream.getFileName()); } stream.setParameter(DownloadStream.CONTENT_DISPOSITION, diff --git a/server/src/main/java/com/vaadin/server/FileResource.java b/server/src/main/java/com/vaadin/server/FileResource.java index 28de124fe9..ff74ab9dca 100644 --- a/server/src/main/java/com/vaadin/server/FileResource.java +++ b/server/src/main/java/com/vaadin/server/FileResource.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -27,7 +27,7 @@ import com.vaadin.util.FileTypeResolver; * 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 */ @@ -52,7 +52,7 @@ public class FileResource implements ConnectorResource { /** * Creates a new file resource for providing given file for client * terminals. - * + * * @param sourceFile * the file that should be served. */ @@ -66,22 +66,23 @@ public class FileResource implements ConnectorResource { @Override public DownloadStream getStream() { try { - final DownloadStream ds = new DownloadStream(new FileInputStream( - sourceFile), getMIMEType(), getFilename()); + 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) { - throw new RuntimeException("File not found: " - + sourceFile.getName(), e); + throw new RuntimeException( + "File not found: " + sourceFile.getName(), e); } } /** * Gets the source file. - * + * * @return the source File. */ public File getSourceFile() { @@ -90,7 +91,7 @@ public class FileResource implements ConnectorResource { /** * Sets the source file. - * + * * @param sourceFile * the source file to set. */ @@ -113,7 +114,7 @@ public class FileResource implements ConnectorResource { * 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. */ public long getCacheTime() { @@ -125,7 +126,7 @@ public class FileResource implements ConnectorResource { * 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. */ @@ -135,12 +136,12 @@ public class FileResource implements ConnectorResource { /** * 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 the size of the buffer in bytes. */ public int getBufferSize() { @@ -149,7 +150,7 @@ public class FileResource implements ConnectorResource { /** * Sets the size of the download buffer used for this resource. - * + * * @param bufferSize * the size of the buffer in bytes. */ diff --git a/server/src/main/java/com/vaadin/server/FontAwesome.java b/server/src/main/java/com/vaadin/server/FontAwesome.java index 2a07a0b1a6..ee152df571 100644 --- a/server/src/main/java/com/vaadin/server/FontAwesome.java +++ b/server/src/main/java/com/vaadin/server/FontAwesome.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -28,7 +28,7 @@ package com.vaadin.server; *

      * The Font Awesome version currently included is 4.4.0. *

      - * + * * @since 7.2 * @author Vaadin Ltd * @see http://fortawesome.github.io/Font-Awesome/ @@ -750,7 +750,7 @@ public enum FontAwesome implements FontIcon { /* * (non-Javadoc) - * + * * @see com.vaadin.ui.FontIcon#getFontFamily() */ @Override @@ -760,7 +760,7 @@ public enum FontAwesome implements FontIcon { /* * (non-Javadoc) - * + * * @see com.vaadin.ui.FontIcon#getCodepoint() */ @Override @@ -775,7 +775,7 @@ public enum FontAwesome implements FontIcon { /** * Finds an instance of FontAwesome with given codepoint - * + * * @since 7.5.0 * @param codepoint * @return FontAwesome instance with a specific codepoint or null if there @@ -787,8 +787,8 @@ public enum FontAwesome implements FontIcon { return f; } } - throw new IllegalArgumentException("Codepoint " + codepoint - + " not found in FontAwesome"); + throw new IllegalArgumentException( + "Codepoint " + codepoint + " not found in FontAwesome"); } } diff --git a/server/src/main/java/com/vaadin/server/FontIcon.java b/server/src/main/java/com/vaadin/server/FontIcon.java index 2ada45084f..f3671d5159 100644 --- a/server/src/main/java/com/vaadin/server/FontIcon.java +++ b/server/src/main/java/com/vaadin/server/FontIcon.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -27,7 +27,7 @@ import com.vaadin.ui.Label; * fonticon://<fontfamily>/<codepoint> to reference a * specific icon from a specific icon font.
      *

      - * + * * @since 7.2 * @author Vaadin Ltd */ @@ -35,7 +35,7 @@ public interface FontIcon extends Resource { /** * Returns the name (font family) of the font from which this icon comes. * The name is used to apply the correct font where the icon is used. - * + * * @since 7.2 * @return */ @@ -50,7 +50,7 @@ public interface FontIcon extends Resource { * When constructing icon fonts, it might be a good idea to use the * codepoints in the "Private use area", from 0xE000 0xF8FF. *

      - * + * * @since 7.2 * @return */ @@ -59,8 +59,8 @@ public interface FontIcon extends Resource { /** * Returns HTML that can be used to display the icon in places where HTML * can be used, such as a {@link Label} with {@link ContentMode#HTML}. - * - * + * + * * @since 7.2 * @return HTML needed to display icon */ diff --git a/server/src/main/java/com/vaadin/server/GAEVaadinServlet.java b/server/src/main/java/com/vaadin/server/GAEVaadinServlet.java index 2429fde746..2164517b78 100644 --- a/server/src/main/java/com/vaadin/server/GAEVaadinServlet.java +++ b/server/src/main/java/com/vaadin/server/GAEVaadinServlet.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -51,7 +51,7 @@ import com.google.apphosting.api.DeadlineExceededException; /** * ApplicationServlet to be used when deploying to Google App Engine, in * web.xml: - * + * *
        *      <servlet>
        *              <servlet-name>HelloWorld</servlet-name>
      @@ -62,17 +62,17 @@ import com.google.apphosting.api.DeadlineExceededException;
        *              </init-param>
        *      </servlet>
        * 
      - * + * * Session support must be enabled in appengine-web.xml: - * + * *
        *      <sessions-enabled>true</sessions-enabled>
        * 
      - * + * * Appengine datastore cleanup can be invoked by calling one of the applications * with an additional path "/CLEAN". This can be set up as a cron-job in * cron.xml (see appengine documentation for more information): - * + * *
        * <cronentries>
        *   <cron>
      @@ -82,18 +82,18 @@ import com.google.apphosting.api.DeadlineExceededException;
        *   </cron>
        * </cronentries>
        * 
      - * + * * It is recommended (but not mandatory) to extract themes and widgetsets and * have App Engine server these statically. Extract VAADIN folder (and it's * contents) 'next to' the WEB-INF folder, and add the following to * appengine-web.xml: - * + * *
        *      <static-files>
        *           <include path="/VAADIN/**" />
        *      </static-files>
        * 
      - * + * * Additional limitations: *
        *
      • Do not change application state when serving an ApplicationResource. @@ -139,41 +139,31 @@ public class GAEVaadinServlet extends VaadinServlet { protected void sendDeadlineExceededNotification( VaadinServletRequest request, VaadinServletResponse response) throws IOException { - criticalNotification( - request, - response, - "Deadline Exceeded", + criticalNotification(request, response, "Deadline Exceeded", "I'm sorry, but the operation took too long to complete. We'll try reloading to see where we're at, please take note of any unsaved data...", "", null); } - protected void sendNotSerializableNotification( - VaadinServletRequest request, VaadinServletResponse response) - throws IOException { - criticalNotification( - request, - response, - "NotSerializableException", + protected void sendNotSerializableNotification(VaadinServletRequest request, + VaadinServletResponse response) throws IOException { + criticalNotification(request, response, "NotSerializableException", "I'm sorry, but there seems to be a serious problem, please contact the administrator. And please take note of any unsaved data...", - "", getApplicationUrl(request).toString() - + "?restartApplication"); + "", + getApplicationUrl(request).toString() + "?restartApplication"); } protected void sendCriticalErrorNotification(VaadinServletRequest request, VaadinServletResponse response) throws IOException { - criticalNotification( - request, - response, - "Critical error", + criticalNotification(request, response, "Critical error", "I'm sorry, but there seems to be a serious problem, please contact the administrator. And please take note of any unsaved data...", - "", getApplicationUrl(request).toString() - + "?restartApplication"); + "", + getApplicationUrl(request).toString() + "?restartApplication"); } @Override protected void service(HttpServletRequest unwrappedRequest, - HttpServletResponse unwrappedResponse) throws ServletException, - IOException { + HttpServletResponse unwrappedResponse) + throws ServletException, IOException { VaadinServletRequest request = new VaadinServletRequest( unwrappedRequest, getService()); VaadinServletResponse response = new VaadinServletResponse( @@ -200,8 +190,8 @@ public class GAEVaadinServlet extends VaadinServlet { return; } - final HttpSession session = request.getSession(getService() - .requestCanCreateSession(request)); + final HttpSession session = request + .getSession(getService().requestCanCreateSession(request)); if (session == null) { try { getService().handleSessionExpired(request, response); @@ -219,7 +209,8 @@ public class GAEVaadinServlet extends VaadinServlet { try { // try to get lock long started = System.currentTimeMillis(); - while (System.currentTimeMillis() - started < MAX_UIDL_WAIT_MILLISECONDS) { + while (System.currentTimeMillis() + - started < MAX_UIDL_WAIT_MILLISECONDS) { locked = memcache.put(mutex, 1, Expiration.byDeltaSeconds(40), MemcacheService.SetPolicy.ADD_ONLY_IF_NOT_PRESENT); if (locked || ServletPortletHelper.isUIDLRequest(request)) { @@ -233,8 +224,8 @@ public class GAEVaadinServlet extends VaadinServlet { try { Thread.sleep(RETRY_AFTER_MILLISECONDS); } catch (InterruptedException e) { - getLogger().finer( - "Thread.sleep() interrupted while waiting for lock. Trying again. " + getLogger() + .finer("Thread.sleep() interrupted while waiting for lock. Trying again. " + e); } } @@ -244,7 +235,8 @@ public class GAEVaadinServlet extends VaadinServlet { // client to retry response.setStatus(HttpServletResponse.SC_SERVICE_UNAVAILABLE); // Note: currently interpreting Retry-After as ms, not sec - response.setHeader("Retry-After", "" + RETRY_AFTER_MILLISECONDS); + response.setHeader("Retry-After", + "" + RETRY_AFTER_MILLISECONDS); return; } @@ -264,8 +256,8 @@ public class GAEVaadinServlet extends VaadinServlet { started = new Date().getTime(); String id = AC_BASE + session.getId(); - Date expire = new Date(started - + (getMaxInactiveIntervalSeconds(session) * 1000)); + Date expire = new Date( + started + (getMaxInactiveIntervalSeconds(session) * 1000)); Expiration expires = Expiration.onDate(expire); memcache.put(id, bytes, expires); @@ -303,16 +295,15 @@ public class GAEVaadinServlet extends VaadinServlet { /** * Returns the maximum inactive time for a session. This is used for * handling the expiration of session related information in caches etc. - * + * * @param session * @return inactive timeout in seconds, greater than zero */ protected int getMaxInactiveIntervalSeconds(final HttpSession session) { int interval = session.getMaxInactiveInterval(); if (interval <= 0) { - getLogger() - .log(Level.FINE, - "Undefined session expiration time, using default value instead."); + getLogger().log(Level.FINE, + "Undefined session expiration time, using default value instead."); return DEFAULT_MAX_INACTIVE_INTERVAL; } return interval; @@ -336,11 +327,9 @@ public class GAEVaadinServlet extends VaadinServlet { Blob blob = (Blob) entity.getProperty(PROPERTY_DATA); serializedAC = blob.getBytes(); // bring it to memcache - memcache.put( - AC_BASE + session.getId(), - serializedAC, - Expiration - .byDeltaSeconds(getMaxInactiveIntervalSeconds(session)), + memcache.put(AC_BASE + session.getId(), serializedAC, + Expiration.byDeltaSeconds( + getMaxInactiveIntervalSeconds(session)), MemcacheService.SetPolicy.ADD_ONLY_IF_NOT_PRESENT); } } @@ -353,17 +342,17 @@ public class GAEVaadinServlet extends VaadinServlet { getService().storeSession(vaadinSession, new WrappedHttpSession(session)); } catch (IOException e) { - getLogger().log( - Level.WARNING, + getLogger().log(Level.WARNING, "Could not de-serialize ApplicationContext for " + session.getId() - + " A new one will be created. ", e); + + " A new one will be created. ", + e); } catch (ClassNotFoundException e) { - getLogger().log( - Level.WARNING, + getLogger().log(Level.WARNING, "Could not de-serialize ApplicationContext for " + session.getId() - + " A new one will be created. ", e); + + " A new one will be created. ", + e); } } @@ -386,7 +375,7 @@ public class GAEVaadinServlet extends VaadinServlet { /** * Removes the ApplicationContext from the session in order to minimize the * data serialized to datastore and memcache. - * + * * @param request */ private void cleanSession(VaadinServletRequest request) { @@ -416,7 +405,7 @@ public class GAEVaadinServlet extends VaadinServlet { /** * This will look at the timestamp and delete expired persisted Vaadin and * appengine sessions from the datastore. - * + * * TODO Possible improvements include: 1. Use transactions (requires entity * groups - overkill?) 2. Delete one-at-a-time, catch possible exception, * continue w/ next. @@ -430,16 +419,15 @@ public class GAEVaadinServlet extends VaadinServlet { Query q = new Query(AC_BASE); q.setKeysOnly(); - q.addFilter(PROPERTY_EXPIRES, - FilterOperator.LESS_THAN_OR_EQUAL, expire); + q.addFilter(PROPERTY_EXPIRES, FilterOperator.LESS_THAN_OR_EQUAL, + expire); PreparedQuery pq = ds.prepare(q); - List entities = pq.asList(Builder - .withLimit(CLEANUP_LIMIT)); + List entities = pq + .asList(Builder.withLimit(CLEANUP_LIMIT)); if (entities != null) { - getLogger() - .log(Level.INFO, - "Vaadin cleanup deleting {0} expired Vaadin sessions.", - entities.size()); + getLogger().log(Level.INFO, + "Vaadin cleanup deleting {0} expired Vaadin sessions.", + entities.size()); List keys = new ArrayList(); for (Entity e : entities) { keys.add(e.getKey()); @@ -454,13 +442,12 @@ public class GAEVaadinServlet extends VaadinServlet { q.addFilter(PROPERTY_APPENGINE_EXPIRES, FilterOperator.LESS_THAN_OR_EQUAL, expire); PreparedQuery pq = ds.prepare(q); - List entities = pq.asList(Builder - .withLimit(CLEANUP_LIMIT)); + List entities = pq + .asList(Builder.withLimit(CLEANUP_LIMIT)); if (entities != null) { - getLogger() - .log(Level.INFO, - "Vaadin cleanup deleting {0} expired appengine sessions.", - entities.size()); + getLogger().log(Level.INFO, + "Vaadin cleanup deleting {0} expired appengine sessions.", + entities.size()); List keys = new ArrayList(); for (Entity e : entities) { keys.add(e.getKey()); diff --git a/server/src/main/java/com/vaadin/server/GenericFontIcon.java b/server/src/main/java/com/vaadin/server/GenericFontIcon.java index cf435d55e6..879ca679c8 100644 --- a/server/src/main/java/com/vaadin/server/GenericFontIcon.java +++ b/server/src/main/java/com/vaadin/server/GenericFontIcon.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -17,7 +17,7 @@ package com.vaadin.server; /** * A generic implementation of {@link FontIcon} interface - * + * * @since 7.5.0 * @author Vaadin Ltd */ @@ -29,7 +29,7 @@ public class GenericFontIcon implements FontIcon { /** * Creates a new instance of GenericFontIcon with given font family and * codepoint - * + * * @param fontFamily * Name of the type face that is used to display icons * @param codepoint @@ -42,7 +42,7 @@ public class GenericFontIcon implements FontIcon { /* * (non-Javadoc) - * + * * @see com.vaadin.server.FontIcon#getFontFamily() */ @Override @@ -52,7 +52,7 @@ public class GenericFontIcon implements FontIcon { /* * (non-Javadoc) - * + * * @see com.vaadin.server.Resource#getMIMEType() */ @Override @@ -63,7 +63,7 @@ public class GenericFontIcon implements FontIcon { /* * (non-Javadoc) - * + * * @see com.vaadin.server.FontIcon#getCodepoint() */ @Override @@ -73,7 +73,7 @@ public class GenericFontIcon implements FontIcon { /* * (non-Javadoc) - * + * * @see com.vaadin.server.FontIcon#getHtml() */ @Override @@ -84,7 +84,7 @@ public class GenericFontIcon implements FontIcon { /** * Utility method for generating HTML that displays an icon from specific * fontFamiliy with a given codePoint in the font - * + * * @param fontFamily * Name of the font family * @param codePoint @@ -98,7 +98,7 @@ public class GenericFontIcon implements FontIcon { /* * (non-Javadoc) - * + * * @see java.lang.Object#hashCode() */ @Override @@ -113,7 +113,7 @@ public class GenericFontIcon implements FontIcon { /* * (non-Javadoc) - * + * * @see java.lang.Object#equals(java.lang.Object) */ @Override diff --git a/server/src/main/java/com/vaadin/server/GlobalResourceHandler.java b/server/src/main/java/com/vaadin/server/GlobalResourceHandler.java index d1ef125534..1c3d5816d4 100644 --- a/server/src/main/java/com/vaadin/server/GlobalResourceHandler.java +++ b/server/src/main/java/com/vaadin/server/GlobalResourceHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -36,7 +36,7 @@ import com.vaadin.util.CurrentInstance; /** * A {@link RequestHandler} that takes care of {@link ConnectorResource}s that * should not be served by the connector. - * + * * @author Vaadin Ltd * @version @VERSION@ * @since 7.0.0 @@ -61,9 +61,9 @@ public class GlobalResourceHandler implements RequestHandler { private int nextLegacyId = 0; // APP/global/[uiid]/[type]/[id] - private static final Pattern pattern = Pattern.compile("^/?" - + ApplicationConstants.APP_PATH + '/' + RESOURCE_REQUEST_PATH - + "(\\d+)/(([^/]+)(/.*))"); + private static final Pattern pattern = Pattern + .compile("^/?" + ApplicationConstants.APP_PATH + '/' + + RESOURCE_REQUEST_PATH + "(\\d+)/(([^/]+)(/.*))"); @Override public boolean handleRequest(VaadinSession session, VaadinRequest request, @@ -83,8 +83,8 @@ public class GlobalResourceHandler implements RequestHandler { String key = matcher.group(2); if (key == null) { - return error(request, response, pathInfo - + " is not a valid global resource path"); + return error(request, response, + pathInfo + " is not a valid global resource path"); } session.lock(); Map, CurrentInstance> oldInstances = null; @@ -104,14 +104,14 @@ public class GlobalResourceHandler implements RequestHandler { } if (resource == null) { - return error(request, response, "Global resource " + key - + " not found"); + return error(request, response, + "Global resource " + key + " not found"); } stream = resource.getStream(); if (stream == null) { - return error(request, response, "Resource " + resource - + " didn't produce any stream."); + return error(request, response, + "Resource " + resource + " didn't produce any stream."); } } finally { session.unlock(); @@ -130,7 +130,7 @@ public class GlobalResourceHandler implements RequestHandler { * A {@link ConnectorResource} registered for a {@link LegacyComponent} will * be set to be served with a global URL. Other resource types will be * ignored and thus not served by this handler. - * + * * @param resource * the resource to register * @param ownerConnector @@ -181,7 +181,7 @@ public class GlobalResourceHandler implements RequestHandler { /** * Gets a global URI for a resource if it's registered with this handler. - * + * * @param connector * the connector for which the uri should be generated. * @param resource @@ -189,7 +189,8 @@ public class GlobalResourceHandler implements RequestHandler { * @return an URI string, or null if the resource is not * registered. */ - public String getUri(ClientConnector connector, ConnectorResource resource) { + public String getUri(ClientConnector connector, + ConnectorResource resource) { // app://APP/global/[ui]/[type]/[id] String uri = legacyResourceKeys.get(resource); if (uri != null && !uri.isEmpty()) { @@ -205,7 +206,7 @@ public class GlobalResourceHandler implements RequestHandler { /** * Notifies this handler that resources registered for the given connector * can be released. - * + * * @param connector * the connector for which any registered resources can be * released. @@ -230,8 +231,8 @@ public class GlobalResourceHandler implements RequestHandler { return Logger.getLogger(GlobalResourceHandler.class.getName()); } - private static boolean error(VaadinRequest request, - VaadinResponse response, String logMessage) throws IOException { + private static boolean error(VaadinRequest request, VaadinResponse response, + String logMessage) throws IOException { getLogger().log(Level.WARNING, logMessage); response.sendError(HttpServletResponse.SC_NOT_FOUND, request.getPathInfo() + " can not be found"); diff --git a/server/src/main/java/com/vaadin/server/JavaScriptCallbackHelper.java b/server/src/main/java/com/vaadin/server/JavaScriptCallbackHelper.java index ac4a586d00..9e9dcf3d2a 100644 --- a/server/src/main/java/com/vaadin/server/JavaScriptCallbackHelper.java +++ b/server/src/main/java/com/vaadin/server/JavaScriptCallbackHelper.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -39,7 +39,7 @@ import elemental.json.JsonException; * {@link com.vaadin.client.JavaScriptConnectorHelper}. *

        * You should most likely no use this class directly. - * + * * @author Vaadin Ltd * @since 7.0.0 */ @@ -89,13 +89,12 @@ public class JavaScriptCallbackHelper implements Serializable { 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."); + 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 = (JsonArray) JsonCodec.encode(arguments, null, - Object[].class, null).getEncodedValue(); + JsonArray args = (JsonArray) JsonCodec + .encode(arguments, null, Object[].class, null) + .getEncodedValue(); connector.addMethodInvocationToQueue( JavaScriptCallbackRpc.class.getName(), CALL_METHOD, new Object[] { name, args }); diff --git a/server/src/main/java/com/vaadin/server/JsonCodec.java b/server/src/main/java/com/vaadin/server/JsonCodec.java index 8b685bb046..60f3856211 100644 --- a/server/src/main/java/com/vaadin/server/JsonCodec.java +++ b/server/src/main/java/com/vaadin/server/JsonCodec.java @@ -417,7 +417,8 @@ public class JsonCodec implements Serializable { connectorTracker); } else if (JsonConstants.VTYPE_STRINGARRAY.equals(transportType)) { - return decodeArray(String.class, (JsonArray) encodedJsonValue, null); + return decodeArray(String.class, (JsonArray) encodedJsonValue, + null); } // Special Vaadin types @@ -467,7 +468,8 @@ public class JsonCodec implements Serializable { } } - if (!restrictToInternalTypes && targetType instanceof ParameterizedType) { + if (!restrictToInternalTypes + && targetType instanceof ParameterizedType) { Type keyType = ((ParameterizedType) targetType) .getActualTypeArguments()[0]; Type valueType = ((ParameterizedType) targetType) @@ -489,14 +491,16 @@ public class JsonCodec implements Serializable { } private static Map decodeObjectMap(Type keyType, - Type valueType, JsonArray jsonMap, ConnectorTracker connectorTracker) { + Type valueType, JsonArray jsonMap, + ConnectorTracker connectorTracker) { JsonArray keys = jsonMap.getArray(0); JsonArray values = jsonMap.getArray(1); assert (keys.length() == values.length()); - Map map = new HashMap(keys.length() * 2); + Map map = new HashMap( + keys.length() * 2); for (int i = 0; i < keys.length(); i++) { Object key = decodeInternalOrCustomType(keyType, keys.get(i), connectorTracker); @@ -554,7 +558,8 @@ public class JsonCodec implements Serializable { private static Object decodeParametrizedType(Type targetType, boolean restrictToInternalTypes, int typeIndex, JsonValue value, ConnectorTracker connectorTracker) { - if (!restrictToInternalTypes && targetType instanceof ParameterizedType) { + if (!restrictToInternalTypes + && targetType instanceof ParameterizedType) { Type childType = ((ParameterizedType) targetType) .getActualTypeArguments()[typeIndex]; // Only decode the given type @@ -569,7 +574,8 @@ public class JsonCodec implements Serializable { } } - private static Object decodeEnum(Class cls, JsonString value) { + private static Object decodeEnum(Class cls, + JsonString value) { return Enum.valueOf(cls, value.getString()); } @@ -616,8 +622,8 @@ public class JsonCodec implements Serializable { String fieldName = property.getName(); JsonValue encodedFieldValue = serializedObject.get(fieldName); Type fieldType = property.getType(); - Object decodedFieldValue = decodeInternalOrCustomType( - fieldType, encodedFieldValue, connectorTracker); + Object decodedFieldValue = decodeInternalOrCustomType(fieldType, + encodedFieldValue, connectorTracker); property.setValue(decodedObject, decodedFieldValue); } @@ -654,11 +660,11 @@ public class JsonCodec implements Serializable { toReturn = encodeCollection(valueType, (Collection) value, connectorTracker); } else if (value instanceof Map) { - toReturn = encodeMap(valueType, (Map) value, connectorTracker); + toReturn = encodeMap(valueType, (Map) value, + connectorTracker); } else if (value instanceof Connector) { - if (value instanceof Component - && !(LegacyCommunicationManager - .isComponentVisibleToClient((Component) value))) { + if (value instanceof Component && !(LegacyCommunicationManager + .isComponentVisibleToClient((Component) value))) { // an encoded null is cached, return it directly. return ENCODE_RESULT_NULL; } @@ -724,12 +730,11 @@ public class JsonCodec implements Serializable { Object fieldValue = property.getValue(value); if (encoded.hasKey(fieldName)) { - throw new RuntimeException( - "Can't encode " - + valueType.getName() - + " as it has multiple properties with the name " - + fieldName.toLowerCase() - + ". This can happen if there are getters and setters for a public field (the framework can't know which to ignore) or if there are properties with only casing distinguishing between the names (e.g. getFoo() and getFOO())"); + throw new RuntimeException("Can't encode " + + valueType.getName() + + " as it has multiple properties with the name " + + fieldName.toLowerCase() + + ". This can happen if there are getters and setters for a public field (the framework can't know which to ignore) or if there are properties with only casing distinguishing between the names (e.g. getFoo() and getFOO())"); } JsonValue fieldReference; @@ -746,7 +751,8 @@ public class JsonCodec implements Serializable { fieldType, connectorTracker); encoded.put(fieldName, encodeResult.getEncodedValue()); - if (valueChanged(encodeResult.getEncodedValue(), fieldReference)) { + if (valueChanged(encodeResult.getEncodedValue(), + fieldReference)) { diff.put(fieldName, encodeResult.getDiffOrValue()); } } @@ -781,12 +787,12 @@ public class JsonCodec implements Serializable { /** * Compares two json values for deep equality. - * + * * This is a helper for overcoming the fact that * {@link JsonValue#equals(Object)} only does an identity check and * {@link JsonValue#jsEquals(JsonValue)} is defined to use JavaScript * semantics where arrays and objects are equals only based on identity. - * + * * @since 7.4 * @param a * the first json value to check, may not be null @@ -896,7 +902,8 @@ public class JsonCodec implements Serializable { if (mapType instanceof ParameterizedType) { keyType = ((ParameterizedType) mapType).getActualTypeArguments()[0]; - valueType = ((ParameterizedType) mapType).getActualTypeArguments()[1]; + valueType = ((ParameterizedType) mapType) + .getActualTypeArguments()[1]; } else { throw new JsonException("Map is missing generics"); } diff --git a/server/src/main/java/com/vaadin/server/JsonPaintTarget.java b/server/src/main/java/com/vaadin/server/JsonPaintTarget.java index a885acccbc..41cf52d6ab 100644 --- a/server/src/main/java/com/vaadin/server/JsonPaintTarget.java +++ b/server/src/main/java/com/vaadin/server/JsonPaintTarget.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -35,10 +35,10 @@ import com.vaadin.ui.CustomLayout; /** * User Interface Description Language Target. - * + * * TODO document better: role of this class, UIDL format, attributes, variables, * etc. - * + * * @author Vaadin Ltd. * @since 5.0 */ @@ -77,7 +77,7 @@ public class JsonPaintTarget implements PaintTarget { /** * Creates a new JsonPaintTarget. - * + * * @param manager * @param outWriter * A character-output stream. @@ -87,8 +87,8 @@ public class JsonPaintTarget implements PaintTarget { * @throws PaintException * if the paint operation failed. */ - public JsonPaintTarget(LegacyCommunicationManager manager, - Writer outWriter, boolean cachingRequired) throws PaintException { + public JsonPaintTarget(LegacyCommunicationManager manager, Writer outWriter, + boolean cachingRequired) throws PaintException { this.manager = manager; @@ -112,18 +112,18 @@ public class JsonPaintTarget implements PaintTarget { /** * Prints the 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, boolean isChildNode) throws PaintException { @@ -152,10 +152,10 @@ public class JsonPaintTarget implements PaintTarget { /** * Prints the element end tag. - * + * * If the parent tag is closed before every child tag is closed an * PaintException is raised. - * + * * @param tag * the name of the end tag. * @throws PaintException @@ -198,7 +198,7 @@ public class JsonPaintTarget implements PaintTarget { /** * Substitutes the XML sensitive characters with predefined XML entities. - * + * * @param xml * the String to be substituted. * @return A new string instance where all occurrences of XML sensitive @@ -213,12 +213,12 @@ public class JsonPaintTarget implements PaintTarget { /** * Substitutes the XML sensitive characters with predefined XML entities. - * + * * @param xml * the String to be substituted. * @return A new StringBuilder instance where all occurrences of XML * sensitive characters are substituted with entities. - * + * */ static StringBuilder escapeXML(StringBuilder xml) { if (xml == null || xml.length() <= 0) { @@ -241,7 +241,7 @@ public class JsonPaintTarget implements PaintTarget { /** * Escapes the given string so it can safely be used as a JSON string. - * + * * @param s * The string to escape * @return Escaped version of the string @@ -298,7 +298,7 @@ public class JsonPaintTarget implements PaintTarget { /** * Substitutes a XML sensitive character with predefined XML entity. - * + * * @param c * the Character to be replaced with an entity. * @return String of the entity or null if character is not to be replaced @@ -323,11 +323,11 @@ public class JsonPaintTarget implements PaintTarget { /** * Prints XML-escaped text. - * + * * @param str * @throws PaintException * if the paint operation failed. - * + * */ @Override @@ -341,7 +341,8 @@ public class JsonPaintTarget implements PaintTarget { } @Override - public void addAttribute(String name, Resource value) throws PaintException { + public void addAttribute(String name, Resource value) + throws PaintException { if (value == null) { throw new NullPointerException(); } @@ -417,8 +418,7 @@ public class JsonPaintTarget implements PaintTarget { } sb.append("\":"); if (mapValue instanceof Float || mapValue instanceof Integer - || mapValue instanceof Double - || mapValue instanceof Boolean + || mapValue instanceof Double || mapValue instanceof Boolean || mapValue instanceof Alignment) { sb.append(mapValue); } else { @@ -465,7 +465,8 @@ public class JsonPaintTarget implements PaintTarget { @Override public void addVariable(VariableOwner owner, String name, Component value) throws PaintException { - tag.addVariable(new StringVariable(owner, name, value.getConnectorId())); + tag.addVariable( + new StringVariable(owner, name, value.getConnectorId())); } @Override @@ -506,14 +507,14 @@ public class JsonPaintTarget implements PaintTarget { /** * Adds a upload stream type variable. - * + * * TODO not converted for JSON - * + * * @param owner * the Listener for variable changes. * @param name * the Variable name. - * + * * @throws PaintException * if the paint operation failed. */ @@ -528,9 +529,9 @@ public class JsonPaintTarget implements PaintTarget { /** * Prints the single text section. - * + * * Prints full text section. The section data is escaped - * + * * @param sectionTagName * the name of the tag. * @param sectionData @@ -548,7 +549,7 @@ public class JsonPaintTarget implements PaintTarget { /** * Adds XML directly to UIDL. - * + * * @param xml * the Xml to be added. * @throws PaintException @@ -576,7 +577,7 @@ public class JsonPaintTarget implements PaintTarget { /** * Adds XML section with namespace. - * + * * @param sectionTagName * the name of the tag. * @param sectionData @@ -585,7 +586,7 @@ public class JsonPaintTarget implements PaintTarget { * the namespace to be added. * @throws PaintException * if the paint operation failed. - * + * * @see com.vaadin.server.PaintTarget#addXMLSection(String, String, String) */ @@ -613,7 +614,7 @@ public class JsonPaintTarget implements PaintTarget { /** * Gets the UIDL already printed to stream. Paint target must be closed * before the getUIDL can be called. - * + * * @return the UIDL. */ public String getUIDL() { @@ -629,7 +630,7 @@ public class JsonPaintTarget implements PaintTarget { * getUIDL can be called. Subsequent attempts to write to paint * target. If the target was already closed, call to this function is * ignored. will generate an exception. - * + * * @throws PaintException * if the paint operation failed. */ @@ -650,7 +651,7 @@ public class JsonPaintTarget implements PaintTarget { /* * (non-Javadoc) - * + * * @see com.vaadin.terminal.PaintTarget#startPaintable(com.vaadin.terminal * .Paintable, java.lang.String) */ @@ -661,9 +662,7 @@ public class JsonPaintTarget implements PaintTarget { boolean topLevelPaintable = openPaintables.isEmpty(); if (getLogger().isLoggable(Level.FINE)) { - getLogger().log( - Level.FINE, - "startPaintable for {0}@{1}", + getLogger().log(Level.FINE, "startPaintable for {0}@{1}", new Object[] { connector.getClass().getName(), Integer.toHexString(connector.hashCode()) }); } @@ -689,9 +688,7 @@ public class JsonPaintTarget implements PaintTarget { @Override public void endPaintable(Component paintable) throws PaintException { if (getLogger().isLoggable(Level.FINE)) { - getLogger().log( - Level.FINE, - "endPaintable for {0}@{1}", + getLogger().log(Level.FINE, "endPaintable for {0}@{1}", new Object[] { paintable.getClass().getName(), Integer.toHexString(paintable.hashCode()) }); } @@ -710,7 +707,7 @@ public class JsonPaintTarget implements PaintTarget { /* * (non-Javadoc) - * + * * @see com.vaadin.terminal.PaintTarget#addCharacterData(java.lang.String ) */ @@ -724,9 +721,9 @@ public class JsonPaintTarget implements PaintTarget { /** * This is basically a container for UI components variables, that will be * added at the end of JSON object. - * + * * @author mattitahvonen - * + * */ class JsonTag implements Serializable { boolean firstField = false; @@ -797,7 +794,7 @@ public class JsonPaintTarget implements PaintTarget { } /** - * + * * @param s * json string, object or array */ @@ -823,7 +820,8 @@ public class JsonPaintTarget implements PaintTarget { final StringBuilder buf = new StringBuilder(); buf.append(startField()); buf.append("{"); - for (final Iterator iter = attr.iterator(); iter.hasNext();) { + for (final Iterator iter = attr.iterator(); iter + .hasNext();) { final String element = (String) iter.next(); buf.append(element); if (iter.hasNext()) { @@ -1010,8 +1008,8 @@ public class JsonPaintTarget implements PaintTarget { @Override public void addVariable(VariableOwner owner, String name, StreamVariable value) throws PaintException { - String url = manager.getStreamVariableTargetUrl( - (ClientConnector) owner, name, value); + String url = manager.getStreamVariableTargetUrl((ClientConnector) owner, + name, value); if (url != null) { addVariable(owner, name, url); } // else { //NOP this was just a cleanup by component } @@ -1020,7 +1018,7 @@ public class JsonPaintTarget implements PaintTarget { /* * (non-Javadoc) - * + * * @see com.vaadin.terminal.PaintTarget#isFullRepaint() */ diff --git a/server/src/main/java/com/vaadin/server/KeyMapper.java b/server/src/main/java/com/vaadin/server/KeyMapper.java index b858660b4b..9a2c776045 100644 --- a/server/src/main/java/com/vaadin/server/KeyMapper.java +++ b/server/src/main/java/com/vaadin/server/KeyMapper.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -22,7 +22,7 @@ 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 */ @@ -36,7 +36,7 @@ public class KeyMapper implements Serializable { /** * Gets key for an object. - * + * * @param o * the object. */ @@ -62,7 +62,7 @@ public class KeyMapper implements Serializable { /** * Retrieves object with the key. - * + * * @param key * the name with the desired value. * @return the object with the key. @@ -73,7 +73,7 @@ public class KeyMapper implements Serializable { /** * Removes object from the mapper. - * + * * @param removeobj * the object to be removed. */ @@ -96,9 +96,9 @@ public class KeyMapper implements Serializable { /** * Checks if the given key is mapped to an object. - * + * * @since 7.7 - * + * * @param key * the key to check * @return true if the key is currently mapped, diff --git a/server/src/main/java/com/vaadin/server/LegacyApplication.java b/server/src/main/java/com/vaadin/server/LegacyApplication.java index d03b3d7f96..c256699f06 100644 --- a/server/src/main/java/com/vaadin/server/LegacyApplication.java +++ b/server/src/main/java/com/vaadin/server/LegacyApplication.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -31,10 +31,10 @@ import com.vaadin.ui.UI; * to Vaadin 7. The legacy application supports setting a main window, adding * additional browser level windows and defining the theme for the entire * application. - * + * * @deprecated As of 7.0. This class is only intended to ease migration and * should not be used for new projects. - * + * * @since 7.0 */ @Deprecated @@ -56,7 +56,7 @@ public abstract class LegacyApplication implements ErrorHandler { /** * Sets the main window of this application. Setting window as a main window * of this application also adds the window to this application. - * + * * @param mainWindow * the UI to set as the default window */ @@ -87,7 +87,7 @@ public abstract class LegacyApplication implements ErrorHandler { /** * Gets the mainWindow of the application. - * + * *

        * The main window is the window attached to the application URL ( * {@link #getURL()}) and thus which is show by default to the user. @@ -95,7 +95,7 @@ public abstract class LegacyApplication implements ErrorHandler { *

        * Note that each application must have at least one main window. *

        - * + * * @return the UI used as the default window */ public LegacyWindow getMainWindow() { @@ -110,7 +110,7 @@ public abstract class LegacyApplication implements ErrorHandler { * null selects the default theme. For the available theme * names, see the contents of the VAADIN/themes directory. *

        - * + * * @param theme * the new theme for this application. */ @@ -123,7 +123,7 @@ public abstract class LegacyApplication implements ErrorHandler { * theme used by all the uIs for which a theme is not explicitly defined. If * the application theme is not explicitly set, null is * returned. - * + * * @return the name of the application's theme. */ public String getTheme() { @@ -135,7 +135,7 @@ public abstract class LegacyApplication implements ErrorHandler { * Gets a UI by name. Returns null if the application is not * running or it does not contain a window corresponding to the name. *

        - * + * * @param name * the name of the requested window * @return a UI corresponding to the name, or null to use the @@ -154,11 +154,11 @@ public abstract class LegacyApplication implements ErrorHandler { * Adds a new browser level window to this application. Please note that UI * doesn't have a name that is used in the URL - to add a named window you * should instead use {@link #addWindow(UI, String)} - * + * * @param uI * the UI window to add to the application * @return returns the name that has been assigned to the window - * + * * @see #addWindow(UI, String) */ public void addWindow(LegacyWindow uI) { @@ -177,12 +177,12 @@ public abstract class LegacyApplication implements ErrorHandler { * Removes the specified window from the application. This also removes all * name mappings for the window (see {@link #addWindow(UI, String) and * #getWindowName(UI)}. - * + * *

        * Note that removing window from the application does not close the browser * window - the window is only removed from the server-side. *

        - * + * * @param uI * the UI to remove */ @@ -196,11 +196,11 @@ public abstract class LegacyApplication implements ErrorHandler { /** * Gets the set of windows contained by the application. - * + * *

        * Note that the returned set of windows can not be modified. *

        - * + * * @return the unmodifiable collection of windows. */ public Collection getWindows() { @@ -250,7 +250,7 @@ public abstract class LegacyApplication implements ErrorHandler { * Desktop application just closes the application window and * web-application redirects the browser to application main URL. *

        - * + * * @return the URL. */ public String getLogoutURL() { @@ -263,7 +263,7 @@ public abstract class LegacyApplication implements ErrorHandler { * application running environment: Desktop application just closes the * application window and web-application redirects the browser to * application main URL. - * + * * @param logoutURL * the logoutURL to set. */ diff --git a/server/src/main/java/com/vaadin/server/LegacyApplicationUIProvider.java b/server/src/main/java/com/vaadin/server/LegacyApplicationUIProvider.java index 0977071806..02a6544d3f 100644 --- a/server/src/main/java/com/vaadin/server/LegacyApplicationUIProvider.java +++ b/server/src/main/java/com/vaadin/server/LegacyApplicationUIProvider.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,10 +25,10 @@ import com.vaadin.ui.LegacyWindow; import com.vaadin.ui.UI; /** - * + * * @author Vaadin Ltd * @since 7.0.0 - * + * * @deprecated As of 7.0. Used only to support LegacyApplication - will be * removed when LegacyApplication support is removed. */ @@ -100,7 +100,7 @@ public abstract class LegacyApplicationUIProvider extends UIProvider { /** * Hack used to return existing LegacyWindow instances without regard for * out-of-sync problems. - * + * * @param event * @return */ @@ -129,8 +129,8 @@ public abstract class LegacyApplicationUIProvider extends UIProvider { URL applicationUrl; try { - applicationUrl = VaadinService.getCurrent().getApplicationUrl( - VaadinService.getCurrentRequest()); + applicationUrl = VaadinService.getCurrent() + .getApplicationUrl(VaadinService.getCurrentRequest()); } catch (MalformedURLException e) { throw new RuntimeException(e); } diff --git a/server/src/main/java/com/vaadin/server/LegacyCommunicationManager.java b/server/src/main/java/com/vaadin/server/LegacyCommunicationManager.java index 87b484a65f..f8074c5449 100644 --- a/server/src/main/java/com/vaadin/server/LegacyCommunicationManager.java +++ b/server/src/main/java/com/vaadin/server/LegacyCommunicationManager.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -48,7 +48,7 @@ import elemental.json.JsonValue; * {@link com.vaadin.client.ApplicationConnection}. *

        * TODO Document better! - * + * * @deprecated As of 7.0. Will likely change or be removed in a future version */ @Deprecated @@ -71,7 +71,7 @@ public class LegacyCommunicationManager implements Serializable { /** * TODO New constructor - document me! - * + * * @param session */ public LegacyCommunicationManager(VaadinSession session) { @@ -133,7 +133,7 @@ public class LegacyCommunicationManager implements Serializable { * Resolves a dependency URI, registering the URI with this * {@code LegacyCommunicationManager} if needed and returns a fully * qualified URI. - * + * * @deprecated As of 7.1. See #11413. */ @Deprecated @@ -174,10 +174,9 @@ public class LegacyCommunicationManager implements Serializable { if (publishedFileContexts.containsKey(name)) { Class oldContext = publishedFileContexts.get(name); if (oldContext != context) { - getLogger() - .log(Level.WARNING, - "{0} published by both {1} and {2}. File from {2} will be used.", - new Object[] { name, context, oldContext }); + getLogger().log(Level.WARNING, + "{0} published by both {1} and {2}. File from {2} will be used.", + new Object[] { name, context, oldContext }); } } else { publishedFileContexts.put(name, context); @@ -205,16 +204,17 @@ public class LegacyCommunicationManager implements Serializable { * {@link #isComponentVisibleToClient(Component)} is used. For other types * of connectors, the contextual visibility of its first Component ancestor * is used. If no Component ancestor is found, the connector is not visible. - * + * * @deprecated As of 7.1. See #11411. - * + * * @param connector * The connector to check * @return true if the connector is visible to the client, * false otherwise */ @Deprecated - public static boolean isConnectorVisibleToClient(ClientConnector connector) { + public static boolean isConnectorVisibleToClient( + ClientConnector connector) { if (connector instanceof Component) { return isComponentVisibleToClient((Component) connector); } else { @@ -230,9 +230,9 @@ public class LegacyCommunicationManager implements Serializable { /** * Checks if the component should be visible to the client. Returns false if * the child should not be sent to the client, true otherwise. - * + * * @deprecated As of 7.1. See #11411. - * + * * @param child * The child to check * @return true if the child is visible to the client, false otherwise @@ -299,8 +299,8 @@ public class LegacyCommunicationManager implements Serializable { * @deprecated As of 7.1. Will be removed in the future. */ @Deprecated - public static class InvalidUIDLSecurityKeyException extends - GeneralSecurityException { + public static class InvalidUIDLSecurityKeyException + extends GeneralSecurityException { public InvalidUIDLSecurityKeyException(String message) { super(message); @@ -330,9 +330,9 @@ public class LegacyCommunicationManager implements Serializable { /** * Helper class for terminal to keep track of data that client is expected * to know. - * + * * TODO make customlayout templates (from theme) to be cached here. - * + * * @deprecated As of 7.1. See #11410. */ @Deprecated @@ -341,7 +341,7 @@ public class LegacyCommunicationManager implements Serializable { private final Set res = new HashSet(); /** - * + * * @param paintable * @return true if the given class was added to cache */ @@ -363,17 +363,17 @@ public class LegacyCommunicationManager implements Serializable { * @deprecated As of 7.1. See #11411. */ @Deprecated - public String getStreamVariableTargetUrl(ClientConnector owner, - String name, StreamVariable value) { + public String getStreamVariableTargetUrl(ClientConnector owner, String name, + StreamVariable value) { /* * We will use the same APP/* URI space as ApplicationResources but * prefix url with UPLOAD - * + * * eg. APP/UPLOAD/[UIID]/[PID]/[NAME]/[SECKEY] - * + * * SECKEY is created on each paint to make URL's unpredictable (to * prevent CSRF attacks). - * + * * NAME and PID from URI forms a key to fetch StreamVariable when * handling post */ @@ -394,9 +394,9 @@ public class LegacyCommunicationManager implements Serializable { /** * Handles an exception related to a connector by invoking the appropriate * error handler. - * + * * @deprecated As of 7.1. See #11411. - * + * * @param throwable * the exception to handle * @param connector @@ -413,10 +413,9 @@ public class LegacyCommunicationManager implements Serializable { /** * Requests that the given UI should be fully re-rendered on the client * side. - * - * @since 7.1 - * @deprecated. As of 7.1. Should be refactored once locales are fixed - * (#11378) + * + * @since 7.1 @deprecated. As of 7.1. Should be refactored once locales are + * fixed (#11378) */ @Deprecated public void repaintAll(UI ui) { diff --git a/server/src/main/java/com/vaadin/server/LegacyPaint.java b/server/src/main/java/com/vaadin/server/LegacyPaint.java index 91ff103db6..9aad82561b 100644 --- a/server/src/main/java/com/vaadin/server/LegacyPaint.java +++ b/server/src/main/java/com/vaadin/server/LegacyPaint.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -23,24 +23,24 @@ import com.vaadin.ui.LegacyComponent; 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. diff --git a/server/src/main/java/com/vaadin/server/LegacyVaadinPortlet.java b/server/src/main/java/com/vaadin/server/LegacyVaadinPortlet.java index 606809d893..6392e46f3d 100644 --- a/server/src/main/java/com/vaadin/server/LegacyVaadinPortlet.java +++ b/server/src/main/java/com/vaadin/server/LegacyVaadinPortlet.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/server/src/main/java/com/vaadin/server/LegacyVaadinServlet.java b/server/src/main/java/com/vaadin/server/LegacyVaadinServlet.java index 8ef16b50bc..4a6a7af866 100644 --- a/server/src/main/java/com/vaadin/server/LegacyVaadinServlet.java +++ b/server/src/main/java/com/vaadin/server/LegacyVaadinServlet.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/server/src/main/java/com/vaadin/server/LocaleService.java b/server/src/main/java/com/vaadin/server/LocaleService.java index ccdc49f690..6435a08cdd 100644 --- a/server/src/main/java/com/vaadin/server/LocaleService.java +++ b/server/src/main/java/com/vaadin/server/LocaleService.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -15,7 +15,7 @@ */ /** - * + * */ package com.vaadin.server; @@ -35,7 +35,7 @@ import com.vaadin.ui.UI; /** * Server side service which handles locale and the transmission of locale date * to the client side LocaleService. - * + * * @since 7.1 * @author Vaadin Ltd */ @@ -47,7 +47,7 @@ public class LocaleService implements Serializable { /** * Creates a LocaleService bound to the given UI - * + * * @since 7.1 * @param ui * The UI which owns the LocaleService @@ -59,7 +59,7 @@ public class LocaleService implements Serializable { /** * Retrieves the UI this service is bound to - * + * * @since 7.1 * @return the UI for this service */ @@ -73,7 +73,7 @@ public class LocaleService implements Serializable { * {@link Locale} instances and sent to the client when needed, eliminating * the need to use the {@link Locale} class and all the framework behind it * on the client. - * + * * @param locale * The locale which is required on the client side */ @@ -94,7 +94,7 @@ public class LocaleService implements Serializable { * The state is transmitted inside the UI state rather than as an individual * entity. *

        - * + * * @since 7.1 * @param markAsDirty * true to mark the state as dirty @@ -111,7 +111,7 @@ public class LocaleService implements Serializable { /** * Creates a LocaleData instance for transportation to the client - * + * * @since 7.1 * @param locale * The locale for which to create a LocaleData object @@ -159,12 +159,11 @@ public class LocaleService implements Serializable { * Date formatting (MM/DD/YYYY etc.) */ - DateFormat dateFormat = DateFormat.getDateTimeInstance( - DateFormat.SHORT, DateFormat.SHORT, locale); + DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.SHORT, + DateFormat.SHORT, locale); if (!(dateFormat instanceof SimpleDateFormat)) { - getLogger().warning( - "Unable to get default date pattern for locale " - + locale.toString()); + getLogger().warning("Unable to get default date pattern for locale " + + locale.toString()); dateFormat = new SimpleDateFormat(); } final String df = ((SimpleDateFormat) dateFormat).toPattern(); @@ -201,7 +200,7 @@ public class LocaleService implements Serializable { final String timeformat = df.substring(timeStart, df.length()); /* * Doesn't return second or milliseconds. - * + * * We use timeformat to determine 12/24-hour clock */ final boolean twelve_hour_clock = timeformat.indexOf("a") > -1; diff --git a/server/src/main/java/com/vaadin/server/NoInputStreamException.java b/server/src/main/java/com/vaadin/server/NoInputStreamException.java index 9f12c52fdf..8e35a66902 100644 --- a/server/src/main/java/com/vaadin/server/NoInputStreamException.java +++ b/server/src/main/java/com/vaadin/server/NoInputStreamException.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/server/src/main/java/com/vaadin/server/NoOutputStreamException.java b/server/src/main/java/com/vaadin/server/NoOutputStreamException.java index 8dce2194e8..66675b0a30 100644 --- a/server/src/main/java/com/vaadin/server/NoOutputStreamException.java +++ b/server/src/main/java/com/vaadin/server/NoOutputStreamException.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/server/src/main/java/com/vaadin/server/Page.java b/server/src/main/java/com/vaadin/server/Page.java index 74d79ade50..abb2ce19ef 100644 --- a/server/src/main/java/com/vaadin/server/Page.java +++ b/server/src/main/java/com/vaadin/server/Page.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -45,13 +45,13 @@ 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 */ @@ -68,7 +68,7 @@ public class Page implements Serializable { /** * Creates a new event - * + * * @param source * the uI for which the browser window has been resized * @param width @@ -89,7 +89,7 @@ public class Page implements Serializable { /** * Gets the new browser window height - * + * * @return an integer with the new pixel height of the browser window */ public int getHeight() { @@ -98,7 +98,7 @@ public class Page implements Serializable { /** * Gets the new browser window width - * + * * @return an integer with the new pixel width of the browser window */ public int getWidth() { @@ -140,7 +140,7 @@ public class Page implements Serializable { /** * Creates a new open resource. - * + * * @param url * The URL to open * @param name @@ -162,7 +162,7 @@ public class Page implements Serializable { /** * Creates a new open resource. - * + * * @param resource * The resource to open * @param name @@ -188,7 +188,7 @@ public class Page implements Serializable { /** * Paints the open request. Should be painted inside the window. - * + * * @param target * the paint target * @throws PaintException @@ -222,9 +222,9 @@ public class Page implements Serializable { } } - private static final Method BROWSER_RESIZE_METHOD = ReflectTools - .findMethod(BrowserWindowResizeListener.class, - "browserWindowResized", BrowserWindowResizeEvent.class); + private static final Method BROWSER_RESIZE_METHOD = ReflectTools.findMethod( + BrowserWindowResizeListener.class, "browserWindowResized", + BrowserWindowResizeEvent.class); /** * @deprecated As of 7.0, use {@link BorderStyle#NONE} instead. @@ -247,7 +247,7 @@ public class Page implements Serializable { /** * Listener that that gets notified when the URI fragment of the page * changes. - * + * * @see Page#addUriFragmentChangedListener(UriFragmentChangedListener) */ public interface UriFragmentChangedListener extends Serializable { @@ -256,9 +256,9 @@ public class Page implements Serializable { * changes. Please note that the initial URI fragment has already been * set when a new UI is initialized, so there will not be any initial * event for listeners added during {@link UI#init(VaadinRequest)}. - * + * * @see Page#addUriFragmentChangedListener(UriFragmentChangedListener) - * + * * @param event * the URI fragment changed event */ @@ -283,7 +283,7 @@ public class Page implements Serializable { /** * Event fired when the URI fragment of a Page changes. - * + * * @see Page#addUriFragmentChangedListener(UriFragmentChangedListener) */ public static class UriFragmentChangedEvent extends EventObject { @@ -295,7 +295,7 @@ public class Page implements Serializable { /** * Creates a new instance of UriFragmentReader change event. - * + * * @param source * the Source of the event. * @param uriFragment @@ -308,7 +308,7 @@ public class Page implements Serializable { /** * Gets the page in which the fragment has changed. - * + * * @return the page in which the fragment has changed */ public Page getPage() { @@ -317,7 +317,7 @@ public class Page implements Serializable { /** * Get the new URI fragment - * + * * @return the new fragment */ public String getUriFragment() { @@ -383,7 +383,7 @@ public class Page implements Serializable { /** * Contains dynamically injected styles injected in the HTML document at * runtime. - * + * * @since 7.1 */ public static class Styles implements Serializable { @@ -400,7 +400,7 @@ public class Page implements Serializable { /** * Injects a raw CSS string into the page. - * + * * @param css * The CSS to inject */ @@ -416,7 +416,7 @@ public class Page implements Serializable { /** * Injects a CSS resource into the page - * + * * @param resource * The resource to inject. */ @@ -491,7 +491,8 @@ public class Page implements Serializable { eventRouter.addListener(eventType, target, method); } - private void removeListener(Class eventType, Object target, Method method) { + private void removeListener(Class eventType, Object target, + Method method) { if (hasEventRouter()) { eventRouter.removeListener(eventType, target, method); } @@ -502,11 +503,11 @@ public class Page implements Serializable { * page is changed. Please note that the initial URI fragment has already * been set when a new UI is initialized, so there will not be any initial * event for listeners added during {@link UI#init(VaadinRequest)}. - * + * * @see #getUriFragment() * @see #setUriFragment(String) * @see #removeUriFragmentChangedListener(UriFragmentChangedListener) - * + * * @param listener * the URI fragment listener to add */ @@ -527,10 +528,10 @@ public class Page implements Serializable { /** * Removes a URI fragment listener that was previously added to this page. - * + * * @param listener * the URI fragment listener to remove - * + * * @see Page#addUriFragmentChangedListener(UriFragmentChangedListener) */ public void removeUriFragmentChangedListener( @@ -560,17 +561,17 @@ public class Page implements Serializable { * is already a non-null fragment will leave a trailing # in the URI since * removing it would cause the browser to reload the page. This is not fully * consistent with the semantics of {@link java.net.URI}. - * + * * @param newUriFragment * The new fragment. * @param fireEvents * true to fire event - * + * * @see #getUriFragment() * @see #setLocation(URI) * @see UriFragmentChangedEvent * @see Page.UriFragmentChangedListener - * + * */ public void setUriFragment(String newUriFragment, boolean fireEvents) { String oldUriFragment = location.getFragment(); @@ -579,9 +580,8 @@ public class Page implements Serializable { // instead set it to the empty string newUriFragment = ""; } - if (newUriFragment == oldUriFragment - || (newUriFragment != null && newUriFragment - .equals(oldUriFragment))) { + if (newUriFragment == oldUriFragment || (newUriFragment != null + && newUriFragment.equals(oldUriFragment))) { return; } try { @@ -606,7 +606,7 @@ public class Page implements Serializable { /** * Sets URI fragment. This method fires a {@link UriFragmentChangedEvent} - * + * * @param newUriFragment * id of the new fragment * @see UriFragmentChangedEvent @@ -624,9 +624,9 @@ public class Page implements Serializable { *

        * To listen to changes in fragment, hook a * {@link Page.UriFragmentChangedListener}. - * + * * @return the current fragment in browser location URI. - * + * * @see #getLocation() * @see #setUriFragment(String) * @see #addUriFragmentChangedListener(UriFragmentChangedListener) @@ -671,9 +671,9 @@ public class Page implements Serializable { /** * Gets the window.name value of the browser window of this page. - * + * * @since 7.2 - * + * * @return the window name, null if the name is not known */ public String getWindowName() { @@ -700,9 +700,9 @@ public class Page implements Serializable { /** * For internal use only. Updates the internal state with the given values. * Does not resize the Page or browser window. - * + * * @since 7.2 - * + * * @param width * the new browser window width * @param height @@ -742,10 +742,10 @@ public class Page implements Serializable { * received while a resize is being performed. Use * {@link UI#setResizeLazy(boolean)}. *

        - * + * * @param resizeListener * the listener to add - * + * * @see BrowserWindowResizeListener#browserWindowResized(BrowserWindowResizeEvent) * @see UI#setResizeLazy(boolean) */ @@ -768,7 +768,7 @@ public class Page implements Serializable { /** * 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 */ @@ -792,7 +792,7 @@ public class Page implements Serializable { /** * Gets the last known height of the browser window in which this UI * resides. - * + * * @return the browser window height in pixels */ public int getBrowserWindowHeight() { @@ -801,7 +801,7 @@ public class Page implements Serializable { /** * Gets the last known width of the browser window in which this uI resides. - * + * * @return the browser window width in pixels */ public int getBrowserWindowWidth() { @@ -820,7 +820,7 @@ public class Page implements Serializable { /** * Returns that stylesheet associated with this Page. The stylesheet * contains additional styles injected at runtime into the HTML document. - * + * * @since 7.1 */ public Styles getStyles() { @@ -858,8 +858,7 @@ public class Page implements Serializable { n.getDescription()); } if (n.getIcon() != null) { - target.addAttribute( - UIConstants.ATTRIBUTE_NOTIFICATION_ICON, + target.addAttribute(UIConstants.ATTRIBUTE_NOTIFICATION_ICON, n.getIcon()); } if (!n.isHtmlContentAllowed()) { @@ -867,9 +866,8 @@ public class Page implements Serializable { UIConstants.NOTIFICATION_HTML_CONTENT_NOT_ALLOWED, true); } - target.addAttribute( - UIConstants.ATTRIBUTE_NOTIFICATION_POSITION, n - .getPosition().ordinal()); + target.addAttribute(UIConstants.ATTRIBUTE_NOTIFICATION_POSITION, + n.getPosition().ordinal()); target.addAttribute(UIConstants.ATTRIBUTE_NOTIFICATION_DELAY, n.getDelayMsec()); if (n.getStyleName() != null) { @@ -900,16 +898,16 @@ public class Page implements Serializable { * This method should not be used to start downloads, as the client side * will assume the browser will navigate away when opening the URI. Use one * of the {@code Page.open} methods or {@code FileDownloader} instead. - * + * * @see #open(String, String) * @see FileDownloader - * + * * @param uri * the URI to show */ public void setLocation(String uri) { - openList.add(new OpenResource(uri, "_self", -1, -1, BORDER_DEFAULT, - false)); + openList.add( + new OpenResource(uri, "_self", -1, -1, BORDER_DEFAULT, false)); uI.markAsDirty(); } @@ -920,10 +918,10 @@ public class Page implements Serializable { * This method should not be used to start downloads, as the client side * will assume the browser will navigate away when opening the URI. Use one * of the {@code Page.open} methods or {@code FileDownloader} instead. - * + * * @see #open(String, String) * @see FileDownloader - * + * * @param uri * the URI to show */ @@ -935,12 +933,12 @@ public class Page implements Serializable { * Returns the location URI of this page, as reported by the browser. Note * that this may not be consistent with the server URI the application is * deployed in due to potential proxies, redirections and similar. - * + * * @return The browser location URI. */ public URI getLocation() { - if (location == null - && !uI.getSession().getConfiguration().isSendUrlsAsParameters()) { + if (location == null && !uI.getSession().getConfiguration() + .isSendUrlsAsParameters()) { throw new IllegalStateException("Location is not available as the " + Constants.SERVLET_PARAMETER_SENDURLSASPARAMETERS + " parameter is configured as false"); @@ -951,10 +949,10 @@ public class Page implements Serializable { /** * For internal use only. Used to update the server-side location when the * client-side location changes. - * + * * @deprecated As of 7.2, use {@link #updateLocation(String, boolean)} * instead. - * + * * @param location * the new location URI */ @@ -966,9 +964,9 @@ public class Page implements Serializable { /** * For internal use only. Used to update the server-side location when the * client-side location changes. - * + * * @since 7.2 - * + * * @param location * the new location URI * @param fireEvents @@ -1030,7 +1028,7 @@ public class Page implements Serializable { * forgiving when the window is opened directly from a client-side click * event. *

        - * + * * @param url * the URL to open. * @param windowName @@ -1081,7 +1079,7 @@ public class Page implements Serializable { * forgiving when the window is opened directly from a client-side click * event. *

        - * + * * @param url * the URL to open. * @param windowName @@ -1108,7 +1106,7 @@ public class Page implements Serializable { * forgiving when the window is opened directly from a client-side click * event. *

        - * + * * @param url * the URL to open. * @param windowName @@ -1122,8 +1120,8 @@ public class Page implements Serializable { */ public void open(String url, String windowName, int width, int height, BorderStyle border) { - openList.add(new OpenResource(url, windowName, width, height, border, - true)); + openList.add( + new OpenResource(url, windowName, width, height, border, true)); uI.markAsDirty(); } @@ -1157,7 +1155,7 @@ public class Page implements Serializable { /** * Internal helper method to actually add a notification. - * + * * @param notification * the notification to add */ @@ -1171,12 +1169,12 @@ public class Page implements Serializable { /** * Shows a notification message. - * + * * @see Notification - * + * * @param notification * The notification message to show - * + * * @deprecated As of 7.0, use Notification.show(Page) instead. */ @Deprecated @@ -1188,9 +1186,9 @@ public class Page implements Serializable { * 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 */ @@ -1208,7 +1206,7 @@ public class Page implements Serializable { *

        * If the title is set to null, it will not left as-is. Set to empty string * to clear the title. - * + * * @param title * the page title to set */ @@ -1234,7 +1232,7 @@ public class Page implements Serializable { * outside of Page should not access it directly but only through public * APIs provided by Page. *

        - * + * * @since 7.1 * @param markAsDirty * true to mark the state as dirty diff --git a/server/src/main/java/com/vaadin/server/PaintException.java b/server/src/main/java/com/vaadin/server/PaintException.java index a7025598b2..5fb0e06779 100644 --- a/server/src/main/java/com/vaadin/server/PaintException.java +++ b/server/src/main/java/com/vaadin/server/PaintException.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,7 +21,7 @@ import java.io.Serializable; /** * PaintExcepection is thrown if painting of a component fails. - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -31,7 +31,7 @@ public class PaintException extends IOException implements Serializable { /** * Constructs an instance of PaintExeception with the specified * detail message. - * + * * @param msg * the detail message. */ @@ -42,7 +42,7 @@ public class PaintException extends IOException implements Serializable { /** * Constructs an instance of PaintExeception with the specified * detail message and cause. - * + * * @param msg * the detail message. * @param cause @@ -54,7 +54,7 @@ public class PaintException extends IOException implements Serializable { /** * Constructs an instance of PaintExeception from IOException. - * + * * @param exception * the original exception. */ diff --git a/server/src/main/java/com/vaadin/server/PaintTarget.java b/server/src/main/java/com/vaadin/server/PaintTarget.java index 902cb13816..b0acefda65 100644 --- a/server/src/main/java/com/vaadin/server/PaintTarget.java +++ b/server/src/main/java/com/vaadin/server/PaintTarget.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -24,7 +24,7 @@ import com.vaadin.ui.Component; /** * This interface defines the methods for painting XML to the UIDL stream. - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -32,10 +32,10 @@ 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 @@ -49,7 +49,7 @@ public interface PaintTarget extends Serializable { /** * Result of starting to paint a Component ( * {@link PaintTarget#startPaintable(Component, String)}). - * + * * @since 7.0 */ public enum PaintStatus { @@ -85,7 +85,7 @@ public interface PaintTarget extends Serializable { * {@link #endPaintable(Component)} regardless of the {@link PaintStatus} * returned. *

        - * + * * @param paintable * the paintable to start. * @param tag @@ -103,11 +103,11 @@ public interface PaintTarget extends Serializable { /** * 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 @@ -118,12 +118,12 @@ public interface PaintTarget extends Serializable { /** * Prints element start tag. - * + * *
              * Todo:
              * Checking of input values
              * 
        - * + * * @param tagName * the name of the start tag. * @throws PaintException @@ -133,10 +133,10 @@ public interface PaintTarget extends Serializable { /** * 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 @@ -147,12 +147,12 @@ public interface PaintTarget extends Serializable { /** * 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. */ @@ -161,12 +161,12 @@ public interface PaintTarget extends Serializable { /** * 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. */ @@ -175,12 +175,12 @@ public interface PaintTarget extends Serializable { /** * 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. */ @@ -206,7 +206,7 @@ public interface PaintTarget extends Serializable { * 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 @@ -214,7 +214,7 @@ public interface PaintTarget extends Serializable { * an identifying name for the StreamVariable * @param value * the StreamVariable to paint - * + * * @throws PaintException * if the paint operation failed. */ @@ -224,12 +224,12 @@ public interface PaintTarget extends Serializable { /** * 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. */ @@ -238,12 +238,12 @@ public interface PaintTarget extends Serializable { /** * 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. */ @@ -252,12 +252,12 @@ public interface PaintTarget extends Serializable { /** * 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. */ @@ -266,12 +266,12 @@ public interface PaintTarget extends Serializable { /** * 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. */ @@ -279,7 +279,7 @@ public interface PaintTarget extends Serializable { /** * TODO - * + * * @param name * @param value * @throws PaintException @@ -291,7 +291,7 @@ public interface PaintTarget extends Serializable { * 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 @@ -303,14 +303,14 @@ public interface PaintTarget extends Serializable { /** * 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. */ @@ -319,14 +319,14 @@ public interface PaintTarget extends Serializable { /** * 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. */ @@ -335,14 +335,14 @@ public interface PaintTarget extends Serializable { /** * 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. */ @@ -351,14 +351,14 @@ public interface PaintTarget extends Serializable { /** * 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. */ @@ -367,14 +367,14 @@ public interface PaintTarget extends Serializable { /** * 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. */ @@ -383,14 +383,14 @@ public interface PaintTarget extends Serializable { /** * 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. */ @@ -399,14 +399,14 @@ public interface PaintTarget extends Serializable { /** * 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. */ @@ -419,14 +419,14 @@ public interface PaintTarget extends Serializable { * 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 */ @@ -435,12 +435,12 @@ public interface PaintTarget extends Serializable { /** * 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. */ @@ -453,7 +453,7 @@ public interface PaintTarget extends Serializable { * 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 @@ -469,7 +469,7 @@ public interface PaintTarget extends Serializable { /** * Adds UIDL directly. The UIDL must be valid in accordance with the * UIDL.dtd - * + * * @param uidl * the UIDL to be added. * @throws PaintException @@ -479,7 +479,7 @@ public interface PaintTarget extends Serializable { /** * Adds text node. All the contents of the text are XML-escaped. - * + * * @param text * the Text to add * @throws PaintException @@ -489,7 +489,7 @@ public interface PaintTarget extends Serializable { /** * Adds CDATA node to target UIDL-tree. - * + * * @param text * the Character data to add * @throws PaintException diff --git a/server/src/main/java/com/vaadin/server/RequestHandler.java b/server/src/main/java/com/vaadin/server/RequestHandler.java index b667ed038c..64f9cf6aa1 100644 --- a/server/src/main/java/com/vaadin/server/RequestHandler.java +++ b/server/src/main/java/com/vaadin/server/RequestHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -40,7 +40,7 @@ public interface RequestHandler extends Serializable { * {@link VaadinSession#accessSynchronously(Runnable)} or * {@link UI#accessSynchronously(Runnable)}. *

        - * + * * @param session * The session for the request * @param request diff --git a/server/src/main/java/com/vaadin/server/Resource.java b/server/src/main/java/com/vaadin/server/Resource.java index 20e0bb7f9a..6e54fab8ed 100644 --- a/server/src/main/java/com/vaadin/server/Resource.java +++ b/server/src/main/java/com/vaadin/server/Resource.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,7 +21,7 @@ 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 */ @@ -29,7 +29,7 @@ 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/main/java/com/vaadin/server/ResourceReference.java b/server/src/main/java/com/vaadin/server/ResourceReference.java index aeb06394b7..014301adf0 100644 --- a/server/src/main/java/com/vaadin/server/ResourceReference.java +++ b/server/src/main/java/com/vaadin/server/ResourceReference.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -87,8 +87,8 @@ public class ResourceReference extends URLReference { String uri = ApplicationConstants.APP_PROTOCOL_PREFIX + ApplicationConstants.APP_PATH + '/' + ConnectorResource.CONNECTOR_PATH + '/' - + connector.getUI().getUIId() + '/' - + connector.getConnectorId() + '/' + encodeFileName(filename); + + connector.getUI().getUIId() + '/' + connector.getConnectorId() + + '/' + encodeFileName(filename); return uri; } diff --git a/server/src/main/java/com/vaadin/server/Responsive.java b/server/src/main/java/com/vaadin/server/Responsive.java index 9209f14ff9..f44b8e4926 100644 --- a/server/src/main/java/com/vaadin/server/Responsive.java +++ b/server/src/main/java/com/vaadin/server/Responsive.java @@ -4,9 +4,9 @@ * Licensed under the Apache 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 @@ -40,22 +40,22 @@ import com.vaadin.ui.Component; * Page.getCurrent().getStyles().add(...)) or any other style * updates after the initial page load are not supported at the moment. *

        - * - * + * + * *

        * Example: - * + * * Java - * + * *

          * CssLayout layout = new CssLayout();
          * layout.setStyleName("responsive");
          * layout.setSizeFull();
          * Responsive.makeResponsive(layout);
          * 
        - * + * * SCSS - * + * *
          * .v-csslayout.responsive {
          *   &[width-range~="0-300px"] {
        @@ -78,9 +78,9 @@ import com.vaadin.ui.Component;
          *   }
          * }
          * 
        - * + * * CSS - * + * *
          * .v-csslayout.responsive[width-range~="0-300px"] {
          *    // Styles for the layout when its width is between 0 and 300 pixels
        @@ -91,7 +91,7 @@ import com.vaadin.ui.Component;
          * .v-csslayout.responsive[width-range~="501-"] {
          *    // Styles for the layout when its width is over 500 pixels
          * }
        - * 
        + *
          * .v-csslayout.responsive[height-range~="0-300px"] {
          *    // Styles for the layout when its height is between 0 and 300 pixels
          * }
        @@ -102,7 +102,7 @@ import com.vaadin.ui.Component;
          *    // Styles for the layout when its height is over 500 pixels
          * }
          * 
        - * + * *

        *

        * Note: The defined ranges are applied on a global context, so even @@ -114,24 +114,24 @@ import com.vaadin.ui.Component; * though the CSS implies it would only affect CssLayout instances inside a * parent with a style name "foobar": *

        - * + * *
          * .foobar .v-csslayout[width-range~="0px-100px"] {
          *    // These properties will affect all responsive CssLayout instances
          * }
          * 
        - * + * *

        * To scope the ranges, use an additional style name for the target component, * and add that to your CSS selector: *

        - * + * *
          *  .v-csslayout.mystyle[width-range="0px-100px"] {
          *    // These properties will only affect responsive CssLayout instances with an additional style name of 'mystyle'
          * }
          * 
        - * + * * @author Vaadin Ltd * @since 7.2 */ @@ -146,7 +146,7 @@ public class Responsive extends AbstractExtension { /** * Enable responsive width and height range styling for the target component * or UI instance. - * + * * @param target * The component which should be able to respond to width and/or * height changes. diff --git a/server/src/main/java/com/vaadin/server/RestrictedRenderResponse.java b/server/src/main/java/com/vaadin/server/RestrictedRenderResponse.java index 5bee476cff..e4092f8383 100644 --- a/server/src/main/java/com/vaadin/server/RestrictedRenderResponse.java +++ b/server/src/main/java/com/vaadin/server/RestrictedRenderResponse.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -34,7 +34,7 @@ import org.w3c.dom.Element; /** * Read-only wrapper for a {@link RenderResponse}. - * + * * Only for use by {@link PortletApplicationContext} and * {@link VaadinPortletSession}. */ @@ -149,7 +149,8 @@ class RestrictedRenderResponse implements RenderResponse, Serializable { } @Override - public void setNextPossiblePortletModes(Collection portletModes) { + public void setNextPossiblePortletModes( + Collection portletModes) { // NOP // TODO throw? } diff --git a/server/src/main/java/com/vaadin/server/Scrollable.java b/server/src/main/java/com/vaadin/server/Scrollable.java index ae6828e339..36be9cac01 100644 --- a/server/src/main/java/com/vaadin/server/Scrollable.java +++ b/server/src/main/java/com/vaadin/server/Scrollable.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -23,7 +23,7 @@ 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 */ @@ -31,24 +31,24 @@ 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. */ @@ -56,24 +56,24 @@ public interface Scrollable extends Serializable { /** * 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. @@ -81,7 +81,7 @@ public interface Scrollable extends Serializable { * scrolling to bottom only scrolls to the bottom of the previous content * area. *

        - * + * * @param scrollTop * the yOffset. */ diff --git a/server/src/main/java/com/vaadin/server/ServerRpcManager.java b/server/src/main/java/com/vaadin/server/ServerRpcManager.java index ae99622a4a..ce09dd2ec2 100644 --- a/server/src/main/java/com/vaadin/server/ServerRpcManager.java +++ b/server/src/main/java/com/vaadin/server/ServerRpcManager.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -29,11 +29,11 @@ import com.vaadin.shared.communication.ServerRpc; /** * Server side RPC manager that handles RPC calls coming from the client. - * + * * Each {@link RpcTarget} (typically a {@link ClientConnector}) should have its * own instance of {@link ServerRpcManager} if it wants to receive RPC calls * from the client. - * + * * @since 7.0 */ public class ServerRpcManager implements Serializable { @@ -44,10 +44,10 @@ public class ServerRpcManager implements Serializable { /** * Wrapper exception for exceptions which occur during invocation of an RPC * call - * + * * @author Vaadin Ltd * @since 7.0 - * + * */ public static class RpcInvocationException extends Exception { @@ -87,7 +87,7 @@ public class ServerRpcManager implements Serializable { /** * Create a RPC manager for an RPC target. - * + * * @param target * RPC call target (normally a {@link Connector}) * @param implementation @@ -103,7 +103,7 @@ public class ServerRpcManager implements Serializable { /** * Invoke a method in a server side RPC target class. This method is to be * used by the RPC framework and unit testing tools only. - * + * * @param target * non-null target of the RPC call * @param invocation @@ -111,23 +111,23 @@ public class ServerRpcManager implements Serializable { * @throws RpcInvocationException */ public static void applyInvocation(ClientConnector target, - ServerRpcMethodInvocation invocation) throws RpcInvocationException { - ServerRpcManager manager = target.getRpcManager(invocation - .getInterfaceName()); + ServerRpcMethodInvocation invocation) + throws RpcInvocationException { + ServerRpcManager manager = target + .getRpcManager(invocation.getInterfaceName()); if (manager != null) { manager.applyInvocation(invocation); } else { - getLogger() - .log(Level.WARNING, - "RPC call received for RpcTarget {0} ({1}) but the target has not registered any RPC interfaces", - new Object[] { target.getClass().getName(), - invocation.getConnectorId() }); + getLogger().log(Level.WARNING, + "RPC call received for RpcTarget {0} ({1}) but the target has not registered any RPC interfaces", + new Object[] { target.getClass().getName(), + invocation.getConnectorId() }); } } /** * Returns the RPC interface implementation for the RPC target. - * + * * @return RPC interface implementation */ protected T getImplementation() { @@ -136,7 +136,7 @@ public class ServerRpcManager implements Serializable { /** * Returns the RPC interface type managed by this RPC manager instance. - * + * * @return RPC interface type */ public Class getRpcInterface() { @@ -146,7 +146,7 @@ public class ServerRpcManager implements Serializable { /** * Invoke a method in a server side RPC target class. This method is to be * used by the RPC framework and unit testing tools only. - * + * * @param invocation * method invocation to perform */ @@ -157,9 +157,10 @@ public class ServerRpcManager implements Serializable { try { method.invoke(implementation, arguments); } catch (Exception e) { - throw new RpcInvocationException("Unable to invoke method " - + invocation.getMethodName() + " in " - + invocation.getInterfaceName(), e); + throw new RpcInvocationException( + "Unable to invoke method " + invocation.getMethodName() + + " in " + invocation.getInterfaceName(), + e); } } diff --git a/server/src/main/java/com/vaadin/server/ServerRpcMethodInvocation.java b/server/src/main/java/com/vaadin/server/ServerRpcMethodInvocation.java index d3f8531406..7dc669e1cf 100644 --- a/server/src/main/java/com/vaadin/server/ServerRpcMethodInvocation.java +++ b/server/src/main/java/com/vaadin/server/ServerRpcMethodInvocation.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -55,7 +55,7 @@ public class ServerRpcMethodInvocation extends MethodInvocation { * Tries to find the method from the cache or alternatively by invoking * {@link #doFindInvocationMethod(Class, String, int)} and updating the * cache. - * + * * @param targetType * @param methodName * @param parameterCount @@ -90,7 +90,7 @@ public class ServerRpcMethodInvocation extends MethodInvocation { /** * Tries to find the method from the class by looping through available * methods. - * + * * @param targetType * @param methodName * @param parameterCount diff --git a/server/src/main/java/com/vaadin/server/ServiceDestroyEvent.java b/server/src/main/java/com/vaadin/server/ServiceDestroyEvent.java index 2ed0bbf8f1..6f3d790b82 100644 --- a/server/src/main/java/com/vaadin/server/ServiceDestroyEvent.java +++ b/server/src/main/java/com/vaadin/server/ServiceDestroyEvent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,7 +21,7 @@ import java.util.EventObject; /** * Event fired to {@link ServiceDestroyListener} when a {@link VaadinService} is * being destroyed. - * + * * @since 7.2 * @author Vaadin Ltd */ @@ -29,7 +29,7 @@ public class ServiceDestroyEvent extends EventObject { /** * Creates a new event for the given service. - * + * * @param service * the service being destroyed */ @@ -39,7 +39,7 @@ public class ServiceDestroyEvent extends EventObject { /* * (non-Javadoc) - * + * * @see java.util.EventObject#getSource() */ @Override diff --git a/server/src/main/java/com/vaadin/server/ServiceDestroyListener.java b/server/src/main/java/com/vaadin/server/ServiceDestroyListener.java index 1549d82d51..54b9a607d5 100644 --- a/server/src/main/java/com/vaadin/server/ServiceDestroyListener.java +++ b/server/src/main/java/com/vaadin/server/ServiceDestroyListener.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,17 +21,17 @@ import java.io.Serializable; /** * Listener that gets notified when the {@link VaadinService} to which it has * been registered is destroyed. - * + * * @see VaadinService#addServiceDestroyListener(ServiceDestroyListener) * @see VaadinService#removeServiceDestroyListener(ServiceDestroyListener) - * + * * @since 7.2 * @author Vaadin Ltd */ public interface ServiceDestroyListener extends Serializable { /** * Invoked when a service is destroyed - * + * * @param event * the event */ diff --git a/server/src/main/java/com/vaadin/server/ServiceException.java b/server/src/main/java/com/vaadin/server/ServiceException.java index 2bc36bc1d7..dffa4ac024 100644 --- a/server/src/main/java/com/vaadin/server/ServiceException.java +++ b/server/src/main/java/com/vaadin/server/ServiceException.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/server/src/main/java/com/vaadin/server/ServletPortletHelper.java b/server/src/main/java/com/vaadin/server/ServletPortletHelper.java index 33ecf16e17..7431ec6360 100644 --- a/server/src/main/java/com/vaadin/server/ServletPortletHelper.java +++ b/server/src/main/java/com/vaadin/server/ServletPortletHelper.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -26,7 +26,7 @@ import com.vaadin.ui.UI; /** * Contains helper methods shared by {@link VaadinServlet} and * {@link VaadinPortlet}. - * + * * @deprecated As of 7.1. Will be removed or refactored in the future. */ @Deprecated @@ -50,37 +50,39 @@ public class ServletPortletHelper implements Serializable { } try { - return classLoader.loadClass(applicationParameter).asSubclass( - LegacyApplication.class); + return classLoader.loadClass(applicationParameter) + .asSubclass(LegacyApplication.class); } catch (final ClassNotFoundException e) { - throw new ServiceException("Failed to load application class: " - + applicationParameter, e); + throw new ServiceException( + "Failed to load application class: " + applicationParameter, + e); } } private static void verifyUIClass(String className, ClassLoader classLoader) throws ServiceException { if (className == null) { - throw new ServiceException(VaadinSession.UI_PARAMETER - + " init parameter not defined"); + throw new ServiceException( + VaadinSession.UI_PARAMETER + " init parameter not defined"); } // Check that the UI layout class can be found try { Class uiClass = classLoader.loadClass(className); if (!UI.class.isAssignableFrom(uiClass)) { - throw new ServiceException(className + " does not implement UI"); + throw new ServiceException( + className + " does not implement UI"); } // Try finding a default constructor, else throw exception uiClass.getConstructor(); } catch (ClassNotFoundException e) { throw new ServiceException(className + " could not be loaded", e); } catch (SecurityException e) { - throw new ServiceException("Could not access " + className - + " class", e); + throw new ServiceException( + "Could not access " + className + " class", e); } catch (NoSuchMethodException e) { - throw new ServiceException(className - + " doesn't have a public no-args constructor"); + throw new ServiceException( + className + " doesn't have a public no-args constructor"); } } @@ -125,8 +127,8 @@ public class ServletPortletHelper implements Serializable { } public static boolean isPublishedFileRequest(VaadinRequest request) { - return hasPathPrefix(request, ApplicationConstants.PUBLISHED_FILE_PATH - + "/"); + return hasPathPrefix(request, + ApplicationConstants.PUBLISHED_FILE_PATH + "/"); } public static boolean isUIDLRequest(VaadinRequest request) { @@ -138,7 +140,8 @@ public class ServletPortletHelper implements Serializable { } public static boolean isHeartbeatRequest(VaadinRequest request) { - return hasPathPrefix(request, ApplicationConstants.HEARTBEAT_PATH + '/'); + return hasPathPrefix(request, + ApplicationConstants.HEARTBEAT_PATH + '/'); } public static boolean isPushRequest(VaadinRequest request) { @@ -175,17 +178,19 @@ public class ServletPortletHelper implements Serializable { .asSubclass(UIProvider.class); return subclass.newInstance(); } catch (ClassNotFoundException e) { - throw new ServiceException("Could not load UIProvider class " - + uiProviderProperty, e); + throw new ServiceException( + "Could not load UIProvider class " + uiProviderProperty, e); } catch (ClassCastException e) { throw new ServiceException("UIProvider class " + uiProviderProperty + " does not extend UIProvider", e); } catch (InstantiationException e) { - throw new ServiceException("Could not instantiate UIProvider " - + uiProviderProperty, e); + throw new ServiceException( + "Could not instantiate UIProvider " + uiProviderProperty, + e); } catch (IllegalAccessException e) { - throw new ServiceException("Could not instantiate UIProvider " - + uiProviderProperty, e); + throw new ServiceException( + "Could not instantiate UIProvider " + uiProviderProperty, + e); } } @@ -194,7 +199,8 @@ public class ServletPortletHelper implements Serializable { if (session.getUIProviders().isEmpty()) { throw new ServiceException( "No UIProvider has been added and there is no \"" - + VaadinSession.UI_PARAMETER + "\" init parameter."); + + VaadinSession.UI_PARAMETER + + "\" init parameter."); } } diff --git a/server/src/main/java/com/vaadin/server/SessionDestroyEvent.java b/server/src/main/java/com/vaadin/server/SessionDestroyEvent.java index a64fce0b64..ced5729177 100644 --- a/server/src/main/java/com/vaadin/server/SessionDestroyEvent.java +++ b/server/src/main/java/com/vaadin/server/SessionDestroyEvent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,9 +20,9 @@ import java.util.EventObject; /** * Event fired when a Vaadin service session is no longer in use. - * + * * @see SessionDestroyListener#sessionDestroy(SessionDestroyEvent) - * + * * @author Vaadin Ltd * @since 7.0.0 */ @@ -32,7 +32,7 @@ public class SessionDestroyEvent extends EventObject { /** * Creates a new event. - * + * * @param service * the Vaadin service from which the even originates * @param session @@ -50,7 +50,7 @@ public class SessionDestroyEvent extends EventObject { /** * Gets the Vaadin service from which the even originates. - * + * * @return the Vaadin service */ public VaadinService getService() { @@ -59,7 +59,7 @@ public class SessionDestroyEvent extends EventObject { /** * Gets the Vaadin service session that is no longer used. - * + * * @return the Vaadin service session */ public VaadinSession getSession() { diff --git a/server/src/main/java/com/vaadin/server/SessionDestroyListener.java b/server/src/main/java/com/vaadin/server/SessionDestroyListener.java index 29daa60a40..7c6ce1b354 100644 --- a/server/src/main/java/com/vaadin/server/SessionDestroyListener.java +++ b/server/src/main/java/com/vaadin/server/SessionDestroyListener.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,16 +21,16 @@ import java.io.Serializable; /** * A listener that gets notified when a Vaadin service session is no longer * used. - * + * * @see VaadinService#addSessionDestroyListener(SessionDestroyListener) - * + * * @author Vaadin Ltd * @since 7.0.0 */ public interface SessionDestroyListener extends Serializable { /** * Called when a Vaadin service session is no longer used. - * + * * @param event * the event with details about the destroyed session */ diff --git a/server/src/main/java/com/vaadin/server/SessionExpiredException.java b/server/src/main/java/com/vaadin/server/SessionExpiredException.java index d70498e7cb..d0e8fb04dc 100644 --- a/server/src/main/java/com/vaadin/server/SessionExpiredException.java +++ b/server/src/main/java/com/vaadin/server/SessionExpiredException.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/server/src/main/java/com/vaadin/server/SessionExpiredHandler.java b/server/src/main/java/com/vaadin/server/SessionExpiredHandler.java index 3d6de95dea..5bb6d58764 100644 --- a/server/src/main/java/com/vaadin/server/SessionExpiredHandler.java +++ b/server/src/main/java/com/vaadin/server/SessionExpiredHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,7 +20,7 @@ import java.io.IOException; /** * A specialized RequestHandler which is capable of sending session expiration * messages to the user. - * + * * @since 7.1 * @author Vaadin Ltd */ @@ -31,7 +31,7 @@ public interface SessionExpiredHandler extends RequestHandler { * to be sent to the user. If a response is written, this method should * return true to indicate that no more * {@link SessionExpiredHandler} handlers should be invoked for the request. - * + * * @param request * The request to handle * @param response diff --git a/server/src/main/java/com/vaadin/server/SessionInitEvent.java b/server/src/main/java/com/vaadin/server/SessionInitEvent.java index 76262c6140..1ab9fe6083 100644 --- a/server/src/main/java/com/vaadin/server/SessionInitEvent.java +++ b/server/src/main/java/com/vaadin/server/SessionInitEvent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -26,9 +26,9 @@ import java.util.EventObject; * event is not necessarily fired immediately when the session is created but * only when the first request for that session is handled by a specific * service. - * + * * @see SessionInitListener#sessionInit(SessionInitEvent) - * + * * @author Vaadin Ltd * @since 7.0.0 */ @@ -39,7 +39,7 @@ public class SessionInitEvent extends EventObject { /** * Creates a new event. - * + * * @param service * the Vaadin service from which the event originates * @param session @@ -61,7 +61,7 @@ public class SessionInitEvent extends EventObject { /** * Gets the Vaadin service from which this event originates - * + * * @return the Vaadin service instance */ public VaadinService getService() { @@ -70,7 +70,7 @@ public class SessionInitEvent extends EventObject { /** * Gets the Vaadin service session that has been initialized. - * + * * @return the Vaadin service session */ public VaadinSession getSession() { @@ -79,7 +79,7 @@ public class SessionInitEvent extends EventObject { /** * Gets the request that triggered the initialization. - * + * * @return the request */ public VaadinRequest getRequest() { diff --git a/server/src/main/java/com/vaadin/server/SessionInitListener.java b/server/src/main/java/com/vaadin/server/SessionInitListener.java index 2bbb8e3d1f..3434df3ce2 100644 --- a/server/src/main/java/com/vaadin/server/SessionInitListener.java +++ b/server/src/main/java/com/vaadin/server/SessionInitListener.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -26,9 +26,9 @@ import java.io.Serializable; * listener is not necessarily notified immediately when the session is created * but only when the first request for that session is handled by a specific * service. - * + * * @see VaadinService#addSessionInitListener(SessionInitListener) - * + * * @author Vaadin Ltd * @since 7.0.0 */ @@ -41,7 +41,7 @@ public interface SessionInitListener extends Serializable { * the listener is not necessarily notified immediately when the session is * created but only when the first request for that session is handled by a * specific service. - * + * * @param event * the initialization event * @throws ServiceException diff --git a/server/src/main/java/com/vaadin/server/SizeWithUnit.java b/server/src/main/java/com/vaadin/server/SizeWithUnit.java index 4c3c51eaec..ddd584b607 100644 --- a/server/src/main/java/com/vaadin/server/SizeWithUnit.java +++ b/server/src/main/java/com/vaadin/server/SizeWithUnit.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,7 +25,7 @@ import com.vaadin.shared.util.SharedUtil; /** * A class for representing a value-unit pair. Also contains utility methods for * parsing such pairs from a string. - * + * * @since 7.4 * @author Vaadin Ltd */ @@ -37,7 +37,7 @@ public class SizeWithUnit implements Serializable { /** * Constructs a new SizeWithUnit object representing the pair (size, unit). - * + * * @param size * a numeric value * @param unit @@ -50,7 +50,7 @@ public class SizeWithUnit implements Serializable { /** * Returns the numeric value stored in this object. - * + * * @return the value of this (value, unit) pair */ public float getSize() { @@ -59,7 +59,7 @@ public class SizeWithUnit implements Serializable { /** * Returns the unit stored in this object. - * + * * @return the unit of this (value, unit) pair */ public Unit getUnit() { @@ -72,7 +72,7 @@ public class SizeWithUnit implements Serializable { * is used as the unit. If defaultUnit is null and s is a nonempty string * representing a unitless number, an exception is thrown. Null or empty * string will produce {-1,Unit#PIXELS}. - * + * * @param s * the string to be parsed * @param defaultUnit @@ -116,7 +116,7 @@ public class SizeWithUnit implements Serializable { * Returns an object whose numeric value and unit are taken from the string * s. Null or empty string will produce {-1,Unit#PIXELS}. An exception is * thrown if s specifies a number without a unit. - * + * * @param s * the string to be parsed * @return an object containing the parsed value and unit diff --git a/server/src/main/java/com/vaadin/server/Sizeable.java b/server/src/main/java/com/vaadin/server/Sizeable.java index ede5e6ab3b..dfdbc6d9d4 100644 --- a/server/src/main/java/com/vaadin/server/Sizeable.java +++ b/server/src/main/java/com/vaadin/server/Sizeable.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,7 +21,7 @@ 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 */ @@ -163,7 +163,7 @@ public interface Sizeable extends Serializable { /** * 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(); @@ -171,38 +171,38 @@ public interface Sizeable extends Serializable { /** * 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 + * + * See + * CSS * specification for more details. - * + * * @param height * in CSS style string representation */ @@ -211,7 +211,7 @@ public interface Sizeable extends Serializable { /** * 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 @@ -222,7 +222,7 @@ public interface Sizeable extends Serializable { /** * 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 @@ -232,17 +232,17 @@ public interface Sizeable extends Serializable { /** * 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 + * + * See + * CSS * specification for more details. - * + * * @param width * in CSS style string representation, null or empty string to * reset @@ -261,14 +261,14 @@ public interface Sizeable extends Serializable { /** * Clears any defined width - * + * * @since 7.3 */ public void setWidthUndefined(); /** * Clears any defined height - * + * * @since 7.3 */ public void setHeightUndefined(); diff --git a/server/src/main/java/com/vaadin/server/StreamResource.java b/server/src/main/java/com/vaadin/server/StreamResource.java index 070cfb5138..25d5436529 100644 --- a/server/src/main/java/com/vaadin/server/StreamResource.java +++ b/server/src/main/java/com/vaadin/server/StreamResource.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -26,7 +26,7 @@ import com.vaadin.util.FileTypeResolver; /** * StreamResource is a resource provided to the client directly by * the application. - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -60,7 +60,7 @@ public class StreamResource implements ConnectorResource { /** * Creates a new stream resource for downloading from stream. - * + * * @param streamSource * the source Stream. * @param filename @@ -84,7 +84,7 @@ public class StreamResource implements ConnectorResource { /** * Sets the mime type of the resource. - * + * * @param MIMEType * the MIME type to be set. */ @@ -95,7 +95,7 @@ public class StreamResource implements ConnectorResource { /** * 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() { @@ -106,7 +106,7 @@ public class StreamResource implements ConnectorResource { * 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. */ @@ -116,7 +116,7 @@ public class StreamResource implements ConnectorResource { /** * Gets the filename. - * + * * @return the filename. */ @Override @@ -126,7 +126,7 @@ public class StreamResource implements ConnectorResource { /** * Sets the filename. - * + * * @param filename * the filename to set. */ @@ -149,7 +149,7 @@ public class StreamResource implements ConnectorResource { /** * Interface implemented by the source of a StreamResource. - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -163,12 +163,12 @@ public class StreamResource implements ConnectorResource { /** * 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 the size of the buffer in bytes. */ public int getBufferSize() { @@ -177,7 +177,7 @@ public class StreamResource implements ConnectorResource { /** * Sets the size of the download buffer used for this resource. - * + * * @param bufferSize * the size of the buffer in bytes. */ @@ -190,7 +190,7 @@ public class StreamResource implements ConnectorResource { * 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. */ public long getCacheTime() { @@ -199,17 +199,17 @@ public class StreamResource implements ConnectorResource { /** * 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/main/java/com/vaadin/server/StreamVariable.java b/server/src/main/java/com/vaadin/server/StreamVariable.java index c7b84c92d6..08a405b741 100644 --- a/server/src/main/java/com/vaadin/server/StreamVariable.java +++ b/server/src/main/java/com/vaadin/server/StreamVariable.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -33,7 +33,7 @@ import com.vaadin.server.StreamVariable.StreamingStartEvent; * 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) @@ -45,7 +45,7 @@ public interface StreamVariable extends Serializable { * {@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(); @@ -59,7 +59,7 @@ public interface StreamVariable extends Serializable { * 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) @@ -91,7 +91,7 @@ public interface StreamVariable extends Serializable { * 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(); diff --git a/server/src/main/java/com/vaadin/server/SynchronizedRequestHandler.java b/server/src/main/java/com/vaadin/server/SynchronizedRequestHandler.java index 56abfbb8f3..cb93eb9535 100644 --- a/server/src/main/java/com/vaadin/server/SynchronizedRequestHandler.java +++ b/server/src/main/java/com/vaadin/server/SynchronizedRequestHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -22,7 +22,7 @@ import java.io.IOException; * automatically. The session is locked before * {@link #synchronizedHandleRequest(VaadinSession, VaadinRequest, VaadinResponse)} * is called and unlocked after it has completed. - * + * * @author Vaadin Ltd * @version @VERSION@ * @since 7.1 @@ -49,7 +49,7 @@ public abstract class SynchronizedRequestHandler implements RequestHandler { * {@link #handleRequest(VaadinSession, VaadinRequest, VaadinResponse)} * except the {@link VaadinSession} is locked before this is called and * unlocked after this has completed. - * + * * @see #handleRequest(VaadinSession, VaadinRequest, VaadinResponse) * @param session * The session for the request @@ -59,7 +59,7 @@ public abstract class SynchronizedRequestHandler implements RequestHandler { * 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 * If an IO error occurred */ @@ -74,7 +74,7 @@ public abstract class SynchronizedRequestHandler implements RequestHandler { * calling * {@link #synchronizedHandleRequest(VaadinSession, VaadinRequest, VaadinResponse)} * with the session locked. - * + * * @since 7.2 * @param request * the request to handle diff --git a/server/src/main/java/com/vaadin/server/SystemError.java b/server/src/main/java/com/vaadin/server/SystemError.java index 834055e1e1..b792320f15 100644 --- a/server/src/main/java/com/vaadin/server/SystemError.java +++ b/server/src/main/java/com/vaadin/server/SystemError.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,11 +20,11 @@ package com.vaadin.server; * 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 */ @@ -33,7 +33,7 @@ public class SystemError extends AbstractErrorMessage { /** * Constructor for SystemError with error message specified. - * + * * @param message * the Textual error description. */ @@ -46,7 +46,7 @@ public class SystemError extends AbstractErrorMessage { /** * Constructor for SystemError with causing exception and error message. - * + * * @param message * the Textual error description. * @param cause @@ -59,7 +59,7 @@ public class SystemError extends AbstractErrorMessage { /** * Constructor for SystemError with cause. - * + * * @param cause * the throwable causing the system error. */ @@ -69,7 +69,7 @@ public class SystemError extends AbstractErrorMessage { /** * Returns the message of the error in HTML. - * + * * Note that this API may change in future versions. */ protected String getHtmlMessage() { diff --git a/server/src/main/java/com/vaadin/server/SystemMessageException.java b/server/src/main/java/com/vaadin/server/SystemMessageException.java index 854d8001f6..f7d90d69e3 100644 --- a/server/src/main/java/com/vaadin/server/SystemMessageException.java +++ b/server/src/main/java/com/vaadin/server/SystemMessageException.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -26,7 +26,7 @@ public class SystemMessageException extends RuntimeException { /** * Constructs a new SystemMessageException with the specified * detail message. - * + * * @param msg * the detail message. */ @@ -37,7 +37,7 @@ public class SystemMessageException extends RuntimeException { /** * Constructs a new SystemMessageException with the specified * detail message and cause. - * + * * @param msg * the detail message. * @param cause @@ -50,7 +50,7 @@ public class SystemMessageException extends RuntimeException { /** * Constructs a new SystemMessageException from another * exception. - * + * * @param cause * the cause of the exception. */ diff --git a/server/src/main/java/com/vaadin/server/SystemMessages.java b/server/src/main/java/com/vaadin/server/SystemMessages.java index 3bcf0a90fa..ee9254a583 100644 --- a/server/src/main/java/com/vaadin/server/SystemMessages.java +++ b/server/src/main/java/com/vaadin/server/SystemMessages.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -31,13 +31,13 @@ import java.io.Serializable; *

      • sessionExpiredURL = null
      • *
      • sessionExpiredNotificationEnabled = true
      • *
      • sessionExpiredCaption = ""
      • - *
      • sessionExpiredMessage = - * "Take note of any unsaved data, and click here to continue."
      • + *
      • sessionExpiredMessage = "Take note of any unsaved data, and + * click here to continue."
      • *
      • communicationErrorURL = null
      • *
      • communicationErrorNotificationEnabled = true
      • *
      • communicationErrorCaption = "Communication problem"
      • - *
      • communicationErrorMessage = - * "Take note of any unsaved data, and click here to continue."
      • + *
      • communicationErrorMessage = "Take note of any unsaved data, and + * click here to continue."
      • *
      • internalErrorURL = null
      • *
      • internalErrorNotificationEnabled = true
      • *
      • internalErrorCaption = "Internal error"
      • @@ -48,10 +48,11 @@ import java.io.Serializable; *
      • cookiesDisabledCaption = "Cookies disabled"
      • *
      • cookiesDisabledMessage = "This application requires cookies to * function.
        - * Please enable cookies in your browser and click here to try again.
      • + * Please enable cookies in your browser and click here to try + * again. * *

        - * + * */ public class SystemMessages implements Serializable { protected String sessionExpiredURL = null; @@ -110,8 +111,8 @@ public class SystemMessages implements Serializable { } /** - * @return - * "Take note of any unsaved data, and click here to continue." + * @return "Take note of any unsaved data, and click here to + * continue." */ public String getSessionExpiredMessage() { return (sessionExpiredNotificationEnabled ? sessionExpiredMessage @@ -136,17 +137,17 @@ public class SystemMessages implements Serializable { * @return "Communication problem" */ public String getCommunicationErrorCaption() { - return (communicationErrorNotificationEnabled ? communicationErrorCaption - : null); + return (communicationErrorNotificationEnabled + ? communicationErrorCaption : null); } /** - * @return - * "Take note of any unsaved data, and click here to continue." + * @return "Take note of any unsaved data, and click here to + * continue." */ public String getCommunicationErrorMessage() { - return (communicationErrorNotificationEnabled ? communicationErrorMessage - : null); + return (communicationErrorNotificationEnabled + ? communicationErrorMessage : null); } /** @@ -168,17 +169,17 @@ public class SystemMessages implements Serializable { * @return "Authentication problem" */ public String getAuthenticationErrorCaption() { - return (authenticationErrorNotificationEnabled ? authenticationErrorCaption - : null); + return (authenticationErrorNotificationEnabled + ? authenticationErrorCaption : null); } /** - * @return - * "Take note of any unsaved data, and click here to continue." + * @return "Take note of any unsaved data, and click here to + * continue." */ public String getAuthenticationErrorMessage() { - return (authenticationErrorNotificationEnabled ? authenticationErrorMessage - : null); + return (authenticationErrorNotificationEnabled + ? authenticationErrorMessage : null); } /** @@ -215,7 +216,7 @@ public class SystemMessages implements Serializable { /** * Returns the URL the user should be redirected to after dismissing the * "you have to enable your cookies" message. Typically null. - * + * * @return A URL the user should be redirected to after dismissing the * message or null to reload the current URL. */ @@ -227,7 +228,7 @@ public class SystemMessages implements Serializable { * Determines if "cookies disabled" messages should be shown to the end user * or not. If the notification is disabled the user will be immediately * redirected to the URL returned by {@link #getCookiesDisabledURL()}. - * + * * @return true to show "cookies disabled" messages to the end user, false * to redirect to the given URL directly */ @@ -238,7 +239,7 @@ public class SystemMessages implements Serializable { /** * Returns the caption of the message shown to the user when cookies are * disabled in the browser. - * + * * @return The caption of the "cookies disabled" message */ public String getCookiesDisabledCaption() { @@ -249,7 +250,7 @@ public class SystemMessages implements Serializable { /** * Returns the message shown to the user when cookies are disabled in the * browser. - * + * * @return The "cookies disabled" message */ public String getCookiesDisabledMessage() { diff --git a/server/src/main/java/com/vaadin/server/SystemMessagesInfo.java b/server/src/main/java/com/vaadin/server/SystemMessagesInfo.java index 195cf3c711..5b410b5486 100644 --- a/server/src/main/java/com/vaadin/server/SystemMessagesInfo.java +++ b/server/src/main/java/com/vaadin/server/SystemMessagesInfo.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -26,7 +26,7 @@ public class SystemMessagesInfo implements Serializable { /** * The locale of the UI related to the {@link SystemMessages} request. - * + * * @return The Locale or null if the locale is not known */ public Locale getLocale() { @@ -39,7 +39,7 @@ public class SystemMessagesInfo implements Serializable { /** * Gets the request currently in progress. - * + * * @return The request currently in progress or null if no request is in * progress. */ @@ -53,7 +53,7 @@ public class SystemMessagesInfo implements Serializable { /** * Returns the service this SystemMessages request comes from. - * + * * @return The service which triggered this request or null of not triggered * from a service. */ diff --git a/server/src/main/java/com/vaadin/server/SystemMessagesProvider.java b/server/src/main/java/com/vaadin/server/SystemMessagesProvider.java index a69cc0b159..fda3090350 100644 --- a/server/src/main/java/com/vaadin/server/SystemMessagesProvider.java +++ b/server/src/main/java/com/vaadin/server/SystemMessagesProvider.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -23,7 +23,7 @@ import com.vaadin.ui.UI; /** * Gives out system messages based on Locale. Registered using * {@link VaadinService#setSystemMessagesProvider(SystemMessagesProvider)}. - * + * * @author Vaadin Ltd * @since 7.0.0 */ @@ -34,7 +34,7 @@ public interface SystemMessagesProvider extends Serializable { * most cases some or both of {@link VaadinSession#getCurrent()} and * {@link UI#getCurrent()} can also be used to find more information to help * the decision. - * + * * @param systemMessagesInfo * Locale, current request and other information available. * @return a system messages object diff --git a/server/src/main/java/com/vaadin/server/ThemeResource.java b/server/src/main/java/com/vaadin/server/ThemeResource.java index 45a2736bf3..889e5365d6 100644 --- a/server/src/main/java/com/vaadin/server/ThemeResource.java +++ b/server/src/main/java/com/vaadin/server/ThemeResource.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -23,7 +23,7 @@ import com.vaadin.util.FileTypeResolver; * 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 */ @@ -37,7 +37,7 @@ public class ThemeResource implements Resource { /** * Creates a resource. - * + * * @param resourceId * the Id of the resource. */ @@ -58,7 +58,7 @@ public class ThemeResource implements Resource { /** * 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, @@ -89,7 +89,7 @@ public class ThemeResource implements Resource { /** * Gets the resource id. - * + * * @return the resource id. */ public String getResourceId() { diff --git a/server/src/main/java/com/vaadin/server/UIClassSelectionEvent.java b/server/src/main/java/com/vaadin/server/UIClassSelectionEvent.java index 9c9bbe5bc9..013e4037f4 100644 --- a/server/src/main/java/com/vaadin/server/UIClassSelectionEvent.java +++ b/server/src/main/java/com/vaadin/server/UIClassSelectionEvent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,7 +20,7 @@ package com.vaadin.server; * Contains information used by * {@link UIProvider#getUIClass(UIClassSelectionEvent)} to choose a UI class to * use in a specific situation. - * + * * @author Vaadin Ltd * @since 7.0.0 */ @@ -28,7 +28,7 @@ public class UIClassSelectionEvent extends UIProviderEvent { /** * Creates a new event for a specific request. - * + * * @param request * the Vaadin request for which a UI class is wanted. */ diff --git a/server/src/main/java/com/vaadin/server/UICreateEvent.java b/server/src/main/java/com/vaadin/server/UICreateEvent.java index 1688416ba5..f7819c5d9f 100644 --- a/server/src/main/java/com/vaadin/server/UICreateEvent.java +++ b/server/src/main/java/com/vaadin/server/UICreateEvent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,7 +21,7 @@ import com.vaadin.ui.UI; /** * Contains data used by various methods in {@link UIProvider} for determining * information about a new UI that is about to be created. - * + * * @author Vaadin Ltd * @since 7.0.0 */ @@ -33,7 +33,7 @@ public class UICreateEvent extends UIProviderEvent { /** * Creates a new UI create event for a given VaadinRequest and UI class but * without a UI id. - * + * * @param request * the request for which the UI will be created * @param uiClass @@ -46,7 +46,7 @@ public class UICreateEvent extends UIProviderEvent { /** * Creates a new UI create event for a given VaadinRequest, UI class and UI * id - * + * * @param request * the request for which the UI will be created * @param uiClass @@ -64,7 +64,7 @@ public class UICreateEvent extends UIProviderEvent { /** * Gets the UI class that will be created. - * + * * @return the UI class */ public Class getUIClass() { @@ -77,7 +77,7 @@ public class UICreateEvent extends UIProviderEvent { *

        * The UI id is generally only available in * {@link UIProvider#createInstance(UICreateEvent)} - * + * * @return the UI id; or null if the UI id is not yet known. */ public Integer getUiId() { diff --git a/server/src/main/java/com/vaadin/server/UIProvider.java b/server/src/main/java/com/vaadin/server/UIProvider.java index 6cff6f9be2..d16507234d 100644 --- a/server/src/main/java/com/vaadin/server/UIProvider.java +++ b/server/src/main/java/com/vaadin/server/UIProvider.java @@ -195,8 +195,8 @@ public abstract class UIProvider implements Serializable { // Fourth case: we have an AppWidgetset.gwt.xml file else { - InputStream resource = event.getUIClass().getResourceAsStream( - "/" + APP_WIDGETSET_NAME + ".gwt.xml"); + InputStream resource = event.getUIClass() + .getResourceAsStream("/" + APP_WIDGETSET_NAME + ".gwt.xml"); if (resource != null) { return new WidgetsetInfoImpl(false, null, APP_WIDGETSET_NAME); } @@ -231,15 +231,14 @@ public abstract class UIProvider implements Serializable { try { return cls.newInstance(); } catch (InstantiationException e) { - getLogger().log( - Level.INFO, + getLogger().log(Level.INFO, "Unexpected trying to instantiate class " - + cls.getName(), e); + + cls.getName(), + e); } catch (IllegalAccessException e) { - getLogger() - .log(Level.INFO, - "Unexpected trying to access class " - + cls.getName(), e); + getLogger().log(Level.INFO, + "Unexpected trying to access class " + cls.getName(), + e); } } return null; diff --git a/server/src/main/java/com/vaadin/server/UIProviderEvent.java b/server/src/main/java/com/vaadin/server/UIProviderEvent.java index 1fcc0a3ddc..5eee93808e 100644 --- a/server/src/main/java/com/vaadin/server/UIProviderEvent.java +++ b/server/src/main/java/com/vaadin/server/UIProviderEvent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,9 +21,9 @@ import java.util.EventObject; /** * Base class for the events that are sent to various methods in UIProvider. - * + * * @see UIProvider - * + * * @author Vaadin Ltd * @since 7.0.0 */ @@ -33,7 +33,7 @@ public class UIProviderEvent extends EventObject implements Serializable { /** * Creates a new UI provider event. - * + * * @param request * the request for which the event is UI provider is invoked */ @@ -44,7 +44,7 @@ public class UIProviderEvent extends EventObject implements Serializable { /** * Gets the Vaadin service from which the event originates. - * + * * @return the Vaadin service */ public VaadinService getService() { @@ -53,7 +53,7 @@ public class UIProviderEvent extends EventObject implements Serializable { /** * Gets the request associated with this event. - * + * * @return the Vaadin request */ public VaadinRequest getRequest() { diff --git a/server/src/main/java/com/vaadin/server/UnsupportedBrowserHandler.java b/server/src/main/java/com/vaadin/server/UnsupportedBrowserHandler.java index e5ea55b116..42a7d29efd 100644 --- a/server/src/main/java/com/vaadin/server/UnsupportedBrowserHandler.java +++ b/server/src/main/java/com/vaadin/server/UnsupportedBrowserHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,7 +21,7 @@ import java.io.Writer; /** * A {@link RequestHandler} that presents an informative page if the browser in * use is unsupported. Recognizes Chrome Frame and allow it to be used. - * + * *

        * This handler is usually added to the application by * {@link LegacyCommunicationManager}. @@ -54,7 +54,7 @@ public class UnsupportedBrowserHandler extends SynchronizedRequestHandler { /** * Writes a page encouraging the user to upgrade to a more current browser. - * + * * @param request * @param response * @throws IOException @@ -64,29 +64,30 @@ public class UnsupportedBrowserHandler extends SynchronizedRequestHandler { Writer page = response.getWriter(); WebBrowser b = VaadinSession.getCurrent().getBrowser(); - page.write("

        I'm sorry, but your browser is not supported

        " - + "

        The version (" - + b.getBrowserMajorVersion() - + "." - + b.getBrowserMinorVersion() - + ") of the browser you are using " - + " is outdated and not supported.

        " - + "

        You should consider upgrading to a more up-to-date browser.

        " - + "

        The most popular browsers are " - + " Chrome," - + " Firefox," - + (b.isWindows() ? " Internet Explorer," - : "") - + " Opera" - + " and Safari.
        " - + "Upgrading to the latest version of one of these will make the web safer, faster and better looking.

        " - + (b.isIE() ? "" - + "

        If you can not upgrade your browser, please consider trying Chrome Frame.

        " - : "") // - + "

        Continue without updating (not recommended)

        " - + "\n" + ""); + page.write( + "

        I'm sorry, but your browser is not supported

        " + + "

        The version (" + b.getBrowserMajorVersion() + "." + + b.getBrowserMinorVersion() + + ") of the browser you are using " + + " is outdated and not supported.

        " + + "

        You should consider upgrading to a more up-to-date browser.

        " + + "

        The most popular browsers are " + + " Chrome," + + " Firefox," + + (b.isWindows() + ? " Internet Explorer," + : "") + + " Opera" + + " and Safari.
        " + + "Upgrading to the latest version of one of these will make the web safer, faster and better looking.

        " + + (b.isIE() + ? "" + + "

        If you can not upgrade your browser, please consider trying Chrome Frame.

        " + : "") // + + "

        Continue without updating (not recommended)

        " + + "\n" + ""); page.close(); } diff --git a/server/src/main/java/com/vaadin/server/UploadException.java b/server/src/main/java/com/vaadin/server/UploadException.java index 1f1073b435..ad4027ca1a 100644 --- a/server/src/main/java/com/vaadin/server/UploadException.java +++ b/server/src/main/java/com/vaadin/server/UploadException.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/server/src/main/java/com/vaadin/server/UserError.java b/server/src/main/java/com/vaadin/server/UserError.java index ec1ac042f8..6ffc04d0d7 100644 --- a/server/src/main/java/com/vaadin/server/UserError.java +++ b/server/src/main/java/com/vaadin/server/UserError.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -19,7 +19,7 @@ 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 */ @@ -46,7 +46,7 @@ public class UserError extends AbstractErrorMessage { /** * Creates a textual error message of level ERROR. - * + * * @param textErrorMessage * the text of the error message. */ @@ -56,7 +56,7 @@ public class UserError extends AbstractErrorMessage { /** * Creates an error message with level and content mode. - * + * * @param message * the error message. * @param contentMode diff --git a/server/src/main/java/com/vaadin/server/VaadinPortlet.java b/server/src/main/java/com/vaadin/server/VaadinPortlet.java index 5c91b6669c..1072313f56 100644 --- a/server/src/main/java/com/vaadin/server/VaadinPortlet.java +++ b/server/src/main/java/com/vaadin/server/VaadinPortlet.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -52,22 +52,22 @@ import com.vaadin.util.CurrentInstance; /** * Portlet 2.0 base class. This replaces the servlet in servlet/portlet 1.0 * deployments and handles various portlet requests from the browser. - * + * * @author Vaadin Ltd */ -public class VaadinPortlet extends GenericPortlet implements Constants, - Serializable { +public class VaadinPortlet extends GenericPortlet + implements Constants, Serializable { /** * Base class for portlet requests that need access to HTTP servlet * requests. */ - public static abstract class VaadinHttpAndPortletRequest extends - VaadinPortletRequest { + public static abstract class VaadinHttpAndPortletRequest + extends VaadinPortletRequest { /** * Constructs a new {@link VaadinHttpAndPortletRequest}. - * + * * @since 7.2 * @param request * {@link PortletRequest} to be wrapped @@ -83,7 +83,7 @@ public class VaadinPortlet extends GenericPortlet implements Constants, /** * Returns the original HTTP servlet request for this portlet request. - * + * * @since 7.2 * @param request * {@link PortletRequest} used to @@ -178,8 +178,8 @@ public class VaadinPortlet extends GenericPortlet implements Constants, /** * Portlet request for Liferay. */ - public static class VaadinLiferayRequest extends - VaadinHttpAndPortletRequest { + public static class VaadinLiferayRequest + extends VaadinHttpAndPortletRequest { /** * The PortalUtil class to use. Set to either * {@link #LIFERAY_6_PORTAL_UTIL} or {@link #LIFERAY_7_PORTAL_UTIL} the @@ -203,15 +203,15 @@ public class VaadinPortlet extends GenericPortlet implements Constants, * Simplified version of what Liferay PortalClassInvoker did. This is * used because the API of PortalClassInvoker has changed in Liferay * 6.2. - * + * * This simply uses reflection with Liferay class loader. Parameters are * Strings to avoid static dependencies and to load all classes with * Liferay's own class loader. Only static utility methods are * supported. - * + * * This method is for internal use only and may change in future * versions. - * + * * @param className * name of the Liferay class to call * @param methodName @@ -288,7 +288,8 @@ public class VaadinPortlet extends GenericPortlet implements Constants, /** * Portlet request for GateIn. */ - public static class VaadinGateInRequest extends VaadinHttpAndPortletRequest { + public static class VaadinGateInRequest + extends VaadinHttpAndPortletRequest { public VaadinGateInRequest(PortletRequest request, VaadinPortletService vaadinService) { super(request, vaadinService); @@ -297,8 +298,8 @@ public class VaadinPortlet extends GenericPortlet implements Constants, @Override protected HttpServletRequest getServletRequest(PortletRequest request) { try { - Method getRealReq = request.getClass().getMethod( - "getRealRequest"); + Method getRealReq = request.getClass() + .getMethod("getRealRequest"); HttpServletRequestWrapper origRequest = (HttpServletRequestWrapper) getRealReq .invoke(request); return origRequest; @@ -312,8 +313,8 @@ public class VaadinPortlet extends GenericPortlet implements Constants, /** * Portlet request for WebSphere Portal. */ - public static class VaadinWebSpherePortalRequest extends - VaadinHttpAndPortletRequest { + public static class VaadinWebSpherePortalRequest + extends VaadinHttpAndPortletRequest { public VaadinWebSpherePortalRequest(PortletRequest request, VaadinPortletService vaadinService) { @@ -323,8 +324,8 @@ public class VaadinPortlet extends GenericPortlet implements Constants, @Override protected HttpServletRequest getServletRequest(PortletRequest request) { try { - Class portletUtils = Class - .forName("com.ibm.ws.portletcontainer.portlet.PortletUtils"); + Class portletUtils = Class.forName( + "com.ibm.ws.portletcontainer.portlet.PortletUtils"); Method getHttpServletRequest = portletUtils.getMethod( "getHttpServletRequest", PortletRequest.class); @@ -340,8 +341,8 @@ public class VaadinPortlet extends GenericPortlet implements Constants, /** * Portlet request for WebSphere Portal. */ - public static class VaadinWebLogicPortalRequest extends - VaadinHttpAndPortletRequest { + public static class VaadinWebLogicPortalRequest + extends VaadinHttpAndPortletRequest { private static boolean warningLogged = false; private static Method servletRequestMethod = null; @@ -355,8 +356,8 @@ public class VaadinPortlet extends GenericPortlet implements Constants, protected HttpServletRequest getServletRequest(PortletRequest request) { try { if (servletRequestMethod == null) { - Class portletRequestClass = Class - .forName("com.bea.portlet.container.PortletRequestImpl"); + Class portletRequestClass = Class.forName( + "com.bea.portlet.container.PortletRequestImpl"); servletRequestMethod = portletRequestClass .getDeclaredMethod("getInternalRequest", new Class[] {}); @@ -368,10 +369,9 @@ public class VaadinPortlet extends GenericPortlet implements Constants, } catch (Exception e) { if (!warningLogged) { warningLogged = true; - getLogger() - .log(Level.WARNING, - "Could not determine underlying servlet request for WebLogic Portal portlet request", - e); + getLogger().log(Level.WARNING, + "Could not determine underlying servlet request for WebLogic Portal portlet request", + e); } return null; } @@ -388,7 +388,7 @@ public class VaadinPortlet extends GenericPortlet implements Constants, /** * This portlet parameter is used to add styles to the main element. E.g * "height:500px" generates a style="height:500px" to the main element. - * + * * @deprecated As of 7.0. Will likely change or be removed in a future * version */ @@ -398,7 +398,7 @@ public class VaadinPortlet extends GenericPortlet implements Constants, /** * This portal parameter is used to define the name of the Vaadin theme that * is used for all Vaadin applications in the portal. - * + * * @deprecated As of 7.0. Will likely change or be removed in a future * version */ @@ -440,11 +440,13 @@ public class VaadinPortlet extends GenericPortlet implements Constants, initParameters.setProperty(name, config.getInitParameter(name)); } - DeploymentConfiguration deploymentConfiguration = createDeploymentConfiguration(initParameters); + DeploymentConfiguration deploymentConfiguration = createDeploymentConfiguration( + initParameters); try { vaadinService = createPortletService(deploymentConfiguration); } catch (ServiceException e) { - throw new PortletException("Could not initialized VaadinPortlet", e); + throw new PortletException("Could not initialized VaadinPortlet", + e); } // Sets current service even though there are no request and response vaadinService.setCurrentInstances(null, null); @@ -474,7 +476,7 @@ public class VaadinPortlet extends GenericPortlet implements Constants, /** * @author Vaadin Ltd - * + * * @deprecated As of 7.0. This is no longer used and only provided for * backwards compatibility. Each {@link RequestHandler} can * individually decide whether it wants to handle a request or @@ -488,7 +490,7 @@ public class VaadinPortlet extends GenericPortlet implements Constants, /** * @param vaadinRequest * @return - * + * * @deprecated As of 7.0. This is no longer used and only provided for * backwards compatibility. Each {@link RequestHandler} can * individually decide whether it wants to handle a request or @@ -504,7 +506,8 @@ public class VaadinPortlet extends GenericPortlet implements Constants, return RequestType.UIDL; } else if (PortletUIInitHandler.isUIInitRequest(vaadinRequest)) { return RequestType.BROWSER_DETAILS; - } else if (ServletPortletHelper.isFileUploadRequest(vaadinRequest)) { + } else if (ServletPortletHelper + .isFileUploadRequest(vaadinRequest)) { return RequestType.FILE_UPLOAD; } else if (ServletPortletHelper .isPublishedFileRequest(vaadinRequest)) { @@ -513,7 +516,8 @@ public class VaadinPortlet extends GenericPortlet implements Constants, return RequestType.APP; } else if (ServletPortletHelper.isHeartbeatRequest(vaadinRequest)) { return RequestType.HEARTBEAT; - } else if (PortletDummyRequestHandler.isDummyRequest(vaadinRequest)) { + } else if (PortletDummyRequestHandler + .isDummyRequest(vaadinRequest)) { return RequestType.DUMMY; } else { return RequestType.STATIC_FILE; @@ -531,7 +535,7 @@ public class VaadinPortlet extends GenericPortlet implements Constants, * @param response * @throws PortletException * @throws IOException - * + * * @deprecated As of 7.0. Will likely change or be removed in a future * version */ @@ -550,7 +554,7 @@ public class VaadinPortlet extends GenericPortlet implements Constants, /** * Wraps the request in a (possibly portal specific) Vaadin portlet request. - * + * * @param request * The original PortletRequest * @return A wrapped version of the PortletRequest @@ -578,7 +582,8 @@ public class VaadinPortlet extends GenericPortlet implements Constants, return new VaadinPortletRequest(request, service); } - private VaadinPortletResponse createVaadinResponse(PortletResponse response) { + private VaadinPortletResponse createVaadinResponse( + PortletResponse response) { return new VaadinPortletResponse(response, getService()); } @@ -621,8 +626,8 @@ public class VaadinPortlet extends GenericPortlet implements Constants, } @Override - public void serveResource(ResourceRequest request, ResourceResponse response) - throws PortletException, IOException { + public void serveResource(ResourceRequest request, + ResourceResponse response) throws PortletException, IOException { handleRequest(request, response); } @@ -646,10 +651,10 @@ public class VaadinPortlet extends GenericPortlet implements Constants, *

        * The current portlet is derived from the current service using * {@link VaadinService#getCurrent()} - * + * * @return the current vaadin portlet instance if available, otherwise * null - * + * * @since 7.0 */ public static VaadinPortlet getCurrent() { diff --git a/server/src/main/java/com/vaadin/server/VaadinPortletRequest.java b/server/src/main/java/com/vaadin/server/VaadinPortletRequest.java index 93e06d7f45..658d653dad 100644 --- a/server/src/main/java/com/vaadin/server/VaadinPortletRequest.java +++ b/server/src/main/java/com/vaadin/server/VaadinPortletRequest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -33,21 +33,21 @@ import com.vaadin.shared.ApplicationConstants; /** * Wrapper for {@link PortletRequest} and its subclasses. - * + * * @author Vaadin Ltd. * @since 7.0 - * + * * @see VaadinRequest * @see VaadinPortletResponse */ -public class VaadinPortletRequest extends PortletRequestWrapper implements - VaadinRequest { +public class VaadinPortletRequest extends PortletRequestWrapper + implements VaadinRequest { private final VaadinPortletService vaadinService; /** * Wraps a portlet request and an associated vaadin service - * + * * @param request * the portlet request to wrap * @param vaadinService @@ -123,7 +123,7 @@ public class VaadinPortletRequest extends PortletRequestWrapper implements /** * Gets the original, unwrapped portlet request. - * + * * @return the unwrapped portlet request */ public PortletRequest getPortletRequest() { @@ -182,7 +182,7 @@ public class VaadinPortletRequest extends PortletRequestWrapper implements /** * Reads a portal property from the portal context of the Vaadin request. - * + * * @param name * a string with the name of the portal property to get * @return a string with the value of the property, or null if @@ -194,11 +194,11 @@ public class VaadinPortletRequest extends PortletRequestWrapper implements /** * Reads a portlet preference from the portlet of the request. - * + * * @param name * The name of the portlet preference. Cannot be * null. - * + * * @return The value of the portlet preference, null if the * preference is not defined. */ @@ -244,7 +244,7 @@ public class VaadinPortletRequest extends PortletRequestWrapper implements * is automatically defined when the request is started. The current portlet * request can not be used in e.g. background threads because of the way * server implementations reuse request instances. - * + * * @return the current portlet request instance if available, otherwise * null * @since 7.3 @@ -259,7 +259,7 @@ public class VaadinPortletRequest extends PortletRequestWrapper implements * is automatically defined when the request is started. The current request * can not be used in e.g. background threads because of the way server * implementations reuse request instances. - * + * * @return the current Vaadin portlet request instance if available, * otherwise null * @since 7.3 diff --git a/server/src/main/java/com/vaadin/server/VaadinPortletResponse.java b/server/src/main/java/com/vaadin/server/VaadinPortletResponse.java index 0e830666e1..0ea8150122 100644 --- a/server/src/main/java/com/vaadin/server/VaadinPortletResponse.java +++ b/server/src/main/java/com/vaadin/server/VaadinPortletResponse.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -32,10 +32,10 @@ import javax.servlet.http.Cookie; /** * Wrapper for {@link PortletResponse} and its subclasses. - * + * * @author Vaadin Ltd. * @since 7.0 - * + * * @see VaadinResponse * @see VaadinPortletRequest */ @@ -51,7 +51,7 @@ public class VaadinPortletResponse implements VaadinResponse { /** * Wraps a portlet response and an associated vaadin service - * + * * @param response * the portlet response to wrap * @param vaadinService @@ -76,7 +76,7 @@ public class VaadinPortletResponse implements VaadinResponse { /** * Gets the original, unwrapped portlet response. - * + * * @return the unwrapped portlet response */ public PortletResponse getPortletResponse() { @@ -125,7 +125,8 @@ public class VaadinPortletResponse implements VaadinResponse { @Override public void setDateHeader(String name, long timestamp) { - response.setProperty(name, HTTP_DATE_FORMAT.format(new Date(timestamp))); + response.setProperty(name, + HTTP_DATE_FORMAT.format(new Date(timestamp))); } @Override diff --git a/server/src/main/java/com/vaadin/server/VaadinPortletService.java b/server/src/main/java/com/vaadin/server/VaadinPortletService.java index 5f22dd7d7c..0e53337edb 100644 --- a/server/src/main/java/com/vaadin/server/VaadinPortletService.java +++ b/server/src/main/java/com/vaadin/server/VaadinPortletService.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -65,14 +65,15 @@ public class VaadinPortletService extends VaadinService { /** * Retrieves a reference to the portlet associated with this service. - * + * * @return A reference to the VaadinPortlet this service is using */ public VaadinPortlet getPortlet() { return portlet; } - private String getPortalProperty(VaadinRequest request, String propertyName) { + private String getPortalProperty(VaadinRequest request, + String propertyName) { return ((VaadinPortletRequest) request).getPortalProperty(propertyName); } @@ -179,11 +180,10 @@ public class VaadinPortletService extends VaadinService { return new File(url.getFile()); } catch (final Exception e) { // FIXME: Handle exception - getLogger() - .log(Level.INFO, - "Cannot access base directory, possible security issue " - + "with Application Server or Servlet Container", - e); + getLogger().log(Level.INFO, + "Cannot access base directory, possible security issue " + + "with Application Server or Servlet Container", + e); } } return null; @@ -222,18 +222,18 @@ public class VaadinPortletService extends VaadinService { /** * Gets the request type for the request. - * + * * @param request * the request to get a request type for * @return the request type - * + * * @deprecated As of 7.0. Will likely change or be removed in a future * version */ @Deprecated protected RequestType getRequestType(VaadinRequest request) { - RequestType type = (RequestType) request.getAttribute(RequestType.class - .getName()); + RequestType type = (RequestType) request + .getAttribute(RequestType.class.getName()); if (type == null) { type = getPortlet().getRequestType((VaadinPortletRequest) request); request.setAttribute(RequestType.class.getName(), type); @@ -246,10 +246,10 @@ public class VaadinPortletService extends VaadinService { * is automatically defined when the request is started. The current portlet * request can not be used in e.g. background threads because of the way * server implementations reuse request instances. - * + * * @return the current portlet request instance if available, otherwise * null - * + * */ public static PortletRequest getCurrentPortletRequest() { VaadinPortletRequest currentRequest = getCurrentRequest(); @@ -265,10 +265,10 @@ public class VaadinPortletService extends VaadinService { * is automatically defined when the request is started. The current request * can not be used in e.g. background threads because of the way server * implementations reuse request instances. - * + * * @return the current Vaadin portlet request instance if available, * otherwise null - * + * */ public static VaadinPortletRequest getCurrentRequest() { return (VaadinPortletRequest) VaadinService.getCurrentRequest(); @@ -279,10 +279,10 @@ public class VaadinPortletService extends VaadinService { * response is automatically defined when the request is started. The * current response can not be used in e.g. background threads because of * the way server implementations reuse response instances. - * + * * @return the current Vaadin portlet response instance if available, * otherwise null - * + * */ public static VaadinPortletResponse getCurrentResponse() { return (VaadinPortletResponse) VaadinService.getCurrentResponse(); @@ -303,7 +303,8 @@ public class VaadinPortletService extends VaadinService { * Always preserve UIs in portlets to make portlet actions work. */ @Override - public boolean preserveUIOnRefresh(UIProvider provider, UICreateEvent event) { + public boolean preserveUIOnRefresh(UIProvider provider, + UICreateEvent event) { return true; } @@ -313,9 +314,9 @@ public class VaadinPortletService extends VaadinService { VaadinPortletSession session = (VaadinPortletSession) uI.getSession(); PortletContext portletContext = session.getPortletSession() .getPortletContext(); - return portletContext.getResourceAsStream("/" - + VaadinPortlet.THEME_DIR_PATH + '/' + themeName + "/" - + resource); + return portletContext + .getResourceAsStream("/" + VaadinPortlet.THEME_DIR_PATH + '/' + + themeName + "/" + resource); } @Override @@ -332,7 +333,7 @@ public class VaadinPortletService extends VaadinService { /* * (non-Javadoc) - * + * * @see * com.vaadin.server.VaadinService#handleSessionExpired(com.vaadin.server * .VaadinRequest, com.vaadin.server.VaadinResponse) diff --git a/server/src/main/java/com/vaadin/server/VaadinPortletSession.java b/server/src/main/java/com/vaadin/server/VaadinPortletSession.java index 23b5027b03..f7f9bd56a3 100644 --- a/server/src/main/java/com/vaadin/server/VaadinPortletSession.java +++ b/server/src/main/java/com/vaadin/server/VaadinPortletSession.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -47,18 +47,18 @@ import com.vaadin.util.CurrentInstance; /** * An implementation of {@link VaadinSession} for JSR-286 portlet environments. - * + * * This is automatically registered as a {@link HttpSessionBindingListener} when * {@link PortletSession#setAttribute()} is called with the context as value. - * + * * Only the documented parts of this class should be considered as stable public * API. - * + * * Note also that some methods and/or nested interfaces might move to * {@link VaadinPortletService} in future minor or major versions of Vaadin. In * these cases, a deprecated redirection for backwards compatibility will be * used in VaadinPortletSession for a transition period. - * + * * @since 7.0 */ @SuppressWarnings("serial") @@ -74,7 +74,7 @@ public class VaadinPortletSession extends VaadinSession { /** * Create a portlet service session for the given portlet service - * + * * @param service * the portlet service to which the new session belongs */ @@ -84,7 +84,7 @@ public class VaadinPortletSession extends VaadinSession { /** * Returns the underlying portlet session. - * + * * @return portlet session */ public PortletSession getPortletSession() { @@ -108,7 +108,7 @@ public class VaadinPortletSession extends VaadinSession { /** * Returns the JSR-286 portlet configuration that provides access to the * portlet context and init parameters. - * + * * @return portlet configuration */ public PortletConfig getPortletConfig() { @@ -119,7 +119,7 @@ public class VaadinPortletSession extends VaadinSession { /** * Adds a listener for various types of portlet requests. - * + * * @param listener * to add */ @@ -130,7 +130,7 @@ public class VaadinPortletSession extends VaadinSession { /** * Removes a portlet request listener registered with * {@link #addPortletListener(PortletListener)}. - * + * * @param listener * to remove */ @@ -145,8 +145,8 @@ public class VaadinPortletSession extends VaadinSession { RenderResponse response) { for (PortletListener l : new ArrayList( portletListeners)) { - l.handleRenderRequest(request, new RestrictedRenderResponse( - response), uI); + l.handleRenderRequest(request, + new RestrictedRenderResponse(response), uI); } } @@ -207,11 +207,11 @@ public class VaadinPortletSession extends VaadinSession { * {@link PortletListenerNotifier} after the session is locked and the * corresponding UI has been found (if already created) but before other * request processing takes place. - * + * * Direct rendering of output is not possible in a portlet listener and the * JSR-286 limitations on allowed operations in each phase or portlet * request processing must be respected by the listeners. - * + * * Note that internal action requests used by the framework to trigger * events or set shared parameters do not call the action request listener * but will result in a later event or render request that will trigger the @@ -234,11 +234,11 @@ public class VaadinPortletSession extends VaadinSession { /** * Creates a new action URL. - * + * * Creating an action URL is only supported when processing a suitable * request (render or resource request, including normal Vaadin UIDL * processing) and will return null if not processing a suitable request. - * + * * @param action * the action parameter (javax.portlet.action parameter value in * JSR-286) @@ -259,18 +259,18 @@ public class VaadinPortletSession extends VaadinSession { /** * Sends a portlet event to the indicated destination. - * + * * Internally, an action may be created and opened, as an event cannot be * sent directly from all types of requests. - * + * * Sending portlet events from background threads is not supported. - * + * * The event destinations and values need to be kept in the context until * sent. Any memory leaks if the action fails are limited to the session. - * + * * Event names for events sent and received by a portlet need to be declared * in portlet.xml . - * + * * @param uI * a window in which a temporary action URL can be opened if * necessary @@ -309,19 +309,19 @@ public class VaadinPortletSession extends VaadinSession { /** * Sets a shared portlet parameter. - * + * * Internally, an action may be created and opened, as shared parameters * cannot be set directly from all types of requests. - * + * * Setting shared render parameters from background threads is not * supported. - * + * * The parameters and values need to be kept in the context until sent. Any * memory leaks if the action fails are limited to the session. - * + * * Shared parameters set or read by a portlet need to be declared in * portlet.xml . - * + * * @param uI * a window in which a temporary action URL can be opened if * necessary @@ -359,13 +359,13 @@ public class VaadinPortletSession extends VaadinSession { /** * Sets the portlet mode. This may trigger a new render request. - * + * * Currently, this is only supported when working with a * {@link StateAwareResponse} (an action request or an event request). * Portlet mode change in background threads is not supported. - * + * * Portlet modes used by a portlet need to be declared in portlet.xml . - * + * * @param uI * a window in which the render URL can be opened if necessary * @param portletMode diff --git a/server/src/main/java/com/vaadin/server/VaadinRequest.java b/server/src/main/java/com/vaadin/server/VaadinRequest.java index 5b7e16ac46..87d4a07b45 100644 --- a/server/src/main/java/com/vaadin/server/VaadinRequest.java +++ b/server/src/main/java/com/vaadin/server/VaadinRequest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -35,7 +35,7 @@ import javax.servlet.http.HttpServletRequest; /** * A generic request to the server, wrapping a more specific request type, e.g. * HttpServletReqest or PortletRequest. - * + * * @author Vaadin Ltd * @since 7.0.0 */ @@ -44,10 +44,10 @@ public interface VaadinRequest extends Serializable { * 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 @@ -59,12 +59,12 @@ public interface VaadinRequest extends Serializable { * Gets all the parameters of the request. Framework's internal init * parameters have prefix "v-" (does not include such parameters as "theme" * and "debug"). - * + * * @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(); @@ -72,10 +72,10 @@ public interface VaadinRequest extends Serializable { /** * 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(); @@ -84,10 +84,10 @@ public interface VaadinRequest extends Serializable { * 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 @@ -97,12 +97,12 @@ public interface VaadinRequest extends Serializable { /** * 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) */ @@ -110,12 +110,12 @@ public interface VaadinRequest extends Serializable { /** * 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) */ @@ -125,9 +125,9 @@ public interface VaadinRequest extends Serializable { * Gets the path of the requested resource relative to the application. The * path is 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 getPathInfo(); @@ -135,10 +135,10 @@ public interface VaadinRequest extends Serializable { /** * Returns the portion of the request URI that indicates the context of the * request. The context path always comes first in a request URI. - * + * * @see HttpServletRequest#getContextPath() * @see PortletRequest#getContextPath() - * + * * @return a String specifying the portion of the request URI that indicates * the context of the request */ @@ -147,11 +147,11 @@ public interface VaadinRequest extends Serializable { /** * Gets the session associated with this request, creating a new if there is * no session. - * + * * @see WrappedSession * @see HttpServletRequest#getSession() * @see PortletRequest#getPortletSession() - * + * * @return the wrapped session for this request */ public WrappedSession getWrappedSession(); @@ -159,16 +159,16 @@ public interface VaadinRequest extends Serializable { /** * Gets the session associated with this request, optionally creating a new * if there is no session. - * + * * @param allowSessionCreation * true to create a new session for this request if * necessary; false to return null if * there's no current session - * + * * @see WrappedSession * @see HttpServletRequest#getSession(boolean) * @see PortletRequest#getPortletSession(boolean) - * + * * @return the wrapped session for this request */ public WrappedSession getWrappedSession(boolean allowSessionCreation); @@ -176,22 +176,22 @@ public interface VaadinRequest extends Serializable { /** * 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 locale information from the query, e.g. using the Accept-Language * header. - * + * * @return the preferred Locale - * + * * @see ServletRequest#getLocale() * @see PortletRequest#getLocale() */ @@ -200,10 +200,10 @@ public interface VaadinRequest extends Serializable { /** * 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(); @@ -211,9 +211,9 @@ public interface VaadinRequest extends Serializable { /** * 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() */ @@ -222,21 +222,21 @@ public interface VaadinRequest extends Serializable { /** * 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 vaadin service for the context of this request. - * + * * @return the vaadin service - * + * * @see VaadinService */ public VaadinService getService(); @@ -245,10 +245,10 @@ public interface VaadinRequest extends Serializable { * Returns an array containing all of the Cookie objects the * client sent with this request. This method returns null if * no cookies were sent. - * + * * @return an array of all the Cookies included with this * request, or null if the request has no cookies - * + * * @see HttpServletRequest#getCookies() * @see PortletRequest#getCookies() */ @@ -259,10 +259,10 @@ public interface VaadinRequest extends Serializable { * between client and server, for example, BASIC_AUTH, * CLIENT_CERT_AUTH, a custom one or null if there * was no authentication. - * + * * @return a string indicating the authentication scheme, or * null if the request was not authenticated. - * + * * @see HttpServletRequest#getAuthType() * @see PortletRequest#getAuthType() */ @@ -273,10 +273,10 @@ public interface VaadinRequest extends Serializable { * authenticated, or null if the user has not been authenticated. Whether * the user name is sent with each subsequent request depends on the browser * and type of authentication. - * + * * @return a String specifying the login of the user making this request, or * null if the user login is not known. - * + * * @see HttpServletRequest#getRemoteUser() * @see PortletRequest#getRemoteUser() */ @@ -286,11 +286,11 @@ public interface VaadinRequest extends Serializable { * Returns a java.security.Principal object containing the name * of the current authenticated user. If the user has not been * authenticated, the method returns null. - * + * * @return a java.security.Principal containing the name of the * user making this request; null if the user has not * been authenticated - * + * * @see HttpServletRequest#getUserPrincipal() * @see PortletRequest#getUserPrincipal() */ @@ -301,13 +301,13 @@ public interface VaadinRequest extends Serializable { * in the specified logical "role". Roles and role membership can be defined * using deployment descriptors. If the user has not been authenticated, the * method returns false. - * + * * @param role * a String specifying the name of the role * @return a boolean indicating whether the user making this request belongs * to a given role; false if the user has not been * authenticated - * + * * @see HttpServletRequest#isUserInRole(String) * @see PortletRequest#isUserInRole(String) */ @@ -317,10 +317,10 @@ public interface VaadinRequest extends Serializable { * Removes an attribute from this request. This method is not generally * needed as attributes only persist as long as the request is being * handled. - * + * * @param name * a String specifying the name of the attribute to remove - * + * * @see ServletRequest#removeAttribute(String) * @see PortletRequest#removeAttribute(String) */ @@ -330,10 +330,10 @@ public interface VaadinRequest extends Serializable { * Returns an Enumeration containing the names of the attributes available * to this request. This method returns an empty Enumeration if the request * has no attributes available to it. - * + * * @return an Enumeration of strings containing the names of the request's * attributes - * + * * @see ServletRequest#getAttributeNames() * @see PortletRequest#getAttributeNames() */ @@ -345,9 +345,9 @@ public interface VaadinRequest extends Serializable { * the client based on the Accept-Language header. If the client request * doesn't provide an Accept-Language header, this method returns an * Enumeration containing one Locale, the default locale for the server. - * + * * @return an Enumeration of preferred Locale objects for the client - * + * * @see HttpServletRequest#getLocales() * @see PortletRequest#getLocales() */ @@ -358,10 +358,10 @@ public interface VaadinRequest extends Serializable { * sent the request. If the engine cannot or chooses not to resolve the * hostname (to improve performance), this method returns the dotted-string * form of the IP address. - * + * * @return a String containing the fully qualified name of the client, or * null if the information is not available. - * + * * @see HttpServletRequest#getRemoteHost() */ public String getRemoteHost(); @@ -369,10 +369,10 @@ public interface VaadinRequest extends Serializable { /** * Returns the Internet Protocol (IP) source port of the client or last * proxy that sent the request. - * + * * @return an integer specifying the port number, or -1 if the information * is not available. - * + * * @see ServletRequest#getRemotePort() */ public int getRemotePort(); @@ -381,10 +381,10 @@ public interface VaadinRequest extends Serializable { * Returns the name of the character encoding used in the body of this * request. This method returns null if the request does not * specify a character encoding. - * + * * @return a String containing the name of the character encoding, or null * if the request does not specify a character encoding - * + * * @see ServletRequest#getCharacterEncoding() * @see ClientDataRequest#getCharacterEncoding() */ @@ -395,9 +395,9 @@ public interface VaadinRequest extends Serializable { * BufferedReader. The reader translates the character data * according to the character encoding used on the body. Either this method * or {@link #getInputStream()} may be called to read the body, not both. - * + * * @return a BufferedReader containing the body of the request - * + * * @throws UnsupportedEncodingException * - if the character set encoding used is not supported and the * text cannot be decoded @@ -406,7 +406,7 @@ public interface VaadinRequest extends Serializable { * request * @throws IOException * if an input or output exception occurred - * + * * @see ServletRequest#getReader() * @see ClientDataRequest#getReader() */ @@ -415,10 +415,10 @@ public interface VaadinRequest extends Serializable { /** * Returns the name of the HTTP method with which this request was made, for * example, GET, POST, or PUT. - * + * * @return a String specifying the name of the method with which this * request was made - * + * * @see HttpServletRequest#getMethod() * @see ClientDataRequest#getMethod() */ @@ -435,7 +435,7 @@ public interface VaadinRequest extends Serializable { * If the request did not have a header of the specified name, this method * returns -1. If the header can't be converted to a date, the method throws * an IllegalArgumentException. - * + * * @param name * a String specifying the name of the header * @return a long value representing the date specified in the header @@ -453,7 +453,7 @@ public interface VaadinRequest extends Serializable { *

        * Some implementations do not allow access headers using this method, in * which case this method returns null - * + * * @return an enumeration of all the header names sent with this request; if * the request has no headers, an empty enumeration; if the * implementation does not allow this method, null @@ -475,8 +475,8 @@ public interface VaadinRequest extends Serializable { *

        * The header name is case insensitive. You can use this method with any * request header. - * - * + * + * * @param name * a String specifying the header name * @return an Enumeration containing the values of the requested header. If diff --git a/server/src/main/java/com/vaadin/server/VaadinResponse.java b/server/src/main/java/com/vaadin/server/VaadinResponse.java index c31c6c05d8..de33279814 100644 --- a/server/src/main/java/com/vaadin/server/VaadinResponse.java +++ b/server/src/main/java/com/vaadin/server/VaadinResponse.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -31,7 +31,7 @@ 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 VaadinResponse extends Serializable { @@ -40,11 +40,11 @@ public interface VaadinResponse 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); @@ -53,10 +53,10 @@ public interface VaadinResponse extends Serializable { * 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) */ @@ -65,12 +65,12 @@ public interface VaadinResponse extends Serializable { /** * 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) */ @@ -79,12 +79,12 @@ public interface VaadinResponse extends Serializable { /** * 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); @@ -95,11 +95,11 @@ public interface VaadinResponse extends Serializable { *

        * 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() @@ -113,11 +113,11 @@ public interface VaadinResponse extends Serializable { *

        * 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() @@ -127,7 +127,7 @@ public interface VaadinResponse extends Serializable { /** * 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 */ @@ -137,23 +137,23 @@ public interface VaadinResponse extends Serializable { * 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 vaadin service for the context of this response. - * + * * @return the vaadin service - * + * * @see VaadinService */ public VaadinService getService(); @@ -161,10 +161,10 @@ public interface VaadinResponse extends Serializable { /** * Adds the specified cookie to the response. This method can be called * multiple times to set more than one cookie. - * + * * @param cookie * the Cookie to return to the client - * + * * @see HttpServletResponse#addCookie(Cookie) * @see PortletResponse#addProperty(Cookie) */ diff --git a/server/src/main/java/com/vaadin/server/VaadinService.java b/server/src/main/java/com/vaadin/server/VaadinService.java index b08597d37c..e453332f02 100644 --- a/server/src/main/java/com/vaadin/server/VaadinService.java +++ b/server/src/main/java/com/vaadin/server/VaadinService.java @@ -165,12 +165,13 @@ public abstract class VaadinService implements Serializable { .loadClass(classLoaderName); final Constructor c = classLoaderClass .getConstructor(new Class[] { ClassLoader.class }); - setClassLoader((ClassLoader) c - .newInstance(new Object[] { getClass().getClassLoader() })); + setClassLoader((ClassLoader) c.newInstance( + new Object[] { getClass().getClassLoader() })); } catch (final Exception e) { throw new RuntimeException( "Could not find specified class loader: " - + classLoaderName, e); + + classLoaderName, + e); } } @@ -372,7 +373,8 @@ public abstract class VaadinService implements Serializable { * @param request * @return the system messages to use */ - public SystemMessages getSystemMessages(Locale locale, VaadinRequest request) { + public SystemMessages getSystemMessages(Locale locale, + VaadinRequest request) { SystemMessagesInfo systemMessagesInfo = new SystemMessagesInfo(); systemMessagesInfo.setLocale(locale); systemMessagesInfo.setService(this); @@ -485,8 +487,9 @@ public abstract class VaadinService implements Serializable { // for now, use the session error handler; in the future, could // have an API for using some other handler for session init and // destroy listeners - eventRouter.fireEvent(new SessionDestroyEvent( - VaadinService.this, session), session.getErrorHandler()); + eventRouter.fireEvent( + new SessionDestroyEvent(VaadinService.this, session), + session.getErrorHandler()); session.setState(State.CLOSED); } @@ -553,7 +556,8 @@ public abstract class VaadinService implements Serializable { } Object currentSessionLock = wrappedSession .getAttribute(getLockAttributeName()); - assert (currentSessionLock == null || currentSessionLock == lock) : "Changing the lock for a session is not allowed"; + assert (currentSessionLock == null + || currentSessionLock == lock) : "Changing the lock for a session is not allowed"; wrappedSession.setAttribute(getLockAttributeName(), lock); } @@ -665,7 +669,8 @@ public abstract class VaadinService implements Serializable { } try { - return doFindOrCreateVaadinSession(request, requestCanCreateSession); + return doFindOrCreateVaadinSession(request, + requestCanCreateSession); } finally { unlockSession(wrappedSession); } @@ -684,8 +689,8 @@ public abstract class VaadinService implements Serializable { * @throws ServiceException */ private VaadinSession doFindOrCreateVaadinSession(VaadinRequest request, - boolean requestCanCreateSession) throws SessionExpiredException, - ServiceException { + boolean requestCanCreateSession) + throws SessionExpiredException, ServiceException { assert ((ReentrantLock) getSessionLock(request.getWrappedSession())) .isHeldByCurrentThread() : "Session has not been locked by this thread"; @@ -768,7 +773,8 @@ public abstract class VaadinService implements Serializable { Locale locale = request.getLocale(); session.setLocale(locale); session.setConfiguration(getDeploymentConfiguration()); - session.setCommunicationManager(new LegacyCommunicationManager(session)); + session.setCommunicationManager( + new LegacyCommunicationManager(session)); ServletPortletHelper.initDefaultUIProvider(session, this); onVaadinSessionStarted(request, session); @@ -1020,7 +1026,8 @@ public abstract class VaadinService implements Serializable { * false if a new UI instance should be initialized on * refreshed. */ - public boolean preserveUIOnRefresh(UIProvider provider, UICreateEvent event) { + public boolean preserveUIOnRefresh(UIProvider provider, + UICreateEvent event) { return provider.isPreservedOnRefresh(event); } @@ -1088,7 +1095,7 @@ public abstract class VaadinService implements Serializable { * * Finds the given theme resource from the web content folder or using the * class loader and returns a stream for it - * + * * @param ui * The ui for which to find the resource * @param themeName @@ -1237,7 +1244,8 @@ public abstract class VaadinService implements Serializable { */ private int getHeartbeatTimeout() { // Permit three missed heartbeats before closing the UI - return (int) (getDeploymentConfiguration().getHeartbeatInterval() * (3.1)); + return (int) (getDeploymentConfiguration().getHeartbeatInterval() + * (3.1)); } /** @@ -1260,8 +1268,8 @@ public abstract class VaadinService implements Serializable { * timeout never occurs. */ private int getUidlRequestTimeout(VaadinSession session) { - return getDeploymentConfiguration().isCloseIdleSessions() ? session - .getSession().getMaxInactiveInterval() : -1; + return getDeploymentConfiguration().isCloseIdleSessions() + ? session.getSession().getMaxInactiveInterval() : -1; } /** @@ -1445,12 +1453,10 @@ public abstract class VaadinService implements Serializable { // if this was an UIDL request, send UIDL back to the client if (ServletPortletHelper.isUIDLRequest(request)) { - SystemMessages ci = getSystemMessages( - ServletPortletHelper.findLocale(null, vaadinSession, - request), request); + SystemMessages ci = getSystemMessages(ServletPortletHelper + .findLocale(null, vaadinSession, request), request); try { - writeStringResponse( - response, + writeStringResponse(response, JsonConstants.JSON_CONTENT_TYPE, createCriticalNotificationJSON( ci.getInternalErrorCaption(), @@ -1459,10 +1465,9 @@ public abstract class VaadinService implements Serializable { } catch (IOException e) { // An exception occured while writing the response. Log // it and continue handling only the original error. - getLogger() - .log(Level.WARNING, - "Failed to write critical notification response to the client", - e); + getLogger().log(Level.WARNING, + "Failed to write critical notification response to the client", + e); } } else { // Re-throw other exceptions @@ -1488,14 +1493,14 @@ public abstract class VaadinService implements Serializable { * @throws IOException * If an error occured while writing the response */ - public void writeStringResponse(VaadinResponse response, - String contentType, String reponseString) throws IOException { + public void writeStringResponse(VaadinResponse response, String contentType, + String reponseString) throws IOException { response.setContentType(contentType); final OutputStream out = response.getOutputStream(); - final PrintWriter outWriter = new PrintWriter(new BufferedWriter( - new OutputStreamWriter(out, "UTF-8"))); + final PrintWriter outWriter = new PrintWriter( + new BufferedWriter(new OutputStreamWriter(out, "UTF-8"))); outWriter.print(reponseString); outWriter.close(); } @@ -1517,8 +1522,8 @@ public abstract class VaadinService implements Serializable { for (RequestHandler handler : getRequestHandlers()) { if (handler instanceof SessionExpiredHandler) { try { - if (((SessionExpiredHandler) handler).handleSessionExpired( - request, response)) { + if (((SessionExpiredHandler) handler) + .handleSessionExpired(request, response)) { return; } } catch (IOException e) { @@ -1652,8 +1657,7 @@ public abstract class VaadinService implements Serializable { } if (!Constants.REQUIRED_ATMOSPHERE_RUNTIME_VERSION.equals(rawVersion)) { - getLogger().log( - Level.WARNING, + getLogger().log(Level.WARNING, Constants.INVALID_ATMOSPHERE_VERSION_WARNING, new Object[] { Constants.REQUIRED_ATMOSPHERE_RUNTIME_VERSION, @@ -1664,7 +1668,7 @@ public abstract class VaadinService implements Serializable { /** * Checks whether Atmosphere is avilable for use - * + * * @since 7.6 * @return true if Atmosphere is available, false otherwise */ @@ -1763,7 +1767,8 @@ public abstract class VaadinService implements Serializable { * @return a future that can be used to check for task completion and to * cancel the task */ - public Future accessSession(VaadinSession session, Runnable runnable) { + public Future accessSession(VaadinSession session, + Runnable runnable) { FutureAccess future = new FutureAccess(session, runnable); session.getPendingAccessQueue().add(future); @@ -1788,7 +1793,7 @@ public abstract class VaadinService implements Serializable { * If no thread is currently holding the lock, pending changes for UIs * with automatic push would not be processed and pushed until the next * time there is a request or someone does an explicit push call. - * + * * To remedy this, we try to get the lock at this point. If the lock is * currently held by another thread, we just back out as the queue will * get purged once it is released. If the lock is held by the current @@ -1831,11 +1836,12 @@ public abstract class VaadinService implements Serializable { FutureAccess pendingAccess; try { - while ((pendingAccess = session.getPendingAccessQueue().poll()) != null) { + while ((pendingAccess = session.getPendingAccessQueue() + .poll()) != null) { if (!pendingAccess.isCancelled()) { CurrentInstance.clearAll(); - CurrentInstance.restoreInstances(pendingAccess - .getCurrentInstances()); + CurrentInstance.restoreInstances( + pendingAccess.getCurrentInstances()); CurrentInstance.setCurrent(session); pendingAccess.run(); @@ -1903,16 +1909,16 @@ public abstract class VaadinService implements Serializable { * this {@link VaadinService} if found. If current security policy disallows * acquiring class loader instance it will log a message and re-throw * {@link SecurityException} - * + * * @throws SecurityException * If current security policy forbids acquiring class loader - * + * * @since 7.3.5 */ protected void setDefaultClassLoader() { try { - setClassLoader(VaadinServiceClassLoaderUtil - .findDefaultClassLoader()); + setClassLoader( + VaadinServiceClassLoaderUtil.findDefaultClassLoader()); } catch (SecurityException e) { getLogger().log(Level.SEVERE, Constants.CANNOT_ACQUIRE_CLASSLOADER_SEVERE, e); @@ -1924,7 +1930,7 @@ public abstract class VaadinService implements Serializable { * Called when the VaadinSession should be stored. *

        * By default stores the VaadinSession in the underlying HTTP session. - * + * * @since 7.6 * @param session * the VaadinSession to store @@ -1943,7 +1949,7 @@ public abstract class VaadinService implements Serializable { * session after sanity checks have been performed. *

        * Called by {@link #storeSession(VaadinSession, WrappedSession)} - * + * * @since 7.6 * @param wrappedSession * the underlying HTTP session @@ -1958,7 +1964,7 @@ public abstract class VaadinService implements Serializable { /** * Called when the VaadinSession should be loaded from the underlying HTTP * session - * + * * @since 7.6 * @param wrappedSession * the underlying HTTP session @@ -1980,7 +1986,7 @@ public abstract class VaadinService implements Serializable { * session after sanity checks have been performed. *

        * Called by {@link #loadSession(WrappedSession)}. - * + * * @param wrappedSession * the underlying HTTP session * @since 7.6 @@ -1994,7 +2000,7 @@ public abstract class VaadinService implements Serializable { /** * Called when the VaadinSession should be removed from the underlying HTTP * session - * + * * @since 7.6 * @param wrappedSession * the underlying HTTP session @@ -2007,7 +2013,7 @@ public abstract class VaadinService implements Serializable { /** * Performs the actual removal of the VaadinSession from the underlying HTTP * session after sanity checks have been performed - * + * * @since 7.6 * @param wrappedSession * the underlying HTTP session @@ -2020,7 +2026,7 @@ public abstract class VaadinService implements Serializable { /** * Returns the name used for storing the VaadinSession in the underlying * HTTP session - * + * * @since 7.6 * @return the attribute name used for storing the VaadinSession */ diff --git a/server/src/main/java/com/vaadin/server/VaadinServiceClassLoaderUtil.java b/server/src/main/java/com/vaadin/server/VaadinServiceClassLoaderUtil.java index 8c85a6b3b3..5b9d0a9237 100644 --- a/server/src/main/java/com/vaadin/server/VaadinServiceClassLoaderUtil.java +++ b/server/src/main/java/com/vaadin/server/VaadinServiceClassLoaderUtil.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,14 +20,14 @@ import java.security.PrivilegedAction; /** * Utility class used by {@link VaadinService#setDefaultClassLoader()}. - * + * * @since 7.4 * @author Vaadin Ltd */ class VaadinServiceClassLoaderUtil { - private static class GetClassLoaderPrivilegedAction implements - PrivilegedAction { + private static class GetClassLoaderPrivilegedAction + implements PrivilegedAction { @Override public ClassLoader run() { return Thread.currentThread().getContextClassLoader(); @@ -41,7 +41,7 @@ class VaadinServiceClassLoaderUtil { * appropriate message. The code for this method is modeled after * recommendations laid out by JEE 5 specification sections EE.6.2.4.7 and * EE.8.2.5 - * + * * @return Instance of {@link ClassLoader} that should be used by this * instance of {@link VaadinService} * @throws SecurityException @@ -50,8 +50,8 @@ class VaadinServiceClassLoaderUtil { */ static protected ClassLoader findDefaultClassLoader() throws SecurityException { - return AccessController - .doPrivileged(new VaadinServiceClassLoaderUtil.GetClassLoaderPrivilegedAction()); + return AccessController.doPrivileged( + new VaadinServiceClassLoaderUtil.GetClassLoaderPrivilegedAction()); } } diff --git a/server/src/main/java/com/vaadin/server/VaadinServlet.java b/server/src/main/java/com/vaadin/server/VaadinServlet.java index eef3bcd8ee..b48063f972 100644 --- a/server/src/main/java/com/vaadin/server/VaadinServlet.java +++ b/server/src/main/java/com/vaadin/server/VaadinServlet.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -125,25 +125,27 @@ public class VaadinServlet extends HttpServlet implements Constants { long lastModified = -1L; if (file.exists()) { lastModified = file.lastModified(); - } else if (resource != null && resource.getProtocol().equals("file")) { + } else if (resource != null + && resource.getProtocol().equals("file")) { try { file = new File(resource.toURI()); if (file.exists()) { lastModified = file.lastModified(); } } catch (URISyntaxException e) { - getLogger().log(Level.WARNING, "Could not resolve timestamp for " + resource, e); + getLogger().log(Level.WARNING, + "Could not resolve timestamp for " + resource, + e); } } if (lastModified == -1L && resource == null) { /* - * Ignore missing files found in the classpath, - * report problem and abort for other files. + * Ignore missing files found in the classpath, report + * problem and abort for other files. */ - getLogger() - .log(Level.WARNING, - "Could not resolve timestamp for {0}, Scss on the fly caching will be disabled", - uri); + getLogger().log(Level.WARNING, + "Could not resolve timestamp for {0}, Scss on the fly caching will be disabled", + uri); // -1 means this cache entry will never be valid return -1; } @@ -184,7 +186,7 @@ public class VaadinServlet extends HttpServlet implements Constants { /** * Called by the servlet container to indicate to a servlet that the servlet * is being placed into service. - * + * * @param servletConfig * the object containing the servlet's configuration and * initialization parameters @@ -219,7 +221,8 @@ public class VaadinServlet extends HttpServlet implements Constants { servletConfig.getInitParameter(name)); } - DeploymentConfiguration deploymentConfiguration = createDeploymentConfiguration(initParameters); + DeploymentConfiguration deploymentConfiguration = createDeploymentConfiguration( + initParameters); try { servletService = createServletService(deploymentConfiguration); } catch (ServiceException e) { @@ -236,7 +239,8 @@ public class VaadinServlet extends HttpServlet implements Constants { private void readUiFromEnclosingClass(Properties initParameters) { Class enclosingClass = getClass().getEnclosingClass(); - if (enclosingClass != null && UI.class.isAssignableFrom(enclosingClass)) { + if (enclosingClass != null + && UI.class.isAssignableFrom(enclosingClass)) { initParameters.put(VaadinSession.UI_PARAMETER, enclosingClass.getName()); } @@ -269,7 +273,8 @@ public class VaadinServlet extends HttpServlet implements Constants { // This should never happen throw new ServletException( "Could not read @VaadinServletConfiguration value " - + method.getName(), e); + + method.getName(), + e); } } } @@ -289,10 +294,10 @@ public class VaadinServlet extends HttpServlet implements Constants { *

        * The current servlet is derived from the current service using * {@link VaadinService#getCurrent()} - * + * * @return the current Vaadin servlet instance if available, otherwise * null - * + * * @since 7.0 */ public static VaadinServlet getCurrent() { @@ -322,7 +327,7 @@ public class VaadinServlet extends HttpServlet implements Constants { /** * Receives standard HTTP requests from the public service method and * dispatches them. - * + * * @param request * the object that contains the request the client made of the * servlet. @@ -373,7 +378,7 @@ public class VaadinServlet extends HttpServlet implements Constants { * Invoked for every request to this servlet to potentially send a redirect * to avoid problems with requests to the context root with no trailing * slash. - * + * * @param request * the processed request * @param response @@ -425,7 +430,7 @@ public class VaadinServlet extends HttpServlet implements Constants { * related to /bar. *

        * For http://myhost.com/foo;a=1/bar;b=1 this method will return ;b=1 - * + * * @since 7.2 * @param uri * a URI @@ -457,7 +462,7 @@ public class VaadinServlet extends HttpServlet implements Constants { /** * Create a Vaadin request for a http servlet request. This method can be * overridden if the Vaadin request should have special properties. - * + * * @param request * the original http servlet request * @return a Vaadin request for the original request @@ -469,7 +474,7 @@ public class VaadinServlet extends HttpServlet implements Constants { /** * Gets a the vaadin service for this servlet. - * + * * @return the vaadin service */ protected VaadinServletService getService() { @@ -479,7 +484,7 @@ public class VaadinServlet extends HttpServlet implements Constants { /** * Check that cookie support is enabled in the browser. Only checks UIDL * requests. - * + * * @param requestType * Type of the request as returned by * {@link #getRequestType(HttpServletRequest)} @@ -501,8 +506,7 @@ public class VaadinServlet extends HttpServlet implements Constants { SystemMessages systemMessages = getService().getSystemMessages( ServletPortletHelper.findLocale(null, null, request), request); - getService().writeStringResponse( - response, + getService().writeStringResponse(response, JsonConstants.JSON_CONTENT_TYPE, VaadinService.createCriticalNotificationJSON( systemMessages.getCookiesDisabledCaption(), @@ -518,7 +522,7 @@ public class VaadinServlet extends HttpServlet implements Constants { * Send a notification to client-side widgetset. Used to notify client of * critical errors, session expiration and more. Server has no knowledge of * what UI client refers to. - * + * * @param request * the HTTP request instance. * @param response @@ -537,7 +541,7 @@ public class VaadinServlet extends HttpServlet implements Constants { * the current page. * @throws IOException * if the writing failed due to input/output error. - * + * * @deprecated As of 7.0. This method is retained only for backwards * compatibility and for {@link GAEVaadinServlet}. */ @@ -581,20 +585,20 @@ public class VaadinServlet extends HttpServlet implements Constants { /** * Writes the response in {@code output} using the contentType given in * {@code contentType} to the provided {@link HttpServletResponse} - * + * * @param response * @param contentType * @param output * Output to write (UTF-8 encoded) * @throws IOException */ - private void writeResponse(HttpServletResponse response, - String contentType, String output) throws IOException { + private void writeResponse(HttpServletResponse response, String contentType, + String output) throws IOException { response.setContentType(contentType); final OutputStream out = response.getOutputStream(); // Set the response type - final PrintWriter outWriter = new PrintWriter(new BufferedWriter( - new OutputStreamWriter(out, "UTF-8"))); + final PrintWriter outWriter = new PrintWriter( + new BufferedWriter(new OutputStreamWriter(out, "UTF-8"))); outWriter.print(output); outWriter.flush(); outWriter.close(); @@ -604,12 +608,12 @@ public class VaadinServlet extends HttpServlet implements Constants { * Gets resource path using different implementations. Required to * supporting different servlet container implementations (application * servers). - * + * * @param servletContext * @param path * the resource path. * @return the resource path. - * + * * @deprecated As of 7.0. Will likely change or be removed in a future * version */ @@ -637,10 +641,10 @@ public class VaadinServlet extends HttpServlet implements Constants { * A helper method to strip away characters that might somehow be used for * XSS attacks. Leaves at least alphanumeric characters intact. Also removes * e.g. '(' and ')', so values should be safe in javascript too. - * + * * @param themeName * @return - * + * * @deprecated As of 7.0. Will likely change or be removed in a future * version */ @@ -685,7 +689,7 @@ public class VaadinServlet extends HttpServlet implements Constants { /** * Returns the default theme. Must never return null. - * + * * @return */ public static String getDefaultTheme() { @@ -695,7 +699,7 @@ public class VaadinServlet extends HttpServlet implements Constants { /** * Check if this is a request for a static resource and, if it is, serve the * resource to the client. - * + * * @param request * @param response * @return true if a file was served and the request has been handled, false @@ -733,7 +737,7 @@ public class VaadinServlet extends HttpServlet implements Constants { /** * Serve resources from VAADIN directory. - * + * * @param filename * The filename to serve. Should always start with /VAADIN/. * @param request @@ -755,11 +759,10 @@ public class VaadinServlet extends HttpServlet implements Constants { return; } else { // cannot serve requested file - getLogger() - .log(Level.INFO, - "Requested resource [{0}] not found from filesystem or through class loader." - + " Add widgetset and/or theme JAR to your classpath or add files to WebContent/VAADIN folder.", - filename); + getLogger().log(Level.INFO, + "Requested resource [{0}] not found from filesystem or through class loader." + + " Add widgetset and/or theme JAR to your classpath or add files to WebContent/VAADIN folder.", + filename); response.setStatus(HttpServletResponse.SC_NOT_FOUND); } return; @@ -768,10 +771,9 @@ public class VaadinServlet extends HttpServlet implements Constants { // security check: do not permit navigation out of the VAADIN // directory if (!isAllowedVAADINResourceUrl(request, resourceUrl)) { - getLogger() - .log(Level.INFO, - "Requested resource [{0}] not accessible in the VAADIN directory or access to it is forbidden.", - filename); + getLogger().log(Level.INFO, + "Requested resource [{0}] not accessible in the VAADIN directory or access to it is forbidden.", + filename); response.setStatus(HttpServletResponse.SC_FORBIDDEN); return; } @@ -782,8 +784,8 @@ public class VaadinServlet extends HttpServlet implements Constants { cacheControl = "max-age=" + String.valueOf(resourceCacheTime); } response.setHeader("Cache-Control", cacheControl); - response.setDateHeader("Expires", System.currentTimeMillis() - + (resourceCacheTime * 1000)); + response.setDateHeader("Expires", + System.currentTimeMillis() + (resourceCacheTime * 1000)); // Find the modification timestamp long lastModifiedTime = 0; @@ -803,10 +805,9 @@ public class VaadinServlet extends HttpServlet implements Constants { } } catch (Exception e) { // Failed to find out last modified timestamp. Continue without it. - getLogger() - .log(Level.FINEST, - "Failed to find out last modified timestamp. Continuing without it.", - e); + getLogger().log(Level.FINEST, + "Failed to find out last modified timestamp. Continuing without it.", + e); } finally { try { // Explicitly close the input stream to prevent it @@ -838,18 +839,18 @@ public class VaadinServlet extends HttpServlet implements Constants { * default filenames containing ".nocache." return 0, filenames containing * ".cache." return one year, all other return the value defined in the * web.xml using resourceCacheTime (defaults to 1 hour). - * + * * @param filename * @return cache lifetime for the given filename in seconds */ protected int getCacheTime(String filename) { /* * GWT conventions: - * + * * - files containing .nocache. will not be cached. - * + * * - files containing .cache. will be cached for one year. - * + * * https://developers.google.com/web-toolkit/doc/latest/ * DevGuideCompilingAndDebugging#perfect_caching */ @@ -873,7 +874,7 @@ public class VaadinServlet extends HttpServlet implements Constants { /** * Writes the contents of the given resourceUrl in the response. Can be * overridden to add/modify response headers and similar. - * + * * @param request * The request for the resource * @param response @@ -899,10 +900,10 @@ public class VaadinServlet extends HttpServlet implements Constants { } catch (IOException e) { // NOP: will be still tried with non gzipped version } catch (Exception e) { - getLogger().log( - Level.FINE, + getLogger().log(Level.FINE, "Unexpected exception looking for gzipped version of resource " - + urlStr, e); + + urlStr, + e); } } if (is == null) { @@ -942,13 +943,13 @@ public class VaadinServlet extends HttpServlet implements Constants { * is served if it exists. It is assumed that the compression method used is * gzip. If this method returns false or a compressed version is not found, * the original URL is used. - * + * * The base implementation of this method returns true if and only if the * request indicates that the client accepts gzip compressed responses and * the filename extension of the requested resource is .js, .css, or .html. - * + * * @since 7.5.0 - * + * * @param request * the request for the resource * @param url @@ -959,10 +960,8 @@ public class VaadinServlet extends HttpServlet implements Constants { protected boolean allowServePrecompressedResource( HttpServletRequest request, String url) { String accept = request.getHeader("Accept-Encoding"); - return accept != null - && accept.contains("gzip") - && (url.endsWith(".js") || url.endsWith(".css") || url - .endsWith(".html")); + return accept != null && accept.contains("gzip") && (url.endsWith(".js") + || url.endsWith(".css") || url.endsWith(".html")); } private void streamContent(HttpServletResponse response, InputStream is) @@ -978,7 +977,7 @@ public class VaadinServlet extends HttpServlet implements Constants { /** * Finds the given resource from the web content folder or using the class * loader. - * + * * @since 7.7 * @param filename * The file to find, starting with a "/" @@ -1018,10 +1017,9 @@ public class VaadinServlet extends HttpServlet implements Constants { // security check: do not permit navigation out of the VAADIN // directory if (!isAllowedVAADINResourceUrl(request, scssUrl)) { - getLogger() - .log(Level.INFO, - "Requested resource [{0}] not accessible in the VAADIN directory or access to it is forbidden.", - filename); + getLogger().log(Level.INFO, + "Requested resource [{0}] not accessible in the VAADIN directory or access to it is forbidden.", + filename); response.setStatus(HttpServletResponse.SC_FORBIDDEN); // Handled, return true so no further processing is done @@ -1029,10 +1027,9 @@ public class VaadinServlet extends HttpServlet implements Constants { } if (getService().getDeploymentConfiguration().isProductionMode()) { // This is not meant for production mode. - getLogger() - .log(Level.INFO, - "Request for {0} not handled by sass compiler while in production mode", - filename); + getLogger().log(Level.INFO, + "Request for {0} not handled by sass compiler while in production mode", + filename); response.setStatus(HttpServletResponse.SC_NOT_FOUND); // Handled, return true so no further processing is done return true; @@ -1110,10 +1107,9 @@ public class VaadinServlet extends HttpServlet implements Constants { } if (scss == null) { - getLogger() - .log(Level.WARNING, - "Scss file {0} exists but ScssStylesheet was not able to find it", - scssFilename); + getLogger().log(Level.WARNING, + "Scss file {0} exists but ScssStylesheet was not able to find it", + scssFilename); return null; } try { @@ -1132,19 +1128,19 @@ public class VaadinServlet extends HttpServlet implements Constants { /** * Check whether a URL obtained from a classloader refers to a valid static * resource in the directory VAADIN. - * + * * Warning: Overriding of this method is not recommended, but is possible to * support non-default classloaders or servers that may produce URLs * different from the normal ones. The method prototype may change in the * future. Care should be taken not to expose class files or other resources * outside the VAADIN directory if the method is overridden. - * + * * @param request * @param resourceUrl * @return - * + * * @since 6.6.7 - * + * * @deprecated As of 7.0. Will likely change or be removed in a future * version */ @@ -1162,10 +1158,9 @@ public class VaadinServlet extends HttpServlet implements Constants { // loader sees it. if (!resourceUrl.getPath().contains("!/VAADIN/")) { - getLogger() - .log(Level.INFO, - "Blocked attempt to access a JAR entry not starting with /VAADIN/: {0}", - resourceUrl); + getLogger().log(Level.INFO, + "Blocked attempt to access a JAR entry not starting with /VAADIN/: {0}", + resourceUrl); return false; } getLogger().log(Level.FINE, @@ -1195,7 +1190,7 @@ public class VaadinServlet extends HttpServlet implements Constants { * Checks if the browser has an up to date cached version of requested * resource. Currently the check is performed using the "If-Modified-Since" * header. Could be expanded if needed. - * + * * @param request * The HttpServletRequest from the browser. * @param resourceLastModifiedTimestamp @@ -1234,10 +1229,10 @@ public class VaadinServlet extends HttpServlet implements Constants { } /** - * + * * @author Vaadin Ltd * @since 7.0 - * + * * @deprecated As of 7.0. This is no longer used and only provided for * backwards compatibility. Each {@link RequestHandler} can * individually decide whether it wants to handle a request or @@ -1251,7 +1246,7 @@ public class VaadinServlet extends HttpServlet implements Constants { /** * @param request * @return - * + * * @deprecated As of 7.0. This is no longer used and only provided for * backwards compatibility. Each {@link RequestHandler} can * individually decide whether it wants to handle a request or @@ -1279,13 +1274,13 @@ public class VaadinServlet extends HttpServlet implements Constants { } protected boolean isStaticResourceRequest(HttpServletRequest request) { - return request.getRequestURI().startsWith( - request.getContextPath() + "/VAADIN/"); + return request.getRequestURI() + .startsWith(request.getContextPath() + "/VAADIN/"); } /** * Remove any heading or trailing "what" from the "string". - * + * * @param string * @param what * @return @@ -1304,7 +1299,7 @@ public class VaadinServlet extends HttpServlet implements Constants { /** * Write a redirect response to the main page of the application. - * + * * @param request * @param response * @throws IOException @@ -1319,32 +1314,33 @@ public class VaadinServlet extends HttpServlet implements Constants { /** * Gets the current application URL from request. - * + * * @param request * the HTTP request. * @throws MalformedURLException * if the application is denied access to the persistent data * store represented by the given URL. - * + * * @deprecated As of 7.0. Will likely change or be removed in a future * version */ @Deprecated protected URL getApplicationUrl(HttpServletRequest request) throws MalformedURLException { - final URL reqURL = new URL( - (request.isSecure() ? "https://" : "http://") - + request.getServerName() - + ((request.isSecure() && request.getServerPort() == 443) - || (!request.isSecure() && request - .getServerPort() == 80) ? "" : ":" - + request.getServerPort()) - + request.getRequestURI()); + final URL reqURL = new URL((request.isSecure() ? "https://" : "http://") + + request.getServerName() + + ((request.isSecure() && request.getServerPort() == 443) + || (!request.isSecure() + && request.getServerPort() == 80) ? "" + : ":" + request.getServerPort()) + + request.getRequestURI()); String servletPath = ""; - if (request.getAttribute("javax.servlet.include.servlet_path") != null) { + if (request + .getAttribute("javax.servlet.include.servlet_path") != null) { // this is an include request - servletPath = request.getAttribute( - "javax.servlet.include.context_path").toString() + servletPath = request + .getAttribute("javax.servlet.include.context_path") + .toString() + request .getAttribute("javax.servlet.include.servlet_path"); @@ -1362,7 +1358,7 @@ public class VaadinServlet extends HttpServlet implements Constants { /* * (non-Javadoc) - * + * * @see javax.servlet.GenericServlet#destroy() */ @Override @@ -1375,10 +1371,9 @@ public class VaadinServlet extends HttpServlet implements Constants { String scssFileName = cacheEntry.getScssFileName(); if (scssFileName == null) { if (!scssCompileWarWarningEmitted) { - getLogger() - .warning( - "Could not persist scss cache because no real file was found for the compiled scss file. " - + "This might happen e.g. if serving the scss file directly from a .war file."); + getLogger().warning( + "Could not persist scss cache because no real file was found for the compiled scss file. " + + "This might happen e.g. if serving the scss file directly from a .war file."); scssCompileWarWarningEmitted = true; } return; @@ -1390,7 +1385,8 @@ public class VaadinServlet extends HttpServlet implements Constants { String cacheEntryJsonString = cacheEntry.asJson(); try { - writeFile(cacheEntryJsonString, cacheFile, Charset.forName("UTF-8")); + writeFile(cacheEntryJsonString, cacheFile, + Charset.forName("UTF-8")); } catch (IOException e) { getLogger().log(Level.WARNING, "Error persisting scss cache " + cacheFile, e); @@ -1430,16 +1426,17 @@ public class VaadinServlet extends HttpServlet implements Constants { } private static File getScssCacheFile(File scssFile) { - return new File(scssFile.getParentFile(), scssFile.getName() + ".cache"); + return new File(scssFile.getParentFile(), + scssFile.getName() + ".cache"); } /** - * Escapes characters to html entities. An exception is made for some - * "safe characters" to keep the text somewhat readable. - * + * Escapes characters to html entities. An exception is made for some "safe + * characters" to keep the text somewhat readable. + * * @param unsafe * @return a safe string to be added inside an html tag - * + * * @deprecated As of 7.0. Will likely change or be removed in a future * version */ diff --git a/server/src/main/java/com/vaadin/server/VaadinServletRequest.java b/server/src/main/java/com/vaadin/server/VaadinServletRequest.java index c68eefedb1..9aec546cba 100644 --- a/server/src/main/java/com/vaadin/server/VaadinServletRequest.java +++ b/server/src/main/java/com/vaadin/server/VaadinServletRequest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -22,21 +22,21 @@ import javax.servlet.http.HttpSession; /** * Wrapper for {@link HttpServletRequest}. - * + * * @author Vaadin Ltd. * @since 7.0 - * + * * @see VaadinRequest * @see VaadinServletResponse */ -public class VaadinServletRequest extends HttpServletRequestWrapper implements - VaadinRequest { +public class VaadinServletRequest extends HttpServletRequestWrapper + implements VaadinRequest { private final VaadinServletService vaadinService; /** * Wraps a http servlet request and associates with a vaadin service - * + * * @param request * the http servlet request to wrap * @param vaadinService @@ -65,7 +65,7 @@ public class VaadinServletRequest extends HttpServletRequestWrapper implements /** * Gets the original, unwrapped HTTP servlet request. - * + * * @return the servlet request */ public HttpServletRequest getHttpServletRequest() { diff --git a/server/src/main/java/com/vaadin/server/VaadinServletResponse.java b/server/src/main/java/com/vaadin/server/VaadinServletResponse.java index fd688a594c..74f522b777 100644 --- a/server/src/main/java/com/vaadin/server/VaadinServletResponse.java +++ b/server/src/main/java/com/vaadin/server/VaadinServletResponse.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,21 +21,21 @@ import javax.servlet.http.HttpServletResponseWrapper; /** * Wrapper for {@link HttpServletResponse}. - * + * * @author Vaadin Ltd. * @since 7.0 - * + * * @see VaadinResponse * @see VaadinServletRequest */ -public class VaadinServletResponse extends HttpServletResponseWrapper implements - VaadinResponse { +public class VaadinServletResponse extends HttpServletResponseWrapper + implements VaadinResponse { private VaadinServletService vaadinService; /** * Wraps a http servlet response and an associated vaadin service - * + * * @param response * the http servlet response to wrap * @param vaadinService @@ -49,7 +49,7 @@ public class VaadinServletResponse extends HttpServletResponseWrapper implements /** * Gets the original unwrapped HttpServletResponse - * + * * @return the unwrapped response */ public HttpServletResponse getHttpServletResponse() { @@ -68,10 +68,10 @@ public class VaadinServletResponse extends HttpServletResponseWrapper implements response.setHeader("Pragma", "no-cache"); response.setDateHeader("Expires", 0); } else { - response.setHeader("Cache-Control", "max-age=" + milliseconds - / 1000); - response.setDateHeader("Expires", System.currentTimeMillis() - + milliseconds); + response.setHeader("Cache-Control", + "max-age=" + milliseconds / 1000); + response.setDateHeader("Expires", + System.currentTimeMillis() + milliseconds); // Required to apply caching in some Tomcats response.setHeader("Pragma", "cache"); } diff --git a/server/src/main/java/com/vaadin/server/VaadinServletService.java b/server/src/main/java/com/vaadin/server/VaadinServletService.java index 7025d5f491..5091aac9a4 100644 --- a/server/src/main/java/com/vaadin/server/VaadinServletService.java +++ b/server/src/main/java/com/vaadin/server/VaadinServletService.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -56,10 +56,9 @@ public class VaadinServletService extends VaadinService { // Atmosphere init failed. Push won't work but we don't throw a // service exception as we don't want to prevent non-push // applications from working - getLogger() - .log(Level.WARNING, - "Error initializing Atmosphere. Push will not work.", - e); + getLogger().log(Level.WARNING, + "Error initializing Atmosphere. Push will not work.", + e); } } return handlers; @@ -67,7 +66,7 @@ public class VaadinServletService extends VaadinService { /** * Retrieves a reference to the servlet associated with this service. - * + * * @return A reference to the VaadinServlet this service is using */ public VaadinServlet getServlet() { @@ -100,7 +99,7 @@ public class VaadinServletService extends VaadinService { /** * Gets a relative path that cancels the provided path. This essentially * adds one .. for each part of the path to cancel. - * + * * @param pathToCancel * the path that should be canceled * @return a relative path that cancels out the provided path segment @@ -118,8 +117,8 @@ public class VaadinServletService extends VaadinService { @Override public String getConfiguredWidgetset(VaadinRequest request) { - return getDeploymentConfiguration().getWidgetset( - VaadinServlet.DEFAULT_WIDGETSET); + return getDeploymentConfiguration() + .getWidgetset(VaadinServlet.DEFAULT_WIDGETSET); } @Override @@ -140,8 +139,8 @@ public class VaadinServletService extends VaadinService { @Override public File getBaseDirectory() { - final String realPath = VaadinServlet.getResourcePath( - servlet.getServletContext(), "/"); + final String realPath = VaadinServlet + .getResourcePath(servlet.getServletContext(), "/"); if (realPath == null) { return null; } @@ -172,8 +171,8 @@ public class VaadinServletService extends VaadinService { && !ServletPortletHelper.isFileUploadRequest(request) && !ServletPortletHelper.isHeartbeatRequest(request) && !ServletPortletHelper.isPublishedFileRequest(request) - && !ServletPortletHelper.isUIDLRequest(request) && !ServletPortletHelper - .isPushRequest(request)); + && !ServletPortletHelper.isUIDLRequest(request) + && !ServletPortletHelper.isPushRequest(request)); } @Override @@ -211,10 +210,9 @@ public class VaadinServletService extends VaadinService { // security check: do not permit navigation out of the VAADIN // directory if (!servlet.isAllowedVAADINResourceUrl(null, resourceUrl)) { - throw new IOException( - String.format( - "Requested resource [{0}] not accessible in the VAADIN directory or access to it is forbidden.", - filename)); + throw new IOException(String.format( + "Requested resource [{0}] not accessible in the VAADIN directory or access to it is forbidden.", + filename)); } return resourceUrl.openStream(); @@ -228,8 +226,8 @@ public class VaadinServletService extends VaadinService { Class uiClass) { String appId = null; try { - URL appUrl = getServlet().getApplicationUrl( - (VaadinServletRequest) request); + URL appUrl = getServlet() + .getApplicationUrl((VaadinServletRequest) request); appId = appUrl.getPath(); } catch (MalformedURLException e) { // Just ignore problem here diff --git a/server/src/main/java/com/vaadin/server/VaadinSession.java b/server/src/main/java/com/vaadin/server/VaadinSession.java index 304dd4bec6..b0a99c1de9 100644 --- a/server/src/main/java/com/vaadin/server/VaadinSession.java +++ b/server/src/main/java/com/vaadin/server/VaadinSession.java @@ -115,7 +115,7 @@ public class VaadinSession implements HttpSessionBindingListener, Serializable { * deadlocks unless implemented very carefully. get(long, TimeUnit) * does not have the same detection since a sensible timeout should * avoid completely locking up the application. - * + * * Even though no deadlock could occur after the runnable has been * run, the check is always done as the deterministic behavior makes * it easier to detect potential problems. @@ -204,9 +204,9 @@ public class VaadinSession implements HttpSessionBindingListener, Serializable { private static final Method BOOTSTRAP_FRAGMENT_METHOD = ReflectTools .findMethod(BootstrapListener.class, "modifyBootstrapFragment", BootstrapFragmentResponse.class); - private static final Method BOOTSTRAP_PAGE_METHOD = ReflectTools - .findMethod(BootstrapListener.class, "modifyBootstrapPage", - BootstrapPageResponse.class); + private static final Method BOOTSTRAP_PAGE_METHOD = ReflectTools.findMethod( + BootstrapListener.class, "modifyBootstrapPage", + BootstrapPageResponse.class); /** * Configuration for the session. @@ -299,17 +299,17 @@ public class VaadinSession implements HttpSessionBindingListener, Serializable { // closing // Notify the service if (service == null) { - getLogger() - .warning( - "A VaadinSession instance not associated to any service is getting unbound. " - + "Session destroy events will not be fired and UIs in the session will not get detached. " - + "This might happen if a session is deserialized but never used before it expires."); + getLogger().warning( + "A VaadinSession instance not associated to any service is getting unbound. " + + "Session destroy events will not be fired and UIs in the session will not get detached. " + + "This might happen if a session is deserialized but never used before it expires."); } else if (VaadinService.getCurrentRequest() != null && getCurrent() == this) { assert hasLock(); // Ignore if the session is being moved to a different backing // session or if GAEVaadinServlet is doing its normal cleanup. - if (getAttribute(VaadinService.PRESERVE_UNBOUND_SESSION_ATTRIBUTE) == Boolean.TRUE) { + if (getAttribute( + VaadinService.PRESERVE_UNBOUND_SESSION_ATTRIBUTE) == Boolean.TRUE) { return; } @@ -506,7 +506,8 @@ public class VaadinSession implements HttpSessionBindingListener, Serializable { * Updates the transient session lock from VaadinService. */ private void refreshLock() { - assert lock == null || lock == service.getSessionLock(session) : "Cannot change the lock from one instance to another"; + assert lock == null || lock == service.getSessionLock( + session) : "Cannot change the lock from one instance to another"; assert hasLock(service, session); lock = service.getSessionLock(session); } @@ -892,7 +893,8 @@ public class VaadinSession implements HttpSessionBindingListener, Serializable { * * @since 7.0.0 */ - public GlobalResourceHandler getGlobalResourceHandler(boolean createOnDemand) { + public GlobalResourceHandler getGlobalResourceHandler( + boolean createOnDemand) { assert hasLock(); if (globalResourceHandler == null && createOnDemand) { globalResourceHandler = new GlobalResourceHandler(); @@ -990,7 +992,8 @@ public class VaadinSession implements HttpSessionBindingListener, Serializable { getService().runPendingAccessTasks(this); for (UI ui : getUIs()) { - if (ui.getPushConfiguration().getPushMode() == PushMode.AUTOMATIC) { + if (ui.getPushConfiguration() + .getPushMode() == PushMode.AUTOMATIC) { Map, CurrentInstance> oldCurrent = CurrentInstance .setCurrent(ui); try { @@ -1052,7 +1055,8 @@ public class VaadinSession implements HttpSessionBindingListener, Serializable { * null clears the stored value. *

        * The fully qualified name of the type is used as the name when storing the - * value. The outcome of calling this method is thus the same as if calling
        + * value. The outcome of calling this method is thus the same as if + * calling
        *
        * setAttribute(type.getName(), value); * @@ -1071,9 +1075,8 @@ public class VaadinSession implements HttpSessionBindingListener, Serializable { throw new IllegalArgumentException("type can not be null"); } if (value != null && !type.isInstance(value)) { - throw new IllegalArgumentException("value of type " - + type.getName() + " expected but got " - + value.getClass().getName()); + throw new IllegalArgumentException("value of type " + type.getName() + + " expected but got " + value.getClass().getName()); } setAttribute(type.getName(), value); } @@ -1104,7 +1107,8 @@ public class VaadinSession implements HttpSessionBindingListener, Serializable { * null is returned. *

        * The fully qualified name of the type is used as the name when getting the - * value. The outcome of calling this method is thus the same as if calling
        + * value. The outcome of calling this method is thus the same as if + * calling
        *
        * getAttribute(type.getName()); * @@ -1164,8 +1168,8 @@ public class VaadinSession implements HttpSessionBindingListener, Serializable { Integer previousUiId = embedIdMap.put(embedId, uiId); if (previousUiId != null) { UI previousUi = uIs.get(previousUiId); - assert previousUi != null - && embedId.equals(previousUi.getEmbedId()) : "UI id map and embed id map not in sync"; + assert previousUi != null && embedId.equals(previousUi + .getEmbedId()) : "UI id map and embed id map not in sync"; // Will fire cleanup events at the end of the request handling. previousUi.close(); @@ -1409,8 +1413,8 @@ public class VaadinSession implements HttpSessionBindingListener, Serializable { * Override default deserialization logic to account for transient * {@link #pendingAccessQueue}. */ - private void readObject(ObjectInputStream stream) throws IOException, - ClassNotFoundException { + private void readObject(ObjectInputStream stream) + throws IOException, ClassNotFoundException { Map, CurrentInstance> old = CurrentInstance.setCurrent(this); try { stream.defaultReadObject(); @@ -1465,7 +1469,7 @@ public class VaadinSession implements HttpSessionBindingListener, Serializable { * date. *

        * Called internally by the framework. - * + * * @since 7.6 * @param wrappedSession * the session this VaadinSession is stored in diff --git a/server/src/main/java/com/vaadin/server/VariableOwner.java b/server/src/main/java/com/vaadin/server/VariableOwner.java index 87a820e8b7..5588a40b29 100644 --- a/server/src/main/java/com/vaadin/server/VariableOwner.java +++ b/server/src/main/java/com/vaadin/server/VariableOwner.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -29,7 +29,7 @@ import com.vaadin.ui.LegacyComponent; * application, and the components owning those variables may then process those * changes. *

        - * + * * @author Vaadin Ltd. * @since 3.0 * @deprecated As of 7.0. Only provided to ease porting of Vaadin 6 components. @@ -42,7 +42,7 @@ 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. @@ -56,7 +56,7 @@ public interface VariableOwner extends Serializable { * 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 */ @@ -68,7 +68,7 @@ public interface VariableOwner extends Serializable { * 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 @@ -76,7 +76,7 @@ public interface VariableOwner extends Serializable { * 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. */ diff --git a/server/src/main/java/com/vaadin/server/ViewportGenerator.java b/server/src/main/java/com/vaadin/server/ViewportGenerator.java index 33cc1341af..852b2b55dc 100644 --- a/server/src/main/java/com/vaadin/server/ViewportGenerator.java +++ b/server/src/main/java/com/vaadin/server/ViewportGenerator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -19,17 +19,17 @@ import java.io.Serializable; /** * Callback for generating a viewport tag content based on a request. - * + * * @see ViewportGenerator - * + * * @since 7.4 - * + * * @author Vaadin Ltd */ public interface ViewportGenerator extends Serializable { /** * Generates a viewport tag based on a request. - * + * * @param request * the request for which to generate a viewport tag * @return the viewport tag content diff --git a/server/src/main/java/com/vaadin/server/WebBrowser.java b/server/src/main/java/com/vaadin/server/WebBrowser.java index 5b7d795793..cb2f7686d9 100644 --- a/server/src/main/java/com/vaadin/server/WebBrowser.java +++ b/server/src/main/java/com/vaadin/server/WebBrowser.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -27,7 +27,7 @@ import com.vaadin.shared.VBrowserDetails; * Class that provides information about the web browser the user is using. * Provides information such as browser name and version, screen resolution and * IP address. - * + * * @author Vaadin Ltd. */ public class WebBrowser implements Serializable { @@ -50,7 +50,7 @@ public class WebBrowser implements Serializable { /** * Gets the height of the screen in pixels. This is the full screen * resolution and not the height available for the application. - * + * * @return the height of the screen in pixels. */ public int getScreenHeight() { @@ -60,7 +60,7 @@ public class WebBrowser implements Serializable { /** * Gets the width of the screen in pixels. This is the full screen * resolution and not the width available for the application. - * + * * @return the width of the screen in pixels. */ public int getScreenWidth() { @@ -69,7 +69,7 @@ public class WebBrowser implements Serializable { /** * Get the browser user-agent string. - * + * * @return The raw browser userAgent string */ public String getBrowserApplication() { @@ -79,7 +79,7 @@ public class WebBrowser implements Serializable { /** * Gets the IP-address of the web browser. If the application is running * inside a portlet, this method will return null. - * + * * @return IP-address in 1.12.123.123 -format */ public String getAddress() { @@ -98,7 +98,7 @@ public class WebBrowser implements Serializable { /** * Tests whether the user is using Firefox. - * + * * @return true if the user is using Firefox, false if the user is not using * Firefox or if no information on the browser is present */ @@ -112,7 +112,7 @@ public class WebBrowser implements Serializable { /** * Tests whether the user is using Internet Explorer. - * + * * @return true if the user is using Internet Explorer, false if the user is * not using Internet Explorer or if no information on the browser * is present @@ -127,7 +127,7 @@ public class WebBrowser implements Serializable { /** * Tests whether the user is using Edge. - * + * * @since 7.5.3 * @return true if the user is using Edge, false if the user is not using * Edge or if no information on the browser is present @@ -142,7 +142,7 @@ public class WebBrowser implements Serializable { /** * Tests whether the user is using Safari. - * + * * @return true if the user is using Safari, false if the user is not using * Safari or if no information on the browser is present */ @@ -156,7 +156,7 @@ public class WebBrowser implements Serializable { /** * Tests whether the user is using Opera. - * + * * @return true if the user is using Opera, false if the user is not using * Opera or if no information on the browser is present */ @@ -170,7 +170,7 @@ public class WebBrowser implements Serializable { /** * Tests whether the user is using Chrome. - * + * * @return true if the user is using Chrome, false if the user is not using * Chrome or if no information on the browser is present */ @@ -184,7 +184,7 @@ public class WebBrowser implements Serializable { /** * Tests whether the user is using Chrome Frame. - * + * * @return true if the user is using Chrome Frame, false if the user is not * using Chrome or if no information on the browser is present */ @@ -198,7 +198,7 @@ public class WebBrowser implements Serializable { /** * Tests whether the user's browser is Chrome Frame capable. - * + * * @return true if the user can use Chrome Frame, false if the user can not * or if no information on the browser is present */ @@ -212,12 +212,12 @@ public class WebBrowser implements Serializable { /** * Gets the major version of the browser the user is using. - * + * *

        * Note that Internet Explorer in IE7 compatibility mode might return 8 in * some cases even though it should return 7. *

        - * + * * @return The major version of the browser or -1 if not known. */ public int getBrowserMajorVersion() { @@ -230,9 +230,9 @@ public class WebBrowser implements Serializable { /** * Gets the minor version of the browser the user is using. - * + * * @see #getBrowserMajorVersion() - * + * * @return The minor version of the browser or -1 if not known. */ public int getBrowserMinorVersion() { @@ -245,7 +245,7 @@ public class WebBrowser implements Serializable { /** * Tests whether the user is using Linux. - * + * * @return true if the user is using Linux, false if the user is not using * Linux or if no information on the browser is present */ @@ -255,7 +255,7 @@ public class WebBrowser implements Serializable { /** * Tests whether the user is using Mac OS X. - * + * * @return true if the user is using Mac OS X, false if the user is not * using Mac OS X or if no information on the browser is present */ @@ -265,7 +265,7 @@ public class WebBrowser implements Serializable { /** * Tests whether the user is using Windows. - * + * * @return true if the user is using Windows, false if the user is not using * Windows or if no information on the browser is present */ @@ -275,7 +275,7 @@ public class WebBrowser implements Serializable { /** * Tests whether the user is using Windows Phone. - * + * * @return true if the user is using Windows Phone, false if the user is not * using Windows Phone or if no information on the browser is * present @@ -287,7 +287,7 @@ public class WebBrowser implements Serializable { /** * Tests if the browser is run on Android. - * + * * @return true if run on Android false if the user is not using Android or * if no information on the browser is present */ @@ -297,7 +297,7 @@ public class WebBrowser implements Serializable { /** * Tests if the browser is run in iOS. - * + * * @return true if run in iOS false if the user is not using iOS or if no * information on the browser is present */ @@ -307,7 +307,7 @@ public class WebBrowser implements Serializable { /** * Tests if the browser is run on IPhone. - * + * * @return true if run on IPhone false if the user is not using IPhone or if * no information on the browser is present * @since 7.3.3 @@ -318,7 +318,7 @@ public class WebBrowser implements Serializable { /** * Tests if the browser is run on IPad. - * + * * @return true if run on IPad false if the user is not using IPad or if no * information on the browser is present * @since 7.3.3 @@ -332,7 +332,7 @@ public class WebBrowser implements Serializable { * This includes possible daylight saving adjustments, to figure out which * TimeZone the user actually might be in, see * {@link #getRawTimezoneOffset()}. - * + * * @see WebBrowser#getRawTimezoneOffset() * @return timezone offset in milliseconds, 0 if not available */ @@ -354,7 +354,7 @@ public class WebBrowser implements Serializable { * currently have daylight saving time, or in a zone that never has daylight * saving time. *

        - * + * * @return timezone offset in milliseconds excluding DST, 0 if not available */ public int getRawTimezoneOffset() { @@ -364,7 +364,7 @@ public class WebBrowser implements Serializable { /** * Returns the offset in milliseconds between the browser's GMT TimeZone and * DST. - * + * * @return the number of milliseconds that the TimeZone shifts when DST is * in effect */ @@ -375,7 +375,7 @@ public class WebBrowser implements Serializable { /** * Returns whether daylight saving time (DST) is currently in effect in the * region of the browser or not. - * + * * @return true if the browser resides at a location that currently is in * DST */ @@ -391,7 +391,7 @@ public class WebBrowser implements Serializable { *

        * To get the actual date and time shown in the end users computer, you can * do something like: - * + * *

              * WebBrowser browser = ...;
              * SimpleTimeZone timeZone = new SimpleTimeZone(browser.getTimezoneOffset(), "Fake client time zone");
        @@ -399,7 +399,7 @@ public class WebBrowser implements Serializable {
              * format.setTimeZone(timeZone);
              * myLabel.setValue(format.format(browser.getCurrentDate()));
              * 
        - * + * * @return the current date and time of the browser. * @see #isDSTInEffect() * @see #getDSTSavings() @@ -419,7 +419,7 @@ public class WebBrowser implements Serializable { /** * For internal use by VaadinServlet/VaadinPortlet only. Updates all * properties in the class according to the given information. - * + * * @param sw * Screen width * @param sh @@ -489,7 +489,7 @@ public class WebBrowser implements Serializable { /** * For internal use by VaadinServlet/VaadinPortlet only. Updates all * properties in the class according to the given information. - * + * * @param request * the Vaadin request to read the information from */ @@ -508,8 +508,7 @@ public class WebBrowser implements Serializable { if (request.getParameter("v-sw") != null) { updateClientSideDetails(request.getParameter("v-sw"), - request.getParameter("v-sh"), - request.getParameter("v-tzo"), + request.getParameter("v-sh"), request.getParameter("v-tzo"), request.getParameter("v-rtzo"), request.getParameter("v-dstd"), request.getParameter("v-dston"), @@ -522,11 +521,11 @@ public class WebBrowser implements Serializable { * Checks if the browser is so old that it simply won't work with a Vaadin * application. Can be used to redirect to an alternative page, show * alternative content or similar. - * + * * When this method returns true chances are very high that the browser * won't work and it does not make sense to direct the user to the Vaadin * application. - * + * * @return true if the browser won't work, false if not the browser is * supported or might work */ diff --git a/server/src/main/java/com/vaadin/server/WidgetsetInfoImpl.java b/server/src/main/java/com/vaadin/server/WidgetsetInfoImpl.java index a887b0b7ac..373bc05b4c 100644 --- a/server/src/main/java/com/vaadin/server/WidgetsetInfoImpl.java +++ b/server/src/main/java/com/vaadin/server/WidgetsetInfoImpl.java @@ -24,8 +24,8 @@ package com.vaadin.server; * BootstrapHandler. *

        * This class is intended primarily for internal use. It is recommended to - * implement WidgetsetInfo directly rather than extending or using this - * class outside the framework, and this class is subject to changes. + * implement WidgetsetInfo directly rather than extending or using this class + * outside the framework, and this class is subject to changes. * * @since 7.7 */ diff --git a/server/src/main/java/com/vaadin/server/WrappedHttpSession.java b/server/src/main/java/com/vaadin/server/WrappedHttpSession.java index db4318e37a..45eb18faa1 100644 --- a/server/src/main/java/com/vaadin/server/WrappedHttpSession.java +++ b/server/src/main/java/com/vaadin/server/WrappedHttpSession.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,7 +25,7 @@ import javax.servlet.http.HttpSession; /** * Wrapper for {@link HttpSession}. - * + * * @author Vaadin Ltd * @since 7.0.0 * @see WrappedSession @@ -36,7 +36,7 @@ public class WrappedHttpSession implements WrappedSession { /** * Creates a new wrapped http session. - * + * * @param session * the http session to wrap. */ @@ -61,7 +61,7 @@ public class WrappedHttpSession implements WrappedSession { /** * Gets the wrapped {@link HttpSession}. - * + * * @return the wrapped http session */ public HttpSession getHttpSession() { diff --git a/server/src/main/java/com/vaadin/server/WrappedPortletSession.java b/server/src/main/java/com/vaadin/server/WrappedPortletSession.java index 9f0f1ac10f..fa7dbe7f41 100644 --- a/server/src/main/java/com/vaadin/server/WrappedPortletSession.java +++ b/server/src/main/java/com/vaadin/server/WrappedPortletSession.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -22,7 +22,7 @@ import javax.portlet.PortletSession; /** * Wrapper for {@link PortletSession}. - * + * * @author Vaadin Ltd * @since 7.0.0 * @see WrappedSession @@ -33,7 +33,7 @@ public class WrappedPortletSession implements WrappedSession { /** * Creates a new wrapped portlet session. - * + * * @param session * the portlet session to wrap. */ @@ -68,11 +68,11 @@ public class WrappedPortletSession implements WrappedSession { * scope is unknown to the container. * @exception java.lang.IllegalArgumentException * if name is null. - * + * * @see PortletSession#getAttribute(String, int) * @see PortletSession#PORTLET_SCOPE * @see PortletSession#APPLICATION_SCOPE - * + * * @since 7.6 */ public Object getAttribute(String name, int scope) { @@ -108,11 +108,11 @@ public class WrappedPortletSession implements WrappedSession { * @exception java.lang.IllegalArgumentException * if name is null or scope is unknown to the * container. - * + * * @see PortletSession#setAttribute(String, Object, int) * @see PortletSession#PORTLET_SCOPE * @see PortletSession#APPLICATION_SCOPE - * + * * @since 7.6 */ public void setAttribute(String name, Object value, int scope) { @@ -121,7 +121,7 @@ public class WrappedPortletSession implements WrappedSession { /** * Gets the wrapped {@link PortletSession}. - * + * * @return the wrapped portlet session */ public PortletSession getPortletSession() { @@ -136,19 +136,19 @@ public class WrappedPortletSession implements WrappedSession { /** * Gets the current set of attribute names bound to this session in the * given scope. - * + * * @param scope * session scope of the attribute names * @return an unmodifiable set of the current attribute names in the given * scope - * + * * @see PortletSession#getAttributeNames() - * + * * @since 7.6 */ public Set getAttributeNames(int scope) { - return WrappedHttpSession.enumerationToSet(session - .getAttributeNames(scope)); + return WrappedHttpSession + .enumerationToSet(session.getAttributeNames(scope)); } @Override @@ -185,7 +185,7 @@ public class WrappedPortletSession implements WrappedSession { * Removes the object bound with the specified name and the given scope from * this session. If the session does not have an object bound with the * specified name, this method does nothing. - * + * * @param name * the name of the object to be removed from this session * @param scope @@ -199,7 +199,7 @@ public class WrappedPortletSession implements WrappedSession { * @see PortletSession#removeAttribute(String, int) * @see PortletSession#PORTLET_SCOPE * @see PortletSession#APPLICATION_SCOPE - * + * * @since 7.6 */ public void removeAttribute(String name, int scope) { diff --git a/server/src/main/java/com/vaadin/server/WrappedSession.java b/server/src/main/java/com/vaadin/server/WrappedSession.java index b839e5d87a..b2b74a64e1 100644 --- a/server/src/main/java/com/vaadin/server/WrappedSession.java +++ b/server/src/main/java/com/vaadin/server/WrappedSession.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,8 +25,8 @@ import javax.servlet.http.HttpSession; /** * A generic session, wrapping a more specific session implementation, e.g. * {@link HttpSession} or {@link PortletSession}. - * - * + * + * * @author Vaadin Ltd * @version @VERSION@ * @since 7.0.0 @@ -35,10 +35,10 @@ public interface WrappedSession extends Serializable { /** * Returns the maximum time interval, in seconds, that this session will be * kept open between client accesses. - * + * * @return an integer specifying the number of seconds this session remains * open between client requests - * + * * @see javax.servlet.http.HttpSession#getMaxInactiveInterval() * @see javax.portlet.PortletSession#getMaxInactiveInterval() */ @@ -46,12 +46,12 @@ public interface WrappedSession extends Serializable { /** * Gets an attribute from this session. - * + * * @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) */ @@ -59,12 +59,12 @@ public interface WrappedSession extends Serializable { /** * Saves an attribute value in this session. - * + * * @param name * the name of the attribute * @param value * the attribute value - * + * * @see javax.servlet.http.HttpSession#setAttribute(String, Object) * @see javax.portlet.PortletSession#setAttribute(String, Object) */ @@ -72,9 +72,9 @@ public interface WrappedSession extends Serializable { /** * Gets the current set of attribute names stored in this session. - * + * * @return an unmodifiable set of the current attribute names - * + * * @see HttpSession#getAttributeNames() * @see PortletSession#getAttributeNames() */ @@ -82,7 +82,7 @@ public interface WrappedSession extends Serializable { /** * Invalidates this session then unbinds any objects bound to it. - * + * * @see HttpSession#invalidate() * @see PortletSession#invalidate() */ @@ -90,9 +90,9 @@ public interface WrappedSession extends Serializable { /** * Gets a string with a unique identifier for the session. - * + * * @return a unique session id string - * + * * @see HttpSession#getId() * @see PortletSession#getId() */ @@ -101,10 +101,10 @@ public interface WrappedSession extends Serializable { /** * Returns the time when this session was created, measured in milliseconds * since midnight January 1, 1970 GMT. - * + * * @return a long specifying when this session was created, expressed in * milliseconds since 1/1/1970 GMT - * + * * @throws IllegalStateException * if this method is called on an invalidated session * @see HttpSession#getCreationTime() @@ -119,14 +119,14 @@ public interface WrappedSession extends Serializable { *

        * Actions that your application takes, such as getting or setting a value * associated with the session, do not affect the access time. - * + * * @return a long representing the last time the client sent a request * associated with this session, expressed in milliseconds since * 1/1/1970 GMT - * + * * @throws IllegalStateException * if this method is called on an invalidated session - * + * * @see HttpSession#getLastAccessedTime() * @see PortletSession#getLastAccessedTime() */ @@ -137,7 +137,7 @@ public interface WrappedSession extends Serializable { * client chooses not to join the session. For example, if the server used * only cookie-based sessions, and the client had disabled the use of * cookies, then a session would be new on each request. - * + * * @return true if the server has created a session, but the client has not * yet joined * @throws IllegalStateException @@ -151,7 +151,7 @@ public interface WrappedSession extends Serializable { * Removes the object bound with the specified name from this session. If * the session does not have an object bound with the specified name, this * method does nothing. - * + * * @param name * the name of the object to remove from this session * @throws IllegalStateException @@ -165,7 +165,7 @@ public interface WrappedSession extends Serializable { * Specifies the time, in seconds, between client requests before the * servlet container will invalidate this session. A negative time indicates * the session should never timeout. - * + * * @param interval * An integer specifying the number of seconds * @see HttpSession#setMaxInactiveInterval(int) diff --git a/server/src/main/java/com/vaadin/server/communication/AbstractStreamingEvent.java b/server/src/main/java/com/vaadin/server/communication/AbstractStreamingEvent.java index 1f546b2489..8d7591d7bb 100644 --- a/server/src/main/java/com/vaadin/server/communication/AbstractStreamingEvent.java +++ b/server/src/main/java/com/vaadin/server/communication/AbstractStreamingEvent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/server/src/main/java/com/vaadin/server/communication/AtmospherePushConnection.java b/server/src/main/java/com/vaadin/server/communication/AtmospherePushConnection.java index 5c0d2e14d4..19f0572300 100644 --- a/server/src/main/java/com/vaadin/server/communication/AtmospherePushConnection.java +++ b/server/src/main/java/com/vaadin/server/communication/AtmospherePushConnection.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -41,7 +41,7 @@ import com.vaadin.ui.UI; /** * A {@link PushConnection} implementation using the Atmosphere push support * that is by default included in Vaadin. - * + * * @author Vaadin Ltd * @since 7.1 */ @@ -83,7 +83,7 @@ public class AtmospherePushConnection implements PushConnection { /** * Appends all the data from the given Reader to this message and * returns whether the message was completed. - * + * * @param reader * The Reader from which to read. * @return true if this message is complete, false otherwise. @@ -150,7 +150,7 @@ public class AtmospherePushConnection implements PushConnection { * Pushes pending state changes and client RPC calls to the client. If * {@code isConnected()} is false, defers the push until a connection is * established. - * + * * @param async * True if this push asynchronously originates from the server, * false if it is a response to a client request. @@ -176,7 +176,7 @@ public class AtmospherePushConnection implements PushConnection { /** * Sends the given message to the current client. Cannot be called if * {@isConnected()} is false. - * + * * @param message * The message to send */ @@ -192,7 +192,7 @@ public class AtmospherePushConnection implements PushConnection { * received, or if the call resulted in the completion of a partially * received message, returns a {@link Reader} yielding the complete message. * Otherwise, returns null. - * + * * @param reader * A Reader from which to read the (partial) message * @return A Reader yielding a complete message or null if the message is @@ -230,10 +230,10 @@ public class AtmospherePushConnection implements PushConnection { /** * Associates this {@code AtmospherePushConnection} with the given - * {@AtmosphereResource} representing an established - * push connection. If already connected, calls {@link #disconnect()} first. - * If there is a deferred push, carries it out via the new connection. - * + * {@AtmosphereResource} representing an established push connection. If + * already connected, calls {@link #disconnect()} first. If there is a + * deferred push, carries it out via the new connection. + * * @since 7.2 */ public void connect(AtmosphereResource resource) { @@ -279,8 +279,8 @@ public class AtmospherePushConnection implements PushConnection { if (resource == null) { // Already disconnected. Should not happen but if it does, we don't // want to cause NPEs - getLogger() - .fine("AtmospherePushConnection.disconnect() called twice, this should not happen"); + getLogger().fine( + "AtmospherePushConnection.disconnect() called twice, this should not happen"); return; } if (resource.isResumed()) { @@ -297,13 +297,11 @@ public class AtmospherePushConnection implements PushConnection { try { outgoingMessage.get(1000, TimeUnit.MILLISECONDS); } catch (TimeoutException e) { - getLogger() - .log(Level.INFO, - "Timeout waiting for messages to be sent to client before disconnect"); + getLogger().log(Level.INFO, + "Timeout waiting for messages to be sent to client before disconnect"); } catch (Exception e) { - getLogger() - .log(Level.INFO, - "Error waiting for messages to be sent to client before disconnect"); + getLogger().log(Level.INFO, + "Error waiting for messages to be sent to client before disconnect"); } outgoingMessage = null; } @@ -311,15 +309,15 @@ public class AtmospherePushConnection implements PushConnection { try { resource.close(); } catch (IOException e) { - getLogger() - .log(Level.INFO, "Error when closing push connection", e); + getLogger().log(Level.INFO, "Error when closing push connection", + e); } connectionLost(); } /** * Called when the connection to the client has been lost. - * + * * @since 7.4.1 */ public void connectionLost() { @@ -345,8 +343,8 @@ public class AtmospherePushConnection implements PushConnection { * is initially in disconnected state; the client will handle the * reconnecting. */ - private void readObject(ObjectInputStream stream) throws IOException, - ClassNotFoundException { + private void readObject(ObjectInputStream stream) + throws IOException, ClassNotFoundException { stream.defaultReadObject(); state = State.DISCONNECTED; } @@ -358,7 +356,7 @@ public class AtmospherePushConnection implements PushConnection { /** * Internal method used for reconfiguring loggers to show all Atmosphere log * messages in the console. - * + * * @since 7.6 */ public static void enableAtmosphereDebugLogging() { diff --git a/server/src/main/java/com/vaadin/server/communication/ClientRpcWriter.java b/server/src/main/java/com/vaadin/server/communication/ClientRpcWriter.java index 2ecf81287e..aaecf9f273 100644 --- a/server/src/main/java/com/vaadin/server/communication/ClientRpcWriter.java +++ b/server/src/main/java/com/vaadin/server/communication/ClientRpcWriter.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -40,7 +40,7 @@ import elemental.json.impl.JsonUtil; /** * Serializes {@link ClientRpc client RPC} invocations to JSON. - * + * * @author Vaadin Ltd * @since 7.1 */ @@ -49,7 +49,7 @@ public class ClientRpcWriter implements Serializable { /** * Writes a JSON object containing all pending client RPC invocations in the * given UI. - * + * * @param ui * The {@link UI} whose RPC calls to write. * @param writer @@ -59,20 +59,21 @@ public class ClientRpcWriter implements Serializable { */ public void write(UI ui, Writer writer) throws IOException { - Collection pendingInvocations = collectPendingRpcCalls(ui - .getConnectorTracker().getDirtyVisibleConnectors()); + Collection pendingInvocations = collectPendingRpcCalls( + ui.getConnectorTracker().getDirtyVisibleConnectors()); JsonArray rpcCalls = Json.createArray(); for (ClientMethodInvocation invocation : pendingInvocations) { // add invocation to rpcCalls try { JsonArray invocationJson = Json.createArray(); - invocationJson.set(0, invocation.getConnector() - .getConnectorId()); + invocationJson.set(0, + invocation.getConnector().getConnectorId()); invocationJson.set(1, invocation.getInterfaceName()); invocationJson.set(2, invocation.getMethodName()); JsonArray paramJson = Json.createArray(); - for (int i = 0; i < invocation.getParameterTypes().length; ++i) { + for (int i = 0; i < invocation + .getParameterTypes().length; ++i) { Type parameterType = invocation.getParameterTypes()[i]; JsonValue referenceParameter = null; // TODO Use default values for RPC parameter types @@ -98,7 +99,8 @@ public class ClientRpcWriter implements Serializable { + invocation.getConnector().getConnectorId() + " method " + invocation.getInterfaceName() + "." + invocation.getMethodName() + ": " - + e.getMessage(), e); + + e.getMessage(), + e); } } writer.write(JsonUtil.stringify(rpcCalls)); @@ -107,7 +109,7 @@ public class ClientRpcWriter implements Serializable { /** * Collects all pending RPC calls from listed {@link ClientConnector}s and * clears their RPC queues. - * + * * @param rpcPendingQueue * list of {@link ClientConnector} of interest * @return ordered list of pending RPC calls @@ -128,14 +130,15 @@ public class ClientRpcWriter implements Serializable { // merge two ordered comparable lists for (int destIndex = 0, oldIndex = 0, paintableIndex = 0; destIndex < totalCalls; destIndex++) { if (paintableIndex >= paintablePendingRpc.size() - || (oldIndex < oldPendingRpc.size() && ((Comparable) oldPendingRpc - .get(oldIndex)) - .compareTo(paintablePendingRpc - .get(paintableIndex)) <= 0)) { + || (oldIndex < oldPendingRpc.size() + && ((Comparable) oldPendingRpc + .get(oldIndex)).compareTo( + paintablePendingRpc.get( + paintableIndex)) <= 0)) { pendingInvocations.add(oldPendingRpc.get(oldIndex++)); } else { - pendingInvocations.add(paintablePendingRpc - .get(paintableIndex++)); + pendingInvocations + .add(paintablePendingRpc.get(paintableIndex++)); } } } diff --git a/server/src/main/java/com/vaadin/server/communication/ConnectorHierarchyWriter.java b/server/src/main/java/com/vaadin/server/communication/ConnectorHierarchyWriter.java index 16ed9985c4..9af4186132 100644 --- a/server/src/main/java/com/vaadin/server/communication/ConnectorHierarchyWriter.java +++ b/server/src/main/java/com/vaadin/server/communication/ConnectorHierarchyWriter.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -38,7 +38,7 @@ import elemental.json.impl.JsonUtil; /** * Serializes a connector hierarchy to JSON. - * + * * @author Vaadin Ltd * @since 7.1 */ @@ -47,7 +47,7 @@ public class ConnectorHierarchyWriter implements Serializable { /** * Writes a JSON object containing the connector hierarchy (parent-child * mappings) of the dirty connectors in the given UI. - * + * * @param ui * The {@link UI} whose hierarchy to write. * @param writer @@ -85,7 +85,8 @@ public class ConnectorHierarchyWriter implements Serializable { throw new PaintException( "Failed to send hierarchy information about " + connectorId + " to the client: " - + e.getMessage(), e); + + e.getMessage(), + e); } } } @@ -100,8 +101,9 @@ public class ConnectorHierarchyWriter implements Serializable { Set stateUpdateConnectors) { VaadinRequest request = VaadinService.getCurrentRequest(); if (request != null) { - request.setAttribute(ConnectorHierarchyWriter.class.getName() - + ".hierarchyInfo", hierarchyInfo); + request.setAttribute( + ConnectorHierarchyWriter.class.getName() + ".hierarchyInfo", + hierarchyInfo); request.setAttribute(ConnectorHierarchyWriter.class.getName() + ".stateUpdateConnectors", stateUpdateConnectors); } diff --git a/server/src/main/java/com/vaadin/server/communication/ConnectorTypeWriter.java b/server/src/main/java/com/vaadin/server/communication/ConnectorTypeWriter.java index d534987061..c7f48b9367 100644 --- a/server/src/main/java/com/vaadin/server/communication/ConnectorTypeWriter.java +++ b/server/src/main/java/com/vaadin/server/communication/ConnectorTypeWriter.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -33,7 +33,7 @@ import elemental.json.impl.JsonUtil; /** * Serializes connector type mappings to JSON. - * + * * @author Vaadin Ltd * @since 7.1 */ @@ -42,7 +42,7 @@ public class ConnectorTypeWriter implements Serializable { /** * Writes a JSON object containing connector-ID-to-type-ID mappings for each * dirty Connector in the given UI. - * + * * @param ui * The {@link UI} containing dirty connectors * @param writer @@ -67,7 +67,8 @@ public class ConnectorTypeWriter implements Serializable { throw new PaintException( "Failed to send connector type for connector " + connector.getConnectorId() + ": " - + e.getMessage(), e); + + e.getMessage(), + e); } } writer.write(JsonUtil.stringify(connectorTypes)); diff --git a/server/src/main/java/com/vaadin/server/communication/DateSerializer.java b/server/src/main/java/com/vaadin/server/communication/DateSerializer.java index 593728bac7..e10edf852a 100644 --- a/server/src/main/java/com/vaadin/server/communication/DateSerializer.java +++ b/server/src/main/java/com/vaadin/server/communication/DateSerializer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -24,7 +24,7 @@ import elemental.json.JsonValue; /** * Server side serializer/deserializer for java.util.Date - * + * * @since 7.2 * @author Vaadin Ltd */ diff --git a/server/src/main/java/com/vaadin/server/communication/FileUploadHandler.java b/server/src/main/java/com/vaadin/server/communication/FileUploadHandler.java index b9eaff3bd1..f205e28b7d 100644 --- a/server/src/main/java/com/vaadin/server/communication/FileUploadHandler.java +++ b/server/src/main/java/com/vaadin/server/communication/FileUploadHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -42,7 +42,7 @@ import com.vaadin.ui.Upload.FailedEvent; /** * Handles a file upload request submitted via an Upload component. - * + * * @author Vaadin Ltd * @since 7.1 */ @@ -51,7 +51,7 @@ public class FileUploadHandler implements RequestHandler { /** * Stream that extracts content from another stream until the boundary * string is encountered. - * + * * Public only for unit tests, should be considered private for all other * purposes. */ @@ -119,7 +119,7 @@ public class FileUploadHandler implements RequestHandler { /** * Reads the input to expect a boundary string. Expects that the first * character has already been matched. - * + * * @return -1 if the boundary was matched, else returns the first byte * from boundary * @throws IOException @@ -155,7 +155,7 @@ public class FileUploadHandler implements RequestHandler { /** * Returns the partly matched boundary string and the byte following * that. - * + * * @return * @throws IOException */ @@ -192,7 +192,8 @@ public class FileUploadHandler implements RequestHandler { } } if (b == -1) { - throw new IOException("The multipart stream ended unexpectedly"); + throw new IOException( + "The multipart stream ended unexpectedly"); } return b; } @@ -201,7 +202,7 @@ public class FileUploadHandler implements RequestHandler { /** * An UploadInterruptedException will be thrown by an ongoing upload if * {@link StreamVariable#isInterrupted()} returns true. - * + * * By checking the exception of an {@link StreamingErrorEvent} or * {@link FailedEvent} against this class, it is possible to determine if an * upload was interrupted by code or aborted due to any other exception. @@ -227,7 +228,9 @@ public class FileUploadHandler implements RequestHandler { private static final String DASHDASH = "--"; - /* Same as in apache commons file upload library that was previously used. */ + /* + * Same as in apache commons file upload library that was previously used. + */ private static final int MAX_UPLOAD_BUFFER_SIZE = 4 * 1024; /* Minimum interval which will be used for streaming progress events. */ @@ -266,8 +269,8 @@ public class FileUploadHandler implements RequestHandler { UI uI = session.getUIById(Integer.parseInt(uiId)); UI.setCurrent(uI); - streamVariable = uI.getConnectorTracker().getStreamVariable( - connectorId, variableName); + streamVariable = uI.getConnectorTracker() + .getStreamVariable(connectorId, variableName); String secKey = uI.getConnectorTracker().getSeckey(streamVariable); if (secKey == null || !secKey.equals(parts[3])) { // TODO Should rethink error handling @@ -299,7 +302,8 @@ public class FileUploadHandler implements RequestHandler { int readByte = stream.read(); while (readByte != LF) { if (readByte == -1) { - throw new IOException("The multipart stream ended unexpectedly"); + throw new IOException( + "The multipart stream ended unexpectedly"); } bout.write(readByte); readByte = stream.read(); @@ -316,7 +320,7 @@ public class FileUploadHandler implements RequestHandler { * assume the caller has locked the session. This allows the session to be * locked only when needed and not when handling the upload data. *

        - * + * * @param session * The session containing the stream variable * @param request @@ -374,19 +378,19 @@ public class FileUploadHandler implements RequestHandler { } } - contentLength -= (boundary.length() + CRLF.length() + 2 - * DASHDASH.length() + CRLF.length()); + contentLength -= (boundary.length() + CRLF.length() + + 2 * DASHDASH.length() + CRLF.length()); /* * Reads bytes from the underlying stream. Compares the read bytes to * the boundary string and returns -1 if met. - * + * * The matching happens so that if the read byte equals to the first * char of boundary string, the stream goes to "buffering mode". In * buffering mode bytes are read until the character does not match the * corresponding from boundary string or the full boundary string is * found. - * + * * Note, if this is someday needed elsewhere, don't shoot yourself to * foot and split to a top level helper class. */ @@ -404,8 +408,8 @@ public class FileUploadHandler implements RequestHandler { streamVariable, filename, mimeType, contentLength, owner, variableName); } catch (UploadException e) { - session.getCommunicationManager().handleConnectorRelatedException( - owner, e); + session.getCommunicationManager() + .handleConnectorRelatedException(owner, e); } sendUploadResponse(request, response); @@ -476,7 +480,7 @@ public class FileUploadHandler implements RequestHandler { * assume the caller has locked the session. This allows the session to be * locked only when needed and not when handling the upload data. *

        - * + * * @param session * The session containing the stream variable * @param request @@ -510,8 +514,8 @@ public class FileUploadHandler implements RequestHandler { handleFileUploadValidationAndData(session, stream, streamVariable, filename, mimeType, contentLength, owner, variableName); } catch (UploadException e) { - session.getCommunicationManager().handleConnectorRelatedException( - owner, e); + session.getCommunicationManager() + .handleConnectorRelatedException(owner, e); } sendUploadResponse(request, response); } @@ -657,7 +661,7 @@ public class FileUploadHandler implements RequestHandler { /** * Removes any possible path information from the filename and returns the * filename. Separators / and \\ are used. - * + * * @param name * @return */ @@ -671,7 +675,7 @@ public class FileUploadHandler implements RequestHandler { /** * TODO document - * + * * @param request * @param response * @throws IOException @@ -680,8 +684,8 @@ public class FileUploadHandler implements RequestHandler { VaadinResponse response) throws IOException { response.setContentType("text/html"); final OutputStream out = response.getOutputStream(); - final PrintWriter outWriter = new PrintWriter(new BufferedWriter( - new OutputStreamWriter(out, "UTF-8"))); + final PrintWriter outWriter = new PrintWriter( + new BufferedWriter(new OutputStreamWriter(out, "UTF-8"))); outWriter.print("download handled"); outWriter.flush(); out.close(); diff --git a/server/src/main/java/com/vaadin/server/communication/HeartbeatHandler.java b/server/src/main/java/com/vaadin/server/communication/HeartbeatHandler.java index c6711d1d18..47671c0c5b 100644 --- a/server/src/main/java/com/vaadin/server/communication/HeartbeatHandler.java +++ b/server/src/main/java/com/vaadin/server/communication/HeartbeatHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -36,12 +36,12 @@ import com.vaadin.ui.UI; * no UIDL requests for a prolonged period of time. UIs that do not receive * either heartbeat or UIDL requests are eventually removed from the session and * garbage collected. - * + * * @author Vaadin Ltd * @since 7.1 */ -public class HeartbeatHandler extends SynchronizedRequestHandler implements - SessionExpiredHandler { +public class HeartbeatHandler extends SynchronizedRequestHandler + implements SessionExpiredHandler { @Override protected boolean canHandleRequest(VaadinRequest request) { @@ -68,7 +68,8 @@ public class HeartbeatHandler extends SynchronizedRequestHandler implements // complain about the empty response body (#12182) response.setHeader("Content-Type", "text/plain"); } else { - response.sendError(HttpServletResponse.SC_NOT_FOUND, "UI not found"); + response.sendError(HttpServletResponse.SC_NOT_FOUND, + "UI not found"); } return true; @@ -76,7 +77,7 @@ public class HeartbeatHandler extends SynchronizedRequestHandler implements /* * (non-Javadoc) - * + * * @see * com.vaadin.server.SessionExpiredHandler#handleSessionExpired(com.vaadin * .server.VaadinRequest, com.vaadin.server.VaadinResponse) diff --git a/server/src/main/java/com/vaadin/server/communication/JSONSerializer.java b/server/src/main/java/com/vaadin/server/communication/JSONSerializer.java index 7f673d01e8..dc9dcc8d79 100644 --- a/server/src/main/java/com/vaadin/server/communication/JSONSerializer.java +++ b/server/src/main/java/com/vaadin/server/communication/JSONSerializer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -34,7 +34,7 @@ import elemental.json.JsonValue; *

        * This is the server side interface, see * com.vaadin.client.communication.JSONSerializer for the client side interface. - * + * * @since 7.2 * @author Vaadin Ltd */ @@ -59,7 +59,7 @@ public interface JSONSerializer { * Serialize the given object into JSON. Must be compatible with * {@link #deserialize(Type, JsonValue, ConnectorTracker)} and the client * side com.vaadin.client.communication.JSONSerializer - * + * * @param value * The object to serialize * @param connectorTracker diff --git a/server/src/main/java/com/vaadin/server/communication/JSR356WebsocketInitializer.java b/server/src/main/java/com/vaadin/server/communication/JSR356WebsocketInitializer.java index be74c47106..bb28de67b0 100644 --- a/server/src/main/java/com/vaadin/server/communication/JSR356WebsocketInitializer.java +++ b/server/src/main/java/com/vaadin/server/communication/JSR356WebsocketInitializer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -43,7 +43,7 @@ import com.vaadin.server.VaadinServlet; * Note that {@link WebListener} is Servlet 3.0 API so this will not be run for * older servers (unless added to web.xml), but these servers do not support JSR * 356 websockets either. - * + * * @since 7.5.0 * @author Vaadin Ltd */ @@ -91,8 +91,8 @@ public class JSR356WebsocketInitializer implements ServletContextListener { @Override public Enumeration getInitParameterNames() { - return Collections.enumeration(servletRegistration - .getInitParameters().keySet()); + return Collections.enumeration( + servletRegistration.getInitParameters().keySet()); } } @@ -118,10 +118,10 @@ public class JSR356WebsocketInitializer implements ServletContextListener { initAtmosphereForVaadinServlet(servletRegistration, servletContext); } catch (Exception e) { - getLogger().log( - Level.WARNING, + getLogger().log(Level.WARNING, "Failed to initialize Atmosphere for " - + servletName, e); + + servletName, + e); } } } @@ -132,7 +132,7 @@ public class JSR356WebsocketInitializer implements ServletContextListener { *

        * For JSR 356 websockets to work properly, the initialization must be done * in the servlet context initialization phase. - * + * * @param servletRegistration * The servlet registration info for the servlet * @param servletContext @@ -149,9 +149,8 @@ public class JSR356WebsocketInitializer implements ServletContextListener { return; } getLogger().finer("Creating AtmosphereFramework for " + servletName); - AtmosphereFramework framework = PushRequestHandler - .initAtmosphere(new FakeServletConfig(servletRegistration, - servletContext)); + AtmosphereFramework framework = PushRequestHandler.initAtmosphere( + new FakeServletConfig(servletRegistration, servletContext)); servletContext.setAttribute(attributeName, framework); getLogger().finer("Created AtmosphereFramework for " + servletName); @@ -160,7 +159,7 @@ public class JSR356WebsocketInitializer implements ServletContextListener { /** * Returns the name of the attribute in the servlet context where the * pre-initialized Atmosphere object is stored - * + * * @param servletName * The name of the servlet * @return The attribute name which contains the initialized Atmosphere @@ -179,15 +178,16 @@ public class JSR356WebsocketInitializer implements ServletContextListener { * @return true if the attribute name matches the convention, * false otherwise */ - private static boolean isAtmosphereFrameworkAttribute(String attributeName) { - return attributeName.startsWith(JSR356WebsocketInitializer.class - .getName() + "."); + private static boolean isAtmosphereFrameworkAttribute( + String attributeName) { + return attributeName + .startsWith(JSR356WebsocketInitializer.class.getName() + "."); } /** * Tries to determine if the given servlet registration refers to a Vaadin * servlet. - * + * * @param servletRegistration * The servlet registration info for the servlet * @return false if the servlet is definitely not a Vaadin servlet, true diff --git a/server/src/main/java/com/vaadin/server/communication/LegacyUidlWriter.java b/server/src/main/java/com/vaadin/server/communication/LegacyUidlWriter.java index 3f70a25c5b..c5a84c29a7 100644 --- a/server/src/main/java/com/vaadin/server/communication/LegacyUidlWriter.java +++ b/server/src/main/java/com/vaadin/server/communication/LegacyUidlWriter.java @@ -73,9 +73,9 @@ public class LegacyUidlWriter implements Serializable { writer.write("["); for (Component c : legacyComponents) { - getLogger().fine( - "Painting LegacyComponent " + c.getClass().getName() + "@" - + Integer.toHexString(c.hashCode())); + getLogger() + .fine("Painting LegacyComponent " + c.getClass().getName() + + "@" + Integer.toHexString(c.hashCode())); target.startTag("change"); final String pid = c.getConnectorId(); target.addAttribute("pid", pid); diff --git a/server/src/main/java/com/vaadin/server/communication/MetadataWriter.java b/server/src/main/java/com/vaadin/server/communication/MetadataWriter.java index 9c46e64692..941d1b0c4d 100644 --- a/server/src/main/java/com/vaadin/server/communication/MetadataWriter.java +++ b/server/src/main/java/com/vaadin/server/communication/MetadataWriter.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,7 +25,7 @@ import com.vaadin.ui.UI; /** * Serializes miscellaneous metadata to JSON. - * + * * @author Vaadin Ltd * @since 7.1 */ @@ -35,7 +35,7 @@ public class MetadataWriter implements Serializable { /** * Writes a JSON object containing metadata related to the given UI. - * + * * @param ui * The UI whose metadata to write. * @param writer @@ -53,7 +53,7 @@ public class MetadataWriter implements Serializable { * messages. * @throws IOException * If the serialization fails. - * + * */ public void write(UI ui, Writer writer, boolean repaintAll, boolean async, SystemMessages messages) throws IOException { @@ -89,8 +89,8 @@ public class MetadataWriter implements Serializable { writer.write(","); } writer.write("\"timedRedirect\":{\"interval\":" - + (newTimeoutInterval + 15) + ",\"url\":\"" - + escapedURL + "\"}"); + + (newTimeoutInterval + 15) + ",\"url\":\"" + escapedURL + + "\"}"); metaOpen = true; } timeoutInterval = newTimeoutInterval; diff --git a/server/src/main/java/com/vaadin/server/communication/PortletBootstrapHandler.java b/server/src/main/java/com/vaadin/server/communication/PortletBootstrapHandler.java index 289309b631..57336b8a0f 100644 --- a/server/src/main/java/com/vaadin/server/communication/PortletBootstrapHandler.java +++ b/server/src/main/java/com/vaadin/server/communication/PortletBootstrapHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -74,7 +74,8 @@ public class PortletBootstrapHandler extends BootstrapHandler { // applications will load this exactly once String portalTheme = ((VaadinPortletRequest) context.getRequest()) .getPortalProperty(VaadinPortlet.PORTAL_PARAMETER_VAADIN_THEME); - if (portalTheme != null && !portalTheme.equals(context.getThemeName())) { + if (portalTheme != null + && !portalTheme.equals(context.getThemeName())) { String portalThemeUri = getThemeUri(context, portalTheme); // XSS safe - originates from portal properties builder.append("vaadin.loadTheme('" + portalThemeUri + "');"); diff --git a/server/src/main/java/com/vaadin/server/communication/PortletDummyRequestHandler.java b/server/src/main/java/com/vaadin/server/communication/PortletDummyRequestHandler.java index a79f5e96f2..83699a1818 100644 --- a/server/src/main/java/com/vaadin/server/communication/PortletDummyRequestHandler.java +++ b/server/src/main/java/com/vaadin/server/communication/PortletDummyRequestHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -34,7 +34,7 @@ import com.vaadin.server.VaadinSession; /** * Request handler which provides a dummy HTML response to any resource request * with the resource id DUMMY. - * + * * @author Vaadin Ltd * @since 7.1 */ @@ -60,8 +60,8 @@ public class PortletDummyRequestHandler implements RequestHandler { final OutputStream out = ((ResourceResponse) response) .getPortletOutputStream(); - final PrintWriter outWriter = new PrintWriter(new BufferedWriter( - new OutputStreamWriter(out, "UTF-8"))); + final PrintWriter outWriter = new PrintWriter( + new BufferedWriter(new OutputStreamWriter(out, "UTF-8"))); outWriter.print("dummy page"); outWriter.close(); diff --git a/server/src/main/java/com/vaadin/server/communication/PortletListenerNotifier.java b/server/src/main/java/com/vaadin/server/communication/PortletListenerNotifier.java index 3aa3426d2f..06e1d9f11c 100644 --- a/server/src/main/java/com/vaadin/server/communication/PortletListenerNotifier.java +++ b/server/src/main/java/com/vaadin/server/communication/PortletListenerNotifier.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -42,7 +42,7 @@ import com.vaadin.ui.UI; /** * Notifies {@link PortletListener}s of a received portlet request. - * + * * @author Vaadin Ltd * @since 7.1 */ diff --git a/server/src/main/java/com/vaadin/server/communication/PortletStateAwareRequestHandler.java b/server/src/main/java/com/vaadin/server/communication/PortletStateAwareRequestHandler.java index a1276025d8..cb8c511a92 100644 --- a/server/src/main/java/com/vaadin/server/communication/PortletStateAwareRequestHandler.java +++ b/server/src/main/java/com/vaadin/server/communication/PortletStateAwareRequestHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -29,7 +29,7 @@ import com.vaadin.server.VaadinSession; /** * Handler which ensures that Action and Event requests are marked as handled * and do not cause a 404 to be sent. - * + * * @since 7.1 * @author Vaadin Ltd */ @@ -37,7 +37,7 @@ public class PortletStateAwareRequestHandler implements RequestHandler { /* * (non-Javadoc) - * + * * @see com.vaadin.server.RequestHandler#handleRequest(com.vaadin.server. * VaadinSession, com.vaadin.server.VaadinRequest, * com.vaadin.server.VaadinResponse) diff --git a/server/src/main/java/com/vaadin/server/communication/PortletUIInitHandler.java b/server/src/main/java/com/vaadin/server/communication/PortletUIInitHandler.java index b3cda44592..a47c59aa45 100644 --- a/server/src/main/java/com/vaadin/server/communication/PortletUIInitHandler.java +++ b/server/src/main/java/com/vaadin/server/communication/PortletUIInitHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -34,14 +34,14 @@ public class PortletUIInitHandler extends UIInitHandler { return false; } - return UIInitHandler.BROWSER_DETAILS_PARAMETER.equals(resourceRequest - .getResourceID()); + return UIInitHandler.BROWSER_DETAILS_PARAMETER + .equals(resourceRequest.getResourceID()); } /** * Returns the {@link ResourceRequest} for the given request or null if none * could be found. - * + * * @param request * The original request, must be a {@link VaadinPortletRequest} * @return The resource request from the request parameter or null diff --git a/server/src/main/java/com/vaadin/server/communication/PublishedFileHandler.java b/server/src/main/java/com/vaadin/server/communication/PublishedFileHandler.java index 56edffd16d..7603b0f078 100644 --- a/server/src/main/java/com/vaadin/server/communication/PublishedFileHandler.java +++ b/server/src/main/java/com/vaadin/server/communication/PublishedFileHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -42,7 +42,7 @@ import com.vaadin.shared.ApplicationConstants; * names that have explicitly been registered. Resources can currently only be * registered by including a {@link JavaScript} or {@link StyleSheet} annotation * on a Connector class. - * + * * @author Vaadin Ltd * @since 7.1 */ @@ -62,16 +62,16 @@ public class PublishedFileHandler implements RequestHandler { String pathInfo = request.getPathInfo(); // + 2 to also remove beginning and ending slashes - String fileName = pathInfo - .substring(ApplicationConstants.PUBLISHED_FILE_PATH.length() + 2); + String fileName = pathInfo.substring( + ApplicationConstants.PUBLISHED_FILE_PATH.length() + 2); final String mimetype = response.getService().getMimeType(fileName); // Security check: avoid accidentally serving from the UI of the // classpath instead of relative to the context class if (fileName.startsWith("/")) { - getLogger().warning( - "Published file request starting with / rejected: " + getLogger() + .warning("Published file request starting with / rejected: " + fileName); response.sendError(HttpServletResponse.SC_NOT_FOUND, fileName); return true; @@ -100,12 +100,10 @@ public class PublishedFileHandler implements RequestHandler { // Resolve file relative to the location of the context class InputStream in = context.getResourceAsStream(fileName); if (in == null) { - getLogger().warning( - fileName + " published by " + context.getName() - + " not found. Verify that the file " - + context.getPackage().getName().replace('.', '/') - + '/' + fileName - + " is available on the classpath."); + getLogger().warning(fileName + " published by " + context.getName() + + " not found. Verify that the file " + + context.getPackage().getName().replace('.', '/') + '/' + + fileName + " is available on the classpath."); response.sendError(HttpServletResponse.SC_NOT_FOUND, fileName); return true; } diff --git a/server/src/main/java/com/vaadin/server/communication/PushAtmosphereHandler.java b/server/src/main/java/com/vaadin/server/communication/PushAtmosphereHandler.java index 50279a1a74..6e1fadca04 100644 --- a/server/src/main/java/com/vaadin/server/communication/PushAtmosphereHandler.java +++ b/server/src/main/java/com/vaadin/server/communication/PushAtmosphereHandler.java @@ -29,7 +29,7 @@ import org.atmosphere.handler.AbstractReflectorAtmosphereHandler; /** * Handles Atmosphere requests and forwards them to logical methods in * {@link PushHandler} - * + * * @since 7.5.0 * @author Vaadin Ltd */ @@ -47,12 +47,12 @@ public class PushAtmosphereHandler extends AbstractReflectorAtmosphereHandler } @Override - public void onStateChange(AtmosphereResourceEvent event) throws IOException { + public void onStateChange(AtmosphereResourceEvent event) + throws IOException { super.onStateChange(event); if (pushHandler == null) { - getLogger() - .warning( - "AtmosphereHandler.onStateChange called before PushHandler has been set. This should really not happen"); + getLogger().warning( + "AtmosphereHandler.onStateChange called before PushHandler has been set. This should really not happen"); return; } @@ -64,9 +64,8 @@ public class PushAtmosphereHandler extends AbstractReflectorAtmosphereHandler @Override public void onRequest(AtmosphereResource resource) { if (pushHandler == null) { - getLogger() - .warning( - "AtmosphereHandler.onRequest called before PushHandler has been set. This should really not happen"); + getLogger().warning( + "AtmosphereHandler.onRequest called before PushHandler has been set. This should really not happen"); return; } @@ -81,7 +80,7 @@ public class PushAtmosphereHandler extends AbstractReflectorAtmosphereHandler /** * Called when the client sends a message through the push channel - * + * * @param resource */ private void onMessage(AtmosphereResource resource) { @@ -91,7 +90,7 @@ public class PushAtmosphereHandler extends AbstractReflectorAtmosphereHandler /** * Called when the client sends the first request (to establish a push * connection) - * + * * @param resource */ private void onConnect(AtmosphereResource resource) { diff --git a/server/src/main/java/com/vaadin/server/communication/PushConnection.java b/server/src/main/java/com/vaadin/server/communication/PushConnection.java index d5a0d6e9bc..6e0a31b9d6 100644 --- a/server/src/main/java/com/vaadin/server/communication/PushConnection.java +++ b/server/src/main/java/com/vaadin/server/communication/PushConnection.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -28,7 +28,7 @@ import com.vaadin.ui.UI; * the transport mechanism. *

        * This interface is an internal API, only meant to be used by the framework. - * + * * @author Vaadin Ltd * @since 7.1 */ diff --git a/server/src/main/java/com/vaadin/server/communication/PushHandler.java b/server/src/main/java/com/vaadin/server/communication/PushHandler.java index 0b4fe28b77..7cc41aeda3 100644 --- a/server/src/main/java/com/vaadin/server/communication/PushHandler.java +++ b/server/src/main/java/com/vaadin/server/communication/PushHandler.java @@ -49,7 +49,7 @@ import elemental.json.JsonException; /** * Handles incoming push connections and messages and dispatches them to the * correct {@link UI}/ {@link AtmospherePushConnection} - * + * * @author Vaadin Ltd * @since 7.1 */ @@ -90,13 +90,12 @@ public class PushHandler { resource.getResponse().addHeader("Connection", "close"); } - String requestToken = resource.getRequest().getParameter( - ApplicationConstants.CSRF_TOKEN_PARAMETER); + String requestToken = resource.getRequest() + .getParameter(ApplicationConstants.CSRF_TOKEN_PARAMETER); if (!VaadinService.isCsrfTokenValid(session, requestToken)) { - getLogger() - .log(Level.WARNING, - "Invalid CSRF token in new connection received from {0}", - resource.getRequest().getRemoteHost()); + getLogger().log(Level.WARNING, + "Invalid CSRF token in new connection received from {0}", + resource.getRequest().getRemoteHost()); // Refresh on client side, create connection just for // sending a message sendRefreshAndDisconnect(resource); @@ -171,7 +170,7 @@ public class PushHandler { /** * Suspends the given resource - * + * * @since 7.6 * @param resource * the resource to suspend @@ -186,7 +185,7 @@ public class PushHandler { /** * Find the UI for the atmosphere resource, lock it and invoke the callback. - * + * * @param resource * the atmosphere resource for the current request * @param callback @@ -217,11 +216,10 @@ public class PushHandler { "Could not get session. This should never happen", e); return; } catch (SessionExpiredException e) { - SystemMessages msg = service.getSystemMessages( - ServletPortletHelper.findLocale(null, null, - vaadinRequest), vaadinRequest); - sendNotificationAndDisconnect( - resource, + SystemMessages msg = service + .getSystemMessages(ServletPortletHelper.findLocale(null, + null, vaadinRequest), vaadinRequest); + sendNotificationAndDisconnect(resource, VaadinService.createCriticalNotificationJSON( msg.getSessionExpiredCaption(), msg.getSessionExpiredMessage(), null, @@ -236,18 +234,17 @@ public class PushHandler { assert UI.getCurrent() == ui; if (ui == null) { - sendNotificationAndDisconnect(resource, - UidlRequestHandler.getUINotFoundErrorJSON(service, - vaadinRequest)); + sendNotificationAndDisconnect(resource, UidlRequestHandler + .getUINotFoundErrorJSON(service, vaadinRequest)); } else { callback.run(resource, ui); } } catch (final IOException e) { callErrorHandler(session, e); } catch (final Exception e) { - SystemMessages msg = service.getSystemMessages( - ServletPortletHelper.findLocale(null, null, - vaadinRequest), vaadinRequest); + SystemMessages msg = service + .getSystemMessages(ServletPortletHelper.findLocale(null, + null, vaadinRequest), vaadinRequest); AtmosphereResource errorResource = resource; if (ui != null && ui.getPushConnection() != null) { @@ -259,8 +256,7 @@ public class PushHandler { .getPushConnection()).getResource(); } - sendNotificationAndDisconnect( - errorResource, + sendNotificationAndDisconnect(errorResource, VaadinService.createCriticalNotificationJSON( msg.getInternalErrorCaption(), msg.getInternalErrorMessage(), null, @@ -334,10 +330,9 @@ public class PushHandler { // preserving the session. After restart the client reconnects, gets // a session expired notification and then closes the connection and // ends up here - getLogger() - .log(Level.FINER, - "Session expired before push disconnect event was received", - e); + getLogger().log(Level.FINER, + "Session expired before push disconnect event was received", + e); return; } @@ -352,7 +347,7 @@ public class PushHandler { * UI not found, could be because FF has asynchronously closed * the websocket connection and Atmosphere has already done * cleanup of the request attributes. - * + * * In that case, we still have a chance of finding the right UI * by iterating through the UIs in the session looking for one * using the same AtmosphereResource. @@ -360,18 +355,16 @@ public class PushHandler { ui = findUiUsingResource(resource, session.getUIs()); if (ui == null) { - getLogger() - .log(Level.FINE, - "Could not get UI. This should never happen," - + " except when reloading in Firefox and Chrome -" - + " see http://dev.vaadin.com/ticket/14251."); + getLogger().log(Level.FINE, + "Could not get UI. This should never happen," + + " except when reloading in Firefox and Chrome -" + + " see http://dev.vaadin.com/ticket/14251."); return; } else { - getLogger() - .log(Level.INFO, - "No UI was found based on data in the request," - + " but a slower lookup based on the AtmosphereResource succeeded." - + " See http://dev.vaadin.com/ticket/14251 for more details."); + getLogger().log(Level.INFO, + "No UI was found based on data in the request," + + " but a slower lookup based on the AtmosphereResource succeeded." + + " See http://dev.vaadin.com/ticket/14251 for more details."); } } @@ -381,10 +374,9 @@ public class PushHandler { String id = resource.uuid(); if (pushConnection == null) { - getLogger() - .log(Level.WARNING, - "Could not find push connection to close: {0} with transport {1}", - new Object[] { id, resource.transport() }); + getLogger().log(Level.WARNING, + "Could not find push connection to close: {0} with transport {1}", + new Object[] { id, resource.transport() }); } else { if (!pushMode.isEnabled()) { /* @@ -398,10 +390,9 @@ public class PushHandler { * Unexpected cancel, e.g. if the user closes the browser * tab. */ - getLogger() - .log(Level.FINER, - "Connection unexpectedly closed for resource {0} with transport {1}", - new Object[] { id, resource.transport() }); + getLogger().log(Level.FINER, + "Connection unexpectedly closed for resource {0} with transport {1}", + new Object[] { id, resource.transport() }); } pushConnection.connectionLost(); @@ -425,7 +416,8 @@ public class PushHandler { for (UI ui : uIs) { PushConnection pushConnection = ui.getPushConnection(); if (pushConnection instanceof AtmospherePushConnection) { - if (((AtmospherePushConnection) pushConnection).getResource() == resource) { + if (((AtmospherePushConnection) pushConnection) + .getResource() == resource) { return ui; } } @@ -441,16 +433,15 @@ public class PushHandler { * two push connections which try to use the same UI. Using the * AtmosphereResource directly guarantees the message goes to the correct * recipient. - * + * * @param resource * The atmosphere resource to send refresh to - * + * */ private static void sendRefreshAndDisconnect(AtmosphereResource resource) throws IOException { - sendNotificationAndDisconnect(resource, - VaadinService.createCriticalNotificationJSON(null, null, null, - null)); + sendNotificationAndDisconnect(resource, VaadinService + .createCriticalNotificationJSON(null, null, null, null)); } /** @@ -465,8 +456,8 @@ public class PushHandler { && !((AtmosphereResourceImpl) resource).isInScope()) { // The resource is no longer valid so we should not write // anything to it - getLogger() - .fine("sendNotificationAndDisconnect called for resource no longer in scope"); + getLogger().fine( + "sendNotificationAndDisconnect called for resource no longer in scope"); return; } resource.getResponse().getWriter().write(notificationJson); @@ -483,7 +474,7 @@ public class PushHandler { /** * Called when a new push connection is requested to be opened by the client - * + * * @since 7.5.0 * @param resource * The related atmosphere resources @@ -494,7 +485,7 @@ public class PushHandler { /** * Called when a message is received through the push connection - * + * * @since 7.5.0 * @param resource * The related atmosphere resources @@ -506,11 +497,11 @@ public class PushHandler { /** * Sets the timeout used for suspend calls when using long polling. - * + * * If you are using a proxy with a defined idle timeout, set the suspend * timeout to a value smaller than the proxy timeout so that the server is * aware of a reconnect taking place. - * + * * @since 7.6 * @param suspendTimeout * the timeout to use for suspended AtmosphereResources @@ -521,7 +512,7 @@ public class PushHandler { /** * Gets the timeout used for suspend calls when using long polling. - * + * * @since 7.6 * @return the timeout to use for suspended AtmosphereResources */ diff --git a/server/src/main/java/com/vaadin/server/communication/PushRequestHandler.java b/server/src/main/java/com/vaadin/server/communication/PushRequestHandler.java index 17f7243e36..04970fb90d 100644 --- a/server/src/main/java/com/vaadin/server/communication/PushRequestHandler.java +++ b/server/src/main/java/com/vaadin/server/communication/PushRequestHandler.java @@ -58,8 +58,8 @@ import com.vaadin.shared.communication.PushConstants; * @author Vaadin Ltd * @since 7.1 */ -public class PushRequestHandler implements RequestHandler, - SessionExpiredHandler { +public class PushRequestHandler + implements RequestHandler, SessionExpiredHandler { private AtmosphereFramework atmosphere; private PushHandler pushHandler; @@ -82,30 +82,26 @@ public class PushRequestHandler implements RequestHandler, atmosphere = getPreInitializedAtmosphere(vaadinServletConfig); if (atmosphere == null) { // Not initialized by JSR356WebsocketInitializer - getLogger().fine( - "Initializing Atmosphere for servlet " - + vaadinServletConfig.getServletName()); + getLogger().fine("Initializing Atmosphere for servlet " + + vaadinServletConfig.getServletName()); try { atmosphere = initAtmosphere(vaadinServletConfig); } catch (Exception e) { - getLogger().log( - Level.WARNING, + getLogger().log(Level.WARNING, "Failed to initialize Atmosphere for " + service.getServlet().getServletName() - + ". Push will not work.", e); + + ". Push will not work.", + e); return; } } else { - getLogger().fine( - "Using pre-initialized Atmosphere for servlet " - + vaadinServletConfig.getServletName()); + getLogger().fine("Using pre-initialized Atmosphere for servlet " + + vaadinServletConfig.getServletName()); } - pushHandler - .setLongPollingSuspendTimeout(atmosphere - .getAtmosphereConfig() - .getInitParameter( - com.vaadin.server.Constants.SERVLET_PARAMETER_PUSH_SUSPEND_TIMEOUT_LONGPOLLING, - -1)); + pushHandler.setLongPollingSuspendTimeout( + atmosphere.getAtmosphereConfig().getInitParameter( + com.vaadin.server.Constants.SERVLET_PARAMETER_PUSH_SUSPEND_TIMEOUT_LONGPOLLING, + -1)); for (AtmosphereHandlerWrapper handlerWrapper : atmosphere .getAtmosphereHandlers().values()) { AtmosphereHandler handler = handlerWrapper.atmosphereHandler; @@ -124,7 +120,7 @@ public class PushRequestHandler implements RequestHandler, * Create your own request handler and override this method if you want to * customize the {@link PushHandler}, e.g. to dynamically decide the suspend * timeout. - * + * * @since 7.6 * @param service * the vaadin service @@ -158,7 +154,7 @@ public class PushRequestHandler implements RequestHandler, /** * Initializes Atmosphere for the given ServletConfiguration - * + * * @since 7.5.0 * @param vaadinServletConfig * The servlet configuration for the servlet which should have @@ -249,8 +245,8 @@ public class PushRequestHandler implements RequestHandler, return true; } try { - atmosphere.doCometSupport(AtmosphereRequest - .wrap((VaadinServletRequest) request), + atmosphere.doCometSupport( + AtmosphereRequest.wrap((VaadinServletRequest) request), AtmosphereResponse .wrap((VaadinServletResponse) response)); } catch (ServletException e) { @@ -271,7 +267,7 @@ public class PushRequestHandler implements RequestHandler, /* * (non-Javadoc) - * + * * @see * com.vaadin.server.SessionExpiredHandler#handleSessionExpired(com.vaadin * .server.VaadinRequest, com.vaadin.server.VaadinResponse) diff --git a/server/src/main/java/com/vaadin/server/communication/ResourceWriter.java b/server/src/main/java/com/vaadin/server/communication/ResourceWriter.java index 2834b3cea5..e663d004f4 100644 --- a/server/src/main/java/com/vaadin/server/communication/ResourceWriter.java +++ b/server/src/main/java/com/vaadin/server/communication/ResourceWriter.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -33,7 +33,7 @@ import com.vaadin.ui.UI; /** * Serializes resources to JSON. Currently only used for {@link CustomLayout} * templates. - * + * * @author Vaadin Ltd * @since 7.1 */ @@ -41,7 +41,7 @@ public class ResourceWriter implements Serializable { /** * Writes a JSON object containing registered resources. - * + * * @param ui * The {@link UI} whose resources to write. * @param writer @@ -69,8 +69,8 @@ public class ResourceWriter implements Serializable { final String resource = (String) i.next(); InputStream is = null; try { - is = ui.getSession().getService() - .getThemeResourceAsStream(ui, ui.getTheme(), resource); + is = ui.getSession().getService().getThemeResourceAsStream(ui, + ui.getTheme(), resource); } catch (final Exception e) { // FIXME: Handle exception getLogger().log(Level.FINER, @@ -78,8 +78,8 @@ public class ResourceWriter implements Serializable { } if (is != null) { - writer.write((resourceIndex++ > 0 ? ", " : "") + "\"" - + resource + "\" : "); + writer.write((resourceIndex++ > 0 ? ", " : "") + "\"" + resource + + "\" : "); final StringBuffer layout = new StringBuffer(); try { diff --git a/server/src/main/java/com/vaadin/server/communication/ServerRpcHandler.java b/server/src/main/java/com/vaadin/server/communication/ServerRpcHandler.java index 03770d683e..dfdeed70ae 100644 --- a/server/src/main/java/com/vaadin/server/communication/ServerRpcHandler.java +++ b/server/src/main/java/com/vaadin/server/communication/ServerRpcHandler.java @@ -257,8 +257,8 @@ public class ServerRpcHandler implements Serializable { // Just a duplicate message due to a bad connection or similar // It has already been handled by the server so it is safe to // ignore - getLogger().fine( - "Ignoring old message from the client. Expected: " + getLogger() + .fine("Ignoring old message from the client. Expected: " + expectedId + ", got: " + rpcRequest.getClientToServerId()); } else { @@ -274,8 +274,8 @@ public class ServerRpcHandler implements Serializable { rpcRequest.getRpcInvocationsData()); } - ui.getConnectorTracker().cleanConcurrentlyRemovedConnectorIds( - rpcRequest.getSyncId()); + ui.getConnectorTracker() + .cleanConcurrentlyRemovedConnectorIds(rpcRequest.getSyncId()); if (rpcRequest.isResynchronize()) { ui.getSession().getCommunicationManager().repaintAll(ui); @@ -299,9 +299,8 @@ public class ServerRpcHandler implements Serializable { } if (!Version.getFullVersion().equals(widgetsetVersion)) { - getLogger().warning( - String.format(Constants.WIDGETSET_MISMATCH_INFO, - Version.getFullVersion(), widgetsetVersion)); + getLogger().warning(String.format(Constants.WIDGETSET_MISMATCH_INFO, + Version.getFullVersion(), widgetsetVersion)); } } @@ -355,12 +354,11 @@ public class ServerRpcHandler implements Serializable { final ClientConnector connector = connectorTracker .getConnector(invocation.getConnectorId()); if (connector == null) { - getLogger() - .log(Level.WARNING, - "Received RPC call for unknown connector with id {0} (tried to invoke {1}.{2})", - new Object[] { invocation.getConnectorId(), - invocation.getInterfaceName(), - invocation.getMethodName() }); + getLogger().log(Level.WARNING, + "Received RPC call for unknown connector with id {0} (tried to invoke {1}.{2})", + new Object[] { invocation.getConnectorId(), + invocation.getInterfaceName(), + invocation.getMethodName() }); continue; } @@ -389,7 +387,8 @@ public class ServerRpcHandler implements Serializable { continue; } // DragAndDropService has null UI - if (connector.getUI() != null && connector.getUI().isClosing()) { + if (connector.getUI() != null + && connector.getUI().isClosing()) { String msg = "Ignoring RPC call for connector " + connector.getClass().getName(); if (connector instanceof Component) { @@ -413,9 +412,8 @@ public class ServerRpcHandler implements Serializable { } } } catch (JsonException e) { - getLogger().warning( - "Unable to parse RPC call from the client: " - + e.getMessage()); + getLogger().warning("Unable to parse RPC call from the client: " + + e.getMessage()); throw new RuntimeException(e); } } @@ -464,8 +462,7 @@ public class ServerRpcHandler implements Serializable { } else { throw new IllegalStateException( "Received a legacy variable change for " - + connector.getClass().getName() - + " (" + + connector.getClass().getName() + " (" + connector.getConnectorId() + ") which is not a VariableOwner. The client-side connector sent these legacy variables: " + changes.keySet()); @@ -524,21 +521,15 @@ public class ServerRpcHandler implements Serializable { String interfaceName = invocationJson.getString(1); String methodName = invocationJson.getString(2); - if (connectorTracker.getConnector(connectorId) == null - && !connectorId - .equals(ApplicationConstants.DRAG_AND_DROP_CONNECTOR_ID)) { + if (connectorTracker.getConnector(connectorId) == null && !connectorId + .equals(ApplicationConstants.DRAG_AND_DROP_CONNECTOR_ID)) { if (!connectorTracker.connectorWasPresentAsRequestWasSent( connectorId, lastSyncIdSeenByClient)) { - getLogger() - .log(Level.WARNING, - "RPC call to " - + interfaceName - + "." - + methodName - + " received for connector " - + connectorId - + " but no such connector could be found. Resynchronizing client."); + getLogger().log(Level.WARNING, "RPC call to " + interfaceName + + "." + methodName + " received for connector " + + connectorId + + " but no such connector could be found. Resynchronizing client."); // This is likely an out of sync issue (client tries to update a // connector which is not present). Force resync. connectorTracker.markAllConnectorsDirty(); @@ -548,8 +539,8 @@ public class ServerRpcHandler implements Serializable { JsonArray parametersJson = invocationJson.getArray(3); - if (LegacyChangeVariablesInvocation.isLegacyVariableChange( - interfaceName, methodName)) { + if (LegacyChangeVariablesInvocation + .isLegacyVariableChange(interfaceName, methodName)) { if (!(previousInvocation instanceof LegacyChangeVariablesInvocation)) { previousInvocation = null; } @@ -603,11 +594,10 @@ public class ServerRpcHandler implements Serializable { * corresponding to the received method invocation has been * registered. */ - getLogger().warning( - "Ignoring RPC call to " + interfaceName + "." + methodName - + " in connector " + connector.getClass().getName() - + "(" + connectorId - + ") as no RPC implementation is registered"); + getLogger().warning("Ignoring RPC call to " + interfaceName + "." + + methodName + " in connector " + + connector.getClass().getName() + "(" + connectorId + + ") as no RPC implementation is registered"); return null; } diff --git a/server/src/main/java/com/vaadin/server/communication/ServletBootstrapHandler.java b/server/src/main/java/com/vaadin/server/communication/ServletBootstrapHandler.java index 46909cecee..bef9b71aef 100644 --- a/server/src/main/java/com/vaadin/server/communication/ServletBootstrapHandler.java +++ b/server/src/main/java/com/vaadin/server/communication/ServletBootstrapHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -38,8 +38,8 @@ public class ServletBootstrapHandler extends BootstrapHandler { @Override public String getThemeName(BootstrapContext context) { - String themeName = context.getRequest().getParameter( - VaadinServlet.URL_PARAMETER_THEME); + String themeName = context.getRequest() + .getParameter(VaadinServlet.URL_PARAMETER_THEME); if (themeName == null) { themeName = super.getThemeName(context); } diff --git a/server/src/main/java/com/vaadin/server/communication/ServletUIInitHandler.java b/server/src/main/java/com/vaadin/server/communication/ServletUIInitHandler.java index b3b1684809..44eda4c35c 100644 --- a/server/src/main/java/com/vaadin/server/communication/ServletUIInitHandler.java +++ b/server/src/main/java/com/vaadin/server/communication/ServletUIInitHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,9 +25,8 @@ public class ServletUIInitHandler extends UIInitHandler { } public static boolean isUIInitRequest(VaadinRequest request) { - return "POST".equals(request.getMethod()) - && request - .getParameter(UIInitHandler.BROWSER_DETAILS_PARAMETER) != null; + return "POST".equals(request.getMethod()) && request + .getParameter(UIInitHandler.BROWSER_DETAILS_PARAMETER) != null; } } diff --git a/server/src/main/java/com/vaadin/server/communication/SessionRequestHandler.java b/server/src/main/java/com/vaadin/server/communication/SessionRequestHandler.java index 383ad2d541..c609610189 100644 --- a/server/src/main/java/com/vaadin/server/communication/SessionRequestHandler.java +++ b/server/src/main/java/com/vaadin/server/communication/SessionRequestHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -39,10 +39,10 @@ import com.vaadin.server.VaadinSession; * The session is not locked during execution of the request handlers. The * request handler can itself decide if it needs to lock the session or not. *

        - * + * * @see VaadinSession#addRequestHandler(RequestHandler) * @see RequestHandler - * + * * @since 7.1 */ public class SessionRequestHandler implements RequestHandler { diff --git a/server/src/main/java/com/vaadin/server/communication/SharedStateWriter.java b/server/src/main/java/com/vaadin/server/communication/SharedStateWriter.java index 06b59ad4cc..ab91f6e605 100644 --- a/server/src/main/java/com/vaadin/server/communication/SharedStateWriter.java +++ b/server/src/main/java/com/vaadin/server/communication/SharedStateWriter.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -35,7 +35,7 @@ import elemental.json.impl.JsonUtil; /** * Serializes {@link SharedState shared state} changes to JSON. - * + * * @author Vaadin Ltd * @since 7.1 */ @@ -44,7 +44,7 @@ public class SharedStateWriter implements Serializable { /** * Writes a JSON object containing the pending state changes of the dirty * connectors of the given UI. - * + * * @param ui * The UI whose state changes should be written. * @param writer @@ -74,7 +74,8 @@ public class SharedStateWriter implements Serializable { throw new PaintException( "Failed to serialize shared state for connector " + connector.getClass().getName() + " (" - + connectorId + "): " + e.getMessage(), e); + + connectorId + "): " + e.getMessage(), + e); } } writer.write(JsonUtil.stringify(sharedStates)); diff --git a/server/src/main/java/com/vaadin/server/communication/StreamingEndEventImpl.java b/server/src/main/java/com/vaadin/server/communication/StreamingEndEventImpl.java index 6d87d0cc8b..70fb97fbd1 100644 --- a/server/src/main/java/com/vaadin/server/communication/StreamingEndEventImpl.java +++ b/server/src/main/java/com/vaadin/server/communication/StreamingEndEventImpl.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -18,10 +18,11 @@ package com.vaadin.server.communication; import com.vaadin.server.StreamVariable.StreamingEndEvent; @SuppressWarnings("serial") -final class StreamingEndEventImpl extends AbstractStreamingEvent implements - StreamingEndEvent { +final class StreamingEndEventImpl extends AbstractStreamingEvent + implements StreamingEndEvent { - public StreamingEndEventImpl(String filename, String type, long totalBytes) { + public StreamingEndEventImpl(String filename, String type, + long totalBytes) { super(filename, type, totalBytes, totalBytes); } diff --git a/server/src/main/java/com/vaadin/server/communication/StreamingErrorEventImpl.java b/server/src/main/java/com/vaadin/server/communication/StreamingErrorEventImpl.java index a96f759216..4cc0ee459f 100644 --- a/server/src/main/java/com/vaadin/server/communication/StreamingErrorEventImpl.java +++ b/server/src/main/java/com/vaadin/server/communication/StreamingErrorEventImpl.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -18,8 +18,8 @@ package com.vaadin.server.communication; import com.vaadin.server.StreamVariable.StreamingErrorEvent; @SuppressWarnings("serial") -final class StreamingErrorEventImpl extends AbstractStreamingEvent implements - StreamingErrorEvent { +final class StreamingErrorEventImpl extends AbstractStreamingEvent + implements StreamingErrorEvent { private final Exception exception; diff --git a/server/src/main/java/com/vaadin/server/communication/StreamingProgressEventImpl.java b/server/src/main/java/com/vaadin/server/communication/StreamingProgressEventImpl.java index 7f2428a55d..10fbbac08f 100644 --- a/server/src/main/java/com/vaadin/server/communication/StreamingProgressEventImpl.java +++ b/server/src/main/java/com/vaadin/server/communication/StreamingProgressEventImpl.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -18,8 +18,8 @@ package com.vaadin.server.communication; import com.vaadin.server.StreamVariable.StreamingProgressEvent; @SuppressWarnings("serial") -final class StreamingProgressEventImpl extends AbstractStreamingEvent implements - StreamingProgressEvent { +final class StreamingProgressEventImpl extends AbstractStreamingEvent + implements StreamingProgressEvent { public StreamingProgressEventImpl(final String filename, final String type, long contentLength, long bytesReceived) { diff --git a/server/src/main/java/com/vaadin/server/communication/StreamingStartEventImpl.java b/server/src/main/java/com/vaadin/server/communication/StreamingStartEventImpl.java index a2ce075458..42ed8a0bb9 100644 --- a/server/src/main/java/com/vaadin/server/communication/StreamingStartEventImpl.java +++ b/server/src/main/java/com/vaadin/server/communication/StreamingStartEventImpl.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -18,8 +18,8 @@ package com.vaadin.server.communication; import com.vaadin.server.StreamVariable.StreamingStartEvent; @SuppressWarnings("serial") -final class StreamingStartEventImpl extends AbstractStreamingEvent implements - StreamingStartEvent { +final class StreamingStartEventImpl extends AbstractStreamingEvent + implements StreamingStartEvent { private boolean disposed; diff --git a/server/src/main/java/com/vaadin/server/communication/UIInitHandler.java b/server/src/main/java/com/vaadin/server/communication/UIInitHandler.java index f380a6df6e..f66dbe4107 100644 --- a/server/src/main/java/com/vaadin/server/communication/UIInitHandler.java +++ b/server/src/main/java/com/vaadin/server/communication/UIInitHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -47,7 +47,7 @@ import elemental.json.impl.JsonUtil; /** * Handles an initial request from the client to initialize a {@link UI}. - * + * * @author Vaadin Ltd * @since 7.1 */ @@ -91,7 +91,7 @@ public abstract class UIInitHandler extends SynchronizedRequestHandler { * Commit the JSON response. We can't write immediately to the output stream * as we want to write only a critical notification if something goes wrong * during the response handling. - * + * * @param request * The request that resulted in this response * @param response @@ -122,7 +122,8 @@ public abstract class UIInitHandler extends SynchronizedRequestHandler { return true; } - private UI getBrowserDetailsUI(VaadinRequest request, VaadinSession session) { + private UI getBrowserDetailsUI(VaadinRequest request, + VaadinSession session) { VaadinService vaadinService = request.getService(); List uiProviders = session.getUIProviders(); @@ -162,17 +163,16 @@ public abstract class UIInitHandler extends SynchronizedRequestHandler { UI retainedUI = session.getUIByEmbedId(embedId); if (retainedUI != null) { - if (vaadinService.preserveUIOnRefresh(provider, new UICreateEvent( - request, uiClass))) { + if (vaadinService.preserveUIOnRefresh(provider, + new UICreateEvent(request, uiClass))) { if (uiClass.isInstance(retainedUI)) { reinitUI(retainedUI, request); return retainedUI; } else { - getLogger().info( - "Not using the preserved UI " + embedId - + " because it is of type " - + retainedUI.getClass() + " but " + uiClass - + " is expected for the request."); + getLogger().info("Not using the preserved UI " + embedId + + " because it is of type " + retainedUI.getClass() + + " but " + uiClass + + " is expected for the request."); } } /* @@ -218,9 +218,8 @@ public abstract class UIInitHandler extends SynchronizedRequestHandler { // Warn if the window can't be preserved if (embedId == null && vaadinService.preserveUIOnRefresh(provider, event)) { - getLogger().warning( - "There is no embed id available for UI " + uiClass - + " that should be preserved."); + getLogger().warning("There is no embed id available for UI " + + uiClass + " that should be preserved."); } return ui; @@ -228,13 +227,13 @@ public abstract class UIInitHandler extends SynchronizedRequestHandler { /** * Constructs an embed id based on information in the request. - * + * * @since 7.2 - * + * * @param request * the request to get embed information from * @return the embed id, or null if id is not available. - * + * * @see UI#getEmbedId() */ protected String getEmbedId(VaadinRequest request) { @@ -252,7 +251,7 @@ public abstract class UIInitHandler extends SynchronizedRequestHandler { /** * Updates a UI that has already been initialized but is now loaded again, * e.g. because of {@link PreserveOnRefresh}. - * + * * @param ui * @param request */ @@ -264,7 +263,7 @@ public abstract class UIInitHandler extends SynchronizedRequestHandler { /** * Generates the initial UIDL message that can e.g. be included in a html * page to avoid a separate round trip just for getting the UIDL. - * + * * @param request * the request that caused the initialization * @param uI @@ -295,7 +294,7 @@ public abstract class UIInitHandler extends SynchronizedRequestHandler { /** * Gets the security key (and generates one if needed) as UIDL. - * + * * @param session * the vaadin session to which the security key belongs * @return the security key UIDL or "" if the feature is turned off diff --git a/server/src/main/java/com/vaadin/server/communication/UidlRequestHandler.java b/server/src/main/java/com/vaadin/server/communication/UidlRequestHandler.java index 20b906c3e6..a9933a0054 100644 --- a/server/src/main/java/com/vaadin/server/communication/UidlRequestHandler.java +++ b/server/src/main/java/com/vaadin/server/communication/UidlRequestHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -38,16 +38,16 @@ import elemental.json.JsonException; /** * Processes a UIDL request from the client. - * + * * Uses {@link ServerRpcHandler} to execute client-to-server RPC invocations and * {@link UidlWriter} to write state changes and client RPC calls back to the * client. - * + * * @author Vaadin Ltd * @since 7.1 */ -public class UidlRequestHandler extends SynchronizedRequestHandler implements - SessionExpiredHandler { +public class UidlRequestHandler extends SynchronizedRequestHandler + implements SessionExpiredHandler { public static final String UIDL_PATH = "UIDL/"; @@ -59,7 +59,7 @@ public class UidlRequestHandler extends SynchronizedRequestHandler implements /** * Creates the ServerRpcHandler to use - * + * * @since 7.7 * @return the ServerRpcHandler to use */ @@ -132,7 +132,7 @@ public class UidlRequestHandler extends SynchronizedRequestHandler implements /** * Writes the opening of JSON message to be sent to client. - * + * * @param outWriter * @param response * @throws IOException @@ -149,7 +149,7 @@ public class UidlRequestHandler extends SynchronizedRequestHandler implements /* * (non-Javadoc) - * + * * @see * com.vaadin.server.SessionExpiredHandler#handleSessionExpired(com.vaadin * .server.VaadinRequest, com.vaadin.server.VaadinResponse) @@ -176,7 +176,7 @@ public class UidlRequestHandler extends SynchronizedRequestHandler implements /** * Returns the JSON which should be returned to the client when a request * for a non-existent UI arrives. - * + * * @param service * The VaadinService * @param vaadinRequest @@ -186,8 +186,8 @@ public class UidlRequestHandler extends SynchronizedRequestHandler implements */ static String getUINotFoundErrorJSON(VaadinService service, VaadinRequest vaadinRequest) { - SystemMessages ci = service.getSystemMessages( - vaadinRequest.getLocale(), vaadinRequest); + SystemMessages ci = service.getSystemMessages(vaadinRequest.getLocale(), + vaadinRequest); // Session Expired is not really the correct message as the // session exists but the requested UI does not. // Using Communication Error for now. diff --git a/server/src/main/java/com/vaadin/server/communication/UidlWriter.java b/server/src/main/java/com/vaadin/server/communication/UidlWriter.java index 8a4e62fb24..c61060d95f 100644 --- a/server/src/main/java/com/vaadin/server/communication/UidlWriter.java +++ b/server/src/main/java/com/vaadin/server/communication/UidlWriter.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -50,7 +50,7 @@ import elemental.json.impl.JsonUtil; * Serializes pending server-side changes to UI state to JSON. This includes * shared state, client RPC invocations, connector hierarchy changes, connector * type information among others. - * + * * @author Vaadin Ltd * @since 7.1 */ @@ -58,7 +58,7 @@ public class UidlWriter implements Serializable { /** * Writes a JSON object containing all pending changes to the given UI. - * + * * @param ui * The {@link UI} whose changes to write * @param writer @@ -68,7 +68,7 @@ public class UidlWriter implements Serializable { * @param async * True if this message is sent by the server asynchronously, * false if it is a response to a client message. - * + * * @throws IOException * If the writing fails. */ @@ -116,17 +116,15 @@ public class UidlWriter implements Serializable { } } - getLogger().log( - Level.FINE, - "Found " + processedConnectors.size() - + " dirty connectors to paint"); + getLogger().log(Level.FINE, "Found " + processedConnectors.size() + + " dirty connectors to paint"); uiConnectorTracker.setWritingResponse(true); try { int syncId = service.getDeploymentConfiguration() - .isSyncIdCheckEnabled() ? uiConnectorTracker - .getCurrentSyncId() : -1; + .isSyncIdCheckEnabled() + ? uiConnectorTracker.getCurrentSyncId() : -1; writer.write("\"" + ApplicationConstants.SERVER_SYNC_ID + "\": " + syncId + ", "); if (repaintAll) { @@ -159,8 +157,8 @@ public class UidlWriter implements Serializable { // processing. writer.write("\"state\":"); - Set stateUpdateConnectors = new SharedStateWriter().write( - ui, writer); + Set stateUpdateConnectors = new SharedStateWriter() + .write(ui, writer); writer.write(", "); // close states // TODO This should be optimized. The type only needs to be @@ -241,8 +239,8 @@ public class UidlWriter implements Serializable { if (typeMappingsOpen) { // send the whole type inheritance map if any new mappings for (Class class1 : usedClientConnectors) { - if (!ClientConnector.class.isAssignableFrom(class1 - .getSuperclass())) { + if (!ClientConnector.class + .isAssignableFrom(class1.getSuperclass())) { continue; } if (!typeInheritanceMapOpen) { @@ -254,8 +252,8 @@ public class UidlWriter implements Serializable { writer.write("\""); writer.write(manager.getTagForType(class1)); writer.write("\" : "); - writer.write(manager - .getTagForType((Class) class1 + writer.write(manager.getTagForType( + (Class) class1 .getSuperclass())); } if (typeInheritanceMapOpen) { @@ -267,7 +265,7 @@ public class UidlWriter implements Serializable { /* * Ensure super classes come before sub classes to get script * dependency order right. Sub class @JavaScript might assume that - * + * * @JavaScript defined by super class is already loaded. */ Collections.sort(newConnectorTypes, new Comparator>() { @@ -294,8 +292,8 @@ public class UidlWriter implements Serializable { .getAnnotation(JavaScript.class); if (jsAnnotation != null) { for (String uri : jsAnnotation.value()) { - scriptDependencies.add(manager.registerDependency(uri, - class1)); + scriptDependencies + .add(manager.registerDependency(uri, class1)); } } @@ -303,8 +301,8 @@ public class UidlWriter implements Serializable { .getAnnotation(StyleSheet.class); if (styleAnnotation != null) { for (String uri : styleAnnotation.value()) { - styleDependencies.add(manager.registerDependency(uri, - class1)); + styleDependencies + .add(manager.registerDependency(uri, class1)); } } } @@ -327,7 +325,8 @@ public class UidlWriter implements Serializable { uiConnectorTracker.markClientSideInitialized(connector); } - assert (uiConnectorTracker.getDirtyConnectors().isEmpty()) : "Connectors have been marked as dirty during the end of the paint phase. This is most certainly not intended."; + assert (uiConnectorTracker.getDirtyConnectors() + .isEmpty()) : "Connectors have been marked as dirty during the end of the paint phase. This is most certainly not intended."; writePerformanceData(ui, writer); } finally { @@ -348,15 +347,15 @@ public class UidlWriter implements Serializable { /** * Adds the performance timing data (used by TestBench 3) to the UIDL * response. - * + * * @throws IOException */ private void writePerformanceData(UI ui, Writer writer) throws IOException { if (!ui.getSession().getService().getDeploymentConfiguration() .isProductionMode()) { - writer.write(String.format(", \"timings\":[%d, %d]", ui - .getSession().getCumulativeRequestDuration(), ui - .getSession().getLastRequestDuration())); + writer.write(String.format(", \"timings\":[%d, %d]", + ui.getSession().getCumulativeRequestDuration(), + ui.getSession().getLastRequestDuration())); } } diff --git a/server/src/main/java/com/vaadin/server/communication/data/DataGenerator.java b/server/src/main/java/com/vaadin/server/communication/data/DataGenerator.java index 58ba1b3b00..2a45e05a0c 100644 --- a/server/src/main/java/com/vaadin/server/communication/data/DataGenerator.java +++ b/server/src/main/java/com/vaadin/server/communication/data/DataGenerator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -28,7 +28,7 @@ import elemental.json.JsonObject; *

        * This class also provides a way to remove any unneeded data once the data * object is no longer used on the client-side. - * + * * @since 7.6 * @author Vaadin Ltd */ @@ -36,7 +36,7 @@ public interface DataGenerator extends Serializable { /** * Adds data to row object for given item and item id being sent to client. - * + * * @param itemId * item id of item * @param item @@ -50,7 +50,7 @@ public interface DataGenerator extends Serializable { * Informs the DataGenerator that an item id has been dropped and is no * longer needed. This method should clean up any unneeded stored data * related to the item. - * + * * @param itemId * removed item id */ diff --git a/server/src/main/java/com/vaadin/server/communication/data/RpcDataProviderExtension.java b/server/src/main/java/com/vaadin/server/communication/data/RpcDataProviderExtension.java index 08c70c14cf..fb500eb870 100644 --- a/server/src/main/java/com/vaadin/server/communication/data/RpcDataProviderExtension.java +++ b/server/src/main/java/com/vaadin/server/communication/data/RpcDataProviderExtension.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -58,7 +58,7 @@ import elemental.json.JsonObject; * implemented as an Extension hardcoded to support a specific connector type. * This will be changed once framework support for something more flexible has * been implemented. - * + * * @since 7.4 * @author Vaadin Ltd */ @@ -66,7 +66,7 @@ public class RpcDataProviderExtension extends AbstractExtension { /** * Class for keeping track of current items and ValueChangeListeners. - * + * * @since 7.6 */ private class ActiveItemHandler implements Serializable, DataGenerator { @@ -80,7 +80,7 @@ public class RpcDataProviderExtension extends AbstractExtension { *

        * Note: This method will clean up any unneeded listeners and key * mappings - * + * * @param itemIds * collection of new active item ids */ @@ -101,7 +101,7 @@ public class RpcDataProviderExtension extends AbstractExtension { /** * Marks given item id as dropped. Dropped items are cleared when adding * new active items. - * + * * @param itemId * dropped item id */ @@ -113,7 +113,7 @@ public class RpcDataProviderExtension extends AbstractExtension { /** * Gets a collection copy of currently active item ids. - * + * * @return collection of item ids */ public Collection getActiveItemIds() { @@ -122,7 +122,7 @@ public class RpcDataProviderExtension extends AbstractExtension { /** * Gets a collection copy of currently active ValueChangeListeners. - * + * * @return collection of value change listeners */ public Collection getValueChangeListeners() { @@ -163,7 +163,7 @@ public class RpcDataProviderExtension extends AbstractExtension { * Since there's no Container-wide possibility to listen to any kind of * value changes, an instance of this class needs to be attached to each and * every Item's Property in the container. - * + * * @see Grid#addValueChangeListener(Container, Object, Object) * @see Grid#valueChangeListeners */ @@ -199,8 +199,8 @@ public class RpcDataProviderExtension extends AbstractExtension { private void internalAddColumns(Collection addedColumns) { for (final Column column : addedColumns) { - final Property property = item.getItemProperty(column - .getPropertyId()); + final Property property = item + .getItemProperty(column.getPropertyId()); if (property instanceof ValueChangeNotifier) { ((ValueChangeNotifier) property) .addValueChangeListener(this); @@ -210,8 +210,8 @@ public class RpcDataProviderExtension extends AbstractExtension { public void removeColumns(Collection removedColumns) { for (final Column column : removedColumns) { - final Property property = item.getItemProperty(column - .getPropertyId()); + final Property property = item + .getItemProperty(column.getPropertyId()); if (property instanceof ValueChangeNotifier) { ((ValueChangeNotifier) property) .removeValueChangeListener(this); @@ -278,7 +278,7 @@ public class RpcDataProviderExtension extends AbstractExtension { /** * Creates a new data provider using the given container. - * + * * @param container * the container to make available */ @@ -297,8 +297,8 @@ public class RpcDataProviderExtension extends AbstractExtension { @Override public void dropRows(JsonArray rowKeys) { for (int i = 0; i < rowKeys.length(); ++i) { - activeItemHandler.dropActiveItem(getKeyMapper().get( - rowKeys.getString(i))); + activeItemHandler.dropActiveItem( + getKeyMapper().get(rowKeys.getString(i))); } } }); @@ -383,7 +383,8 @@ public class RpcDataProviderExtension extends AbstractExtension { diff = cached.length(); } - for (int i = 0; i < newRange.length() && i + diff < itemIds.size(); ++i) { + for (int i = 0; i < newRange.length() + && i + diff < itemIds.size(); ++i) { Object itemId = itemIds.get(i + diff); Item item = container.getItem(itemId); @@ -408,7 +409,7 @@ public class RpcDataProviderExtension extends AbstractExtension { /** * Makes the data source available to the given {@link Grid} component. - * + * * @param component * the remote data grid component to extend * @param columnKeys @@ -422,7 +423,7 @@ public class RpcDataProviderExtension extends AbstractExtension { * Adds a {@link DataGenerator} for this {@code RpcDataProviderExtension}. * DataGenerators are called when sending row data to client. If given * DataGenerator is already added, this method does nothing. - * + * * @since 7.6 * @param generator * generator to add @@ -435,7 +436,7 @@ public class RpcDataProviderExtension extends AbstractExtension { * Removes a {@link DataGenerator} from this * {@code RpcDataProviderExtension}. If given DataGenerator is not added to * this data provider, this method does nothing. - * + * * @since 7.6 * @param generator * generator to remove @@ -447,7 +448,7 @@ public class RpcDataProviderExtension extends AbstractExtension { /** * Informs the client side that new rows have been inserted into the data * source. - * + * * @param index * the index at which new rows have been inserted * @param count @@ -478,7 +479,7 @@ public class RpcDataProviderExtension extends AbstractExtension { /** * Informs the client side that rows have been removed from the data source. - * + * * @param index * the index of the first row removed * @param count @@ -507,7 +508,7 @@ public class RpcDataProviderExtension extends AbstractExtension { /** * Informs the client side that data of a row has been modified in the data * source. - * + * * @param itemId * the item Id the row that was updated */ @@ -576,7 +577,7 @@ public class RpcDataProviderExtension extends AbstractExtension { /** * Informs all DataGenerators than an item id has been dropped. - * + * * @param droppedItemIds * collection of dropped item ids */ @@ -591,7 +592,7 @@ public class RpcDataProviderExtension extends AbstractExtension { /** * Informs this data provider that given columns have been removed from * grid. - * + * * @param removedColumns * a list of removed columns */ @@ -607,7 +608,7 @@ public class RpcDataProviderExtension extends AbstractExtension { /** * Informs this data provider that given columns have been added to grid. - * + * * @param addedColumns * a list of added columns */ diff --git a/server/src/main/java/com/vaadin/server/themeutils/SASSAddonImportFileCreator.java b/server/src/main/java/com/vaadin/server/themeutils/SASSAddonImportFileCreator.java index cfee2a320e..2f8b1459b5 100644 --- a/server/src/main/java/com/vaadin/server/themeutils/SASSAddonImportFileCreator.java +++ b/server/src/main/java/com/vaadin/server/themeutils/SASSAddonImportFileCreator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -36,11 +36,11 @@ import com.vaadin.server.widgetsetutils.ClassPathExplorer.LocationInfo; * Helper class for managing the addon imports and creating an a SCSS file for * importing all your addon themes. The helper method searches the classpath for * Vaadin addons and uses the 'Vaadin-Themes' metadata to create the imports. - * + * *

        * The addons.scss is always overwritten when this tool is invoked. *

        - * + * * @since 7.1 */ public class SASSAddonImportFileCreator { @@ -51,7 +51,7 @@ public class SASSAddonImportFileCreator { + "will be overwritten from time to time."; /** - * + * * @param args * Theme directory where the addons.scss file should be created */ @@ -66,7 +66,7 @@ public class SASSAddonImportFileCreator { /** * Updates a themes addons.scss with the addon themes found on the classpath - * + * * @param themeDirectory * The target theme directory */ @@ -87,8 +87,8 @@ public class SASSAddonImportFileCreator { .getAvailableWidgetSetsAndStylesheets(); try { - PrintStream printStream = new PrintStream(new FileOutputStream( - addonImports)); + PrintStream printStream = new PrintStream( + new FileOutputStream(addonImports)); printStream.println("/* " + ADDON_IMPORTS_FILE_TEXT + " */"); @@ -119,8 +119,8 @@ public class SASSAddonImportFileCreator { List mixins = new ArrayList(); for (String path : paths) { - mixins.addAll(addImport(printStream, path, - addonThemes.get(path))); + mixins.addAll( + addImport(printStream, path, addonThemes.get(path))); printStream.println(); } @@ -187,7 +187,8 @@ public class SASSAddonImportFileCreator { private static void createAddonsMixin(PrintStream stream, List mixins) { - stream.println("/* Import and include this mixin into your project theme to include the addon themes */"); + stream.println( + "/* Import and include this mixin into your project theme to include the addon themes */"); stream.println("@mixin addons {"); for (String addon : mixins) { stream.println("\t@include " + addon + ";"); diff --git a/server/src/main/java/com/vaadin/server/widgetsetutils/ClassPathExplorer.java b/server/src/main/java/com/vaadin/server/widgetsetutils/ClassPathExplorer.java index 99ec884c42..fefdf18e70 100644 --- a/server/src/main/java/com/vaadin/server/widgetsetutils/ClassPathExplorer.java +++ b/server/src/main/java/com/vaadin/server/widgetsetutils/ClassPathExplorer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -49,7 +49,7 @@ import java.util.jar.Manifest; * appropriate monkey code for gwt directly in annotation processor and get rid * of {@link WidgetMapGenerator}. Using annotation processor might be a good * idea when dropping Java 1.5 support (integrated to javac in 6). - * + * */ public class ClassPathExplorer { @@ -71,7 +71,7 @@ public class ClassPathExplorer { /** * Contains information about widgetsets and themes found on the classpath - * + * * @since 7.1 */ public static class LocationInfo { @@ -80,7 +80,8 @@ public class ClassPathExplorer { private final Map addonStyles; - public LocationInfo(Map widgetsets, Map themes) { + public LocationInfo(Map widgetsets, + Map themes) { this.widgetsets = widgetsets; addonStyles = themes; } @@ -107,7 +108,8 @@ public class ClassPathExplorer { * slash, or a URL for a JAR file) to the corresponding URLs. This is * constructed from the class path. */ - private static Map classpathLocations = getClasspathLocations(rawClasspathEntries); + private static Map classpathLocations = getClasspathLocations( + rawClasspathEntries); private static boolean debug = false; @@ -126,7 +128,7 @@ public class ClassPathExplorer { /** * Finds the names and locations of widgetsets available on the class path. - * + * * @return map from widgetset classname to widgetset location URL * @deprecated Use {@link #getAvailableWidgetSetsAndStylesheets()} instead */ @@ -138,7 +140,7 @@ public class ClassPathExplorer { /** * Finds the names and locations of widgetsets and themes available on the * class path. - * + * * @return */ public static LocationInfo getAvailableWidgetSetsAndStylesheets() { @@ -178,13 +180,13 @@ public class ClassPathExplorer { /** * Finds all GWT modules / Vaadin widgetsets and Addon styles in a valid * location. - * + * * If the location is a directory, all GWT modules (files with the * ".gwt.xml" extension) are added to widgetsets. - * + * * If the location is a JAR file, the comma-separated values of the * "Vaadin-Widgetsets" attribute in its manifest are added to widgetsets. - * + * * @param locationString * an entry in {@link #classpathLocations} * @param widgetsets @@ -192,9 +194,8 @@ public class ClassPathExplorer { * separators) to a URL (see {@link #classpathLocations}) - new * entries are added to this map */ - private static void searchForWidgetSetsAndAddonStyles( - String locationString, Map widgetsets, - Map addonStyles) { + private static void searchForWidgetSetsAndAddonStyles(String locationString, + Map widgetsets, Map addonStyles) { URL location = classpathLocations.get(locationString); File directory = new File(location.getFile()); @@ -210,8 +211,8 @@ public class ClassPathExplorer { // remove the .gwt.xml extension String classname = files[i].substring(0, files[i].length() - 8); - String packageName = locationString.substring(locationString - .lastIndexOf("/") + 1); + String packageName = locationString + .substring(locationString.lastIndexOf("/") + 1); classname = packageName + "." + classname; if (!WidgetSetBuilder.isWidgetset(classname)) { @@ -222,8 +223,8 @@ public class ClassPathExplorer { if (!widgetsets.containsKey(classname)) { String packagePath = packageName.replaceAll("\\.", "/"); - String basePath = location.getFile().replaceAll( - "/" + packagePath + "$", ""); + String basePath = location.getFile() + .replaceAll("/" + packagePath + "$", ""); try { URL url = new URL(location.getProtocol(), location.getHost(), location.getPort(), @@ -255,8 +256,8 @@ public class ClassPathExplorer { } // Check for widgetset attribute - String value = manifest.getMainAttributes().getValue( - "Vaadin-Widgetsets"); + String value = manifest.getMainAttributes() + .getValue("Vaadin-Widgetsets"); if (value != null) { String[] widgetsetNames = value.split(","); for (int i = 0; i < widgetsetNames.length; i++) { @@ -268,8 +269,8 @@ public class ClassPathExplorer { } // Check for theme attribute - value = manifest.getMainAttributes().getValue( - "Vaadin-Stylesheets"); + value = manifest.getMainAttributes() + .getValue("Vaadin-Stylesheets"); if (value != null) { String[] stylesheets = value.split(","); for (int i = 0; i < stylesheets.length; i++) { @@ -290,9 +291,9 @@ public class ClassPathExplorer { /** * Splits the current class path into entries, and filters them accepting * directories, Vaadin add-on JARs with widgetsets and Vaadin JARs. - * + * * Some other non-JAR entries may also be included in the result. - * + * * @return filtered list of class path entries */ private final static List getRawClasspathEntries() { @@ -325,9 +326,9 @@ public class ClassPathExplorer { /** * Determine every URL location defined by the current classpath, and it's * associated package name. - * + * * See {@link #classpathLocations} for information on output format. - * + * * @param rawClasspathEntries * raw class path entries as split from the Java class path * string @@ -352,14 +353,14 @@ public class ClassPathExplorer { /** * Checks a class path entry to see whether it can contain widgets and * widgetsets. - * + * * All directories are automatically accepted. JARs are accepted if they * have the "Vaadin-Widgetsets" attribute in their manifest or the JAR file * name contains "vaadin-" or ".vaadin.". - * + * * Also other non-JAR entries may be accepted, the caller should be prepared * to handle them. - * + * * @param classpathEntry * class path entry string as given in the Java class path * @return true if the entry should be considered when looking for widgets @@ -390,10 +391,12 @@ public class ClassPathExplorer { if (manifest != null) { Attributes mainAttributes = manifest .getMainAttributes(); - if (mainAttributes.getValue("Vaadin-Widgetsets") != null) { + if (mainAttributes + .getValue("Vaadin-Widgetsets") != null) { return true; } - if (mainAttributes.getValue("Vaadin-Stylesheets") != null) { + if (mainAttributes + .getValue("Vaadin-Stylesheets") != null) { return true; } } @@ -415,7 +418,7 @@ public class ClassPathExplorer { /** * Recursively add subdirectories and jar files to locations - see * {@link #classpathLocations}. - * + * * @param name * @param file * @param locations @@ -462,7 +465,7 @@ public class ClassPathExplorer { /** * Add a jar file to locations - see {@link #classpathLocations}. - * + * * @param name * @param locations */ @@ -486,12 +489,12 @@ public class ClassPathExplorer { /** * Find and return the default source directory where to create new * widgetsets. - * + * * Return the first directory (not a JAR file etc.) on the classpath by * default. - * + * * TODO this could be done better... - * + * * @return URL */ public static URL getDefaultSourceDirectory() { @@ -501,17 +504,17 @@ public class ClassPathExplorer { /** * Find and return the source directory which contains the given widgetset * file. - * + * * If not applicable or widgetsetFileName is null, return the first * directory (not a JAR file etc.) on the classpath. - * + * * TODO this could be done better... * * @since 7.6.5 - * + * * @param widgetsetFileName * relative path for the widgetset - * + * * @return URL */ public static URL getWidgetsetSourceDirectory(String widgetsetFileName) { @@ -541,7 +544,8 @@ public class ClassPathExplorer { } if (widgetsetFileName == null - || new File(directory, widgetsetFileName).exists()) { + || new File(directory, widgetsetFileName) + .exists()) { return directoryUrl; } } catch (MalformedURLException e) { diff --git a/server/src/main/java/com/vaadin/server/widgetsetutils/WidgetSetBuilder.java b/server/src/main/java/com/vaadin/server/widgetsetutils/WidgetSetBuilder.java index 58e90f9268..74e13d35ee 100644 --- a/server/src/main/java/com/vaadin/server/widgetsetutils/WidgetSetBuilder.java +++ b/server/src/main/java/com/vaadin/server/widgetsetutils/WidgetSetBuilder.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -37,11 +37,11 @@ import java.util.regex.Pattern; /** * Helper class to update widgetsets GWT module configuration file. Can be used * command line or via IDE tools. - * + * *

        * If module definition file contains text "WS Compiler: manually edited", tool * will skip editing file. - * + * */ public class WidgetSetBuilder { @@ -84,28 +84,25 @@ public class WidgetSetBuilder { } } widgetsetFile.createNewFile(); - PrintStream printStream = new PrintStream(new FileOutputStream( - widgetsetFile)); - printStream - .print("\n" - + "\n"); + PrintStream printStream = new PrintStream( + new FileOutputStream(widgetsetFile)); + printStream.print("\n" + + "\n"); printStream.print("\n"); - printStream - .print(" \n" - + " \n\n" - + " \n" - + " \n\n"); + printStream.print(" \n" + + " \n\n" + + " \n" + + " \n\n"); printStream.print("\n\n"); printStream.close(); changed = true; @@ -115,7 +112,8 @@ public class WidgetSetBuilder { if (isEditable(content)) { String originalContent = content; - Collection oldInheritedWidgetsets = getCurrentInheritedWidgetsets(content); + Collection oldInheritedWidgetsets = getCurrentInheritedWidgetsets( + content); // add widgetsets that do not exist Iterator i = availableWidgetSets.keySet().iterator(); @@ -164,8 +162,8 @@ public class WidgetSetBuilder { } private static String addWidgetSet(String ws, String content) { - return content.replace("", "\n " + "\n"); + return content.replace("", + "\n " + "\n"); } private static Collection getCurrentInheritedWidgetsets( @@ -209,7 +207,8 @@ public class WidgetSetBuilder { o.println(" 2. Give the widgetsetname (to be created or updated)" + " as first parameter"); o.println(); - o.println("All found vaadin widgetsets will be inherited in given widgetset"); + o.println( + "All found vaadin widgetsets will be inherited in given widgetset"); } diff --git a/server/src/main/java/com/vaadin/ui/AbsoluteLayout.java b/server/src/main/java/com/vaadin/ui/AbsoluteLayout.java index c62da24612..0be3c6cb46 100644 --- a/server/src/main/java/com/vaadin/ui/AbsoluteLayout.java +++ b/server/src/main/java/com/vaadin/ui/AbsoluteLayout.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -40,11 +40,11 @@ import com.vaadin.ui.declarative.DesignContext; /** * AbsoluteLayout is a layout implementation that mimics html absolute * positioning. - * + * */ @SuppressWarnings("serial") -public class AbsoluteLayout extends AbstractLayout implements - LayoutClickNotifier { +public class AbsoluteLayout extends AbstractLayout + implements LayoutClickNotifier { // constants for design attributes private static final String ATTR_TOP = ":top"; @@ -90,7 +90,7 @@ public class AbsoluteLayout extends AbstractLayout implements /** * Gets the number of contained components. Consistent with the iterator * returned by {@link #getComponentIterator()}. - * + * * @return the number of contained components */ @Override @@ -103,7 +103,8 @@ public class AbsoluteLayout extends AbstractLayout implements * old components position. */ @Override - public void replaceComponent(Component oldComponent, Component newComponent) { + public void replaceComponent(Component oldComponent, + Component newComponent) { ComponentPosition position = getPosition(oldComponent); removeComponent(oldComponent); addComponent(newComponent, position); @@ -111,10 +112,9 @@ public class AbsoluteLayout extends AbstractLayout implements /* * (non-Javadoc) - * - * @see - * com.vaadin.ui.AbstractComponentContainer#addComponent(com.vaadin.ui.Component - * ) + * + * @see com.vaadin.ui.AbstractComponentContainer#addComponent(com.vaadin.ui. + * Component ) */ @Override public void addComponent(Component c) { @@ -129,7 +129,7 @@ public class AbsoluteLayout extends AbstractLayout implements * 10 pixels from the left and 10 pixels from the top. The identifiers: * "top","left","right" and "bottom" can be used to specify the position. *

        - * + * * @param c * The component to add to the layout * @param cssPosition @@ -144,7 +144,7 @@ public class AbsoluteLayout extends AbstractLayout implements /** * Adds the component using the given position. Ensures the position is only * set if the component is added correctly. - * + * * @param c * The component to add * @param position @@ -175,7 +175,7 @@ public class AbsoluteLayout extends AbstractLayout implements * Removes the component from all internal data structures. Does not * actually remove the component from the layout (this is assumed to have * been done by the caller). - * + * * @param c * The component to remove */ @@ -194,8 +194,8 @@ public class AbsoluteLayout extends AbstractLayout implements Map connectorToPosition = new HashMap(); for (Iterator ci = getComponentIterator(); ci.hasNext();) { Component c = ci.next(); - connectorToPosition.put(c.getConnectorId(), getPosition(c) - .getCSSString()); + connectorToPosition.put(c.getConnectorId(), + getPosition(c).getCSSString()); } getState().connectorToCssPosition = connectorToPosition; @@ -203,7 +203,7 @@ public class AbsoluteLayout extends AbstractLayout implements /* * (non-Javadoc) - * + * * @see * com.vaadin.ui.AbstractComponentContainer#removeComponent(com.vaadin.ui * .Component) @@ -222,7 +222,7 @@ public class AbsoluteLayout extends AbstractLayout implements * {@link #setPosition(Component, ComponentPosition)} with the updated * {@link ComponentPosition} object. *

        - * + * * @param component * The component which position is needed * @return An instance of ComponentPosition containing the position of the @@ -235,7 +235,7 @@ public class AbsoluteLayout extends AbstractLayout implements /** * Sets the position of a component in the layout. - * + * * @param component * @param position */ @@ -250,7 +250,7 @@ public class AbsoluteLayout extends AbstractLayout implements /** * Updates the position for a component. Caller must ensure component is a * child of this layout. - * + * * @param component * The component. Must be a child for this layout. Not enforced. * @param position @@ -283,11 +283,11 @@ public class AbsoluteLayout extends AbstractLayout implements /** * Sets the position attributes using CSS syntax. Attributes not * included in the string are reset to their unset states. - * + * *
                  * setCSSString("top:10px;left:20%;z-index:16;");
                  * 
        - * + * * @param css */ public void setCSSString(String css) { @@ -341,7 +341,7 @@ public class AbsoluteLayout extends AbstractLayout implements /** * Converts the internal values into a valid CSS string. - * + * * @return A valid CSS string */ public String getCSSString() { @@ -367,7 +367,7 @@ public class AbsoluteLayout extends AbstractLayout implements /** * Sets the 'top' attribute; distance from the top of the component to * the top edge of the layout. - * + * * @param topValue * The value of the 'top' attribute * @param topUnits @@ -383,7 +383,7 @@ public class AbsoluteLayout extends AbstractLayout implements /** * Sets the 'right' attribute; distance from the right of the component * to the right edge of the layout. - * + * * @param rightValue * The value of the 'right' attribute * @param rightUnits @@ -399,7 +399,7 @@ public class AbsoluteLayout extends AbstractLayout implements /** * Sets the 'bottom' attribute; distance from the bottom of the * component to the bottom edge of the layout. - * + * * @param bottomValue * The value of the 'bottom' attribute * @param units @@ -415,7 +415,7 @@ public class AbsoluteLayout extends AbstractLayout implements /** * Sets the 'left' attribute; distance from the left of the component to * the left edge of the layout. - * + * * @param leftValue * The value of the 'left' attribute * @param units @@ -430,7 +430,7 @@ public class AbsoluteLayout extends AbstractLayout implements /** * Sets the 'z-index' attribute; the visual stacking order - * + * * @param zIndex * The z-index for the component. */ @@ -442,7 +442,7 @@ public class AbsoluteLayout extends AbstractLayout implements /** * Sets the value of the 'top' attribute; distance from the top of the * component to the top edge of the layout. - * + * * @param topValue * The value of the 'left' attribute */ @@ -453,7 +453,7 @@ public class AbsoluteLayout extends AbstractLayout implements /** * Gets the 'top' attributes value in current units. - * + * * @see #getTopUnits() * @return The value of the 'top' attribute, null if not set */ @@ -463,7 +463,7 @@ public class AbsoluteLayout extends AbstractLayout implements /** * Gets the 'right' attributes value in current units. - * + * * @return The value of the 'right' attribute, null if not set * @see #getRightUnits() */ @@ -475,7 +475,7 @@ public class AbsoluteLayout extends AbstractLayout implements * Sets the 'right' attribute value (distance from the right of the * component to the right edge of the layout). Currently active units * are maintained. - * + * * @param rightValue * The value of the 'right' attribute * @see #setRightUnits(int) @@ -487,7 +487,7 @@ public class AbsoluteLayout extends AbstractLayout implements /** * Gets the 'bottom' attributes value using current units. - * + * * @return The value of the 'bottom' attribute, null if not set * @see #getBottomUnits() */ @@ -499,7 +499,7 @@ public class AbsoluteLayout extends AbstractLayout implements * Sets the 'bottom' attribute value (distance from the bottom of the * component to the bottom edge of the layout). Currently active units * are maintained. - * + * * @param bottomValue * The value of the 'bottom' attribute * @see #setBottomUnits(int) @@ -511,7 +511,7 @@ public class AbsoluteLayout extends AbstractLayout implements /** * Gets the 'left' attributes value using current units. - * + * * @return The value of the 'left' attribute, null if not set * @see #getLeftUnits() */ @@ -523,7 +523,7 @@ public class AbsoluteLayout extends AbstractLayout implements * Sets the 'left' attribute value (distance from the left of the * component to the left edge of the layout). Currently active units are * maintained. - * + * * @param leftValue * The value of the 'left' CSS-attribute * @see #setLeftUnits(int) @@ -535,7 +535,7 @@ public class AbsoluteLayout extends AbstractLayout implements /** * Gets the unit for the 'top' attribute - * + * * @return See {@link Sizeable} UNIT_SYMBOLS for a description of the * available units. */ @@ -545,7 +545,7 @@ public class AbsoluteLayout extends AbstractLayout implements /** * Sets the unit for the 'top' attribute - * + * * @param topUnits * See {@link Sizeable} UNIT_SYMBOLS for a description of the * available units. @@ -557,7 +557,7 @@ public class AbsoluteLayout extends AbstractLayout implements /** * Gets the unit for the 'right' attribute - * + * * @return See {@link Sizeable} UNIT_SYMBOLS for a description of the * available units. */ @@ -567,7 +567,7 @@ public class AbsoluteLayout extends AbstractLayout implements /** * Sets the unit for the 'right' attribute - * + * * @param rightUnits * See {@link Sizeable} UNIT_SYMBOLS for a description of the * available units. @@ -579,7 +579,7 @@ public class AbsoluteLayout extends AbstractLayout implements /** * Gets the unit for the 'bottom' attribute - * + * * @return See {@link Sizeable} UNIT_SYMBOLS for a description of the * available units. */ @@ -589,7 +589,7 @@ public class AbsoluteLayout extends AbstractLayout implements /** * Sets the unit for the 'bottom' attribute - * + * * @param bottomUnits * See {@link Sizeable} UNIT_SYMBOLS for a description of the * available units. @@ -601,7 +601,7 @@ public class AbsoluteLayout extends AbstractLayout implements /** * Gets the unit for the 'left' attribute - * + * * @return See {@link Sizeable} UNIT_SYMBOLS for a description of the * available units. */ @@ -611,7 +611,7 @@ public class AbsoluteLayout extends AbstractLayout implements /** * Sets the unit for the 'left' attribute - * + * * @param leftUnits * See {@link Sizeable} UNIT_SYMBOLS for a description of the * available units. @@ -623,7 +623,7 @@ public class AbsoluteLayout extends AbstractLayout implements /** * Gets the 'z-index' attribute. - * + * * @return the zIndex The z-index attribute */ public int getZIndex() { @@ -632,7 +632,7 @@ public class AbsoluteLayout extends AbstractLayout implements /* * (non-Javadoc) - * + * * @see java.lang.Object#toString() */ @Override @@ -677,7 +677,7 @@ public class AbsoluteLayout extends AbstractLayout implements /* * (non-Javadoc) - * + * * @see com.vaadin.ui.AbstractComponent#readDesign(org.jsoup.nodes .Node, * com.vaadin.ui.declarative.DesignContext) */ @@ -712,7 +712,7 @@ public class AbsoluteLayout extends AbstractLayout implements /* * (non-Javadoc) - * + * * @see com.vaadin.ui.AbstractComponent#writeDesign(org.jsoup.nodes.Node, * com.vaadin.ui.declarative.DesignContext) */ @@ -730,26 +730,29 @@ public class AbsoluteLayout extends AbstractLayout implements // handle position ComponentPosition position = getPosition(child); - writePositionAttribute(childElement, ATTR_TOP, position - .getTopUnits().getSymbol(), position.getTopValue()); - writePositionAttribute(childElement, ATTR_RIGHT, position - .getRightUnits().getSymbol(), position.getRightValue()); - writePositionAttribute(childElement, ATTR_BOTTOM, position - .getBottomUnits().getSymbol(), position.getBottomValue()); - writePositionAttribute(childElement, ATTR_LEFT, position - .getLeftUnits().getSymbol(), position.getLeftValue()); + writePositionAttribute(childElement, ATTR_TOP, + position.getTopUnits().getSymbol(), position.getTopValue()); + writePositionAttribute(childElement, ATTR_RIGHT, + position.getRightUnits().getSymbol(), + position.getRightValue()); + writePositionAttribute(childElement, ATTR_BOTTOM, + position.getBottomUnits().getSymbol(), + position.getBottomValue()); + writePositionAttribute(childElement, ATTR_LEFT, + position.getLeftUnits().getSymbol(), + position.getLeftValue()); // handle z-index if (position.getZIndex() >= 0) { - childElement - .attr(ATTR_Z_INDEX, String.valueOf(position.zIndex)); + childElement.attr(ATTR_Z_INDEX, + String.valueOf(position.zIndex)); } } } /** * Private method for writing position attributes - * + * * @since 7.4 * @param node * target node @@ -763,8 +766,8 @@ public class AbsoluteLayout extends AbstractLayout implements private void writePositionAttribute(Node node, String key, String symbol, Float value) { if (value != null) { - String valueString = DesignAttributeHandler.getFormatter().format( - value); + String valueString = DesignAttributeHandler.getFormatter() + .format(value); node.attr(key, valueString + symbol); } } diff --git a/server/src/main/java/com/vaadin/ui/AbstractColorPicker.java b/server/src/main/java/com/vaadin/ui/AbstractColorPicker.java index 4ce4e46d6a..ca5631c3b0 100644 --- a/server/src/main/java/com/vaadin/ui/AbstractColorPicker.java +++ b/server/src/main/java/com/vaadin/ui/AbstractColorPicker.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -37,11 +37,11 @@ import com.vaadin.ui.declarative.DesignContext; /** * An abstract class that defines default implementation for a color picker * component. - * + * * @since 7.0.0 */ -public abstract class AbstractColorPicker extends AbstractComponent implements - CloseListener, ColorSelector { +public abstract class AbstractColorPicker extends AbstractComponent + implements CloseListener, ColorSelector { private static final Method COLOR_CHANGE_METHOD; static { try { @@ -61,22 +61,22 @@ public abstract class AbstractColorPicker extends AbstractComponent implements /** * Calculate color from coordinates - * + * * @param x * the x-coordinate * @param y * the y-coordinate - * + * * @return the color */ public Color calculate(int x, int y); /** * Calculate coordinates from color - * + * * @param c * the c - * + * * @return the integer array with the coordinates */ public int[] calculate(Color c); @@ -139,7 +139,7 @@ public abstract class AbstractColorPicker extends AbstractComponent implements /** * Instantiates a new color picker. - * + * * @param popupCaption * the caption of the popup window */ @@ -149,7 +149,7 @@ public abstract class AbstractColorPicker extends AbstractComponent implements /** * Instantiates a new color picker. - * + * * @param popupCaption * the caption of the popup window * @param initialColor @@ -183,7 +183,7 @@ public abstract class AbstractColorPicker extends AbstractComponent implements * Set true if the component should show a default caption (css-code for the * currently selected color, e.g. #ffffff) when no other caption is * available. - * + * * @param enabled */ public void setDefaultCaptionEnabled(boolean enabled) { @@ -200,7 +200,7 @@ public abstract class AbstractColorPicker extends AbstractComponent implements /** * Sets the position of the popup window - * + * * @param x * the x-coordinate * @param y @@ -235,7 +235,7 @@ public abstract class AbstractColorPicker extends AbstractComponent implements /** * Fired when a color change event occurs - * + * * @param event * The color change event */ @@ -253,7 +253,7 @@ public abstract class AbstractColorPicker extends AbstractComponent implements /** * The style for the popup window - * + * * @param style * The style */ @@ -283,7 +283,7 @@ public abstract class AbstractColorPicker extends AbstractComponent implements /** * Gets the style for the popup window - * + * * @since 7.5.0 * @return popup window style */ @@ -293,7 +293,7 @@ public abstract class AbstractColorPicker extends AbstractComponent implements /** * Set the visibility of the RGB Tab - * + * * @param visible * The visibility */ @@ -311,7 +311,7 @@ public abstract class AbstractColorPicker extends AbstractComponent implements /** * Gets the visibility of the RGB Tab - * + * * @since 7.5.0 * @return visibility of the RGB tab */ @@ -321,7 +321,7 @@ public abstract class AbstractColorPicker extends AbstractComponent implements /** * Set the visibility of the HSV Tab - * + * * @param visible * The visibility */ @@ -338,7 +338,7 @@ public abstract class AbstractColorPicker extends AbstractComponent implements /** * Gets the visibility of the HSV Tab - * + * * @since 7.5.0 * @return visibility of the HSV tab */ @@ -348,7 +348,7 @@ public abstract class AbstractColorPicker extends AbstractComponent implements /** * Set the visibility of the Swatches Tab - * + * * @param visible * The visibility */ @@ -365,7 +365,7 @@ public abstract class AbstractColorPicker extends AbstractComponent implements /** * Gets the visibility of the Swatches Tab - * + * * @since 7.5.0 * @return visibility of the swatches tab */ @@ -375,7 +375,7 @@ public abstract class AbstractColorPicker extends AbstractComponent implements /** * Sets the visibility of the Color History - * + * * @param visible * The visibility */ @@ -388,7 +388,7 @@ public abstract class AbstractColorPicker extends AbstractComponent implements /** * Gets the visibility of the Color History - * + * * @since 7.5.0 * @return visibility of color history */ @@ -398,7 +398,7 @@ public abstract class AbstractColorPicker extends AbstractComponent implements /** * Sets the visibility of the CSS color code text field - * + * * @param visible * The visibility */ @@ -411,7 +411,7 @@ public abstract class AbstractColorPicker extends AbstractComponent implements /** * Gets the visibility of CSS color code text field - * + * * @since 7.5.0 * @return visibility of css color code text field */ @@ -431,7 +431,7 @@ public abstract class AbstractColorPicker extends AbstractComponent implements /** * Sets the default styles of the component - * + * */ abstract protected void setDefaultStyles(); @@ -452,7 +452,7 @@ public abstract class AbstractColorPicker extends AbstractComponent implements /** * Shows or hides popup-window depending on the given parameter. If there is * no such window yet, one is created. - * + * * @param open */ protected void showPopup(boolean open) { @@ -513,11 +513,11 @@ public abstract class AbstractColorPicker extends AbstractComponent implements * Set whether the caption text is rendered as HTML or not. You might need * to re-theme component to allow higher content than the original text * style. - * + * * If set to true, the captions are passed to the browser as html and the * developer is responsible for ensuring no harmful html is used. If set to * false, the content is passed to the browser as plain text. - * + * * @param htmlContentAllowed * true if caption is rendered as HTML, * false otherwise @@ -530,7 +530,7 @@ public abstract class AbstractColorPicker extends AbstractComponent implements /** * Return HTML rendering setting - * + * * @return true if the caption text is to be rendered as HTML, * false otherwise * @deprecated as of , use {@link #isCaptionAsHtml()} instead @@ -547,13 +547,14 @@ public abstract class AbstractColorPicker extends AbstractComponent implements Attributes attributes = design.attributes(); if (design.hasAttr("color")) { // Ignore the # character - String hexColor = DesignAttributeHandler.readAttribute("color", - attributes, String.class).substring(1); + String hexColor = DesignAttributeHandler + .readAttribute("color", attributes, String.class) + .substring(1); setColor(new Color(Integer.parseInt(hexColor, 16))); } if (design.hasAttr("popup-style")) { - setPopupStyle(PopupStyle.valueOf("POPUP_" - + attributes.get("popup-style").toUpperCase())); + setPopupStyle(PopupStyle.valueOf( + "POPUP_" + attributes.get("popup-style").toUpperCase())); } if (design.hasAttr("position")) { String[] position = attributes.get("position").split(","); @@ -572,8 +573,8 @@ public abstract class AbstractColorPicker extends AbstractComponent implements DesignAttributeHandler.writeAttribute("popup-style", attribute, (popupStyle == PopupStyle.POPUP_NORMAL ? "normal" : "simple"), "normal", String.class); - DesignAttributeHandler.writeAttribute("position", attribute, positionX - + "," + positionY, "0,0", String.class); + DesignAttributeHandler.writeAttribute("position", attribute, + positionX + "," + positionY, "0,0", String.class); } @Override diff --git a/server/src/main/java/com/vaadin/ui/AbstractComponent.java b/server/src/main/java/com/vaadin/ui/AbstractComponent.java index 8fa1f523ff..f0d5773736 100644 --- a/server/src/main/java/com/vaadin/ui/AbstractComponent.java +++ b/server/src/main/java/com/vaadin/ui/AbstractComponent.java @@ -69,7 +69,7 @@ import com.vaadin.util.ReflectTools; * {@link Component} interface. Basic UI components that are not derived from an * external component can inherit this class to easily qualify as Vaadin * components. Most components in Vaadin do just that. - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -134,7 +134,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /* * (non-Javadoc) - * + * * @see com.vaadin.ui.Component#setId(java.lang.String) */ @Override @@ -144,7 +144,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /* * (non-Javadoc) - * + * * @see com.vaadin.ui.Component#getId() */ @Override @@ -176,8 +176,8 @@ public abstract class AbstractComponent extends AbstractClientConnector public String getStyleName() { String s = ""; if (ComponentStateUtil.hasStyles(getState(false))) { - for (final Iterator it = getState(false).styles.iterator(); it - .hasNext();) { + for (final Iterator it = getState(false).styles + .iterator(); it.hasNext();) { s += it.next(); if (it.hasNext()) { s += " "; @@ -254,14 +254,14 @@ public abstract class AbstractComponent extends AbstractClientConnector /** * Adds or removes a style name. Multiple styles can be specified as a * space-separated list of style names. - * + * * If the {@code add} parameter is true, the style name is added to the * component. If the {@code add} parameter is false, the style name is * removed from the component. *

        * Functionally this is equivalent to using {@link #addStyleName(String)} or * {@link #removeStyleName(String)} - * + * * @since 7.5 * @param style * the style name to be added or removed @@ -292,7 +292,7 @@ public abstract class AbstractComponent extends AbstractClientConnector * Sets the component's caption String. Caption is the visible * name of the component. This method will trigger a * {@link RepaintRequestEvent}. - * + * * @param caption * the new caption String for the component. */ @@ -309,7 +309,7 @@ public abstract class AbstractComponent extends AbstractClientConnector * false, the caption is rendered in the browser as plain text. *

        * The default is false, i.e. to render that caption as plain text. - * + * * @param captionAsHtml * true if the captions are rendered as HTML, false if rendered * as plain text @@ -322,7 +322,7 @@ public abstract class AbstractComponent extends AbstractClientConnector * Checks whether captions are rendered as HTML *

        * The default is false, i.e. to render that caption as plain text. - * + * * @return true if the captions are rendered as HTML, false if rendered as * plain text */ @@ -352,20 +352,20 @@ public abstract class AbstractComponent extends AbstractClientConnector /** * Sets the locale of this component. - * + * *

              * // Component for which the locale is meaningful
              * InlineDateField date = new InlineDateField("Datum");
        -     * 
        +     *
              * // German language specified with ISO 639-1 language
              * // code and ISO 3166-1 alpha-2 country code.
              * date.setLocale(new Locale("de", "DE"));
        -     * 
        +     *
              * date.setResolution(DateField.RESOLUTION_DAY);
              * layout.addComponent(date);
              * 
        - * - * + * + * * @param locale * the locale to become this component's locale. */ @@ -391,7 +391,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /** * Sets the component's icon. This method will trigger a * {@link RepaintRequestEvent}. - * + * * @param icon * the icon to be shown with the component's caption. */ @@ -402,7 +402,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /* * (non-Javadoc) - * + * * @see com.vaadin.ui.Component#isEnabled() */ @Override @@ -412,7 +412,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /* * (non-Javadoc) - * + * * @see com.vaadin.ui.Component#setEnabled(boolean) */ @Override @@ -422,7 +422,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /* * (non-Javadoc) - * + * * @see com.vaadin.client.Connector#isConnectorEnabled() */ @Override @@ -443,7 +443,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /** * Returns the explicitly set immediate value. - * + * * @return the explicitly set immediate value or null if * {@link #setImmediate(boolean)} has not been explicitly invoked */ @@ -457,7 +457,7 @@ public abstract class AbstractComponent extends AbstractClientConnector * Certain operations such as adding a value change listener will set the * component into immediate mode if {@link #setImmediate(boolean)} has not * been explicitly called with false. - * + * * @return true if the component is in immediate mode (explicitly or * implicitly set), false if the component if not in immediate mode */ @@ -477,7 +477,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /** * Sets the component's immediate mode to the specified status. - * + * * @param immediate * the boolean value specifying if the component should be in the * immediate mode after the call. @@ -489,7 +489,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /* * (non-Javadoc) - * + * * @see com.vaadin.ui.Component#isVisible() */ @Override @@ -499,7 +499,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /* * (non-Javadoc) - * + * * @see com.vaadin.ui.Component#setVisible(boolean) */ @Override @@ -526,7 +526,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /* * (non-Javadoc) - * + * * @see com.vaadin.ui.Component#getDescription() */ @Override @@ -538,11 +538,11 @@ public abstract class AbstractComponent extends AbstractClientConnector * Sets the component's description. See {@link #getDescription()} for more * information on what the description is. This method will trigger a * {@link RepaintRequestEvent}. - * + * * The description is displayed as HTML in tooltips or directly in certain * components so care should be taken to avoid creating the possibility for * HTML injection and possibly XSS vulnerabilities. - * + * * @param description * the new description string for the component. */ @@ -567,8 +567,8 @@ public abstract class AbstractComponent extends AbstractClientConnector } if (parent != null && this.parent != null) { - throw new IllegalStateException(getClass().getName() - + " already has a parent."); + throw new IllegalStateException( + getClass().getName() + " already has a parent."); } // Send a detach event if the component is currently attached @@ -591,7 +591,7 @@ public abstract class AbstractComponent extends AbstractClientConnector * To find the Window that contains the component, use {@code Window w = * getParent(Window.class);} *

        - * + * * @param * The type of the ancestor * @param parentType @@ -612,7 +612,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /** * Gets the error message for this component. - * + * * @return ErrorMessage containing the description of the error state of the * component or null, if the component contains no errors. Extending * classes should override this method if they support other error @@ -625,9 +625,9 @@ public abstract class AbstractComponent extends AbstractClientConnector /** * Gets the component's error message. - * + * * @link Terminal.ErrorMessage#ErrorMessage(String, int) - * + * * @return the component's error message. */ public ErrorMessage getComponentError() { @@ -637,9 +637,9 @@ public abstract class AbstractComponent extends AbstractClientConnector /** * Sets the component's error message. The message may contain certain XML * tags, for more information see - * + * * @link Component.ErrorMessage#ErrorMessage(String, int) - * + * * @param componentError * the new ErrorMessage of the component. */ @@ -716,7 +716,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /** * Build CSS compatible string representation of height. - * + * * @return CSS height */ private String getCSSHeight() { @@ -725,7 +725,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /** * Build CSS compatible string representation of width. - * + * * @return CSS width */ private String getCSSWidth() { @@ -735,12 +735,12 @@ public abstract class AbstractComponent extends AbstractClientConnector /** * Returns the shared state bean with information to be sent from the server * to the client. - * + * * Subclasses should override this method and set any relevant fields of the * state returned by super.getState(). - * + * * @since 7.0 - * + * * @return updated component shared state */ @Override @@ -758,17 +758,15 @@ public abstract class AbstractComponent extends AbstractClientConnector super.beforeClientResponse(initial); // TODO This logic should be on the client side and the state should // simply be a data object with "width" and "height". - if (getHeight() >= 0 - && (getHeightUnits() != Unit.PERCENTAGE || ComponentSizeValidator - .parentCanDefineHeight(this))) { + if (getHeight() >= 0 && (getHeightUnits() != Unit.PERCENTAGE + || ComponentSizeValidator.parentCanDefineHeight(this))) { getState().height = "" + getCSSHeight(); } else { getState().height = ""; } - if (getWidth() >= 0 - && (getWidthUnits() != Unit.PERCENTAGE || ComponentSizeValidator - .parentCanDefineWidth(this))) { + if (getWidth() >= 0 && (getWidthUnits() != Unit.PERCENTAGE + || ComponentSizeValidator.parentCanDefineWidth(this))) { getState().width = "" + getCSSWidth(); } else { getState().width = ""; @@ -831,7 +829,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /** * Sets the data object, that can be used for any application specific data. * The component does not use or modify this data. - * + * * @param data * the Application specific data. * @since 3.1 @@ -842,7 +840,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /** * Gets the application specific data. See {@link #setData(Object)}. - * + * * @return the Application specific data set with setData function. * @since 3.1 */ @@ -854,7 +852,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /* * (non-Javadoc) - * + * * @see com.vaadin.Sizeable#getHeight() */ @Override @@ -864,7 +862,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /* * (non-Javadoc) - * + * * @see com.vaadin.server.Sizeable#getHeightUnits() */ @Override @@ -874,7 +872,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /* * (non-Javadoc) - * + * * @see com.vaadin.server.Sizeable#getWidth() */ @Override @@ -884,7 +882,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /* * (non-Javadoc) - * + * * @see com.vaadin.server.Sizeable#getWidthUnits() */ @Override @@ -894,7 +892,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /* * (non-Javadoc) - * + * * @see com.vaadin.server.Sizeable#setHeight(float, Unit) */ @Override @@ -910,7 +908,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /* * (non-Javadoc) - * + * * @see com.vaadin.server.Sizeable#setSizeFull() */ @Override @@ -921,7 +919,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /* * (non-Javadoc) - * + * * @see com.vaadin.server.Sizeable#setSizeUndefined() */ @Override @@ -932,7 +930,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /* * (non-Javadoc) - * + * * @see com.vaadin.server.Sizeable#setWidthUndefined() */ @Override @@ -942,7 +940,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /* * (non-Javadoc) - * + * * @see com.vaadin.server.Sizeable#setHeightUndefined() */ @Override @@ -952,7 +950,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /* * (non-Javadoc) - * + * * @see com.vaadin.server.Sizeable#setWidth(float, Unit) */ @Override @@ -968,7 +966,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /* * (non-Javadoc) - * + * * @see com.vaadin.server.Sizeable#setWidth(java.lang.String) */ @Override @@ -983,7 +981,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /* * (non-Javadoc) - * + * * @see com.vaadin.server.Sizeable#setHeight(java.lang.String) */ @Override @@ -998,7 +996,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /* * (non-Javadoc) - * + * * @see com.vaadin.ui.Component#readDesign(org.jsoup.nodes.Element, * com.vaadin.ui.declarative.DesignContext) */ @@ -1015,8 +1013,8 @@ public abstract class AbstractComponent extends AbstractClientConnector } // handle immediate if (attr.hasKey("immediate")) { - setImmediate(DesignAttributeHandler.getFormatter().parse( - attr.get("immediate"), Boolean.class)); + setImmediate(DesignAttributeHandler.getFormatter() + .parse(attr.get("immediate"), Boolean.class)); } // handle locale @@ -1027,15 +1025,14 @@ public abstract class AbstractComponent extends AbstractClientConnector readSize(attr); // handle component error if (attr.hasKey("error")) { - UserError error = new UserError(attr.get("error"), - ContentMode.HTML, ErrorLevel.ERROR); + UserError error = new UserError(attr.get("error"), ContentMode.HTML, + ErrorLevel.ERROR); setComponentError(error); } // Tab index when applicable if (design.hasAttr("tabindex") && this instanceof Focusable) { - ((Focusable) this).setTabIndex(DesignAttributeHandler - .readAttribute("tabindex", design.attributes(), - Integer.class)); + ((Focusable) this).setTabIndex(DesignAttributeHandler.readAttribute( + "tabindex", design.attributes(), Integer.class)); } // check for unsupported attributes @@ -1057,7 +1054,7 @@ public abstract class AbstractComponent extends AbstractClientConnector * consist of one, two or three parts with '_' between the different parts * if there is more than one part. The first part specifies the language, * the second part the country and the third part the variant of the locale. - * + * * @param localeString * the locale specified as a string * @return the Locale object corresponding to localeString @@ -1068,8 +1065,8 @@ public abstract class AbstractComponent extends AbstractClientConnector } String[] parts = localeString.split("_"); if (parts.length > 3) { - throw new RuntimeException("Cannot parse the locale string: " - + localeString); + throw new RuntimeException( + "Cannot parse the locale string: " + localeString); } switch (parts.length) { case 1: @@ -1083,7 +1080,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /** * Toggles responsiveness of this component. - * + * * @since 7.5.0 * @param responsive * boolean enables responsiveness, false disables @@ -1108,7 +1105,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /** * Returns true if the component is responsive - * + * * @since 7.5.0 * @return true if the component is responsive */ @@ -1125,7 +1122,7 @@ public abstract class AbstractComponent extends AbstractClientConnector * Reads the size of this component from the given design attributes. If the * attributes do not contain relevant size information, defaults is * consulted. - * + * * @param attributes * the design attributes * @param defaultInstance @@ -1143,7 +1140,8 @@ public abstract class AbstractComponent extends AbstractClientConnector } // read height - if (attributes.hasKey("height-auto") || attributes.hasKey("size-auto")) { + if (attributes.hasKey("height-auto") + || attributes.hasKey("size-auto")) { this.setHeight(null); } else if (attributes.hasKey("height-full") || attributes.hasKey("size-full")) { @@ -1156,7 +1154,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /** * Writes the size related attributes for the component if they differ from * the defaults - * + * * @param component * the component * @param attributes @@ -1213,7 +1211,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /** * Test if the given component has equal width with this instance - * + * * @param component * the component for the width comparison * @return true if the widths are equal @@ -1225,7 +1223,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /** * Test if the given component has equal height with this instance - * + * * @param component * the component for the height comparison * @return true if the heights are equal @@ -1237,7 +1235,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /** * Test if the given components has equal size with this instance - * + * * @param component * the component for the size comparison * @return true if the sizes are equal @@ -1251,7 +1249,7 @@ public abstract class AbstractComponent extends AbstractClientConnector * when reading or writing design. These are typically attributes of some * primitive type. The default implementation searches setters with * primitive values - * + * * @return a collection of attributes that can be read and written using the * default approach. */ @@ -1267,9 +1265,9 @@ public abstract class AbstractComponent extends AbstractClientConnector * basic implementation of the {@link readDesign} and {@link writeDesign} * methods. Typically these are handled in a custom way in the overridden * versions of the above methods - * + * * @since 7.4 - * + * * @return the collection of attributes that are not handled by the basic * implementation */ @@ -1290,7 +1288,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /* * (non-Javadoc) - * + * * @see com.vaadin.ui.Component#writeDesign(org.jsoup.nodes.Element, * com.vaadin.ui.declarative.DesignContext) */ @@ -1308,18 +1306,17 @@ public abstract class AbstractComponent extends AbstractClientConnector explicitImmediateValue, def.isImmediate(), Boolean.class); } // handle locale - if (getLocale() != null - && (getParent() == null || !getLocale().equals( - getParent().getLocale()))) { + if (getLocale() != null && (getParent() == null + || !getLocale().equals(getParent().getLocale()))) { design.attr("locale", getLocale().toString()); } // handle size writeSize(attr, def); // handle component error - String errorMsg = getComponentError() != null ? getComponentError() - .getFormattedHtmlMessage() : null; - String defErrorMsg = def.getComponentError() != null ? def - .getComponentError().getFormattedHtmlMessage() : null; + String errorMsg = getComponentError() != null + ? getComponentError().getFormattedHtmlMessage() : null; + String defErrorMsg = def.getComponentError() != null + ? def.getComponentError().getFormattedHtmlMessage() : null; if (!SharedUtil.equals(errorMsg, defErrorMsg)) { attr.put("error", errorMsg); } @@ -1346,7 +1343,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /** * Gets the {@link ActionManager} used to manage the * {@link ShortcutListener}s added to this {@link Field}. - * + * * @return the ActionManager in use */ protected ActionManager getActionManager() { @@ -1388,7 +1385,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /** * Determine whether a content component is equal to, or the * ancestor of this component. - * + * * @param content * the potential ancestor element * @return true if the relationship holds @@ -1426,7 +1423,8 @@ public abstract class AbstractComponent extends AbstractClientConnector @Override public void removeContextClickListener(ContextClickListener listener) { - removeListener(EventId.CONTEXT_CLICK, ContextClickEvent.class, listener); + removeListener(EventId.CONTEXT_CLICK, ContextClickEvent.class, + listener); } private static final Logger getLogger() { diff --git a/server/src/main/java/com/vaadin/ui/AbstractComponentContainer.java b/server/src/main/java/com/vaadin/ui/AbstractComponentContainer.java index 1095331602..ac331761d5 100644 --- a/server/src/main/java/com/vaadin/ui/AbstractComponentContainer.java +++ b/server/src/main/java/com/vaadin/ui/AbstractComponentContainer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -28,7 +28,7 @@ import com.vaadin.server.ComponentSizeValidator; * implementation for the methods in {@link ComponentContainer}. Basic UI * components that need to contain other components inherit this class to easily * qualify as a component container. - * + * * @author Vaadin Ltd * @since 3.0 */ @@ -45,7 +45,7 @@ public abstract class AbstractComponentContainer extends AbstractComponent /* * (non-Javadoc) - * + * * @see * com.vaadin.ui.ComponentContainer#addComponents(com.vaadin.ui.Component[]) */ @@ -65,7 +65,8 @@ public abstract class AbstractComponentContainer extends AbstractComponent final LinkedList l = new LinkedList(); // Adds all components - for (final Iterator i = getComponentIterator(); i.hasNext();) { + for (final Iterator i = getComponentIterator(); i + .hasNext();) { l.add(i.next()); } @@ -88,7 +89,8 @@ public abstract class AbstractComponentContainer extends AbstractComponent components.add(i.next()); } - for (final Iterator i = components.iterator(); i.hasNext();) { + for (final Iterator i = components.iterator(); i + .hasNext();) { final Component c = i.next(); source.removeComponent(c); addComponent(c); @@ -114,7 +116,8 @@ public abstract class AbstractComponentContainer extends AbstractComponent /* documented in interface */ @Override - public void removeComponentAttachListener(ComponentAttachListener listener) { + public void removeComponentAttachListener( + ComponentAttachListener listener) { removeListener(ComponentAttachEvent.class, listener, ComponentAttachListener.attachMethod); } @@ -148,7 +151,8 @@ public abstract class AbstractComponentContainer extends AbstractComponent /* documented in interface */ @Override - public void removeComponentDetachListener(ComponentDetachListener listener) { + public void removeComponentDetachListener( + ComponentDetachListener listener) { removeListener(ComponentDetachEvent.class, listener, ComponentDetachListener.detachMethod); } @@ -167,7 +171,7 @@ public abstract class AbstractComponentContainer extends AbstractComponent * Fires the component attached event. This should be called by the * addComponent methods after the component have been added to this * container. - * + * * @param component * the component that has been added to this container. */ @@ -179,7 +183,7 @@ public abstract class AbstractComponentContainer extends AbstractComponent * Fires the component detached event. This should be called by the * removeComponent methods after the component have been removed from this * container. - * + * * @param component * the component that has been removed from this container. */ @@ -191,7 +195,7 @@ public abstract class AbstractComponentContainer extends AbstractComponent * This only implements the events and component parent calls. The extending * classes must implement component list maintenance and call this method * after component list maintenance. - * + * * @see com.vaadin.ui.ComponentContainer#addComponent(Component) */ @Override @@ -216,7 +220,7 @@ public abstract class AbstractComponentContainer extends AbstractComponent * This only implements the events and component parent calls. The extending * classes must implement component list maintenance and call this method * before component list maintenance. - * + * * @see com.vaadin.ui.ComponentContainer#removeComponent(Component) */ @Override @@ -241,8 +245,9 @@ public abstract class AbstractComponentContainer extends AbstractComponent dirtyChildren = getInvalidSizedChildren(false); } else if ((width == SIZE_UNDEFINED && getWidth() != SIZE_UNDEFINED) || (unit == Unit.PERCENTAGE - && getWidthUnits() != Unit.PERCENTAGE && !ComponentSizeValidator - .parentCanDefineWidth(this))) { + && getWidthUnits() != Unit.PERCENTAGE + && !ComponentSizeValidator + .parentCanDefineWidth(this))) { /* * relative width children may get to invalid state if width becomes * invalid. Width may also become invalid if units become percentage @@ -256,15 +261,15 @@ public abstract class AbstractComponentContainer extends AbstractComponent false); } - private void repaintChangedChildTrees( - Collection invalidChildren, + private void repaintChangedChildTrees(Collection invalidChildren, boolean childrenMayBecomeUndefined, boolean vertical) { if (childrenMayBecomeUndefined) { Collection previouslyInvalidComponents = invalidChildren; invalidChildren = getInvalidSizedChildren(vertical); - if (previouslyInvalidComponents != null && invalidChildren != null) { - for (Iterator iterator = invalidChildren.iterator(); iterator - .hasNext();) { + if (previouslyInvalidComponents != null + && invalidChildren != null) { + for (Iterator iterator = invalidChildren + .iterator(); iterator.hasNext();) { Component component = iterator.next(); if (previouslyInvalidComponents.contains(component)) { // still invalid don't repaint @@ -273,7 +278,8 @@ public abstract class AbstractComponentContainer extends AbstractComponent } } } else if (invalidChildren != null) { - Collection stillInvalidChildren = getInvalidSizedChildren(vertical); + Collection stillInvalidChildren = getInvalidSizedChildren( + vertical); if (stillInvalidChildren != null) { for (Component component : stillInvalidChildren) { // didn't become valid @@ -286,12 +292,13 @@ public abstract class AbstractComponentContainer extends AbstractComponent } } - private Collection getInvalidSizedChildren(final boolean vertical) { + private Collection getInvalidSizedChildren( + final boolean vertical) { HashSet components = null; for (Component component : this) { - boolean valid = vertical ? ComponentSizeValidator - .checkHeights(component) : ComponentSizeValidator - .checkWidths(component); + boolean valid = vertical + ? ComponentSizeValidator.checkHeights(component) + : ComponentSizeValidator.checkWidths(component); if (!valid) { if (components == null) { components = new HashSet(); @@ -321,8 +328,9 @@ public abstract class AbstractComponentContainer extends AbstractComponent dirtyChildren = getInvalidSizedChildren(true); } else if ((height == SIZE_UNDEFINED && getHeight() != SIZE_UNDEFINED) || (unit == Unit.PERCENTAGE - && getHeightUnits() != Unit.PERCENTAGE && !ComponentSizeValidator - .parentCanDefineHeight(this))) { + && getHeightUnits() != Unit.PERCENTAGE + && !ComponentSizeValidator + .parentCanDefineHeight(this))) { /* * relative height children may get to invalid state if height * becomes invalid. Height may also become invalid if units become @@ -338,7 +346,7 @@ public abstract class AbstractComponentContainer extends AbstractComponent /** * {@inheritDoc} - * + * * @deprecated As of 7.0, use {@link #iterator()} instead. */ @Deprecated diff --git a/server/src/main/java/com/vaadin/ui/AbstractEmbedded.java b/server/src/main/java/com/vaadin/ui/AbstractEmbedded.java index a38e9bb788..de48b73539 100644 --- a/server/src/main/java/com/vaadin/ui/AbstractEmbedded.java +++ b/server/src/main/java/com/vaadin/ui/AbstractEmbedded.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -26,10 +26,9 @@ import com.vaadin.ui.declarative.DesignContext; /** * Abstract base for embedding components. - * + * * @author Vaadin Ltd. - * @version - * @VERSION@ + * @version @VERSION@ * @since 7.0 */ @SuppressWarnings("serial") @@ -48,7 +47,7 @@ public abstract class AbstractEmbedded extends AbstractComponent { /** * Sets the object source resource. The dimensions are assumed if possible. * The type is guessed from resource. - * + * * @param source * the source to set. */ @@ -58,7 +57,7 @@ public abstract class AbstractEmbedded extends AbstractComponent { /** * Get the object source resource. - * + * * @return the source */ public Resource getSource() { @@ -68,7 +67,7 @@ public abstract class AbstractEmbedded extends AbstractComponent { /** * Sets this component's alternate text that can be presented instead of the * component's normal content for accessibility purposes. - * + * * @param altText * A short, human-readable description of this component's * content. @@ -80,7 +79,7 @@ public abstract class AbstractEmbedded extends AbstractComponent { /** * Gets this component's alternate text that can be presented instead of the * component's normal content for accessibility purposes. - * + * * @returns Alternate text */ public String getAlternateText() { diff --git a/server/src/main/java/com/vaadin/ui/AbstractField.java b/server/src/main/java/com/vaadin/ui/AbstractField.java index 6d25076526..e0f5e971ac 100644 --- a/server/src/main/java/com/vaadin/ui/AbstractField.java +++ b/server/src/main/java/com/vaadin/ui/AbstractField.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -58,25 +58,25 @@ import com.vaadin.ui.declarative.DesignContext; * AbstractField implements that interface itself, too, so * accessing the Property value represented by it is straightforward. *

        - * + * *

        * AbstractField also provides the {@link com.vaadin.data.Buffered} interface * for buffering the data source value. By default the Field is in write * through-mode and {@link #setWriteThrough(boolean)}should be called to enable * buffering. *

        - * + * *

        * The class also supports {@link com.vaadin.data.Validator validators} to make * sure the value contained in the field is valid. *

        - * + * * @author Vaadin Ltd. * @since 3.0 */ @SuppressWarnings("serial") -public abstract class AbstractField extends AbstractComponent implements - Field, Property.ReadOnlyStatusChangeListener, +public abstract class AbstractField extends AbstractComponent + implements Field, Property.ReadOnlyStatusChangeListener, Property.ReadOnlyStatusChangeNotifier, Action.ShortcutNotifier { /* Private members */ @@ -148,7 +148,7 @@ public abstract class AbstractField extends AbstractComponent implements /** * Whether this field is currently registered as listening to events from * its data source. - * + * * @see #setPropertyDataSource(Property) * @see #addPropertyListeners() * @see #removePropertyListeners() @@ -170,11 +170,11 @@ public abstract class AbstractField extends AbstractComponent implements /** * Returns true if the error indicator be hidden when painting the component * even when there are errors. - * + * * This is a mostly internal method, but can be overridden in subclasses * e.g. if the error indicator should also be shown for empty fields in some * cases. - * + * * @return true to hide the error indicator, false to use the normal logic * to show it when there are errors */ @@ -190,7 +190,7 @@ public abstract class AbstractField extends AbstractComponent implements * to safely cast the value returned from getValue to the given * type and pass any variable assignable to this type as an argument to * setValue. - * + * * @return the type of the Field */ @Override @@ -208,7 +208,7 @@ public abstract class AbstractField extends AbstractComponent implements /** * Changes the readonly state and throw read-only status change events. - * + * * @see com.vaadin.ui.Component#setReadOnly(boolean) */ @Override @@ -219,7 +219,7 @@ public abstract class AbstractField extends AbstractComponent implements /** * Tests if the invalid data is committed to datasource. - * + * * @see com.vaadin.data.BufferedValidatable#isInvalidCommitted() */ @Override @@ -229,7 +229,7 @@ public abstract class AbstractField extends AbstractComponent implements /** * Sets if the invalid data should be committed to datasource. - * + * * @see com.vaadin.data.BufferedValidatable#setInvalidCommitted(boolean) */ @Override @@ -242,7 +242,8 @@ public abstract class AbstractField extends AbstractComponent implements * here, we use the default documentation from the implemented interface. */ @Override - public void commit() throws Buffered.SourceException, InvalidValueException { + public void commit() + throws Buffered.SourceException, InvalidValueException { if (dataSource != null && !dataSource.isReadOnly()) { if ((isInvalidCommitted() || isValid())) { try { @@ -300,7 +301,7 @@ public abstract class AbstractField extends AbstractComponent implements /** * Gets the value from the data source. This is only here because of clarity * in the code that handles both the data model value and the field value. - * + * * @return The value of the property data source */ private Object getDataSourceValue() { @@ -311,7 +312,7 @@ public abstract class AbstractField extends AbstractComponent implements * Returns the field value. This is always identical to {@link #getValue()} * and only here because of clarity in the code that handles both the data * model value and the field value. - * + * * @return The value of the field */ private T getFieldValue() { @@ -348,9 +349,9 @@ public abstract class AbstractField extends AbstractComponent implements * Setting buffered mode from true to false will commit any pending changes. *

        *

        - * + * *

        - * + * * @since 7.0.0 * @param buffered * true if buffered mode should be turned on, false otherwise @@ -368,7 +369,7 @@ public abstract class AbstractField extends AbstractComponent implements /** * Checks the buffered mode of this Field. - * + * * @return true if buffered mode is on, false otherwise */ @Override @@ -388,9 +389,9 @@ public abstract class AbstractField extends AbstractComponent implements * If legacy Property toString mode is disabled, the string representation * has no special meaning *

        - * + * * @see LegacyPropertyHelper#isLegacyToStringEnabled() - * + * * @return A string representation of the value value stored in the Property * or a string representation of the Property object. * @deprecated As of 7.0. Use {@link #getValue()} to get the value of the @@ -413,12 +414,12 @@ public abstract class AbstractField extends AbstractComponent implements /** * Gets the current value of the field. - * + * *

        * This is the visible, modified and possible invalid value the user have * entered to the field. *

        - * + * *

        * Note that the object returned is compatible with getType(). For example, * if the type is String, this returns Strings even when the underlying @@ -427,12 +428,12 @@ public abstract class AbstractField extends AbstractComponent implements * data source, use {@link Property#getValue()} for the property data * source. *

        - * + * *

        * Since Vaadin 7.0, no implicit conversions between other data types and * String are performed, but a converter is used if set. *

        - * + * * @return the current value of the field. */ @Override @@ -442,20 +443,20 @@ public abstract class AbstractField extends AbstractComponent implements /** * Sets the value of the field. - * + * * @param newFieldValue * the New value of the field. * @throws Property.ReadOnlyException */ @Override - public void setValue(T newFieldValue) throws Property.ReadOnlyException, - Converter.ConversionException { + public void setValue(T newFieldValue) + throws Property.ReadOnlyException, Converter.ConversionException { setValue(newFieldValue, false); } /** * Sets the value of the field. - * + * * @param newFieldValue * the New value of the field. * @param repaintIsNotNeeded @@ -470,7 +471,7 @@ public abstract class AbstractField extends AbstractComponent implements /** * Sets the value of the field. - * + * * @since 7.5.7 * @param newFieldValue * the New value of the field. @@ -493,9 +494,10 @@ public abstract class AbstractField extends AbstractComponent implements throw new Property.ReadOnlyException(); } try { - T doubleConvertedFieldValue = convertFromModel(convertToModel(newFieldValue)); - if (!SharedUtil - .equals(newFieldValue, doubleConvertedFieldValue)) { + T doubleConvertedFieldValue = convertFromModel( + convertToModel(newFieldValue)); + if (!SharedUtil.equals(newFieldValue, + doubleConvertedFieldValue)) { newFieldValue = doubleConvertedFieldValue; repaintIsNotNeeded = false; } @@ -506,8 +508,8 @@ public abstract class AbstractField extends AbstractComponent implements // Repaint is needed even when the client thinks that it knows the // new state if validity of the component may change - if (repaintIsNotNeeded - && (isRequired() || hasValidators() || getConverter() != null)) { + if (repaintIsNotNeeded && (isRequired() || hasValidators() + || getConverter() != null)) { repaintIsNotNeeded = false; } @@ -533,8 +535,8 @@ public abstract class AbstractField extends AbstractComponent implements // Commits the value to datasource committingValueToDataSource = true; - getPropertyDataSource().setValue( - convertToModel(newFieldValue)); + getPropertyDataSource() + .setValue(convertToModel(newFieldValue)); // The buffer is now unmodified setModified(false); @@ -581,7 +583,7 @@ public abstract class AbstractField extends AbstractComponent implements /** * Gets the current data source of the field, if any. - * + * * @return the current data source as a Property, or null if * none defined. */ @@ -595,7 +597,7 @@ public abstract class AbstractField extends AbstractComponent implements * Sets the specified Property as the data source for the field. All * uncommitted changes are replaced with a value from the new data source. *

        - * + * *

        * If the datasource has any validators, the same validators are added to * the field. Because the default behavior of the field is to allow invalid @@ -604,7 +606,7 @@ public abstract class AbstractField extends AbstractComponent implements * is invalid. After the value is valid, the error message is not shown and * the commit can be done normally. *

        - * + * *

        * If the data source implements * {@link com.vaadin.data.Property.ValueChangeNotifier} and/or @@ -615,7 +617,7 @@ public abstract class AbstractField extends AbstractComponent implements * {@link AbstractField#detach() detach} and re-added on * {@link AbstractField#attach() attach}. *

        - * + * *

        * Note: before 6.5 we actually called discard() method in the beginning of * the method. This was removed to simplify implementation, avoid excess @@ -624,7 +626,7 @@ public abstract class AbstractField extends AbstractComponent implements * method is called). Some complex field implementations might now need to * override this method to do housekeeping similar to discard(). *

        - * + * * @param newDataSource * the new data source Property. */ @@ -639,8 +641,8 @@ public abstract class AbstractField extends AbstractComponent implements // Sets the new data source dataSource = newDataSource; - getState().propertyReadOnly = dataSource == null ? false : dataSource - .isReadOnly(); + getState().propertyReadOnly = dataSource == null ? false + : dataSource.isReadOnly(); // Check if the current converter is compatible. if (newDataSource != null @@ -662,8 +664,8 @@ public abstract class AbstractField extends AbstractComponent implements setCurrentBufferedSourceException(null); } } catch (final Throwable e) { - setCurrentBufferedSourceException(new Buffered.SourceException( - this, e)); + setCurrentBufferedSourceException( + new Buffered.SourceException(this, e)); setModified(true); throw getCurrentBufferedSourceException(); } @@ -685,8 +687,8 @@ public abstract class AbstractField extends AbstractComponent implements // Fires value change if the value has changed T value = getInternalValue(); - if ((value != oldValue) - && ((value != null && !value.equals(oldValue)) || value == null)) { + if ((value != oldValue) && ((value != null && !value.equals(oldValue)) + || value == null)) { fireValueChange(false); } } @@ -695,20 +697,20 @@ public abstract class AbstractField extends AbstractComponent implements * Retrieves a converter for the field from the converter factory defined * for the application. Clears the converter if no application reference is * available or if the factory returns null. - * + * * @param datamodelType * The type of the data model that we want to be able to convert * from */ public void setConverter(Class datamodelType) { - Converter c = (Converter) ConverterUtil.getConverter( - getType(), datamodelType, getSession()); + Converter c = (Converter) ConverterUtil + .getConverter(getType(), datamodelType, getSession()); setConverter(c); } /** * Convert the given value from the data source type to the UI type. - * + * * @param newValue * The data source value to convert. * @return The converted value that is compatible with the UI type or the @@ -723,7 +725,7 @@ public abstract class AbstractField extends AbstractComponent implements /** * Convert the given value from the data source type to the UI type. - * + * * @param newValue * The data source value to convert. * @return The converted value that is compatible with the UI type or the @@ -739,7 +741,7 @@ public abstract class AbstractField extends AbstractComponent implements /** * Convert the given value from the UI type to the data source type. - * + * * @param fieldValue * The value to convert. Typically returned by * {@link #getFieldValue()} @@ -755,7 +757,7 @@ public abstract class AbstractField extends AbstractComponent implements /** * Convert the given value from the UI type to the data source type. - * + * * @param fieldValue * The value to convert. Typically returned by * {@link #getFieldValue()} @@ -780,7 +782,7 @@ public abstract class AbstractField extends AbstractComponent implements /** * Retrieves the type of the currently used data model. If the field has no * data source then the model type of the converter is used. - * + * * @since 7.1 * @return The type of the currently used data model or null if no data * source or converter is set. @@ -798,7 +800,7 @@ public abstract class AbstractField extends AbstractComponent implements /** * Returns the conversion error with {0} replaced by the data source type * and {1} replaced by the exception (localized) message. - * + * * @since 7.1 * @param dataSourceType * the type of the data source @@ -832,7 +834,7 @@ public abstract class AbstractField extends AbstractComponent implements * has been set. The value is not necessarily the same as the data source * value e.g. if the field is in buffered mode and has been modified. *

        - * + * * @return The converted value that is compatible with the data source type */ public Object getConvertedValue() { @@ -844,7 +846,7 @@ public abstract class AbstractField extends AbstractComponent implements * value given is converted to the field type and then assigned to the * field. This will update the property data source in the same way as when * {@link #setValue(Object)} is called. - * + * * @param value * The value to set. Must be the same type as the data source. */ @@ -857,7 +859,7 @@ public abstract class AbstractField extends AbstractComponent implements /** * Adds a new validator for the field's value. All validators added to a * field are checked each time the its value changes. - * + * * @param validator * the new validator to be added. */ @@ -872,7 +874,7 @@ public abstract class AbstractField extends AbstractComponent implements /** * Gets the validators of the field. - * + * * @return An unmodifiable collection that holds all validators for the * field. */ @@ -891,7 +893,7 @@ public abstract class AbstractField extends AbstractComponent implements /** * Removes the validator from the field. - * + * * @param validator * the validator to remove. */ @@ -918,10 +920,10 @@ public abstract class AbstractField extends AbstractComponent implements * Tests the current value against registered validators if the field is not * empty. If the field is empty it is considered valid if it is not required * and invalid otherwise. Validators are never checked for empty fields. - * + * * In most cases, {@link #validate()} should be used instead of * {@link #isValid()} to also get the error message. - * + * * @return true if all registered validators claim that the * current value is valid or if the field is empty and not required, * false otherwise. @@ -939,16 +941,16 @@ public abstract class AbstractField extends AbstractComponent implements /** * Checks the validity of the Field. - * + * * A field is invalid if it is set as required (using * {@link #setRequired(boolean)} and is empty, if one or several of the * validators added to the field indicate it is invalid or if the value * cannot be converted provided a converter has been set. - * + * * The "required" validation is a built-in validation feature. If the field * is required and empty this method throws an EmptyValueException with the * error message set using {@link #setRequiredError(String)}. - * + * * @see com.vaadin.data.Validatable#validate() */ @Override @@ -964,7 +966,7 @@ public abstract class AbstractField extends AbstractComponent implements * Validates that the given value pass the validators for the field. *

        * This method does not check the requiredness of the field. - * + * * @param fieldValue * The value to check * @throws Validator.InvalidValueException @@ -982,8 +984,8 @@ public abstract class AbstractField extends AbstractComponent implements valueToValidate = getConverter().convertToModel(fieldValue, getModelType(), getLocale()); } catch (ConversionException e) { - throw new InvalidValueException(getConversionError( - getConverter().getModelType(), e)); + throw new InvalidValueException( + getConversionError(getConverter().getModelType(), e)); } } @@ -1009,8 +1011,8 @@ public abstract class AbstractField extends AbstractComponent implements throw validationExceptions.get(0); } - InvalidValueException[] exceptionArray = validationExceptions - .toArray(new InvalidValueException[validationExceptions.size()]); + InvalidValueException[] exceptionArray = validationExceptions.toArray( + new InvalidValueException[validationExceptions.size()]); // Create a composite validator and include all exceptions throw new Validator.InvalidValueException(null, exceptionArray); @@ -1019,7 +1021,7 @@ public abstract class AbstractField extends AbstractComponent implements /** * Fields allow invalid values by default. In most cases this is wanted, * because the field otherwise visually forget the user input immediately. - * + * * @return true iff the invalid values are allowed. * @see com.vaadin.data.Validatable#isInvalidAllowed() */ @@ -1038,7 +1040,7 @@ public abstract class AbstractField extends AbstractComponent implements * values. The validators are automatically copied to the field when the * datasource is set. *

        - * + * * @see com.vaadin.data.Validatable#setInvalidAllowed(boolean) */ @Override @@ -1051,7 +1053,7 @@ public abstract class AbstractField extends AbstractComponent implements * Error messages shown by the fields are composites of the error message * thrown by the superclasses (that is the component error message), * validation errors and buffered source errors. - * + * * @see com.vaadin.ui.AbstractComponent#getErrorMessage() */ @Override @@ -1084,13 +1086,11 @@ public abstract class AbstractField extends AbstractComponent implements } // Throw combination of the error types - return new CompositeErrorMessage( - new ErrorMessage[] { - superError, + return new CompositeErrorMessage(new ErrorMessage[] { superError, AbstractErrorMessage .getErrorMessageForException(validationError), - AbstractErrorMessage - .getErrorMessageForException(getCurrentBufferedSourceException()) }); + AbstractErrorMessage.getErrorMessageForException( + getCurrentBufferedSourceException()) }); } @@ -1138,7 +1138,8 @@ public abstract class AbstractField extends AbstractComponent implements * interface. */ @Override - public void removeValueChangeListener(Property.ValueChangeListener listener) { + public void removeValueChangeListener( + Property.ValueChangeListener listener) { removeListener(AbstractField.ValueChangeEvent.class, listener, VALUE_CHANGE_METHOD); // ensure "automatic immediate handling" works @@ -1173,9 +1174,8 @@ public abstract class AbstractField extends AbstractComponent implements static { try { READ_ONLY_STATUS_CHANGE_METHOD = Property.ReadOnlyStatusChangeListener.class - .getDeclaredMethod( - "readOnlyStatusChange", - new Class[] { Property.ReadOnlyStatusChangeEvent.class }); + .getDeclaredMethod("readOnlyStatusChange", new Class[] { + Property.ReadOnlyStatusChangeEvent.class }); } catch (final java.lang.NoSuchMethodException e) { // This should never happen throw new java.lang.RuntimeException( @@ -1186,7 +1186,7 @@ public abstract class AbstractField extends AbstractComponent implements /** * React to read only status changes of the property by requesting a * repaint. - * + * * @see Property.ReadOnlyStatusChangeListener */ @Override @@ -1206,7 +1206,7 @@ public abstract class AbstractField extends AbstractComponent implements /** * An Event object specifying the Property whose read-only * status has changed. - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -1215,7 +1215,7 @@ public abstract class AbstractField extends AbstractComponent implements /** * New instance of text change event. - * + * * @param source * the Source of the event. */ @@ -1225,7 +1225,7 @@ public abstract class AbstractField extends AbstractComponent implements /** * Property where the event occurred. - * + * * @return the Source of the event. */ @Override @@ -1289,10 +1289,10 @@ public abstract class AbstractField extends AbstractComponent implements /** * This method listens to data source value changes and passes the changes * forwards. - * + * * Changes are not forwarded to the listeners of the field during internal * operations of the field to avoid duplicate notifications. - * + * * @param event * the value change event telling the data source contents have * changed. @@ -1309,7 +1309,7 @@ public abstract class AbstractField extends AbstractComponent implements * reports different value than the one the field has just * committed to it. In this case we respect the property * value. - * + * * Still, we don't fire value change yet, but instead * postpone it until "commit" is done. See setValue(Object, * boolean) and commit(). @@ -1338,7 +1338,7 @@ public abstract class AbstractField extends AbstractComponent implements /* * (non-Javadoc) - * + * * @see com.vaadin.ui.Component.Focusable#getTabIndex() */ @Override @@ -1348,7 +1348,7 @@ public abstract class AbstractField extends AbstractComponent implements /* * (non-Javadoc) - * + * * @see com.vaadin.ui.Component.Focusable#setTabIndex(int) */ @Override @@ -1360,13 +1360,13 @@ public abstract class AbstractField extends AbstractComponent implements * Returns the internal field value, which might not match the data source * value e.g. if the field has been modified and is not in write-through * mode. - * + * * This method can be overridden by subclasses together with * {@link #setInternalValue(Object)} to compute internal field value at * runtime. When doing so, typically also {@link #isModified()} needs to be * overridden and care should be taken in the management of the empty state * and buffering support. - * + * * @return internal field value */ protected T getInternalValue() { @@ -1378,9 +1378,9 @@ public abstract class AbstractField extends AbstractComponent implements * change the internal Field value. It does not trigger valuechange events. * It can be overridden by the inheriting classes to update all dependent * variables. - * + * * Subclasses can also override {@link #getInternalValue()} if necessary. - * + * * @param newValue * the new value to be set. */ @@ -1394,7 +1394,7 @@ public abstract class AbstractField extends AbstractComponent implements /** * Notifies the component that it is connected to an application. - * + * * @see com.vaadin.ui.Component#attach() */ @Override @@ -1424,8 +1424,8 @@ public abstract class AbstractField extends AbstractComponent implements if (dataSource != null && !isModified()) { // When we have a data source and the internal value is directly // read from that we want to update the value - T newInternalValue = convertFromModel(getPropertyDataSource() - .getValue()); + T newInternalValue = convertFromModel( + getPropertyDataSource().getValue()); if (!SharedUtil.equals(newInternalValue, getInternalValue())) { setInternalValue(newInternalValue); fireValueChange(false); @@ -1460,17 +1460,17 @@ public abstract class AbstractField extends AbstractComponent implements /** * Is this field required. Required fields must filled by the user. - * + * * If the field is required, it is visually indicated in the user interface. * Furthermore, setting field to be required implicitly adds "non-empty" * validator and thus isValid() == false or any isEmpty() fields. In those * cases validation errors are not painted as it is obvious that the user * must fill in the required fields. - * + * * On the other hand, for the non-required fields isValid() == true if the * field isEmpty() regardless of any attached validators. - * - * + * + * * @return true if the field is required, otherwise * false. */ @@ -1481,16 +1481,16 @@ public abstract class AbstractField extends AbstractComponent implements /** * Sets the field required. Required fields must filled by the user. - * + * * If the field is required, it is visually indicated in the user interface. * Furthermore, setting field to be required implicitly adds "non-empty" * validator and thus isValid() == false or any isEmpty() fields. In those * cases validation errors are not painted as it is obvious that the user * must fill in the required fields. - * + * * On the other hand, for the non-required fields isValid() == true if the * field isEmpty() regardless of any attached validators. - * + * * @param required * Is the field required. */ @@ -1504,7 +1504,7 @@ public abstract class AbstractField extends AbstractComponent implements * setting requiredMessage to be "" or null, no error pop-up or exclamation * mark is shown for a empty required field. This faults to "". Even in * those cases isValid() returns false for empty required fields. - * + * * @param requiredMessage * Message to be shown when this field is required, but empty. */ @@ -1522,7 +1522,7 @@ public abstract class AbstractField extends AbstractComponent implements /** * Gets the error that is shown if the field value cannot be converted to * the data source type. - * + * * @return The error that is shown if conversion of the field value fails */ public String getConversionError() { @@ -1534,7 +1534,7 @@ public abstract class AbstractField extends AbstractComponent implements * the data source type. If {0} is present in the message, it will be * replaced by the simple name of the data source type. If {1} is present in * the message, it will be replaced by the ConversionException message. - * + * * @param valueConversionError * Message to be shown when conversion of the value fails */ @@ -1555,13 +1555,13 @@ public abstract class AbstractField extends AbstractComponent implements /** * Is automatic, visible validation enabled? - * + * * If automatic validation is enabled, any validators connected to this * component are evaluated while painting the component and potential error * messages are sent to client. If the automatic validation is turned off, * isValid() and validate() methods still work, but one must show the * validation in their own code. - * + * * @return True, if automatic validation is enabled. */ public boolean isValidationVisible() { @@ -1570,13 +1570,13 @@ public abstract class AbstractField extends AbstractComponent implements /** * Enable or disable automatic, visible validation. - * + * * If automatic validation is enabled, any validators connected to this * component are evaluated while painting the component and potential error * messages are sent to client. If the automatic validation is turned off, * isValid() and validate() methods still work, but one must show the * validation in their own code. - * + * * @param validateAutomatically * True, if automatic validation is enabled. */ @@ -1589,7 +1589,7 @@ public abstract class AbstractField extends AbstractComponent implements /** * Sets the current buffered source exception. - * + * * @param currentBufferedSourceException */ public void setCurrentBufferedSourceException( @@ -1600,7 +1600,7 @@ public abstract class AbstractField extends AbstractComponent implements /** * Gets the current buffered source exception. - * + * * @return The current source exception */ protected Buffered.SourceException getCurrentBufferedSourceException() { @@ -1611,7 +1611,7 @@ public abstract class AbstractField extends AbstractComponent implements * A ready-made {@link ShortcutListener} that focuses the given * {@link Focusable} (usually a {@link Field}) when the keyboard shortcut is * invoked. - * + * */ public static class FocusShortcut extends ShortcutListener { protected Focusable focusable; @@ -1619,7 +1619,7 @@ public abstract class AbstractField extends AbstractComponent implements /** * Creates a keyboard shortcut for focusing the given {@link Focusable} * using the shorthand notation defined in {@link ShortcutAction}. - * + * * @param focusable * to focused when the shortcut is invoked * @param shorthandCaption @@ -1632,7 +1632,7 @@ public abstract class AbstractField extends AbstractComponent implements /** * Creates a keyboard shortcut for focusing the given {@link Focusable}. - * + * * @param focusable * to focused when the shortcut is invoked * @param keyCode @@ -1640,14 +1640,15 @@ public abstract class AbstractField extends AbstractComponent implements * @param modifiers * modifiers required to invoke the shortcut */ - public FocusShortcut(Focusable focusable, int keyCode, int... modifiers) { + public FocusShortcut(Focusable focusable, int keyCode, + int... modifiers) { super(null, keyCode, modifiers); this.focusable = focusable; } /** * Creates a keyboard shortcut for focusing the given {@link Focusable}. - * + * * @param focusable * to focused when the shortcut is invoked * @param keyCode @@ -1706,7 +1707,7 @@ public abstract class AbstractField extends AbstractComponent implements /** * Gets the converter used to convert the property data source value to the * field value. - * + * * @return The converter or null if none is set. */ public Converter getConverter() { @@ -1717,7 +1718,7 @@ public abstract class AbstractField extends AbstractComponent implements * Sets the converter used to convert the field value to property data * source type. The converter must have a presentation type that matches the * field type. - * + * * @param converter * The new converter to use. */ @@ -1800,7 +1801,7 @@ public abstract class AbstractField extends AbstractComponent implements /* * (non-Javadoc) - * + * * @see com.vaadin.ui.AbstractComponent#readDesign(org.jsoup.nodes .Element, * com.vaadin.ui.declarative.DesignContext) */ @@ -1816,7 +1817,7 @@ public abstract class AbstractField extends AbstractComponent implements /* * (non-Javadoc) - * + * * @see com.vaadin.ui.AbstractComponent#getCustomAttributes() */ @Override @@ -1831,7 +1832,7 @@ public abstract class AbstractField extends AbstractComponent implements /* * (non-Javadoc) - * + * * @see com.vaadin.ui.AbstractComponent#writeDesign(org.jsoup.nodes.Element * , com.vaadin.ui.declarative.DesignContext) */ diff --git a/server/src/main/java/com/vaadin/ui/AbstractFocusable.java b/server/src/main/java/com/vaadin/ui/AbstractFocusable.java index ad3b96f29b..5f1c6cbc64 100644 --- a/server/src/main/java/com/vaadin/ui/AbstractFocusable.java +++ b/server/src/main/java/com/vaadin/ui/AbstractFocusable.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -28,12 +28,12 @@ import com.vaadin.ui.Component.Focusable; /** * An abstract base class for focusable components. Includes API for setting the * tab index, programmatic focusing, and adding focus and blur listeners. - * + * * @since 7.6 * @author Vaadin Ltd */ -public abstract class AbstractFocusable extends AbstractComponent implements - Focusable, FocusNotifier, BlurNotifier { +public abstract class AbstractFocusable extends AbstractComponent + implements Focusable, FocusNotifier, BlurNotifier { protected AbstractFocusable() { registerRpc(new FocusAndBlurServerRpcImpl(this) { diff --git a/server/src/main/java/com/vaadin/ui/AbstractJavaScriptComponent.java b/server/src/main/java/com/vaadin/ui/AbstractJavaScriptComponent.java index 68ee132b76..415ad2dcc9 100644 --- a/server/src/main/java/com/vaadin/ui/AbstractJavaScriptComponent.java +++ b/server/src/main/java/com/vaadin/ui/AbstractJavaScriptComponent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -106,16 +106,18 @@ import elemental.json.JsonValue; * the field, that function is called whenever the contents of the shared state * is changed. *
      • onUnregister - If the JavaScript code assigns a function to - * the field, that function is called when the connector has been unregistered.
      • + * the field, that function is called when the connector has been + * unregistered. *
      • 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.
      • + * 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: *

          @@ -127,7 +129,8 @@ import elemental.json.JsonValue; *
        • Java Strings are represented by JavaScript strings.
        • *
        • Java Dates are represented by JavaScript numbers containing the timestamp *
        • - *
        • List, Set and all arrays in Java are represented by JavaScript arrays.
        • + *
        • List, Set and all arrays in Java are represented by JavaScript + * arrays.
        • *
        • Map<String, ?> 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 @@ -141,7 +144,7 @@ import elemental.json.JsonValue; * here. Please refer to the documentation for specific types for serialization * information.
        • *
        - * + * * @author Vaadin Ltd * @since 7.0.0 */ @@ -163,14 +166,15 @@ public abstract class AbstractJavaScriptComponent extends AbstractComponent { * 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 function * @param function * the {@link JavaScriptFunction} object that will be invoked * when the JavaScript function is called */ - protected void addFunction(String functionName, JavaScriptFunction function) { + protected void addFunction(String functionName, + JavaScriptFunction function) { callbackHelper.registerCallback(functionName, function); } @@ -183,7 +187,7 @@ public abstract class AbstractJavaScriptComponent extends AbstractComponent { * before sending. This can be done either with * {@link JsonCodec#encode(Object, JsonValue, java.lang.reflect.Type, com.vaadin.ui.ConnectorTracker)} * or using the factory methods in {@link Json}. - * + * * @param name * the name of the function * @param arguments diff --git a/server/src/main/java/com/vaadin/ui/AbstractLayout.java b/server/src/main/java/com/vaadin/ui/AbstractLayout.java index 0770670680..1804c2d135 100644 --- a/server/src/main/java/com/vaadin/ui/AbstractLayout.java +++ b/server/src/main/java/com/vaadin/ui/AbstractLayout.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -26,7 +26,7 @@ import com.vaadin.ui.declarative.DesignContext; /** * An abstract class that defines default implementation for the {@link Layout} * interface. - * + * * @author Vaadin Ltd. * @since 5.0 */ @@ -43,9 +43,9 @@ public abstract class AbstractLayout extends AbstractComponentContainer * helper method should be called from the * {@link #readDesign(Element, DesignContext) readDesign} method of layouts * that implement {@link MarginHandler}. - * + * * @since 7.5 - * + * * @param design * the design from which to read * @param defMargin @@ -66,16 +66,15 @@ public abstract class AbstractLayout extends AbstractComponentContainer boolean left = DesignAttributeHandler.readAttribute("margin-left", design.attributes(), defMargin.hasLeft(), boolean.class); - boolean right = DesignAttributeHandler.readAttribute( - "margin-right", design.attributes(), defMargin.hasRight(), - boolean.class); + boolean right = DesignAttributeHandler.readAttribute("margin-right", + design.attributes(), defMargin.hasRight(), boolean.class); boolean top = DesignAttributeHandler.readAttribute("margin-top", design.attributes(), defMargin.hasTop(), boolean.class); boolean bottom = DesignAttributeHandler.readAttribute( - "margin-bottom", design.attributes(), - defMargin.hasBottom(), boolean.class); + "margin-bottom", design.attributes(), defMargin.hasBottom(), + boolean.class); return new MarginInfo(top, right, bottom, left); } @@ -86,10 +85,10 @@ public abstract class AbstractLayout extends AbstractComponentContainer * helper method should be called from the * {@link #readDesign(Element, DesignContext) writeDesign} method of layouts * that implement {@link MarginHandler}. - * - * + * + * * @since 7.5 - * + * * @param design * the design to write to * @param margin @@ -102,9 +101,8 @@ public abstract class AbstractLayout extends AbstractComponentContainer protected void writeMargin(Element design, MarginInfo margin, MarginInfo defMargin, DesignContext context) { if (margin.hasAll()) { - DesignAttributeHandler.writeAttribute("margin", - design.attributes(), margin.hasAll(), defMargin.hasAll(), - boolean.class); + DesignAttributeHandler.writeAttribute("margin", design.attributes(), + margin.hasAll(), defMargin.hasAll(), boolean.class); } else { DesignAttributeHandler.writeAttribute("margin-left", diff --git a/server/src/main/java/com/vaadin/ui/AbstractMedia.java b/server/src/main/java/com/vaadin/ui/AbstractMedia.java index a0344624d7..a2f2c74d26 100644 --- a/server/src/main/java/com/vaadin/ui/AbstractMedia.java +++ b/server/src/main/java/com/vaadin/ui/AbstractMedia.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -44,7 +44,7 @@ import com.vaadin.ui.declarative.DesignContext; /** * Abstract base class for the HTML5 media components. - * + * * @author Vaadin Ltd */ public abstract class AbstractMedia extends AbstractComponent { @@ -61,7 +61,7 @@ public abstract class AbstractMedia extends AbstractComponent { /** * Sets a single media file as the source of the media component. - * + * * @param source */ public void setSource(Resource source) { @@ -78,17 +78,17 @@ public abstract class AbstractMedia extends AbstractComponent { /** * Adds an alternative media file to the sources list. Which of the sources * is used is selected by the browser depending on which file formats it - * supports. See wikipedia for a - * table of formats supported by different browsers. - * + * supports. See + * wikipedia + * for a table of formats supported by different browsers. + * * @param source */ public void addSource(Resource source) { if (source != null) { List sources = getState().sources; - sources.add(new ResourceReference(source, this, Integer - .toString(sources.size()))); + sources.add(new ResourceReference(source, this, + Integer.toString(sources.size()))); getState().sourceTypes.add(source.getMIMEType()); } } @@ -135,10 +135,10 @@ public abstract class AbstractMedia extends AbstractComponent { /** * Set multiple sources at once. Which of the sources is used is selected by - * the browser depending on which file formats it supports. See wikipedia for a - * table of formats supported by different browsers. - * + * the browser depending on which file formats it supports. See + * wikipedia + * for a table of formats supported by different browsers. + * * @param sources */ public void setSources(Resource... sources) { @@ -161,7 +161,7 @@ public abstract class AbstractMedia extends AbstractComponent { /** * Sets whether or not the browser should show native media controls. - * + * * @param showControls */ public void setShowControls(boolean showControls) { @@ -183,7 +183,7 @@ public abstract class AbstractMedia extends AbstractComponent { * flash-based player, see the Mozilla Developer Network for details. - * + * * @param altText */ public void setAltText(String altText) { @@ -201,7 +201,7 @@ public abstract class AbstractMedia extends AbstractComponent { /** * Set whether the alternative text ({@link #setAltText(String)}) is * rendered as HTML or not. - * + * * @param htmlContentAllowed */ public void setHtmlContentAllowed(boolean htmlContentAllowed) { @@ -219,7 +219,7 @@ public abstract class AbstractMedia extends AbstractComponent { /** * Sets whether the media is to automatically start playback when enough * data has been loaded. - * + * * @param autoplay */ public void setAutoplay(boolean autoplay) { @@ -235,7 +235,7 @@ public abstract class AbstractMedia extends AbstractComponent { /** * Set whether to mute the audio or not. - * + * * @param muted */ public void setMuted(boolean muted) { diff --git a/server/src/main/java/com/vaadin/ui/AbstractOrderedLayout.java b/server/src/main/java/com/vaadin/ui/AbstractOrderedLayout.java index d6df3f372a..0a555152cb 100644 --- a/server/src/main/java/com/vaadin/ui/AbstractOrderedLayout.java +++ b/server/src/main/java/com/vaadin/ui/AbstractOrderedLayout.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -39,9 +39,9 @@ import com.vaadin.ui.declarative.DesignAttributeHandler; import com.vaadin.ui.declarative.DesignContext; @SuppressWarnings("serial") -public abstract class AbstractOrderedLayout extends AbstractLayout implements - Layout.AlignmentHandler, Layout.SpacingHandler, LayoutClickNotifier, - Layout.MarginHandler { +public abstract class AbstractOrderedLayout extends AbstractLayout + implements Layout.AlignmentHandler, Layout.SpacingHandler, + LayoutClickNotifier, Layout.MarginHandler { private AbstractOrderedLayoutServerRpc rpc = new AbstractOrderedLayoutServerRpc() { @@ -84,7 +84,7 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements /** * Add a component into this container. The component is added to the right * or under the previous component. - * + * * @param c * the component to be added. */ @@ -105,7 +105,7 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements /** * Adds a component into this container. The component is added to the left * or on top of the other components. - * + * * @param c * the component to be added. */ @@ -128,7 +128,7 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements /** * Adds a component into indexed position in this container. - * + * * @param c * the component to be added. * @param index @@ -168,7 +168,7 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements /** * Removes the component from this container. - * + * * @param c * the component to be removed. */ @@ -182,7 +182,7 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements /** * Gets the component container iterator for going trough all the components * in the container. - * + * * @return the Iterator of the components inside the container. */ @Override @@ -193,7 +193,7 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements /** * Gets the number of contained components. Consistent with the iterator * returned by {@link #getComponentIterator()}. - * + * * @return the number of contained components */ @Override @@ -203,13 +203,15 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements /* Documented in superclass */ @Override - public void replaceComponent(Component oldComponent, Component newComponent) { + public void replaceComponent(Component oldComponent, + Component newComponent) { // Gets the locations int oldLocation = -1; int newLocation = -1; int location = 0; - for (final Iterator i = components.iterator(); i.hasNext();) { + for (final Iterator i = components.iterator(); i + .hasNext();) { final Component component = i.next(); if (component == oldComponent) { @@ -265,7 +267,7 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements /* * (non-Javadoc) - * + * * @see com.vaadin.ui.Layout.AlignmentHandler#getComponentAlignment(com * .vaadin.ui.Component) */ @@ -282,7 +284,7 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements /* * (non-Javadoc) - * + * * @see com.vaadin.ui.Layout.SpacingHandler#setSpacing(boolean) */ @Override @@ -292,7 +294,7 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements /* * (non-Javadoc) - * + * * @see com.vaadin.ui.Layout.SpacingHandler#isSpacing() */ @Override @@ -305,26 +307,26 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements * This method is used to control how excess space in layout is distributed * among components. Excess space may exist if layout is sized and contained * non relatively sized components don't consume all available space. - * + * *

        * Example how to distribute 1:3 (33%) for component1 and 2:3 (67%) for * component2 : - * + * * * layout.setExpandRatio(component1, 1);
        * layout.setExpandRatio(component2, 2); *
        - * + * *

        * If no ratios have been set, the excess space is distributed evenly among * all components. - * + * *

        * Note, that width or height (depending on orientation) needs to be defined * for this method to have any effect. - * + * * @see Sizeable - * + * * @param component * the component in this layout which expand ratio is to be set * @param ratio @@ -349,7 +351,7 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements /** * Returns the expand ratio of given component. - * + * * @param component * which expand ratios is requested * @return expand ratio of given component, 0.0f by default. @@ -399,7 +401,7 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements /** * Returns the index of the given component. - * + * * @param component * The component to look up. * @return The index of the component or -1 if the component is not a child. @@ -410,7 +412,7 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements /** * Returns the component at the given position. - * + * * @param index * The position of the component. * @return The component at the given index. @@ -428,7 +430,7 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements /* * (non-Javadoc) - * + * * @see com.vaadin.ui.Layout.MarginHandler#getMargin() */ @Override @@ -438,7 +440,7 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements /* * (non-Javadoc) - * + * * @see com.vaadin.ui.Layout.MarginHandler#setMargin(MarginInfo) */ @Override @@ -448,7 +450,7 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements /* * (non-Javadoc) - * + * * @see com.vaadin.ui.Layout.AlignmentHandler#getDefaultComponentAlignment() */ @Override @@ -458,7 +460,7 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements /* * (non-Javadoc) - * + * * @see * com.vaadin.ui.Layout.AlignmentHandler#setDefaultComponentAlignment(com * .vaadin.ui.Alignment) @@ -476,7 +478,7 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements /* * (non-Javadoc) - * + * * @see com.vaadin.ui.AbstractComponent#readDesign(org.jsoup.nodes .Element, * com.vaadin.ui.declarative.DesignContext) */ @@ -503,8 +505,8 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements float ratio = Float.valueOf(value); setExpandRatio(newChild, ratio); } catch (NumberFormatException nfe) { - getLogger().info( - "Failed to parse expand ratio " + value); + getLogger() + .info("Failed to parse expand ratio " + value); } } else { setExpandRatio(newChild, 1.0f); @@ -515,7 +517,7 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements /* * (non-Javadoc) - * + * * @see com.vaadin.ui.AbstractComponent#writeDesign(org.jsoup.nodes.Element * , com.vaadin.ui.declarative.DesignContext) */ @@ -562,7 +564,7 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements /* * (non-Javadoc) - * + * * @see com.vaadin.ui.AbstractComponent#getCustomAttributes() */ @Override diff --git a/server/src/main/java/com/vaadin/ui/AbstractSelect.java b/server/src/main/java/com/vaadin/ui/AbstractSelect.java index 882458c531..80fd442724 100644 --- a/server/src/main/java/com/vaadin/ui/AbstractSelect.java +++ b/server/src/main/java/com/vaadin/ui/AbstractSelect.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -66,13 +66,13 @@ import com.vaadin.ui.declarative.DesignFormatter; * set of choices is presented as a set of {@link com.vaadin.data.Item}s in a * {@link com.vaadin.data.Container}. *

        - * + * *

        * A Select component may be in single- or multiselect mode. * Multiselect mode means that more than one item can be selected * simultaneously. *

        - * + * * @author Vaadin Ltd. * @since 5.0 */ @@ -92,7 +92,7 @@ public abstract class AbstractSelect extends AbstractField implements /** * Item caption mode: Item's ID's String representation is * used as caption. - * + * * @since 7.5.6 */ ID_TOSTRING, @@ -200,7 +200,7 @@ public abstract class AbstractSelect extends AbstractField implements /** * Sets the option filtering mode. - * + * * @param filteringMode * the filtering mode to use */ @@ -208,7 +208,7 @@ public abstract class AbstractSelect extends AbstractField implements /** * Gets the current filtering mode. - * + * * @return the filtering mode in use */ public FilteringMode getFilteringMode(); @@ -272,7 +272,7 @@ public abstract class AbstractSelect extends AbstractField implements /** * Item id that represents null selection of this select. - * + * *

        * Data interface does not support nulls as item ids. Selecting the item * identified by this id is the same as selecting no items at all. This @@ -307,7 +307,7 @@ public abstract class AbstractSelect extends AbstractField implements /** * Creates a new select that is connected to a data-source. - * + * * @param caption * the Caption of the component. * @param dataSource @@ -320,7 +320,7 @@ public abstract class AbstractSelect extends AbstractField implements /** * Creates a new select that is filled from a collection of option values. - * + * * @param caption * the Caption of this field. * @param options @@ -344,7 +344,7 @@ public abstract class AbstractSelect extends AbstractField implements /** * Paints the content of this component. - * + * * @param target * the Paint Event. * @throws PaintException @@ -449,7 +449,7 @@ public abstract class AbstractSelect extends AbstractField implements /** * Invoked when the value of a variable has changed. - * + * * @see com.vaadin.ui.AbstractComponent#changeVariables(java.lang.Object, * java.util.Map) */ @@ -488,7 +488,8 @@ public abstract class AbstractSelect extends AbstractField implements } } - if (!isNullSelectionAllowed() && acceptedSelections.size() < 1) { + if (!isNullSelectionAllowed() + && acceptedSelections.size() < 1) { // empty selection not allowed, keep old value markAsDirty(); return; @@ -498,7 +499,8 @@ public abstract class AbstractSelect extends AbstractField implements // (non-visible items can not be deselected) Collection visibleNotSelected = getVisibleItemIds(); if (visibleNotSelected != null) { - visibleNotSelected = new HashSet(visibleNotSelected); + visibleNotSelected = new HashSet( + visibleNotSelected); // Don't remove those that will be added to preserve order visibleNotSelected.removeAll(acceptedSelections); @@ -517,7 +519,8 @@ public abstract class AbstractSelect extends AbstractField implements // Single select mode if (!isNullSelectionAllowed() && (clientSideSelectedKeys.length == 0 - || clientSideSelectedKeys[0] == null || clientSideSelectedKeys[0] == getNullSelectionItemId())) { + || clientSideSelectedKeys[0] == null + || clientSideSelectedKeys[0] == getNullSelectionItemId())) { markAsDirty(); return; } @@ -554,7 +557,7 @@ public abstract class AbstractSelect extends AbstractField implements /** * TODO refine doc Setter for new item handler that is called when user adds * new item in newItemAllowed mode. - * + * * @param newItemHandler */ public void setNewItemHandler(NewItemHandler newItemHandler) { @@ -563,7 +566,7 @@ public abstract class AbstractSelect extends AbstractField implements /** * TODO refine doc - * + * * @return */ public NewItemHandler getNewItemHandler() { @@ -579,13 +582,13 @@ public abstract class AbstractSelect extends AbstractField implements /** * TODO refine doc - * + * * This is a default class that handles adding new items that are typed by * user to selects container. - * + * * By extending this class one may implement some logic on new item addition * like database inserts. - * + * */ public class DefaultNewItemHandler implements NewItemHandler { @Override @@ -602,7 +605,7 @@ public abstract class AbstractSelect extends AbstractField implements if (getItemCaptionPropertyId() != null) { getContainerProperty(newItemCaption, getItemCaptionPropertyId()) - .setValue(newItemCaption); + .setValue(newItemCaption); } if (isMultiSelect()) { Set values = new HashSet((Collection) getValue()); @@ -631,7 +634,7 @@ public abstract class AbstractSelect extends AbstractField implements * setValue methods must be compatible with this type: one can * safely cast getValue to given type and pass any variable * assignable to this type as a parameter to setValue. - * + * * @return the Type of the property. */ @Override @@ -645,7 +648,7 @@ public abstract class AbstractSelect extends AbstractField implements /** * Gets the selected item id or in multiselect mode a set of selected ids. - * + * * @see com.vaadin.ui.AbstractField#getValue() */ @Override @@ -677,13 +680,13 @@ public abstract class AbstractSelect extends AbstractField implements /** * Sets the visible value of the property. - * + * *

        * The value of the select is the selected item id. If the select is in * multiselect-mode, the value is a set of selected item keys. In * multiselect mode all collections of id:s can be assigned. *

        - * + * * @param newValue * the New selected item or collection of selected items. * @see com.vaadin.ui.AbstractField#setValue(java.lang.Object) @@ -699,13 +702,13 @@ public abstract class AbstractSelect extends AbstractField implements /** * Sets the visible value of the property. - * + * *

        * The value of the select is the selected item id. If the select is in * multiselect-mode, the value is a set of selected item keys. In * multiselect mode all collections of id:s can be assigned. *

        - * + * * @since 7.5.7 * @param newValue * the New selected item or collection of selected items. @@ -725,11 +728,12 @@ public abstract class AbstractSelect extends AbstractField implements if (newFieldValue == null) { super.setValue(new LinkedHashSet(), repaintIsNotNeeded, ignoreReadOnly); - } else if (Collection.class.isAssignableFrom(newFieldValue - .getClass())) { - super.setValue(new LinkedHashSet( - (Collection) newFieldValue), repaintIsNotNeeded, - ignoreReadOnly); + } else if (Collection.class + .isAssignableFrom(newFieldValue.getClass())) { + super.setValue( + new LinkedHashSet( + (Collection) newFieldValue), + repaintIsNotNeeded, ignoreReadOnly); } } else if (newFieldValue == null || items.containsId(newFieldValue)) { super.setValue(newFieldValue, repaintIsNotNeeded, ignoreReadOnly); @@ -741,7 +745,7 @@ public abstract class AbstractSelect extends AbstractField implements /** * Gets the item from the container with given id. If the container does not * contain the requested item, null is returned. - * + * * @param itemId * the item id. * @return the item from the container. @@ -753,7 +757,7 @@ public abstract class AbstractSelect extends AbstractField implements /** * Gets the item Id collection from the container. - * + * * @return the Collection of item ids. */ @Override @@ -763,7 +767,7 @@ public abstract class AbstractSelect extends AbstractField implements /** * Gets the property Id collection from the container. - * + * * @return the Collection of property ids. */ @Override @@ -773,7 +777,7 @@ public abstract class AbstractSelect extends AbstractField implements /** * Gets the property type. - * + * * @param propertyId * the Id identifying the property. * @see com.vaadin.data.Container#getType(java.lang.Object) @@ -785,9 +789,9 @@ public abstract class AbstractSelect extends AbstractField implements /* * Gets the number of items in the container. - * + * * @return the Number of items in the container. - * + * * @see com.vaadin.data.Container#size() */ @Override @@ -799,7 +803,7 @@ public abstract class AbstractSelect extends AbstractField implements /** * Tests, if the collection contains an item with given id. - * + * * @param itemId * the Id the of item to be tested. */ @@ -815,7 +819,7 @@ public abstract class AbstractSelect extends AbstractField implements /** * Gets the Property identified by the given itemId and propertyId from the * Container - * + * * @see com.vaadin.data.Container#getContainerProperty(Object, Object) */ @Override @@ -826,10 +830,10 @@ public abstract class AbstractSelect extends AbstractField implements /** * Adds the new property to all items. Adds a property with given id, type * and default value to all items in the container. - * + * * This functionality is optional. If the function is unsupported, it always * returns false. - * + * * @return True if the operation succeeded. * @see com.vaadin.data.Container#addContainerProperty(java.lang.Object, * java.lang.Class, java.lang.Object) @@ -848,10 +852,10 @@ public abstract class AbstractSelect extends AbstractField implements /** * Removes all items from the container. - * + * * This functionality is optional. If the function is unsupported, it always * returns false. - * + * * @return True if the operation succeeded. * @see com.vaadin.data.Container#removeAllItems() */ @@ -873,7 +877,7 @@ public abstract class AbstractSelect extends AbstractField implements * Creates a new item into container with container managed id. The id of * the created new item is returned. The item can be fetched with getItem() * method. if the creation fails, null is returned. - * + * * @return the Id of the created item or null in case of failure. * @see com.vaadin.data.Container#addItem() */ @@ -893,10 +897,10 @@ public abstract class AbstractSelect extends AbstractField implements * ready for setting property values. if the creation fails, null is * returned. In case the container already contains the item, null is * returned. - * + * * This functionality is optional. If the function is unsupported, it always * returns null. - * + * * @param itemId * the Identification of the item to be created. * @return the Created item with the given id, or null in case of failure. @@ -915,7 +919,7 @@ public abstract class AbstractSelect extends AbstractField implements /** * Adds given items with given item ids to container. - * + * * @since 7.2 * @param itemId * item identifiers to be added to underlying container @@ -923,7 +927,8 @@ public abstract class AbstractSelect extends AbstractField implements * if the underlying container don't support adding items with * identifiers */ - public void addItems(Object... itemId) throws UnsupportedOperationException { + public void addItems(Object... itemId) + throws UnsupportedOperationException { for (Object id : itemId) { addItem(id); } @@ -931,7 +936,7 @@ public abstract class AbstractSelect extends AbstractField implements /** * Adds given items with given item ids to container. - * + * * @since 7.2 * @param itemIds * item identifiers to be added to underlying container @@ -946,7 +951,7 @@ public abstract class AbstractSelect extends AbstractField implements /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container#removeItem(java.lang.Object) */ @Override @@ -1001,10 +1006,10 @@ public abstract class AbstractSelect extends AbstractField implements /** * Removes the property from all items. Removes a property with given id * from all the items in the container. - * + * * This functionality is optional. If the function is unsupported, it always * returns false. - * + * * @return True if the operation succeeded. * @see com.vaadin.data.Container#removeContainerProperty(java.lang.Object) */ @@ -1023,12 +1028,12 @@ public abstract class AbstractSelect extends AbstractField implements /** * Sets the Container that serves as the data source of the viewer. - * + * * As a side-effect the fields value (selection) is set to null due old * selection not necessary exists in new Container. - * + * * @see com.vaadin.data.Container.Viewer#setContainerDataSource(Container) - * + * * @param newDataSource * the new data source. */ @@ -1085,7 +1090,7 @@ public abstract class AbstractSelect extends AbstractField implements /** * Gets the viewing data-source container. - * + * * @see com.vaadin.data.Container.Viewer#getContainerDataSource() */ @Override @@ -1097,7 +1102,7 @@ public abstract class AbstractSelect extends AbstractField implements /** * Is the select in multiselect mode? In multiselect mode - * + * * @return the Value of property multiSelect. */ public boolean isMultiSelect() { @@ -1108,10 +1113,10 @@ public abstract class AbstractSelect extends AbstractField implements * Sets the multiselect mode. Setting multiselect mode false may lose * selection information: if selected items set contains one or more * selected items, only one of the selected items is kept as selected. - * + * * Subclasses of AbstractSelect can choose not to support changing the * multiselect mode, and may throw {@link UnsupportedOperationException}. - * + * * @param multiSelect * the New value of property multiSelect. */ @@ -1153,7 +1158,7 @@ public abstract class AbstractSelect extends AbstractField implements * Does the select allow adding new options by the user. If true, the new * options can be added to the Container. The text entered by the user is * used as id. Note that data-source must allow adding new items. - * + * * @return True if additions are allowed. */ public boolean isNewItemsAllowed() { @@ -1162,7 +1167,7 @@ public abstract class AbstractSelect extends AbstractField implements /** * Enables or disables possibility to add new options by the user. - * + * * @param allowNewOptions * the New value of property allowNewOptions. */ @@ -1180,7 +1185,7 @@ public abstract class AbstractSelect extends AbstractField implements /** * Override the caption of an item. Setting caption explicitly overrides id, * item and index captions. - * + * * @param itemId * the id of the item to be recaptioned. * @param caption @@ -1197,7 +1202,7 @@ public abstract class AbstractSelect extends AbstractField implements * Gets the caption of an item. The caption is generated as specified by the * item caption mode. See setItemCaptionMode() for more * details. - * + * * @param itemId * the id of the item to be queried. * @return the caption for specified item. @@ -1221,8 +1226,8 @@ public abstract class AbstractSelect extends AbstractField implements break; case INDEX: if (items instanceof Container.Indexed) { - caption = String.valueOf(((Container.Indexed) items) - .indexOfId(itemId)); + caption = String + .valueOf(((Container.Indexed) items).indexOfId(itemId)); } else { caption = "ERROR: Container is not indexed"; } @@ -1265,7 +1270,8 @@ public abstract class AbstractSelect extends AbstractField implements private String idToCaption(Object itemId) { try { Converter c = (Converter) ConverterUtil - .getConverter(String.class, itemId.getClass(), getSession()); + .getConverter(String.class, itemId.getClass(), + getSession()); return ConverterUtil.convertFromModel(itemId, String.class, c, getLocale()); } catch (Exception e) { @@ -1275,7 +1281,7 @@ public abstract class AbstractSelect extends AbstractField implements /** * Sets the icon for an item. - * + * * @param itemId * the id of the item to be assigned an icon. * @param icon @@ -1294,7 +1300,7 @@ public abstract class AbstractSelect extends AbstractField implements /** * Gets the item icon. - * + * * @param itemId * the id of the item to be assigned an icon. * @return the icon for the item or null, if not specified. @@ -1324,12 +1330,12 @@ public abstract class AbstractSelect extends AbstractField implements /** * Sets the item caption mode. - * + * * See {@link ItemCaptionMode} for a description of the modes. *

        * {@link ItemCaptionMode#EXPLICIT_DEFAULTS_ID} is the default mode. *

        - * + * * @param mode * the One of the modes listed above. */ @@ -1342,7 +1348,7 @@ public abstract class AbstractSelect extends AbstractField implements /** * Gets the item caption mode. - * + * *

        * The mode can be one of the following ones: *

          @@ -1365,7 +1371,7 @@ public abstract class AbstractSelect extends AbstractField implements * The ITEM_CAPTION_MODE_EXPLICIT_DEFAULTS_ID is the default * mode. *

          - * + * * @return the One of the modes listed above. */ public ItemCaptionMode getItemCaptionMode() { @@ -1374,7 +1380,7 @@ public abstract class AbstractSelect extends AbstractField implements /** * Sets the item caption property. - * + * *

          * Setting the id to a existing property implicitly sets the item caption * mode to ITEM_CAPTION_MODE_PROPERTY. If the object is in @@ -1390,10 +1396,10 @@ public abstract class AbstractSelect extends AbstractField implements * default *

          * . - * + * * @param propertyId * the id of the property. - * + * */ public void setItemCaptionPropertyId(Object propertyId) { if (propertyId != null) { @@ -1411,7 +1417,7 @@ public abstract class AbstractSelect extends AbstractField implements /** * Gets the item caption property. - * + * * @return the Id of the property used as item caption source. */ public Object getItemCaptionPropertyId() { @@ -1420,24 +1426,24 @@ public abstract class AbstractSelect extends AbstractField implements /** * Sets the item icon property. - * + * *

          * If the property id is set to a valid value, each item is given an icon * got from the given property of the items. The type of the property must * be assignable to Resource. *

          - * + * *

          * Note : The icons set with setItemIcon function override the * icons from the property. *

          - * + * *

          * Setting the property id to null disables this feature. The id is null by * default *

          * . - * + * * @param propertyId * the id of the property that specifies icons for items or null * @throws IllegalArgumentException @@ -1462,24 +1468,24 @@ public abstract class AbstractSelect extends AbstractField implements /** * Gets the item icon property. - * + * *

          * If the property id is set to a valid value, each item is given an icon * got from the given property of the items. The type of the property must * be assignable to Icon. *

          - * + * *

          * Note : The icons set with setItemIcon function override the * icons from the property. *

          - * + * *

          * Setting the property id to null disables this feature. The id is null by * default *

          * . - * + * * @return the Id of the property containing the item icons. */ public Object getItemIconPropertyId() { @@ -1488,18 +1494,18 @@ public abstract class AbstractSelect extends AbstractField implements /** * Tests if an item is selected. - * + * *

          * In single select mode testing selection status of the item identified by * {@link #getNullSelectionItemId()} returns true if the value of the * property is null. *

          - * + * * @param itemId * the Id the of the item to be tested. * @see #getNullSelectionItemId() * @see #setNullSelectionItemId(Object) - * + * */ public boolean isSelected(Object itemId) { if (itemId == null) { @@ -1509,24 +1515,24 @@ public abstract class AbstractSelect extends AbstractField implements return ((Set) getValue()).contains(itemId); } else { final Object value = getValue(); - return itemId.equals(value == null ? getNullSelectionItemId() - : value); + return itemId + .equals(value == null ? getNullSelectionItemId() : value); } } /** * Selects an item. - * + * *

          * In single select mode selecting item identified by * {@link #getNullSelectionItemId()} sets the value of the property to null. *

          - * + * * @param itemId * the identifier of Item to be selected. * @see #getNullSelectionItemId() * @see #setNullSelectionItemId(Object) - * + * */ public void select(Object itemId) { if (!isMultiSelect()) { @@ -1541,12 +1547,12 @@ public abstract class AbstractSelect extends AbstractField implements /** * Unselects an item. - * + * * @param itemId * the identifier of the Item to be unselected. * @see #getNullSelectionItemId() * @see #setNullSelectionItemId(Object) - * + * */ public void unselect(Object itemId) { if (isSelected(itemId)) { @@ -1562,7 +1568,7 @@ public abstract class AbstractSelect extends AbstractField implements /** * Notifies this listener that the Containers contents has changed. - * + * * @see com.vaadin.data.Container.PropertySetChangeListener#containerPropertySetChange(com.vaadin.data.Container.PropertySetChangeEvent) */ @Override @@ -1573,7 +1579,7 @@ public abstract class AbstractSelect extends AbstractField implements /** * Adds a new Property set change listener for this Container. - * + * * @see com.vaadin.data.Container.PropertySetChangeNotifier#addListener(com.vaadin.data.Container.PropertySetChangeListener) */ @Override @@ -1597,7 +1603,7 @@ public abstract class AbstractSelect extends AbstractField implements /** * Removes a previously registered Property set change listener. - * + * * @see com.vaadin.data.Container.PropertySetChangeNotifier#removeListener(com.vaadin.data.Container.PropertySetChangeListener) */ @Override @@ -1623,7 +1629,7 @@ public abstract class AbstractSelect extends AbstractField implements /** * Adds an Item set change listener for the object. - * + * * @see com.vaadin.data.Container.ItemSetChangeNotifier#addListener(com.vaadin.data.Container.ItemSetChangeListener) */ @Override @@ -1647,7 +1653,7 @@ public abstract class AbstractSelect extends AbstractField implements /** * Removes the Item set change listener from the object. - * + * * @see com.vaadin.data.Container.ItemSetChangeNotifier#removeListener(com.vaadin.data.Container.ItemSetChangeListener) */ @Override @@ -1695,7 +1701,7 @@ public abstract class AbstractSelect extends AbstractField implements /** * Lets the listener know a Containers Item set has changed. - * + * * @see com.vaadin.data.Container.ItemSetChangeListener#containerItemSetChange(com.vaadin.data.Container.ItemSetChangeEvent) */ @Override @@ -1743,8 +1749,8 @@ public abstract class AbstractSelect extends AbstractField implements /** * Implementation of item set change event. */ - private static class ItemSetChangeEvent extends EventObject implements - Serializable, Container.ItemSetChangeEvent { + private static class ItemSetChangeEvent extends EventObject + implements Serializable, Container.ItemSetChangeEvent { private ItemSetChangeEvent(Container source) { super(source); @@ -1752,7 +1758,7 @@ public abstract class AbstractSelect extends AbstractField implements /** * Gets the Property where the event occurred. - * + * * @see com.vaadin.data.Container.ItemSetChangeEvent#getContainer() */ @Override @@ -1765,8 +1771,8 @@ public abstract class AbstractSelect extends AbstractField implements /** * Implementation of property set change event. */ - private static class PropertySetChangeEvent extends EventObject implements - Container.PropertySetChangeEvent, Serializable { + private static class PropertySetChangeEvent extends EventObject + implements Container.PropertySetChangeEvent, Serializable { private PropertySetChangeEvent(Container source) { super(source); @@ -1774,7 +1780,7 @@ public abstract class AbstractSelect extends AbstractField implements /** * Retrieves the Container whose contents have been modified. - * + * * @see com.vaadin.data.Container.PropertySetChangeEvent#getContainer() */ @Override @@ -1787,7 +1793,7 @@ public abstract class AbstractSelect extends AbstractField implements /** * For multi-selectable fields, also an empty collection of values is * considered to be an empty field. - * + * * @see AbstractField#isEmpty(). */ @Override @@ -1796,9 +1802,8 @@ public abstract class AbstractSelect extends AbstractField implements return super.isEmpty(); } else { Object value = getValue(); - return super.isEmpty() - || (value instanceof Collection && ((Collection) value) - .isEmpty()); + return super.isEmpty() || (value instanceof Collection + && ((Collection) value).isEmpty()); } } @@ -1807,7 +1812,7 @@ public abstract class AbstractSelect extends AbstractField implements * single-select mode, you can make an item represent the empty selection by * calling setNullSelectionItemId(). This way you can for * instance set an icon and caption for the null selection item. - * + * * @param nullSelectionAllowed * whether or not to allow empty selection * @see #setNullSelectionItemId(Object) @@ -1822,7 +1827,7 @@ public abstract class AbstractSelect extends AbstractField implements /** * Checks if null empty selection is allowed by the user. - * + * * @return whether or not empty selection is allowed * @see #setNullSelectionAllowed(boolean) */ @@ -1833,13 +1838,13 @@ public abstract class AbstractSelect extends AbstractField implements /** * Returns the item id that represents null value of this select in single * select mode. - * + * *

          * Data interface does not support nulls as item ids. Selecting the item * identified by this id is the same as selecting no items at all. This * setting only affects the single select mode. *

          - * + * * @return the Object Null value item id. * @see #setNullSelectionItemId(Object) * @see #isSelected(Object) @@ -1851,13 +1856,13 @@ public abstract class AbstractSelect extends AbstractField implements /** * Sets the item id that represents null value of this select. - * + * *

          * Data interface does not support nulls as item ids. Selecting the item * identified by this id is the same as selecting no items at all. This * setting only affects the single select mode. *

          - * + * * @param nullSelectionItemId * the nullSelectionItemId to set. * @see #getNullSelectionItemId() @@ -1874,7 +1879,7 @@ public abstract class AbstractSelect extends AbstractField implements /** * Notifies the component that it is connected to an application. - * + * * @see com.vaadin.ui.AbstractField#attach() */ @Override @@ -1884,7 +1889,7 @@ public abstract class AbstractSelect extends AbstractField implements /** * Detaches the component from application. - * + * * @see com.vaadin.ui.AbstractComponent#detach() */ @Override @@ -1908,9 +1913,9 @@ public abstract class AbstractSelect extends AbstractField implements * "lazyloading" components should take care to add and remove listeners as * appropriate. Call addNotifierForItem() for each painted item (and * remember to clear). - * + * * NOTE: singleton, use getCaptionChangeListener(). - * + * */ protected class CaptionChangeListener implements Item.PropertySetChangeListener, Property.ValueChangeListener { @@ -1928,7 +1933,8 @@ public abstract class AbstractSelect extends AbstractField implements } if (i instanceof Item.PropertySetChangeNotifier) { ((Item.PropertySetChangeNotifier) i) - .addPropertySetChangeListener(getCaptionChangeListener()); + .addPropertySetChangeListener( + getCaptionChangeListener()); captionChangeNotifiers.add(i); } Collection pids = i.getItemPropertyIds(); @@ -1938,7 +1944,8 @@ public abstract class AbstractSelect extends AbstractField implements if (p != null && p instanceof Property.ValueChangeNotifier) { ((Property.ValueChangeNotifier) p) - .addValueChangeListener(getCaptionChangeListener()); + .addValueChangeListener( + getCaptionChangeListener()); captionChangeNotifiers.add(p); } } @@ -1973,17 +1980,20 @@ public abstract class AbstractSelect extends AbstractField implements Object notifier = it.next(); if (notifier instanceof Item.PropertySetChangeNotifier) { ((Item.PropertySetChangeNotifier) notifier) - .removePropertySetChangeListener(getCaptionChangeListener()); + .removePropertySetChangeListener( + getCaptionChangeListener()); } else { ((Property.ValueChangeNotifier) notifier) - .removeValueChangeListener(getCaptionChangeListener()); + .removeValueChangeListener( + getCaptionChangeListener()); } } captionChangeNotifiers.clear(); } @Override - public void valueChange(com.vaadin.data.Property.ValueChangeEvent event) { + public void valueChange( + com.vaadin.data.Property.ValueChangeEvent event) { markAsDirty(); } @@ -2000,7 +2010,7 @@ public abstract class AbstractSelect extends AbstractField implements * given Item identifier(s). Criterion can be used only on a drop targets * that extends AbstractSelect like {@link Table} and {@link Tree}. The * target and identifiers of valid Items are given in constructor. - * + * * @since 6.3 */ public static class TargetItemIs extends AbstractItemSetCriterion { @@ -2029,18 +2039,19 @@ public abstract class AbstractSelect extends AbstractField implements /** * Abstract helper class to implement item id based criterion. - * + * * Note, inner class used not to open itemIdMapper for public access. - * + * * @since 6.3 - * + * */ - private static abstract class AbstractItemSetCriterion extends - ClientSideCriterion { + private static abstract class AbstractItemSetCriterion + extends ClientSideCriterion { protected final Collection itemIds = new HashSet(); protected AbstractSelect select; - public AbstractItemSetCriterion(AbstractSelect select, Object... itemId) { + public AbstractItemSetCriterion(AbstractSelect select, + Object... itemId) { if (itemIds == null || select == null) { throw new IllegalArgumentException( "Accepted item identifiers must be accepted."); @@ -2067,7 +2078,7 @@ public abstract class AbstractSelect extends AbstractField implements /** * This criterion accepts a only a {@link Transferable} that contains given * Item (practically its identifier) from a specific AbstractSelect. - * + * * @since 6.3 */ public static class AcceptItem extends AbstractItemSetCriterion { @@ -2106,7 +2117,7 @@ public abstract class AbstractSelect extends AbstractField implements /** * TargetDetails implementation for subclasses of {@link AbstractSelect} * that implement {@link DropTarget}. - * + * * @since 6.3 */ public class AbstractSelectTargetDetails extends TargetDetailsImpl { @@ -2119,9 +2130,10 @@ public abstract class AbstractSelect extends AbstractField implements /** * Constructor that automatically converts itemIdOver key to * corresponding item Id - * + * */ - protected AbstractSelectTargetDetails(Map rawVariables) { + protected AbstractSelectTargetDetails( + Map rawVariables) { super(rawVariables, (DropTarget) AbstractSelect.this); // eagar fetch itemid, mapper may be emptied String keyover = (String) getData("itemIdOver"); @@ -2133,7 +2145,7 @@ public abstract class AbstractSelect extends AbstractField implements /** * If the drag operation is currently over an {@link Item}, this method * returns the identifier of that {@link Item}. - * + * */ public Object getItemIdOver() { return idOver; @@ -2182,7 +2194,7 @@ public abstract class AbstractSelect extends AbstractField implements /** * Called by Table when a cell (and row) is painted or a item is painted * in Tree - * + * * @param source * The source of the generator, the Tree or Table the * generator is attached to @@ -2226,7 +2238,7 @@ public abstract class AbstractSelect extends AbstractField implements * Reads an Item from a design and inserts it into the data source. * Hierarchical select components should override this method to recursively * recursively read any child items as well. - * + * * @since 7.5.0 * @param child * a child element representing the item @@ -2236,7 +2248,7 @@ public abstract class AbstractSelect extends AbstractField implements * @param context * the DesignContext instance used in parsing * @return the item id of the new item - * + * * @throws DesignException * if the tag name of the {@code child} element is not * {@code option}. @@ -2259,10 +2271,8 @@ public abstract class AbstractSelect extends AbstractField implements } if (child.hasAttr("icon")) { - setItemIcon( - itemId, - DesignAttributeHandler.readAttribute("icon", - child.attributes(), Resource.class)); + setItemIcon(itemId, DesignAttributeHandler.readAttribute("icon", + child.attributes(), Resource.class)); } if (child.hasAttr("selected")) { @@ -2286,7 +2296,7 @@ public abstract class AbstractSelect extends AbstractField implements /** * Writes the data source items to a design. Hierarchical select components * should override this method to only write the root items. - * + * * @since 7.5.0 * @param design * the element into which to insert the items @@ -2302,7 +2312,7 @@ public abstract class AbstractSelect extends AbstractField implements /** * Writes a data source Item to a design. Hierarchical select components * should override this method to recursively write any child items as well. - * + * * @since 7.5.0 * @param design * the element into which to insert the item diff --git a/server/src/main/java/com/vaadin/ui/AbstractSingleComponentContainer.java b/server/src/main/java/com/vaadin/ui/AbstractSingleComponentContainer.java index 0854ffe9c2..07a0da9a68 100644 --- a/server/src/main/java/com/vaadin/ui/AbstractSingleComponentContainer.java +++ b/server/src/main/java/com/vaadin/ui/AbstractSingleComponentContainer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -30,14 +30,14 @@ import com.vaadin.ui.declarative.DesignException; /** * Abstract base class for component containers that have only one child * component. - * + * * For component containers that support multiple children, inherit * {@link AbstractComponentContainer} instead of this class. - * + * * @since 7.0 */ -public abstract class AbstractSingleComponentContainer extends - AbstractComponent implements SingleComponentContainer { +public abstract class AbstractSingleComponentContainer extends AbstractComponent + implements SingleComponentContainer { private Component content; @@ -65,7 +65,8 @@ public abstract class AbstractSingleComponentContainer extends /* documented in interface */ @Override - public void removeComponentAttachListener(ComponentAttachListener listener) { + public void removeComponentAttachListener( + ComponentAttachListener listener) { removeListener(ComponentAttachEvent.class, listener, ComponentAttachListener.attachMethod); } @@ -79,7 +80,8 @@ public abstract class AbstractSingleComponentContainer extends /* documented in interface */ @Override - public void removeComponentDetachListener(ComponentDetachListener listener) { + public void removeComponentDetachListener( + ComponentDetachListener listener) { removeListener(ComponentDetachEvent.class, listener, ComponentDetachListener.detachMethod); } @@ -88,7 +90,7 @@ public abstract class AbstractSingleComponentContainer extends * Fires the component attached event. This is called by the * {@link #setContent(Component)} method after the component has been set as * the content. - * + * * @param component * the component that has been added to this container. */ @@ -100,7 +102,7 @@ public abstract class AbstractSingleComponentContainer extends * Fires the component detached event. This is called by the * {@link #setContent(Component)} method after the content component has * been replaced by other content. - * + * * @param component * the component that has been removed from this container. */ @@ -116,13 +118,13 @@ public abstract class AbstractSingleComponentContainer extends /** * Sets the content of this container. The content is a component that * serves as the outermost item of the visual contents. - * + * * The content must always be set, either with a constructor parameter or by * calling this method. - * + * * Previous versions of Vaadin used a {@link VerticalLayout} with margins * enabled as the default content but that is no longer the case. - * + * * @param content * a component (typically a layout) to use as content */ @@ -156,7 +158,7 @@ public abstract class AbstractSingleComponentContainer extends /** * Utility method for removing a component from its parent (if possible). - * + * * @param content * component to remove */ @@ -208,8 +210,9 @@ public abstract class AbstractSingleComponentContainer extends dirtyChild = getInvalidSizedChild(false); } else if ((width == SIZE_UNDEFINED && getWidth() != SIZE_UNDEFINED) || (unit == Unit.PERCENTAGE - && getWidthUnits() != Unit.PERCENTAGE && !ComponentSizeValidator - .parentCanDefineWidth(this))) { + && getWidthUnits() != Unit.PERCENTAGE + && !ComponentSizeValidator + .parentCanDefineWidth(this))) { /* * relative width children may get to invalid state if width becomes * invalid. Width may also become invalid if units become percentage @@ -265,8 +268,9 @@ public abstract class AbstractSingleComponentContainer extends dirtyChild = getInvalidSizedChild(true); } else if ((height == SIZE_UNDEFINED && getHeight() != SIZE_UNDEFINED) || (unit == Unit.PERCENTAGE - && getHeightUnits() != Unit.PERCENTAGE && !ComponentSizeValidator - .parentCanDefineHeight(this))) { + && getHeightUnits() != Unit.PERCENTAGE + && !ComponentSizeValidator + .parentCanDefineHeight(this))) { /* * relative height children may get to invalid state if height * becomes invalid. Height may also become invalid if units become @@ -281,7 +285,7 @@ public abstract class AbstractSingleComponentContainer extends /* * (non-Javadoc) - * + * * @see com.vaadin.ui.AbstractComponent#readDesign(org.jsoup.nodes .Element, * com.vaadin.ui.declarative.DesignContext) */ @@ -298,24 +302,25 @@ public abstract class AbstractSingleComponentContainer extends * contains multiple child elements, a DesignException is thrown. This * method should be overridden by subclasses whose design may contain * non-content child elements. - * + * * @since 7.5.0 - * + * * @param children * the child elements of the design that is being read * @param context * the DesignContext instance used to parse the design - * + * * @throws DesignException * if there are multiple child elements * @throws DesignException * if a child element could not be parsed as a Component */ - protected void readDesignChildren(Elements children, DesignContext context) { + protected void readDesignChildren(Elements children, + DesignContext context) { if (children.size() > 1) { - throw new DesignException("The container of type " - + getClass().toString() - + " can have only one child component."); + throw new DesignException( + "The container of type " + getClass().toString() + + " can have only one child component."); } else if (children.size() == 1) { setContent(context.readDesign(children.first())); } @@ -323,7 +328,7 @@ public abstract class AbstractSingleComponentContainer extends /* * (non-Javadoc) - * + * * @see com.vaadin.ui.AbstractComponent#writeDesign(org.jsoup.nodes.Element * , com.vaadin.ui.declarative.DesignContext) */ diff --git a/server/src/main/java/com/vaadin/ui/AbstractSplitPanel.java b/server/src/main/java/com/vaadin/ui/AbstractSplitPanel.java index 0561996277..2bf93219fb 100644 --- a/server/src/main/java/com/vaadin/ui/AbstractSplitPanel.java +++ b/server/src/main/java/com/vaadin/ui/AbstractSplitPanel.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -39,10 +39,10 @@ import com.vaadin.util.ReflectTools; /** * AbstractSplitPanel. - * + * * AbstractSplitPanel is base class for a component container that * can contain two components. The components are split by a divider element. - * + * * @author Vaadin Ltd. * @since 6.5 */ @@ -79,8 +79,8 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { * Modifiable and Serializable Iterator for the components, used by * {@link AbstractSplitPanel#getComponentIterator()}. */ - private class ComponentIterator implements Iterator, - Serializable { + private class ComponentIterator + implements Iterator, Serializable { int i = 0; @@ -125,7 +125,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { /** * Add a component into this container. The component is added to the right * or under the previous component. - * + * * @param c * the component to be added. */ @@ -145,7 +145,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { /** * Sets the first component of this split panel. Depending on the direction * the first component is shown at the top or to the left. - * + * * @param c * The component to use as first component */ @@ -168,7 +168,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { /** * Sets the second component of this split panel. Depending on the direction * the second component is shown at the bottom or to the right. - * + * * @param c * The component to use as second component */ @@ -191,7 +191,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { /** * Gets the first component of this split panel. Depending on the direction * this is either the component shown at the top or to the left. - * + * * @return the first component of this split panel */ public Component getFirstComponent() { @@ -201,7 +201,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { /** * Gets the second component of this split panel. Depending on the direction * this is either the component shown at the top or to the left. - * + * * @return the second component of this split panel */ public Component getSecondComponent() { @@ -210,7 +210,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { /** * Removes the component from this container. - * + * * @param c * the component to be removed. */ @@ -227,7 +227,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { /* * (non-Javadoc) - * + * * @see com.vaadin.ui.ComponentContainer#getComponentIterator() */ @@ -239,7 +239,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { /** * Gets the number of contained components. Consistent with the iterator * returned by {@link #getComponentIterator()}. - * + * * @return the number of contained components (zero, one or two) */ @@ -258,7 +258,8 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { /* Documented in superclass */ @Override - public void replaceComponent(Component oldComponent, Component newComponent) { + public void replaceComponent(Component oldComponent, + Component newComponent) { if (oldComponent == getFirstComponent()) { setFirstComponent(newComponent); } else if (oldComponent == getSecondComponent()) { @@ -268,7 +269,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { /** * Moves the position of the splitter. - * + * * @param pos * the new size of the first region in the unit that was last * used (default is percentage). Fractions are only allowed when @@ -280,12 +281,12 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { /** * Moves the position of the splitter. - * + * * @param pos * the new size of the region in the unit that was last used * (default is percentage). Fractions are only allowed when unit * is percentage. - * + * * @param reverse * if set to true the split splitter position is measured by the * second region else it is measured by the first region @@ -296,7 +297,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { /** * Moves the position of the splitter with given position and unit. - * + * * @param pos * the new size of the first region. Fractions are only allowed * when unit is percentage. @@ -309,7 +310,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { /** * Moves the position of the splitter with given position and unit. - * + * * @param pos * the new size of the first region. Fractions are only allowed * when unit is percentage. @@ -318,7 +319,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { * @param reverse * if set to true the split splitter position is measured by the * second region else it is measured by the first region - * + * */ public void setSplitPosition(float pos, Unit unit, boolean reverse) { if (unit != Unit.PERCENTAGE && unit != Unit.PIXELS) { @@ -340,7 +341,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { /** * Returns the current position of the splitter, in * {@link #getSplitPositionUnit()} units. - * + * * @return position of the splitter */ public float getSplitPosition() { @@ -349,7 +350,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { /** * Returns the unit of position of the splitter - * + * * @return unit of position of the splitter * @see #setSplitPosition(float, Unit) */ @@ -361,7 +362,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { * Is the split position reversed. By default the split position is measured * by the first region, but if split position is reversed the measuring is * done by the second region instead. - * + * * @since 7.3.6 * @return {@code true} if reversed, {@code false} otherwise. * @see #setSplitPosition(float, boolean) @@ -373,7 +374,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { /** * Sets the minimum split position to the given position and unit. If the * split position is reversed, maximum and minimum are also reversed. - * + * * @param pos * the minimum position of the split * @param unit @@ -388,7 +389,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { /** * Returns the current minimum position of the splitter, in * {@link #getMinSplitPositionUnit()} units. - * + * * @return the minimum position of the splitter */ public float getMinSplitPosition() { @@ -397,7 +398,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { /** * Returns the unit of the minimum position of the splitter. - * + * * @return the unit of the minimum position of the splitter */ public Unit getMinSplitPositionUnit() { @@ -407,7 +408,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { /** * Sets the maximum split position to the given position and unit. If the * split position is reversed, maximum and minimum are also reversed. - * + * * @param pos * the maximum position of the split * @param unit @@ -422,7 +423,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { /** * Returns the current maximum position of the splitter, in * {@link #getMaxSplitPositionUnit()} units. - * + * * @return the maximum position of the splitter */ public float getMaxSplitPosition() { @@ -431,7 +432,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { /** * Returns the unit of the maximum position of the splitter - * + * * @return the unit of the maximum position of the splitter */ public Unit getMaxSplitPositionUnit() { @@ -441,7 +442,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { /** * Sets the maximum and minimum position of the splitter. If the split * position is reversed, maximum and minimum are also reversed. - * + * * @param minPos * the new minimum position * @param minPosUnit @@ -456,7 +457,8 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { private void setSplitPositionLimits(float minPos, Unit minPosUnit, float maxPos, Unit maxPosUnit) { if ((minPosUnit != Unit.PERCENTAGE && minPosUnit != Unit.PIXELS) - || (maxPosUnit != Unit.PERCENTAGE && maxPosUnit != Unit.PIXELS)) { + || (maxPosUnit != Unit.PERCENTAGE + && maxPosUnit != Unit.PIXELS)) { throw new IllegalArgumentException( "Only percentage and pixel units are allowed"); } @@ -475,7 +477,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { /** * Lock the SplitPanels position, disabling the user from dragging the split * handle. - * + * * @param locked * Set true if locked, false otherwise. */ @@ -486,7 +488,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { /** * Is the SplitPanel handle locked (user not allowed to change split * position by dragging). - * + * * @return true if locked, false otherwise. */ public boolean isLocked() { @@ -496,7 +498,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { /** * SplitterClickListener interface for listening for * SplitterClickEvent fired by a SplitPanel. - * + * * @see SplitterClickEvent * @since 6.2 */ @@ -508,7 +510,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { /** * SplitPanel splitter has been clicked - * + * * @param event * SplitterClickEvent event. */ @@ -527,10 +529,11 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { /** * Interface for listening for {@link SplitPositionChangeEvent}s fired by a * SplitPanel. - * + * * @since 7.5.0 */ - public interface SplitPositionChangeListener extends ConnectorEventListener { + public interface SplitPositionChangeListener + extends ConnectorEventListener { public static final Method moveMethod = ReflectTools.findMethod( SplitPositionChangeListener.class, "onSplitPositionChanged", @@ -538,7 +541,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { /** * SplitPanel splitter position has been changed. - * + * * @param event * SplitPositionChangeEvent event. */ @@ -547,7 +550,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { /** * Event that indicates a change in SplitPanel's splitter position. - * + * * @since 7.5.0 */ public static class SplitPositionChangeEvent extends Component.Event { @@ -587,8 +590,8 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { } public void removeSplitterClickListener(SplitterClickListener listener) { - removeListener(EventId.CLICK_EVENT_IDENTIFIER, - SplitterClickEvent.class, listener); + removeListener(EventId.CLICK_EVENT_IDENTIFIER, SplitterClickEvent.class, + listener); } /** @@ -602,7 +605,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { /** * Register a listener to handle {@link SplitPositionChangeEvent}s. - * + * * @since 7.5.0 * @param listener * {@link SplitPositionChangeListener} to be registered. @@ -615,7 +618,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { /** * Removes a {@link SplitPositionChangeListener}. - * + * * @since 7.5.0 * @param listener * SplitPositionChangeListener to be removed. @@ -640,12 +643,13 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { } private SplitterState getSplitterState(boolean markAsDirty) { - return ((AbstractSplitPanelState) super.getState(markAsDirty)).splitterState; + return ((AbstractSplitPanelState) super.getState( + markAsDirty)).splitterState; } /* * (non-Javadoc) - * + * * @see com.vaadin.ui.AbstractComponent#readDesign(org.jsoup.nodes .Element, * com.vaadin.ui.declarative.DesignContext) */ @@ -722,15 +726,13 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { + getSplitPositionUnit(); design.attr("split-position", splitPositionString); } - if (getMinSplitPosition() != def.getMinSplitPosition() - || !def.getMinSplitPositionUnit().equals( - getMinSplitPositionUnit())) { + if (getMinSplitPosition() != def.getMinSplitPosition() || !def + .getMinSplitPositionUnit().equals(getMinSplitPositionUnit())) { design.attr("min-split-position", asString(getMinSplitPosition()) + getMinSplitPositionUnit()); } - if (getMaxSplitPosition() != def.getMaxSplitPosition() - || !def.getMaxSplitPositionUnit().equals( - getMaxSplitPositionUnit())) { + if (getMaxSplitPosition() != def.getMaxSplitPosition() || !def + .getMaxSplitPositionUnit().equals(getMaxSplitPositionUnit())) { design.attr("max-split-position", asString(getMaxSplitPosition()) + getMaxSplitPositionUnit()); } diff --git a/server/src/main/java/com/vaadin/ui/AbstractTextField.java b/server/src/main/java/com/vaadin/ui/AbstractTextField.java index 5fbe60937a..0138da9c37 100644 --- a/server/src/main/java/com/vaadin/ui/AbstractTextField.java +++ b/server/src/main/java/com/vaadin/ui/AbstractTextField.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -189,7 +189,8 @@ public abstract class AbstractTextField extends AbstractField implements String newValue = (String) variables.get("text"); // server side check for max length - if (getMaxLength() != -1 && newValue.length() > getMaxLength()) { + if (getMaxLength() != -1 + && newValue.length() > getMaxLength()) { newValue = newValue.substring(0, getMaxLength()); } final String oldValue = getValue(); @@ -232,17 +233,17 @@ public abstract class AbstractTextField extends AbstractField implements /** * Gets the null-string representation. - * + * *

          * The null-valued strings are represented on the user interface by * replacing the null value with this string. If the null representation is * set null (not 'null' string), painting null value throws exception. *

          - * + * *

          * The default value is string 'null'. *

          - * + * * @return the String Textual representation for null strings. * @see TextField#isNullSettingAllowed() */ @@ -252,7 +253,7 @@ public abstract class AbstractTextField extends AbstractField implements /** * Is setting nulls with null-string representation allowed. - * + * *

          * If this property is true, writing null-representation string to text * field always sets the field value to real null. If this property is @@ -261,11 +262,11 @@ public abstract class AbstractTextField extends AbstractField implements * contents to real null, if the text field matches the null-string * representation and the current value of the field is null. *

          - * + * *

          * By default this setting is false *

          - * + * * @return boolean Should the null-string represenation be always converted * to null-values. * @see TextField#getNullRepresentation() @@ -276,17 +277,17 @@ public abstract class AbstractTextField extends AbstractField implements /** * Sets the null-string representation. - * + * *

          * The null-valued strings are represented on the user interface by * replacing the null value with this string. If the null representation is * set null (not 'null' string), painting null value throws exception. *

          - * + * *

          * The default value is string 'null' *

          - * + * * @param nullRepresentation * Textual representation for null strings. * @see TextField#setNullSettingAllowed(boolean) @@ -298,7 +299,7 @@ public abstract class AbstractTextField extends AbstractField implements /** * Sets the null conversion mode. - * + * *

          * If this property is true, writing null-representation string to text * field always sets the field value to real null. If this property is @@ -307,11 +308,11 @@ public abstract class AbstractTextField extends AbstractField implements * contents to real null, if the text field matches the null-string * representation and the current value of the field is null. *

          - * + * *

          * By default this setting is false. *

          - * + * * @param nullSettingAllowed * Should the null-string representation always be converted to * null-values. @@ -330,7 +331,7 @@ public abstract class AbstractTextField extends AbstractField implements /** * Returns the maximum number of characters in the field. Value -1 is * considered unlimited. Terminal may however have some technical limits. - * + * * @return the maxLength */ public int getMaxLength() { @@ -340,7 +341,7 @@ public abstract class AbstractTextField extends AbstractField implements /** * Sets the maximum number of characters in the field. Value -1 is * considered unlimited. Terminal may however have some technical limits. - * + * * @param maxLength * the maxLength to set */ @@ -352,7 +353,7 @@ public abstract class AbstractTextField extends AbstractField implements * Gets the number of columns in the editor. If the number of columns is set * 0, the actual number of displayed columns is determined implicitly by the * adapter. - * + * * @return the number of columns in the editor. */ public int getColumns() { @@ -363,7 +364,7 @@ public abstract class AbstractTextField extends AbstractField implements * Sets the number of columns in the editor. If the number of columns is set * 0, the actual number of displayed columns is determined implicitly by the * adapter. - * + * * @param columns * the number of columns to set. */ @@ -376,7 +377,7 @@ public abstract class AbstractTextField extends AbstractField implements /** * Gets the current input prompt. - * + * * @see #setInputPrompt(String) * @return the current input prompt, or null if not enabled */ @@ -387,7 +388,7 @@ public abstract class AbstractTextField extends AbstractField implements /** * Sets the input prompt - a textual prompt that is displayed when the field * would otherwise be empty, to prompt the user for input. - * + * * @param inputPrompt */ public void setInputPrompt(String inputPrompt) { @@ -414,11 +415,11 @@ public abstract class AbstractTextField extends AbstractField implements /* * TODO check for possible (minor?) issue (not tested) - * + * * -field with e.g. PropertyFormatter. - * + * * -TextChangeListener and it changes value. - * + * * -if formatter again changes the value, do we get an extra * simulated text change event ? */ @@ -426,7 +427,7 @@ public abstract class AbstractTextField extends AbstractField implements /* * Fire a "simulated" text change event before value change event if * change is coming from the client side. - * + * * Iff there is both value change and textChangeEvent in same * variable burst, it is a text field in non immediate mode and the * text change event "flushed" queued value change event. In this @@ -479,10 +480,10 @@ public abstract class AbstractTextField extends AbstractField implements /** * Sets the mode how the TextField triggers {@link TextChangeEvent}s. - * + * * @param inputEventMode * the new mode - * + * * @see TextChangeEventMode */ public void setTextChangeEventMode(TextChangeEventMode inputEventMode) { @@ -569,10 +570,10 @@ public abstract class AbstractTextField extends AbstractField implements * The text change timeout modifies how often text change events are * communicated to the application when {@link #getTextChangeEventMode()} is * {@link TextChangeEventMode#LAZY} or {@link TextChangeEventMode#TIMEOUT}. - * - * + * + * * @see #getTextChangeEventMode() - * + * * @param timeout * the timeout in milliseconds */ @@ -585,7 +586,7 @@ public abstract class AbstractTextField extends AbstractField implements * Gets the timeout used to fire {@link TextChangeEvent}s when the * {@link #getTextChangeEventMode()} is {@link TextChangeEventMode#LAZY} or * {@link TextChangeEventMode#TIMEOUT}. - * + * * @return the timeout value in milliseconds */ public int getTextChangeTimeout() { @@ -628,7 +629,7 @@ public abstract class AbstractTextField extends AbstractField implements * pressing enter. The value returned by this method is updated also on * {@link TextChangeEvent}s. Due to this high dependency to the terminal * implementation this method is (at least at this point) not published. - * + * * @return the text which is currently displayed in the field. */ private String getCurrentTextContent() { @@ -645,7 +646,7 @@ public abstract class AbstractTextField extends AbstractField implements /** * Selects all text in the field. - * + * * @since 6.4 */ public void selectAll() { @@ -655,11 +656,11 @@ public abstract class AbstractTextField extends AbstractField implements /** * Sets the range of text to be selected. - * + * * As a side effect the field will become focused. - * + * * @since 6.4 - * + * * @param pos * the position of the first character to be selected * @param length @@ -675,12 +676,12 @@ public abstract class AbstractTextField extends AbstractField implements /** * Sets the cursor position in the field. As a side effect the field will * become focused. - * + * * @since 6.4 - * + * * @param pos * the position for the cursor - * */ + */ public void setCursorPosition(int pos) { setSelectionRange(pos, 0); lastKnownCursorPosition = pos; @@ -688,14 +689,14 @@ public abstract class AbstractTextField extends AbstractField implements /** * Returns the last known cursor position of the field. - * + * *

          * Note that due to the client server nature or the GWT terminal, Vaadin * cannot provide the exact value of the cursor position in most situations. * The value is updated only when the client side terminal communicates to * TextField, like on {@link ValueChangeEvent}s and {@link TextChangeEvent} * s. This may change later if a deep push integration is built to Vaadin. - * + * * @return the cursor position */ public int getCursorPosition() { @@ -765,7 +766,7 @@ public abstract class AbstractTextField extends AbstractField implements /* * (non-Javadoc) - * + * * @see com.vaadin.ui.AbstractField#readDesign(org.jsoup.nodes.Element , * com.vaadin.ui.declarative.DesignContext) */ @@ -774,14 +775,14 @@ public abstract class AbstractTextField extends AbstractField implements super.readDesign(design, designContext); Attributes attr = design.attributes(); if (attr.hasKey("maxlength")) { - setMaxLength(DesignAttributeHandler.readAttribute("maxlength", - attr, Integer.class)); + setMaxLength(DesignAttributeHandler.readAttribute("maxlength", attr, + Integer.class)); } } /* * (non-Javadoc) - * + * * @see com.vaadin.ui.AbstractField#getCustomAttributes() */ @Override @@ -796,7 +797,7 @@ public abstract class AbstractTextField extends AbstractField implements /* * (non-Javadoc) - * + * * @see com.vaadin.ui.AbstractField#writeDesign(org.jsoup.nodes.Element, * com.vaadin.ui.declarative.DesignContext) */ @@ -806,8 +807,8 @@ public abstract class AbstractTextField extends AbstractField implements AbstractTextField def = (AbstractTextField) designContext .getDefaultInstance(this); Attributes attr = design.attributes(); - DesignAttributeHandler.writeAttribute("maxlength", attr, - getMaxLength(), def.getMaxLength(), Integer.class); + DesignAttributeHandler.writeAttribute("maxlength", attr, getMaxLength(), + def.getMaxLength(), Integer.class); } } diff --git a/server/src/main/java/com/vaadin/ui/Accordion.java b/server/src/main/java/com/vaadin/ui/Accordion.java index 1d53937d24..331c503d17 100644 --- a/server/src/main/java/com/vaadin/ui/Accordion.java +++ b/server/src/main/java/com/vaadin/ui/Accordion.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,12 +20,12 @@ import com.vaadin.shared.ui.accordion.AccordionState; /** * An accordion is a component similar to a {@link TabSheet}, but with a * vertical orientation and the selected component presented between tabs. - * + * * Closable tabs are not supported by the accordion. - * + * * The {@link Accordion} can be styled with the .v-accordion, .v-accordion-item, * .v-accordion-item-first and .v-accordion-item-caption styles. - * + * * @see TabSheet */ public class Accordion extends TabSheet { @@ -38,7 +38,7 @@ public class Accordion extends TabSheet { /** * Constructs a new accordion containing the given components. - * + * * @param components * The components to add to the accordion. Each component will be * added to a separate tab. @@ -50,7 +50,7 @@ public class Accordion extends TabSheet { /* * (non-Javadoc) - * + * * @see com.vaadin.ui.TabSheet#getState() */ @Override diff --git a/server/src/main/java/com/vaadin/ui/Alignment.java b/server/src/main/java/com/vaadin/ui/Alignment.java index 57131494ac..06183ec927 100644 --- a/server/src/main/java/com/vaadin/ui/Alignment.java +++ b/server/src/main/java/com/vaadin/ui/Alignment.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -26,12 +26,12 @@ import com.vaadin.shared.ui.AlignmentInfo.Bits; @SuppressWarnings("serial") public final class Alignment implements Serializable { - public static final Alignment TOP_RIGHT = new Alignment(Bits.ALIGNMENT_TOP - + Bits.ALIGNMENT_RIGHT); - public static final Alignment TOP_LEFT = new Alignment(Bits.ALIGNMENT_TOP - + Bits.ALIGNMENT_LEFT); - public static final Alignment TOP_CENTER = new Alignment(Bits.ALIGNMENT_TOP - + Bits.ALIGNMENT_HORIZONTAL_CENTER); + public static final Alignment TOP_RIGHT = new Alignment( + Bits.ALIGNMENT_TOP + Bits.ALIGNMENT_RIGHT); + public static final Alignment TOP_LEFT = new Alignment( + Bits.ALIGNMENT_TOP + Bits.ALIGNMENT_LEFT); + public static final Alignment TOP_CENTER = new Alignment( + Bits.ALIGNMENT_TOP + Bits.ALIGNMENT_HORIZONTAL_CENTER); public static final Alignment MIDDLE_RIGHT = new Alignment( Bits.ALIGNMENT_VERTICAL_CENTER + Bits.ALIGNMENT_RIGHT); public static final Alignment MIDDLE_LEFT = new Alignment( @@ -54,7 +54,7 @@ public final class Alignment implements Serializable { /** * Returns a bitmask representation of the alignment value. Used internally * by terminal. - * + * * @return the bitmask representation of the alignment value */ public int getBitMask() { @@ -63,7 +63,7 @@ public final class Alignment implements Serializable { /** * Checks if component is aligned to the top of the available space. - * + * * @return true if aligned top */ public boolean isTop() { @@ -72,7 +72,7 @@ public final class Alignment implements Serializable { /** * Checks if component is aligned to the bottom of the available space. - * + * * @return true if aligned bottom */ public boolean isBottom() { @@ -81,7 +81,7 @@ public final class Alignment implements Serializable { /** * Checks if component is aligned to the left of the available space. - * + * * @return true if aligned left */ public boolean isLeft() { @@ -90,7 +90,7 @@ public final class Alignment implements Serializable { /** * Checks if component is aligned to the right of the available space. - * + * * @return true if aligned right */ public boolean isRight() { @@ -100,26 +100,28 @@ public final class Alignment implements Serializable { /** * Checks if component is aligned middle (vertically center) of the * available space. - * + * * @return true if aligned bottom */ public boolean isMiddle() { - return (bitMask & Bits.ALIGNMENT_VERTICAL_CENTER) == Bits.ALIGNMENT_VERTICAL_CENTER; + return (bitMask + & Bits.ALIGNMENT_VERTICAL_CENTER) == Bits.ALIGNMENT_VERTICAL_CENTER; } /** * Checks if component is aligned center (horizontally) of the available * space. - * + * * @return true if aligned center */ public boolean isCenter() { - return (bitMask & Bits.ALIGNMENT_HORIZONTAL_CENTER) == Bits.ALIGNMENT_HORIZONTAL_CENTER; + return (bitMask + & Bits.ALIGNMENT_HORIZONTAL_CENTER) == Bits.ALIGNMENT_HORIZONTAL_CENTER; } /** * Returns string representation of vertical alignment. - * + * * @return vertical alignment as CSS value */ public String getVerticalAlignment() { @@ -133,7 +135,7 @@ public final class Alignment implements Serializable { /** * Returns string representation of horizontal alignment. - * + * * @return horizontal alignment as CSS value */ public String getHorizontalAlignment() { diff --git a/server/src/main/java/com/vaadin/ui/Audio.java b/server/src/main/java/com/vaadin/ui/Audio.java index 8b9fad2196..056bde4280 100644 --- a/server/src/main/java/com/vaadin/ui/Audio.java +++ b/server/src/main/java/com/vaadin/ui/Audio.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -24,19 +24,19 @@ import com.vaadin.shared.ui.audio.AudioState; * such is only supported in browsers that support HTML5 media markup. Browsers * that do not support HTML5 display the text or HTML set by calling * {@link #setAltText(String)}. - * + * * A flash-player fallback can be implemented by setting HTML content allowed ( * {@link #setHtmlContentAllowed(boolean)} and calling * {@link #setAltText(String)} with the flash player markup. An example of flash * fallback can be found at the Mozilla Developer Network. - * + * * Multiple sources can be specified. Which of the sources is used is selected - * by the browser depending on which file formats it supports. See wikipedia for a + * by the browser depending on which file formats it supports. See + * wikipedia for a * table of formats supported by different browsers. - * + * * @author Vaadin Ltd * @since 6.7.0 */ diff --git a/server/src/main/java/com/vaadin/ui/BrowserFrame.java b/server/src/main/java/com/vaadin/ui/BrowserFrame.java index 5717941ac5..cbb346db30 100644 --- a/server/src/main/java/com/vaadin/ui/BrowserFrame.java +++ b/server/src/main/java/com/vaadin/ui/BrowserFrame.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,10 +21,9 @@ import com.vaadin.shared.ui.browserframe.BrowserFrameState; /** * A component displaying an embedded web page. Implemented as a HTML * iframe element. - * + * * @author Vaadin Ltd. - * @version - * @VERSION@ + * @version @VERSION@ * @since 7.0 */ public class BrowserFrame extends AbstractEmbedded { @@ -38,7 +37,7 @@ public class BrowserFrame extends AbstractEmbedded { /** * Creates a new empty browser frame with the given caption. - * + * * @param caption * The caption for the component */ @@ -48,7 +47,7 @@ public class BrowserFrame extends AbstractEmbedded { /** * Creates a new browser frame with the given caption and content. - * + * * @param caption * The caption for the component. * @param source diff --git a/server/src/main/java/com/vaadin/ui/Button.java b/server/src/main/java/com/vaadin/ui/Button.java index 677e8cac7d..80b8bdfd32 100644 --- a/server/src/main/java/com/vaadin/ui/Button.java +++ b/server/src/main/java/com/vaadin/ui/Button.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -39,13 +39,13 @@ import com.vaadin.util.ReflectTools; /** * A generic button component. - * + * * @author Vaadin Ltd. * @since 3.0 */ @SuppressWarnings("serial") -public class Button extends AbstractFocusable implements - Action.ShortcutNotifier { +public class Button extends AbstractFocusable + implements Action.ShortcutNotifier { private ButtonServerRpc rpc = new ButtonServerRpc() { @@ -74,7 +74,7 @@ public class Button extends AbstractFocusable implements /** * Creates a new push button with the given caption. - * + * * @param caption * the Button caption. */ @@ -85,7 +85,7 @@ public class Button extends AbstractFocusable implements /** * Creates a new push button with the given icon. - * + * * @param icon * the icon */ @@ -96,7 +96,7 @@ public class Button extends AbstractFocusable implements /** * Creates a new push button with the given caption and icon. - * + * * @param caption * the caption * @param icon @@ -110,7 +110,7 @@ public class Button extends AbstractFocusable implements /** * Creates a new push button with a click listener. - * + * * @param caption * the Button caption. * @param listener @@ -123,7 +123,7 @@ public class Button extends AbstractFocusable implements /** * Click event. This event is thrown, when the button is clicked. - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -133,7 +133,7 @@ public class Button extends AbstractFocusable implements /** * New instance of text change event. - * + * * @param source * the Source of the event. */ @@ -144,7 +144,7 @@ public class Button extends AbstractFocusable implements /** * Constructor with mouse details - * + * * @param source * The source where the click took place * @param details @@ -157,7 +157,7 @@ public class Button extends AbstractFocusable implements /** * Gets the Button where the event occurred. - * + * * @return the Source of the event. */ public Button getButton() { @@ -167,7 +167,7 @@ public class Button extends AbstractFocusable implements /** * Returns the mouse position (x coordinate) when the click took place. * The position is relative to the browser client area. - * + * * @return The mouse cursor x position or -1 if unknown */ public int getClientX() { @@ -181,7 +181,7 @@ public class Button extends AbstractFocusable implements /** * Returns the mouse position (y coordinate) when the click took place. * The position is relative to the browser client area. - * + * * @return The mouse cursor y position or -1 if unknown */ public int getClientY() { @@ -195,7 +195,7 @@ public class Button extends AbstractFocusable implements /** * Returns the relative mouse position (x coordinate) when the click * took place. The position is relative to the clicked component. - * + * * @return The mouse cursor x position relative to the clicked layout * component or -1 if no x coordinate available */ @@ -210,7 +210,7 @@ public class Button extends AbstractFocusable implements /** * Returns the relative mouse position (y coordinate) when the click * took place. The position is relative to the clicked component. - * + * * @return The mouse cursor y position relative to the clicked layout * component or -1 if no y coordinate available */ @@ -224,7 +224,7 @@ public class Button extends AbstractFocusable implements /** * Checks if the Alt key was down when the mouse event took place. - * + * * @return true if Alt was down when the event occured, false otherwise * or if unknown */ @@ -238,7 +238,7 @@ public class Button extends AbstractFocusable implements /** * Checks if the Ctrl key was down when the mouse event took place. - * + * * @return true if Ctrl was pressed when the event occured, false * otherwise or if unknown */ @@ -252,7 +252,7 @@ public class Button extends AbstractFocusable implements /** * Checks if the Meta key was down when the mouse event took place. - * + * * @return true if Meta was pressed when the event occured, false * otherwise or if unknown */ @@ -266,7 +266,7 @@ public class Button extends AbstractFocusable implements /** * Checks if the Shift key was down when the mouse event took place. - * + * * @return true if Shift was pressed when the event occured, false * otherwise or if unknown */ @@ -282,7 +282,7 @@ public class Button extends AbstractFocusable implements /** * Interface for listening for a {@link ClickEvent} fired by a * {@link Component}. - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -295,7 +295,7 @@ public class Button extends AbstractFocusable implements /** * Called when a {@link Button} has been clicked. A reference to the * button is given by {@link ClickEvent#getButton()}. - * + * * @param event * An event containing information about the click. */ @@ -305,7 +305,7 @@ public class Button extends AbstractFocusable implements /** * Adds the button click listener. - * + * * @param listener * the Listener to be added. */ @@ -325,7 +325,7 @@ public class Button extends AbstractFocusable implements /** * Removes the button click listener. - * + * * @param listener * the Listener to be removed. */ @@ -345,7 +345,7 @@ public class Button extends AbstractFocusable implements /** * Simulates a button click, notifying all server-side listeners. - * + * * No action is taken is the button is disabled. */ public void click() { @@ -356,7 +356,7 @@ public class Button extends AbstractFocusable implements /** * Fires a click event to all listeners without any event details. - * + * * In subclasses, override {@link #fireClick(MouseEventDetails)} instead of * this method. */ @@ -366,7 +366,7 @@ public class Button extends AbstractFocusable implements /** * Fires a click event to all listeners. - * + * * @param details * MouseEventDetails from which keyboard modifiers and other * information about the mouse click can be obtained. If the @@ -387,7 +387,7 @@ public class Button extends AbstractFocusable implements * Makes it possible to invoke a click on this button by pressing the given * {@link KeyCode} and (optional) {@link ModifierKey}s.
          * The shortcut is global (bound to the containing Window). - * + * * @param keyCode * the keycode for invoking the shortcut * @param modifiers @@ -418,7 +418,7 @@ public class Button extends AbstractFocusable implements /** * A {@link ShortcutListener} specifically made to define a keyboard * shortcut that invokes a click on the given button. - * + * */ public static class ClickShortcut extends ShortcutListener { protected Button button; @@ -426,7 +426,7 @@ public class Button extends AbstractFocusable implements /** * Creates a keyboard shortcut for clicking the given button using the * shorthand notation defined in {@link ShortcutAction}. - * + * * @param button * to be clicked when the shortcut is invoked * @param shorthandCaption @@ -440,7 +440,7 @@ public class Button extends AbstractFocusable implements /** * Creates a keyboard shortcut for clicking the given button using the * given {@link KeyCode} and {@link ModifierKey}s. - * + * * @param button * to be clicked when the shortcut is invoked * @param keyCode @@ -456,7 +456,7 @@ public class Button extends AbstractFocusable implements /** * Creates a keyboard shortcut for clicking the given button using the * given {@link KeyCode}. - * + * * @param button * to be clicked when the shortcut is invoked * @param keyCode @@ -475,7 +475,7 @@ public class Button extends AbstractFocusable implements /** * Determines if a button is automatically disabled when clicked. See * {@link #setDisableOnClick(boolean)} for details. - * + * * @return true if the button is disabled when clicked, false otherwise */ public boolean isDisableOnClick() { @@ -491,7 +491,7 @@ public class Button extends AbstractFocusable implements * calling {@link #click()} method programmatically. Also, if developer * wants to re-enable the button, it needs to be done programmatically. *

          - * + * * @param disableOnClick * true to disable button when it is clicked, false otherwise */ @@ -511,10 +511,10 @@ public class Button extends AbstractFocusable implements /** * Sets the component's icon and alt text. - * + * * An alt text is shown when an image could not be loaded, and read by * assisitve devices. - * + * * @param icon * the icon to be shown with the component's caption. * @param iconAltText @@ -527,7 +527,7 @@ public class Button extends AbstractFocusable implements /** * Returns the icon's alt text. - * + * * @return String with the alt text */ public String getIconAlternateText() { @@ -541,11 +541,11 @@ public class Button extends AbstractFocusable implements /** * Set whether the caption text is rendered as HTML or not. You might need * to re-theme button to allow higher content than the original text style. - * + * * If set to true, the captions are passed to the browser as html and the * developer is responsible for ensuring no harmful html is used. If set to * false, the content is passed to the browser as plain text. - * + * * @param htmlContentAllowed * true if caption is rendered as HTML, * false otherwise @@ -556,7 +556,7 @@ public class Button extends AbstractFocusable implements /** * Return HTML rendering setting - * + * * @return true if the caption text is to be rendered as HTML, * false otherwise */ @@ -566,7 +566,7 @@ public class Button extends AbstractFocusable implements /* * (non-Javadoc) - * + * * @see com.vaadin.ui.AbstractComponent#readDesign(org.jsoup.nodes .Element, * com.vaadin.ui.declarative.DesignContext) */ @@ -576,8 +576,8 @@ public class Button extends AbstractFocusable implements Attributes attr = design.attributes(); String content; // plain-text (default is html) - Boolean plain = DesignAttributeHandler.readAttribute( - DESIGN_ATTR_PLAIN_TEXT, attr, Boolean.class); + Boolean plain = DesignAttributeHandler + .readAttribute(DESIGN_ATTR_PLAIN_TEXT, attr, Boolean.class); if (plain == null || !plain) { setHtmlContentAllowed(true); content = design.html(); @@ -588,13 +588,13 @@ public class Button extends AbstractFocusable implements } setCaption(content); if (attr.hasKey("icon-alt")) { - setIconAlternateText(DesignAttributeHandler.readAttribute( - "icon-alt", attr, String.class)); + setIconAlternateText(DesignAttributeHandler + .readAttribute("icon-alt", attr, String.class)); } // click-shortcut removeClickShortcut(); - ShortcutAction action = DesignAttributeHandler.readAttribute( - "click-shortcut", attr, ShortcutAction.class); + ShortcutAction action = DesignAttributeHandler + .readAttribute("click-shortcut", attr, ShortcutAction.class); if (action != null) { setClickShortcut(action.getKeyCode(), action.getModifiers()); } @@ -602,7 +602,7 @@ public class Button extends AbstractFocusable implements /* * (non-Javadoc) - * + * * @see com.vaadin.ui.AbstractComponent#getCustomAttributes() */ @Override @@ -620,7 +620,7 @@ public class Button extends AbstractFocusable implements /* * (non-Javadoc) - * + * * @see com.vaadin.ui.AbstractComponent#writeDesign(org.jsoup.nodes.Element * , com.vaadin.ui.declarative.DesignContext) */ diff --git a/server/src/main/java/com/vaadin/ui/Calendar.java b/server/src/main/java/com/vaadin/ui/Calendar.java index 028a094cb5..741e2bb45a 100644 --- a/server/src/main/java/com/vaadin/ui/Calendar.java +++ b/server/src/main/java/com/vaadin/ui/Calendar.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -97,27 +97,27 @@ import com.vaadin.ui.declarative.DesignContext; * be visualized in the variable length view depending on the start and end * dates. *

          - * + * *
        • You can set the viewable date range with the {@link #setStartDate(Date)} * and {@link #setEndDate(Date)} methods. Calendar has a default date range of * one week
        • - * + * *
        • Calendar has two kind of views: monthly and weekly view
        • - * + * *
        • If date range is seven days or shorter, the weekly view is used.
        • - * + * *
        • Calendar queries its events by using a * {@link com.vaadin.addon.calendar.event.CalendarEventProvider * CalendarEventProvider}. By default, a * {@link com.vaadin.addon.calendar.event.BasicEventProvider BasicEventProvider} * is used.
        • - * + * * @since 7.1 * @author Vaadin Ltd. */ @SuppressWarnings("serial") -public class Calendar extends AbstractComponent implements - CalendarComponentEvents.NavigationNotifier, +public class Calendar extends AbstractComponent + implements CalendarComponentEvents.NavigationNotifier, CalendarComponentEvents.EventMoveNotifier, CalendarComponentEvents.RangeSelectNotifier, CalendarComponentEvents.EventResizeNotifier, @@ -216,7 +216,7 @@ public class Calendar extends AbstractComponent implements private KeyMapper actionMapper = null; /** - * + * */ private CalendarServerRpcImpl rpc = new CalendarServerRpcImpl(); @@ -240,7 +240,7 @@ public class Calendar extends AbstractComponent implements /** * Construct a Vaadin Calendar with a BasicEventProvider and the provided * caption. Default date range is one week. - * + * * @param caption */ public Calendar(String caption) { @@ -253,13 +253,13 @@ public class Calendar extends AbstractComponent implements * obligatory, because calendar component will query active events through * it. *

          - * + * *

          * By default, Vaadin Calendar will show dates from the start of the current * week to the end of the current week. Use {@link #setStartDate(Date)} and * {@link #setEndDate(Date)} to change this. *

          - * + * * @param eventProvider * Event provider, cannot be null. */ @@ -273,13 +273,13 @@ public class Calendar extends AbstractComponent implements * provider is obligatory, because calendar component will query active * events through it. *

          - * + * *

          * By default, Vaadin Calendar will show dates from the start of the current * week to the end of the current week. Use {@link #setStartDate(Date)} and * {@link #setEndDate(Date)} to change this. *

          - * + * * @param eventProvider * Event provider, cannot be null. */ @@ -337,7 +337,7 @@ public class Calendar extends AbstractComponent implements /** * Gets the calendar's start date. - * + * * @return First visible date. */ public Date getStartDate() { @@ -357,7 +357,7 @@ public class Calendar extends AbstractComponent implements * Sets start date for the calendar. This and {@link #setEndDate(Date)} * control the range of dates visible on the component. The default range is * one week. - * + * * @param date * First visible date to show. */ @@ -370,7 +370,7 @@ public class Calendar extends AbstractComponent implements /** * Gets the calendar's end date. - * + * * @return Last visible date. */ public Date getEndDate() { @@ -389,10 +389,10 @@ public class Calendar extends AbstractComponent implements /** * Sets end date for the calendar. Starting from startDate, only six weeks * will be shown if duration to endDate is longer than six weeks. - * + * * This and {@link #setStartDate(Date)} control the range of dates visible * on the component. The default range is one week. - * + * * @param date * Last visible date to show. */ @@ -408,7 +408,7 @@ public class Calendar extends AbstractComponent implements /** * Sets the locale to be used in the Calendar component. - * + * * @see com.vaadin.ui.AbstractComponent#setLocale(java.util.Locale) */ @Override @@ -436,11 +436,12 @@ public class Calendar extends AbstractComponent implements } private void setupCalendarEvents() { - int durationInDays = (int) (((endDate.getTime()) - startDate.getTime()) / DateConstants.DAYINMILLIS); + int durationInDays = (int) (((endDate.getTime()) - startDate.getTime()) + / DateConstants.DAYINMILLIS); durationInDays++; if (durationInDays > 60) { - throw new RuntimeException("Daterange is too big (max 60) = " - + durationInDays); + throw new RuntimeException( + "Daterange is too big (max 60) = " + durationInDays); } Date firstDateToShow = expandStartDate(startDate, durationInDays > 7); @@ -460,10 +461,10 @@ public class Calendar extends AbstractComponent implements event.dateTo = df_date.format(e.getEnd()); event.timeFrom = df_time.format(e.getStart()); event.timeTo = df_time.format(e.getEnd()); - event.description = e.getDescription() == null ? "" : e - .getDescription(); - event.styleName = e.getStyleName() == null ? "" : e - .getStyleName(); + event.description = e.getDescription() == null ? "" + : e.getDescription(); + event.styleName = e.getStyleName() == null ? "" + : e.getStyleName(); event.allDay = e.isAllDay(); calendarStateEvents.add(event); } @@ -498,11 +499,12 @@ public class Calendar extends AbstractComponent implements endDate = getEndDate(); } - int durationInDays = (int) (((endDate.getTime()) - startDate.getTime()) / DateConstants.DAYINMILLIS); + int durationInDays = (int) (((endDate.getTime()) - startDate.getTime()) + / DateConstants.DAYINMILLIS); durationInDays++; if (durationInDays > 60) { - throw new RuntimeException("Daterange is too big (max 60) = " - + durationInDays); + throw new RuntimeException( + "Daterange is too big (max 60) = " + durationInDays); } state.dayNames = getDayNamesShort(); @@ -551,8 +553,8 @@ public class Calendar extends AbstractComponent implements for (Action.Handler actionHandler : actionHandlers) { // Create calendar which omits time - GregorianCalendar cal = new GregorianCalendar( - getTimeZone(), getLocale()); + GregorianCalendar cal = new GregorianCalendar(getTimeZone(), + getLocale()); cal.clear(); cal.set(currentCalendar.get(java.util.Calendar.YEAR), currentCalendar.get(java.util.Calendar.MONTH), @@ -604,8 +606,8 @@ public class Calendar extends AbstractComponent implements } private void setActionsForEachHalfHour( - Map> actionMap, Date start, - Date end, Action.Handler actionHandler) { + Map> actionMap, Date start, Date end, + Action.Handler actionHandler) { GregorianCalendar cal = new GregorianCalendar(getTimeZone(), getLocale()); cal.setTime(start); @@ -613,7 +615,8 @@ public class Calendar extends AbstractComponent implements Date s = cal.getTime(); cal.add(java.util.Calendar.MINUTE, 30); Date e = cal.getTime(); - CalendarDateRange range = new CalendarDateRange(s, e, getTimeZone()); + CalendarDateRange range = new CalendarDateRange(s, e, + getTimeZone()); Action[] actions = actionHandler.getActions(range, this); if (actions != null) { Set actionSet = new LinkedHashSet( @@ -623,9 +626,8 @@ public class Calendar extends AbstractComponent implements } } - private void setActionsForDay( - Map> actionMap, Date start, - Date end, Action.Handler actionHandler) { + private void setActionsForDay(Map> actionMap, + Date start, Date end, Action.Handler actionHandler) { CalendarDateRange range = new CalendarDateRange(start, end, getTimeZone()); Action[] actions = actionHandler.getActions(range, this); @@ -648,7 +650,8 @@ public class Calendar extends AbstractComponent implements DateConstants.ACTION_DATE_FORMAT_PATTERN); formatter.setTimeZone(getTimeZone()); - for (Entry> entry : actionMap.entrySet()) { + for (Entry> entry : actionMap + .entrySet()) { CalendarDateRange range = entry.getKey(); Set actions = entry.getValue(); for (Action action : actions) { @@ -670,7 +673,7 @@ public class Calendar extends AbstractComponent implements /** * Gets currently active time format. Value is either TimeFormat.Format12H * or TimeFormat.Format24H. - * + * * @return TimeFormat Format for the time. */ public TimeFormat getTimeFormat() { @@ -680,8 +683,8 @@ public class Calendar extends AbstractComponent implements f = (SimpleDateFormat) SimpleDateFormat .getTimeInstance(SimpleDateFormat.SHORT); } else { - f = (SimpleDateFormat) SimpleDateFormat.getTimeInstance( - SimpleDateFormat.SHORT, getLocale()); + f = (SimpleDateFormat) SimpleDateFormat + .getTimeInstance(SimpleDateFormat.SHORT, getLocale()); } String p = f.toPattern(); if (p.indexOf("HH") != -1 || p.indexOf("H") != -1) { @@ -693,9 +696,9 @@ public class Calendar extends AbstractComponent implements } /** - * Example: setTimeFormat(TimeFormat.Format12H);
          Set to - * null, if you want the format being defined by the locale. - * + * Example: setTimeFormat(TimeFormat.Format12H);
          + * Set to null, if you want the format being defined by the locale. + * * @param format * Set 12h or 24h format. Default is defined by the locale. */ @@ -706,7 +709,7 @@ public class Calendar extends AbstractComponent implements /** * Returns a time zone that is currently used by this component. - * + * * @return Component's Time zone */ public TimeZone getTimeZone() { @@ -719,7 +722,7 @@ public class Calendar extends AbstractComponent implements /** * Set time zone that this component will use. Null value sets the default * time zone. - * + * * @param zone * Time zone to use */ @@ -739,7 +742,7 @@ public class Calendar extends AbstractComponent implements * Get the internally used Calendar instance. This is the currently used * instance of {@link java.util.Calendar} but is bound to change during the * lifetime of the component. - * + * * @return the currently used java calendar */ public java.util.Calendar getInternalCalendar() { @@ -752,13 +755,13 @@ public class Calendar extends AbstractComponent implements * monthly and the weekly view. The general contract is that firstDay < * lastDay. *

          - * + * *

          * Note that this only affects the rendering process. Events are still * requested by the dates set by {@link #setStartDate(Date)} and * {@link #setEndDate(Date)}. *

          - * + * * @param firstDay * the first day of the week to show, between 1 and 7 */ @@ -773,7 +776,7 @@ public class Calendar extends AbstractComponent implements /** * Get the first visible day of the week. Returns the weekdays as integers * represented by {@link java.util.Calendar#DAY_OF_WEEK} - * + * * @return An integer representing the week day according to * {@link java.util.Calendar#DAY_OF_WEEK} */ @@ -787,13 +790,13 @@ public class Calendar extends AbstractComponent implements * monthly and the weekly view. The general contract is that firstDay < * lastDay. *

          - * + * *

          * Note that this only affects the rendering process. Events are still * requested by the dates set by {@link #setStartDate(Date)} and * {@link #setEndDate(Date)}. *

          - * + * * @param lastDay * the first day of the week to show, between 1 and 7 */ @@ -808,7 +811,7 @@ public class Calendar extends AbstractComponent implements /** * Get the last visible day of the week. Returns the weekdays as integers * represented by {@link java.util.Calendar#DAY_OF_WEEK} - * + * * @return An integer representing the week day according to * {@link java.util.Calendar#DAY_OF_WEEK} */ @@ -821,13 +824,13 @@ public class Calendar extends AbstractComponent implements * This method restricts the hours that are shown per day. This affects the * weekly view. The general contract is that firstHour < lastHour. *

          - * + * *

          * Note that this only affects the rendering process. Events are still * requested by the dates set by {@link #setStartDate(Date)} and * {@link #setEndDate(Date)}. *

          - * + * * @param firstHour * the first hour of the day to show, between 0 and 23 */ @@ -842,7 +845,7 @@ public class Calendar extends AbstractComponent implements /** * Returns the first visible hour in the week view. Returns the hour using a * 24h time format - * + * */ public int getFirstVisibleHourOfDay() { return firstHour; @@ -853,13 +856,13 @@ public class Calendar extends AbstractComponent implements * This method restricts the hours that are shown per day. This affects the * weekly view. The general contract is that firstHour < lastHour. *

          - * + * *

          * Note that this only affects the rendering process. Events are still * requested by the dates set by {@link #setStartDate(Date)} and * {@link #setEndDate(Date)}. *

          - * + * * @param lastHour * the first hour of the day to show, between 0 and 23 */ @@ -874,7 +877,7 @@ public class Calendar extends AbstractComponent implements /** * Returns the last visible hour in the week view. Returns the hour using a * 24h time format - * + * */ public int getLastVisibleHourOfDay() { return lastHour; @@ -882,7 +885,7 @@ public class Calendar extends AbstractComponent implements /** * Gets the date caption format for the weekly view. - * + * * @return The pattern used in caption of dates in weekly view. */ public String getWeeklyCaptionFormat() { @@ -892,14 +895,14 @@ public class Calendar extends AbstractComponent implements /** * Sets custom date format for the weekly view. This is the caption of the * date. Format could be like "mmm MM/dd". - * + * * @param dateFormatPattern * The date caption pattern. */ public void setWeeklyCaptionFormat(String dateFormatPattern) { if ((weeklyCaptionFormat == null && dateFormatPattern != null) - || (weeklyCaptionFormat != null && !weeklyCaptionFormat - .equals(dateFormatPattern))) { + || (weeklyCaptionFormat != null + && !weeklyCaptionFormat.equals(dateFormatPattern))) { weeklyCaptionFormat = dateFormatPattern; markAsDirty(); } @@ -916,7 +919,7 @@ public class Calendar extends AbstractComponent implements /** * Get the day of week by the given calendar and its locale - * + * * @param calendar * The calendar to use * @return @@ -934,7 +937,7 @@ public class Calendar extends AbstractComponent implements /** * Is the user allowed to trigger events which alters the events - * + * * @return true if the client is allowed to send changes to server * @see #isEventClickAllowed() */ @@ -946,7 +949,7 @@ public class Calendar extends AbstractComponent implements * Is the user allowed to trigger click events. Returns {@code true} by * default. Subclass can override this method to disallow firing event * clicks got from the client side. - * + * * @return true if the client is allowed to click events * @see #isClientChangeAllowed() * @deprecated As of 7.4, override {@link #fireEventClick(Integer)} instead. @@ -959,7 +962,7 @@ public class Calendar extends AbstractComponent implements /** * Fires an event when the user selecing moving forward/backward in the * calendar. - * + * * @param forward * True if the calendar moved forward else backward is assumed. */ @@ -973,7 +976,7 @@ public class Calendar extends AbstractComponent implements /** * Fires an event move event to all server side move listerners - * + * * @param index * The index of the event in the events list * @param newFromDatetime @@ -995,7 +998,7 @@ public class Calendar extends AbstractComponent implements /** * Fires event when a week was clicked in the calendar. - * + * * @param week * The week that was clicked * @param year @@ -1008,7 +1011,7 @@ public class Calendar extends AbstractComponent implements /** * Fires event when a date was clicked in the calendar. Uses an existing * event from the event cache. - * + * * @param index * The index of the event in the event cache. */ @@ -1019,7 +1022,7 @@ public class Calendar extends AbstractComponent implements /** * Fires event when a date was clicked in the calendar. Creates a new event * for the date and passes it to the listener. - * + * * @param date * The date and time that was clicked */ @@ -1031,7 +1034,7 @@ public class Calendar extends AbstractComponent implements * Fires an event range selected event. The event is fired when a user * highlights an area in the calendar. The highlighted areas start and end * dates are returned as arguments. - * + * * @param from * The start date and time of the highlighted area * @param to @@ -1048,7 +1051,7 @@ public class Calendar extends AbstractComponent implements * event in the calendar causing the time range of the event to increase or * decrease. The new start and end times are returned as arguments to this * method. - * + * * @param index * The index of the event in the event cache * @param startTime @@ -1073,7 +1076,7 @@ public class Calendar extends AbstractComponent implements /** * Localized display names for week days starting from sunday. Returned * array's length is always 7. - * + * * @return Array of localized weekday names. */ protected String[] getDayNamesShort() { @@ -1084,7 +1087,7 @@ public class Calendar extends AbstractComponent implements /** * Localized display names for months starting from January. Returned * array's length is always 12. - * + * * @return Array of localized month names. */ protected String[] getMonthNamesShort() { @@ -1095,7 +1098,7 @@ public class Calendar extends AbstractComponent implements /** * Gets a date that is first day in the week that target given date belongs * to. - * + * * @param date * Target date * @return Date that is first date in same week that given date is. @@ -1113,7 +1116,7 @@ public class Calendar extends AbstractComponent implements /** * Gets a date that is last day in the week that target given date belongs * to. - * + * * @param date * Target date * @return Date that is last date in same week that given date is. @@ -1134,7 +1137,7 @@ public class Calendar extends AbstractComponent implements /** * Calculates the end time of the day using the given calendar and date - * + * * @param date * @param calendar * the calendar instance to be used in the calculation. The given @@ -1162,7 +1165,7 @@ public class Calendar extends AbstractComponent implements /** * Calculates the end time of the day using the given calendar and date - * + * * @param date * @param calendar * the calendar instance to be used in the calculation. The given @@ -1186,7 +1189,7 @@ public class Calendar extends AbstractComponent implements /** * Finds the first day of the week and returns a day representing the start * of that day - * + * * @param start * The actual date * @param expandToFullWeek @@ -1217,7 +1220,7 @@ public class Calendar extends AbstractComponent implements /** * Finds the last day of the week and returns a day representing the end of * that day - * + * * @param end * The actual date * @param expandToFullWeek @@ -1251,7 +1254,7 @@ public class Calendar extends AbstractComponent implements * is used to query for events to show, and must be non-null. By default a * {@link com.vaadin.addon.calendar.event.BasicEventProvider * BasicEventProvider} is used. - * + * * @param calendarEventProvider * the calendarEventProvider to set. Cannot be null. */ @@ -1286,7 +1289,7 @@ public class Calendar extends AbstractComponent implements /* * (non-Javadoc) - * + * * @see com.vaadin.addon.calendar.ui.CalendarEvents.EventChangeListener# * eventChange (com.vaadin.addon.calendar.ui.CalendarEvents.EventChange) */ @@ -1302,7 +1305,7 @@ public class Calendar extends AbstractComponent implements * Set the handler for the given type information. Mirrors * {@link #addListener(String, Class, Object, Method) addListener} from * AbstractComponent - * + * * @param eventId * A unique id for the event. Usually one of * {@link CalendarEventId} @@ -1329,7 +1332,7 @@ public class Calendar extends AbstractComponent implements /* * (non-Javadoc) - * + * * @see * com.vaadin.addon.calendar.ui.CalendarComponentEvents.NavigationNotifier * #addListener @@ -1343,7 +1346,7 @@ public class Calendar extends AbstractComponent implements /* * (non-Javadoc) - * + * * @see * com.vaadin.addon.calendar.ui.CalendarComponentEvents.NavigationNotifier * #addListener @@ -1357,7 +1360,7 @@ public class Calendar extends AbstractComponent implements /* * (non-Javadoc) - * + * * @see * com.vaadin.addon.calendar.ui.CalendarComponentEvents.NavigationNotifier * #addListener @@ -1371,7 +1374,7 @@ public class Calendar extends AbstractComponent implements /* * (non-Javadoc) - * + * * @see * com.vaadin.addon.calendar.ui.CalendarComponentEvents.NavigationNotifier * #addListener @@ -1385,7 +1388,7 @@ public class Calendar extends AbstractComponent implements /* * (non-Javadoc) - * + * * @see * com.vaadin.addon.calendar.ui.CalendarComponentEvents.NavigationNotifier * #addListener @@ -1399,7 +1402,7 @@ public class Calendar extends AbstractComponent implements /* * (non-Javadoc) - * + * * @see * com.vaadin.addon.calendar.ui.CalendarComponentEvents.EventResizeNotifier * #addListener @@ -1414,7 +1417,7 @@ public class Calendar extends AbstractComponent implements /* * (non-Javadoc) - * + * * @see * com.vaadin.addon.calendar.ui.CalendarComponentEvents.RangeSelectNotifier * #addListener @@ -1430,7 +1433,7 @@ public class Calendar extends AbstractComponent implements /* * (non-Javadoc) - * + * * @see * com.vaadin.addon.calendar.ui.CalendarComponentEvents.EventMoveNotifier * #addListener @@ -1444,7 +1447,7 @@ public class Calendar extends AbstractComponent implements /* * (non-Javadoc) - * + * * @see com.vaadin.addon.calendar.ui.CalendarComponentEvents. * CalendarEventNotifier #getHandler(java.lang.String) */ @@ -1464,7 +1467,7 @@ public class Calendar extends AbstractComponent implements /** * Set the drop handler for the calendar See {@link DropHandler} for * implementation details. - * + * * @param dropHandler * The drop handler to set */ @@ -1474,7 +1477,7 @@ public class Calendar extends AbstractComponent implements /* * (non-Javadoc) - * + * * @see * com.vaadin.event.dd.DropTarget#translateDropTargetDetails(java.util.Map) */ @@ -1514,26 +1517,28 @@ public class Calendar extends AbstractComponent implements * Sets a container as a data source for the events in the calendar. * Equivalent for doing * Calendar.setEventProvider(new ContainerEventProvider(container)) - * + * * Use this method if you are adding a container which uses the default * property ids like {@link BeanItemContainer} for instance. If you are * using custom properties instead use * {@link Calendar#setContainerDataSource(com.vaadin.data.Container.Indexed, Object, Object, Object, Object, Object)} - * + * * Please note that the container must be sorted by date! - * + * * @param container * The container to use as a datasource */ public void setContainerDataSource(Container.Indexed container) { ContainerEventProvider provider = new ContainerEventProvider(container); - provider.addEventSetChangeListener(new CalendarEventProvider.EventSetChangeListener() { - @Override - public void eventSetChange(EventSetChangeEvent changeEvent) { - // Repaint if events change - markAsDirty(); - } - }); + provider.addEventSetChangeListener( + new CalendarEventProvider.EventSetChangeListener() { + @Override + public void eventSetChange( + EventSetChangeEvent changeEvent) { + // Repaint if events change + markAsDirty(); + } + }); provider.addEventChangeListener(new EventChangeListener() { @Override public void eventChange(EventChangeEvent changeEvent) { @@ -1548,9 +1553,9 @@ public class Calendar extends AbstractComponent implements * Sets a container as a data source for the events in the calendar. * Equivalent for doing * Calendar.setEventProvider(new ContainerEventProvider(container)) - * + * * Please note that the container must be sorted by date! - * + * * @param container * The container to use as a data source * @param captionProperty @@ -1577,13 +1582,15 @@ public class Calendar extends AbstractComponent implements provider.setStartDateProperty(startDateProperty); provider.setEndDateProperty(endDateProperty); provider.setStyleNameProperty(styleNameProperty); - provider.addEventSetChangeListener(new CalendarEventProvider.EventSetChangeListener() { - @Override - public void eventSetChange(EventSetChangeEvent changeEvent) { - // Repaint if events change - markAsDirty(); - } - }); + provider.addEventSetChangeListener( + new CalendarEventProvider.EventSetChangeListener() { + @Override + public void eventSetChange( + EventSetChangeEvent changeEvent) { + // Repaint if events change + markAsDirty(); + } + }); provider.addEventChangeListener(new EventChangeListener() { @Override public void eventChange(EventChangeEvent changeEvent) { @@ -1596,7 +1603,7 @@ public class Calendar extends AbstractComponent implements /* * (non-Javadoc) - * + * * @see * com.vaadin.addon.calendar.event.CalendarEventProvider#getEvents(java. * util.Date, java.util.Date) @@ -1608,7 +1615,7 @@ public class Calendar extends AbstractComponent implements /* * (non-Javadoc) - * + * * @see * com.vaadin.addon.calendar.event.CalendarEditableEventProvider#addEvent * (com.vaadin.addon.calendar.event.CalendarEvent) @@ -1627,7 +1634,7 @@ public class Calendar extends AbstractComponent implements /* * (non-Javadoc) - * + * * @see * com.vaadin.addon.calendar.event.CalendarEditableEventProvider#removeEvent * (com.vaadin.addon.calendar.event.CalendarEvent) @@ -1647,7 +1654,7 @@ public class Calendar extends AbstractComponent implements /** * Adds an action handler to the calender that handles event produced by the * context menu. - * + * *

          * The {@link Handler#getActions(Object, Object)} parameters depend on what * view the Calendar is in: @@ -1664,7 +1671,7 @@ public class Calendar extends AbstractComponent implements * The Dates passed into the {@link CalendarDateRange} are in the same * timezone as the calendar is. *

          - * + * *

          * The {@link Handler#handleAction(Action, Object, Object)} parameters * depend on what the context menu is called upon: @@ -1692,7 +1699,7 @@ public class Calendar extends AbstractComponent implements /** * Is the calendar in a mode where all days of the month is shown - * + * * @return Returns true if calendar is in monthly mode and false if it is in * weekly mode */ @@ -1708,7 +1715,7 @@ public class Calendar extends AbstractComponent implements /* * (non-Javadoc) - * + * * @see * com.vaadin.event.Action.Container#removeActionHandler(com.vaadin.event * .Action.Handler) @@ -1895,7 +1902,7 @@ public class Calendar extends AbstractComponent implements /* * (non-Javadoc) - * + * * @see com.vaadin.server.VariableOwner#changeVariables(java.lang.Object, * java.util.Map) */ @@ -1909,7 +1916,7 @@ public class Calendar extends AbstractComponent implements /* * (non-Javadoc) - * + * * @see * com.vaadin.ui.LegacyComponent#paintContent(com.vaadin.server.PaintTarget) */ @@ -1928,7 +1935,7 @@ public class Calendar extends AbstractComponent implements * false, the caption is rendered in the browser as plain text. *

          * The default is false, i.e. to render that caption as plain text. - * + * * @param captionAsHtml * true if the captions are rendered as HTML, false if rendered * as plain text @@ -1941,7 +1948,7 @@ public class Calendar extends AbstractComponent implements * Checks whether event captions are rendered as HTML *

          * The default is false, i.e. to render that caption as plain text. - * + * * @return true if the captions are rendered as HTML, false if rendered as * plain text */ @@ -1955,8 +1962,8 @@ public class Calendar extends AbstractComponent implements Attributes attr = design.attributes(); if (design.hasAttr("time-format")) { - setTimeFormat(TimeFormat.valueOf("Format" - + design.attr("time-format").toUpperCase())); + setTimeFormat(TimeFormat.valueOf( + "Format" + design.attr("time-format").toUpperCase())); } if (design.hasAttr("start-date")) { @@ -1975,7 +1982,8 @@ public class Calendar extends AbstractComponent implements if (currentTimeFormat != null) { design.attr("time-format", - (currentTimeFormat == TimeFormat.Format12H ? "12h" : "24h")); + (currentTimeFormat == TimeFormat.Format12H ? "12h" + : "24h")); } if (startDate != null) { design.attr("start-date", df_date.format(getStartDate())); @@ -2000,7 +2008,7 @@ public class Calendar extends AbstractComponent implements /** * Allow setting first day of week independent of Locale. Set to null if you * want first day of week being defined by the locale - * + * * @since 7.6 * @param dayOfWeek * any of java.util.Calendar.SUNDAY..java.util.Calendar.SATURDAY @@ -2009,12 +2017,11 @@ public class Calendar extends AbstractComponent implements public void setFirstDayOfWeek(Integer dayOfWeek) { int minimalSupported = java.util.Calendar.SUNDAY; int maximalSupported = java.util.Calendar.SATURDAY; - if (dayOfWeek != null - && (dayOfWeek < minimalSupported || dayOfWeek > maximalSupported)) { - throw new IllegalArgumentException( - String.format( - "Day of week must be between %s and %s. Actually received: %s", - minimalSupported, maximalSupported, dayOfWeek)); + if (dayOfWeek != null && (dayOfWeek < minimalSupported + || dayOfWeek > maximalSupported)) { + throw new IllegalArgumentException(String.format( + "Day of week must be between %s and %s. Actually received: %s", + minimalSupported, maximalSupported, dayOfWeek)); } customFirstDayOfWeek = dayOfWeek; markAsDirty(); diff --git a/server/src/main/java/com/vaadin/ui/CheckBox.java b/server/src/main/java/com/vaadin/ui/CheckBox.java index 8b31edcbb4..f7c518a499 100644 --- a/server/src/main/java/com/vaadin/ui/CheckBox.java +++ b/server/src/main/java/com/vaadin/ui/CheckBox.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -49,7 +49,7 @@ public class CheckBox extends AbstractField { * to make sure the cached state is updated to match the client. If * we do not do this, a reverting setValue() call in a listener will * not cause the new state to be sent to the client. - * + * * See #11028, #10030. */ getUI().getConnectorTracker().getDiffState(CheckBox.this) @@ -66,7 +66,8 @@ public class CheckBox extends AbstractField { } }; - FocusAndBlurServerRpcImpl focusBlurRpc = new FocusAndBlurServerRpcImpl(this) { + FocusAndBlurServerRpcImpl focusBlurRpc = new FocusAndBlurServerRpcImpl( + this) { @Override protected void fireEvent(Event event) { CheckBox.this.fireEvent(event); @@ -84,7 +85,7 @@ public class CheckBox extends AbstractField { /** * Creates a new checkbox with a set caption. - * + * * @param caption * the Checkbox caption. */ @@ -95,7 +96,7 @@ public class CheckBox extends AbstractField { /** * Creates a new checkbox with a caption and a set initial state. - * + * * @param caption * the caption of the checkbox * @param initialState @@ -108,7 +109,7 @@ public class CheckBox extends AbstractField { /** * Creates a new checkbox that is connected to a boolean property. - * + * * @param state * the Initial state of the switch-button. * @param dataSource @@ -132,7 +133,7 @@ public class CheckBox extends AbstractField { * Overridden to keep the shared state in sync with the AbstractField * internal value. Should be removed once AbstractField is refactored to use * shared state. - * + * * See tickets #10921 and #11064. */ @Override @@ -199,9 +200,9 @@ public class CheckBox extends AbstractField { /** * Get the boolean value of the button state. - * + * * @return True iff the button is pressed down or checked. - * + * * @deprecated As of 7.0, use {@link #getValue()} instead and, if needed, * handle null values. */ @@ -213,7 +214,7 @@ public class CheckBox extends AbstractField { /* * (non-Javadoc) - * + * * @see com.vaadin.ui.AbstractField#readDesign(org.jsoup.nodes.Element, * com.vaadin.ui.declarative.DesignContext) */ @@ -221,15 +222,14 @@ public class CheckBox extends AbstractField { public void readDesign(Element design, DesignContext designContext) { super.readDesign(design, designContext); if (design.hasAttr("checked")) { - this.setValue( - DesignAttributeHandler.readAttribute("checked", - design.attributes(), Boolean.class), false, true); + this.setValue(DesignAttributeHandler.readAttribute("checked", + design.attributes(), Boolean.class), false, true); } } /* * (non-Javadoc) - * + * * @see com.vaadin.ui.AbstractField#getCustomAttributes() */ @Override @@ -241,7 +241,7 @@ public class CheckBox extends AbstractField { /* * (non-Javadoc) - * + * * @see com.vaadin.ui.AbstractField#writeDesign(org.jsoup.nodes.Element, * com.vaadin.ui.declarative.DesignContext) */ diff --git a/server/src/main/java/com/vaadin/ui/ColorPicker.java b/server/src/main/java/com/vaadin/ui/ColorPicker.java index 9e46c4e718..5f21aa0360 100644 --- a/server/src/main/java/com/vaadin/ui/ColorPicker.java +++ b/server/src/main/java/com/vaadin/ui/ColorPicker.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,11 +20,11 @@ import com.vaadin.shared.ui.colorpicker.Color; /** * A class that defines default (button-like) implementation for a color picker * component. - * + * * @since 7.0.0 - * + * * @see ColorPickerArea - * + * */ public class ColorPicker extends AbstractColorPicker { @@ -37,7 +37,7 @@ public class ColorPicker extends AbstractColorPicker { /** * Instantiates a new color picker. - * + * * @param popupCaption * caption of the color select popup */ @@ -47,7 +47,7 @@ public class ColorPicker extends AbstractColorPicker { /** * Instantiates a new color picker. - * + * * @param popupCaption * caption of the color select popup * @param initialColor diff --git a/server/src/main/java/com/vaadin/ui/ColorPickerArea.java b/server/src/main/java/com/vaadin/ui/ColorPickerArea.java index 94f64cf256..d15ffc6fad 100644 --- a/server/src/main/java/com/vaadin/ui/ColorPickerArea.java +++ b/server/src/main/java/com/vaadin/ui/ColorPickerArea.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -19,11 +19,11 @@ import com.vaadin.shared.ui.colorpicker.Color; /** * A class that defines area-like implementation for a color picker component. - * + * * @since 7.0.0 - * + * * @see ColorPicker - * + * */ public class ColorPickerArea extends AbstractColorPicker { @@ -36,7 +36,7 @@ public class ColorPickerArea extends AbstractColorPicker { /** * Instantiates a new color picker. - * + * * @param popupCaption * caption of the color select popup */ @@ -46,7 +46,7 @@ public class ColorPickerArea extends AbstractColorPicker { /** * Instantiates a new color picker. - * + * * @param popupCaption * caption of the color select popup * @param initialColor diff --git a/server/src/main/java/com/vaadin/ui/ComboBox.java b/server/src/main/java/com/vaadin/ui/ComboBox.java index ce3526af53..0df7ed12da 100644 --- a/server/src/main/java/com/vaadin/ui/ComboBox.java +++ b/server/src/main/java/com/vaadin/ui/ComboBox.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -44,18 +44,18 @@ import com.vaadin.shared.ui.combobox.FilteringMode; * input, and loaded dynamically ("lazy-loading") from the server. You can turn * on newItemsAllowed and change filtering mode (and also turn it off), but you * can not turn on multi-select mode. - * + * */ @SuppressWarnings("serial") -public class ComboBox extends AbstractSelect implements - AbstractSelect.Filtering, FieldEvents.BlurNotifier, +public class ComboBox extends AbstractSelect + implements AbstractSelect.Filtering, FieldEvents.BlurNotifier, FieldEvents.FocusNotifier { /** * ItemStyleGenerator can be used to add custom styles to combo box items * shown in the popup. The CSS class name that will be added to the item * style names is v-filterselect-item-[style name]. - * + * * @since 7.5.6 * @see ComboBox#setItemStyleGenerator(ItemStyleGenerator) */ @@ -63,7 +63,7 @@ public class ComboBox extends AbstractSelect implements /** * Called by ComboBox when an item is painted. - * + * * @param source * the source combo box * @param itemId @@ -115,7 +115,7 @@ public class ComboBox extends AbstractSelect implements * Flag to indicate whether to scroll the selected item visible (select the * page on which it is) when opening the popup or not. Only applies to * single select mode. - * + * * This requires finding the index of the item, which can be expensive in * many large lazy loading containers. */ @@ -161,7 +161,7 @@ public class ComboBox extends AbstractSelect implements /** * Gets the current input prompt. - * + * * @see #setInputPrompt(String) * @return the current input prompt, or null if not enabled */ @@ -320,11 +320,11 @@ public class ComboBox extends AbstractSelect implements } target.endTag("options"); - target.addAttribute("totalitems", size() - + (needNullSelectOption ? 1 : 0)); + target.addAttribute("totalitems", + size() + (needNullSelectOption ? 1 : 0)); if (filteredSize > 0 || nullOptionVisible) { - target.addAttribute("totalMatches", filteredSize - + (nullOptionVisible ? 1 : 0)); + target.addAttribute("totalMatches", + filteredSize + (nullOptionVisible ? 1 : 0)); } // Paint variables @@ -367,9 +367,9 @@ public class ComboBox extends AbstractSelect implements * field area of the component is just used to show what is selected. By * disabling text input, the comboBox will work in the same way as a * {@link NativeSelect} - * + * * @see #isTextInputAllowed() - * + * * @param textInputAllowed * true to allow entering text, false to just show the current * selection @@ -384,7 +384,7 @@ public class ComboBox extends AbstractSelect implements * the selections or enter a new value if {@link #isNewItemsAllowed()} * returns true. If text input is disabled, the comboBox will work in the * same way as a {@link NativeSelect} - * + * * @return */ public boolean isTextInputAllowed() { @@ -399,17 +399,17 @@ public class ComboBox extends AbstractSelect implements /** * Returns the filtered options for the current page using a container * filter. - * + * * As a size effect, {@link #filteredSize} is set to the total number of * items passing the filter. - * + * * The current container must be {@link Filterable} and {@link Indexed}, and * the filtering mode must be suitable for container filtering (tested with * {@link #canUseContainerFilter()}). - * + * * Use {@link #getFilteredOptions()} and * {@link #sanitizeList(List, boolean)} if this is not the case. - * + * * @param needNullSelectOption * @return filtered list of options (may be empty) or null if cannot use * container filters @@ -452,7 +452,8 @@ public class ComboBox extends AbstractSelect implements // to page with the selected item after filtering if accepted by // filter Object selection = getValue(); - if (isScrollToSelectedItem() && !optionRequest && selection != null) { + if (isScrollToSelectedItem() && !optionRequest + && selection != null) { // ensure proper page indexToEnsureInView = indexed.indexOfId(selection); } @@ -485,11 +486,11 @@ public class ComboBox extends AbstractSelect implements /** * Constructs a filter instance to use when using a Filterable container in * the ITEM_CAPTION_MODE_PROPERTY mode. - * + * * Note that the client side implementation expects the filter string to * apply to the item caption string it sees, so changing the behavior of * this method can cause problems. - * + * * @param filterString * @param filteringMode * @return @@ -533,7 +534,7 @@ public class ComboBox extends AbstractSelect implements * be adjusted. *

          * Package private only for testing purposes. - * + * * @param options * @param needNullSelectOption * flag to indicate if nullselect option needs to be taken into @@ -550,7 +551,8 @@ public class ComboBox extends AbstractSelect implements // to page with the selected item after filtering if accepted by // filter Object selection = getValue(); - if (isScrollToSelectedItem() && !optionRequest && selection != null) { + if (isScrollToSelectedItem() && !optionRequest + && selection != null) { // ensure proper page indexToEnsureInView = options.indexOf(selection); } @@ -560,8 +562,8 @@ public class ComboBox extends AbstractSelect implements indexToEnsureInView, size); int first = getFirstItemIndexOnCurrentPage(needNullSelectOption, size); - int last = getLastItemIndexOnCurrentPage(needNullSelectOption, - size, first); + int last = getLastItemIndexOnCurrentPage(needNullSelectOption, size, + first); return options.subList(first, last + 1); } else { return options; @@ -572,7 +574,7 @@ public class ComboBox extends AbstractSelect implements * Returns the index of the first item on the current page. The index is to * the underlying (possibly filtered) contents. The null item, if any, does * not have an index but takes up a slot on the first page. - * + * * @param needNullSelectOption * true if a null option should be shown before any other options * (takes up the first slot on the first page, not counted in @@ -599,7 +601,7 @@ public class ComboBox extends AbstractSelect implements * the underlying (possibly filtered) contents. If needNullSelectOption is * true, the null item takes up the first slot on the first page, * effectively reducing the first page size by one. - * + * * @param needNullSelectOption * true if a null option should be shown before any other options * (takes up the first slot on the first page, not counted in @@ -624,7 +626,7 @@ public class ComboBox extends AbstractSelect implements * page is not after the end of the contents, and optionally go to the page * containg a specific item. There are no side effects but the adjusted page * index is returned. - * + * * @param page * page number to use as the starting point * @param needNullSelectOption @@ -654,11 +656,11 @@ public class ComboBox extends AbstractSelect implements /** * Filters the options in memory and returns the full filtered list. - * + * * This can be less efficient than using container filters, so use * {@link #getOptionsWithFilter(boolean)} if possible (filterable container * and suitable item caption mode etc.). - * + * * @return */ protected List getFilteredOptions() { @@ -710,7 +712,7 @@ public class ComboBox extends AbstractSelect implements /** * Invoked when the value of a variable has changed. - * + * * @see com.vaadin.ui.AbstractComponent#changeVariables(java.lang.Object, * java.util.Map) */ @@ -844,7 +846,7 @@ public class ComboBox extends AbstractSelect implements /** * ComboBox does not support multi select mode. - * + * * @deprecated As of 7.0, use {@link ListSelect}, {@link OptionGroup} or * {@link TwinColSelect} instead * @see com.vaadin.ui.AbstractSelect#setMultiSelect(boolean) @@ -855,18 +857,19 @@ public class ComboBox extends AbstractSelect implements @Override public void setMultiSelect(boolean multiSelect) { if (multiSelect) { - throw new UnsupportedOperationException("Multiselect not supported"); + throw new UnsupportedOperationException( + "Multiselect not supported"); } } /** * ComboBox does not support multi select mode. - * + * * @deprecated As of 7.0, use {@link ListSelect}, {@link OptionGroup} or * {@link TwinColSelect} instead - * + * * @see com.vaadin.ui.AbstractSelect#isMultiSelect() - * + * * @return false */ @Deprecated @@ -877,7 +880,7 @@ public class ComboBox extends AbstractSelect implements /** * Returns the page length of the suggestion popup. - * + * * @return the pageLength */ public int getPageLength() { @@ -897,7 +900,7 @@ public class ComboBox extends AbstractSelect implements /** * Sets the page length for the suggestion popup. Setting the page length to * 0 will disable suggestion popup paging (all items visible). - * + * * @param pageLength * the pageLength to set */ @@ -910,10 +913,11 @@ public class ComboBox extends AbstractSelect implements * Sets the suggestion pop-up's width as a CSS string. By using relative * units (e.g. "50%") it's possible to set the popup's width relative to the * ComboBox itself. - * + * * @see #getPopupWidth() * @since 7.7 - * @param width the width + * @param width + * the width */ public void setPopupWidth(String width) { suggestionPopupWidth = width; @@ -924,10 +928,10 @@ public class ComboBox extends AbstractSelect implements * Sets whether to scroll the selected item visible (directly open the page * on which it is) when opening the combo box popup or not. Only applies to * single select mode. - * + * * This requires finding the index of the item, which can be expensive in * many large lazy loading containers. - * + * * @param scrollToSelectedItem * true to find the page with the selected item when opening the * selection popup @@ -939,9 +943,9 @@ public class ComboBox extends AbstractSelect implements /** * Returns true if the select should find the page with the selected item * when opening the popup (single select combo box only). - * + * * @see #setScrollToSelectedItem(boolean) - * + * * @return true if the page with the selected item will be shown when * opening the popup */ @@ -953,7 +957,7 @@ public class ComboBox extends AbstractSelect implements * Sets the item style generator that is used to produce custom styles for * showing items in the popup. The CSS class name that will be added to the * item style names is v-filterselect-item-[style name]. - * + * * @param itemStyleGenerator * the item style generator to set, or null to not * use any custom item styles @@ -966,7 +970,7 @@ public class ComboBox extends AbstractSelect implements /** * Gets the currently used item style generator. - * + * * @return the itemStyleGenerator the currently used item style generator, * or null if no generator is used * @since 7.5.6 diff --git a/server/src/main/java/com/vaadin/ui/Component.java b/server/src/main/java/com/vaadin/ui/Component.java index 5db48806c3..22548fb0b5 100644 --- a/server/src/main/java/com/vaadin/ui/Component.java +++ b/server/src/main/java/com/vaadin/ui/Component.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -36,14 +36,14 @@ import com.vaadin.ui.declarative.DesignContext; * by all Vaadin components. {@code Component} is paired with * {@link AbstractComponent}, which provides a default implementation for all * the methods defined in this interface. - * + * *

          * Components are laid out in the user interface hierarchically. The layout is * managed by layout components, or more generally by components that implement * the {@link ComponentContainer} interface. Such a container is the * parent of the contained components. *

          - * + * *

          * The {@link #getParent()} method allows retrieving the parent component of a * component. While there is a {@link #setParent(Component) setParent()}, you @@ -52,13 +52,13 @@ import com.vaadin.ui.declarative.DesignContext; * the layout or other {@code ComponentContainer}, which automatically sets the * parent. *

          - * + * *

          * A component becomes attached to an application (and the * {@link #attach()} is called) when it or one of its parents is attached to the * main window of the application through its containment hierarchy. *

          - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -69,14 +69,14 @@ public interface Component extends ClientConnector, Sizeable, Serializable { * has multiple style names defined, the return string is a space-separated * list of style names. Built-in style names defined in Vaadin or GWT are * not returned. - * + * *

          * The style names are returned only in the basic form in which they were * added; each user-defined style name shows as two CSS style class names in * the rendered HTML: one as it was given and one prefixed with the * component-specific style name. Only the former is returned. *

          - * + * * @return the style name or a space-separated list of user-defined style * names of the component * @see #setStyleName(String) @@ -91,12 +91,12 @@ public interface Component extends ClientConnector, Sizeable, Serializable { * space-separated list of style names. The style names must be valid CSS * class names and should not conflict with any built-in style names in * Vaadin or GWT. - * + * *
                * Label label = new Label("This text has a lot of style");
                * label.setStyleName("myonestyle myotherstyle");
                * 
          - * + * *

          * Each style name will occur in two versions: one as specified and one that * is prefixed with the style name of the component. For example, if you @@ -104,30 +104,30 @@ public interface Component extends ClientConnector, Sizeable, Serializable { * component will have both "{@code mystyle}" and "{@code v-button-mystyle}" * styles. You could then style the component either with: *

          - * + * *
                * .myonestyle {background: blue;}
                * 
          - * + * *

          * or *

          - * + * *
                * .v-button-myonestyle {background: blue;}
                * 
          - * + * *

          * It is normally a good practice to use {@link #addStyleName(String) * addStyleName()} rather than this setter, as different software * abstraction layers can then add their own styles without accidentally * removing those defined in other layers. *

          - * + * *

          * This method will trigger a {@link RepaintRequestEvent}. *

          - * + * * @param style * the new style or styles of the component as a space-separated * list @@ -141,12 +141,12 @@ public interface Component extends ClientConnector, Sizeable, Serializable { * Adds one or more style names to this component. Multiple styles can be * specified as a space-separated list of style names. The style name will * be rendered as a HTML class name, which can be used in a CSS definition. - * + * *
                * Label label = new Label("This text has style");
                * label.addStyleName("mystyle");
                * 
          - * + * *

          * Each style name will occur in two versions: one as specified and one that * is prefixed with the style name of the component. For example, if you @@ -154,23 +154,23 @@ public interface Component extends ClientConnector, Sizeable, Serializable { * component will have both "{@code mystyle}" and "{@code v-button-mystyle}" * styles. You could then style the component either with: *

          - * + * *
                * .mystyle {font-style: italic;}
                * 
          - * + * *

          * or *

          - * + * *
                * .v-button-mystyle {font-style: italic;}
                * 
          - * + * *

          * This method will trigger a {@link RepaintRequestEvent}. *

          - * + * * @param style * the new style to be added to the component * @see #getStyleName() @@ -182,16 +182,16 @@ public interface Component extends ClientConnector, Sizeable, Serializable { /** * Removes one or more style names from component. Multiple styles can be * specified as a space-separated list of style names. - * + * *

          * The parameter must be a valid CSS style name. Only user-defined style * names added with {@link #addStyleName(String) addStyleName()} or * {@link #setStyleName(String) setStyleName()} can be removed; built-in * style names defined in Vaadin or GWT can not be removed. *

          - * + * * * This method will trigger a {@link RepaintRequestEvent}. - * + * * @param style * the style name or style names to be removed * @see #getStyleName() @@ -209,21 +209,21 @@ public interface Component extends ClientConnector, Sizeable, Serializable { /** * Changes the primary style name of the component. - * + * *

          * The primary style name identifies the component when applying the CSS * theme to the Component. By changing the style name all CSS rules targeted * for that style name will no longer apply, and might result in the * component not working as intended. *

          - * + * *

          * To preserve the original style of the component when changing to a new * primary style you should make your new primary style inherit the old * primary style using the SASS @include directive. See more in the SASS * tutorials. *

          - * + * * @param style * The new primary style name */ @@ -234,18 +234,18 @@ public interface Component extends ClientConnector, Sizeable, Serializable { * with disabled components. Disabled components are rendered in a style * that indicates the status, usually in gray color. Children of a disabled * component are also disabled. Components are enabled by default. - * + * *

          * As a security feature, all updates for disabled components are blocked on * the server-side. *

          - * + * *

          * Note that this method only returns the status of the component and does * not take parents into account. Even though this method returns true the * component can be disabled to the user if a parent is disabled. *

          - * + * * @return true if the component and its parent are enabled, * false otherwise. * @see VariableOwner#isEnabled() @@ -257,23 +257,23 @@ public interface Component extends ClientConnector, Sizeable, Serializable { * disabled components, which are shown with a style that indicates the * status, usually shaded in light gray color. Components are enabled by * default. - * + * *
                * Button enabled = new Button("Enabled");
                * enabled.setEnabled(true); // The default
                * layout.addComponent(enabled);
          -     * 
          +     *
                * Button disabled = new Button("Disabled");
                * disabled.setEnabled(false);
                * layout.addComponent(disabled);
                * 
          - * + * *

          * This method will trigger a {@link RepaintRequestEvent} for the component * and, if it is a {@link ComponentContainer}, for all its children * recursively. *

          - * + * * @param enabled * a boolean value specifying if the component should be enabled * or not @@ -282,7 +282,7 @@ public interface Component extends ClientConnector, Sizeable, Serializable { /** * Tests the visibility property of the component. - * + * *

          * Visible components are drawn in the user interface, while invisible ones * are not. The effect is not merely a cosmetic CSS change - no information @@ -291,14 +291,14 @@ public interface Component extends ClientConnector, Sizeable, Serializable { * component invisible through this property can alter the positioning of * other components. *

          - * + * *

          * A component is visible only if all its parents are also visible. This is * not checked by this method though, so even if this method returns true, * the component can be hidden from the user because a parent is set to * invisible. *

          - * + * * @return true if the component has been set to be visible in * the user interface, false if not * @see #setVisible(boolean) @@ -308,27 +308,27 @@ public interface Component extends ClientConnector, Sizeable, Serializable { /** * Sets the visibility of the component. - * + * *

          * Visible components are drawn in the user interface, while invisible ones * are not. The effect is not merely a cosmetic CSS change - no information * about an invisible component will be sent to the client. The effect is * thus the same as removing the component from its parent. *

          - * + * *
                * TextField readonly = new TextField("Read-Only");
                * readonly.setValue("You can't see this!");
                * readonly.setVisible(false);
                * layout.addComponent(readonly);
                * 
          - * + * *

          * A component is visible only if all of its parents are also visible. If a * component is explicitly set to be invisible, changes in the visibility of * its parents will not change the visibility of the component. *

          - * + * * @param visible * the boolean value specifying if the component should be * visible after the call or not. @@ -338,7 +338,7 @@ public interface Component extends ClientConnector, Sizeable, Serializable { /** * Sets the parent connector of the component. - * + * *

          * This method automatically calls {@link #attach()} if the component * becomes attached to the session, regardless of whether it was attached @@ -353,7 +353,7 @@ public interface Component extends ClientConnector, Sizeable, Serializable { * components to a parent and the used method will call this method * implicitly. *

          - * + * * @param parent * the parent connector * @throws IllegalStateException @@ -364,13 +364,13 @@ public interface Component extends ClientConnector, Sizeable, Serializable { /** * Gets the parent component of the component. - * + * *

          * Components can be nested but a component can have only one parent. A * component that contains other components, that is, can be a parent, * should usually inherit the {@link ComponentContainer} interface. *

          - * + * * @return the parent component */ @Override @@ -382,18 +382,18 @@ public interface Component extends ClientConnector, Sizeable, Serializable { * components normally have a value that can be input or changed by the * user, this is mostly relevant only to field components, though not * restricted to them. - * + * *

          * Notice that the read-only mode only affects whether the user can change * the value of the component; it is possible to, for example, scroll * a read-only table. *

          - * + * *

          * The method will return {@code true} if the component or any of its * parents is in the read-only mode. *

          - * + * * @return true if the component or any of its parents is in * read-only mode, false if not. * @see #setReadOnly(boolean) @@ -403,23 +403,23 @@ public interface Component extends ClientConnector, Sizeable, Serializable { /** * Sets the read-only mode of the component to the specified mode. The user * can not change the value of a read-only component. - * + * *

          * As only {@link Field} components normally have a value that can be input * or changed by the user, this is mostly relevant only to field components, * though not restricted to them. *

          - * + * *

          * Notice that the read-only mode only affects whether the user can change * the value of the component; it is possible to, for example, scroll * a read-only table. *

          - * + * *

          * This method will trigger a {@link RepaintRequestEvent}. *

          - * + * * @param readOnly * a boolean value specifying whether the component is put * read-only mode or not @@ -428,12 +428,12 @@ public interface Component extends ClientConnector, Sizeable, Serializable { /** * Gets the caption of the component. - * + * *

          * See {@link #setCaption(String)} for a detailed description of the * caption. *

          - * + * * @return the caption of the component or {@code null} if the caption is * not set. * @see #setCaption(String) @@ -442,7 +442,7 @@ public interface Component extends ClientConnector, Sizeable, Serializable { /** * Sets the caption of the component. - * + * *

          * A caption is an explanatory textual label accompanying a user * interface component, usually shown above, left of, or inside the @@ -450,25 +450,25 @@ public interface Component extends ClientConnector, Sizeable, Serializable { * closely related to caption and is usually displayed horizontally before * or after it, depending on the component and the containing layout. *

          - * + * *

          * The caption can usually also be given as the first parameter to a * constructor, though some components do not support it. *

          - * + * *
                * RichTextArea area = new RichTextArea();
                * area.setCaption("You can edit stuff here");
                * area.setValue("<h1>Helpful Heading</h1>"
                *         + "<p>All this is for you to edit.</p>");
                * 
          - * + * *

          * The contents of a caption are automatically quoted, so no raw HTML can be * rendered in a caption. The validity of the used character encoding, * usually UTF-8, is not checked. *

          - * + * *

          * The caption of a component is, by default, managed and displayed by the * layout component or component container in which the component is placed. @@ -482,12 +482,12 @@ public interface Component extends ClientConnector, Sizeable, Serializable { * {@link Button} and {@link Panel}, manage the caption themselves and * display it inside the component. *

          - * + * *

          * This method will trigger a {@link RepaintRequestEvent}. A * reimplementation should call the superclass implementation. *

          - * + * * @param caption * the new caption for the component. If the caption is * {@code null}, no caption is shown and it does not normally @@ -497,11 +497,11 @@ public interface Component extends ClientConnector, Sizeable, Serializable { /** * Gets the icon resource of the component. - * + * *

          * See {@link #setIcon(Resource)} for a detailed description of the icon. *

          - * + * * @return the icon resource of the component or {@code null} if the * component has no icon * @see #setIcon(Resource) @@ -510,7 +510,7 @@ public interface Component extends ClientConnector, Sizeable, Serializable { /** * Sets the icon of the component. - * + * *

          * An icon is an explanatory graphical label accompanying a user interface * component, usually shown above, left of, or inside the component. Icon is @@ -518,24 +518,24 @@ public interface Component extends ClientConnector, Sizeable, Serializable { * and is usually displayed horizontally before or after it, depending on * the component and the containing layout. *

          - * + * *

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

          - * + * *
                * // Component with an icon from a custom theme
                * TextField name = new TextField("Name");
                * name.setIcon(new ThemeResource("icons/user.png"));
                * layout.addComponent(name);
          -     * 
          +     *
                * // Component with an icon from another theme ('runo')
                * Button ok = new Button("OK");
                * ok.setIcon(new ThemeResource("../runo/icons/16/ok.png"));
                * layout.addComponent(ok);
                * 
          - * + * *

          * The icon of a component is, by default, managed and displayed by the * layout component or component container in which the component is placed. @@ -547,16 +547,16 @@ public interface Component extends ClientConnector, Sizeable, Serializable { * icon of its composition root, so if the root component has an icon, it * will not be rendered. *

          - * + * *

          * An icon will be rendered inside an HTML element that has the * {@code v-icon} CSS style class. The containing layout may enclose an icon * and a caption inside elements related to the caption, such as * {@code v-caption} . *

          - * + * * This method will trigger a {@link RepaintRequestEvent}. - * + * * @param icon * the icon of the component. If null, no icon is shown and it * does not normally take any space. @@ -567,12 +567,12 @@ public interface Component extends ClientConnector, Sizeable, Serializable { /** * Gets the UI the component is attached to. - * + * *

          * If the component is not attached to a UI through a component containment * hierarchy, null is returned. *

          - * + * * @return the UI of the component or null if it is not * attached to a UI */ @@ -581,7 +581,7 @@ public interface Component extends ClientConnector, Sizeable, Serializable { /** * {@inheritDoc} - * + * *

          * Reimplementing the {@code attach()} method is useful for tasks that need * to get a reference to the parent, window, or application object with the @@ -590,18 +590,19 @@ public interface Component extends ClientConnector, Sizeable, Serializable { * so in such case, the methods will return {@code null}. For example, the * following is invalid: *

          - * + * *
                * public class AttachExample extends CustomComponent {
                *     public AttachExample() {
                *         // ERROR: We can't access the application object yet.
          -     *         ClassResource r = new ClassResource("smiley.jpg", getApplication());
          +     *         ClassResource r = new ClassResource("smiley.jpg",
          +     *                 getApplication());
                *         Embedded image = new Embedded("Image:", r);
                *         setCompositionRoot(image);
                *     }
                * }
                * 
          - * + * *

          * Adding a component to an application triggers calling the * {@link #attach()} method for the component. Correspondingly, removing a @@ -610,18 +611,19 @@ public interface Component extends ClientConnector, Sizeable, Serializable { * application, the {@code attach()} is called immediately from * {@link #setParent(Component)}. *

          - * + * *
                * public class AttachExample extends CustomComponent {
                *     public AttachExample() {
                *     }
          -     * 
          +     *
                *     @Override
                *     public void attach() {
                *         super.attach(); // Must call.
          -     * 
          +     *
                *         // Now we know who ultimately owns us.
          -     *         ClassResource r = new ClassResource("smiley.jpg", getApplication());
          +     *         ClassResource r = new ClassResource("smiley.jpg",
          +     *                 getApplication());
                *         Embedded image = new Embedded("Image:", r);
                *         setCompositionRoot(image);
                *     }
          @@ -633,21 +635,21 @@ public interface Component extends ClientConnector, Sizeable, Serializable {
           
               /**
                * Gets the locale of the component.
          -     * 
          +     *
                * 

          * If a component does not have a locale set, the locale of its parent is * returned, and so on. Eventually, if no parent has locale set, the locale * of the application is returned. If the application does not have a locale * set, it is determined by Locale.getDefault(). *

          - * + * *

          * As the component must be attached before its locale can be acquired, * using this method in the internationalization of component captions, etc. * is generally not feasible. For such use case, we recommend using an * otherwise acquired reference to the application locale. *

          - * + * * @return Locale of this component or {@code null} if the component and * none of its parents has a locale set and the component is not yet * attached to an application. @@ -658,7 +660,7 @@ public interface Component extends ClientConnector, Sizeable, Serializable { * Adds an unique id for component that is used in the client-side for * testing purposes. Keeping identifiers unique is the responsibility of the * programmer. - * + * * @param id * An alphanumeric id */ @@ -666,7 +668,7 @@ public interface Component extends ClientConnector, Sizeable, Serializable { /** * Gets currently set debug identifier - * + * * @return current id, null if not set */ public String getId(); @@ -678,7 +680,7 @@ public interface Component extends ClientConnector, Sizeable, Serializable { * be used to briefly describe the state of the component to the user. The * description string may contain certain XML tags: *

          - * + * *

          * * @@ -721,11 +723,11 @@ public interface Component extends ClientConnector, Sizeable, Serializable { * *
          *

          - * + * *

          * These tags may be nested. *

          - * + * * @return component's description String */ public String getDescription(); @@ -744,7 +746,7 @@ public interface Component extends ClientConnector, Sizeable, Serializable { * defaults. *

          * This method must not modify the design. - * + * * @since 7.4 * @param design * The element to obtain the state from @@ -760,14 +762,14 @@ public interface Component extends ClientConnector, Sizeable, Serializable { * for ensuring that its children write their state to the design. *

          * This method must not modify the component state. - * + * * @since 7.4 * @param design * The element to write the component state to. Any previous * attributes or child nodes are not cleared. * @param designContext * The DesignContext instance used for writing the design - * + * */ public void writeDesign(Element design, DesignContext designContext); @@ -775,13 +777,13 @@ public interface Component extends ClientConnector, Sizeable, Serializable { /** * Superclass of all component originated events. - * + * *

          * Events are the basis of all user interaction handling in Vaadin. To * handle events, you provide a listener object that receives the events of * the particular event type. *

          - * + * *
                * Button button = new Button("Click Me!");
                * button.addListener(new Button.ClickListener() {
          @@ -791,13 +793,13 @@ public interface Component extends ClientConnector, Sizeable, Serializable {
                * });
                * layout.addComponent(button);
                * 
          - * + * *

          * Notice that while each of the event types have their corresponding * listener types; the listener interfaces are not required to inherit the * {@code Component.Listener} interface. *

          - * + * * @see Component.Listener */ @SuppressWarnings("serial") @@ -805,7 +807,7 @@ public interface Component extends ClientConnector, Sizeable, Serializable { /** * Constructs a new event with the specified source component. - * + * * @param source * the source component of the event */ @@ -815,7 +817,7 @@ public interface Component extends ClientConnector, Sizeable, Serializable { /** * Gets the component where the event occurred. - * + * * @return the source component of the event */ public Component getComponent() { @@ -826,7 +828,7 @@ public interface Component extends ClientConnector, Sizeable, Serializable { /** * Listener interface for receiving Component.Events. - * + * *

          * Listener interfaces are the basis of all user interaction handling in * Vaadin. You have or create a listener object that receives the events. @@ -834,7 +836,7 @@ public interface Component extends ClientConnector, Sizeable, Serializable { * however, required to inherit the {@code Component.Listener} interface, * and they rarely do so. *

          - * + * *

          * This generic listener interface is useful typically when you wish to * handle events from different component types in a single listener method @@ -842,76 +844,79 @@ public interface Component extends ClientConnector, Sizeable, Serializable { * listener class, you normally use the component specific listener class, * such as {@link com.vaadin.ui.Button.ClickEvent}. *

          - * + * *
                * class Listening extends CustomComponent implements Listener {
                *     Button ok; // Stored for determining the source of an event
          -     * 
          +     *
                *     Label status; // For displaying info about the event
          -     * 
          +     *
                *     public Listening() {
                *         VerticalLayout layout = new VerticalLayout();
          -     * 
          +     *
                *         // Some miscellaneous component
                *         TextField name = new TextField("Say it all here");
                *         name.addListener(this);
                *         name.setImmediate(true);
                *         layout.addComponent(name);
          -     * 
          +     *
                *         // Handle button clicks as generic events instead
                *         // of Button.ClickEvent events
                *         ok = new Button("OK");
                *         ok.addListener(this);
                *         layout.addComponent(ok);
          -     * 
          +     *
                *         // For displaying information about an event
                *         status = new Label("");
                *         layout.addComponent(status);
          -     * 
          +     *
                *         setCompositionRoot(layout);
                *     }
          -     * 
          +     *
                *     public void componentEvent(Event event) {
                *         // Act according to the source of the event
                *         if (event.getSource() == ok
                *                 && event.getClass() == Button.ClickEvent.class)
                *             getWindow().showNotification("Click!");
          -     * 
          +     *
                *         // Display source component and event class names
          -     *         status.setValue("Event from " + event.getSource().getClass().getName()
          -     *                 + ": " + event.getClass().getName());
          +     *         status.setValue(
          +     *                 "Event from " + event.getSource().getClass().getName()
          +     *                         + ": " + event.getClass().getName());
                *     }
                * }
          -     * 
          +     *
                * Listening listening = new Listening();
                * layout.addComponent(listening);
                * 
          - * + * * @see Component#addListener(Listener) */ public interface Listener extends ConnectorEventListener { /** * Notifies the listener of a component event. - * + * *

          * As the event can typically come from one of many source components, * you may need to differentiate between the event source by component * reference, class, etc. *

          - * + * *
                    * public void componentEvent(Event event) {
                    *     // Act according to the source of the event
          -         *     if (event.getSource() == ok && event.getClass() == Button.ClickEvent.class)
          +         *     if (event.getSource() == ok
          +         *             && event.getClass() == Button.ClickEvent.class)
                    *         getWindow().showNotification("Click!");
          -         * 
          +         *
                    *     // Display source component and event class names
          -         *     status.setValue("Event from " + event.getSource().getClass().getName()
          -         *             + ": " + event.getClass().getName());
          +         *     status.setValue(
          +         *             "Event from " + event.getSource().getClass().getName() + ": "
          +         *                     + event.getClass().getName());
                    * }
                    * 
          - * + * * @param event * the event that has occurred. */ @@ -920,50 +925,51 @@ public interface Component extends ClientConnector, Sizeable, Serializable { /** * Registers a new (generic) component event listener for the component. - * + * *
                * class Listening extends CustomComponent implements Listener {
                *     // Stored for determining the source of an event
                *     Button ok;
          -     * 
          +     *
                *     Label status; // For displaying info about the event
          -     * 
          +     *
                *     public Listening() {
                *         VerticalLayout layout = new VerticalLayout();
          -     * 
          +     *
                *         // Some miscellaneous component
                *         TextField name = new TextField("Say it all here");
                *         name.addListener(this);
                *         name.setImmediate(true);
                *         layout.addComponent(name);
          -     * 
          +     *
                *         // Handle button clicks as generic events instead
                *         // of Button.ClickEvent events
                *         ok = new Button("OK");
                *         ok.addListener(this);
                *         layout.addComponent(ok);
          -     * 
          +     *
                *         // For displaying information about an event
                *         status = new Label("");
                *         layout.addComponent(status);
          -     * 
          +     *
                *         setCompositionRoot(layout);
                *     }
          -     * 
          +     *
                *     public void componentEvent(Event event) {
                *         // Act according to the source of the event
                *         if (event.getSource() == ok)
                *             getWindow().showNotification("Click!");
          -     * 
          -     *         status.setValue("Event from " + event.getSource().getClass().getName()
          -     *                 + ": " + event.getClass().getName());
          +     *
          +     *         status.setValue(
          +     *                 "Event from " + event.getSource().getClass().getName()
          +     *                         + ": " + event.getClass().getName());
                *     }
                * }
          -     * 
          +     *
                * Listening listening = new Listening();
                * layout.addComponent(listening);
                * 
          - * + * * @param listener * the new Listener to be registered. * @see Component.Event @@ -974,7 +980,7 @@ public interface Component extends ClientConnector, Sizeable, Serializable { /** * Removes a previously registered component event listener from this * component. - * + * * @param listener * the listener to be removed. * @see #addListener(Listener) @@ -983,7 +989,7 @@ public interface Component extends ClientConnector, Sizeable, Serializable { /** * Class of all component originated error events. - * + * *

          * The component error event is normally fired by * {@link AbstractComponent#setComponentError(ErrorMessage)}. The component @@ -998,7 +1004,7 @@ public interface Component extends ClientConnector, Sizeable, Serializable { /** * Constructs a new event with a specified source component. - * + * * @param message * the error message. * @param component @@ -1011,7 +1017,7 @@ public interface Component extends ClientConnector, Sizeable, Serializable { /** * Gets the error message. - * + * * @return the error message. */ public ErrorMessage getErrorMessage() { @@ -1023,7 +1029,7 @@ public interface Component extends ClientConnector, Sizeable, Serializable { * A sub-interface implemented by components that can obtain input focus. * This includes all {@link Field} components as well as some other * components, such as {@link Upload}. - * + * *

          * Focus can be set with {@link #focus()}. This interface does not provide * an accessor that would allow finding out the currently focused component; @@ -1031,33 +1037,33 @@ public interface Component extends ClientConnector, Sizeable, Serializable { * components through the {@link com.vaadin.event.FieldEvents.FocusListener} * and {@link com.vaadin.event.FieldEvents.BlurListener} interfaces. *

          - * + * * @see FieldEvents */ public interface Focusable extends Component { /** * Sets the focus to this component. - * + * *
                    * Form loginBox = new Form();
                    * loginBox.setCaption("Login");
                    * layout.addComponent(loginBox);
          -         * 
          +         *
                    * // Create the first field which will be focused
                    * TextField username = new TextField("User name");
                    * loginBox.addField("username", username);
          -         * 
          +         *
                    * // Set focus to the user name
                    * username.focus();
          -         * 
          +         *
                    * TextField password = new TextField("Password");
                    * loginBox.addField("password", password);
          -         * 
          +         *
                    * Button login = new Button("Login");
                    * loginBox.getFooter().addComponent(login);
                    * 
          - * + * *

          * Notice that this interface does not provide an accessor that would * allow finding out the currently focused component. Focus information @@ -1065,7 +1071,7 @@ public interface Component extends ClientConnector, Sizeable, Serializable { * through the {@link com.vaadin.event.FieldEvents.FocusListener} and * {@link com.vaadin.event.FieldEvents.BlurListener} interfaces. *

          - * + * * @see com.vaadin.event.FieldEvents * @see com.vaadin.event.FieldEvents.FocusEvent * @see com.vaadin.event.FieldEvents.FocusListener @@ -1076,7 +1082,7 @@ public interface Component extends ClientConnector, Sizeable, Serializable { /** * Gets the tabulator index of the {@code Focusable} component. - * + * * @return tab index set for the {@code Focusable} component * @see #setTabIndex(int) */ @@ -1088,54 +1094,54 @@ public interface Component extends ClientConnector, Sizeable, Serializable { * fields are focused when the user presses the Tab key. Components with * a defined tab index are focused sequentially first, and then the * components with no tab index. - * + * *
                    * Form loginBox = new Form();
                    * loginBox.setCaption("Login");
                    * layout.addComponent(loginBox);
          -         * 
          +         *
                    * // Create the first field which will be focused
                    * TextField username = new TextField("User name");
                    * loginBox.addField("username", username);
          -         * 
          +         *
                    * // Set focus to the user name
                    * username.focus();
          -         * 
          +         *
                    * TextField password = new TextField("Password");
                    * loginBox.addField("password", password);
          -         * 
          +         *
                    * Button login = new Button("Login");
                    * loginBox.getFooter().addComponent(login);
          -         * 
          +         *
                    * // An additional component which natural focus order would
                    * // be after the button.
                    * CheckBox remember = new CheckBox("Remember me");
                    * loginBox.getFooter().addComponent(remember);
          -         * 
          +         *
                    * username.setTabIndex(1);
                    * password.setTabIndex(2);
                    * remember.setTabIndex(3); // Different than natural place
                    * login.setTabIndex(4);
                    * 
          - * + * *

          * After all focusable user interface components are done, the browser * can begin again from the component with the smallest tab index, or it * can take the focus out of the page, for example, to the location bar. *

          - * + * *

          * If the tab index is not set (is set to zero), the default tab order * is used. The order is somewhat browser-dependent, but generally * follows the HTML structure of the page. *

          - * + * *

          * A negative value means that the component is completely removed from * the tabulation order and can not be reached by pressing the Tab key * at all. *

          - * + * * @param tabIndex * the tab order of this component. Indexes usually start * from 1. Zero means that default tab order should be used. diff --git a/server/src/main/java/com/vaadin/ui/ComponentContainer.java b/server/src/main/java/com/vaadin/ui/ComponentContainer.java index 2d5b4ffa9a..521bee3879 100644 --- a/server/src/main/java/com/vaadin/ui/ComponentContainer.java +++ b/server/src/main/java/com/vaadin/ui/ComponentContainer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -24,16 +24,16 @@ import com.vaadin.ui.HasComponents.ComponentAttachDetachNotifier; * A special type of parent which allows the user to add and remove components * to it. Typically does not have any restrictions on the number of children it * can contain. - * + * * @author Vaadin Ltd. * @since 3.0 */ -public interface ComponentContainer extends HasComponents, - ComponentAttachDetachNotifier { +public interface ComponentContainer + extends HasComponents, ComponentAttachDetachNotifier { /** * Adds the component into this container. - * + * * @param c * the component to be added. */ @@ -41,7 +41,7 @@ public interface ComponentContainer extends HasComponents, /** * Adds the components in the given order to this component container. - * + * * @param components * The components to add. */ @@ -49,7 +49,7 @@ public interface ComponentContainer extends HasComponents, /** * Removes the component from this container. - * + * * @param c * the component to be removed. */ @@ -63,7 +63,7 @@ public interface ComponentContainer extends HasComponents, /** * Replaces the component in the container with another one without changing * position. - * + * *

          * This method replaces component with another one is such way that the new * component overtakes the position of the old component. If the old @@ -72,21 +72,22 @@ public interface ComponentContainer extends HasComponents, * positions are swapped. Component attach and detach events should be taken * care as with add and remove. *

          - * + * * @param oldComponent * the old component that will be replaced. * @param newComponent * the new component to be replaced. */ - public void replaceComponent(Component oldComponent, Component newComponent); + public void replaceComponent(Component oldComponent, + Component newComponent); /** * Gets an iterator to the collection of contained components. Using this * iterator it is possible to step through all components contained in this * container. - * + * * @return the component iterator. - * + * * @deprecated As of 7.0, use {@link #iterator()} instead. */ @Deprecated @@ -95,7 +96,7 @@ public interface ComponentContainer extends HasComponents, /** * Gets the number of children this {@link ComponentContainer} has. This * must be symmetric with what {@link #getComponentIterator()} returns. - * + * * @return The number of child components this container has. * @since 7.0.0 */ @@ -104,7 +105,7 @@ public interface ComponentContainer extends HasComponents, /** * Moves all components from an another container into this container. The * components are removed from source. - * + * * @param source * the container which contains the components that are to be * moved to this container. diff --git a/server/src/main/java/com/vaadin/ui/ConnectorTracker.java b/server/src/main/java/com/vaadin/ui/ConnectorTracker.java index 159bd09c0d..3cf03a134d 100644 --- a/server/src/main/java/com/vaadin/ui/ConnectorTracker.java +++ b/server/src/main/java/com/vaadin/ui/ConnectorTracker.java @@ -140,9 +140,7 @@ public class ConnectorTracker implements Serializable { connectorIdToConnector.put(connectorId, connector); uninitializedConnectors.add(connector); if (getLogger().isLoggable(Level.FINE)) { - getLogger().log( - Level.FINE, - "Registered {0} ({1})", + getLogger().log(Level.FINE, "Registered {0} ({1})", new Object[] { connector.getClass().getSimpleName(), connectorId }); } @@ -150,12 +148,10 @@ public class ConnectorTracker implements Serializable { throw new RuntimeException("A connector with id " + connectorId + " is already registered!"); } else if (!wasUnregistered) { - getLogger() - .log(Level.WARNING, - "An already registered connector was registered again: {0} ({1})", - new Object[] { - connector.getClass().getSimpleName(), - connectorId }); + getLogger().log(Level.WARNING, + "An already registered connector was registered again: {0} ({1})", + new Object[] { connector.getClass().getSimpleName(), + connectorId }); } dirtyConnectors.add(connector); } @@ -174,8 +170,7 @@ public class ConnectorTracker implements Serializable { public void unregisterConnector(ClientConnector connector) { String connectorId = connector.getConnectorId(); if (!connectorIdToConnector.containsKey(connectorId)) { - getLogger().log( - Level.WARNING, + getLogger().log(Level.WARNING, "Tried to unregister {0} ({1}) which is not registered", new Object[] { connector.getClass().getSimpleName(), connectorId }); @@ -199,15 +194,12 @@ public class ConnectorTracker implements Serializable { dirtyConnectors.remove(connector); if (unregisteredConnectors.add(connector)) { if (getLogger().isLoggable(Level.FINE)) { - getLogger().log( - Level.FINE, - "Unregistered {0} ({1})", + getLogger().log(Level.FINE, "Unregistered {0} ({1})", new Object[] { connector.getClass().getSimpleName(), connectorId }); } } else { - getLogger().log( - Level.WARNING, + getLogger().log(Level.WARNING, "Unregistered {0} ({1}) that was already unregistered.", new Object[] { connector.getClass().getSimpleName(), connectorId }); @@ -226,7 +218,8 @@ public class ConnectorTracker implements Serializable { * already know anything about the connector. */ public boolean isClientSideInitialized(ClientConnector connector) { - assert connectorIdToConnector.get(connector.getConnectorId()) == connector : "Connector should be registered with this ConnectorTracker"; + assert connectorIdToConnector.get(connector + .getConnectorId()) == connector : "Connector should be registered with this ConnectorTracker"; return !uninitializedConnectors.contains(connector); } @@ -313,10 +306,9 @@ public class ConnectorTracker implements Serializable { // This code should never be called as cleanup should take place // in detach() - getLogger() - .log(Level.WARNING, - "cleanConnectorMap unregistered connector {0}. This should have been done when the connector was detached.", - getConnectorAndParentInfo(connector)); + getLogger().log(Level.WARNING, + "cleanConnectorMap unregistered connector {0}. This should have been done when the connector was detached.", + getConnectorAndParentInfo(connector)); if (globalResourceHandler != null) { globalResourceHandler.unregisterConnector(connector); @@ -331,16 +323,13 @@ public class ConnectorTracker implements Serializable { diffStates.remove(connector); assert isRemovalSentToClient(connector) : "Connector " - + connector - + " (id = " - + connector.getConnectorId() + + connector + " (id = " + connector.getConnectorId() + ") is no longer visible to the client, but no corresponding hierarchy change is being sent."; if (getLogger().isLoggable(Level.FINE)) { - getLogger() - .log(Level.FINE, - "cleanConnectorMap removed state for {0} as it is not visible", - getConnectorAndParentInfo(connector)); + getLogger().log(Level.FINE, + "cleanConnectorMap removed state for {0} as it is not visible", + getConnectorAndParentInfo(connector)); } } } @@ -361,7 +350,8 @@ public class ConnectorTracker implements Serializable { if (hierarchyInfoObj instanceof JsonObject) { JsonObject hierachyInfo = (JsonObject) hierarchyInfoObj; - ClientConnector firstVisibleParent = findFirstVisibleParent(connector); + ClientConnector firstVisibleParent = findFirstVisibleParent( + connector); if (firstVisibleParent == null) { // Connector is detached, not our business return true; @@ -385,22 +375,20 @@ public class ConnectorTracker implements Serializable { .getAttribute(attributeName); if (stateUpdateConnectorsObj instanceof Set) { Set stateUpdateConnectors = (Set) stateUpdateConnectorsObj; - if (!stateUpdateConnectors.contains(firstVisibleParent - .getConnectorId())) { + if (!stateUpdateConnectors + .contains(firstVisibleParent.getConnectorId())) { // Not the optimization case if the parent is not marked // as dirty return false; } } else { - getLogger().warning( - "Request attribute " + attributeName - + " is not a Set"); + getLogger().warning("Request attribute " + attributeName + + " is not a Set"); } } } else { - getLogger().warning( - "Request attribute " + attributeName - + " is not a JsonObject"); + getLogger().warning("Request attribute " + attributeName + + " is not a JsonObject"); } return true; @@ -466,25 +454,21 @@ public class ConnectorTracker implements Serializable { if (!connector.equals(child.getParent())) { noErrors = false; - getLogger() - .log(Level.WARNING, - "{0} claims that {1} is its child, but the child claims {2} is its parent.", - new Object[] { - getConnectorString(connector), - getConnectorString(child), - getConnectorString(child - .getParent()) }); + getLogger().log(Level.WARNING, + "{0} claims that {1} is its child, but the child claims {2} is its parent.", + new Object[] { getConnectorString(connector), + getConnectorString(child), + getConnectorString(child.getParent()) }); } } } for (ClientConnector dangling : danglingConnectors) { noErrors = false; - getLogger() - .log(Level.WARNING, - "{0} claims that {1} is its parent, but the parent does not acknowledge the parenthood.", - new Object[] { getConnectorString(dangling), - getConnectorString(dangling.getParent()) }); + getLogger().log(Level.WARNING, + "{0} claims that {1} is its parent, but the parent does not acknowledge the parenthood.", + new Object[] { getConnectorString(dangling), + getConnectorString(dangling.getParent()) }); } return noErrors; @@ -717,7 +701,8 @@ public class ConnectorTracker implements Serializable { } /* Special serialization to JsonObjects which are not serializable */ - private void writeObject(java.io.ObjectOutputStream out) throws IOException { + private void writeObject(java.io.ObjectOutputStream out) + throws IOException { out.defaultWriteObject(); // Convert JsonObjects in diff state to String representation as // JsonObject is not serializable @@ -730,8 +715,8 @@ public class ConnectorTracker implements Serializable { } /* Special serialization to JsonObjects which are not serializable */ - private void readObject(java.io.ObjectInputStream in) throws IOException, - ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) + throws IOException, ClassNotFoundException { in.defaultReadObject(); // Read String versions of JsonObjects and parse into JsonObjects as @@ -930,11 +915,11 @@ public class ConnectorTracker implements Serializable { * Maintains the bookkeeping connector removal and concurrency by removing * entries that have become too old. *

          - * It is important to run this call for each transmission from the client - * , otherwise the bookkeeping gets out of date and the results form - * {@link #connectorWasPresentAsRequestWasSent(String, long)} will become - * invalid (that is, even though the client knew the component was removed, - * the aforementioned method would start claiming otherwise). + * It is important to run this call for each transmission from the + * client , otherwise the bookkeeping gets out of date and the results + * form {@link #connectorWasPresentAsRequestWasSent(String, long)} will + * become invalid (that is, even though the client knew the component was + * removed, the aforementioned method would start claiming otherwise). *

          * Entries that both client and server agree upon are removed. Since * argument is the last sync id that the client has seen from the server, we @@ -949,7 +934,8 @@ public class ConnectorTracker implements Serializable { * the sync id the client has most recently received from the * server. */ - public void cleanConcurrentlyRemovedConnectorIds(int lastSyncIdSeenByClient) { + public void cleanConcurrentlyRemovedConnectorIds( + int lastSyncIdSeenByClient) { if (lastSyncIdSeenByClient == -1) { // Sync id checking is not in use, so we should just clear the // entire map to avoid leaking memory diff --git a/server/src/main/java/com/vaadin/ui/CssLayout.java b/server/src/main/java/com/vaadin/ui/CssLayout.java index dbedfa53ff..21c1875322 100644 --- a/server/src/main/java/com/vaadin/ui/CssLayout.java +++ b/server/src/main/java/com/vaadin/ui/CssLayout.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -54,7 +54,7 @@ import com.vaadin.ui.declarative.DesignContext; *

          * By extending CssLayout one can also inject some css rules straight to child * components using {@link #getCss(Component)}. - * + * *

          * (*) Relative sizes (set from server side) are treated bit differently than in * other layouts in Vaadin. In cssLayout the size is calculated relatively to @@ -67,9 +67,9 @@ import com.vaadin.ui.declarative.DesignContext; * wants to set component sizes with CSS, component must have undefined size on * server side (which is not the default for all components) and the size must * be defined with class styles - not by directly injecting width and height. - * + * * @since 6.1 brought in from "FastLayouts" incubator project - * + * */ public class CssLayout extends AbstractLayout implements LayoutClickNotifier { @@ -78,8 +78,8 @@ public class CssLayout extends AbstractLayout implements LayoutClickNotifier { @Override public void layoutClick(MouseEventDetails mouseDetails, Connector clickedConnector) { - fireEvent(LayoutClickEvent.createEvent(CssLayout.this, - mouseDetails, clickedConnector)); + fireEvent(LayoutClickEvent.createEvent(CssLayout.this, mouseDetails, + clickedConnector)); } }; /** @@ -96,9 +96,9 @@ public class CssLayout extends AbstractLayout implements LayoutClickNotifier { /** * Constructs a CssLayout with the given components in the given order. - * + * * @see #addComponents(Component...) - * + * * @param children * Components to add to the container. */ @@ -110,7 +110,7 @@ public class CssLayout extends AbstractLayout implements LayoutClickNotifier { /** * Add a component into this container. The component is added to the right * or below the previous component. - * + * * @param c * the component to be added. */ @@ -130,7 +130,7 @@ public class CssLayout extends AbstractLayout implements LayoutClickNotifier { /** * Adds a component into this container. The component is added to the left * or on top of the other components. - * + * * @param c * the component to be added. */ @@ -151,7 +151,7 @@ public class CssLayout extends AbstractLayout implements LayoutClickNotifier { /** * Adds a component into indexed position in this container. - * + * * @param c * the component to be added. * @param index @@ -179,7 +179,7 @@ public class CssLayout extends AbstractLayout implements LayoutClickNotifier { /** * Removes the component from this container. - * + * * @param c * the component to be removed. */ @@ -192,7 +192,7 @@ public class CssLayout extends AbstractLayout implements LayoutClickNotifier { /** * Gets the component container iterator for going trough all the components * in the container. - * + * * @return the Iterator of the components inside the container. */ @Override @@ -203,7 +203,7 @@ public class CssLayout extends AbstractLayout implements LayoutClickNotifier { /** * Gets the number of contained components. Consistent with the iterator * returned by {@link #getComponentIterator()}. - * + * * @return the number of contained components */ @Override @@ -238,17 +238,17 @@ public class CssLayout extends AbstractLayout implements LayoutClickNotifier { /** * Returns styles to be applied to given component. Override this method to * inject custom style rules to components. - * + * *

          * Note that styles are injected over previous styles before actual child * rendering. Previous styles are not cleared, but overridden. - * + * *

          * Note that one most often achieves better code style, by separating * styling to theme (with custom theme and {@link #addStyleName(String)}. * With own custom styles it is also very easy to break browser * compatibility. - * + * * @param c * the component * @return css rules to be applied to component @@ -259,13 +259,15 @@ public class CssLayout extends AbstractLayout implements LayoutClickNotifier { /* Documented in superclass */ @Override - public void replaceComponent(Component oldComponent, Component newComponent) { + public void replaceComponent(Component oldComponent, + Component newComponent) { // Gets the locations int oldLocation = -1; int newLocation = -1; int location = 0; - for (final Iterator i = components.iterator(); i.hasNext();) { + for (final Iterator i = components.iterator(); i + .hasNext();) { final Component component = i.next(); if (component == oldComponent) { @@ -335,7 +337,7 @@ public class CssLayout extends AbstractLayout implements LayoutClickNotifier { /** * Returns the index of the given component. - * + * * @param component * The component to look up. * @return The index of the component or -1 if the component is not a child. @@ -346,7 +348,7 @@ public class CssLayout extends AbstractLayout implements LayoutClickNotifier { /** * Returns the component at the given position. - * + * * @param index * The position of the component. * @return The component at the given index. @@ -359,7 +361,7 @@ public class CssLayout extends AbstractLayout implements LayoutClickNotifier { /* * (non-Javadoc) - * + * * @see com.vaadin.ui.AbstractComponent#readDesign(org.jsoup.nodes .Element, * com.vaadin.ui.declarative.DesignContext) */ @@ -376,7 +378,7 @@ public class CssLayout extends AbstractLayout implements LayoutClickNotifier { /* * (non-Javadoc) - * + * * @see com.vaadin.ui.AbstractComponent#writeDesign(org.jsoup.nodes.Element * , com.vaadin.ui.declarative.DesignContext) */ diff --git a/server/src/main/java/com/vaadin/ui/CustomComponent.java b/server/src/main/java/com/vaadin/ui/CustomComponent.java index 55f9d7db03..5275169cd3 100644 --- a/server/src/main/java/com/vaadin/ui/CustomComponent.java +++ b/server/src/main/java/com/vaadin/ui/CustomComponent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -23,7 +23,7 @@ import java.util.Iterator; * Custom component provides a simple implementation of the {@link Component} * interface to allow creating new UI components by composition of existing * server-side components. - * + * *

          * The component is used by inheriting the CustomComponent class and setting the * composition root component. The composition root must be set with @@ -31,29 +31,30 @@ import java.util.Iterator; * such as by adding it to a layout, so it is preferable to set it in the * constructor. *

          - * + * *

          * The composition root itself can contain more components. The advantage of * wrapping it in a CustomComponent is that its details, such as interfaces, are * hidden from the users of the component, thereby contributing to information * hiding. *

          - * + * *

          * The CustomComponent does not display the caption of the composition root, so * if you want to have it shown in the layout where the custom component is * contained, you need to set it as caption of the CustomComponent. *

          - * + * *

          * The component expands horizontally and has undefined height by default. *

          - * + * * @author Vaadin Ltd. * @since 3.0 */ @SuppressWarnings("serial") -public class CustomComponent extends AbstractComponent implements HasComponents { +public class CustomComponent extends AbstractComponent + implements HasComponents { /** * The root component implementing the custom component. @@ -62,7 +63,7 @@ public class CustomComponent extends AbstractComponent implements HasComponents /** * Constructs a new custom component. - * + * *

          * Note that you must set the composition root before the component can be * used, preferably in the constructor. @@ -75,7 +76,7 @@ public class CustomComponent extends AbstractComponent implements HasComponents /** * Constructs a new custom component. - * + * * @param compositionRoot * the root of the composition component tree. It must not be * null. @@ -87,7 +88,7 @@ public class CustomComponent extends AbstractComponent implements HasComponents /** * Returns the composition root. - * + * * @return the Component Composition root. */ protected Component getCompositionRoot() { @@ -96,12 +97,12 @@ public class CustomComponent extends AbstractComponent implements HasComponents /** * Sets the composition root for the component. - * + * *

          * You must set the composition root to a non-null value before the * component can be used. You can change it later. *

          - * + * * @param compositionRoot * the root of the composition component tree. */ @@ -139,7 +140,7 @@ public class CustomComponent extends AbstractComponent implements HasComponents /** * Gets the number of contained components. Consistent with the iterator * returned by {@link #getComponentIterator()}. - * + * * @return the number of contained components (zero or one) */ public int getComponentCount() { diff --git a/server/src/main/java/com/vaadin/ui/CustomField.java b/server/src/main/java/com/vaadin/ui/CustomField.java index 12f00ac23f..df8f9180c4 100644 --- a/server/src/main/java/com/vaadin/ui/CustomField.java +++ b/server/src/main/java/com/vaadin/ui/CustomField.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,26 +25,26 @@ import com.vaadin.data.Property; * A {@link Field} whose UI content can be constructed by the user, enabling the * creation of e.g. form fields by composing Vaadin components. Customization of * both the visual presentation and the logic of the field is possible. - * + * * Subclasses must implement {@link #getType()} and {@link #initContent()}. - * + * * Most custom fields can simply compose a user interface that calls the methods * {@link #setInternalValue(Object)} and {@link #getInternalValue()} when * necessary. - * + * * It is also possible to override {@link #validate()}, * {@link #setInternalValue(Object)}, {@link #commit()}, * {@link #setPropertyDataSource(Property)}, {@link #isEmpty()} and other logic * of the field. Methods overriding {@link #setInternalValue(Object)} should * also call the corresponding superclass method. - * + * * @param * field value type - * + * * @since 7.0 */ -public abstract class CustomField extends AbstractField implements - HasComponents { +public abstract class CustomField extends AbstractField + implements HasComponents { /** * The root component implementing the custom component. @@ -53,7 +53,7 @@ public abstract class CustomField extends AbstractField implements /** * Constructs a new custom field. - * + * *

          * The component is implemented by wrapping the methods of the composition * root component given as parameter. The composition root must be set @@ -68,7 +68,7 @@ public abstract class CustomField extends AbstractField implements /** * Constructs the content and notifies it that the {@link CustomField} is * attached to a window. - * + * * @see com.vaadin.ui.Component#attach() */ @Override @@ -84,7 +84,7 @@ public abstract class CustomField extends AbstractField implements /** * Returns the content (UI) of the custom component. - * + * * @return Component */ protected Component getContent() { @@ -98,11 +98,11 @@ public abstract class CustomField extends AbstractField implements /** * Create the content component or layout for the field. Subclasses of * {@link CustomField} should implement this method. - * + * * Note that this method is called when the CustomField is attached to a * layout or when {@link #getContent()} is called explicitly for the first * time. It is only called once for a {@link CustomField}. - * + * * @return {@link Component} representing the UI of the CustomField */ protected abstract Component initContent(); @@ -125,8 +125,8 @@ public abstract class CustomField extends AbstractField implements // ComponentContainer methods - private class ComponentIterator implements Iterator, - Serializable { + private class ComponentIterator + implements Iterator, Serializable { boolean first = (root != null); @Override diff --git a/server/src/main/java/com/vaadin/ui/CustomLayout.java b/server/src/main/java/com/vaadin/ui/CustomLayout.java index d64f70e95e..2095d6628d 100644 --- a/server/src/main/java/com/vaadin/ui/CustomLayout.java +++ b/server/src/main/java/com/vaadin/ui/CustomLayout.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -42,7 +42,7 @@ import com.vaadin.ui.declarative.DesignContext; * adapter and theme are responsible for rendering the layout with a given style * by placing the items in the defined locations. *

          - * + * *

          * The placement of the locations is not fixed - different themes can define the * locations in a way that is suitable for them. One typical example would be to @@ -50,12 +50,12 @@ import com.vaadin.ui.declarative.DesignContext; * would define locations for "menu", "body", and "title", for example. The * layout would then be implemented as an HTML template for each theme. *

          - * + * *

          * The default theme handles the styles that are not defined by drawing the * subcomponents just as in OrderedLayout. *

          - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -74,7 +74,7 @@ public class CustomLayout extends AbstractLayout implements LegacyComponent { * for setting the appropriate fields. Either * {@link #setTemplateName(String)}, that makes layout fetch the template * from theme, or {@link #setTemplateContents(String)}. - * + * * @since 7.5.0 */ public CustomLayout() { @@ -83,7 +83,7 @@ public class CustomLayout extends AbstractLayout implements LegacyComponent { /** * Constructs a custom layout with the template given in the stream. - * + * * @param templateStream * Stream containing template data. Must be using UTF-8 encoding. * To use a String as a template use for instance new @@ -108,8 +108,8 @@ public class CustomLayout extends AbstractLayout implements LegacyComponent { protected void initTemplateContentsFromInputStream( InputStream templateStream) throws IOException { - BufferedReader reader = new BufferedReader(new InputStreamReader( - templateStream, "UTF-8")); + BufferedReader reader = new BufferedReader( + new InputStreamReader(templateStream, "UTF-8")); StringBuilder builder = new StringBuilder(BUFFER_SIZE); try { char[] cbuf = new char[BUFFER_SIZE]; @@ -137,7 +137,7 @@ public class CustomLayout extends AbstractLayout implements LegacyComponent { /** * Adds the component into this container to given location. If the location * is already populated, the old component is removed. - * + * * @param c * the component to be added. * @param location @@ -159,7 +159,7 @@ public class CustomLayout extends AbstractLayout implements LegacyComponent { * specifying the location (empty string is then used as location). Only one * component can be added to the default "" location and adding more * components into that location overwrites the old components. - * + * * @param c * the component to be added. */ @@ -170,7 +170,7 @@ public class CustomLayout extends AbstractLayout implements LegacyComponent { /** * Removes the component from this container. - * + * * @param c * the component to be removed. */ @@ -186,7 +186,7 @@ public class CustomLayout extends AbstractLayout implements LegacyComponent { /** * Removes the component from this container from given location. - * + * * @param location * the Location identifier of the component. */ @@ -197,7 +197,7 @@ public class CustomLayout extends AbstractLayout implements LegacyComponent { /** * Gets the component container iterator for going trough all the components * in the container. - * + * * @return the Iterator of the components inside the container. */ @Override @@ -208,7 +208,7 @@ public class CustomLayout extends AbstractLayout implements LegacyComponent { /** * Gets the number of contained components. Consistent with the iterator * returned by {@link #getComponentIterator()}. - * + * * @return the number of contained components */ @Override @@ -218,7 +218,7 @@ public class CustomLayout extends AbstractLayout implements LegacyComponent { /** * Gets the child-component by its location. - * + * * @param location * the name of the location where the requested component * resides. @@ -230,12 +230,14 @@ public class CustomLayout extends AbstractLayout implements LegacyComponent { /* Documented in superclass */ @Override - public void replaceComponent(Component oldComponent, Component newComponent) { + public void replaceComponent(Component oldComponent, + Component newComponent) { // Gets the locations String oldLocation = null; String newLocation = null; - for (final Iterator i = slots.keySet().iterator(); i.hasNext();) { + for (final Iterator i = slots.keySet().iterator(); i + .hasNext();) { final String location = i.next(); final Component component = slots.get(location); if (component == oldComponent) { @@ -271,11 +273,11 @@ public class CustomLayout extends AbstractLayout implements LegacyComponent { /** * Set the name of the template used to draw custom layout. - * + * * With GWT-adapter, the template with name 'templatename' is loaded from * VAADIN/themes/themename/layouts/templatename.html. If the theme has not * been set (with Application.setTheme()), themename is 'default'. - * + * * @param templateName */ public void setTemplateName(String templateName) { @@ -285,7 +287,7 @@ public class CustomLayout extends AbstractLayout implements LegacyComponent { /** * Set the contents of the template used to draw the custom layout. - * + * * @param templateContents */ public void setTemplateContents(String templateContents) { diff --git a/server/src/main/java/com/vaadin/ui/DateField.java b/server/src/main/java/com/vaadin/ui/DateField.java index 82bd10178a..4e005a5c3f 100644 --- a/server/src/main/java/com/vaadin/ui/DateField.java +++ b/server/src/main/java/com/vaadin/ui/DateField.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -60,7 +60,7 @@ import com.vaadin.ui.declarative.DesignContext; * {@link com.vaadin.ui.AbstractField#setWriteThrough(boolean)}must be called to * enable buffering. *

          - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -70,7 +70,7 @@ public class DateField extends AbstractField implements /** * Resolution identifier: seconds. - * + * * @deprecated As of 7.0, use {@link Resolution#SECOND} */ @Deprecated @@ -78,7 +78,7 @@ public class DateField extends AbstractField implements /** * Resolution identifier: minutes. - * + * * @deprecated As of 7.0, use {@link Resolution#MINUTE} */ @Deprecated @@ -86,7 +86,7 @@ public class DateField extends AbstractField implements /** * Resolution identifier: hours. - * + * * @deprecated As of 7.0, use {@link Resolution#HOUR} */ @Deprecated @@ -94,7 +94,7 @@ public class DateField extends AbstractField implements /** * Resolution identifier: days. - * + * * @deprecated As of 7.0, use {@link Resolution#DAY} */ @Deprecated @@ -102,7 +102,7 @@ public class DateField extends AbstractField implements /** * Resolution identifier: months. - * + * * @deprecated As of 7.0, use {@link Resolution#MONTH} */ @Deprecated @@ -110,7 +110,7 @@ public class DateField extends AbstractField implements /** * Resolution identifier: years. - * + * * @deprecated As of 7.0, use {@link Resolution#YEAR} */ @Deprecated @@ -184,7 +184,7 @@ public class DateField extends AbstractField implements /** * Constructs an empty DateField with caption. - * + * * @param caption * the caption of the datefield. */ @@ -195,7 +195,7 @@ public class DateField extends AbstractField implements /** * Constructs a new DateField that's bound to the specified * Property and has the given caption String. - * + * * @param caption * the caption String for the editor. * @param dataSource @@ -209,15 +209,15 @@ public class DateField extends AbstractField implements /** * Constructs a new DateField that's bound to the specified * Property and has no caption. - * + * * @param dataSource * the Property to be edited with this editor. */ public DateField(Property dataSource) throws IllegalArgumentException { if (!Date.class.isAssignableFrom(dataSource.getType())) { - throw new IllegalArgumentException("Can't use " - + dataSource.getType().getName() - + " typed property as datasource"); + throw new IllegalArgumentException( + "Can't use " + dataSource.getType().getName() + + " typed property as datasource"); } setPropertyDataSource(dataSource); @@ -229,7 +229,7 @@ public class DateField extends AbstractField implements * to a Property unless * {@link com.vaadin.data.Property.Viewer#setPropertyDataSource(Property)} * is called to bind it. - * + * * @param caption * the caption String for the editor. * @param value @@ -311,7 +311,7 @@ public class DateField extends AbstractField implements * date (taking the resolution into account), the component will not * validate. If startDate is set to null, any * value before endDate will be accepted by the range - * + * * @param startDate * - the allowed range's start date */ @@ -324,14 +324,14 @@ public class DateField extends AbstractField implements // Create a defensive copy against issues when using java.sql.Date (and // also against mutable Date). - getState().rangeStart = startDate != null ? new Date( - startDate.getTime()) : null; + getState().rangeStart = startDate != null + ? new Date(startDate.getTime()) : null; updateRangeValidator(); } /** * Sets the current error message if the range validation fails. - * + * * @param dateOutOfRangeMessage * - Localizable message which is shown when value (the date) is * set outside allowed range @@ -347,7 +347,7 @@ public class DateField extends AbstractField implements * to YEAR, any date in year n will be accepted. Resolutions lower than DAY * will be interpreted on a DAY level. That is, everything below DATE is * cleared - * + * * @param forResolution * - the range conforms to the resolution * @return @@ -386,7 +386,7 @@ public class DateField extends AbstractField implements * if rangeStart is set to one millisecond before year n and * resolution is set to YEAR, any date in year n - 1 will be accepted. * Lowest supported resolution is DAY. - * + * * @param forResolution * - the range conforms to the resolution * @return @@ -431,7 +431,7 @@ public class DateField extends AbstractField implements * date (taking the resolution into account), the component will not * validate. If endDate is set to null, any value * after startDate will be accepted by the range. - * + * * @param endDate * - the allowed range's end date (inclusive, based on the * current resolution) @@ -452,9 +452,9 @@ public class DateField extends AbstractField implements /** * Returns the precise rangeStart used. - * + * * @param startDate - * + * */ public Date getRangeStart() { return getState(false).rangeStart; @@ -462,7 +462,7 @@ public class DateField extends AbstractField implements /** * Returns the precise rangeEnd used. - * + * * @param startDate */ public Date getRangeEnd() { @@ -477,15 +477,12 @@ public class DateField extends AbstractField implements @Override public void changeVariables(Object source, Map variables) { - if (!isReadOnly() - && (variables.containsKey("year") - || variables.containsKey("month") - || variables.containsKey("day") - || variables.containsKey("hour") - || variables.containsKey("min") - || variables.containsKey("sec") - || variables.containsKey("msec") || variables - .containsKey("dateString"))) { + if (!isReadOnly() && (variables.containsKey("year") + || variables.containsKey("month") + || variables.containsKey("day") || variables.containsKey("hour") + || variables.containsKey("min") || variables.containsKey("sec") + || variables.containsKey("msec") + || variables.containsKey("dateString"))) { // Old and new dates final Date oldDate = getValue(); @@ -543,7 +540,8 @@ public class DateField extends AbstractField implements newDate = cal.getTime(); } - if (newDate == null && dateString != null && !"".equals(dateString)) { + if (newDate == null && dateString != null + && !"".equals(dateString)) { try { Date parsedDate = handleUnparsableDateString(dateString); setValue(parsedDate, true); @@ -606,7 +604,7 @@ public class DateField extends AbstractField implements * also checks the parsingSucceeded flag, we must also * notify the form (if this is used in one) that the * validity of this field has changed. - * + * * Normally fields validity doesn't change without value * change and form depends on this implementation detail. */ @@ -643,7 +641,8 @@ public class DateField extends AbstractField implements // If the user entered an invalid value in the date field // getInternalValue() returns null. // If the datasource also contains null, then - // updateValueFromDataSource() will then not clear the internal state + // updateValueFromDataSource() will then not clear the internal + // state // and error indicators (ticket #8069). setInternalValue(null); } else { @@ -665,13 +664,13 @@ public class DateField extends AbstractField implements /** * This method is called to handle a non-empty date string from the client * if the client could not parse it as a Date. - * + * * By default, a Converter.ConversionException is thrown, and the current * value is not modified. - * + * * This can be overridden to handle conversions, to return null (equivalent * to empty input), to throw an exception or to fire an event. - * + * * @param dateString * @return parsed Date * @throws Converter.ConversionException @@ -696,7 +695,7 @@ public class DateField extends AbstractField implements /* * (non-Javadoc) - * + * * @see com.vaadin.ui.AbstractField#setValue(java.lang.Object, boolean) */ @Override @@ -721,7 +720,7 @@ public class DateField extends AbstractField implements * datefields validity may change although the logical value does * not change. This is an issue for Form which expects that validity * of Fields cannot change unless actual value changes. - * + * * So we check if this field is inside a form and the form has * registered this as a field. In this case we repaint the form. * Without this hacky solution the form might not be able to clean @@ -790,7 +789,7 @@ public class DateField extends AbstractField implements /** * Gets the resolution. - * + * * @return int */ public Resolution getResolution() { @@ -799,9 +798,9 @@ public class DateField extends AbstractField implements /** * Sets the resolution of the DateField. - * + * * The default resolution is {@link Resolution#DAY} since Vaadin 7.0. - * + * * @param resolution * the resolution to set. */ @@ -813,13 +812,13 @@ public class DateField extends AbstractField implements /** * Returns new instance calendar used in Date conversions. - * + * * Returns new clone of the calendar object initialized using the the * current date (if available) - * + * * If this is no calendar is assigned the Calendar.getInstance * is used. - * + * * @return the Calendar. * @see #setCalendar(Calendar) */ @@ -831,7 +830,8 @@ public class DateField extends AbstractField implements // Start by a zeroed calendar to avoid having values for lower // resolution variables e.g. time when resolution is day int min, field; - for (Resolution r : Resolution.getResolutionsLowerThan(resolution)) { + for (Resolution r : Resolution + .getResolutionsLowerThan(resolution)) { field = r.getCalendarField(); min = calendar.getActualMinimum(field); calendar.set(field, min); @@ -857,14 +857,14 @@ public class DateField extends AbstractField implements /** * Sets formatting used by some component implementations. See * {@link SimpleDateFormat} for format details. - * + * * By default it is encouraged to used default formatting defined by Locale, * but due some JVM bugs it is sometimes necessary to use this method to * override formatting. See Vaadin issue #2200. - * + * * @param dateFormat * the dateFormat to set - * + * * @see com.vaadin.ui.AbstractComponent#setLocale(Locale)) */ public void setDateFormat(String dateFormat) { @@ -875,7 +875,7 @@ public class DateField extends AbstractField implements /** * Returns a format string used to format date value on client side or null * if default formatting from {@link Component#getLocale()} is used. - * + * * @return the dateFormat */ public String getDateFormat() { @@ -885,10 +885,10 @@ public class DateField extends AbstractField implements /** * Specifies whether or not date/time interpretation in component is to be * lenient. - * + * * @see Calendar#setLenient(boolean) * @see #isLenient() - * + * * @param lenient * true if the lenient mode is to be turned on; false if it is to * be turned off. @@ -900,9 +900,9 @@ public class DateField extends AbstractField implements /** * Returns whether date/time interpretation is to be lenient. - * + * * @see #setLenient(boolean) - * + * * @return true if the interpretation mode of this calendar is lenient; * false otherwise. */ @@ -973,7 +973,7 @@ public class DateField extends AbstractField implements /** * Checks whether ISO 8601 week numbers are shown in the date selector. - * + * * @return true if week numbers are shown, false otherwise. */ public boolean isShowISOWeekNumbers() { @@ -984,7 +984,7 @@ public class DateField extends AbstractField implements * Sets the visibility of ISO 8601 week numbers in the date selector. ISO * 8601 defines that a week always starts with a Monday so the week numbers * are only shown if this is the case. - * + * * @param showWeekNumbers * true if week numbers should be shown, false otherwise. */ @@ -998,7 +998,7 @@ public class DateField extends AbstractField implements * not empty. Note that DateField is considered empty (value == null) and * invalid if it contains text typed in by the user that couldn't be parsed * into a Date value. - * + * * @see com.vaadin.ui.AbstractField#validate() */ @Override @@ -1021,9 +1021,9 @@ public class DateField extends AbstractField implements * custom exception, the message returned by * {@link Exception#getLocalizedMessage()} will be used instead of the value * returned by this method. - * + * * @see #setParseErrorMessage(String) - * + * * @return the error message that the DateField uses when it can't parse the * textual input from user to a Date object */ @@ -1036,7 +1036,7 @@ public class DateField extends AbstractField implements * text input by user to a Date field. Note that if the * {@link #handleUnparsableDateString(String)} method is overridden, the * localized message from its exception is used. - * + * * @see #getParseErrorMessage() * @see #handleUnparsableDateString(String) * @param parsingErrorMessage @@ -1049,10 +1049,10 @@ public class DateField extends AbstractField implements * Sets the time zone used by this date field. The time zone is used to * convert the absolute time in a Date object to a logical time displayed in * the selector and to convert the select time back to a Date object. - * + * * If no time zone has been set, the current default time zone returned by * {@code TimeZone.getDefault()} is used. - * + * * @see #getTimeZone() * @param timeZone * the time zone to use for time calculations. @@ -1066,18 +1066,18 @@ public class DateField extends AbstractField implements * Gets the time zone used by this field. The time zone is used to convert * the absolute time in a Date object to a logical time displayed in the * selector and to convert the select time back to a Date object. - * + * * If {@code null} is returned, the current default time zone returned by * {@code TimeZone.getDefault()} is used. - * + * * @return the current time zone */ public TimeZone getTimeZone() { return timeZone; } - public static class UnparsableDateString extends - Validator.InvalidValueException { + public static class UnparsableDateString + extends Validator.InvalidValueException { public UnparsableDateString(String message) { super(message); @@ -1089,8 +1089,8 @@ public class DateField extends AbstractField implements public void readDesign(Element design, DesignContext designContext) { super.readDesign(design, designContext); if (design.hasAttr("value") && !design.attr("value").isEmpty()) { - Date date = DesignAttributeHandler.getFormatter().parse( - design.attr("value"), Date.class); + Date date = DesignAttributeHandler.getFormatter() + .parse(design.attr("value"), Date.class); // formatting will return null if it cannot parse the string if (date == null) { Logger.getLogger(DateField.class.getName()).info( @@ -1111,7 +1111,7 @@ public class DateField extends AbstractField implements /** * Returns current date-out-of-range error message. - * + * * @see #setDateOutOfRangeMessage(String) * @since 7.4 * @return Current error message for dates out of range. diff --git a/server/src/main/java/com/vaadin/ui/DefaultFieldFactory.java b/server/src/main/java/com/vaadin/ui/DefaultFieldFactory.java index 535943bcd5..c8a5c241e9 100644 --- a/server/src/main/java/com/vaadin/ui/DefaultFieldFactory.java +++ b/server/src/main/java/com/vaadin/ui/DefaultFieldFactory.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -26,19 +26,20 @@ import com.vaadin.shared.util.SharedUtil; * This class contains a basic implementation for both {@link FormFieldFactory} * and {@link TableFieldFactory}. The class is singleton, use {@link #get()} * method to get reference to the instance. - * + * *

          * There are also some static helper methods available for custom built field * factories. - * + * */ -public class DefaultFieldFactory implements FormFieldFactory, TableFieldFactory { +public class DefaultFieldFactory + implements FormFieldFactory, TableFieldFactory { private static final DefaultFieldFactory instance = new DefaultFieldFactory(); /** * Singleton method to get an instance of DefaultFieldFactory. - * + * * @return an instance of DefaultFieldFactory */ public static DefaultFieldFactory get() { @@ -71,7 +72,7 @@ public class DefaultFieldFactory implements FormFieldFactory, TableFieldFactory /** * If name follows method naming conventions, convert the name to spaced * upper case text. For example, convert "firstName" to "First Name" - * + * * @param propertyId * @return the formatted caption string */ @@ -90,7 +91,7 @@ public class DefaultFieldFactory implements FormFieldFactory, TableFieldFactory * Item: {@link Form}.
          * default field type: {@link TextField}. *

          - * + * * @param type * the type of the property * @return the most suitable generic {@link Field} for given type diff --git a/server/src/main/java/com/vaadin/ui/DragAndDropWrapper.java b/server/src/main/java/com/vaadin/ui/DragAndDropWrapper.java index 29179ddca7..82a78b344c 100644 --- a/server/src/main/java/com/vaadin/ui/DragAndDropWrapper.java +++ b/server/src/main/java/com/vaadin/ui/DragAndDropWrapper.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -44,8 +44,8 @@ import com.vaadin.shared.ui.draganddropwrapper.DragAndDropWrapperServerRpc; import com.vaadin.ui.declarative.DesignContext; @SuppressWarnings("serial") -public class DragAndDropWrapper extends CustomComponent implements DropTarget, - DragSource, LegacyComponent { +public class DragAndDropWrapper extends CustomComponent + implements DropTarget, DragSource, LegacyComponent { public class WrapperTransferable extends TransferableImpl { @@ -73,7 +73,7 @@ public class DragAndDropWrapper extends CustomComponent implements DropTarget, /** * The component in wrapper that is being dragged or null if the * transferable is not a component (most likely an html5 drag). - * + * * @return */ public Component getDraggedComponent() { @@ -136,7 +136,7 @@ public class DragAndDropWrapper extends CustomComponent implements DropTarget, } /** - * + * * @return the absolute position of wrapper on the page */ public Integer getAbsoluteTop() { @@ -177,7 +177,7 @@ public class DragAndDropWrapper extends CustomComponent implements DropTarget, WRAPPER, /** * The whole wrapper is used to start an HTML5 drag. - * + * * NOTE: In Internet Explorer 6 to 8, this prevents user interactions * with the wrapper's contents. For example, clicking a button inside * the wrapper will no longer work. @@ -200,7 +200,7 @@ public class DragAndDropWrapper extends CustomComponent implements DropTarget, /** * This is an internal constructor. Use * {@link DragAndDropWrapper#DragAndDropWrapper(Component)} instead. - * + * * @since 7.5.0 */ @Deprecated @@ -211,7 +211,7 @@ public class DragAndDropWrapper extends CustomComponent implements DropTarget, /** * Wraps given component in a {@link DragAndDropWrapper}. - * + * * @param root * the component to be wrapped */ @@ -224,7 +224,7 @@ public class DragAndDropWrapper extends CustomComponent implements DropTarget, * Sets data flavors available in the DragAndDropWrapper is used to start an * HTML5 style drags. Most commonly the "Text" flavor should be set. * Multiple data types can be set. - * + * * @param type * the string identifier of the drag "payload". E.g. "Text" or * "text/html" @@ -279,7 +279,7 @@ public class DragAndDropWrapper extends CustomComponent implements DropTarget, * We want to avoid a new ProxyReceiver to be made since * it'll get a new URL, so we need to keep extra track * on what has been sent. - * + * * See #12330. */ sentIds.add(id); @@ -318,7 +318,8 @@ public class DragAndDropWrapper extends CustomComponent implements DropTarget, } @Override - public Transferable getTransferable(final Map rawVariables) { + public Transferable getTransferable( + final Map rawVariables) { return new WrapperTransferable(this, rawVariables); } @@ -334,7 +335,7 @@ public class DragAndDropWrapper extends CustomComponent implements DropTarget, /** * Sets the component that will be used as the drag image. Only used when * wrapper is set to {@link DragStartMode#COMPONENT_OTHER} - * + * * @param dragImageComponent */ public void setDragImageComponent(Component dragImageComponent) { @@ -345,7 +346,7 @@ public class DragAndDropWrapper extends CustomComponent implements DropTarget, /** * Gets the component that will be used as the drag image. Only used when * wrapper is set to {@link DragStartMode#COMPONENT_OTHER} - * + * * @return null if no component is set. */ public Component getDragImageComponent() { @@ -379,16 +380,16 @@ public class DragAndDropWrapper extends CustomComponent implements DropTarget, @Override public void onProgress(StreamingProgressEvent event) { - file.getStreamVariable().onProgress( - new ReceivingEventWrapper(event)); + file.getStreamVariable() + .onProgress(new ReceivingEventWrapper(event)); } @Override public void streamingStarted(StreamingStartEvent event) { listenProgressOfUploadedFile = file.getStreamVariable() != null; if (listenProgressOfUploadedFile) { - file.getStreamVariable().streamingStarted( - new ReceivingEventWrapper(event)); + file.getStreamVariable() + .streamingStarted(new ReceivingEventWrapper(event)); } // no need tell to the client about this receiver on next paint receivers.remove(id); @@ -401,16 +402,16 @@ public class DragAndDropWrapper extends CustomComponent implements DropTarget, @Override public void streamingFinished(StreamingEndEvent event) { if (listenProgressOfUploadedFile) { - file.getStreamVariable().streamingFinished( - new ReceivingEventWrapper(event)); + file.getStreamVariable() + .streamingFinished(new ReceivingEventWrapper(event)); } } @Override public void streamingFailed(final StreamingErrorEvent event) { if (listenProgressOfUploadedFile) { - file.getStreamVariable().streamingFailed( - new ReceivingEventWrapper(event)); + file.getStreamVariable() + .streamingFailed(new ReceivingEventWrapper(event)); } } diff --git a/server/src/main/java/com/vaadin/ui/Embedded.java b/server/src/main/java/com/vaadin/ui/Embedded.java index d83eef9c4d..8431faa83a 100644 --- a/server/src/main/java/com/vaadin/ui/Embedded.java +++ b/server/src/main/java/com/vaadin/ui/Embedded.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -42,10 +42,10 @@ import com.vaadin.shared.ui.embedded.EmbeddedServerRpc; * Adobe Flash objects, and embedded web pages. This use of the component is * deprecated in Vaadin 7; the {@link Image}, {@link Flash}, and * {@link BrowserFrame} components should be used instead, respectively. - * + * * @see Video * @see Audio - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -59,7 +59,7 @@ public class Embedded extends AbstractComponent implements LegacyComponent { /** * Image types. - * + * * @deprecated As of 7.0, use the {@link Image} component instead. */ @Deprecated @@ -67,7 +67,7 @@ public class Embedded extends AbstractComponent implements LegacyComponent { /** * Browser ("iframe") type. - * + * * @deprecated As of 7.0, use the {@link BrowserFrame} component instead. */ @Deprecated @@ -119,7 +119,7 @@ public class Embedded extends AbstractComponent implements LegacyComponent { /** * Creates a new empty Embedded object with caption. - * + * * @param caption */ public Embedded(String caption) { @@ -131,7 +131,7 @@ public class Embedded extends AbstractComponent implements LegacyComponent { * Creates a new Embedded object whose contents is loaded from given * resource. The dimensions are assumed if possible. The type is guessed * from resource. - * + * * @param caption * @param source * the Source of the embedded object. @@ -199,7 +199,7 @@ public class Embedded extends AbstractComponent implements LegacyComponent { * presented instead of this component's normal content, for accessibility * purposes. Does not work when {@link #setType(int)} has been called with * {@link #TYPE_BROWSER}. - * + * * @param altText * A short, human-readable description of this component's * content. @@ -215,7 +215,7 @@ public class Embedded extends AbstractComponent implements LegacyComponent { /** * Gets this component's "alt-text". - * + * * @see #setAlternateText(String) */ public String getAlternateText() { @@ -227,7 +227,7 @@ public class Embedded extends AbstractComponent implements LegacyComponent { * are passed to the instantiated object. Parameters are are stored as name * value pairs. This overrides the previous value assigned to this * parameter. - * + * * @param name * the name of the parameter. * @param value @@ -242,7 +242,7 @@ public class Embedded extends AbstractComponent implements LegacyComponent { * Gets the value of an object parameter. Parameters are optional * information, and they are passed to the instantiated object. Parameters * are are stored as name value pairs. - * + * * @return the Value of parameter or null if not found. */ public String getParameter(String name) { @@ -251,7 +251,7 @@ public class Embedded extends AbstractComponent implements LegacyComponent { /** * Removes an object parameter from the list. - * + * * @param name * the name of the parameter to remove. */ @@ -262,7 +262,7 @@ public class Embedded extends AbstractComponent implements LegacyComponent { /** * Gets the embedded object parameter names. - * + * * @return the Iterator of parameters names. */ public Iterator getParameterNames() { @@ -273,7 +273,7 @@ public class Embedded extends AbstractComponent implements LegacyComponent { * This attribute specifies the base path used to resolve relative URIs * specified by the classid, data, and archive attributes. When absent, its * default value is the base URI of the current document. - * + * * @return the code base. */ public String getCodebase() { @@ -282,7 +282,7 @@ public class Embedded extends AbstractComponent implements LegacyComponent { /** * Gets the MIME-Type of the code. - * + * * @return the MIME-Type of the code. */ public String getCodetype() { @@ -291,7 +291,7 @@ public class Embedded extends AbstractComponent implements LegacyComponent { /** * Gets the MIME-Type of the object. - * + * * @return the MIME-Type of the object. */ public String getMimeType() { @@ -301,7 +301,7 @@ public class Embedded extends AbstractComponent implements LegacyComponent { /** * This attribute specifies a message that a user agent may render while * loading the object's implementation and data. - * + * * @return The text displayed when loading */ public String getStandby() { @@ -312,7 +312,7 @@ public class Embedded extends AbstractComponent implements LegacyComponent { * This attribute specifies the base path used to resolve relative URIs * specified by the classid, data, and archive attributes. When absent, its * default value is the base URI of the current document. - * + * * @param codebase * The base path */ @@ -330,7 +330,7 @@ public class Embedded extends AbstractComponent implements LegacyComponent { * but recommended when classid is specified since it allows the user agent * to avoid loading information for unsupported content types. When absent, * it defaults to the value of the type attribute. - * + * * @param codetype * the codetype to set. */ @@ -344,7 +344,7 @@ public class Embedded extends AbstractComponent implements LegacyComponent { /** * Sets the mimeType, the MIME-Type of the object. - * + * * @param mimeType * the mimeType to set. */ @@ -370,7 +370,7 @@ public class Embedded extends AbstractComponent implements LegacyComponent { /** * This attribute specifies a message that a user agent may render while * loading the object's implementation and data. - * + * * @param standby * The text to display while loading */ @@ -385,7 +385,7 @@ public class Embedded extends AbstractComponent implements LegacyComponent { /** * This attribute may be used to specify the location of an object's * implementation via a URI. - * + * * @return the classid. */ public String getClassId() { @@ -395,7 +395,7 @@ public class Embedded extends AbstractComponent implements LegacyComponent { /** * This attribute may be used to specify the location of an object's * implementation via a URI. - * + * * @param classId * the classId to set. */ @@ -409,7 +409,7 @@ public class Embedded extends AbstractComponent implements LegacyComponent { /** * Gets the resource contained in the embedded object. - * + * * @return the Resource */ public Resource getSource() { @@ -425,7 +425,7 @@ public class Embedded extends AbstractComponent implements LegacyComponent { *

        • TYPE_IMAGE * *

          - * + * * @return the type. */ public int getType() { @@ -435,7 +435,7 @@ public class Embedded extends AbstractComponent implements LegacyComponent { /** * Sets the object source resource. The dimensions are assumed if possible. * The type is guessed from resource. - * + * * @param source * the source to set. */ @@ -470,7 +470,7 @@ public class Embedded extends AbstractComponent implements LegacyComponent { *
        • {@link #TYPE_BROWSER} (Deprecated) * *

          - * + * * @param type * the type to set. */ @@ -491,7 +491,7 @@ public class Embedded extends AbstractComponent implements LegacyComponent { * archives will generally result in reduced load times for objects. * Archives specified as relative URIs should be interpreted relative to the * codebase attribute. - * + * * @return Space-separated list of URIs with resources relevant to the * object */ @@ -506,7 +506,7 @@ public class Embedded extends AbstractComponent implements LegacyComponent { * archives will generally result in reduced load times for objects. * Archives specified as relative URIs should be interpreted relative to the * codebase attribute. - * + * * @param archive * Space-separated list of URIs with resources relevant to the * object @@ -523,9 +523,9 @@ public class Embedded extends AbstractComponent implements LegacyComponent { * Add a click listener to the component. The listener is called whenever * the user clicks inside the component. Depending on the content the event * may be blocked and in that case no event is fired. - * + * * Use {@link #removeListener(ClickListener)} to remove the listener. - * + * * @param listener * The listener to add */ @@ -546,7 +546,7 @@ public class Embedded extends AbstractComponent implements LegacyComponent { /** * Remove a click listener from the component. The listener should earlier * have been added using {@link #addListener(ClickListener)}. - * + * * @param listener * The listener to remove */ diff --git a/server/src/main/java/com/vaadin/ui/Field.java b/server/src/main/java/com/vaadin/ui/Field.java index 8a9acd570f..dbcfe69c7f 100644 --- a/server/src/main/java/com/vaadin/ui/Field.java +++ b/server/src/main/java/com/vaadin/ui/Field.java @@ -90,8 +90,8 @@ public interface Field extends Component, BufferedValidatable, Property, * @since 3.0 */ @SuppressWarnings("serial") - public static class ValueChangeEvent extends Component.Event implements - Property.ValueChangeEvent { + public static class ValueChangeEvent extends Component.Event + implements Property.ValueChangeEvent { /** * Constructs a new event object with the specified source field object. @@ -116,10 +116,10 @@ public interface Field extends Component, BufferedValidatable, Property, /** * Is the field empty? - * + * * In general, "empty" state is same as null. As an exception, TextField * also treats empty string as "empty". - * + * * @since 7.4 * @return true if the field is empty, false otherwise */ @@ -130,7 +130,7 @@ public interface Field extends Component, BufferedValidatable, Property, *

          * The field value is typically reset to the initial value of the field. * Calling {@link #isEmpty()} on a cleared field must always returns true. - * + * * @since 7.4 */ public void clear(); diff --git a/server/src/main/java/com/vaadin/ui/Flash.java b/server/src/main/java/com/vaadin/ui/Flash.java index 6e99d2fe35..f569b9ad16 100644 --- a/server/src/main/java/com/vaadin/ui/Flash.java +++ b/server/src/main/java/com/vaadin/ui/Flash.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -28,10 +28,9 @@ import com.vaadin.ui.declarative.DesignContext; /** * A component for displaying Adobe® Flash® content. - * + * * @author Vaadin Ltd. - * @version - * @VERSION@ + * @version @VERSION@ * @since 7.0 */ @SuppressWarnings("serial") @@ -46,7 +45,7 @@ public class Flash extends AbstractEmbedded { /** * Creates a new empty Flash component with the given caption - * + * * @param caption * The caption for the component */ @@ -56,7 +55,7 @@ public class Flash extends AbstractEmbedded { /** * Creates a new Flash component with the given caption and content. - * + * * @param caption * The caption for the component * @param source @@ -82,13 +81,13 @@ public class Flash extends AbstractEmbedded { * This attribute specifies the base path used to resolve relative URIs * specified by the classid, data, and archive attributes. When absent, its * default value is the base URI of the current document. - * + * * @param codebase * The base path */ public void setCodebase(String codebase) { - if (codebase != getState().codebase - || (codebase != null && !codebase.equals(getState().codebase))) { + if (codebase != getState().codebase || (codebase != null + && !codebase.equals(getState().codebase))) { getState().codebase = codebase; requestRepaint(); } @@ -96,7 +95,7 @@ public class Flash extends AbstractEmbedded { /** * Returns the codebase. - * + * * @see #setCodebase(String) * @since 7.4.1 * @return Current codebase. @@ -111,13 +110,13 @@ public class Flash extends AbstractEmbedded { * but recommended when classid is specified since it allows the user agent * to avoid loading information for unsupported content types. When absent, * it defaults to the value of the type attribute. - * + * * @param codetype * the codetype to set. */ public void setCodetype(String codetype) { - if (codetype != getState().codetype - || (codetype != null && !codetype.equals(getState().codetype))) { + if (codetype != getState().codetype || (codetype != null + && !codetype.equals(getState().codetype))) { getState().codetype = codetype; requestRepaint(); } @@ -125,7 +124,7 @@ public class Flash extends AbstractEmbedded { /** * Returns the current codetype. - * + * * @see #setCodetype(String) * @since 7.4.1 * @return Current codetype. @@ -141,7 +140,7 @@ public class Flash extends AbstractEmbedded { * archives will generally result in reduced load times for objects. * Archives specified as relative URIs should be interpreted relative to the * codebase attribute. - * + * * @param archive * Space-separated list of URIs with resources relevant to the * object @@ -156,7 +155,7 @@ public class Flash extends AbstractEmbedded { /** * Returns current archive. - * + * * @see #setArchive(String) * @since 7.4.1 * @return Current archive. @@ -167,7 +166,7 @@ public class Flash extends AbstractEmbedded { /** * Sets standby. - * + * * @param standby * Standby string. */ @@ -181,7 +180,7 @@ public class Flash extends AbstractEmbedded { /** * Returns standby. - * + * * @since 7.4.1 * @return Standby string. */ @@ -194,7 +193,7 @@ public class Flash extends AbstractEmbedded { * are passed to the instantiated object. Parameters are are stored as name * value pairs. This overrides the previous value assigned to this * parameter. - * + * * @param name * the name of the parameter. * @param value @@ -212,17 +211,17 @@ public class Flash extends AbstractEmbedded { * Gets the value of an object parameter. Parameters are optional * information, and they are passed to the instantiated object. Parameters * are are stored as name value pairs. - * + * * @return the Value of parameter or null if not found. */ public String getParameter(String name) { - return getState(false).embedParams != null ? getState(false).embedParams - .get(name) : null; + return getState(false).embedParams != null + ? getState(false).embedParams.get(name) : null; } /** * Removes an object parameter from the list. - * + * * @param name * the name of the parameter to remove. */ @@ -246,14 +245,14 @@ public class Flash extends AbstractEmbedded { Collections.sort(paramNames); for (String param : paramNames) { - design.appendElement("parameter").attr("name", param) - .attr("value", getParameter(param)); + design.appendElement("parameter").attr("name", param).attr("value", + getParameter(param)); } } /** * Returns an iterable with declared parameter names. - * + * * @see #setParameter(String, String) * @see #getParameter(String) * @since 7.4.1 diff --git a/server/src/main/java/com/vaadin/ui/Form.java b/server/src/main/java/com/vaadin/ui/Form.java index 45532756e5..4926a7a429 100644 --- a/server/src/main/java/com/vaadin/ui/Form.java +++ b/server/src/main/java/com/vaadin/ui/Form.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -46,7 +46,7 @@ import com.vaadin.shared.ui.form.FormState; /** * Form component provides easy way of creating and managing sets fields. - * + * *

          * Form is a container for fields implementing {@link Field} * interface. It provides support for any layouts and provides buffering @@ -55,7 +55,7 @@ import com.vaadin.shared.ui.form.FormState; * setting immediateness, etc. Also direct mechanism for replacing existing * fields with selections is given. *

          - * + * *

          * Form provides customizable editor for classes implementing * {@link com.vaadin.data.Item} interface. Also the form itself implements this @@ -69,16 +69,16 @@ import com.vaadin.shared.ui.form.FormState; * properties of any class following bean pattern, can be accessed trough * {@link com.vaadin.data.util.BeanItem}. *

          - * + * * @author Vaadin Ltd. * @since 3.0 * @deprecated As of 7.0, use {@link FieldGroup} instead of {@link Form} for * more flexibility. */ @Deprecated -public class Form extends AbstractField implements Item.Editor, - Buffered, Item, Validatable, Action.Notifier, HasComponents, - LegacyComponent { +public class Form extends AbstractField + implements Item.Editor, Buffered, Item, Validatable, Action.Notifier, + HasComponents, LegacyComponent { private Object propertyValue; @@ -125,13 +125,14 @@ public class Form extends AbstractField implements Item.Editor, /** * Form needs to repaint itself if child fields value changes due possible * change in form validity. - * + * * TODO introduce ValidityChangeEvent (#6239) and start using it instead. * See e.g. DateField#notifyFormOfValidityChange(). */ private final ValueChangeListener fieldValueChangeListener = new ValueChangeListener() { @Override - public void valueChange(com.vaadin.data.Property.ValueChangeEvent event) { + public void valueChange( + com.vaadin.data.Property.ValueChangeEvent event) { markAsDirty(); } }; @@ -155,7 +156,7 @@ public class Form extends AbstractField implements Item.Editor, /** * Constructs a new form with default layout. - * + * *

          * By default the form uses {@link FormLayout}. *

          @@ -167,7 +168,7 @@ public class Form extends AbstractField implements Item.Editor, /** * Constructs a new form with given {@link Layout}. - * + * * @param formLayout * the layout of the form. */ @@ -178,7 +179,7 @@ public class Form extends AbstractField implements Item.Editor, /** * Constructs a new form with given {@link Layout} and * {@link FormFieldFactory}. - * + * * @param formLayout * the layout of the form. * @param fieldFactory @@ -222,7 +223,7 @@ public class Form extends AbstractField implements Item.Editor, /** * The error message of a Form is the error of the first field with a * non-empty error. - * + * * Empty error messages of the contained fields are skipped, because an * empty error indicator would be confusing to the user, especially if there * are errors that have something to display. This is also the reason why @@ -236,7 +237,8 @@ public class Form extends AbstractField implements Item.Editor, // getErrorMessage() recursively instead of validate(). ErrorMessage validationError = null; if (isValidationVisible()) { - for (final Iterator i = propertyIds.iterator(); i.hasNext();) { + for (final Iterator i = propertyIds.iterator(); i + .hasNext();) { Object f = fields.get(i.next()); if (f instanceof AbstractComponent) { AbstractComponent field = (AbstractComponent) f; @@ -248,7 +250,8 @@ public class Form extends AbstractField implements Item.Editor, validationError = new UserError(field.getCaption()); } break; - } else if (f instanceof Field && !((Field) f).isValid()) { + } else if (f instanceof Field + && !((Field) f).isValid()) { // Something is wrong with the field, but no proper // error is given. Generate one. validationError = new UserError(field.getCaption()); @@ -266,24 +269,22 @@ public class Form extends AbstractField implements Item.Editor, // Throw combination of the error types return new CompositeErrorMessage( - new ErrorMessage[] { - getComponentError(), - validationError, - AbstractErrorMessage - .getErrorMessageForException(currentBufferedSourceException) }); + new ErrorMessage[] { getComponentError(), validationError, + AbstractErrorMessage.getErrorMessageForException( + currentBufferedSourceException) }); } /** * Controls the making validation visible implicitly on commit. - * + * * Having commit() call setValidationVisible(true) implicitly is the default * behaviour. You can disable the implicit setting by setting this property * as false. - * + * * It is useful, because you usually want to start with the form free of * errors and only display them after the user clicks Ok. You can disable * the implicit setting by setting this property as false. - * + * * @param makeVisible * If true (default), validation is made visible when commit() is * called. If false, the visibility is left as it is. @@ -294,9 +295,9 @@ public class Form extends AbstractField implements Item.Editor, /** * Is validation made automatically visible on commit? - * + * * See setValidationVisibleOnCommit(). - * + * * @return true if validation is made automatically visible on commit. */ public boolean isValidationVisibleOnCommit() { @@ -308,7 +309,8 @@ public class Form extends AbstractField implements Item.Editor, * use the default one from the interface. */ @Override - public void commit() throws Buffered.SourceException, InvalidValueException { + public void commit() + throws Buffered.SourceException, InvalidValueException { LinkedList problems = null; @@ -433,7 +435,8 @@ public class Form extends AbstractField implements Item.Editor, public void setBuffered(boolean buffered) { if (buffered != this.buffered) { this.buffered = buffered; - for (final Iterator i = propertyIds.iterator(); i.hasNext();) { + for (final Iterator i = propertyIds.iterator(); i + .hasNext();) { (fields.get(i.next())).setBuffered(buffered); } } @@ -441,7 +444,7 @@ public class Form extends AbstractField implements Item.Editor, /** * Adds a new property to form and create corresponding field. - * + * * @see com.vaadin.data.Item#addItemProperty(Object, Property) */ @Override @@ -477,16 +480,16 @@ public class Form extends AbstractField implements Item.Editor, /** * Registers the field with the form and adds the field to the form layout. - * + * *

          * The property id must not be already used in the form. *

          - * + * *

          * This field is added to the layout using the * {@link #attachField(Object, Field)} method. *

          - * + * * @param propertyId * the Property id the the field. * @param field @@ -501,12 +504,12 @@ public class Form extends AbstractField implements Item.Editor, /** * Register the field with the form. All registered fields are validated * when the form is validated and also committed when the form is committed. - * + * *

          * The property id must not be already used in the form. *

          - * - * + * + * * @param propertyId * the Property id of the field. * @param field @@ -542,11 +545,11 @@ public class Form extends AbstractField implements Item.Editor, * CustomLayout location given by the string representation of the property * id using {@link CustomLayout#addComponent(Component, String)}. *

          - * + * *

          * Override this method to control how the fields are added to the layout. *

          - * + * * @param propertyId * @param field */ @@ -566,13 +569,13 @@ public class Form extends AbstractField implements Item.Editor, /** * The property identified by the property id. - * + * *

          * The property data source of the field specified with property id is * returned. If there is a (with specified property id) having no data * source, the field is returned instead of the data source. *

          - * + * * @see com.vaadin.data.Item#getItemProperty(Object) */ @Override @@ -593,7 +596,7 @@ public class Form extends AbstractField implements Item.Editor, /** * Gets the field identified by the propertyid. - * + * * @param propertyId * the id of the property. */ @@ -609,7 +612,7 @@ public class Form extends AbstractField implements Item.Editor, /** * Removes the property and corresponding field from the form. - * + * * @see com.vaadin.data.Item#removeItemProperty(Object) */ @Override @@ -636,7 +639,7 @@ public class Form extends AbstractField implements Item.Editor, * Override this method to control how the fields are removed from the * layout. *

          - * + * * @param field * the field to be detached from the forms layout. */ @@ -649,7 +652,7 @@ public class Form extends AbstractField implements Item.Editor, /** * Removes all properties and fields from the form. - * + * * @return the Success of the operation. Removal of all fields succeeded if * (and only if) the return value is true. */ @@ -674,34 +677,34 @@ public class Form extends AbstractField implements Item.Editor, /** * Sets the item datasource for the form. - * + * *

          * Setting item datasource clears any fields, the form might contain and * adds all the properties as fields to the form. *

          - * + * * @see com.vaadin.data.Item.Viewer#setItemDataSource(Item) */ @Override public void setItemDataSource(Item newDataSource) { - setItemDataSource(newDataSource, - newDataSource != null ? newDataSource.getItemPropertyIds() - : null); + setItemDataSource(newDataSource, newDataSource != null + ? newDataSource.getItemPropertyIds() : null); } /** * Set the item datasource for the form, but limit the form contents to * specified properties of the item. - * + * *

          * Setting item datasource clears any fields, the form might contain and * adds the specified the properties as fields to the form, in the specified * order. *

          - * + * * @see com.vaadin.data.Item.Viewer#setItemDataSource(Item) */ - public void setItemDataSource(Item newDataSource, Collection propertyIds) { + public void setItemDataSource(Item newDataSource, + Collection propertyIds) { if (getLayout() instanceof GridLayout) { GridLayout gl = (GridLayout) getLayout(); @@ -748,7 +751,7 @@ public class Form extends AbstractField implements Item.Editor, * property straight to Field. If Property.Viewer type property (e.g. * PropertyFormatter) is already set for field, the property is bound to * that Property.Viewer. - * + * * @param propertyId * @param property * @param field @@ -771,12 +774,12 @@ public class Form extends AbstractField implements Item.Editor, /** * Gets the layout of the form. - * + * *

          * By default form uses OrderedLayout with form * -style. *

          - * + * * @return the Layout of the form. */ public Layout getLayout() { @@ -785,11 +788,11 @@ public class Form extends AbstractField implements Item.Editor, /** * Sets the layout of the form. - * + * *

          * If set to null then Form uses a FormLayout by default. *

          - * + * * @param layout * the layout of the form. */ @@ -828,16 +831,16 @@ public class Form extends AbstractField implements Item.Editor, /** * Sets the form field to be selectable from static list of changes. - * + * *

          * The list values and descriptions are given as array. The value-array must * contain the current value of the field and the lengths of the arrays must * match. Null values are not supported. *

          - * + * * Note: since Vaadin 7.0, returns an {@link AbstractSelect} instead of a * {@link Select}. - * + * * @param propertyId * the id of the property. * @param values @@ -862,8 +865,9 @@ public class Form extends AbstractField implements Item.Editor, throw new IllegalArgumentException("Field with given propertyid '" + propertyId.toString() + "' can not be found."); } - final Object value = oldField.getPropertyDataSource() == null ? oldField - .getValue() : oldField.getPropertyDataSource().getValue(); + final Object value = oldField.getPropertyDataSource() == null + ? oldField.getValue() + : oldField.getPropertyDataSource().getValue(); // Checks that the value exists and check if the select should // be forced in multiselect mode @@ -877,8 +881,8 @@ public class Form extends AbstractField implements Item.Editor, } if (value != null && !found) { if (value instanceof Collection) { - for (final Iterator it = ((Collection) value).iterator(); it - .hasNext();) { + for (final Iterator it = ((Collection) value) + .iterator(); it.hasNext();) { final Object val = it.next(); found = false; for (int i = 0; i < values.length && !found; i++) { @@ -897,9 +901,9 @@ public class Form extends AbstractField implements Item.Editor, } isMultiselect = true; } else { - throw new IllegalArgumentException("Current value '" + value - + "' of property '" + propertyId.toString() - + "' was not found"); + throw new IllegalArgumentException( + "Current value '" + value + "' of property '" + + propertyId.toString() + "' was not found"); } } @@ -925,8 +929,8 @@ public class Form extends AbstractField implements Item.Editor, } if (item != null) { - item.getItemProperty("desc").setValue( - descriptions[i].toString()); + item.getItemProperty("desc") + .setValue(descriptions[i].toString()); } } @@ -946,7 +950,7 @@ public class Form extends AbstractField implements Item.Editor, /** * Checks the validity of the Form and all of its fields. - * + * * @see com.vaadin.data.Validatable#validate() */ @Override @@ -959,7 +963,7 @@ public class Form extends AbstractField implements Item.Editor, /** * Checks the validabtable object accept invalid values. - * + * * @see com.vaadin.data.Validatable#isInvalidAllowed() */ @Override @@ -969,7 +973,7 @@ public class Form extends AbstractField implements Item.Editor, /** * Should the validabtable object accept invalid values. - * + * * @see com.vaadin.data.Validatable#setInvalidAllowed(boolean) */ @Override @@ -980,7 +984,7 @@ public class Form extends AbstractField implements Item.Editor, /** * Sets the component's to read-only mode to the specified state. - * + * * @see com.vaadin.ui.Component#setReadOnly(boolean) */ @Override @@ -994,10 +998,10 @@ public class Form extends AbstractField implements Item.Editor, /** * Sets the field factory used by this Form to genarate Fields for * properties. - * + * * {@link FormFieldFactory} is used to create fields for form properties. * {@link DefaultFieldFactory} is used by default. - * + * * @param fieldFactory * the new factory used to create the fields. * @see Field @@ -1009,7 +1013,7 @@ public class Form extends AbstractField implements Item.Editor, /** * Get the field factory of the form. - * + * * @return the FormFieldFactory Factory used to create the fields. */ public FormFieldFactory getFormFieldFactory() { @@ -1018,7 +1022,7 @@ public class Form extends AbstractField implements Item.Editor, /** * Gets the field type. - * + * * @see com.vaadin.ui.AbstractField#getType() */ @Override @@ -1031,9 +1035,9 @@ public class Form extends AbstractField implements Item.Editor, /** * Sets the internal value. - * + * * This is relevant when the Form is used as Field. - * + * * @see com.vaadin.ui.AbstractField#setInternalValue(java.lang.Object) */ @Override @@ -1055,7 +1059,7 @@ public class Form extends AbstractField implements Item.Editor, * Gets the first focusable field in form. If there are enabled, * non-read-only fields, the first one of them is returned. Otherwise, the * field for the first property (or null if none) is returned. - * + * * @return the Field. */ private Field getFirstFocusableField() { @@ -1081,9 +1085,9 @@ public class Form extends AbstractField implements Item.Editor, /** * Updates the internal form datasource. - * + * * Method setFormDataSource. - * + * * @param data * @param properties */ @@ -1109,7 +1113,7 @@ public class Form extends AbstractField implements Item.Editor, /** * Returns the visibleProperties. - * + * * @return the Collection of visible Item properites. */ public Collection getVisibleItemProperties() { @@ -1118,7 +1122,7 @@ public class Form extends AbstractField implements Item.Editor, /** * Sets the visibleProperties. - * + * * @param visibleProperties * the visibleProperties to set. */ @@ -1133,7 +1137,7 @@ public class Form extends AbstractField implements Item.Editor, /** * Sets the visibleProperties. - * + * * @param visibleProperties * the visibleProperties to set. */ @@ -1147,7 +1151,7 @@ public class Form extends AbstractField implements Item.Editor, /** * Focuses the first field in the form. - * + * * @see com.vaadin.ui.Component.Focusable#focus() */ @Override @@ -1160,13 +1164,14 @@ public class Form extends AbstractField implements Item.Editor, /** * Sets the Tabulator index of this Focusable component. - * + * * @see com.vaadin.ui.Component.Focusable#setTabIndex(int) */ @Override public void setTabIndex(int tabIndex) { super.setTabIndex(tabIndex); - for (final Iterator i = getItemPropertyIds().iterator(); i.hasNext();) { + for (final Iterator i = getItemPropertyIds().iterator(); i + .hasNext();) { (getField(i.next())).setTabIndex(tabIndex); } } @@ -1190,7 +1195,7 @@ public class Form extends AbstractField implements Item.Editor, * {@inheritDoc} *

          * A Form is empty if all of its fields are empty. - * + * */ @Override public boolean isEmpty() { @@ -1209,7 +1214,7 @@ public class Form extends AbstractField implements Item.Editor, /* * (non-Javadoc) - * + * * @see com.vaadin.ui.AbstractField#clear() */ @Override @@ -1224,7 +1229,7 @@ public class Form extends AbstractField implements Item.Editor, /** * Adding validators directly to form is not supported. - * + * * Add the validators to form fields instead. */ @Override @@ -1235,7 +1240,7 @@ public class Form extends AbstractField implements Item.Editor, /** * Returns a layout that is rendered below normal form contents. This area * can be used for example to include buttons related to form contents. - * + * * @return layout rendered below normal form contents or null if no footer * is used */ @@ -1246,7 +1251,7 @@ public class Form extends AbstractField implements Item.Editor, /** * Sets the layout that is rendered below normal form contents. No footer is * rendered if this is set to null, . - * + * * @param footer * the new footer layout */ @@ -1282,7 +1287,7 @@ public class Form extends AbstractField implements Item.Editor, * {@link AbstractField}. The ownActionManager handles Actions attached to * this Form specifically, while the ActionManager in AbstractField * delegates to the containing Window (i.e global Actions). - * + * * @return */ protected ActionManager getOwnActionManager() { @@ -1336,8 +1341,8 @@ public class Form extends AbstractField implements Item.Editor, * Modifiable and Serializable Iterator for the components, used by * {@link Form#getComponentIterator()}. */ - private class ComponentIterator implements Iterator, - Serializable { + private class ComponentIterator + implements Iterator, Serializable { int i = 0; diff --git a/server/src/main/java/com/vaadin/ui/FormFieldFactory.java b/server/src/main/java/com/vaadin/ui/FormFieldFactory.java index 124e0fcb9a..ef0894de7b 100644 --- a/server/src/main/java/com/vaadin/ui/FormFieldFactory.java +++ b/server/src/main/java/com/vaadin/ui/FormFieldFactory.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,9 +25,9 @@ import com.vaadin.data.fieldgroup.FieldGroup; * property id and uiContext (the component responsible for displaying fields). * Currently this interface is used by {@link Form}, but might later be used by * some other components for {@link Field} generation. - * + * *

          - * + * * @author Vaadin Ltd. * @since 6.0 * @see TableFieldFactory @@ -39,7 +39,7 @@ public interface FormFieldFactory extends Serializable { /** * Creates a field based on the item, property id and the component (most * commonly {@link Form}) where the Field will be presented. - * + * * @param item * the item where the property belongs to. * @param propertyId diff --git a/server/src/main/java/com/vaadin/ui/FormLayout.java b/server/src/main/java/com/vaadin/ui/FormLayout.java index c817300e53..72d053fb4e 100644 --- a/server/src/main/java/com/vaadin/ui/FormLayout.java +++ b/server/src/main/java/com/vaadin/ui/FormLayout.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -22,14 +22,14 @@ import com.vaadin.shared.ui.orderedlayout.FormLayoutState; /** * FormLayout is used by {@link Form} to layout fields. It may also be used * separately without {@link Form}. - * + * * FormLayout is a close relative of {@link VerticalLayout}, but in FormLayout * captions are rendered to the left of their respective components. Required * and validation indicators are shown between the captions and the fields. - * + * * FormLayout by default has component spacing on. Also margin top and margin * bottom are by default on. - * + * */ public class FormLayout extends AbstractOrderedLayout { @@ -42,9 +42,9 @@ public class FormLayout extends AbstractOrderedLayout { /** * Constructs a FormLayout and adds the given components to it. - * + * * @see AbstractOrderedLayout#addComponents(Component...) - * + * * @param children * Components to add to the FormLayout */ diff --git a/server/src/main/java/com/vaadin/ui/Grid.java b/server/src/main/java/com/vaadin/ui/Grid.java index 962d88087d..5e1d44244b 100644 --- a/server/src/main/java/com/vaadin/ui/Grid.java +++ b/server/src/main/java/com/vaadin/ui/Grid.java @@ -123,11 +123,11 @@ import elemental.json.JsonValue; * Grid is always bound to a {@link Container.Indexed}, but is not a * {@code Container} of any kind in of itself. The contents of the given * Container is displayed with the help of {@link Renderer Renderers}. - * + * *

          Headers and Footers

          *

          - * - * + * + * *

          Converters and Renderers

          *

          * Each column has its own {@link Renderer} that displays data into something @@ -146,36 +146,36 @@ import elemental.json.JsonValue; * column.setConverter(new StringToDateConverter()); * column.setRenderer(new MyColorfulDateRenderer()); * - * + * *

          Lazy Loading

          *

          * The data is accessed as it is needed by Grid and not any sooner. In other * words, if the given Container is huge, but only the first few rows are * displayed to the user, only those (and a few more, for caching purposes) are * accessed. - * + * *

          Selection Modes and Models

          *

          * Grid supports three selection {@link SelectionMode modes} (single, - * multi, none), and comes bundled with one - * {@link SelectionModel model} for each of the modes. The distinction - * between a selection mode and selection model is as follows: a mode - * essentially says whether you can have one, many or no rows selected. The - * model, however, has the behavioral details of each. A single selection model - * may require that the user deselects one row before selecting another one. A - * variant of a multiselect might have a configurable maximum of rows that may - * be selected. And so on. + * multi, none), and comes bundled with one {@link SelectionModel + * model} for each of the modes. The distinction between a selection mode + * and selection model is as follows: a mode essentially says whether + * you can have one, many or no rows selected. The model, however, has the + * behavioral details of each. A single selection model may require that the + * user deselects one row before selecting another one. A variant of a + * multiselect might have a configurable maximum of rows that may be selected. + * And so on. *

          *

            * Grid grid = new Grid(myContainer);
          - * 
          + *
            * // uses the bundled SingleSelectionModel class
            * grid.setSelectionMode(SelectionMode.SINGLE);
          - * 
          + *
            * // changes the behavior to a custom selection model
            * grid.setSelectionModel(new MyTwoSelectionModel());
            * 
          - * + * * @since 7.4 * @author Vaadin Ltd */ @@ -184,13 +184,13 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * An event listener for column visibility change events in the Grid. - * + * * @since 7.5.0 */ public interface ColumnVisibilityChangeListener extends Serializable { /** * Called when a column has become hidden or unhidden. - * + * * @param event */ void columnVisibilityChanged(ColumnVisibilityChangeEvent event); @@ -198,7 +198,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * An event that is fired when a column's visibility changes. - * + * * @since 7.5.0 */ public static class ColumnVisibilityChangeEvent extends Component.Event { @@ -209,7 +209,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Constructor for a column visibility change event. - * + * * @param source * the grid from which this event originates * @param column @@ -231,7 +231,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Gets the column that became hidden or visible. - * + * * @return the column that became hidden or visible. * @see Column#isHidden() */ @@ -241,7 +241,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Was the column set hidden or visible. - * + * * @return true if the column was hidden false * if it was set visible */ @@ -252,7 +252,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Returns true if the column reorder was done by the user, * false if not and it was triggered by server side code. - * + * * @return true if event is a result of user interaction */ public boolean isUserOriginated() { @@ -262,7 +262,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * A callback interface for generating details for a particular row in Grid. - * + * * @since 7.5.0 * @author Vaadin Ltd * @see DetailsGenerator#NULL @@ -286,7 +286,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * Note: If a component gets generated, it may not be manually * attached anywhere. The same details component can not be displayed * for multiple different rows. - * + * * @param rowReference * the reference for the row for which to generate details * @return the details for the given row, or null to leave @@ -301,15 +301,15 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * this class when the {@link RpcDataProviderExtension} is sending data to * the client. Details components are detached and forgotten when client * informs that it has dropped the corresponding item. - * + * * @since 7.6.1 */ - public final static class DetailComponentManager extends - AbstractGridExtension implements DataGenerator { + public final static class DetailComponentManager + extends AbstractGridExtension implements DataGenerator { /** * The user-defined details generator. - * + * * @see #setDetailsGenerator(DetailsGenerator) */ private DetailsGenerator detailsGenerator; @@ -348,7 +348,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * {@link DetailsGenerator}. *

          * This method attaches created components to the parent {@link Grid}. - * + * * @param itemId * the item id for which to create the details component. * @throws IllegalStateException @@ -373,10 +373,10 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, if (details != null) { if (details.getParent() != null) { String name = detailsGenerator.getClass().getName(); - throw new IllegalStateException(name - + " generated a details component that already " - + "was attached. (itemId: " + itemId - + ", component: " + details + ")"); + throw new IllegalStateException( + name + " generated a details component that already " + + "was attached. (itemId: " + itemId + + ", component: " + details + ")"); } itemIdToDetailsComponent.put(itemId, details); @@ -396,7 +396,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * Destroys a details component correctly. *

          * This method will detach the component from parent {@link Grid}. - * + * * @param itemId * the item id for which to destroy the details component */ @@ -427,7 +427,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Sets details visiblity status of given item id. - * + * * @param itemId * item id to set * @param visible @@ -460,10 +460,9 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, Component detailsComponent = itemIdToDetailsComponent .get(itemId); - rowData.put( - GridState.JSONKEY_DETAILS_VISIBLE, - (detailsComponent != null ? detailsComponent - .getConnectorId() : "")); + rowData.put(GridState.JSONKEY_DETAILS_VISIBLE, + (detailsComponent != null + ? detailsComponent.getConnectorId() : "")); } } @@ -478,7 +477,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * Sets a new details generator for row details. *

          * The currently opened row details will be re-rendered. - * + * * @param detailsGenerator * the details generator to set * @throws IllegalArgumentException @@ -500,7 +499,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Gets the current details generator for row details. - * + * * @return the detailsGenerator the current details generator */ public DetailsGenerator getDetailsGenerator() { @@ -509,7 +508,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Checks whether details are visible for the given item. - * + * * @param itemId * the id of the item for which to check details visibility * @return true iff the details are visible @@ -552,12 +551,12 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Field factory used by default in the editor. - * + * * Aims to fields of suitable type and with suitable size for use in the * editor row. */ - public static class EditorFieldFactory extends - DefaultFieldGroupFieldFactory { + public static class EditorFieldFactory + extends DefaultFieldGroupFieldFactory { private static final EditorFieldFactory INSTANCE = new EditorFieldFactory(); protected EditorFieldFactory() { @@ -565,7 +564,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Returns the singleton instance - * + * * @return the singleton instance */ public static EditorFieldFactory get() { @@ -573,7 +572,8 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, } @Override - public T createField(Class type, Class fieldType) { + public T createField(Class type, + Class fieldType) { T f = super.createField(type, fieldType); if (f != null) { f.setWidth("100%"); @@ -610,7 +610,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Called when an exception occurs while the editor row is being saved - * + * * @param event * An event providing more information about the error */ @@ -619,7 +619,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * ContextClickEvent for the Grid Component. - * + * * @since 7.6 */ public static class GridContextClickEvent extends ContextClickEvent { @@ -641,7 +641,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Returns the item id of context clicked row. - * + * * @return item id of clicked row; null if header or footer */ public Object getItemId() { @@ -650,7 +650,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Returns property id of clicked column. - * + * * @return property id */ public Object getPropertyId() { @@ -659,7 +659,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Return the clicked section of Grid. - * + * * @return section of grid */ public Section getSection() { @@ -671,7 +671,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * of the Grid the index is the item index in the Container. Header and * Footer rows for index can be fetched with * {@link Grid#getHeaderRow(int)} and {@link Grid#getFooterRow(int)}. - * + * * @return row index in section */ public int getRowIndex() { @@ -703,7 +703,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Retrieves the cause of the failure - * + * * @return the cause of the failure */ public CommitException getCause() { @@ -717,7 +717,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Checks if validation exceptions caused this error - * + * * @return true if the problem was caused by a validation error */ public boolean isValidationFailure() { @@ -727,7 +727,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Marks that an error indicator should be shown for the editor of a * column. - * + * * @param column * the column to show an error for */ @@ -737,7 +737,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Gets all the columns that have been marked as erroneous. - * + * * @return an umodifiable collection of erroneous columns */ public Collection getErrorColumns() { @@ -746,7 +746,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Gets the error message to show to the user. - * + * * @return error message to show */ public String getUserErrorMessage() { @@ -755,7 +755,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Sets the error message to show to the user. - * + * * @param userErrorMessage * the user error message to set */ @@ -767,14 +767,14 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * An event listener for column reorder events in the Grid. - * + * * @since 7.5.0 */ public interface ColumnReorderListener extends Serializable { /** * Called when the columns of the grid have been reordered. - * + * * @param event * An event providing more information */ @@ -783,7 +783,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * An event that is fired when the columns are reordered. - * + * * @since 7.5.0 */ public static class ColumnReorderEvent extends Component.Event { @@ -791,7 +791,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, private final boolean userOriginated; /** - * + * * @param source * the grid where the event originated from * @param userOriginated @@ -806,7 +806,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Returns true if the column reorder was done by the user, * false if not and it was triggered by server side code. - * + * * @return true if event is a result of user interaction */ public boolean isUserOriginated() { @@ -817,14 +817,14 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * An event listener for column resize events in the Grid. - * + * * @since 7.6 */ public interface ColumnResizeListener extends Serializable { /** * Called when the columns of the grid have been resized. - * + * * @param event * An event providing more information */ @@ -834,7 +834,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * An event that is fired when a column is resized, either programmatically * or by the user. - * + * * @since 7.6 */ public static class ColumnResizeEvent extends Component.Event { @@ -843,7 +843,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, private final boolean userOriginated; /** - * + * * @param source * the grid where the event originated from * @param userOriginated @@ -859,7 +859,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Returns the column that was resized. - * + * * @return the resized column. */ public Column getColumn() { @@ -869,7 +869,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Returns true if the column resize was done by the user, * false if not and it was triggered by server side code. - * + * * @return true if event is a result of user interaction */ public boolean isUserOriginated() { @@ -883,19 +883,17 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, */ public interface EditorListener extends Serializable { - public static final Method EDITOR_OPEN_METHOD = ReflectTools - .findMethod(EditorListener.class, "editorOpened", - EditorOpenEvent.class); - public static final Method EDITOR_MOVE_METHOD = ReflectTools - .findMethod(EditorListener.class, "editorMoved", - EditorMoveEvent.class); + public static final Method EDITOR_OPEN_METHOD = ReflectTools.findMethod( + EditorListener.class, "editorOpened", EditorOpenEvent.class); + public static final Method EDITOR_MOVE_METHOD = ReflectTools.findMethod( + EditorListener.class, "editorMoved", EditorMoveEvent.class); public static final Method EDITOR_CLOSE_METHOD = ReflectTools .findMethod(EditorListener.class, "editorClosed", EditorCloseEvent.class); /** * Called when an editor is opened - * + * * @param e * an editor open event object */ @@ -903,7 +901,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Called when an editor is reopened without closing it first - * + * * @param e * an editor move event object */ @@ -911,7 +909,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Called when an editor is closed - * + * * @param e * an editor close event object */ @@ -974,7 +972,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Default error handler for the editor - * + * */ public class DefaultEditorErrorHandler implements EditorErrorHandler { @@ -1038,7 +1036,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * {@link Grid#setSelectionMode(SelectionMode)} is equivalent to calling * {@link Grid#setSelectionModel(SelectionModel)} with one of the built-in * implementations of {@link SelectionModel}. - * + * * @see Grid#setSelectionMode(SelectionMode) * @see Grid#setSelectionModel(SelectionModel) */ @@ -1078,7 +1076,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, public interface SelectionModel extends Serializable, Extension { /** * Checks whether an item is selected or not. - * + * * @param itemId * the item id to check for * @return true iff the item is selected @@ -1087,7 +1085,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Returns a collection of all the currently selected itemIds. - * + * * @return a collection of all the currently selected itemIds */ Collection getSelectedRows(); @@ -1098,7 +1096,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * {@link AbstractExtension}. *

          * Note: This method should not be called manually. - * + * * @param grid * the Grid in which the SelectionModel currently is, or * null when a selection model is being detached @@ -1131,7 +1129,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, *

          * This method does not clear any previous selection state, only * adds to it. - * + * * @param itemIds * the itemId(s) to mark as selected * @return true if the selection state changed. @@ -1150,7 +1148,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, *

          * This method does not clear any previous selection state, only * adds to it. - * + * * @param itemIds * the itemIds to mark as selected * @return true if the selection state changed. @@ -1166,7 +1164,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Marks items as deselected. - * + * * @param itemIds * the itemId(s) to remove from being selected * @return true if the selection state changed. @@ -1181,7 +1179,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Marks items as deselected. - * + * * @param itemIds * the itemId(s) to remove from being selected * @return true if the selection state changed. @@ -1196,7 +1194,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Marks all the items in the current Container as selected - * + * * @return true iff some items were previously not * selected * @see #deselectAll() @@ -1205,7 +1203,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Marks all the items in the current Container as deselected - * + * * @return true iff some items were previously selected * @see #selectAll() */ @@ -1214,7 +1212,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Marks items as selected while deselecting all items not in the * given Collection. - * + * * @param itemIds * the itemIds to mark as selected * @return true if the selection state changed. @@ -1230,7 +1228,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Marks items as selected while deselecting all items not in the * varargs array. - * + * * @param itemIds * the itemIds to mark as selected * @return true if the selection state changed. @@ -1258,7 +1256,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Marks an item as selected. - * + * * @param itemId * the itemId to mark as selected; null for * deselect @@ -1273,12 +1271,12 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * if given itemId does not exist in the container of * Grid */ - boolean select(Object itemId) throws IllegalStateException, - IllegalArgumentException; + boolean select(Object itemId) + throws IllegalStateException, IllegalArgumentException; /** * Gets the item id of the currently selected item. - * + * * @return the item id of the currently selected item, or * null if nothing is selected */ @@ -1287,7 +1285,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Sets whether it's allowed to deselect the selected row through * the UI. Deselection is allowed by default. - * + * * @param deselectAllowed * true if the selected row can be * deselected without selecting another row instead; @@ -1298,7 +1296,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Sets whether it's allowed to deselect the selected row through * the UI. - * + * * @return true if deselection is allowed; otherwise * false */ @@ -1317,7 +1315,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * {@inheritDoc} - * + * * @return always false. */ @Override @@ -1325,7 +1323,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * {@inheritDoc} - * + * * @return always an empty collection. */ @Override @@ -1360,10 +1358,10 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Sanity check for existence of item id. - * + * * @param itemId * item id to be selected / deselected - * + * * @throws IllegalArgumentException * if item Id doesn't exist in the container of Grid */ @@ -1377,10 +1375,10 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Sanity check for existence of item ids in given collection. - * + * * @param itemIds * item id collection to be selected / deselected - * + * * @throws IllegalArgumentException * if at least one item id doesn't exist in the container of * Grid @@ -1400,7 +1398,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * Note that this is only a helper method, and routes the call all the * way to Grid. A {@link SelectionModel} is not a * {@link SelectionNotifier} - * + * * @param oldSelection * the complete {@link Collection} of the itemIds that were * selected before this event happened @@ -1408,8 +1406,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * the complete {@link Collection} of the itemIds that are * selected after this event happened */ - protected void fireSelectionEvent( - final Collection oldSelection, + protected void fireSelectionEvent(final Collection oldSelection, final Collection newSelection) { getParentGrid().fireSelectionEvent(oldSelection, newSelection); } @@ -1572,7 +1569,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * The default selection size limit. - * + * * @see #setSelectionLimit(int) */ public static final int DEFAULT_MAX_SELECTIONS = 1000; @@ -1685,7 +1682,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * row exceeds the new limit. *

          * The default limit is {@value #DEFAULT_MAX_SELECTIONS} rows. - * + * * @param selectionLimit * the non-negative selection limit to set * @throws IllegalArgumentException @@ -1701,9 +1698,9 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Gets the selection limit. - * + * * @see #setSelectionLimit(int) - * + * * @return the selection limit */ public int getSelectionLimit() { @@ -1728,7 +1725,8 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, return deselect(itemIds, true); } - protected boolean deselect(final Collection itemIds, boolean refresh) { + protected boolean deselect(final Collection itemIds, + boolean refresh) { if (itemIds == null) { throw new IllegalArgumentException("itemIds may not be null"); } @@ -1852,7 +1850,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Compares two sets and returns a set containing all values that are * present in the first, but not in the second. - * + * * @param set1 * first item set * @param set2 @@ -1907,7 +1905,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Creates a new row reference for the given grid. - * + * * @param grid * the grid that the row belongs to */ @@ -1917,7 +1915,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Sets the identifying information for this row - * + * * @param itemId * the item id of the row */ @@ -1927,7 +1925,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Gets the grid that contains the referenced row. - * + * * @return the grid that contains referenced row */ public Grid getGrid() { @@ -1936,7 +1934,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Gets the item id of the row. - * + * * @return the item id of the row */ public Object getItemId() { @@ -1945,7 +1943,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Gets the item for the row. - * + * * @return the item for the row */ public Item getItem() { @@ -1973,7 +1971,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Sets the identifying information for this cell - * + * * @param propertyId * the property id of the column */ @@ -1983,7 +1981,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Gets the grid that contains the referenced cell. - * + * * @return the grid that contains referenced cell */ public Grid getGrid() { @@ -2006,7 +2004,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Gets the item id of the row of the cell. - * + * * @return the item id of the row */ public Object getItemId() { @@ -2015,7 +2013,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Gets the item for the row of the cell. - * + * * @return the item for the row */ public Item getItem() { @@ -2024,7 +2022,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Gets the value of the cell. - * + * * @return the value of the cell */ public Object getValue() { @@ -2034,14 +2032,14 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * A callback interface for generating custom style names for Grid rows. - * + * * @see Grid#setRowStyleGenerator(RowStyleGenerator) */ public interface RowStyleGenerator extends Serializable { /** * Called by Grid to generate a style name for a row. - * + * * @param row * the row to generate a style for * @return the style name to add to this row, or {@code null} to not set @@ -2052,14 +2050,14 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * A callback interface for generating custom style names for Grid cells. - * + * * @see Grid#setCellStyleGenerator(CellStyleGenerator) */ public interface CellStyleGenerator extends Serializable { /** * Called by Grid to generate a style name for a column. - * + * * @param cell * the cell to generate a style for * @return the style name to add to this cell, or {@code null} to not @@ -2073,9 +2071,9 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * Grid rows. If a description is generated for a row, it is used for all * the cells in the row for which a {@link CellDescriptionGenerator cell * description} is not generated. - * + * * @see Grid#setRowDescriptionGenerator - * + * * @since 7.6 */ public interface RowDescriptionGenerator extends Serializable { @@ -2085,7 +2083,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * description may contain HTML which is rendered directly; if this is * not desired the returned string must be escaped by the implementing * method. - * + * * @param row * the row to generate a description for * @return the row description or {@code null} for no description @@ -2097,9 +2095,9 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * A callback interface for generating optional descriptions (tooltips) for * Grid cells. If a cell has both a {@link RowDescriptionGenerator row * description} and a cell description, the latter has precedence. - * + * * @see Grid#setCellDescriptionGenerator(CellDescriptionGenerator) - * + * * @since 7.6 */ public interface CellDescriptionGenerator extends Serializable { @@ -2109,7 +2107,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * description may contain HTML which is rendered directly; if this is * not desired the returned string must be escaped by the implementing * method. - * + * * @param cell * the cell to generate a description for * @return the cell description or {@code null} for no description @@ -2162,7 +2160,8 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, if (cellDescriptionGenerator != null && cellDescriptions.keys().length > 0) { - rowData.put(GridState.JSONKEY_CELLDESCRIPTION, cellDescriptions); + rowData.put(GridState.JSONKEY_CELLDESCRIPTION, + cellDescriptions); } if (cellStyleGenerator != null && cellStyles.keys().length > 0) { @@ -2210,7 +2209,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Abstract base class for Grid header and footer sections. - * + * * @since 7.6 * @param * the type of the rows in the section @@ -2220,7 +2219,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Abstract base class for Grid header and footer rows. - * + * * @param * the type of the cells in the row */ @@ -2238,7 +2237,8 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, protected void addCell(Object propertyId) { CELLTYPE cell = createCell(); - cell.setColumnId(section.grid.getColumn(propertyId).getState().id); + cell.setColumnId( + section.grid.getColumn(propertyId).getState().id); cells.put(propertyId, cell); rowState.cells.add(cell.getCellState()); } @@ -2277,7 +2277,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Creates and returns a new instance of the cell type. - * + * * @return the created cell */ protected abstract CELLTYPE createCell(); @@ -2289,7 +2289,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Returns the cell for the given property id on this row. If the * column is merged returned cell is the cell for the whole group. - * + * * @param propertyId * the property id of the column * @return the cell for the given property, merged cell for merged @@ -2306,7 +2306,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Merges columns cells in a row - * + * * @param propertyIds * The property ids of columns to merge * @return The remaining visible cell after the merge @@ -2324,7 +2324,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Merges columns cells in a row - * + * * @param cells * The cells to merge. Must be from the same row. * @return The remaining visible cell after the merge @@ -2369,7 +2369,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Returns the custom style name for this row. - * + * * @return the style name or null if no style name has been set */ public String getStyleName() { @@ -2378,7 +2378,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Sets a custom style name for this row. - * + * * @param styleName * the style name to set or null to not use any style * name @@ -2389,7 +2389,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Writes the declarative design to the given table row element. - * + * * @since 7.5.0 * @param trElement * Element to write design to @@ -2413,8 +2413,8 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, for (Entry, CELLTYPE> entry : cellGroups .entrySet()) { if (entry.getValue() == cell) { - cellElement.attr("colspan", "" - + entry.getKey().size()); + cellElement.attr("colspan", + "" + entry.getKey().size()); break; } } @@ -2423,7 +2423,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Reads the declarative design from the given table row element. - * + * * @since 7.5.0 * @param trElement * Element to read design from @@ -2460,8 +2460,8 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, totalColSpans += colspan - 1; join(cells).readDesign(element, designContext); } else { - cells.iterator().next() - .readDesign(element, designContext); + cells.iterator().next().readDesign(element, + designContext); } } } @@ -2497,7 +2497,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Gets the row where this cell is. - * + * * @return row for this cell */ public StaticRow getRow() { @@ -2510,7 +2510,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Sets the text displayed in this cell. - * + * * @param text * a plain text caption */ @@ -2523,7 +2523,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Returns the text displayed in this cell. - * + * * @return the plain text caption */ public String getText() { @@ -2537,9 +2537,9 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Returns the HTML content displayed in this cell. - * + * * @return the html - * + * */ public String getHtml() { if (cellState.type != GridStaticCellType.HTML) { @@ -2552,7 +2552,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Sets the HTML content displayed in this cell. - * + * * @param html * the html to set */ @@ -2565,7 +2565,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Returns the component displayed in this cell. - * + * * @return the component */ public Component getComponent() { @@ -2579,7 +2579,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Sets the component displayed in this cell. - * + * * @param component * the component to set */ @@ -2593,7 +2593,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Returns the type of content stored in this cell. - * + * * @return cell content type */ public GridStaticCellType getCellType() { @@ -2602,7 +2602,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Returns the custom style name for this cell. - * + * * @return the style name or null if no style name has been set */ public String getStyleName() { @@ -2611,7 +2611,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Sets a custom style name for this cell. - * + * * @param styleName * the style name to set or null to not use any style * name @@ -2631,7 +2631,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Writes the declarative design to the given table cell element. - * + * * @since 7.5.0 * @param cellElement * Element to write design to @@ -2649,15 +2649,15 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, cellElement.append(getHtml()); break; case WIDGET: - cellElement.appendChild(designContext - .createElement(getComponent())); + cellElement.appendChild( + designContext.createElement(getComponent())); break; } } /** * Reads the declarative design from the given table cell element. - * + * * @since 7.5.0 * @param cellElement * Element to read design from @@ -2669,15 +2669,15 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, if (!cellElement.hasAttr("plain-text")) { if (cellElement.children().size() > 0 && cellElement.child(0).tagName().contains("-")) { - setComponent(designContext.readDesign(cellElement - .child(0))); + setComponent( + designContext.readDesign(cellElement.child(0))); } else { setHtml(cellElement.html()); } } else { // text – need to unescape HTML entities - setText(DesignFormatter.decodeFromTextNode(cellElement - .html())); + setText(DesignFormatter + .decodeFromTextNode(cellElement.html())); } } @@ -2691,7 +2691,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Sets the visibility of the whole section. - * + * * @param visible * true to show this section, false to hide */ @@ -2704,7 +2704,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Returns the visibility of this section. - * + * * @return true if visible, false otherwise. */ public boolean isVisible() { @@ -2713,10 +2713,10 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Removes the row at the given position. - * + * * @param rowIndex * the position of the row - * + * * @throws IllegalArgumentException * if no row exists at given index * @see #removeRow(StaticRow) @@ -2726,8 +2726,8 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, */ public ROWTYPE removeRow(int rowIndex) { if (rowIndex >= rows.size() || rowIndex < 0) { - throw new IllegalArgumentException("No row at given index " - + rowIndex); + throw new IllegalArgumentException( + "No row at given index " + rowIndex); } ROWTYPE row = rows.remove(rowIndex); row.detach(); @@ -2739,10 +2739,10 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Removes the given row from the section. - * + * * @param row * the row to be removed - * + * * @throws IllegalArgumentException * if the row does not exist in this section * @see #removeRow(int) @@ -2761,22 +2761,22 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Gets row at given index. - * + * * @param rowIndex * 0 based index for row. Counted from top to bottom * @return row at given index */ public ROWTYPE getRow(int rowIndex) { if (rowIndex >= rows.size() || rowIndex < 0) { - throw new IllegalArgumentException("No row at given index " - + rowIndex); + throw new IllegalArgumentException( + "No row at given index " + rowIndex); } return rows.get(rowIndex); } /** * Adds a new row at the top of this section. - * + * * @return the new row * @see #appendRow() * @see #addRowAt(int) @@ -2789,7 +2789,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Adds a new row at the bottom of this section. - * + * * @return the new row * @see #prependRow() * @see #addRowAt(int) @@ -2802,11 +2802,11 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Inserts a new row at the given position. - * + * * @param index * the position at which to insert the row * @return the new row - * + * * @throws IndexOutOfBoundsException * if the index is out of bounds * @see #appendRow() @@ -2833,7 +2833,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Gets the amount of rows in this section. - * + * * @return row count */ public int getRowCount() { @@ -2853,7 +2853,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Removes a column for given property id from the section. - * + * * @param propertyId * property to be removed */ @@ -2865,7 +2865,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Adds a column for given property id to the section. - * + * * @param propertyId * property to be added */ @@ -2877,7 +2877,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Performs a sanity check that section is in correct state. - * + * * @throws IllegalStateException * if merged cells are not i n continuous range */ @@ -2917,7 +2917,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Writes the declarative design to the given table section element. - * + * * @since 7.5.0 * @param tableSectionElement * Element to write design to @@ -2934,7 +2934,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Writes the declarative design from the given table section element. - * + * * @since 7.5.0 * @param tableSectionElement * Element to read design from @@ -2980,10 +2980,10 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Sets the default row of this header. The default row is a special * header row providing a user interface for sorting columns. - * + * * @param row * the new default row, or null for no default row - * + * * @throws IllegalArgumentException * this header does not contain the row */ @@ -3012,7 +3012,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Returns the current default row of this header. The default row is a * special header row providing a user interface for sorting columns. - * + * * @return the default row or null if no default row set */ public HeaderRow getDefaultRow() { @@ -3106,11 +3106,12 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, } @Override - protected void readDesign(Element trElement, DesignContext designContext) { + protected void readDesign(Element trElement, + DesignContext designContext) { super.readDesign(trElement, designContext); - boolean defaultRow = DesignAttributeHandler.readAttribute( - "default", trElement.attributes(), false, boolean.class); + boolean defaultRow = DesignAttributeHandler.readAttribute("default", + trElement.attributes(), false, boolean.class); if (defaultRow) { section.grid.setDefaultHeaderRow(this); } @@ -3221,7 +3222,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Internally used constructor. - * + * * @param grid * The grid this column belongs to. Should not be null. * @param state @@ -3239,7 +3240,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Returns the serializable state of this column that is sent to the * client side connector. - * + * * @return the internal state of the column */ GridColumnState getState() { @@ -3248,7 +3249,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Returns the property id for the backing property of this Column - * + * * @return property id */ public Object getPropertyId() { @@ -3258,9 +3259,9 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Returns the caption of the header. By default the header caption is * the property id of the column. - * + * * @return the text in the default row of header. - * + * * @throws IllegalStateException * if the column no longer is attached to the grid */ @@ -3274,11 +3275,11 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * Sets the caption of the header. This caption is also used as the * hiding toggle caption, unless it is explicitly set via * {@link #setHidingToggleCaption(String)}. - * + * * @param caption * the text to show in the caption * @return the column itself - * + * * @throws IllegalStateException * if the column is no longer attached to any grid */ @@ -3292,15 +3293,15 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, HeaderRow row = grid.getHeader().getDefaultRow(); if (row != null) { - row.getCell(grid.getPropertyIdByColumnId(state.id)).setText( - caption); + row.getCell(grid.getPropertyIdByColumnId(state.id)) + .setText(caption); } return this; } /** * Gets the caption of the hiding toggle for this column. - * + * * @since 7.5.0 * @see #setHidingToggleCaption(String) * @return the caption for the hiding toggle for this column @@ -3322,7 +3323,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, *

          * NOTE: setting this to empty string might cause the hiding * toggle to not render correctly. - * + * * @since 7.5.0 * @param hidingToggleCaption * the text to show in the column hiding toggle @@ -3340,7 +3341,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Returns the width (in pixels). By default a column is 100px wide. - * + * * @return the width in pixels of the column * @throws IllegalStateException * if the column is no longer attached to any grid @@ -3356,23 +3357,23 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * This overrides any configuration set by any of * {@link #setExpandRatio(int)}, {@link #setMinimumWidth(double)} or * {@link #setMaximumWidth(double)}. - * + * * @param pixelWidth * the new pixel width of the column * @return the column itself - * + * * @throws IllegalStateException * if the column is no longer attached to any grid * @throws IllegalArgumentException * thrown if pixel width is less than zero */ - public Column setWidth(double pixelWidth) throws IllegalStateException, - IllegalArgumentException { + public Column setWidth(double pixelWidth) + throws IllegalStateException, IllegalArgumentException { checkColumnIsAttached(); if (pixelWidth < 0) { throw new IllegalArgumentException( - "Pixel width should be greated than 0 (in " - + toString() + ")"); + "Pixel width should be greated than 0 (in " + toString() + + ")"); } if (state.width != pixelWidth) { state.width = pixelWidth; @@ -3384,7 +3385,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Returns whether this column has an undefined width. - * + * * @since 7.6 * @return whether the width is undefined * @throws IllegalStateException @@ -3399,7 +3400,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * Marks the column width as undefined. An undefined width means the * grid is free to resize the column based on the cell contents and * available space in the grid. - * + * * @return the column itself */ public Column setWidthUndefined() { @@ -3415,7 +3416,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Checks if column is attached and throws an * {@link IllegalStateException} if it is not - * + * * @throws IllegalStateException * if the column is no longer attached to any grid */ @@ -3427,17 +3428,18 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Sets this column as the last frozen column in its grid. - * + * * @return the column itself - * + * * @throws IllegalArgumentException * if the column is no longer attached to any grid * @see Grid#setFrozenColumnCount(int) */ public Column setLastFrozenColumn() { checkColumnIsAttached(); - grid.setFrozenColumnCount(grid.getState(false).columnOrder - .indexOf(getState().id) + 1); + grid.setFrozenColumnCount( + grid.getState(false).columnOrder.indexOf(getState().id) + + 1); return this; } @@ -3446,14 +3448,14 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, *

          * If a suitable converter isn't defined explicitly, the session * converter factory is used to find a compatible converter. - * + * * @param renderer * the renderer to use * @return the column itself - * + * * @throws IllegalArgumentException * if no compatible converter could be found - * + * * @see VaadinSession#getConverterFactory() * @see ConverterUtil#getConverter(Class, Class, VaadinSession) * @see #setConverter(Converter) @@ -3473,13 +3475,13 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Sets the renderer for this column and the converter used to convert * from the property value type to the renderer presentation type. - * + * * @param renderer * the renderer to use, cannot be null * @param converter * the converter to use * @return the column itself - * + * * @throws IllegalArgumentException * if the renderer is already associated with a grid column */ @@ -3504,12 +3506,12 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Sets the converter used to convert from the property value type to * the renderer presentation type. - * + * * @param converter * the converter to use, or {@code null} to not use any * converters * @return the column itself - * + * * @throws IllegalArgumentException * if the types are not compatible */ @@ -3540,7 +3542,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * Since the converter is null (i.e. will be removed), we need * to know that the renderer and model are compatible. If not, * we can't allow for this to happen. - * + * * The constructor is allowed to call this method with null * without any compatibility checks, therefore we have a special * case for it. @@ -3548,17 +3550,14 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, Class rendererPresentationType = getRenderer() .getPresentationType(); - if (!isFirstConverterAssignment - && !rendererPresentationType - .isAssignableFrom(modelType)) { + if (!isFirstConverterAssignment && !rendererPresentationType + .isAssignableFrom(modelType)) { throw new IllegalArgumentException( "Cannot remove converter, " + "as renderer's presentation type " + rendererPresentationType.getName() - + " and column's " - + "model " - + modelType.getName() - + " type aren't " + + " and column's " + "model " + + modelType.getName() + " type aren't " + "directly compatible with each other (in " + toString() + ")"); } @@ -3575,7 +3574,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Returns the renderer instance used by this column. - * + * * @return the renderer */ public Renderer getRenderer() { @@ -3584,7 +3583,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Returns the converter instance used by this column. - * + * * @return the converter */ public Converter getConverter() { @@ -3624,8 +3623,8 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, } private Class getModelType() { - return grid.getContainerDataSource().getType( - grid.getPropertyIdByColumnId(state.id)); + return grid.getContainerDataSource() + .getType(grid.getPropertyIdByColumnId(state.id)); } /** @@ -3633,12 +3632,12 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * sorted by a sortable column by clicking or tapping the column's * default header. Programmatic sorting using the Grid#sort methods is * not affected by this setting. - * + * * @param sortable * {@code true} if the user should be able to sort the * column, {@code false} otherwise * @return the column itself - * + * * @throws IllegalStateException * if the data source of the Grid does not implement * {@link Sortable} @@ -3651,15 +3650,14 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, if (sortable) { if (!(grid.datasource instanceof Sortable)) { - throw new IllegalStateException( - "Can't set column " - + toString() - + " sortable. The Container of Grid does not implement Sortable"); + throw new IllegalStateException("Can't set column " + + toString() + + " sortable. The Container of Grid does not implement Sortable"); } else if (!((Sortable) grid.datasource) - .getSortableContainerPropertyIds().contains(propertyId)) { + .getSortableContainerPropertyIds() + .contains(propertyId)) { throw new IllegalStateException( - "Can't set column " - + toString() + "Can't set column " + toString() + " sortable. Container doesn't support sorting by property " + propertyId); } @@ -3675,7 +3673,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, *

          * Note: it is possible to sort by this column programmatically * using the Grid#sort methods regardless of the returned value. - * + * * @return {@code true} if the column is sortable by the user, * {@code false} otherwise */ @@ -3708,7 +3706,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * reserves only one of those. The column with a ratio of 2, is as wide * as it needs to be, plus two thirds of the excess * width. - * + * * @param expandRatio * the expand ratio of this column. {@code 0} to not have it * expand at all. A negative number to clear the expand @@ -3728,7 +3726,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Returns the column's expand ratio. - * + * * @return the column's expand ratio * @see #setExpandRatio(int) */ @@ -3740,7 +3738,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * Clears the expand ratio for this column. *

          * Equal to calling {@link #setExpandRatio(int) setExpandRatio(-1)} - * + * * @throws IllegalStateException * if the column is no longer attached to any grid */ @@ -3753,7 +3751,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, *

          * This defines the minimum guaranteed pixel width of the column * when it is set to expand. - * + * * @throws IllegalStateException * if the column is no longer attached to any grid * @see #setExpandRatio(int) @@ -3775,7 +3773,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Return the minimum width for this column. - * + * * @return the minimum width for this column * @see #setMinimumWidth(double) */ @@ -3786,9 +3784,9 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Sets the maximum width for this column. *

          - * This defines the maximum allowed pixel width of the column - * when it is set to expand. - * + * This defines the maximum allowed pixel width of the column when + * it is set to expand. + * * @param pixels * the maximum width * @throws IllegalStateException @@ -3812,7 +3810,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Returns the maximum width for this column. - * + * * @return the maximum width for this column * @see #setMaximumWidth(double) */ @@ -3830,15 +3828,15 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * are not automatically assigned an editor field and, if one is * manually assigned, it is not used. Columns that cannot (or should * not) be edited even in principle should be set non-editable. - * + * * @param editable * {@code true} if this column should be editable, * {@code false} otherwise * @return this column - * + * * @throws IllegalStateException * if the editor is currently active - * + * * @see Grid#editItem(Object) * @see Grid#isEditorActive() */ @@ -3856,10 +3854,10 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Returns whether the properties corresponding to this column should be * editable when the item editor is active. - * + * * @return {@code true} if this column is editable, {@code false} * otherwise - * + * * @see Grid#editItem(Object) * @see #setEditable(boolean) */ @@ -3877,7 +3875,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * Setting the field to null clears any previously set * field, causing a new field to be created the next time the item * editor is opened. - * + * * @param editor * the editor field * @return this column @@ -3900,10 +3898,10 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * user-provided FieldGroup might cause * {@link com.vaadin.data.fieldgroup.FieldGroup.BindException * BindException} to be thrown. - * + * * @return the bound field; or null if the respective * column is not editable - * + * * @throws IllegalArgumentException * if there is no column for the provided property id * @throws FieldGroup.BindException @@ -3917,7 +3915,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Hides or shows the column. By default columns are visible before * explicitly hiding them. - * + * * @since 7.5.0 * @param hidden * true to hide the column, false @@ -3935,7 +3933,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Returns whether this column is hidden. Default is {@code false}. - * + * * @since 7.5.0 * @return true if the column is currently hidden, * false otherwise @@ -3947,7 +3945,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Sets whether this column can be hidden by the user. Hidable columns * can be hidden and shown via the sidebar menu. - * + * * @since 7.5.0 * @param hidable * true iff the column may be hidable by the @@ -3968,7 +3966,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, *

          * Note: the column can be programmatically hidden using * {@link #setHidden(boolean)} regardless of the returned value. - * + * * @since 7.5.0 * @return true if the user can hide the column, * false if not @@ -3979,7 +3977,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Sets whether this column can be resized by the user. - * + * * @since 7.6 * @param resizable * {@code true} if this column should be resizable, @@ -4000,7 +3998,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * Note: the column can be programmatically resized using * {@link #setWidth(double)} and {@link #setWidthUndefined()} regardless * of the returned value. - * + * * @since 7.6 * @return {@code true} if this column is resizable, {@code false} * otherwise @@ -4011,16 +4009,17 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Writes the design attributes for this column into given element. - * + * * @since 7.5.0 - * + * * @param design * Element to write attributes into - * + * * @param designContext * the design context */ - protected void writeDesign(Element design, DesignContext designContext) { + protected void writeDesign(Element design, + DesignContext designContext) { Attributes attributes = design.attributes(); GridColumnState def = new GridColumnState(); @@ -4054,7 +4053,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Reads the design attributes for this column from given element. - * + * * @since 7.5.0 * @param design * Element to read attributes from @@ -4096,12 +4095,12 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, attributes, Double.class)); } if (design.hasAttr("min-width")) { - setMinimumWidth(DesignAttributeHandler.readAttribute( - "min-width", attributes, Double.class)); + setMinimumWidth(DesignAttributeHandler + .readAttribute("min-width", attributes, Double.class)); } if (design.hasAttr("max-width")) { - setMaximumWidth(DesignAttributeHandler.readAttribute( - "max-width", attributes, Double.class)); + setMaximumWidth(DesignAttributeHandler + .readAttribute("max-width", attributes, Double.class)); } if (design.hasAttr("expand")) { if (design.attr("expand").isEmpty()) { @@ -4120,12 +4119,12 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * currently extends the AbstractExtension superclass, but this fact should * be regarded as an implementation detail and subject to change in a future * major or minor Vaadin revision. - * + * * @param * the type this renderer knows how to present */ - public static abstract class AbstractRenderer extends - AbstractGridExtension implements Renderer { + public static abstract class AbstractRenderer + extends AbstractGridExtension implements Renderer { private final Class presentationType; @@ -4177,7 +4176,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Null representation for the renderer - * + * * @return a textual representation of {@code null} */ protected String getNullRepresentation() { @@ -4193,7 +4192,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * is desired. For instance, a {@code Renderer} could first turn a * date value into a formatted string and return * {@code encode(dateString, String.class)}. - * + * * @param value * the value to be encoded * @param type @@ -4201,15 +4200,16 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * @return a JSON representation of the given value */ protected JsonValue encode(U value, Class type) { - return JsonCodec.encode(value, null, type, - getUI().getConnectorTracker()).getEncodedValue(); + return JsonCodec + .encode(value, null, type, getUI().getConnectorTracker()) + .getEncodedValue(); } /** * Converts and encodes the given data model property value using the * given converter and renderer. This method is public only for testing * purposes. - * + * * @since 7.6 * @param renderer * the renderer to use @@ -4222,7 +4222,8 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * @return an encoded value ready to be sent to the client */ public static JsonValue encodeValue(Object modelValue, - Renderer renderer, Converter converter, Locale locale) { + Renderer renderer, Converter converter, + Locale locale) { Class presentationType = renderer.getPresentationType(); T presentationValue; @@ -4245,13 +4246,13 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, } } } else { - assert presentationType.isAssignableFrom(converter - .getPresentationType()); + assert presentationType + .isAssignableFrom(converter.getPresentationType()); @SuppressWarnings("unchecked") Converter safeConverter = (Converter) converter; - presentationValue = safeConverter - .convertToPresentation(modelValue, - safeConverter.getPresentationType(), locale); + presentationValue = safeConverter.convertToPresentation( + modelValue, safeConverter.getPresentationType(), + locale); } JsonValue encodedValue; @@ -4277,11 +4278,11 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * Note: If the extension is an instance of {@link DataGenerator} it will * automatically register itself to {@link RpcDataProviderExtension} of * extended Grid. On remove this registration is automatically removed. - * + * * @since 7.5 */ - public static abstract class AbstractGridExtension extends - AbstractExtension { + public static abstract class AbstractGridExtension + extends AbstractExtension { /** * Constructs a new Grid extension. @@ -4292,7 +4293,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Constructs a new Grid extension and extends given Grid. - * + * * @param grid * a grid instance */ @@ -4327,7 +4328,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * A key is used to identify a particular row on both a server and a * client. This method can be used to get the item id for the row key * that the client has sent. - * + * * @param rowKey * the row key for which to retrieve an item id * @return the item id corresponding to {@code key} @@ -4342,7 +4343,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * An id is used to identify a particular column on both a server and a * client. This method can be used to get the column for the column id * that the client has sent. - * + * * @param columnId * the column id for which to retrieve a column * @return the column corresponding to {@code columnId} @@ -4353,7 +4354,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Gets the parent Grid of the renderer. - * + * * @return parent grid * @throws IllegalStateException * if parent is not Grid @@ -4375,7 +4376,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Resends the row data for given item id to the client. - * + * * @since 7.6 * @param itemId * row to refresh @@ -4387,7 +4388,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Informs the parent Grid that this Extension wants to add a child * component to it. - * + * * @since 7.6 * @param c * component @@ -4399,7 +4400,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Informs the parent Grid that this Extension wants to remove a child * component from it. - * + * * @since 7.6 * @param c * component @@ -4436,8 +4437,8 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, @Override public void containerPropertySetChange(PropertySetChangeEvent event) { - Collection properties = new HashSet(event.getContainer() - .getContainerPropertyIds()); + Collection properties = new HashSet( + event.getContainer().getContainerPropertyIds()); // Find columns that need to be removed. List removedColumns = new LinkedList(); @@ -4474,7 +4475,8 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, .getSortableContainerPropertyIds(); for (Object propertyId : columns.keySet()) { Column column = columns.get(propertyId); - if (!sortables.contains(propertyId) && column.isSortable()) { + if (!sortables.contains(propertyId) + && column.isSortable()) { column.setSortable(false); } } @@ -4510,7 +4512,8 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, private Object editedItemId = null; private boolean editorActive = false; /** - * True while the editor is storing the field values, i.e. commiting the field group. + * True while the editor is storing the field values, i.e. commiting the + * field group. */ private boolean editorSaving = false; private FieldGroup editorFieldGroup = new CustomFieldGroup(); @@ -4525,7 +4528,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * true if Grid is using the internal IndexedContainer created * in Grid() constructor, or false if the user has set their * own Container. - * + * * @see #setContainerDataSource(Indexed) * @see #Grid() */ @@ -4538,18 +4541,19 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, private Set extensionComponents = new HashSet(); private static final Method SELECTION_CHANGE_METHOD = ReflectTools - .findMethod(SelectionListener.class, "select", SelectionEvent.class); + .findMethod(SelectionListener.class, "select", + SelectionEvent.class); private static final Method SORT_ORDER_CHANGE_METHOD = ReflectTools .findMethod(SortListener.class, "sort", SortEvent.class); - private static final Method COLUMN_REORDER_METHOD = ReflectTools - .findMethod(ColumnReorderListener.class, "columnReorder", - ColumnReorderEvent.class); + private static final Method COLUMN_REORDER_METHOD = ReflectTools.findMethod( + ColumnReorderListener.class, "columnReorder", + ColumnReorderEvent.class); - private static final Method COLUMN_RESIZE_METHOD = ReflectTools - .findMethod(ColumnResizeListener.class, "columnResize", - ColumnResizeEvent.class); + private static final Method COLUMN_RESIZE_METHOD = ReflectTools.findMethod( + ColumnResizeListener.class, "columnResize", + ColumnResizeEvent.class); private static final Method COLUMN_VISIBILITY_METHOD = ReflectTools .findMethod(ColumnVisibilityChangeListener.class, @@ -4566,7 +4570,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Creates a new Grid using the given data source. - * + * * @param dataSource * the indexed container to use as a data source */ @@ -4577,7 +4581,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Creates a new Grid with the given caption and a new * {@link IndexedContainer} data source. - * + * * @param caption * the caption of the grid */ @@ -4588,7 +4592,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Creates a new Grid with the given caption and data source. If the data * source is null, a new {@link IndexedContainer} will be used. - * + * * @param caption * the caption of the grid * @param dataSource @@ -4664,11 +4668,13 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, getState(false).columnOrder = newColumnOrder; // write changes to diffState so that possible reverting the // column order is sent to client - assert diffState.hasKey(diffStateKey) : "Field name has changed"; + assert diffState + .hasKey(diffStateKey) : "Field name has changed"; Type type = null; try { - type = (getState(false).getClass().getDeclaredField( - diffStateKey).getGenericType()); + type = (getState(false).getClass() + .getDeclaredField(diffStateKey) + .getGenericType()); } catch (NoSuchFieldException e) { e.printStackTrace(); } catch (SecurityException e) { @@ -4703,11 +4709,13 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, JsonObject diffState = connectorTracker .getDiffState(Grid.this); - assert diffState.hasKey(diffStateKey) : "Field name has changed"; + assert diffState + .hasKey(diffStateKey) : "Field name has changed"; Type type = null; try { - type = (getState(false).getClass().getDeclaredField( - diffStateKey).getGenericType()); + type = (getState(false).getClass() + .getDeclaredField(diffStateKey) + .getGenericType()); } catch (NoSuchFieldException e) { e.printStackTrace(); } catch (SecurityException e) { @@ -4726,14 +4734,14 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, @Override public void contextClick(int rowIndex, String rowKey, - String columnId, Section section, MouseEventDetails details) { + String columnId, Section section, + MouseEventDetails details) { Object itemId = null; if (rowKey != null) { itemId = getKeyMapper().get(rowKey); } - fireEvent(new GridContextClickEvent(Grid.this, details, - section, rowIndex, itemId, - getPropertyIdByColumnId(columnId))); + fireEvent(new GridContextClickEvent(Grid.this, details, section, + rowIndex, itemId, getPropertyIdByColumnId(columnId))); } @Override @@ -4804,8 +4812,8 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, success = true; } catch (CommitException e) { try { - CommitErrorEvent event = new CommitErrorEvent( - Grid.this, e); + CommitErrorEvent event = new CommitErrorEvent(Grid.this, + e); getEditorErrorHandler().commitError(event); errorMessage = event.getUserErrorMessage(); @@ -4827,8 +4835,8 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, } private void handleError(Exception e) { - com.vaadin.server.ErrorEvent.findErrorHandler(Grid.this).error( - new ConnectorErrorEvent(Grid.this, e)); + com.vaadin.server.ErrorEvent.findErrorHandler(Grid.this) + .error(new ConnectorErrorEvent(Grid.this, e)); } }); } @@ -4980,8 +4988,8 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, // Initial sorting is defined by container if (datasource instanceof Sortable) { column.setSortable(((Sortable) datasource) - .getSortableContainerPropertyIds().contains( - propertyId)); + .getSortableContainerPropertyIds() + .contains(propertyId)); } else { column.setSortable(false); } @@ -4992,8 +5000,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, if (!properties.contains(property)) { throw new IllegalStateException( "Found at least one column in Grid that does not exist in the given container: " - + property - + " with the header \"" + + property + " with the header \"" + getColumn(property).getHeaderCaption() + "\". " + "Call removeAllColumns() before setContainerDataSource() if you want to reconfigure the columns based on the new container."); @@ -5001,8 +5008,8 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, if (!(datasource instanceof Sortable) || !((Sortable) datasource) - .getSortableContainerPropertyIds().contains( - property)) { + .getSortableContainerPropertyIds() + .contains(property)) { columns.get(property).setSortable(false); } } @@ -5011,7 +5018,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Returns the grid data source. - * + * * @return the container data source of the grid */ public Container.Indexed getContainerDataSource() { @@ -5020,7 +5027,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Returns a column based on the property id - * + * * @param propertyId * the property id of the column * @return the column or null if not found @@ -5032,7 +5039,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Returns a copy of currently configures columns in their current visual * order in this Grid. - * + * * @return unmodifiable copy of current columns in visual order */ public List getColumns() { @@ -5050,11 +5057,11 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, *

          * Note that adding a new property is only done for the default container * that Grid sets up with the default constructor. - * + * * @param propertyId * the property id of the new column * @return the new column - * + * * @throws IllegalStateException * if column for given property already exists in this grid */ @@ -5067,13 +5074,13 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, addColumnProperty(propertyId, String.class, ""); } else { if (columns.containsKey(propertyId)) { - throw new IllegalStateException("A column for property id '" - + propertyId.toString() - + "' already exists in this grid"); + throw new IllegalStateException( + "A column for property id '" + propertyId.toString() + + "' already exists in this grid"); } else { - throw new IllegalStateException("Property id '" - + propertyId.toString() - + "' does not exist in the container"); + throw new IllegalStateException( + "Property id '" + propertyId.toString() + + "' does not exist in the container"); } } @@ -5097,13 +5104,13 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, *

          * Note that adding a new property is only done for the default container * that Grid sets up with the default constructor. - * + * * @param propertyId * the property id of the new column * @param type * the data type for the new property * @return the new column - * + * * @throws IllegalStateException * if column for given property already exists in this grid or * property already exists in the container with wrong type @@ -5124,9 +5131,8 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, if (!datasource.getContainerPropertyIds().contains(propertyId)) { datasource.addContainerProperty(propertyId, type, defaultValue); } else { - Property containerProperty = datasource - .getContainerProperty(datasource.firstItemId(), - propertyId); + Property containerProperty = datasource.getContainerProperty( + datasource.firstItemId(), propertyId); if (containerProperty.getType() == type) { appendColumn(propertyId); } else { @@ -5157,7 +5163,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * Used internally by the {@link Grid} to get a {@link Column} by * referencing its generated state id. Also used by {@link Column} to verify * if it has been detached from the {@link Grid}. - * + * * @param columnId * the client id generated for the column when the column is * added to the grid @@ -5171,7 +5177,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Used internally by the {@link Grid} to get a property id by referencing * the columns generated state id. - * + * * @param columnId * The state id of the column * @return The column instance or null if not found @@ -5183,7 +5189,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Returns whether column reordering is allowed. Default value is * false. - * + * * @since 7.5.0 * @return true if reordering is allowed */ @@ -5194,7 +5200,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Sets whether or not column reordering is allowed. Default value is * false. - * + * * @since 7.5.0 * @param columnReorderingAllowed * specifies whether column reordering is allowed @@ -5218,7 +5224,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Creates a new column based on a property id and appends it as the last * column. - * + * * @param datasourcePropertyId * The property id of a property in the datasource */ @@ -5240,8 +5246,8 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, header.addColumn(datasourcePropertyId); footer.addColumn(datasourcePropertyId); - String humanFriendlyPropertyId = SharedUtil - .propertyIdToHumanFriendly(String.valueOf(datasourcePropertyId)); + String humanFriendlyPropertyId = SharedUtil.propertyIdToHumanFriendly( + String.valueOf(datasourcePropertyId)); column.setHeaderCaption(humanFriendlyPropertyId); if (datasource instanceof Sortable @@ -5255,14 +5261,15 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Removes a column from Grid based on a property id. - * + * * @param propertyId * The property id of column to be removed - * + * * @throws IllegalArgumentException * if there is no column for given property id in this grid */ - public void removeColumn(Object propertyId) throws IllegalArgumentException { + public void removeColumn(Object propertyId) + throws IllegalArgumentException { if (!columns.keySet().contains(propertyId)) { throw new IllegalArgumentException( "There is no column for given property id " + propertyId); @@ -5289,9 +5296,9 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * property id is not in propertyIds are removed. Similarly, a column is * added for any property id in propertyIds that has no corresponding column * in this Grid. - * + * * @since 7.5.0 - * + * * @param propertyIds * properties in the desired column order */ @@ -5313,7 +5320,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * Sets a new column order for the grid. All columns which are not ordered * here will remain in the order they were before as the last columns of * grid. - * + * * @param propertyIds * properties in the order columns should be */ @@ -5345,10 +5352,10 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * -1 will also disable the selection column. *

          * The default value is 0. - * + * * @param numberOfColumns * the number of columns that should be frozen - * + * * @throws IllegalArgumentException * if the column count is < 0 or > the number of visible columns */ @@ -5370,9 +5377,9 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, *

          * NOTE: this count includes {@link Column#isHidden() hidden * columns} in the count. - * + * * @see #setFrozenColumnCount(int) - * + * * @return the number of frozen columns */ public int getFrozenColumnCount() { @@ -5384,7 +5391,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, *

          * If the item has visible details, its size will also be taken into * account. - * + * * @param itemId * id of item to scroll to. * @throws IllegalArgumentException @@ -5399,7 +5406,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, *

          * If the item has visible details, its size will also be taken into * account. - * + * * @param itemId * id of item to scroll to. * @param destination @@ -5443,7 +5450,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, *

          * If Grid is currently not in {@link HeightMode#ROW}, the given value is * remembered, and applied once the mode is applied. - * + * * @param rows * The height in terms of number of rows displayed in Grid's * body. If Grid doesn't contain enough rows, white space is @@ -5473,7 +5480,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Gets the amount of rows in Grid's body that are shown, while * {@link #getHeightMode()} is {@link HeightMode#ROW}. - * + * * @return the amount of rows that are being shown in Grid's body * @see #setHeightByRows(double) */ @@ -5486,7 +5493,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, *

          * Note: This method will change the widget's size in the browser * only if {@link #getHeightMode()} returns {@link HeightMode#CSS}. - * + * * @see #setHeightMode(HeightMode) */ @Override @@ -5505,7 +5512,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * Note: If headers/footers are inserted or removed, the widget * will resize itself to still display the required amount of rows in its * body. It also takes the horizontal scrollbar into account. - * + * * @param heightMode * the mode in to which Grid should be set */ @@ -5515,7 +5522,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * widget dimensions (height/width) on each state change event. The * original design was to have setHeight and setHeightByRow be equals, * and whichever was called the latest was considered in effect. - * + * * But, because of Vaadin always calling setHeight on the widget, this * approach doesn't work. */ @@ -5527,7 +5534,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * Returns the current {@link HeightMode} the Grid is in. *

          * Defaults to {@link HeightMode#CSS}. - * + * * @return the current HeightMode */ public HeightMode getHeightMode() { @@ -5543,7 +5550,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * deselected. *

          * If the given SelectionModel is already in use, this method does nothing. - * + * * @param selectionModel * the new SelectionModel to use * @throws IllegalArgumentException @@ -5569,7 +5576,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Returns the currently used {@link SelectionModel}. - * + * * @return the currently used SelectionModel */ public SelectionModel getSelectionModel() { @@ -5594,8 +5601,8 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * grid.setSelectionMode(SelectionMode.MULTI); * grid.setSelectionModel(new MultiSelectionMode()); * - * - * + * + * * @param selectionMode * the selection mode to switch to * @return The {@link SelectionModel} instance that was taken into use @@ -5606,7 +5613,8 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, public SelectionModel setSelectionMode(final SelectionMode selectionMode) throws IllegalArgumentException { if (selectionMode == null) { - throw new IllegalArgumentException("selection mode may not be null"); + throw new IllegalArgumentException( + "selection mode may not be null"); } final SelectionModel newSelectionModel = selectionMode.createModel(); setSelectionModel(newSelectionModel); @@ -5615,7 +5623,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Checks whether an item is selected or not. - * + * * @param itemId * the item id to check for * @return true iff the item is selected @@ -5630,7 +5638,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, *

          * This method is a shorthand that delegates to the * {@link #getSelectionModel() selection model}. - * + * * @return a collection of all the currently selected itemIds */ // keep this javadoc in sync with SelectionModel.getSelectedRows @@ -5644,7 +5652,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * This method is a shorthand that delegates to the * {@link #getSelectionModel() selection model}. Only * {@link SelectionModel.Single} is supported. - * + * * @return the item id of the currently selected item, or null * if nothing is selected * @throws IllegalStateException @@ -5661,10 +5669,10 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, + "(the current selection model is " + selectionModel.getClass().getName() + ")."); } else if (selectionModel instanceof SelectionModel.None) { - throw new IllegalStateException("Cannot get selected row: " - + "Grid selection is disabled " - + "(the current selection model is " - + selectionModel.getClass().getName() + ")."); + throw new IllegalStateException( + "Cannot get selected row: " + "Grid selection is disabled " + + "(the current selection model is " + + selectionModel.getClass().getName() + ")."); } else { throw new IllegalStateException("Cannot get selected row: " + "Grid selection model does not implement " @@ -5682,7 +5690,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * {@link #getSelectionModel() selection model}. Only * {@link SelectionModel.Single} and {@link SelectionModel.Multi} are * supported. - * + * * @param itemId * the itemId to mark as selected * @return true if the selection state changed, @@ -5700,8 +5708,8 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * {@code SelectionModel.Single} or {@code SelectionModel.Multi} */ // keep this javadoc in sync with SelectionModel.Single.select - public boolean select(Object itemId) throws IllegalArgumentException, - IllegalStateException { + public boolean select(Object itemId) + throws IllegalArgumentException, IllegalStateException { if (selectionModel instanceof SelectionModel.Single) { return ((SelectionModel.Single) selectionModel).select(itemId); } else if (selectionModel instanceof SelectionModel.Multi) { @@ -5728,7 +5736,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * {@link #getSelectionModel() selection model}. Only * {@link SelectionModel.Single} and {@link SelectionModel.Multi} are * supported. - * + * * @param itemId * the itemId to remove from being selected * @return true if the selection state changed, @@ -5775,7 +5783,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * {@link #getSelectionModel() selection model}. Only * {@link SelectionModel.Single} and {@link SelectionModel.Multi} are * supported. - * + * * @return true if the selection state changed, * false if the itemId was already selected * @throws IllegalStateException @@ -5795,10 +5803,10 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, } else if (selectionModel instanceof SelectionModel.Multi) { return ((SelectionModel.Multi) selectionModel).deselectAll(); } else if (selectionModel instanceof SelectionModel.None) { - throw new IllegalStateException("Cannot deselect all rows" - + ": Grid selection is disabled " - + "(the current selection model is " - + selectionModel.getClass().getName() + ")."); + throw new IllegalStateException( + "Cannot deselect all rows" + ": Grid selection is disabled " + + "(the current selection model is " + + selectionModel.getClass().getName() + ")."); } else { throw new IllegalStateException("Cannot deselect all rows:" + " Grid selection model does not implement " @@ -5816,7 +5824,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * application logic. This method is publicly accessible only so that * {@link SelectionModel SelectionModels} would be able to inform Grid of * these events. - * + * * @param newSelection * the selection that was added by this event * @param oldSelection @@ -5843,7 +5851,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Registers a new column reorder listener. - * + * * @since 7.5.0 * @param listener * the listener to register @@ -5854,7 +5862,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Removes a previously registered column reorder listener. - * + * * @since 7.5.0 * @param listener * the listener to remove @@ -5870,7 +5878,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Registers a new column resize listener. - * + * * @param listener * the listener to register */ @@ -5880,7 +5888,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Removes a previously registered column resize listener. - * + * * @param listener * the listener to remove */ @@ -5890,7 +5898,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Gets the {@link KeyMapper } being used by the data source. - * + * * @return the key mapper being used by the data source */ KeyMapper getKeyMapper() { @@ -5899,7 +5907,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Adds a renderer to this grid's connector hierarchy. - * + * * @param renderer * the renderer to add */ @@ -5913,10 +5921,10 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, *

          * Note: Sorting by a property that has no column in Grid will hide * all possible sorting indicators. - * + * * @param s * a sort instance - * + * * @throws IllegalStateException * if container is not sortable (does not implement * Container.Sortable) @@ -5932,10 +5940,10 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, *

          * Note: Sorting by a property that has no column in Grid will hide * all possible sorting indicators. - * + * * @param propertyId * a property ID - * + * * @throws IllegalStateException * if container is not sortable (does not implement * Container.Sortable) @@ -5951,12 +5959,12 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, *

          * Note: Sorting by a property that has no column in Grid will hide * all possible sorting indicators. - * + * * @param propertyId * a property ID * @param direction * a sort order value (ascending/descending) - * + * * @throws IllegalStateException * if container is not sortable (does not implement * Container.Sortable) @@ -5980,10 +5988,10 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, *

          * Note: Sorting by a property that has no column in Grid will hide * all possible sorting indicators. - * + * * @param order * a sort order list. - * + * * @throws IllegalStateException * if container is not sortable (does not implement * Container.Sortable) @@ -6012,10 +6020,9 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, for (SortOrder o : order) { if (!sortableProps.contains(o.getPropertyId())) { - throw new IllegalArgumentException( - "Property " - + o.getPropertyId() - + " does not exist or is not sortable in the current container"); + throw new IllegalArgumentException("Property " + + o.getPropertyId() + + " does not exist or is not sortable in the current container"); } } @@ -6025,7 +6032,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Get the current sort order list. - * + * * @return a sort order list */ public List getSortOrder() { @@ -6090,7 +6097,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Adds a sort order change listener that gets notified when the sort order * changes. - * + * * @param listener * the sort order change listener to add */ @@ -6102,7 +6109,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Removes a sort order change listener previously added using * {@link #addSortListener(SortListener)}. - * + * * @param listener * the sort order change listener to remove */ @@ -6116,7 +6123,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Returns the header section of this grid. The default header contains a * single row displaying the column captions. - * + * * @return the header */ protected Header getHeader() { @@ -6125,7 +6132,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Gets the header row at given index. - * + * * @param rowIndex * 0 based index for row. Counted from top to bottom * @return header row at given index @@ -6140,11 +6147,11 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * Inserts a new row at the given position to the header section. Shifts the * row currently at that position and any subsequent rows down (adds one to * their indices). - * + * * @param index * the position at which to insert the row * @return the new row - * + * * @throws IllegalArgumentException * if the index is less than 0 or greater than row count * @see #appendHeaderRow() @@ -6158,7 +6165,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Adds a new row at the bottom of the header section. - * + * * @return the new row * @see #prependHeaderRow() * @see #addHeaderRowAt(int) @@ -6173,7 +6180,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * Returns the current default row of the header section. The default row is * a special header row providing a user interface for sorting columns. * Setting a header text for column updates cells in the default header. - * + * * @return the default row or null if no default row set */ public HeaderRow getDefaultHeaderRow() { @@ -6182,7 +6189,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Gets the row count for the header section. - * + * * @return row count */ public int getHeaderRowCount() { @@ -6191,7 +6198,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Adds a new row at the top of the header section. - * + * * @return the new row * @see #appendHeaderRow() * @see #addHeaderRowAt(int) @@ -6204,10 +6211,10 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Removes the given row from the header section. - * + * * @param row * the row to be removed - * + * * @throws IllegalArgumentException * if the row does not exist in this section * @see #removeHeaderRow(int) @@ -6221,10 +6228,10 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Removes the row at the given position from the header section. - * + * * @param rowIndex * the position of the row - * + * * @throws IllegalArgumentException * if no row exists at given index * @see #removeHeaderRow(HeaderRow) @@ -6239,10 +6246,10 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Sets the default row of the header. The default row is a special header * row providing a user interface for sorting columns. - * + * * @param row * the new default row, or null for no default row - * + * * @throws IllegalArgumentException * header does not contain the row */ @@ -6252,7 +6259,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Sets the visibility of the header section. - * + * * @param visible * true to show header section, false to hide */ @@ -6262,7 +6269,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Returns the visibility of the header section. - * + * * @return true if visible, false otherwise. */ public boolean isHeaderVisible() { @@ -6274,7 +6281,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Returns the footer section of this grid. The default header contains a * single row displaying the column captions. - * + * * @return the footer */ protected Footer getFooter() { @@ -6283,7 +6290,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Gets the footer row at given index. - * + * * @param rowIndex * 0 based index for row. Counted from top to bottom * @return footer row at given index @@ -6298,11 +6305,11 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * Inserts a new row at the given position to the footer section. Shifts the * row currently at that position and any subsequent rows down (adds one to * their indices). - * + * * @param index * the position at which to insert the row * @return the new row - * + * * @throws IllegalArgumentException * if the index is less than 0 or greater than row count * @see #appendFooterRow() @@ -6316,7 +6323,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Adds a new row at the bottom of the footer section. - * + * * @return the new row * @see #prependFooterRow() * @see #addFooterRowAt(int) @@ -6329,7 +6336,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Gets the row count for the footer. - * + * * @return row count */ public int getFooterRowCount() { @@ -6338,7 +6345,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Adds a new row at the top of the footer section. - * + * * @return the new row * @see #appendFooterRow() * @see #addFooterRowAt(int) @@ -6351,10 +6358,10 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Removes the given row from the footer section. - * + * * @param row * the row to be removed - * + * * @throws IllegalArgumentException * if the row does not exist in this section * @see #removeFooterRow(int) @@ -6368,10 +6375,10 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Removes the row at the given position from the footer section. - * + * * @param rowIndex * the position of the row - * + * * @throws IllegalArgumentException * if no row exists at given index * @see #removeFooterRow(FooterRow) @@ -6385,7 +6392,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Sets the visibility of the footer section. - * + * * @param visible * true to show footer section, false to hide */ @@ -6395,7 +6402,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Returns the visibility of the footer section. - * + * * @return true if visible, false otherwise. */ public boolean isFooterVisible() { @@ -6471,27 +6478,29 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * {@link RowDescriptionGenerator} is also set, the row description it * generates is displayed for cells for which {@code generator} returns * null. - * + * * @param generator * the description generator to use or {@code null} to remove a * previously set generator if any - * + * * @see #setRowDescriptionGenerator(RowDescriptionGenerator) - * + * * @since 7.6 */ - public void setCellDescriptionGenerator(CellDescriptionGenerator generator) { + public void setCellDescriptionGenerator( + CellDescriptionGenerator generator) { cellDescriptionGenerator = generator; - getState().hasDescriptions = (generator != null || rowDescriptionGenerator != null); + getState().hasDescriptions = (generator != null + || rowDescriptionGenerator != null); datasourceExtension.refreshCache(); } /** * Returns the {@code CellDescriptionGenerator} instance used to generate * descriptions (tooltips) for Grid cells. - * + * * @return the description generator or {@code null} if no generator is set - * + * * @since 7.6 */ public CellDescriptionGenerator getCellDescriptionGenerator() { @@ -6504,28 +6513,29 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * {@link CellDescriptionGenerator} is also set, the row description * generated by {@code generator} is used for cells for which the cell * description generator returns null. - * - * + * + * * @param generator * the description generator to use or {@code null} to remove a * previously set generator if any - * + * * @see #setCellDescriptionGenerator(CellDescriptionGenerator) - * + * * @since 7.6 */ public void setRowDescriptionGenerator(RowDescriptionGenerator generator) { rowDescriptionGenerator = generator; - getState().hasDescriptions = (generator != null || cellDescriptionGenerator != null); + getState().hasDescriptions = (generator != null + || cellDescriptionGenerator != null); datasourceExtension.refreshCache(); } /** * Returns the {@code RowDescriptionGenerator} instance used to generate * descriptions (tooltips) for Grid rows - * + * * @return the description generator or {@code} null if no generator is set - * + * * @since 7.6 */ public RowDescriptionGenerator getRowDescriptionGenerator() { @@ -6534,7 +6544,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Sets the style generator that is used for generating styles for cells - * + * * @param cellStyleGenerator * the cell style generator to set, or null to * remove a previously set generator @@ -6546,7 +6556,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Gets the style generator that is used for generating styles for cells - * + * * @return the cell style generator, or null if no generator is * set */ @@ -6556,7 +6566,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Sets the style generator that is used for generating styles for rows - * + * * @param rowStyleGenerator * the row style generator to set, or null to remove * a previously set generator @@ -6568,7 +6578,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Gets the style generator that is used for generating styles for rows - * + * * @return the row style generator, or null if no generator is * set */ @@ -6585,7 +6595,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * order might have been changed, it's better to instead add items directly * to the underlying container and use {@link Item#getItemProperty(Object)} * to make sure each value is assigned to the intended property. - * + * * @param values * the cell values of the new row, in the same order as the * visible column order, not null. @@ -6609,9 +6619,9 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, List columnOrder = getState(false).columnOrder; if (values.length != columnOrder.size()) { - throw new IllegalArgumentException("There are " - + columnOrder.size() + " visible columns, but " - + values.length + " cell values were provided."); + throw new IllegalArgumentException( + "There are " + columnOrder.size() + " visible columns, but " + + values.length + " cell values were provided."); } // First verify all parameter types @@ -6656,13 +6666,13 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * editor is enabled, the user can open it by double-clicking a row or * hitting enter when a row is focused. The editor can also be opened * programmatically using the {@link #editItem(Object)} method. - * + * * @param isEnabled * true to enable the feature, false * otherwise * @throws IllegalStateException * if an item is currently being edited - * + * * @see #getEditedItemId() */ public void setEditorEnabled(boolean isEnabled) @@ -6679,9 +6689,9 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Checks whether the item editor UI is enabled for this grid. - * + * * @return true iff the editor is enabled for this grid - * + * * @see #setEditorEnabled(boolean) * @see #getEditedItemId() */ @@ -6691,7 +6701,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Gets the id of the item that is currently being edited. - * + * * @return the id of the item that is currently being edited, or * null if no item is being edited at the moment */ @@ -6701,7 +6711,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Gets the field group that is backing the item editor of this grid. - * + * * @return the backing field group */ public FieldGroup getEditorFieldGroup() { @@ -6710,10 +6720,10 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Sets the field group that is backing the item editor of this grid. - * + * * @param fieldGroup * the backing field group - * + * * @throws IllegalStateException * if the editor is currently active */ @@ -6728,7 +6738,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Returns whether an item is currently being edited in the editor. - * + * * @return true iff the editor is open */ public boolean isEditorActive() { @@ -6771,10 +6781,10 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Opens the editor interface for the provided item. Scrolls the Grid to * bring the item to view if it is not already visible. - * + * * Note that any cell content rendered by a WidgetRenderer will not be * visible in the editor row. - * + * * @param itemId * the id of the item to edit * @throws IllegalStateException @@ -6784,8 +6794,8 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * if the {@code itemId} is not in the backing container * @see #setEditorEnabled(boolean) */ - public void editItem(Object itemId) throws IllegalStateException, - IllegalArgumentException { + public void editItem(Object itemId) + throws IllegalStateException, IllegalArgumentException { if (!isEditorEnabled()) { throw new IllegalStateException("Item editor is not enabled"); } else if (isEditorBuffered() && editedItemId != null) { @@ -6806,8 +6816,8 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, editorFieldGroup.setItemDataSource(item); for (Column column : getColumns()) { - column.getState().editorConnector = getEditorField(column - .getPropertyId()); + column.getState().editorConnector = getEditorField( + column.getPropertyId()); } editorActive = true; @@ -6842,10 +6852,10 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * Saves all changes done to the bound fields. *

          * Note: This is a pass-through call to the backing field group. - * + * * @throws CommitException * If the commit was aborted - * + * * @see FieldGroup#commit() */ public void saveEditor() throws CommitException { @@ -6870,8 +6880,8 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, } if (isEditorActive()) { - getEditorRpc().cancel( - getContainerDataSource().indexOfId(editedItemId)); + getEditorRpc() + .cancel(getContainerDataSource().indexOfId(editedItemId)); doCancelEditor(); } } @@ -6914,7 +6924,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, *

          * When {@link #editItem(Object) editItem} is called, fields are * automatically created and bound to any unbound properties. - * + * * @return a collection of all the fields bound to the item editor */ Collection> getEditorFields() { @@ -6937,7 +6947,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * only used when {@link FieldGroup} creates a new field. *

          * Note: This is a pass-through call to the backing field group. - * + * * @param fieldFactory * The field factory to use */ @@ -6947,9 +6957,9 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Sets the error handler for the editor. - * + * * The error handler is called whenever there is an exception in the editor. - * + * * @param editorErrorHandler * The editor error handler to use * @throws IllegalArgumentException @@ -6966,7 +6976,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Gets the error handler used for the editor - * + * * @see #setErrorHandler(com.vaadin.server.ErrorHandler) * @return the editor error handler, never null */ @@ -6979,7 +6989,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * only used when {@link FieldGroup} creates a new field. *

          * Note: This is a pass-through call to the backing field group. - * + * * @return The field factory in use */ public FieldGroupFieldFactory getEditorFieldFactory() { @@ -6988,7 +6998,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Sets the caption on the save button in the Grid editor. - * + * * @param saveCaption * the caption to set * @throws IllegalArgumentException @@ -7004,7 +7014,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Gets the current caption of the save button in the Grid editor. - * + * * @return the current caption of the save button */ public String getEditorSaveCaption() { @@ -7013,7 +7023,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Sets the caption on the cancel button in the Grid editor. - * + * * @param cancelCaption * the caption to set * @throws IllegalArgumentException @@ -7029,7 +7039,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Gets the current caption of the cancel button in the Grid editor. - * + * * @return the current caption of the cancel button */ public String getEditorCancelCaption() { @@ -7039,7 +7049,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Sets the buffered editor mode. The default mode is buffered ( * true). - * + * * @since 7.6 * @param editorBuffered * true to enable buffered editor, @@ -7060,7 +7070,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Gets the buffered editor mode. - * + * * @since 7.6 * @return true if buffered editor is enabled, * false otherwise @@ -7099,7 +7109,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * In most cases Grid will know when column widths need to be recalculated * but this method can be used to force recalculation in situations when * grid does not recalculate automatically. - * + * * @since 7.4.1 */ public void recalculateColumnWidths() { @@ -7108,7 +7118,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Registers a new column visibility change listener - * + * * @since 7.5.0 * @param listener * the listener to register @@ -7121,7 +7131,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Removes a previously registered column visibility change listener - * + * * @since 7.5.0 * @param listener * the listener to remove @@ -7142,7 +7152,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * Sets a new details generator for row details. *

          * The currently opened row details will be re-rendered. - * + * * @since 7.5.0 * @param detailsGenerator * the details generator to set @@ -7156,7 +7166,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Gets the current details generator for row details. - * + * * @since 7.5.0 * @return the detailsGenerator the current details generator */ @@ -7166,7 +7176,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Shows or hides the details for a specific item. - * + * * @since 7.5.0 * @param itemId * the id of the item for which to set details visibility @@ -7180,7 +7190,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Checks whether details are visible for the given item. - * + * * @since 7.5.0 * @param itemId * the id of the item for which to check details visibility @@ -7262,8 +7272,8 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, // Read frozen columns after columns are read. if (attrs.hasKey("frozen-columns")) { - setFrozenColumnCount(DesignAttributeHandler.readAttribute( - "frozen-columns", attrs, int.class)); + setFrozenColumnCount(DesignAttributeHandler + .readAttribute("frozen-columns", attrs, int.class)); } } @@ -7289,7 +7299,8 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, if (selectionModel.getClass().equals(SingleSelectionModel.class)) { selectionMode = SelectionMode.SINGLE; - } else if (selectionModel.getClass().equals(MultiSelectionModel.class)) { + } else if (selectionModel.getClass() + .equals(MultiSelectionModel.class)) { selectionMode = SelectionMode.MULTI; } else if (selectionModel.getClass().equals(NoSelectionModel.class)) { selectionMode = SelectionMode.NONE; @@ -7327,8 +7338,8 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, for (Column c : getColumns()) { Object value = datasource.getItem(itemId) .getItemProperty(c.getPropertyId()).getValue(); - tableRow.appendElement("td").append( - (value != null ? DesignFormatter + tableRow.appendElement("td") + .append((value != null ? DesignFormatter .encodeForTextNode(value.toString()) : "")); } } diff --git a/server/src/main/java/com/vaadin/ui/GridLayout.java b/server/src/main/java/com/vaadin/ui/GridLayout.java index e0fe7c18b7..66195c4a6f 100644 --- a/server/src/main/java/com/vaadin/ui/GridLayout.java +++ b/server/src/main/java/com/vaadin/ui/GridLayout.java @@ -50,12 +50,12 @@ import com.vaadin.ui.declarative.DesignContext; /** * A layout where the components are laid out on a grid using cell coordinates. - * + * *

          * The GridLayout also maintains a cursor for adding components in * left-to-right, top-to-bottom order. *

          - * + * *

          * Each component in a GridLayout uses a defined * {@link GridLayout.Area area} (column1,row1,column2,row2) from the grid. The @@ -63,19 +63,19 @@ import com.vaadin.ui.declarative.DesignContext; * you will get an {@link OverlapsException}. Adding a component with cursor * automatically extends the grid by increasing the grid height. *

          - * + * *

          * The grid coordinates, which are specified by a row and column index, always * start from 0 for the topmost row and the leftmost column. *

          - * + * * @author Vaadin Ltd. * @since 3.0 */ @SuppressWarnings("serial") -public class GridLayout extends AbstractLayout implements - Layout.AlignmentHandler, Layout.SpacingHandler, Layout.MarginHandler, - LayoutClickNotifier { +public class GridLayout extends AbstractLayout + implements Layout.AlignmentHandler, Layout.SpacingHandler, + Layout.MarginHandler, LayoutClickNotifier { private GridLayoutServerRpc rpc = new GridLayoutServerRpc() { @@ -107,10 +107,10 @@ public class GridLayout extends AbstractLayout implements /** * Constructor for a grid of given size (number of columns and rows). - * + * * The grid may grow or shrink later. Grid grows automatically if you add * components outside its area. - * + * * @param columns * Number of columns in the grid. * @param rows @@ -132,9 +132,9 @@ public class GridLayout extends AbstractLayout implements /** * Constructs a GridLayout of given size (number of columns and rows) and * adds the given components in order to the grid. - * + * * @see #addComponents(Component...) - * + * * @param columns * Number of columns in the grid. * @param rows @@ -163,13 +163,13 @@ public class GridLayout extends AbstractLayout implements * by specifying the upper left corner (column1, row1) and the lower right * corner (column2, row2) of the area. The coordinates are zero-based. *

          - * + * *

          * If the area overlaps with any of the existing components already present * in the grid, the operation will fail and an {@link OverlapsException} is * thrown. *

          - * + * * @param component * the component to be added, not null. * @param column1 @@ -191,8 +191,8 @@ public class GridLayout extends AbstractLayout implements * if the cells are outside the grid area. */ public void addComponent(Component component, int column1, int row1, - int column2, int row2) throws OverlapsException, - OutOfBoundsException { + int column2, int row2) + throws OverlapsException, OutOfBoundsException { if (component == null) { throw new NullPointerException("Component must not be null"); @@ -271,7 +271,7 @@ public class GridLayout extends AbstractLayout implements /** * Tests if the given area overlaps with any of the items already on the * grid. - * + * * @param area * the Area to be checked for overlapping. * @throws OverlapsException @@ -282,8 +282,8 @@ public class GridLayout extends AbstractLayout implements .entrySet()) { if (componentsOverlap(entry.getValue(), area.childData)) { // Component not added, overlaps with existing component - throw new OverlapsException(new Area(entry.getValue(), - (Component) entry.getKey())); + throw new OverlapsException( + new Area(entry.getValue(), (Component) entry.getKey())); } } } @@ -293,7 +293,7 @@ public class GridLayout extends AbstractLayout implements * the area.) End coordinates (SouthEast corner of the area) are the same as * column1,row1. The coordinates are zero-based. Component width and height * is 1. - * + * * @param component * the component to be added, not null. * @param column @@ -313,16 +313,16 @@ public class GridLayout extends AbstractLayout implements /** * Forces the next component to be added at the beginning of the next line. - * + * *

          * Sets the cursor column to 0 and increments the cursor row by one. *

          - * + * *

          * By calling this function you can ensure that no more components are added * right of the previous component. *

          - * + * * @see #space() */ public void newLine() { @@ -333,7 +333,7 @@ public class GridLayout extends AbstractLayout implements /** * Moves the cursor forward by one. If the cursor goes out of the right grid * border, it is moved to the first column of the next row. - * + * * @see #newLine() */ public void space() { @@ -349,7 +349,7 @@ public class GridLayout extends AbstractLayout implements * cursor position is already occupied, the cursor is moved forwards to find * free position. If the cursor goes out from the bottom of the grid, the * grid is automatically extended. - * + * * @param component * the component to be added, not null. */ @@ -385,7 +385,7 @@ public class GridLayout extends AbstractLayout implements /** * Removes the specified component from the layout. - * + * * @param component * the component to be removed. */ @@ -404,7 +404,7 @@ public class GridLayout extends AbstractLayout implements /** * Removes the component specified by its cell coordinates. - * + * * @param column * the component's column, starting from 0. * @param row @@ -413,7 +413,8 @@ public class GridLayout extends AbstractLayout implements public void removeComponent(int column, int row) { // Finds the area - for (final Iterator i = components.iterator(); i.hasNext();) { + for (final Iterator i = components.iterator(); i + .hasNext();) { final Component component = i.next(); final ChildComponentData childData = getState().childData .get(component); @@ -427,7 +428,7 @@ public class GridLayout extends AbstractLayout implements /** * Gets an Iterator for the components contained in the layout. By using the * Iterator it is possible to step through the contents of the layout. - * + * * @return the Iterator of the components inside the layout. */ @Override @@ -438,7 +439,7 @@ public class GridLayout extends AbstractLayout implements /** * Gets the number of components contained in the layout. Consistent with * the iterator returned by {@link #getComponentIterator()}. - * + * * @return the number of contained components */ @Override @@ -488,7 +489,7 @@ public class GridLayout extends AbstractLayout implements /* * (non-Javadoc) - * + * * @see com.vaadin.ui.Layout.AlignmentHandler#getComponentAlignment(com * .vaadin.ui.Component) */ @@ -506,17 +507,17 @@ public class GridLayout extends AbstractLayout implements /** * Defines a rectangular area of cells in a GridLayout. - * + * *

          * Also maintains a reference to the component contained in the area. *

          - * + * *

          * The area is specified by the cell coordinates of its upper left corner * (column1,row1) and lower right corner (column2,row2). As otherwise with * GridLayout, the column and row coordinates start from zero. *

          - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -528,7 +529,7 @@ public class GridLayout extends AbstractLayout implements *

          * Construct a new area on a grid. *

          - * + * * @param component * the component connected to the area. * @param column1 @@ -562,7 +563,7 @@ public class GridLayout extends AbstractLayout implements /** * Tests if this Area overlaps with another Area. - * + * * @param other * the other Area that is to be tested for overlap with this * area @@ -575,7 +576,7 @@ public class GridLayout extends AbstractLayout implements /** * Gets the component connected to the area. - * + * * @return the Component. */ public Component getComponent() { @@ -584,7 +585,7 @@ public class GridLayout extends AbstractLayout implements /** * Gets the column of the top-left corner cell. - * + * * @return the column of the top-left corner cell. */ public int getColumn1() { @@ -593,7 +594,7 @@ public class GridLayout extends AbstractLayout implements /** * Gets the column of the bottom-right corner cell. - * + * * @return the column of the bottom-right corner cell. */ public int getColumn2() { @@ -602,7 +603,7 @@ public class GridLayout extends AbstractLayout implements /** * Gets the row of the top-left corner cell. - * + * * @return the row of the top-left corner cell. */ public int getRow1() { @@ -611,7 +612,7 @@ public class GridLayout extends AbstractLayout implements /** * Gets the row of the bottom-right corner cell. - * + * * @return the row of the bottom-right corner cell. */ public int getRow2() { @@ -630,7 +631,7 @@ public class GridLayout extends AbstractLayout implements * Gridlayout does not support laying components on top of each other. An * OverlapsException is thrown when a component already exists * (even partly) at the same space on a grid with the new component. - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -640,7 +641,7 @@ public class GridLayout extends AbstractLayout implements /** * Constructs an OverlapsException. - * + * * @param existingArea */ public OverlapsException(Area existingArea) { @@ -675,7 +676,7 @@ public class GridLayout extends AbstractLayout implements /** * Gets the area . - * + * * @return the existing area. */ public Area getArea() { @@ -686,7 +687,7 @@ public class GridLayout extends AbstractLayout implements /** * An Exception object which is thrown when an area exceeds the * bounds of the grid. - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -697,7 +698,7 @@ public class GridLayout extends AbstractLayout implements /** * Constructs an OoutOfBoundsException with the specified * detail message. - * + * * @param areaOutOfBounds */ public OutOfBoundsException(Area areaOutOfBounds) { @@ -706,7 +707,7 @@ public class GridLayout extends AbstractLayout implements /** * Gets the area that is out of bounds. - * + * * @return the area out of Bound. */ public Area getArea() { @@ -717,7 +718,7 @@ public class GridLayout extends AbstractLayout implements /** * Sets the number of columns in the grid. The column count can not be * reduced if there are any areas that would be outside of the shrunk grid. - * + * * @param columns * the new number of columns in the grid. */ @@ -758,7 +759,7 @@ public class GridLayout extends AbstractLayout implements /** * Get the number of columns in the grid. - * + * * @return the number of columns in the grid. */ public int getColumns() { @@ -768,7 +769,7 @@ public class GridLayout extends AbstractLayout implements /** * Sets the number of rows in the grid. The number of rows can not be * reduced if there are any areas that would be outside of the shrunk grid. - * + * * @param rows * the new number of rows in the grid. */ @@ -808,7 +809,7 @@ public class GridLayout extends AbstractLayout implements /** * Get the number of rows in the grid. - * + * * @return the number of rows in the grid. */ public int getRows() { @@ -817,14 +818,14 @@ public class GridLayout extends AbstractLayout implements /** * Gets the current x-position (column) of the cursor. - * + * *

          * The cursor position points the position for the next component that is * added without specifying its coordinates (grid cell). When the cursor * position is occupied, the next component will be added to first free * position after the cursor. *

          - * + * * @return the grid column the cursor is on, starting from 0. */ public int getCursorX() { @@ -834,7 +835,7 @@ public class GridLayout extends AbstractLayout implements /** * Sets the current cursor x-position. This is usually handled automatically * by GridLayout. - * + * * @param cursorX */ public void setCursorX(int cursorX) { @@ -843,14 +844,14 @@ public class GridLayout extends AbstractLayout implements /** * Gets the current y-position (row) of the cursor. - * + * *

          * The cursor position points the position for the next component that is * added without specifying its coordinates (grid cell). When the cursor * position is occupied, the next component will be added to the first free * position after the cursor. *

          - * + * * @return the grid row the Cursor is on. */ public int getCursorY() { @@ -860,7 +861,7 @@ public class GridLayout extends AbstractLayout implements /** * Sets the current y-coordinate (row) of the cursor. This is usually * handled automatically by GridLayout. - * + * * @param cursorY * the row number, starting from 0 for the topmost row. */ @@ -870,7 +871,8 @@ public class GridLayout extends AbstractLayout implements /* Documented in superclass */ @Override - public void replaceComponent(Component oldComponent, Component newComponent) { + public void replaceComponent(Component oldComponent, + Component newComponent) { // Gets the locations ChildComponentData oldLocation = getState().childData.get(oldComponent); @@ -894,7 +896,7 @@ public class GridLayout extends AbstractLayout implements /* * Removes all components from this container. - * + * * @see com.vaadin.ui.ComponentContainer#removeAllComponents() */ @Override @@ -924,7 +926,7 @@ public class GridLayout extends AbstractLayout implements /* * (non-Javadoc) - * + * * @see com.vaadin.ui.Layout.SpacingHandler#setSpacing(boolean) */ @Override @@ -934,7 +936,7 @@ public class GridLayout extends AbstractLayout implements /* * (non-Javadoc) - * + * * @see com.vaadin.ui.Layout.SpacingHandler#isSpacing() */ @Override @@ -944,7 +946,7 @@ public class GridLayout extends AbstractLayout implements /** * Inserts an empty row at the specified position in the grid. - * + * * @param row * Index of the row before which the new row will be inserted. * The leftmost row has index 0. @@ -978,18 +980,18 @@ public class GridLayout extends AbstractLayout implements /** * Removes a row and all the components in the row. - * + * *

          * Components which span over several rows are removed if the selected row * is on the first row of such a component. *

          - * + * *

          * If the last row is removed then all remaining components will be removed * and the grid will be reduced to one row. The cursor will be moved to the * upper left cell of the grid. *

          - * + * * @param row * Index of the row to remove. The leftmost row has index 0. */ @@ -1036,13 +1038,13 @@ public class GridLayout extends AbstractLayout implements /** * Sets the expand ratio of given column. - * + * *

          * The expand ratio defines how excess space is distributed among columns. * Excess space means space that is left over from components that are not * sized relatively. By default, the excess space is distributed evenly. *

          - * + * *

          * Note, that width of this GridLayout needs to be defined (fixed or * relative, as opposed to undefined height) for this method to have any @@ -1052,9 +1054,9 @@ public class GridLayout extends AbstractLayout implements * the server so you cannot set a child component to have undefined width on * the server and set it to 100% in CSS. You must set it to * 100% on the server. - * + * * @see #setWidth(float, int) - * + * * @param columnIndex * @param ratio */ @@ -1066,9 +1068,9 @@ public class GridLayout extends AbstractLayout implements /** * Returns the expand ratio of given column - * + * * @see #setColumnExpandRatio(int, float) - * + * * @param columnIndex * @return the expand ratio, 0.0f by default */ @@ -1079,13 +1081,13 @@ public class GridLayout extends AbstractLayout implements /** * Sets the expand ratio of given row. - * + * *

          * Expand ratio defines how excess space is distributed among rows. Excess * space means the space left over from components that are not sized * relatively. By default, the excess space is distributed evenly. *

          - * + * *

          * Note, that height of this GridLayout needs to be defined (fixed or * relative, as opposed to undefined height) for this method to have any @@ -1095,9 +1097,9 @@ public class GridLayout extends AbstractLayout implements * on the server so you cannot set a child component to have undefined * height on the server and set it to 100% in CSS. You must set * it to 100% on the server. - * + * * @see #setHeight(float, int) - * + * * @param rowIndex * The row index, starting from 0 for the topmost row. * @param ratio @@ -1110,9 +1112,9 @@ public class GridLayout extends AbstractLayout implements /** * Returns the expand ratio of given row. - * + * * @see #setRowExpandRatio(int, float) - * + * * @param rowIndex * The row index, starting from 0 for the topmost row. * @return the expand ratio, 0.0f by default @@ -1124,7 +1126,7 @@ public class GridLayout extends AbstractLayout implements /** * Gets the Component at given index. - * + * * @param x * The column index, starting from 0 for the leftmost column. * @param y @@ -1132,8 +1134,8 @@ public class GridLayout extends AbstractLayout implements * @return Component in given cell or null if empty */ public Component getComponent(int x, int y) { - for (Entry entry : getState(false).childData - .entrySet()) { + for (Entry entry : getState( + false).childData.entrySet()) { ChildComponentData childData = entry.getValue(); if (childData.column1 <= x && x <= childData.column2 && childData.row1 <= y && y <= childData.row2) { @@ -1146,7 +1148,7 @@ public class GridLayout extends AbstractLayout implements /** * Returns information about the area where given component is laid in the * GridLayout. - * + * * @param component * the component whose area information is requested. * @return an Area object that contains information how component is laid in @@ -1197,7 +1199,7 @@ public class GridLayout extends AbstractLayout implements /* * (non-Javadoc) - * + * * @see com.vaadin.ui.Layout.MarginHandler#setMargin(boolean) */ @Override @@ -1207,10 +1209,9 @@ public class GridLayout extends AbstractLayout implements /* * (non-Javadoc) - * - * @see - * com.vaadin.ui.Layout.MarginHandler#setMargin(com.vaadin.shared.ui.MarginInfo - * ) + * + * @see com.vaadin.ui.Layout.MarginHandler#setMargin(com.vaadin.shared.ui. + * MarginInfo ) */ @Override public void setMargin(MarginInfo marginInfo) { @@ -1219,7 +1220,7 @@ public class GridLayout extends AbstractLayout implements /* * (non-Javadoc) - * + * * @see com.vaadin.ui.Layout.MarginHandler#getMargin() */ @Override @@ -1229,7 +1230,7 @@ public class GridLayout extends AbstractLayout implements /* * (non-Javadoc) - * + * * @see com.vaadin.ui.Layout.AlignmentHandler#getDefaultComponentAlignment() */ @Override @@ -1239,7 +1240,7 @@ public class GridLayout extends AbstractLayout implements /* * (non-Javadoc) - * + * * @see * com.vaadin.ui.Layout.AlignmentHandler#setDefaultComponentAlignment(com * .vaadin.ui.Alignment) @@ -1253,12 +1254,12 @@ public class GridLayout extends AbstractLayout implements * Sets whether empty rows and columns should be considered as non-existent * when rendering or not. If this is set to true then the spacing between * multiple empty columns (or rows) will be collapsed. - * + * * The default behavior is to consider all rows and columns as visible - * + * * NOTE that this must be set before the initial rendering takes place. * Updating this on the fly is not supported. - * + * * @since 7.3 * @param hideEmptyRowsAndColumns * true to hide empty rows and columns, false to leave them as-is @@ -1270,7 +1271,7 @@ public class GridLayout extends AbstractLayout implements /** * Checks whether whether empty rows and columns should be considered as * non-existent when rendering or not. - * + * * @see #setHideEmptyRowsAndColumns(boolean) * @since 7.3 * @return true if empty rows and columns are hidden, false otherwise @@ -1345,13 +1346,14 @@ public class GridLayout extends AbstractLayout implements attr, 1, int.class); for (int rowIndex = row; rowIndex < row + rowspan; ++rowIndex) { - for (int colIndex = column; colIndex < column + colspan; ++colIndex) { + for (int colIndex = column; colIndex < column + + colspan; ++colIndex) { if (rowIndex == rows.size()) { // Rowspan with not enough rows. Fix by adding rows. rows.add(new HashMap()); } - rows.get(rowIndex) - .put(colIndex + skippedColumns, child); + rows.get(rowIndex).put(colIndex + skippedColumns, + child); } } @@ -1492,8 +1494,8 @@ public class GridLayout extends AbstractLayout implements col.appendChild(childElement); if (coords.row1 != coords.row2) { - col.attr("rowspan", "" - + (1 + coords.row2 - coords.row1)); + col.attr("rowspan", + "" + (1 + coords.row2 - coords.row1)); } colspan = 1 + coords.column2 - coords.column1; @@ -1503,8 +1505,8 @@ public class GridLayout extends AbstractLayout implements } else { boolean hasExpands = false; - if (i == 0 - && lastComponentOnRow(componentMap[i], j, visited)) { + if (i == 0 && lastComponentOnRow(componentMap[i], j, + visited)) { // A column with expand and no content in the end of // first row needs to be present. for (int c = j; c < componentMap[i].length; ++c) { @@ -1528,7 +1530,8 @@ public class GridLayout extends AbstractLayout implements ++colspan; } - int rowspan = getRowSpan(componentMap, i, j, colspan, child); + int rowspan = getRowSpan(componentMap, i, j, colspan, + child); if (colspan > 1) { col.attr("colspan", "" + colspan); } @@ -1570,7 +1573,7 @@ public class GridLayout extends AbstractLayout implements * for empty {@link GridLayout}, because there's no other way to serialize * info about number of columns and rows if there are absolutely no * components in the {@link GridLayout} - * + * * @param design * @param designContext */ @@ -1596,7 +1599,8 @@ public class GridLayout extends AbstractLayout implements private int getRowSpan(Component[][] compMap, int i, int j, int colspan, Component child) { int rowspan = 1; - while (i + rowspan < compMap.length && compMap[i + rowspan][j] == child) { + while (i + rowspan < compMap.length + && compMap[i + rowspan][j] == child) { for (int k = 0; k < colspan; ++k) { if (compMap[i + rowspan][j + k] != child) { return rowspan; diff --git a/server/src/main/java/com/vaadin/ui/HasChildMeasurementHint.java b/server/src/main/java/com/vaadin/ui/HasChildMeasurementHint.java index 86d33f57b2..fac7cf4dbd 100644 --- a/server/src/main/java/com/vaadin/ui/HasChildMeasurementHint.java +++ b/server/src/main/java/com/vaadin/ui/HasChildMeasurementHint.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -18,7 +18,7 @@ package com.vaadin.ui; /** * Component with layout measuring hint. Used to improve granularity of control * over child component measurements. - * + * * @since 7.6 * @author Vaadin Ltd */ @@ -52,7 +52,7 @@ public interface HasChildMeasurementHint extends HasComponents { /** * Sets desired child size measurement hint. - * + * * @param hint * desired hint. A value of null will reset value back to the * default (MEASURE_ALWAYS) @@ -61,7 +61,7 @@ public interface HasChildMeasurementHint extends HasComponents { /** * Returns the current child size measurement hint. - * + * * @return a child measurement hint value */ ChildMeasurementHint getChildMeasurementHint(); diff --git a/server/src/main/java/com/vaadin/ui/HasComponents.java b/server/src/main/java/com/vaadin/ui/HasComponents.java index 6273e8053b..58a4ac6668 100644 --- a/server/src/main/java/com/vaadin/ui/HasComponents.java +++ b/server/src/main/java/com/vaadin/ui/HasComponents.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -24,17 +24,17 @@ import com.vaadin.util.ReflectTools; /** * Interface that must be implemented by all {@link Component}s that contain * other {@link Component}s. - * + * * @author Vaadin Ltd * @since 7.0.0 - * + * */ public interface HasComponents extends Component, Iterable { /** * Gets an iterator to the collection of contained components. Using this * iterator it is possible to step through all components contained in this * container. - * + * * @return the component iterator. */ @Override @@ -43,21 +43,22 @@ public interface HasComponents extends Component, Iterable { /** * Interface for {@link HasComponents} implementations that support sending * attach and detach events for components. - * + * * @since 7.0 */ public interface ComponentAttachDetachNotifier extends Serializable { /** * Listens the component attach events. - * + * * @param listener * the listener to add. */ - public void addComponentAttachListener(ComponentAttachListener listener); + public void addComponentAttachListener( + ComponentAttachListener listener); /** * Stops the listening component attach events. - * + * * @param listener * the listener to removed. */ @@ -67,7 +68,8 @@ public interface HasComponents extends Component, Iterable { /** * Listens the component detach events. */ - public void addComponentDetachListener(ComponentDetachListener listener); + public void addComponentDetachListener( + ComponentDetachListener listener); /** * Stops the listening component detach events. @@ -87,7 +89,7 @@ public interface HasComponents extends Component, Iterable { /** * A new component is attached to container. - * + * * @param event * the component attach event. */ @@ -100,12 +102,12 @@ public interface HasComponents extends Component, Iterable { public interface ComponentDetachListener extends Serializable { public static final Method detachMethod = ReflectTools.findMethod( - ComponentDetachListener.class, - "componentDetachedFromContainer", ComponentDetachEvent.class); + ComponentDetachListener.class, "componentDetachedFromContainer", + ComponentDetachEvent.class); /** * A component has been detached from container. - * + * * @param event * the component detach event. */ @@ -122,7 +124,7 @@ public interface HasComponents extends Component, Iterable { /** * Creates a new attach event. - * + * * @param container * the container the component has been detached to. * @param attachedComponent @@ -136,7 +138,7 @@ public interface HasComponents extends Component, Iterable { /** * Gets the component container. - * + * * @param the * component container. */ @@ -146,7 +148,7 @@ public interface HasComponents extends Component, Iterable { /** * Gets the attached component. - * + * * @param the * attach component. */ @@ -165,7 +167,7 @@ public interface HasComponents extends Component, Iterable { /** * Creates a new detach event. - * + * * @param container * the container the component has been detached from. * @param detachedComponent @@ -179,7 +181,7 @@ public interface HasComponents extends Component, Iterable { /** * Gets the component container. - * + * * @param the * component container. */ @@ -189,7 +191,7 @@ public interface HasComponents extends Component, Iterable { /** * Gets the detached component. - * + * * @return the detached component. */ public Component getDetachedComponent() { diff --git a/server/src/main/java/com/vaadin/ui/HorizontalLayout.java b/server/src/main/java/com/vaadin/ui/HorizontalLayout.java index 616fa09225..32378a4652 100644 --- a/server/src/main/java/com/vaadin/ui/HorizontalLayout.java +++ b/server/src/main/java/com/vaadin/ui/HorizontalLayout.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -19,10 +19,10 @@ import com.vaadin.shared.ui.orderedlayout.HorizontalLayoutState; /** * Horizontal layout - * + * * HorizontalLayout is a component container, which shows the * subcomponents in the order of their addition (horizontally). - * + * * @author Vaadin Ltd. * @since 5.3 */ @@ -39,9 +39,9 @@ public class HorizontalLayout extends AbstractOrderedLayout { /** * Constructs a HorizontalLayout with the given components. The components * are added in the given order. - * + * * @see AbstractOrderedLayout#addComponents(Component...) - * + * * @param children * The components to add. */ diff --git a/server/src/main/java/com/vaadin/ui/HorizontalSplitPanel.java b/server/src/main/java/com/vaadin/ui/HorizontalSplitPanel.java index 922986eeda..e176573d3c 100644 --- a/server/src/main/java/com/vaadin/ui/HorizontalSplitPanel.java +++ b/server/src/main/java/com/vaadin/ui/HorizontalSplitPanel.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,9 +20,9 @@ import com.vaadin.shared.ui.splitpanel.HorizontalSplitPanelState; /** * A horizontal split panel contains two components and lays them horizontally. * The first component is on the left side. - * + * *

          - * 
          + *
            *      +---------------------++----------------------+
            *      |                     ||                      |
            *      | The first component || The second component |
          @@ -32,9 +32,9 @@ import com.vaadin.shared.ui.splitpanel.HorizontalSplitPanelState;
            *                            ^
            *                            |
            *                      the splitter
          - * 
          + *
            * 
          - * + * * @author Vaadin Ltd. * @since 6.5 */ @@ -49,7 +49,7 @@ public class HorizontalSplitPanel extends AbstractSplitPanel { /** * Creates a horizontal split panel containing the given components - * + * * @param firstComponent * The component to be placed to the left of the splitter * @param secondComponent diff --git a/server/src/main/java/com/vaadin/ui/Html5File.java b/server/src/main/java/com/vaadin/ui/Html5File.java index 87ea83c8c9..ef3b646f81 100644 --- a/server/src/main/java/com/vaadin/ui/Html5File.java +++ b/server/src/main/java/com/vaadin/ui/Html5File.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -61,7 +61,7 @@ public class Html5File implements Serializable { * on HTML 5 API's. It is supported only by modern web browsers like Firefox * 3.6 and above and recent webkit based browsers (Safari 5, Chrome 6) at * this time. - * + * * @param streamVariable * the callback that returns stream where the implementation * writes the file contents as it arrives. diff --git a/server/src/main/java/com/vaadin/ui/Image.java b/server/src/main/java/com/vaadin/ui/Image.java index 7b0294a450..cc92b4a3c8 100644 --- a/server/src/main/java/com/vaadin/ui/Image.java +++ b/server/src/main/java/com/vaadin/ui/Image.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,10 +25,9 @@ import com.vaadin.shared.ui.image.ImageState; /** * Component for embedding images. - * + * * @author Vaadin Ltd. - * @version - * @VERSION@ + * @version @VERSION@ * @since 7.0 */ @SuppressWarnings("serial") @@ -50,7 +49,7 @@ public class Image extends AbstractEmbedded { /** * Creates a new empty Image with caption. - * + * * @param caption */ public Image(String caption) { @@ -61,7 +60,7 @@ public class Image extends AbstractEmbedded { /** * Creates a new Image whose contents is loaded from given resource. The * dimensions are assumed if possible. The type is guessed from resource. - * + * * @param caption * @param source * the Source of the embedded object. @@ -89,9 +88,9 @@ public class Image extends AbstractEmbedded { * Add a click listener to the component. The listener is called whenever * the user clicks inside the component. Depending on the content the event * may be blocked and in that case no event is fired. - * + * * Use {@link #removeClickListener(ClickListener)} to remove the listener. - * + * * @param listener * The listener to add */ @@ -112,7 +111,7 @@ public class Image extends AbstractEmbedded { /** * Remove a click listener from the component. The listener should earlier * have been added using {@link #addClickListener(ClickListener)}. - * + * * @param listener * The listener to remove */ diff --git a/server/src/main/java/com/vaadin/ui/InlineDateField.java b/server/src/main/java/com/vaadin/ui/InlineDateField.java index e6f0f5d7a0..d1d165791b 100644 --- a/server/src/main/java/com/vaadin/ui/InlineDateField.java +++ b/server/src/main/java/com/vaadin/ui/InlineDateField.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -23,9 +23,9 @@ import com.vaadin.data.Property; /** *

          * A date entry component, which displays the actual date selector inline. - * + * *

          - * + * * @see DateField * @see PopupDateField * @author Vaadin Ltd. @@ -37,7 +37,8 @@ public class InlineDateField extends DateField { super(); } - public InlineDateField(Property dataSource) throws IllegalArgumentException { + public InlineDateField(Property dataSource) + throws IllegalArgumentException { super(dataSource); } diff --git a/server/src/main/java/com/vaadin/ui/JavaScript.java b/server/src/main/java/com/vaadin/ui/JavaScript.java index 668ae67056..91ee1ccc20 100644 --- a/server/src/main/java/com/vaadin/ui/JavaScript.java +++ b/server/src/main/java/com/vaadin/ui/JavaScript.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -33,7 +33,7 @@ import elemental.json.JsonException; * instance of JavaScript, either use Page.getJavaScript() or * JavaScript.getCurrent() as a shorthand for getting the JavaScript object * corresponding to the current Page. - * + * * @author Vaadin Ltd * @since 7.0.0 */ @@ -76,15 +76,15 @@ public class JavaScript extends AbstractExtension { * object). The call method in the passed * {@link JavaScriptFunction} object will be invoked with the same * parameters whenever the JavaScript function is called in the browser. - * + * * A function added with the name "myFunction" can thus be * invoked with the following JavaScript code: * window.myFunction(argument1, argument2). - * + * * If the name parameter contains dots, simple objects are created on demand * to allow calling the function using the same name (e.g. * window.myObject.myFunction). - * + * * @param name * the name that the function should get in the global JavaScript * namespace. @@ -100,11 +100,11 @@ public class JavaScript extends AbstractExtension { /** * Removes a JavaScripFunction from the browser's global JavaScript * namespace. - * + * * If the name contains dots and intermediate objects were created by * {@link #addFunction(String, JavaScriptFunction)}, these objects will not * be removed by this method. - * + * * @param name * the name of the callback to remove */ @@ -115,7 +115,7 @@ public class JavaScript extends AbstractExtension { /** * Executes the given JavaScript code in the browser. - * + * * @param script * The JavaScript code to run. */ @@ -125,7 +125,7 @@ public class JavaScript extends AbstractExtension { /** * Executes the given JavaScript code in the browser. - * + * * @param script * The JavaScript code to run. */ @@ -136,9 +136,9 @@ public class JavaScript extends AbstractExtension { /** * Get the JavaScript object for the current Page, or null if there is no * current page. - * + * * @see Page#getCurrent() - * + * * @return the JavaScript object corresponding to the current Page, or * null if there is no current page. */ @@ -152,7 +152,7 @@ public class JavaScript extends AbstractExtension { /** * JavaScript is not designed to be removed. - * + * * @throws UnsupportedOperationException * when invoked */ diff --git a/server/src/main/java/com/vaadin/ui/JavaScriptFunction.java b/server/src/main/java/com/vaadin/ui/JavaScriptFunction.java index 071c88350b..b1f2b8c324 100644 --- a/server/src/main/java/com/vaadin/ui/JavaScriptFunction.java +++ b/server/src/main/java/com/vaadin/ui/JavaScriptFunction.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -26,11 +26,11 @@ import elemental.json.JsonArray; * Defines a method that is called by a client-side JavaScript function. When * the corresponding JavaScript function is called, the {@link #call(JsonArray)} * method is invoked. - * + * * @see JavaScript#addFunction(String, JavaScriptFunction) * @see AbstractJavaScriptComponent#addFunction(String, JavaScriptFunction) * @see AbstractJavaScriptExtension#addFunction(String, JavaScriptFunction) - * + * * @author Vaadin Ltd * @since 7.0.0 */ @@ -41,7 +41,7 @@ public interface JavaScriptFunction extends Serializable { *

          * Because of the asynchronous nature of the communication between client * and server, no return value can be sent back to the browser. - * + * * @param arguments * an array with JSON representations of the arguments with which * the JavaScript function was called. diff --git a/server/src/main/java/com/vaadin/ui/Label.java b/server/src/main/java/com/vaadin/ui/Label.java index 1498246ec5..35ce130790 100644 --- a/server/src/main/java/com/vaadin/ui/Label.java +++ b/server/src/main/java/com/vaadin/ui/Label.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -35,9 +35,9 @@ import com.vaadin.ui.declarative.DesignFormatter; /** * Label component for showing non-editable short texts. - * + * * The label content can be set to the modes specified by {@link ContentMode} - * + * *

          * The contents of the label may contain simple formatting: *

            @@ -51,7 +51,7 @@ import com.vaadin.ui.declarative.DesignFormatter; * The b,i,u and li tags can contain all the tags in * the list recursively. *

            - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -113,7 +113,7 @@ public class Label extends AbstractComponent implements Property, /** * Creates a new instance of Label with text-contents. - * + * * @param content */ public Label(String content) { @@ -123,7 +123,7 @@ public class Label extends AbstractComponent implements Property, /** * Creates a new instance of Label with text-contents read from given * datasource. - * + * * @param contentSource */ public Label(Property contentSource) { @@ -132,7 +132,7 @@ public class Label extends AbstractComponent implements Property, /** * Creates a new instance of Label with text-contents. - * + * * @param content * @param contentMode */ @@ -145,7 +145,7 @@ public class Label extends AbstractComponent implements Property, /** * Creates a new instance of Label with text-contents read from given * datasource. - * + * * @param contentSource * @param contentMode */ @@ -171,7 +171,7 @@ public class Label extends AbstractComponent implements Property, * The value of the label is the text that is shown to the end user. * Depending on the {@link ContentMode} it is plain text or markup. *

            - * + * * @return the value of the label. */ @Override @@ -186,19 +186,20 @@ public class Label extends AbstractComponent implements Property, /** * Returns the current value of the data source converted using the current * locale. - * + * * @return */ private String getDataSourceValue() { - return ConverterUtil.convertFromModel(getPropertyDataSource() - .getValue(), String.class, getConverter(), getLocale()); + return ConverterUtil.convertFromModel( + getPropertyDataSource().getValue(), String.class, + getConverter(), getLocale()); } /** * Set the value of the label. Value of the label is the XML contents of the * label. Since Vaadin 7.2, changing the value of Label instance with that * method will fire ValueChangeEvent. - * + * * @param newStringValue * the New value of the label. */ @@ -220,7 +221,7 @@ public class Label extends AbstractComponent implements Property, /** * Gets the type of the Property. - * + * * @see com.vaadin.data.Property#getType() */ @Override @@ -230,7 +231,7 @@ public class Label extends AbstractComponent implements Property, /** * Gets the viewing data-source property. - * + * * @return the data source property. * @see com.vaadin.data.Property.Viewer#getPropertyDataSource() */ @@ -242,7 +243,7 @@ public class Label extends AbstractComponent implements Property, /** * Sets the property as data-source for viewing. Since Vaadin 7.2 a * ValueChangeEvent is fired if the new value is different from previous. - * + * * @param newDataSource * the new data source Property * @see com.vaadin.data.Property.Viewer#setPropertyDataSource(com.vaadin.data.Property) @@ -250,9 +251,8 @@ public class Label extends AbstractComponent implements Property, @Override public void setPropertyDataSource(Property newDataSource) { // Stops listening the old data source changes - if (dataSource != null - && Property.ValueChangeNotifier.class - .isAssignableFrom(dataSource.getClass())) { + if (dataSource != null && Property.ValueChangeNotifier.class + .isAssignableFrom(dataSource.getClass())) { ((Property.ValueChangeNotifier) dataSource).removeListener(this); } @@ -275,9 +275,8 @@ public class Label extends AbstractComponent implements Property, } // Listens the new data source if possible - if (dataSource != null - && Property.ValueChangeNotifier.class - .isAssignableFrom(dataSource.getClass())) { + if (dataSource != null && Property.ValueChangeNotifier.class + .isAssignableFrom(dataSource.getClass())) { ((Property.ValueChangeNotifier) dataSource).addListener(this); } markAsDirty(); @@ -285,9 +284,9 @@ public class Label extends AbstractComponent implements Property, /** * Gets the content mode of the Label. - * + * * @return the Content mode of the label. - * + * * @see ContentMode */ public ContentMode getContentMode() { @@ -296,10 +295,10 @@ public class Label extends AbstractComponent implements Property, /** * Sets the content mode of the Label. - * + * * @param contentMode * the New content mode of the label. - * + * * @see ContentMode */ public void setContentMode(ContentMode contentMode) { @@ -328,16 +327,16 @@ public class Label extends AbstractComponent implements Property, /** * Value change event - * + * * @author Vaadin Ltd. * @since 3.0 */ - public static class ValueChangeEvent extends Component.Event implements - Property.ValueChangeEvent { + public static class ValueChangeEvent extends Component.Event + implements Property.ValueChangeEvent { /** * New instance of text change event - * + * * @param source * the Source of the event. */ @@ -347,7 +346,7 @@ public class Label extends AbstractComponent implements Property, /** * Gets the Property that has been modified. - * + * * @see com.vaadin.data.Property.ValueChangeEvent#getProperty() */ @Override @@ -358,14 +357,15 @@ public class Label extends AbstractComponent implements Property, /** * Adds the value change listener. - * + * * @param listener * the Listener to be added. * @see com.vaadin.data.Property.ValueChangeNotifier#addListener(com.vaadin.data.Property.ValueChangeListener) */ @Override public void addValueChangeListener(Property.ValueChangeListener listener) { - addListener(Label.ValueChangeEvent.class, listener, VALUE_CHANGE_METHOD); + addListener(Label.ValueChangeEvent.class, listener, + VALUE_CHANGE_METHOD); } /** @@ -380,13 +380,14 @@ public class Label extends AbstractComponent implements Property, /** * Removes the value change listener. - * + * * @param listener * the Listener to be removed. * @see com.vaadin.data.Property.ValueChangeNotifier#removeListener(com.vaadin.data.Property.ValueChangeListener) */ @Override - public void removeValueChangeListener(Property.ValueChangeListener listener) { + public void removeValueChangeListener( + Property.ValueChangeListener listener) { removeListener(Label.ValueChangeEvent.class, listener, VALUE_CHANGE_METHOD); } @@ -411,7 +412,7 @@ public class Label extends AbstractComponent implements Property, /** * Listens the value change events from data source. - * + * * @see com.vaadin.data.Property.ValueChangeListener#valueChange(Property.ValueChangeEvent) */ @Override @@ -463,19 +464,19 @@ public class Label extends AbstractComponent implements Property, /** * Compares the Label to other objects. - * + * *

            * Labels can be compared to other labels for sorting label contents. This * is especially handy for sorting table columns. *

            - * + * *

            * In RAW, PREFORMATTED and TEXT modes, the label contents are compared as * is. In XML, UIDL and HTML modes, only CDATA is compared and tags ignored. * If the other object is not a Label, its toString() return value is used * in comparison. *

            - * + * * @param other * the Other object to compare to. * @return a negative integer, zero, or a positive integer as this object is @@ -493,7 +494,7 @@ public class Label extends AbstractComponent implements Property, /** * Strips the tags from the XML. - * + * * @param xml * the String containing a XML snippet. * @return the original XML without tags. @@ -525,7 +526,7 @@ public class Label extends AbstractComponent implements Property, /** * Gets the converter used to convert the property data source value to the * label value. - * + * * @return The converter or null if none is set. */ public Converter getConverter() { @@ -535,7 +536,7 @@ public class Label extends AbstractComponent implements Property, /** * Sets the converter used to convert the label value to the property data * source type. The converter must have a presentation type of String. - * + * * @param converter * The new converter to use. */ @@ -556,12 +557,12 @@ public class Label extends AbstractComponent implements Property, * If legacy Property toString mode is disabled, the string representation * has no special meaning *

            - * + * * @see AbstractProperty#isLegacyToStringEnabled() - * + * * @return The value displayed by this label or a string representation of * this Label object. - * + * * @deprecated As of 7.0, use {@link #getValue()} to get the value of the * label or {@link #getPropertyDataSource()}.getValue() to get * the value of the data source. @@ -578,7 +579,7 @@ public class Label extends AbstractComponent implements Property, /* * (non-Javadoc) - * + * * @see com.vaadin.ui.AbstractComponent#readDesign(org.jsoup.nodes .Element, * com.vaadin.ui.declarative.DesignContext) */ @@ -602,7 +603,7 @@ public class Label extends AbstractComponent implements Property, /* * (non-Javadoc) - * + * * @see com.vaadin.ui.AbstractComponent#getCustomAttributes() */ @Override @@ -616,7 +617,7 @@ public class Label extends AbstractComponent implements Property, /* * (non-Javadoc) - * + * * @see com.vaadin.ui.AbstractComponent#writeDesign(org.jsoup.nodes.Element * , com.vaadin.ui.declarative.DesignContext) */ diff --git a/server/src/main/java/com/vaadin/ui/Layout.java b/server/src/main/java/com/vaadin/ui/Layout.java index 6cf2cec249..01343d3299 100644 --- a/server/src/main/java/com/vaadin/ui/Layout.java +++ b/server/src/main/java/com/vaadin/ui/Layout.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,7 +25,7 @@ import com.vaadin.shared.ui.MarginInfo; * layouting control to the elements in the container. This is required by the * various layout components to enable them to place other components in * specific locations in the UI. - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -40,11 +40,11 @@ public interface Layout extends ComponentContainer, Serializable { /** * Set alignment for one contained component in this layout. Use * predefined alignments from Alignment class. - * + * * Example: * layout.setComponentAlignment(myComponent, Alignment.TOP_RIGHT); * - * + * * @param childComponent * the component to align within it's layout cell. * @param alignment @@ -55,7 +55,7 @@ public interface Layout extends ComponentContainer, Serializable { /** * Returns the current Alignment of given component. - * + * * @param childComponent * @return the {@link Alignment} */ @@ -64,7 +64,7 @@ public interface Layout extends ComponentContainer, Serializable { /** * Sets the alignment used for new components added to this layout. The * default is {@link Alignment#TOP_LEFT}. - * + * * @param defaultComponentAlignment * The new default alignment */ @@ -73,7 +73,7 @@ public interface Layout extends ComponentContainer, Serializable { /** * Returns the alignment used for new components added to this layout - * + * * @return The default alignment */ public Alignment getDefaultComponentAlignment(); @@ -83,12 +83,12 @@ public interface Layout extends ComponentContainer, Serializable { /** * This type of layout supports automatic addition of space between its * components. - * + * */ public interface SpacingHandler extends Serializable { /** * Enable spacing between child components within this layout. - * + * *

            * NOTE: This will only affect the space between * components, not the space around all the components in the layout @@ -96,12 +96,12 @@ public interface Layout extends ComponentContainer, Serializable { * Table). Use {@link #setMargin(boolean)} to add space around the * layout. *

            - * + * *

            * See the reference manual for more information about CSS rules for * defining the amount of spacing to use. *

            - * + * * @param enabled * true if spacing should be turned on, false if it should be * turned off @@ -109,7 +109,7 @@ public interface Layout extends ComponentContainer, Serializable { public void setSpacing(boolean enabled); /** - * + * * @return true if spacing between child components within this layout * is enabled, false otherwise */ @@ -127,7 +127,7 @@ public interface Layout extends ComponentContainer, Serializable { * will tell the client-side implementation to leave extra space around * the layout. The client-side implementation decides the actual amount, * and it can vary between themes. - * + * * @param enabled * true if margins should be enabled on all sides, false to * disable all margins @@ -136,26 +136,26 @@ public interface Layout extends ComponentContainer, Serializable { /** * Enable margins for this layout. - * + * *

            * NOTE: This will only affect the space around the * components in the layout, not space between the components in the * layout. Use {@link #setSpacing(boolean)} to add space between the * components in the layout. *

            - * + * *

            * See the reference manual for more information about CSS rules for * defining the size of the margin. *

            - * + * * @param marginInfo * MarginInfo object containing the new margins. */ public void setMargin(MarginInfo marginInfo); /** - * + * * @return MarginInfo containing the currently enabled margins. */ public MarginInfo getMargin(); diff --git a/server/src/main/java/com/vaadin/ui/LegacyComponent.java b/server/src/main/java/com/vaadin/ui/LegacyComponent.java index 7f71162c94..4260ee482a 100644 --- a/server/src/main/java/com/vaadin/ui/LegacyComponent.java +++ b/server/src/main/java/com/vaadin/ui/LegacyComponent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,29 +25,29 @@ import com.vaadin.server.VariableOwner; * 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. - * + * * @deprecated As of 7.0. This class is only intended to ease migration and * should not be used for new projects. - * + * * @author Vaadin Ltd * @since 7.0.0 */ @Deprecated -public interface LegacyComponent extends VariableOwner, Component, - ConnectorEventListener { +public interface LegacyComponent + extends VariableOwner, Component, ConnectorEventListener { /** *

            * 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. @@ -62,7 +62,7 @@ public interface LegacyComponent extends VariableOwner, Component, * For a LegacyComponent, markAsDirty will also cause * {@link #paintContent(PaintTarget)} to be called before sending changes to * the client. - * + * * @see com.vaadin.server.ClientConnector#markAsDirty() */ @Override diff --git a/server/src/main/java/com/vaadin/ui/LegacyWindow.java b/server/src/main/java/com/vaadin/ui/LegacyWindow.java index fe71d14430..61b488054d 100644 --- a/server/src/main/java/com/vaadin/ui/LegacyWindow.java +++ b/server/src/main/java/com/vaadin/ui/LegacyWindow.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -45,7 +45,7 @@ public class LegacyWindow extends UI { /** * Creates a new legacy window with the given caption - * + * * @param caption * the caption of the window */ @@ -57,7 +57,7 @@ public class LegacyWindow extends UI { /** * Creates a legacy window with the given caption and content layout - * + * * @param caption * @param content */ @@ -92,7 +92,7 @@ public class LegacyWindow extends UI { *

            * Note! Portlets do not support direct window access through URLs. *

            - * + * * @return the Name of the Window. */ public String getName() { @@ -115,7 +115,7 @@ public class LegacyWindow extends UI { *

            * Note! Portlets do not support direct window access through URLs. *

            - * + * * @param name * the new name for the window or null if the application should * automatically assign a name to it @@ -139,7 +139,7 @@ public class LegacyWindow extends UI { *

            * Note! This method can not be used for portlets. *

            - * + * * @return the URL of the window or null if the window is not attached to an * application */ @@ -160,10 +160,10 @@ public class LegacyWindow extends UI { /** * 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 - * + * * @deprecated As of 7.0, use getPage().setLocation instead */ @Deprecated @@ -211,7 +211,7 @@ public class LegacyWindow extends UI { * with security features in some browsers. Is is recommended to instead use * {@link Link} for starting downloads. *

            - * + * * @param resource * the resource. * @param windowName @@ -270,7 +270,7 @@ public class LegacyWindow extends UI { * with security features in some browsers. Is is recommended to instead use * {@link Link} for starting downloads. *

            - * + * * @param resource * the resource. * @param windowName @@ -278,7 +278,7 @@ public class LegacyWindow extends UI { * @param tryToOpenAsPopup * Whether to try to force the resource to be opened in a new * window - * */ + */ public void open(Resource resource, String windowName, boolean tryToOpenAsPopup) { getPage().open(resource, windowName, tryToOpenAsPopup); @@ -295,7 +295,7 @@ public class LegacyWindow extends UI { * with security features in some browsers. Is is recommended to instead use * {@link Link} for starting downloads. *

            - * + * * @param resource * the resource. * @param windowName @@ -318,13 +318,13 @@ public class LegacyWindow extends UI { * 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) - * + * * @deprecated As of 7.0, use the similarly named api in Page instead */ @Deprecated @@ -335,7 +335,7 @@ public class LegacyWindow extends UI { /** * 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 * @deprecated As of 7.0, use the similarly named api in Page instead @@ -348,7 +348,7 @@ public class LegacyWindow extends UI { /** * Gets the last known height of the browser window in which this UI * resides. - * + * * @return the browser window height in pixels * @deprecated As of 7.0, use the similarly named api in Page instead */ @@ -359,9 +359,9 @@ public class LegacyWindow extends UI { /** * Gets the last known width of the browser window in which this UI resides. - * + * * @return the browser window width in pixels - * + * * @deprecated As of 7.0, use the similarly named api in Page instead */ @Deprecated @@ -371,13 +371,13 @@ public class LegacyWindow extends UI { /** * Executes JavaScript in this window. - * + * *

            * This method allows one to inject javascript from the server to client. A * client implementation is not required to implement this functionality, * but currently all web-based clients do implement this. *

            - * + * *

            * Executing javascript this way often leads to cross-browser compatibility * issues and regressions that are hard to resolve. Use of this method @@ -385,10 +385,10 @@ public class LegacyWindow extends UI { * with GWT. For more info on creating own, reusable client-side widgets in * Java, read the corresponding chapter in Book of Vaadin. *

            - * + * * @param script * JavaScript snippet that will be executed. - * + * * @deprecated As of 7.0, use JavaScript.getCurrent().execute(String) * instead */ @@ -412,7 +412,7 @@ public class LegacyWindow extends UI { /** * Set the content of the window. For a {@link LegacyWindow}, the content * must be a {@link ComponentContainer}. - * + * * @param content */ @Override @@ -427,26 +427,27 @@ public class LegacyWindow extends UI { /** * This implementation replaces a component in the content container ( * {@link #getContent()}) instead of in the actual UI. - * + * * This method should only be called when the content is a * {@link ComponentContainer} (default {@link VerticalLayout} or explicitly * set). */ - public void replaceComponent(Component oldComponent, Component newComponent) { + public void replaceComponent(Component oldComponent, + Component newComponent) { getContent().replaceComponent(oldComponent, newComponent); } /** * Adds a component to this UI. The component is not added directly to the * UI, but instead to the content container ({@link #getContent()}). - * + * * This method should only be called when the content is a * {@link ComponentContainer} (default {@link VerticalLayout} or explicitly * set). - * + * * @param component * the component to add to this UI - * + * * @see #getContent() */ public void addComponent(Component component) { @@ -456,7 +457,7 @@ public class LegacyWindow extends UI { /** * This implementation removes the component from the content container ( * {@link #getContent()}) instead of from the actual UI. - * + * * This method should only be called when the content is a * {@link ComponentContainer} (default {@link VerticalLayout} or explicitly * set). @@ -468,7 +469,7 @@ public class LegacyWindow extends UI { /** * This implementation removes the components from the content container ( * {@link #getContent()}) instead of from the actual UI. - * + * * This method should only be called when the content is a * {@link ComponentContainer} (default {@link VerticalLayout} or explicitly * set). diff --git a/server/src/main/java/com/vaadin/ui/Link.java b/server/src/main/java/com/vaadin/ui/Link.java index c100336180..650aa3bcbd 100644 --- a/server/src/main/java/com/vaadin/ui/Link.java +++ b/server/src/main/java/com/vaadin/ui/Link.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -29,7 +29,7 @@ import com.vaadin.ui.declarative.DesignContext; /** * Link is used to create external or internal URL links. - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -63,7 +63,7 @@ public class Link extends AbstractComponent { /** * Creates a new instance of Link. - * + * * @param caption * @param resource */ @@ -74,8 +74,8 @@ public class Link extends AbstractComponent { /** * Creates a new instance of Link that opens a new window. - * - * + * + * * @param caption * the Link text. * @param targetName @@ -88,7 +88,7 @@ public class Link extends AbstractComponent { * the Height of the target window. * @param border * the Border style of the target window. - * + * */ public Link(String caption, Resource resource, String targetName, int width, int height, BorderStyle border) { @@ -112,7 +112,7 @@ public class Link extends AbstractComponent { /** * Returns the target window border. - * + * * @return the target window border. */ public BorderStyle getTargetBorder() { @@ -121,7 +121,7 @@ public class Link extends AbstractComponent { /** * Returns the target window height or -1 if not set. - * + * * @return the target window height. */ public int getTargetHeight() { @@ -132,7 +132,7 @@ public class Link extends AbstractComponent { /** * Returns the target window name. Empty name of null implies that the * target is opened to the window containing the link. - * + * * @return the target window name. */ public String getTargetName() { @@ -141,7 +141,7 @@ public class Link extends AbstractComponent { /** * Returns the target window width or -1 if not set. - * + * * @return the target window width. */ public int getTargetWidth() { @@ -151,7 +151,7 @@ public class Link extends AbstractComponent { /** * Sets the border of the target window. - * + * * @param targetBorder * the targetBorder to set. */ @@ -161,7 +161,7 @@ public class Link extends AbstractComponent { /** * Sets the target window height. - * + * * @param targetHeight * the targetHeight to set. */ @@ -171,7 +171,7 @@ public class Link extends AbstractComponent { /** * Sets the target window name. - * + * * @param targetName * the targetName to set. */ @@ -181,7 +181,7 @@ public class Link extends AbstractComponent { /** * Sets the target window width. - * + * * @param targetWidth * the targetWidth to set. */ @@ -191,7 +191,7 @@ public class Link extends AbstractComponent { /** * Returns the resource this link opens. - * + * * @return the Resource. */ public Resource getResource() { @@ -200,7 +200,7 @@ public class Link extends AbstractComponent { /** * Sets the resource this link opens. - * + * * @param resource * the resource to set. */ diff --git a/server/src/main/java/com/vaadin/ui/ListSelect.java b/server/src/main/java/com/vaadin/ui/ListSelect.java index 9f44407db9..2f2a336fb8 100644 --- a/server/src/main/java/com/vaadin/ui/ListSelect.java +++ b/server/src/main/java/com/vaadin/ui/ListSelect.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -55,7 +55,7 @@ public class ListSelect extends AbstractSelect { * Calling {@code setColumns(10);} is equivalent to calling * {@code setWidth("10em");} *

            - * + * * @deprecated As of 7.0. "Columns" does not reflect the exact number of * characters that will be displayed. It is better to use * setWidth together with "em" to control the width of the @@ -76,7 +76,7 @@ public class ListSelect extends AbstractSelect { /** * Gets the number of columns for the component. - * + * * @see #setColumns(int) * @deprecated As of 7.0. "Columns" does not reflect the exact number of * characters that will be displayed. It is better to use @@ -96,7 +96,7 @@ public class ListSelect extends AbstractSelect { * Sets the number of rows in the editor. If the number of rows is set 0, * the actual number of displayed rows is determined implicitly by the * adapter. - * + * * @param rows * the number of rows to set. */ diff --git a/server/src/main/java/com/vaadin/ui/LoadingIndicatorConfiguration.java b/server/src/main/java/com/vaadin/ui/LoadingIndicatorConfiguration.java index 46fe7ead35..e0566497e0 100644 --- a/server/src/main/java/com/vaadin/ui/LoadingIndicatorConfiguration.java +++ b/server/src/main/java/com/vaadin/ui/LoadingIndicatorConfiguration.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,7 +21,7 @@ import com.vaadin.shared.ui.ui.UIState.LoadingIndicatorConfigurationState; /** * Provides method for configuring the loading indicator. - * + * * @author Vaadin Ltd * @since 7.1 */ @@ -29,7 +29,7 @@ public interface LoadingIndicatorConfiguration extends Serializable { /** * Sets the delay before the loading indicator is shown. The default is * 300ms. - * + * * @param firstDelay * The first delay (in ms) */ @@ -37,7 +37,7 @@ public interface LoadingIndicatorConfiguration extends Serializable { /** * Returns the delay before the loading indicator is shown. - * + * * @return The first delay (in ms) */ public int getFirstDelay(); @@ -46,7 +46,7 @@ public interface LoadingIndicatorConfiguration extends Serializable { * Sets the delay before the loading indicator goes into the "second" state. * The delay is calculated from the time when the loading indicator was * triggered. The default is 1500ms. - * + * * @param secondDelay * The delay before going into the "second" state (in ms) */ @@ -56,7 +56,7 @@ public interface LoadingIndicatorConfiguration extends Serializable { * Returns the delay before the loading indicator goes into the "second" * state. The delay is calculated from the time when the loading indicator * was triggered. - * + * * @return The delay before going into the "second" state (in ms) */ public int getSecondDelay(); @@ -65,7 +65,7 @@ public interface LoadingIndicatorConfiguration extends Serializable { * Sets the delay before the loading indicator goes into the "third" state. * The delay is calculated from the time when the loading indicator was * triggered. The default is 5000ms. - * + * * @param thirdDelay * The delay before going into the "third" state (in ms) */ @@ -75,14 +75,14 @@ public interface LoadingIndicatorConfiguration extends Serializable { * Returns the delay before the loading indicator goes into the "third" * state. The delay is calculated from the time when the loading indicator * was triggered. - * + * * @return The delay before going into the "third" state (in ms) */ public int getThirdDelay(); } -class LoadingIndicatorConfigurationImpl implements - LoadingIndicatorConfiguration { +class LoadingIndicatorConfigurationImpl + implements LoadingIndicatorConfiguration { private UI ui; public LoadingIndicatorConfigurationImpl(UI ui) { @@ -91,7 +91,7 @@ class LoadingIndicatorConfigurationImpl implements /* * (non-Javadoc) - * + * * @see com.vaadin.ui.LoadingIndicator#setFirstDelay(int) */ @Override @@ -101,7 +101,7 @@ class LoadingIndicatorConfigurationImpl implements /* * (non-Javadoc) - * + * * @see com.vaadin.ui.LoadingIndicator#getFirstDelay() */ @Override @@ -111,7 +111,7 @@ class LoadingIndicatorConfigurationImpl implements /* * (non-Javadoc) - * + * * @see com.vaadin.ui.LoadingIndicator#setSecondDelay(int) */ @Override @@ -121,7 +121,7 @@ class LoadingIndicatorConfigurationImpl implements /* * (non-Javadoc) - * + * * @see com.vaadin.ui.LoadingIndicator#getSecondDelay() */ @Override @@ -131,7 +131,7 @@ class LoadingIndicatorConfigurationImpl implements /* * (non-Javadoc) - * + * * @see com.vaadin.ui.LoadingIndicator#setThirdDelay(int) */ @Override @@ -141,7 +141,7 @@ class LoadingIndicatorConfigurationImpl implements /* * (non-Javadoc) - * + * * @see com.vaadin.ui.LoadingIndicator#getThirdDelay() */ @Override diff --git a/server/src/main/java/com/vaadin/ui/LoginForm.java b/server/src/main/java/com/vaadin/ui/LoginForm.java index 9df5f7343e..89244004db 100644 --- a/server/src/main/java/com/vaadin/ui/LoginForm.java +++ b/server/src/main/java/com/vaadin/ui/LoginForm.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -70,7 +70,7 @@ public class LoginForm extends AbstractSingleComponentContainer { /** * Access method to form values by field names. - * + * * @param name * @return value in given field */ @@ -90,7 +90,7 @@ public class LoginForm extends AbstractSingleComponentContainer { public interface LoginListener extends Serializable { /** * This method is fired on each login form post. - * + * * @param event * Login event */ @@ -101,12 +101,13 @@ public class LoginForm extends AbstractSingleComponentContainer { * Internal stream source for the login URL - always returns "Success" and * ignores the values received. */ - private static class LoginStreamSource implements StreamResource.StreamSource { + private static class LoginStreamSource + implements StreamResource.StreamSource { @Override public InputStream getStream() { try { - return new ByteArrayInputStream("Success".toString().getBytes( - "UTF-8")); + return new ByteArrayInputStream( + "Success".toString().getBytes("UTF-8")); } catch (UnsupportedEncodingException e) { return null; } @@ -114,7 +115,6 @@ public class LoginForm extends AbstractSingleComponentContainer { } } - static { try { ON_LOGIN_METHOD = LoginListener.class.getDeclaredMethod("onLogin", @@ -136,7 +136,7 @@ public class LoginForm extends AbstractSingleComponentContainer { /** * Customize the user name field. Only for overriding, do not call. - * + * * @return the user name field * @since 7.7 */ @@ -151,7 +151,7 @@ public class LoginForm extends AbstractSingleComponentContainer { * Returns the caption set with {@link #setUsernameCaption(String)}. Note * that this method might not match what is shown to the user if * {@link #createUsernameField()} has been overridden. - * + * * @return user name field caption */ public String getUsernameCaption() { @@ -165,7 +165,7 @@ public class LoginForm extends AbstractSingleComponentContainer { *

            * As an alternative to calling this method, the method * {@link #createUsernameField()} can be overridden. - * + * * @param cap * new caption */ @@ -175,7 +175,7 @@ public class LoginForm extends AbstractSingleComponentContainer { /** * Customize the password field. Only for overriding, do not call. - * + * * @return the password field * @since 7.7 */ @@ -188,7 +188,7 @@ public class LoginForm extends AbstractSingleComponentContainer { * Returns the caption set with {@link #setPasswordCaption(String)}. Note * that this method might not match what is shown to the user if * {@link #createPasswordField()} has been overridden. - * + * * @return password field caption */ public String getPasswordCaption() { @@ -202,8 +202,9 @@ public class LoginForm extends AbstractSingleComponentContainer { *

            * As an alternative to calling this method, the method * {@link #createPasswordField()} can be overridden. - * - * @param cap new caption + * + * @param cap + * new caption */ public void setPasswordCaption(String cap) { passwordCaption = cap; @@ -212,7 +213,7 @@ public class LoginForm extends AbstractSingleComponentContainer { /** * Customize the login button. Only for overriding, do not call. - * + * * @return the login button * @since 7.7 */ @@ -225,7 +226,7 @@ public class LoginForm extends AbstractSingleComponentContainer { * Returns the caption set with {@link #setLoginButtonCaption(String)}. Note * that this method might not match what is shown to the user if * {@link #createLoginButton()} has been overridden. - * + * * @return login button caption */ public String getLoginButtonCaption() { @@ -239,8 +240,9 @@ public class LoginForm extends AbstractSingleComponentContainer { *

            * As an alternative to calling this method, the method * {@link #createLoginButton()} can be overridden. - * - * @param cap new caption + * + * @param cap + * new caption */ public void setLoginButtonCaption(String cap) { loginButtonCaption = cap; @@ -274,7 +276,7 @@ public class LoginForm extends AbstractSingleComponentContainer { * {@link #getUsernameFieldCaption()}, {@link #getPasswordFieldCaption()} * and {@link #getLoginButtonCaption()}. You do not have to use the login * button in your layout. - * + * * @param userNameField * the user name text field * @param passwordField @@ -338,7 +340,7 @@ public class LoginForm extends AbstractSingleComponentContainer { /* * (non-Javadoc) - * + * * Handle the login. In deferred mode, this method is called after the dummy * POST request that triggers the password manager has been completed. In * direct mode (the default setting), it is called directly when the user @@ -356,7 +358,7 @@ public class LoginForm extends AbstractSingleComponentContainer { /** * Adds LoginListener to handle login logic - * + * * @param listener */ public void addLoginListener(LoginListener listener) { @@ -374,7 +376,7 @@ public class LoginForm extends AbstractSingleComponentContainer { /** * Removes LoginListener - * + * * @param listener */ public void removeLoginListener(LoginListener listener) { diff --git a/server/src/main/java/com/vaadin/ui/MenuBar.java b/server/src/main/java/com/vaadin/ui/MenuBar.java index 9f05df7869..8dff0db804 100644 --- a/server/src/main/java/com/vaadin/ui/MenuBar.java +++ b/server/src/main/java/com/vaadin/ui/MenuBar.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -45,8 +45,8 @@ import com.vaadin.ui.declarative.DesignContext; *

            */ @SuppressWarnings("serial") -public class MenuBar extends AbstractComponent implements LegacyComponent, - Focusable { +public class MenuBar extends AbstractComponent + implements LegacyComponent, Focusable { // Items of the top-level menu private final List menuItems; @@ -139,8 +139,7 @@ public class MenuBar extends AbstractComponent implements LegacyComponent, String description = item.getDescription(); if (description != null && description.length() > 0) { - target.addAttribute( - MenuBarConstants.ATTRIBUTE_ITEM_DESCRIPTION, + target.addAttribute(MenuBarConstants.ATTRIBUTE_ITEM_DESCRIPTION, description); } if (item.isCheckable()) { @@ -188,7 +187,7 @@ public class MenuBar extends AbstractComponent implements LegacyComponent, } } - }// while + } // while // If we got the clicked item, launch the command. if (found && tmpItem.isEnabled()) { @@ -199,7 +198,7 @@ public class MenuBar extends AbstractComponent implements LegacyComponent, tmpItem.getCommand().menuSelected(tmpItem); } } - }// if + } // if }// changeVariables /** @@ -213,7 +212,7 @@ public class MenuBar extends AbstractComponent implements LegacyComponent, /** * Add a new item to the menu bar. Command can be null, but a caption must * be given. - * + * * @param caption * the text for the menu item * @param command @@ -227,7 +226,7 @@ public class MenuBar extends AbstractComponent implements LegacyComponent, /** * Add a new item to the menu bar. Icon and command can be null, but a * caption must be given. - * + * * @param caption * the text for the menu item * @param icon @@ -253,7 +252,7 @@ public class MenuBar extends AbstractComponent implements LegacyComponent, * Add an item before some item. If the given item does not exist the item * is added at the end of the menu. Icon and command can be null, but a * caption must be given. - * + * * @param caption * the text for the menu item * @param icon @@ -286,7 +285,7 @@ public class MenuBar extends AbstractComponent implements LegacyComponent, /** * Returns a list with all the MenuItem objects in the menu bar - * + * * @return a list containing the MenuItem objects in the menu bar */ public List getItems() { @@ -295,7 +294,7 @@ public class MenuBar extends AbstractComponent implements LegacyComponent, /** * Remove first occurrence the specified item from the main menu - * + * * @param item * The item to be removed */ @@ -316,7 +315,7 @@ public class MenuBar extends AbstractComponent implements LegacyComponent, /** * Returns the size of the menu. - * + * * @return The size of the menu */ public int getSize() { @@ -327,9 +326,9 @@ public class MenuBar extends AbstractComponent implements LegacyComponent, * Set the item that is used when collapsing the top level menu. All * "overflowing" items will be added below this. The item command will be * ignored. If set to null, the default item with a downwards arrow is used. - * + * * The item command (if specified) is ignored. - * + * * @param item */ public void setMoreMenuItem(MenuItem item) { @@ -343,7 +342,7 @@ public class MenuBar extends AbstractComponent implements LegacyComponent, /** * Get the MenuItem used as the collapse menu item. - * + * * @return */ public MenuItem getMoreMenuItem() { @@ -357,7 +356,7 @@ public class MenuBar extends AbstractComponent implements LegacyComponent, * if the mouse is moved out of the opened menu. *

            * Note, that on touch devices the menu still opens on a click event. - * + * * @param autoOpenTopLevelMenu * true if menus should be opened without click, the default is * false @@ -374,7 +373,7 @@ public class MenuBar extends AbstractComponent implements LegacyComponent, * automatically opened when the mouse cursor is moved over the menu. * Normally root menu opens only by clicking on the menu. Submenus always * open automatically. - * + * * @return true if the root menus open without click, the default is false */ public boolean isAutoOpen() { @@ -386,7 +385,7 @@ public class MenuBar extends AbstractComponent implements LegacyComponent, * captions are passed to the browser as html and the developer is * responsible for ensuring no harmful html is used. If set to false, the * content is passed to the browser as plain text. - * + * * @param htmlContentAllowed * true if the captions are used as html, false if used as plain * text @@ -398,7 +397,7 @@ public class MenuBar extends AbstractComponent implements LegacyComponent, /** * Checks whether item captions are interpreted as html or plain text. - * + * * @return true if the captions are used as html, false if used as plain * text * @see #setHtmlContentAllowed(boolean) @@ -414,7 +413,7 @@ public class MenuBar extends AbstractComponent implements LegacyComponent, /* * (non-Javadoc) - * + * * @see com.vaadin.ui.Component.Focusable#setTabIndex(int) */ @Override @@ -443,7 +442,7 @@ public class MenuBar extends AbstractComponent implements LegacyComponent, * be fired on user click by implementing the * {@link com.vaadin.ui.MenuBar.Command} interface. You can also add * multiple MenuItems to a MenuItem and create a sub-menu. - * + * */ public class MenuItem implements Serializable { @@ -466,14 +465,15 @@ public class MenuBar extends AbstractComponent implements LegacyComponent, * Constructs a new menu item that can optionally have an icon and a * command associated with it. Icon and command can be null, but a * caption must be given. - * + * * @param text * The text associated with the command * @param command * The command to be fired * @throws IllegalArgumentException */ - public MenuItem(String caption, Resource icon, MenuBar.Command command) { + public MenuItem(String caption, Resource icon, + MenuBar.Command command) { if (caption == null) { throw new IllegalArgumentException("caption cannot be null"); } @@ -485,7 +485,7 @@ public class MenuBar extends AbstractComponent implements LegacyComponent, /** * Checks if the item has children (if it is a sub-menu). - * + * * @return True if this item has children */ public boolean hasChildren() { @@ -496,7 +496,7 @@ public class MenuBar extends AbstractComponent implements LegacyComponent, * Adds a separator to this menu. A separator is a way to visually group * items in a menu, to make it easier for users to find what they are * looking for in the menu. - * + * * @author Jouni Koivuviita / Vaadin Ltd. * @since 6.2.0 */ @@ -515,20 +515,21 @@ public class MenuBar extends AbstractComponent implements LegacyComponent, /** * Add a new item inside this item, thus creating a sub-menu. Command * can be null, but a caption must be given. - * + * * @param caption * the text for the menu item * @param command * the command for the menu item */ - public MenuBar.MenuItem addItem(String caption, MenuBar.Command command) { + public MenuBar.MenuItem addItem(String caption, + MenuBar.Command command) { return addItem(caption, null, command); } /** * Add a new item inside this item, thus creating a sub-menu. Icon and * command can be null, but a caption must be given. - * + * * @param caption * the text for the menu item * @param icon @@ -571,7 +572,7 @@ public class MenuBar extends AbstractComponent implements LegacyComponent, * Add an item before some item. If the given item does not exist the * item is added at the end of the menu. Icon and command can be null, * but a caption must be given. - * + * * @param caption * the text for the menu item * @param icon @@ -608,7 +609,7 @@ public class MenuBar extends AbstractComponent implements LegacyComponent, /** * For the associated command. - * + * * @return The associated command, or null if there is none */ public Command getCommand() { @@ -617,7 +618,7 @@ public class MenuBar extends AbstractComponent implements LegacyComponent, /** * Gets the objects icon. - * + * * @return The icon of the item, null if the item doesn't have an icon */ public Resource getIcon() { @@ -627,7 +628,7 @@ public class MenuBar extends AbstractComponent implements LegacyComponent, /** * For the containing item. This will return null if the item is in the * top-level menu bar. - * + * * @return The containing {@link com.vaadin.ui.MenuBar.MenuItem} , or * null if there is none */ @@ -637,7 +638,7 @@ public class MenuBar extends AbstractComponent implements LegacyComponent, /** * This will return the children of this item or null if there are none. - * + * * @return List of children items, or null if there are none */ public List getChildren() { @@ -646,7 +647,7 @@ public class MenuBar extends AbstractComponent implements LegacyComponent, /** * Gets the objects text - * + * * @return The text */ public java.lang.String getText() { @@ -655,7 +656,7 @@ public class MenuBar extends AbstractComponent implements LegacyComponent, /** * Returns the number of children. - * + * * @return The number of child items */ public int getSize() { @@ -667,7 +668,7 @@ public class MenuBar extends AbstractComponent implements LegacyComponent, /** * Get the unique identifier for this item. - * + * * @return The id of this item */ public int getId() { @@ -676,7 +677,7 @@ public class MenuBar extends AbstractComponent implements LegacyComponent, /** * Set the command for this item. Set null to remove. - * + * * @param command * The MenuCommand of this item */ @@ -686,7 +687,7 @@ public class MenuBar extends AbstractComponent implements LegacyComponent, /** * Sets the icon. Set null to remove. - * + * * @param icon * The icon for this item */ @@ -697,7 +698,7 @@ public class MenuBar extends AbstractComponent implements LegacyComponent, /** * Set the text of this object. - * + * * @param text * Text for this object */ @@ -710,7 +711,7 @@ public class MenuBar extends AbstractComponent implements LegacyComponent, /** * Remove the first occurrence of the item. - * + * * @param item * The item to be removed */ @@ -737,7 +738,7 @@ public class MenuBar extends AbstractComponent implements LegacyComponent, /** * Set the parent of this item. This is called by the addItem method. - * + * * @param parent * The parent item */ @@ -785,7 +786,7 @@ public class MenuBar extends AbstractComponent implements LegacyComponent, * Sets the items's description. See {@link #getDescription()} for more * information on what the description is. This method will trigger a * {@link RepaintRequestEvent}. - * + * * @param description * the new description string for the component. */ @@ -800,7 +801,7 @@ public class MenuBar extends AbstractComponent implements LegacyComponent, * describe the state of the item to the user. The description string * may contain certain XML tags: *

            - * + * *

            * * @@ -843,11 +844,11 @@ public class MenuBar extends AbstractComponent implements LegacyComponent, * *
            *

            - * + * *

            * These tags may be nested. *

            - * + * * @return item's description String */ public String getDescription() { @@ -858,11 +859,11 @@ public class MenuBar extends AbstractComponent implements LegacyComponent, * Gets the checkable state of the item - whether the item has checked * and unchecked states. If an item is checkable its checked state (as * returned by {@link #isChecked()}) is indicated in the UI. - * + * *

            * An item is not checkable by default. *

            - * + * * @return true if the item is checkable, false otherwise * @since 6.6.2 */ @@ -874,15 +875,15 @@ public class MenuBar extends AbstractComponent implements LegacyComponent, * Sets the checkable state of the item. If an item is checkable its * checked state (as returned by {@link #isChecked()}) is indicated in * the UI. - * + * *

            * An item is not checkable by default. *

            - * + * *

            * Items with sub items cannot be checkable. *

            - * + * * @param checkable * true if the item should be checkable, false otherwise * @throws IllegalStateException @@ -904,15 +905,15 @@ public class MenuBar extends AbstractComponent implements LegacyComponent, * if the item is checkable (as indicated by {@link #isCheckable()}). * The checked state is indicated in the UI with the item, if the item * is checkable. - * + * *

            * An item is not checked by default. *

            - * + * *

            * The CSS style corresponding to the checked state is "-checked". *

            - * + * * @return true if the item is checked, false otherwise * @since 6.6.2 */ @@ -924,15 +925,15 @@ public class MenuBar extends AbstractComponent implements LegacyComponent, * Sets the checked state of the item. Only used if the item is * checkable (indicated by {@link #isCheckable()}). The checked state is * indicated in the UI with the item, if the item is checkable. - * + * *

            * An item is not checked by default. *

            - * + * *

            * The CSS style corresponding to the checked state is "-checked". *

            - * + * * @return true if the item is checked, false otherwise * @since 6.6.2 */ @@ -950,7 +951,8 @@ public class MenuBar extends AbstractComponent implements LegacyComponent, } // in many cases there seems to be an empty more menu item - if (getMoreMenuItem() != null && !getMoreMenuItem().getText().isEmpty()) { + if (getMoreMenuItem() != null + && !getMoreMenuItem().getText().isEmpty()) { Element moreMenu = createMenuElement(getMoreMenuItem()); moreMenu.attr("more", true); design.appendChild(moreMenu); @@ -971,14 +973,14 @@ public class MenuBar extends AbstractComponent implements LegacyComponent, def.getIcon(), Resource.class); DesignAttributeHandler.writeAttribute("disabled", attr, !item.isEnabled(), !def.isEnabled(), boolean.class); - DesignAttributeHandler.writeAttribute("visible", attr, - item.isVisible(), def.isVisible(), boolean.class); + DesignAttributeHandler.writeAttribute("visible", attr, item.isVisible(), + def.isVisible(), boolean.class); DesignAttributeHandler.writeAttribute("separator", attr, item.isSeparator(), def.isSeparator(), boolean.class); DesignAttributeHandler.writeAttribute("checkable", attr, item.isCheckable(), def.isCheckable(), boolean.class); - DesignAttributeHandler.writeAttribute("checked", attr, - item.isChecked(), def.isChecked(), boolean.class); + DesignAttributeHandler.writeAttribute("checked", attr, item.isChecked(), + def.isChecked(), boolean.class); DesignAttributeHandler.writeAttribute("description", attr, item.getDescription(), def.getDescription(), String.class); DesignAttributeHandler.writeAttribute("style-name", attr, @@ -998,8 +1000,8 @@ public class MenuBar extends AbstractComponent implements LegacyComponent, protected MenuItem readMenuElement(Element menuElement) { Resource icon = null; if (menuElement.hasAttr("icon")) { - icon = DesignAttributeHandler.getFormatter().parse( - menuElement.attr("icon"), Resource.class); + icon = DesignAttributeHandler.getFormatter() + .parse(menuElement.attr("icon"), Resource.class); } String caption = ""; @@ -1040,12 +1042,12 @@ public class MenuBar extends AbstractComponent implements LegacyComponent, attr, boolean.class)); } if (menuElement.hasAttr("description")) { - menu.setDescription(DesignAttributeHandler.readAttribute( - "description", attr, String.class)); + menu.setDescription(DesignAttributeHandler + .readAttribute("description", attr, String.class)); } if (menuElement.hasAttr("style-name")) { - menu.setStyleName(DesignAttributeHandler.readAttribute( - "style-name", attr, String.class)); + menu.setStyleName(DesignAttributeHandler.readAttribute("style-name", + attr, String.class)); } if (!subMenus.isEmpty()) { diff --git a/server/src/main/java/com/vaadin/ui/NativeButton.java b/server/src/main/java/com/vaadin/ui/NativeButton.java index 3c220719b5..e04a356e22 100644 --- a/server/src/main/java/com/vaadin/ui/NativeButton.java +++ b/server/src/main/java/com/vaadin/ui/NativeButton.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/server/src/main/java/com/vaadin/ui/NativeSelect.java b/server/src/main/java/com/vaadin/ui/NativeSelect.java index 137d57f677..d3fac0ade5 100644 --- a/server/src/main/java/com/vaadin/ui/NativeSelect.java +++ b/server/src/main/java/com/vaadin/ui/NativeSelect.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -35,13 +35,14 @@ import com.vaadin.server.PaintTarget; * better choice. */ @SuppressWarnings("serial") -public class NativeSelect extends AbstractSelect implements - FieldEvents.BlurNotifier, FieldEvents.FocusNotifier { +public class NativeSelect extends AbstractSelect + implements FieldEvents.BlurNotifier, FieldEvents.FocusNotifier { // width in characters, mimics TextField private int columns = 0; - FocusAndBlurServerRpcImpl focusBlurRpc = new FocusAndBlurServerRpcImpl(this) { + FocusAndBlurServerRpcImpl focusBlurRpc = new FocusAndBlurServerRpcImpl( + this) { @Override protected void fireEvent(Event event) { @@ -76,7 +77,7 @@ public class NativeSelect extends AbstractSelect implements * Calling {@code setColumns(10);} is equivalent to calling * {@code setWidth("10em");} *

            - * + * * @deprecated As of 7.0. "Columns" does not reflect the exact number of * characters that will be displayed. It is better to use * setWidth together with "em" to control the width of the @@ -97,7 +98,7 @@ public class NativeSelect extends AbstractSelect implements /** * Gets the number of columns for the component. - * + * * @see #setColumns(int) * @deprecated As of 7.0. "Columns" does not reflect the exact number of * characters that will be displayed. It is better to use @@ -124,7 +125,8 @@ public class NativeSelect extends AbstractSelect implements public void setMultiSelect(boolean multiSelect) throws UnsupportedOperationException { if (multiSelect == true) { - throw new UnsupportedOperationException("Multiselect not supported"); + throw new UnsupportedOperationException( + "Multiselect not supported"); } } diff --git a/server/src/main/java/com/vaadin/ui/Notification.java b/server/src/main/java/com/vaadin/ui/Notification.java index aaf25a9e9d..410493c81f 100644 --- a/server/src/main/java/com/vaadin/ui/Notification.java +++ b/server/src/main/java/com/vaadin/ui/Notification.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -59,12 +59,12 @@ import com.vaadin.shared.Position; * configured to show up in a custom position, for a specified time (or until * clicked), and with a custom stylename. An icon can also be added. *

            - * + * */ public class Notification implements Serializable { public enum Type { - HUMANIZED_MESSAGE("humanized"), WARNING_MESSAGE("warning"), ERROR_MESSAGE( - "error"), TRAY_NOTIFICATION("tray"), + HUMANIZED_MESSAGE("humanized"), WARNING_MESSAGE( + "warning"), ERROR_MESSAGE("error"), TRAY_NOTIFICATION("tray"), /** * @since 7.2 */ @@ -123,9 +123,9 @@ public class Notification implements Serializable { /** * Creates a "humanized" notification message. - * + * * The caption is rendered as plain text with HTML automatically escaped. - * + * * @param caption * The message to show */ @@ -135,9 +135,9 @@ public class Notification implements Serializable { /** * Creates a notification message of the specified type. - * + * * The caption is rendered as plain text with HTML automatically escaped. - * + * * @param caption * The message to show * @param type @@ -150,10 +150,10 @@ public class Notification implements Serializable { /** * Creates a "humanized" notification message with a bigger caption and * smaller description. - * + * * The caption and description are rendered as plain text with HTML * automatically escaped. - * + * * @param caption * The message caption * @param description @@ -166,10 +166,10 @@ public class Notification implements Serializable { /** * Creates a notification message of the specified type, with a bigger * caption and smaller description. - * + * * The caption and description are rendered as plain text with HTML * automatically escaped. - * + * * @param caption * The message caption * @param description @@ -184,9 +184,9 @@ public class Notification implements Serializable { /** * Creates a notification message of the specified type, with a bigger * caption and smaller description. - * + * * Care should be taken to to avoid XSS vulnerabilities if html is allowed. - * + * * @param caption * The message caption * @param description @@ -230,7 +230,7 @@ public class Notification implements Serializable { /** * Gets the caption part of the notification message. - * + * * @return The message caption */ public String getCaption() { @@ -239,7 +239,7 @@ public class Notification implements Serializable { /** * Sets the caption part of the notification message - * + * * @param caption * The message caption */ @@ -249,7 +249,7 @@ public class Notification implements Serializable { /** * Gets the description part of the notification message. - * + * * @return The message description. */ public String getDescription() { @@ -258,7 +258,7 @@ public class Notification implements Serializable { /** * Sets the description part of the notification message. - * + * * @param description */ public void setDescription(String description) { @@ -267,7 +267,7 @@ public class Notification implements Serializable { /** * Gets the position of the notification message. - * + * * @return The position */ public Position getPosition() { @@ -276,7 +276,7 @@ public class Notification implements Serializable { /** * Sets the position of the notification message. - * + * * @param position * The desired notification position */ @@ -286,7 +286,7 @@ public class Notification implements Serializable { /** * Gets the icon part of the notification message. - * + * * @return The message icon */ public Resource getIcon() { @@ -295,7 +295,7 @@ public class Notification implements Serializable { /** * Sets the icon part of the notification message. - * + * * @param icon * The desired message icon */ @@ -305,7 +305,7 @@ public class Notification implements Serializable { /** * Gets the delay before the notification disappears. - * + * * @return the delay in msec, -1 indicates the message has to be clicked. */ public int getDelayMsec() { @@ -314,7 +314,7 @@ public class Notification implements Serializable { /** * Sets the delay before the notification disappears. - * + * * @param delayMsec * the desired delay in msec, -1 to require the user to click the * message @@ -325,7 +325,7 @@ public class Notification implements Serializable { /** * Sets the style name for the notification message. - * + * * @param styleName * The desired style name. */ @@ -335,7 +335,7 @@ public class Notification implements Serializable { /** * Gets the style name for the notification message. - * + * * @return */ public String getStyleName() { @@ -347,7 +347,7 @@ public class Notification implements Serializable { * true, the texts are passed to the browser as html and the developer is * responsible for ensuring no harmful html is used. If set to false, the * texts are passed to the browser as plain text. - * + * * @param htmlContentAllowed * true if the texts are used as html, false if used as plain * text @@ -359,7 +359,7 @@ public class Notification implements Serializable { /** * Checks whether caption and description are interpreted as html or plain * text. - * + * * @return true if the texts are used as html, false if used as plain text * @see #setHtmlContentAllowed(boolean) */ @@ -369,7 +369,7 @@ public class Notification implements Serializable { /** * Shows this notification on a Page. - * + * * @param page * The page on which the notification should be shown */ @@ -381,12 +381,12 @@ public class Notification implements Serializable { /** * Shows a notification message on the middle of the current page. The * message automatically disappears ("humanized message"). - * + * * The caption is rendered as plain text with HTML automatically escaped. - * + * * @see #Notification(String) * @see #show(Page) - * + * * @param caption * The message */ @@ -399,12 +399,12 @@ public class Notification implements Serializable { * of the message depends on the type, which is one of the basic types * defined in {@link Notification}, for instance * Notification.TYPE_WARNING_MESSAGE. - * + * * The caption is rendered as plain text with HTML automatically escaped. - * + * * @see #Notification(String, int) * @see #show(Page) - * + * * @param caption * The message * @param type @@ -419,12 +419,12 @@ public class Notification implements Serializable { * of the message depends on the type, which is one of the basic types * defined in {@link Notification}, for instance * Notification.TYPE_WARNING_MESSAGE. - * + * * The caption is rendered as plain text with HTML automatically escaped. - * + * * @see #Notification(String, Type) * @see #show(Page) - * + * * @param caption * The message * @param description diff --git a/server/src/main/java/com/vaadin/ui/NotificationConfiguration.java b/server/src/main/java/com/vaadin/ui/NotificationConfiguration.java index 925c888a51..37eacab09d 100644 --- a/server/src/main/java/com/vaadin/ui/NotificationConfiguration.java +++ b/server/src/main/java/com/vaadin/ui/NotificationConfiguration.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -15,7 +15,7 @@ */ /** - * + * */ package com.vaadin.ui; @@ -86,8 +86,8 @@ public interface NotificationConfiguration extends Serializable { * Sets the WAI-ARIA role for a notification type. *

            * This role defines how an assistive device handles a notification. - * Available roles are alert and status (@see Roles + * Available roles are alert and status (@see + * Roles * Model). * * The default role is alert. @@ -103,8 +103,8 @@ public interface NotificationConfiguration extends Serializable { * Gets the WAI-ARIA role for a notification type. *

            * This role defines how an assistive device handles a notification. - * Available roles are alert and status (@see Roles + * Available roles are alert and status (@see + * Roles * Model) *

            * The default role is alert. diff --git a/server/src/main/java/com/vaadin/ui/OptionGroup.java b/server/src/main/java/com/vaadin/ui/OptionGroup.java index 81e81c9a3a..2516dc7dde 100644 --- a/server/src/main/java/com/vaadin/ui/OptionGroup.java +++ b/server/src/main/java/com/vaadin/ui/OptionGroup.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -40,8 +40,8 @@ import com.vaadin.ui.declarative.DesignFormatter; * Configures select to be used as an option group. */ @SuppressWarnings("serial") -public class OptionGroup extends AbstractSelect implements - FieldEvents.BlurNotifier, FieldEvents.FocusNotifier { +public class OptionGroup extends AbstractSelect + implements FieldEvents.BlurNotifier, FieldEvents.FocusNotifier { private Set disabledItemIds = new HashSet(); private boolean htmlContentAllowed = false; @@ -66,7 +66,8 @@ public class OptionGroup extends AbstractSelect implements public void paintContent(PaintTarget target) throws PaintException { target.addAttribute("type", "optiongroup"); if (isHtmlContentAllowed()) { - target.addAttribute(OptionGroupConstants.HTML_CONTENT_ALLOWED, true); + target.addAttribute(OptionGroupConstants.HTML_CONTENT_ALLOWED, + true); } super.paintContent(target); } @@ -168,7 +169,8 @@ public class OptionGroup extends AbstractSelect implements Set currentValueSet = (Set) getValue(); Set newValueSet = (Set) newValue; for (Object itemId : currentValueSet) { - if (!isItemEnabled(itemId) && !newValueSet.contains(itemId)) { + if (!isItemEnabled(itemId) + && !newValueSet.contains(itemId)) { markAsDirty(); return; } @@ -197,10 +199,10 @@ public class OptionGroup extends AbstractSelect implements * Sets an item disabled or enabled. In the multiselect mode, a disabled * item cannot be selected or deselected by the user. In the single * selection mode, a disable item cannot be selected. - * + * * However, programmatical selection or deselection of an disable item is * possible. By default, items are enabled. - * + * * @param itemId * the id of the item to be disabled or enabled * @param enabled @@ -219,7 +221,7 @@ public class OptionGroup extends AbstractSelect implements /** * Returns true if the item is enabled. - * + * * @param itemId * the id of the item to be checked * @return true if the item is enabled, false otherwise @@ -237,7 +239,7 @@ public class OptionGroup extends AbstractSelect implements * captions are passed to the browser as html and the developer is * responsible for ensuring no harmful html is used. If set to false, the * content is passed to the browser as plain text. - * + * * @param htmlContentAllowed * true if the captions are used as html, false if used as plain * text @@ -249,7 +251,7 @@ public class OptionGroup extends AbstractSelect implements /** * Checks whether captions are interpreted as html or plain text. - * + * * @return true if the captions are used as html, false if used as plain * text * @see #setHtmlContentAllowed(boolean) diff --git a/server/src/main/java/com/vaadin/ui/Panel.java b/server/src/main/java/com/vaadin/ui/Panel.java index 6458d5f57d..193f0bdcef 100644 --- a/server/src/main/java/com/vaadin/ui/Panel.java +++ b/server/src/main/java/com/vaadin/ui/Panel.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -38,13 +38,13 @@ import com.vaadin.ui.declarative.DesignContext; /** * Panel - a simple single component container. - * + * * @author Vaadin Ltd. * @since 3.0 */ @SuppressWarnings("serial") -public class Panel extends AbstractSingleComponentContainer implements - Scrollable, Action.Notifier, Focusable, LegacyComponent { +public class Panel extends AbstractSingleComponentContainer + implements Scrollable, Action.Notifier, Focusable, LegacyComponent { /** * Keeps track of the Actions added to this component, and manages the @@ -68,7 +68,7 @@ public class Panel extends AbstractSingleComponentContainer implements /** * Creates a new empty panel which contains the given content. - * + * * @param content * the content for the panel. */ @@ -81,7 +81,7 @@ public class Panel extends AbstractSingleComponentContainer implements /** * Creates a new empty panel with caption. - * + * * @param caption * the caption used in the panel (HTML). */ @@ -91,7 +91,7 @@ public class Panel extends AbstractSingleComponentContainer implements /** * Creates a new empty panel with the given caption and content. - * + * * @param caption * the caption of the panel (HTML). * @param content @@ -104,11 +104,11 @@ public class Panel extends AbstractSingleComponentContainer implements /** * Sets the caption of the panel. - * + * * Note that the caption is interpreted as HTML and therefore care should be * taken not to enable HTML injection and XSS attacks using panel captions. * This behavior may change in future versions. - * + * * @see AbstractComponent#setCaption(String) */ @Override @@ -118,7 +118,7 @@ public class Panel extends AbstractSingleComponentContainer implements /* * (non-Javadoc) - * + * * @see com.vaadin.server.LegacyComponent#paintContent(com.vaadin.server * .PaintTarget) */ @@ -132,7 +132,7 @@ public class Panel extends AbstractSingleComponentContainer implements /** * Called when one or more variables handled by the implementing class are * changed. - * + * * @see com.vaadin.server.VariableOwner#changeVariables(Object, Map) */ @Override @@ -170,7 +170,7 @@ public class Panel extends AbstractSingleComponentContainer implements /* * (non-Javadoc) - * + * * @see com.vaadin.server.Scrollable#setScrollable(boolean) */ @Override @@ -180,7 +180,7 @@ public class Panel extends AbstractSingleComponentContainer implements /* * (non-Javadoc) - * + * * @see com.vaadin.server.Scrollable#setScrollable(boolean) */ @Override @@ -190,7 +190,7 @@ public class Panel extends AbstractSingleComponentContainer implements /* * (non-Javadoc) - * + * * @see com.vaadin.server.Scrollable#setScrollLeft(int) */ @Override @@ -204,7 +204,7 @@ public class Panel extends AbstractSingleComponentContainer implements /* * (non-Javadoc) - * + * * @see com.vaadin.server.Scrollable#setScrollTop(int) */ @Override @@ -267,9 +267,9 @@ public class Panel extends AbstractSingleComponentContainer implements * user clicks inside the Panel. Also when the click targets a component * inside the Panel, provided the targeted component does not prevent the * click event from propagating. - * + * * Use {@link #removeListener(ClickListener)} to remove the listener. - * + * * @param listener * The listener to add */ @@ -290,7 +290,7 @@ public class Panel extends AbstractSingleComponentContainer implements /** * Remove a click listener from the Panel. The listener should earlier have * been added using {@link #addListener(ClickListener)}. - * + * * @param listener * The listener to remove */ @@ -326,7 +326,7 @@ public class Panel extends AbstractSingleComponentContainer implements /** * Moves keyboard focus to the component. {@see Focusable#focus()} - * + * */ @Override public void focus() { diff --git a/server/src/main/java/com/vaadin/ui/PasswordField.java b/server/src/main/java/com/vaadin/ui/PasswordField.java index 385649c318..05f2138dd5 100644 --- a/server/src/main/java/com/vaadin/ui/PasswordField.java +++ b/server/src/main/java/com/vaadin/ui/PasswordField.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -37,7 +37,7 @@ public class PasswordField extends AbstractTextField { /** * Constructs a PasswordField with given property data source. - * + * * @param dataSource * the property data source for the field */ @@ -47,7 +47,7 @@ public class PasswordField extends AbstractTextField { /** * Constructs a PasswordField with given caption and property data source. - * + * * @param caption * the caption for the field * @param dataSource @@ -60,7 +60,7 @@ public class PasswordField extends AbstractTextField { /** * Constructs a PasswordField with given value and caption. - * + * * @param caption * the caption for the field * @param value @@ -73,7 +73,7 @@ public class PasswordField extends AbstractTextField { /** * Constructs a PasswordField with given caption. - * + * * @param caption * the caption for the field */ @@ -84,7 +84,7 @@ public class PasswordField extends AbstractTextField { /* * (non-Javadoc) - * + * * @see com.vaadin.ui.AbstractField#readDesign(org.jsoup.nodes.Element , * com.vaadin.ui.declarative.DesignContext) */ @@ -100,7 +100,7 @@ public class PasswordField extends AbstractTextField { /* * (non-Javadoc) - * + * * @see com.vaadin.ui.AbstractTextField#writeDesign(org.jsoup.nodes.Element * , com.vaadin.ui.declarative.DesignContext) */ diff --git a/server/src/main/java/com/vaadin/ui/PopupDateField.java b/server/src/main/java/com/vaadin/ui/PopupDateField.java index f07ac84160..cdfd594e53 100644 --- a/server/src/main/java/com/vaadin/ui/PopupDateField.java +++ b/server/src/main/java/com/vaadin/ui/PopupDateField.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -26,9 +26,9 @@ import com.vaadin.shared.ui.datefield.PopupDateFieldState; /** *

            * A date entry component, which displays the actual date selector as a popup. - * + * *

            - * + * * @see DateField * @see InlineDateField * @author Vaadin Ltd. @@ -69,7 +69,7 @@ public class PopupDateField extends DateField { /** * Gets the current input prompt. - * + * * @see #setInputPrompt(String) * @return the current input prompt, or null if not enabled */ @@ -80,7 +80,7 @@ public class PopupDateField extends DateField { /** * Sets the input prompt - a textual prompt that is displayed when the field * would otherwise be empty, to prompt the user for input. - * + * * @param inputPrompt */ public void setInputPrompt(String inputPrompt) { @@ -100,9 +100,9 @@ public class PopupDateField extends DateField { /** * Checks whether the text field is enabled (default) or not. - * + * * @see PopupDateField#setTextFieldEnabled(boolean); - * + * * @return true if the text field is enabled, false otherwise. */ public boolean isTextFieldEnabled() { @@ -113,9 +113,9 @@ public class PopupDateField extends DateField { * Enables or disables the text field. By default the text field is enabled. * Disabling it causes only the button for date selection to be active, thus * preventing the user from entering invalid dates. - * + * * See {@link http://dev.vaadin.com/ticket/6790}. - * + * * @param state * true to enable text field, false to disable it. */ @@ -126,7 +126,7 @@ public class PopupDateField extends DateField { /** * Set a description that explains the usage of the Widget for users of * assistive devices. - * + * * @param description * String with the description */ @@ -137,7 +137,7 @@ public class PopupDateField extends DateField { /** * Get the description that explains the usage of the Widget for users of * assistive devices. - * + * * @return String with the description */ public String getAssistiveText() { diff --git a/server/src/main/java/com/vaadin/ui/PopupView.java b/server/src/main/java/com/vaadin/ui/PopupView.java index 73c93b29f3..04598d4aa6 100644 --- a/server/src/main/java/com/vaadin/ui/PopupView.java +++ b/server/src/main/java/com/vaadin/ui/PopupView.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -29,12 +29,12 @@ import com.vaadin.shared.ui.popupview.PopupViewState; import com.vaadin.ui.declarative.DesignContext; /** - * + * * A component for displaying a two different views to data. The minimized view * is normally used to render the component, and when it is clicked the full * view is displayed on a popup. The inner class {@link PopupView.Content} is * used to deliver contents to this component. - * + * * @author Vaadin Ltd. */ @SuppressWarnings("serial") @@ -69,7 +69,7 @@ public class PopupView extends AbstractComponent implements HasComponents { /** * This is an internal constructor. Use * {@link PopupView#PopupView(String, Component)} instead. - * + * * @since 7.5.0 */ @Deprecated @@ -83,7 +83,7 @@ public class PopupView extends AbstractComponent implements HasComponents { * A simple way to create a PopupPanel. Note that the minimal representation * may not be dynamically updated, in order to achieve this create your own * Content object and use {@link PopupView#PopupView(Content)}. - * + * * @param small * the minimal textual representation as HTML * @param large @@ -96,7 +96,7 @@ public class PopupView extends AbstractComponent implements HasComponents { /** * Creates a PopupView through the PopupView.Content interface. This allows * the creator to dynamically change the contents of the PopupView. - * + * * @param content * the PopupView.Content that contains the information for this */ @@ -107,9 +107,9 @@ public class PopupView extends AbstractComponent implements HasComponents { /** * Creates a Content from given text representation and popup content. - * + * * @since 7.5.0 - * + * * @param minimizedValue * text representation when popup is hidden * @param popupContent @@ -133,7 +133,7 @@ public class PopupView extends AbstractComponent implements HasComponents { /** * This method will replace the current content of the panel with a new one. - * + * * @param newContent * PopupView.Content object containing new information for the * PopupView @@ -152,7 +152,7 @@ public class PopupView extends AbstractComponent implements HasComponents { /** * Returns the content-package for this PopupView. - * + * * @return the PopupView.Content for this object or null */ public PopupView.Content getContent() { @@ -162,7 +162,7 @@ public class PopupView extends AbstractComponent implements HasComponents { /** * Set the visibility of the popup. Does not hide the minimal * representation. - * + * * @param visible */ public void setPopupVisible(boolean visible) { @@ -202,7 +202,7 @@ public class PopupView extends AbstractComponent implements HasComponents { /** * Return whether the popup is visible. - * + * * @return true if the popup is showing */ public boolean isPopupVisible() { @@ -212,7 +212,7 @@ public class PopupView extends AbstractComponent implements HasComponents { /** * Check if this popup will be hidden when the user takes the mouse cursor * out of the popup area. - * + * * @return true if the popup is hidden on mouse out, false otherwise */ public boolean isHideOnMouseOut() { @@ -223,9 +223,9 @@ public class PopupView extends AbstractComponent implements HasComponents { * Should the popup automatically hide when the user takes the mouse cursor * out of the popup area? If this is false, the user must click outside the * popup to close it. The default is true. - * + * * @param hideOnMouseOut - * + * */ public void setHideOnMouseOut(boolean hideOnMouseOut) { getState().hideOnMouseOut = hideOnMouseOut; @@ -238,7 +238,7 @@ public class PopupView extends AbstractComponent implements HasComponents { /** * This class only contains other components when the popup is showing. - * + * * @see com.vaadin.ui.ComponentContainer#getComponentIterator() */ @Override @@ -253,7 +253,7 @@ public class PopupView extends AbstractComponent implements HasComponents { /** * Gets the number of contained components. Consistent with the iterator * returned by {@link #getComponentIterator()}. - * + * * @return the number of contained components (zero or one) */ public int getComponentCount() { @@ -288,8 +288,8 @@ public class PopupView extends AbstractComponent implements HasComponents { super.writeDesign(design, designContext); Element popupContent = new Element(Tag.valueOf("popup-content"), ""); - popupContent.appendChild(designContext.createElement(content - .getPopupComponent())); + popupContent.appendChild( + designContext.createElement(content.getPopupComponent())); String minimizedHTML = content.getMinimizedValueAsHTML(); if (minimizedHTML != null && !minimizedHTML.isEmpty()) { @@ -317,14 +317,14 @@ public class PopupView extends AbstractComponent implements HasComponents { /** * This should return a small view of the full data. - * + * * @return value in HTML format */ public String getMinimizedValueAsHTML(); /** * This should return the full Component representing the data - * + * * @return a Component for the value */ public Component getPopupComponent(); @@ -333,13 +333,13 @@ public class PopupView extends AbstractComponent implements HasComponents { /** * Add a listener that is called whenever the visibility of the popup is * changed. - * + * * @param listener * the listener to add * @see PopupVisibilityListener * @see PopupVisibilityEvent * @see #removeListener(PopupVisibilityListener) - * + * */ public void addPopupVisibilityListener(PopupVisibilityListener listener) { addListener(PopupVisibilityEvent.class, listener, @@ -358,13 +358,14 @@ public class PopupView extends AbstractComponent implements HasComponents { /** * Removes a previously added listener, so that it no longer receives events * when the visibility of the popup changes. - * + * * @param listener * the listener to remove * @see PopupVisibilityListener * @see #addListener(PopupVisibilityListener) */ - public void removePopupVisibilityListener(PopupVisibilityListener listener) { + public void removePopupVisibilityListener( + PopupVisibilityListener listener) { removeListener(PopupVisibilityEvent.class, listener, POPUP_VISIBILITY_METHOD); } @@ -383,7 +384,7 @@ public class PopupView extends AbstractComponent implements HasComponents { * visibility of the popup changes. You can get the new visibility directly * with {@link #isPopupVisible()}, or get the PopupView that produced the * event with {@link #getPopupView()}. - * + * */ public static class PopupVisibilityEvent extends Event { @@ -393,7 +394,7 @@ public class PopupView extends AbstractComponent implements HasComponents { /** * Get the PopupView instance that is the source of this event. - * + * * @return the source PopupView */ public PopupView getPopupView() { @@ -402,7 +403,7 @@ public class PopupView extends AbstractComponent implements HasComponents { /** * Returns the current visibility of the popup. - * + * * @return true if the popup is visible */ public boolean isPopupVisible() { @@ -413,16 +414,16 @@ public class PopupView extends AbstractComponent implements HasComponents { /** * Defines a listener that can receive a PopupVisibilityEvent when the * visibility of the popup changes. - * + * */ public interface PopupVisibilityListener extends Serializable { /** * Pass to {@link PopupView#PopupVisibilityEvent} to start listening for * popup visibility changes. - * + * * @param event * the event - * + * * @see {@link PopupVisibilityEvent} * @see {@link PopupView#addListener(PopupVisibilityListener)} */ diff --git a/server/src/main/java/com/vaadin/ui/ProgressBar.java b/server/src/main/java/com/vaadin/ui/ProgressBar.java index d38067d51e..8c588cb095 100644 --- a/server/src/main/java/com/vaadin/ui/ProgressBar.java +++ b/server/src/main/java/com/vaadin/ui/ProgressBar.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -30,12 +30,12 @@ import com.vaadin.ui.declarative.DesignContext; * floating point value between 0 and 1 (inclusive). The progress bar can also * be in an indeterminate mode showing an animation indicating that the task is * running but without providing any information about the current progress. - * + * * @since 7.1 * @author Vaadin Ltd */ -public class ProgressBar extends AbstractField implements - Property.Viewer, Property.ValueChangeListener { +public class ProgressBar extends AbstractField + implements Property.Viewer, Property.ValueChangeListener { private static final float DEFAULT_VALUE = 0f; @@ -48,7 +48,7 @@ public class ProgressBar extends AbstractField implements /** * Creates a new progress bar with the given initial value. - * + * * @param progress * the initial progress value */ @@ -58,7 +58,7 @@ public class ProgressBar extends AbstractField implements /** * Creates a new progress bar bound to the given data source. - * + * * @param dataSource * the property to bind this progress bar to */ @@ -78,7 +78,7 @@ public class ProgressBar extends AbstractField implements * Gets the value of this progress bar. The value is a float * between 0 and 1 where 0 represents no progress at all and 1 represents * fully completed. - * + * * @return the current progress value */ @Override @@ -90,7 +90,7 @@ public class ProgressBar extends AbstractField implements * Sets the value of this progress bar. The value is a float * between 0 and 1 where 0 represents no progress at all and 1 represents * fully completed. - * + * * @param newValue * the current progress value */ @@ -118,7 +118,7 @@ public class ProgressBar extends AbstractField implements * Sets whether or not this progress indicator is indeterminate. In * indeterminate mode there is an animation indicating that the task is * running but without providing any information about the current progress. - * + * * @param indeterminate * true to set to indeterminate mode; otherwise * false @@ -131,7 +131,7 @@ public class ProgressBar extends AbstractField implements * Gets whether or not this progress indicator is indeterminate. In * indeterminate mode there is an animation indicating that the task is * running but without providing any information about the current progress. - * + * * @return true if set to indeterminate mode; otherwise * false */ @@ -143,7 +143,7 @@ public class ProgressBar extends AbstractField implements * Overridden to keep the shared state in sync with the AbstractField * internal value. Should be removed once AbstractField is refactored to use * shared state. - * + * * See tickets #10921 and #11064. */ @Override @@ -159,9 +159,8 @@ public class ProgressBar extends AbstractField implements public void readDesign(Element design, DesignContext designContext) { super.readDesign(design, designContext); if (design.hasAttr("value") && !design.attr("value").isEmpty()) { - setValue( - DesignAttributeHandler.readAttribute("value", - design.attributes(), Float.class), false, true); + setValue(DesignAttributeHandler.readAttribute("value", + design.attributes(), Float.class), false, true); } } diff --git a/server/src/main/java/com/vaadin/ui/ProgressIndicator.java b/server/src/main/java/com/vaadin/ui/ProgressIndicator.java index 6e436169e3..dd275782a8 100644 --- a/server/src/main/java/com/vaadin/ui/ProgressIndicator.java +++ b/server/src/main/java/com/vaadin/ui/ProgressIndicator.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -28,7 +28,7 @@ import com.vaadin.shared.ui.progressindicator.ProgressIndicatorState; * centralized management of when messages are sent to the server. Furthermore, * polling might not be needed at all if {@link UI#setPushMode(PushMode)} or * {@link UI#setPollInterval(int)} is used. - * + * * @author Vaadin Ltd. * @since 4 * @deprecated as of 7.1, use {@link ProgressBar} combined with @@ -56,7 +56,7 @@ public class ProgressIndicator extends ProgressBar { /** * Creates a new instance of ProgressIndicator with given state. - * + * * @param value */ public ProgressIndicator(float value) { @@ -67,7 +67,7 @@ public class ProgressIndicator extends ProgressBar { /** * Creates a new instance of ProgressIndicator with state read from the * given datasource. - * + * * @param contentSource */ public ProgressIndicator(Property contentSource) { @@ -87,7 +87,7 @@ public class ProgressIndicator extends ProgressBar { /** * Sets the interval that component checks for progress. - * + * * @param pollingInterval * the interval in milliseconds. */ @@ -97,7 +97,7 @@ public class ProgressIndicator extends ProgressBar { /** * Gets the interval that component checks for progress. - * + * * @return the interval in milliseconds. */ public int getPollingInterval() { diff --git a/server/src/main/java/com/vaadin/ui/PushConfiguration.java b/server/src/main/java/com/vaadin/ui/PushConfiguration.java index 6ef323cea8..e0f47c494c 100644 --- a/server/src/main/java/com/vaadin/ui/PushConfiguration.java +++ b/server/src/main/java/com/vaadin/ui/PushConfiguration.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -28,7 +28,7 @@ import com.vaadin.shared.ui.ui.UIState.PushConfigurationState; /** * Provides method for configuring the push channel. - * + * * @since 7.1 * @author Vaadin Ltd */ @@ -36,7 +36,7 @@ public interface PushConfiguration extends Serializable { /** * Returns the mode of bidirectional ("push") communication that is used. - * + * * @return The push mode. */ public PushMode getPushMode(); @@ -49,10 +49,10 @@ public interface PushConfiguration extends Serializable { * application developer. An add-on should not set the push mode directly, * rather instruct the user to set it. *

            - * + * * @param pushMode * The push mode to use. - * + * * @throws IllegalArgumentException * if the argument is null. * @throws IllegalStateException @@ -66,7 +66,7 @@ public interface PushConfiguration extends Serializable { * Note that if you set the transport type using * {@link #setParameter(String, String)} to an unsupported type this method * will return null. Supported types are defined by {@link Transport}. - * + * * @return The primary transport type */ public Transport getTransport(); @@ -76,7 +76,7 @@ public interface PushConfiguration extends Serializable { *

            * Note that the new transport type will not be used until the push channel * is disconnected and reconnected if already active. - * + * * @param transport * The primary transport type */ @@ -88,7 +88,7 @@ public interface PushConfiguration extends Serializable { * Note that if you set the transport type using * {@link #setParameter(String, String)} to an unsupported type this method * will return null. Supported types are defined by {@link Transport}. - * + * * @return The fallback transport type */ public Transport getFallbackTransport(); @@ -98,7 +98,7 @@ public interface PushConfiguration extends Serializable { *

            * Note that the new transport type will not be used until the push channel * is disconnected and reconnected if already active. - * + * * @param fallbackTransport * The fallback transport type */ @@ -109,7 +109,7 @@ public interface PushConfiguration extends Serializable { *

            * This method provides low level access to push parameters and is typically * not needed for normal application development. - * + * * @since 7.1 * @param parameter * The parameter name @@ -119,7 +119,7 @@ public interface PushConfiguration extends Serializable { /** * Returns the parameters which have been defined. - * + * * @since 7.1 * @return A collection of parameter names */ @@ -130,7 +130,7 @@ public interface PushConfiguration extends Serializable { *

            * This method provides low level access to push parameters and is typically * not needed for normal application development. - * + * * @since 7.1 * @param parameter * The parameter name @@ -144,7 +144,7 @@ public interface PushConfiguration extends Serializable { *

            * This is only used when overriding the URL to use. Setting this to null * (the default) will use the default URL. - * + * * @since 7.6 * @param pushUrl * The push URL to use @@ -156,7 +156,7 @@ public interface PushConfiguration extends Serializable { *

            * This is only used when overriding the URL to use. Returns null (the * default) when the default URL is used. - * + * * @since 7.6 * @return the URL to use for push requests, or null to use to default */ @@ -173,7 +173,7 @@ class PushConfigurationImpl implements PushConfiguration { /* * (non-Javadoc) - * + * * @see com.vaadin.ui.PushConfiguration#getPushMode() */ @Override @@ -183,10 +183,9 @@ class PushConfigurationImpl implements PushConfiguration { /* * (non-Javadoc) - * - * @see - * com.vaadin.ui.PushConfiguration#setPushMode(com.vaadin.shared.communication - * .PushMode) + * + * @see com.vaadin.ui.PushConfiguration#setPushMode(com.vaadin.shared. + * communication .PushMode) */ @Override public void setPushMode(PushMode pushMode) { @@ -203,7 +202,8 @@ class PushConfigurationImpl implements PushConfiguration { assert session.hasLock(); - if (pushMode.isEnabled() && !session.getService().ensurePushAvailable()) { + if (pushMode.isEnabled() + && !session.getService().ensurePushAvailable()) { throw new IllegalStateException( "Push is not available. See previous log messages for more information."); } @@ -234,14 +234,14 @@ class PushConfigurationImpl implements PushConfiguration { /* * (non-Javadoc) - * + * * @see com.vaadin.ui.PushConfiguration#getTransport() */ @Override public Transport getTransport() { try { - Transport tr = Transport - .getByIdentifier(getParameter(PushConfigurationState.TRANSPORT_PARAM)); + Transport tr = Transport.getByIdentifier( + getParameter(PushConfigurationState.TRANSPORT_PARAM)); if (tr == Transport.WEBSOCKET && getState(false).alwaysUseXhrForServerRequests) { return Transport.WEBSOCKET_XHR; @@ -255,7 +255,7 @@ class PushConfigurationImpl implements PushConfiguration { /* * (non-Javadoc) - * + * * @see * com.vaadin.ui.PushConfiguration#setTransport(com.vaadin.shared.ui.ui. * Transport) @@ -276,14 +276,14 @@ class PushConfigurationImpl implements PushConfiguration { /* * (non-Javadoc) - * + * * @see com.vaadin.ui.PushConfiguration#getFallbackTransport() */ @Override public Transport getFallbackTransport() { try { - return Transport - .valueOf(getParameter(PushConfigurationState.FALLBACK_TRANSPORT_PARAM)); + return Transport.valueOf(getParameter( + PushConfigurationState.FALLBACK_TRANSPORT_PARAM)); } catch (IllegalArgumentException e) { return null; } @@ -291,7 +291,7 @@ class PushConfigurationImpl implements PushConfiguration { /* * (non-Javadoc) - * + * * @see * com.vaadin.ui.PushConfiguration#setFallbackTransport(com.vaadin.shared * .ui.ui.Transport) @@ -308,7 +308,7 @@ class PushConfigurationImpl implements PushConfiguration { /* * (non-Javadoc) - * + * * @see com.vaadin.ui.PushConfiguration#getParameter(java.lang.String) */ @Override @@ -318,7 +318,7 @@ class PushConfigurationImpl implements PushConfiguration { /* * (non-Javadoc) - * + * * @see com.vaadin.ui.PushConfiguration#setParameter(java.lang.String, * java.lang.String) */ @@ -338,8 +338,8 @@ class PushConfigurationImpl implements PushConfiguration { @Override public Collection getParameterNames() { - return Collections.unmodifiableCollection(getState(false).parameters - .keySet()); + return Collections + .unmodifiableCollection(getState(false).parameters.keySet()); } } diff --git a/server/src/main/java/com/vaadin/ui/ReconnectDialogConfiguration.java b/server/src/main/java/com/vaadin/ui/ReconnectDialogConfiguration.java index 92eb1e785f..da5fa80f04 100644 --- a/server/src/main/java/com/vaadin/ui/ReconnectDialogConfiguration.java +++ b/server/src/main/java/com/vaadin/ui/ReconnectDialogConfiguration.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,7 +20,7 @@ import java.io.Serializable; /** * Provides method for configuring the reconnect dialog. - * + * * @since 7.6 * @author Vaadin Ltd */ @@ -28,7 +28,7 @@ public interface ReconnectDialogConfiguration extends Serializable { /** * Gets the text to show in the reconnect dialog when trying to re-establish * the server connection - * + * * @return the text to show in the reconnect dialog */ public String getDialogText(); @@ -36,7 +36,7 @@ public interface ReconnectDialogConfiguration extends Serializable { /** * Sets the text to show in the reconnect dialog when trying to re-establish * the server connection - * + * * @param dialogText * the text to show in the reconnect dialog */ @@ -45,7 +45,7 @@ public interface ReconnectDialogConfiguration extends Serializable { /** * Gets the text to show in the reconnect dialog after giving up trying to * reconnect ({@link #getReconnectAttempts()} reached) - * + * * @return the text to show in the reconnect dialog after giving up */ public String getDialogTextGaveUp(); @@ -53,7 +53,7 @@ public interface ReconnectDialogConfiguration extends Serializable { /** * Sets the text to show in the reconnect dialog after giving up trying to * reconnect ({@link #getReconnectAttempts()} reached) - * + * * @param dialogText * the text to show in the reconnect dialog after giving up */ @@ -62,7 +62,7 @@ public interface ReconnectDialogConfiguration extends Serializable { /** * Gets the number of times to try to reconnect to the server before giving * up - * + * * @return the number of times to try to reconnect */ public int getReconnectAttempts(); @@ -70,7 +70,7 @@ public interface ReconnectDialogConfiguration extends Serializable { /** * Sets the number of times to try to reconnect to the server before giving * up - * + * * @param reconnectAttempts * the number of times to try to reconnect */ @@ -78,14 +78,14 @@ public interface ReconnectDialogConfiguration extends Serializable { /** * Gets the interval (in milliseconds) between reconnect attempts - * + * * @return the interval (in ms) between reconnect attempts */ public int getReconnectInterval(); /** * Sets the interval (in milliseconds) between reconnect attempts - * + * * @param reconnectInterval * the interval (in ms) between reconnect attempts */ @@ -94,7 +94,7 @@ public interface ReconnectDialogConfiguration extends Serializable { /** * Gets the timeout (in milliseconds) between noticing a loss of connection * and showing the dialog. - * + * * @return the time to wait before showing a dialog */ public int getDialogGracePeriod(); @@ -102,7 +102,7 @@ public interface ReconnectDialogConfiguration extends Serializable { /** * Sets the timeout (in milliseconds) between noticing a loss of connection * and showing the dialog. - * + * * @param dialogGracePeriod * the time to wait before showing a dialog */ @@ -115,7 +115,7 @@ public interface ReconnectDialogConfiguration extends Serializable { * application while the dialog is being shown. If not modal, the user can * continue to use the application as normally and all server events will be * queued until connection has been re-established. - * + * * @param dialogModal * true to make the dialog modal, false otherwise */ @@ -160,7 +160,8 @@ class ReconnectDialogConfigurationImpl implements ReconnectDialogConfiguration { @Override public int getReconnectAttempts() { - return ui.getState(false).reconnectDialogConfiguration.reconnectAttempts; + return ui + .getState(false).reconnectDialogConfiguration.reconnectAttempts; } @Override @@ -170,7 +171,8 @@ class ReconnectDialogConfigurationImpl implements ReconnectDialogConfiguration { @Override public int getReconnectInterval() { - return ui.getState(false).reconnectDialogConfiguration.reconnectInterval; + return ui + .getState(false).reconnectDialogConfiguration.reconnectInterval; } @Override @@ -180,7 +182,8 @@ class ReconnectDialogConfigurationImpl implements ReconnectDialogConfiguration { @Override public int getDialogGracePeriod() { - return ui.getState(false).reconnectDialogConfiguration.dialogGracePeriod; + return ui + .getState(false).reconnectDialogConfiguration.dialogGracePeriod; } @Override diff --git a/server/src/main/java/com/vaadin/ui/RichTextArea.java b/server/src/main/java/com/vaadin/ui/RichTextArea.java index 2f0ba215b9..fb66685e16 100644 --- a/server/src/main/java/com/vaadin/ui/RichTextArea.java +++ b/server/src/main/java/com/vaadin/ui/RichTextArea.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -28,13 +28,13 @@ import com.vaadin.ui.declarative.DesignContext; /** * A simple RichTextArea to edit HTML format text. - * + * * Note, that using {@link TextField#setMaxLength(int)} method in * {@link RichTextArea} may produce unexpected results as formatting is counted * into length of field. */ -public class RichTextArea extends AbstractField implements - LegacyComponent { +public class RichTextArea extends AbstractField + implements LegacyComponent { /** * Null representation. @@ -61,9 +61,9 @@ public class RichTextArea extends AbstractField implements } /** - * + * * Constructs an empty RichTextArea with the given caption. - * + * * @param caption * the caption for the editor. */ @@ -75,7 +75,7 @@ public class RichTextArea extends AbstractField implements /** * Constructs a new RichTextArea that's bound to the specified * Property and has no caption. - * + * * @param dataSource * the data source for the editor value */ @@ -86,7 +86,7 @@ public class RichTextArea extends AbstractField implements /** * Constructs a new RichTextArea that's bound to the specified * Property and has the given caption. - * + * * @param caption * the caption for the editor. * @param dataSource @@ -100,7 +100,7 @@ public class RichTextArea extends AbstractField implements /** * Constructs a new RichTextArea with the given caption and * initial text contents. - * + * * @param caption * the caption for the editor. * @param value @@ -146,7 +146,7 @@ public class RichTextArea extends AbstractField implements /** * Selects all text in the rich text area. As a side effect, focuses the * rich text area. - * + * * @since 6.5 */ public void selectAll() { @@ -173,8 +173,7 @@ public class RichTextArea extends AbstractField implements String newValue = (String) variables.get("text"); final String oldValue = getValue(); - if (newValue != null - && (oldValue == null || isNullSettingAllowed()) + if (newValue != null && (oldValue == null || isNullSettingAllowed()) && newValue.equals(getNullRepresentation())) { newValue = null; } @@ -200,17 +199,17 @@ public class RichTextArea extends AbstractField implements /** * Gets the null-string representation. - * + * *

            * The null-valued strings are represented on the user interface by * replacing the null value with this string. If the null representation is * set null (not 'null' string), painting null value throws exception. *

            - * + * *

            * The default value is string 'null'. *

            - * + * * @return the String Textual representation for null strings. * @see TextField#isNullSettingAllowed() */ @@ -220,7 +219,7 @@ public class RichTextArea extends AbstractField implements /** * Is setting nulls with null-string representation allowed. - * + * *

            * If this property is true, writing null-representation string to text * field always sets the field value to real null. If this property is @@ -229,11 +228,11 @@ public class RichTextArea extends AbstractField implements * contents to real null, if the text field matches the null-string * representation and the current value of the field is null. *

            - * + * *

            * By default this setting is false *

            - * + * * @return boolean Should the null-string represenation be always converted * to null-values. * @see TextField#getNullRepresentation() @@ -244,17 +243,17 @@ public class RichTextArea extends AbstractField implements /** * Sets the null-string representation. - * + * *

            * The null-valued strings are represented on the user interface by * replacing the null value with this string. If the null representation is * set null (not 'null' string), painting null value throws exception. *

            - * + * *

            * The default value is string 'null' *

            - * + * * @param nullRepresentation * Textual representation for null strings. * @see TextField#setNullSettingAllowed(boolean) @@ -265,7 +264,7 @@ public class RichTextArea extends AbstractField implements /** * Sets the null conversion mode. - * + * *

            * If this property is true, writing null-representation string to text * field always sets the field value to real null. If this property is @@ -274,11 +273,11 @@ public class RichTextArea extends AbstractField implements * contents to real null, if the text field matches the null-string * representation and the current value of the field is null. *

            - * + * *

            * By default this setting is false. *

            - * + * * @param nullSettingAllowed * Should the null-string represenation be always converted to * null-values. diff --git a/server/src/main/java/com/vaadin/ui/Select.java b/server/src/main/java/com/vaadin/ui/Select.java index e63cba3eaa..21313e6e55 100644 --- a/server/src/main/java/com/vaadin/ui/Select.java +++ b/server/src/main/java/com/vaadin/ui/Select.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -26,13 +26,13 @@ import com.vaadin.data.Container; * set of choices is presented as a set of {@link com.vaadin.data.Item}s in a * {@link com.vaadin.data.Container}. *

            - * + * *

            * A Select component may be in single- or multiselect mode. * Multiselect mode means that more than one item can be selected * simultaneously. *

            - * + * * @author Vaadin Ltd. * @since 3.0 * @deprecated As of 7.0. Use {@link ComboBox} instead. diff --git a/server/src/main/java/com/vaadin/ui/SelectiveRenderer.java b/server/src/main/java/com/vaadin/ui/SelectiveRenderer.java index 5c4d052a53..663e3faaba 100644 --- a/server/src/main/java/com/vaadin/ui/SelectiveRenderer.java +++ b/server/src/main/java/com/vaadin/ui/SelectiveRenderer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -19,11 +19,11 @@ package com.vaadin.ui; * Interface implemented by {@link HasComponents} implementors that wish to * dynamically be able to prevent given child components from reaching the * client side. - * + * * @author Vaadin Ltd * @version @VERSION@ * @since 7.0 - * + * */ public interface SelectiveRenderer extends HasComponents { /** @@ -39,7 +39,7 @@ public interface SelectiveRenderer extends HasComponents { * returning false will prevent the child from being sent to the client. If * a child is set to invisible, this method has no effect. *

            - * + * * @param childComponent * The child component to check * @return true if the child component may be sent to the client, false diff --git a/server/src/main/java/com/vaadin/ui/SingleComponentContainer.java b/server/src/main/java/com/vaadin/ui/SingleComponentContainer.java index 9feee84f15..c9379f85b4 100644 --- a/server/src/main/java/com/vaadin/ui/SingleComponentContainer.java +++ b/server/src/main/java/com/vaadin/ui/SingleComponentContainer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,20 +21,20 @@ import com.vaadin.ui.HasComponents.ComponentAttachDetachNotifier; /** * Interface for component containers that have one child component and do not * support adding or removing components. - * + * * For component containers that support multiple children, see * {@link ComponentContainer} instead. - * + * * @since 7.0 */ -public interface SingleComponentContainer extends HasComponents, - ComponentAttachDetachNotifier { +public interface SingleComponentContainer + extends HasComponents, ComponentAttachDetachNotifier { /** * Gets the number of children this {@link SingleComponentContainer} has. * This must be symmetric with what {@link #iterator()} returns and thus * typically return 1 if the content is set, 0 otherwise. - * + * * @return The number of child components this container has. */ public int getComponentCount(); @@ -42,9 +42,9 @@ public interface SingleComponentContainer extends HasComponents, /** * Gets the content of this container. The content is a component that * serves as the outermost item of the visual contents. - * + * * @return a component to use as content - * + * * @see #setContent(Component) */ public Component getContent(); @@ -52,10 +52,10 @@ public interface SingleComponentContainer extends HasComponents, /** * Sets the content of this container. The content is a component that * serves as the outermost item of the visual contents. - * + * * The content should always be set, either as a constructor parameter or by * calling this method. - * + * * @return a component (typically a layout) to use as content */ public void setContent(Component content); diff --git a/server/src/main/java/com/vaadin/ui/Slider.java b/server/src/main/java/com/vaadin/ui/Slider.java index 1fd6d425fe..af67daa6e7 100644 --- a/server/src/main/java/com/vaadin/ui/Slider.java +++ b/server/src/main/java/com/vaadin/ui/Slider.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -29,7 +29,7 @@ import com.vaadin.ui.declarative.DesignContext; /** * A component for selecting a numerical value within a range. - * + * * @author Vaadin Ltd. */ public class Slider extends AbstractField { @@ -44,11 +44,11 @@ public class Slider extends AbstractField { * to make sure the cached state is updated to match the client. If * we do not do this, a reverting setValue() call in a listener will * not cause the new state to be sent to the client. - * + * * See #12133. */ - getUI().getConnectorTracker().getDiffState(Slider.this) - .put("value", value); + getUI().getConnectorTracker().getDiffState(Slider.this).put("value", + value); try { setValue(value, true); @@ -70,7 +70,7 @@ public class Slider extends AbstractField { /** * Default slider constructor. Sets all values to defaults and the slide * handle at minimum value. - * + * */ public Slider() { super(); @@ -80,10 +80,10 @@ public class Slider extends AbstractField { /** * Create a new slider with the caption given as parameter. - * + * * The range of the slider is set to 0-100 and only integer values are * allowed. - * + * * @param caption * The caption for this slider (e.g. "Volume"). */ @@ -94,7 +94,7 @@ public class Slider extends AbstractField { /** * Create a new slider with the given range and resolution. - * + * * @param min * The minimum value of the slider * @param max @@ -111,7 +111,7 @@ public class Slider extends AbstractField { /** * Create a new slider with the given range that only allows integer values. - * + * * @param min * The minimum value of the slider * @param max @@ -127,7 +127,7 @@ public class Slider extends AbstractField { /** * Create a new slider with the given caption and range that only allows * integer values. - * + * * @param caption * The caption for the slider * @param min @@ -152,7 +152,7 @@ public class Slider extends AbstractField { /** * Gets the maximum slider value - * + * * @return the largest value the slider can have */ public double getMax() { @@ -162,7 +162,7 @@ public class Slider extends AbstractField { /** * Set the maximum slider value. If the current value of the slider is * larger than this, the value is set to the new maximum. - * + * * @param max * The new maximum slider value */ @@ -181,7 +181,7 @@ public class Slider extends AbstractField { /** * Gets the minimum slider value - * + * * @return the smallest value the slider can have */ public double getMin() { @@ -191,7 +191,7 @@ public class Slider extends AbstractField { /** * Set the minimum slider value. If the current value of the slider is * smaller than this, the value is set to the new minimum. - * + * * @param min * The new minimum slider value */ @@ -210,7 +210,7 @@ public class Slider extends AbstractField { /** * Get the current orientation of the slider (horizontal or vertical). - * + * * @return {@link SliderOrientation#HORIZONTAL} or * {@link SliderOrientation#VERTICAL} */ @@ -220,7 +220,7 @@ public class Slider extends AbstractField { /** * Set the orientation of the slider. - * + * * @param orientation * The new orientation, either * {@link SliderOrientation#HORIZONTAL} or @@ -233,7 +233,7 @@ public class Slider extends AbstractField { /** * Get the current resolution of the slider. The resolution is the number of * digits after the decimal point. - * + * * @return resolution */ public int getResolution() { @@ -243,10 +243,10 @@ public class Slider extends AbstractField { /** * Set a new resolution for the slider. The resolution is the number of * digits after the decimal point. - * + * * @throws IllegalArgumentException * if resolution is negative. - * + * * @param resolution */ public void setResolution(int resolution) { @@ -259,7 +259,7 @@ public class Slider extends AbstractField { /** * Sets the value of the slider. - * + * * @param value * The new value of the slider. * @param repaintIsNotNeeded @@ -302,7 +302,7 @@ public class Slider extends AbstractField { * Overridden to keep the shared state in sync with the AbstractField * internal value. Should be removed once AbstractField is refactored to use * shared state. - * + * * See tickets #10921 and #11064. */ @Override @@ -317,9 +317,9 @@ public class Slider extends AbstractField { /** * Thrown when the value of the slider is about to be set to a value that is * outside the valid range of the slider. - * + * * @author Vaadin Ltd. - * + * */ public class ValueOutOfBoundsException extends RuntimeException { @@ -328,7 +328,7 @@ public class Slider extends AbstractField { /** * Constructs an ValueOutOfBoundsException with the * specified detail message. - * + * * @param valueOutOfBounds */ public ValueOutOfBoundsException(Double valueOutOfBounds) { @@ -339,7 +339,7 @@ public class Slider extends AbstractField { /** * Gets the value that is outside the valid range of the slider. - * + * * @return the value that is out of bounds */ public Double getValue() { @@ -371,8 +371,8 @@ public class Slider extends AbstractField { setOrientation(SliderOrientation.VERTICAL); } if (attr.hasKey("value")) { - Double newFieldValue = DesignAttributeHandler.readAttribute( - "value", attr, Double.class); + Double newFieldValue = DesignAttributeHandler.readAttribute("value", + attr, Double.class); setValue(newFieldValue, false, true); } } diff --git a/server/src/main/java/com/vaadin/ui/TabSheet.java b/server/src/main/java/com/vaadin/ui/TabSheet.java index 66784aaa02..ce9214ae40 100644 --- a/server/src/main/java/com/vaadin/ui/TabSheet.java +++ b/server/src/main/java/com/vaadin/ui/TabSheet.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -52,37 +52,37 @@ import com.vaadin.ui.themes.Runo; /** * TabSheet component. - * + * * Tabs are typically identified by the component contained on the tab (see * {@link ComponentContainer}), and tab metadata (including caption, icon, * visibility, enabledness, closability etc.) is kept in separate {@link Tab} * instances. - * + * * Tabs added with {@link #addComponent(Component)} get the caption and the icon * of the component at the time when the component is created, and these are not * automatically updated after tab creation. - * + * * A tab sheet can have multiple tab selection listeners and one tab close * handler ({@link CloseHandler}), which by default removes the tab from the * TabSheet. - * + * * The {@link TabSheet} can be styled with the .v-tabsheet, .v-tabsheet-tabs and * .v-tabsheet-content styles. Themes may also have pre-defined variations of * the tab sheet presentation, such as {@link Reindeer#TABSHEET_BORDERLESS}, * {@link Runo#TABSHEET_SMALL} and several other styles in {@link Reindeer}. - * + * * The current implementation does not load the tabs to the UI before the first * time they are shown, but this may change in future releases. - * + * * @author Vaadin Ltd. * @since 3.0 */ -public class TabSheet extends AbstractComponentContainer implements Focusable, - FocusNotifier, BlurNotifier, SelectiveRenderer { +public class TabSheet extends AbstractComponentContainer + implements Focusable, FocusNotifier, BlurNotifier, SelectiveRenderer { /** * Client to server RPC implementation for TabSheet. - * + * * @since 7.2 */ protected class TabsheetServerRpcImpl implements TabsheetServerRpc { @@ -153,7 +153,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /** * Constructs a new TabSheet containing the given components. - * + * * @param components * The components to add to the tab sheet. Each component will be * added to a separate tab. @@ -166,7 +166,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /** * Gets the component container iterator for going through all the * components (tab contents). - * + * * @return the unmodifiable Iterator of the tab content components */ @@ -178,7 +178,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /** * Gets the number of contained components (tabs). Consistent with the * iterator returned by {@link #getComponentIterator()}. - * + * * @return the number of contained components */ @@ -189,10 +189,10 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /** * Removes a component and its corresponding tab. - * + * * If the tab was selected, the first eligible (visible and enabled) * remaining tab is selected. - * + * * @param component * the component to be removed. */ @@ -216,7 +216,8 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, setSelected(null); } else { - int newSelectedIndex = selectedTabIndexAfterTabRemove(componentIndex); + int newSelectedIndex = selectedTabIndexAfterTabRemove( + componentIndex); // Make sure the component actually exists, in case someone // override it and provide a non existing component. @@ -245,11 +246,11 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, * Called when a selected tab is removed to specify the new tab to select. * Can be overridden to provide another algorithm that calculates the new * selection. - * + * * Current implementation will choose the first enabled tab to the right of * the removed tab if it's not the last one, otherwise will choose the * closer enabled tab to the left. - * + * * @since 7.4 * @param removedTabIndex * the index of the selected tab which was just remove. @@ -284,7 +285,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, * If the tab was selected, the first eligible (visible and enabled) * remaining tab is selected. *

            - * + * * @see #addTab(Component) * @see #addTab(Component, String, Resource) * @see #addComponent(Component) @@ -299,9 +300,9 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /** * Adds a new tab into TabSheet. Component caption and icon are copied to * the tab metadata at creation time. - * + * * @see #addTab(Component) - * + * * @param c * the component to be added. */ @@ -313,13 +314,13 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /** * Adds a new tab into TabSheet. - * + * * The first tab added to a tab sheet is automatically selected and a tab * selection event is fired. - * + * * If the component is already present in the tab sheet, changes its caption * and returns the corresponding (old) tab, preserving other tab metadata. - * + * * @param c * the component to be added onto tab - should not be null. * @param caption @@ -333,14 +334,14 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /** * Adds a new tab into TabSheet. - * + * * The first tab added to a tab sheet is automatically selected and a tab * selection event is fired. - * + * * If the component is already present in the tab sheet, changes its caption * and icon and returns the corresponding (old) tab, preserving other tab * metadata. - * + * * @param c * the component to be added onto tab - should not be null. * @param caption @@ -357,14 +358,14 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /** * Adds a new tab into TabSheet. - * + * * The first tab added to a tab sheet is automatically selected and a tab * selection event is fired. - * + * * If the component is already present in the tab sheet, changes its caption * and icon and returns the corresponding (old) tab, preserving other tab * metadata like the position. - * + * * @param tabComponent * the component to be added onto tab - should not be null. * @param caption @@ -409,9 +410,9 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /** * Adds a new tab into TabSheet. Component caption and icon are copied to * the tab metadata at creation time. - * + * * If the tab sheet already contains the component, its tab is returned. - * + * * @param c * the component to be added onto tab - should not be null. * @return the created {@link Tab} @@ -423,9 +424,9 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /** * Adds a new tab into TabSheet. Component caption and icon are copied to * the tab metadata at creation time. - * + * * If the tab sheet already contains the component, its tab is returned. - * + * * @param component * the component to be added onto tab - should not be null. * @param position @@ -446,10 +447,10 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /** * Moves all components from another container to this container. The * components are removed from the other container. - * + * * If the source container is a {@link TabSheet}, component captions and * icons are copied from it. - * + * * @param source * the container components are removed from. */ @@ -476,7 +477,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /** * Are the tab selection parts ("tabs") hidden. - * + * * @return true if the tabs are hidden in the UI * @deprecated as of 7.5, use {@link #isTabsVisible()} instead */ @@ -487,7 +488,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /** * Hides or shows the tab selection parts ("tabs"). - * + * * @param tabsHidden * true if the tabs should be hidden * @deprecated as of 7.5, use {@link #setTabsVisible(boolean)} instead @@ -499,7 +500,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /** * Sets whether the tab selection part should be shown in the UI - * + * * @since 7.5 * @param tabsVisible * true if the tabs should be shown in the UI, false otherwise @@ -522,7 +523,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /** * Returns the {@link Tab} (metadata) for a component. The {@link Tab} * object can be used for setting caption,icon, etc for the tab. - * + * * @param c * the component * @return The tab instance associated with the given component, or null if @@ -535,7 +536,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /** * Returns the {@link Tab} (metadata) for a component. The {@link Tab} * object can be used for setting caption,icon, etc for the tab. - * + * * @param position * the position of the tab * @return The tab in the given position, or null if the position is out of @@ -552,7 +553,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /** * Sets the selected tab. The tab is identified by the tab content * component. Does nothing if the tabsheet doesn't contain the component. - * + * * @param c */ public void setSelectedTab(Component c) { @@ -568,7 +569,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /** * Sets the selected tab in the TabSheet. Ensures that the selected tab is * repainted if needed. - * + * * @param component * The new selection or null for no selection */ @@ -599,7 +600,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, * Sets the selected tab. The tab is identified by the corresponding * {@link Tab Tab} instance. Does nothing if the tabsheet doesn't contain * the given tab. - * + * * @param tab */ public void setSelectedTab(Tab tab) { @@ -611,7 +612,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /** * Sets the selected tab, identified by its position. Does nothing if the * position is out of bounds. - * + * * @param position */ public void setSelectedTab(int position) { @@ -623,15 +624,16 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, * the previously selected component is not visible and enabled. The first * visible and enabled tab is selected if the current selection is empty or * invalid. - * + * * This method does not fire tab change events, but the caller should do so * if appropriate. - * + * * @return true if selection was changed, false otherwise */ private boolean updateSelection() { Component originalSelection = selected; - for (final Iterator i = getComponentIterator(); i.hasNext();) { + for (final Iterator i = getComponentIterator(); i + .hasNext();) { final Component component = i.next(); Tab tab = tabs.get(component); @@ -668,7 +670,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /** * Gets the selected tab content component. - * + * * @return the selected tab contents */ public Component getSelectedTab() { @@ -691,21 +693,22 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, * change tab contents or to rearrange tabs. The tab position and some * metadata are preserved when moving components within the same * {@link TabSheet}. - * + * * If the oldComponent is not present in the tab sheet, the new one is added * at the end. - * + * * If the oldComponent is already in the tab sheet but the newComponent * isn't, the old tab is replaced with a new one, and the caption and icon * of the old one are copied to the new tab. - * + * * If both old and new components are present, their positions are swapped. - * + * * {@inheritDoc} */ @Override - public void replaceComponent(Component oldComponent, Component newComponent) { + public void replaceComponent(Component oldComponent, + Component newComponent) { boolean selectAfterInserting = false; if (selected == oldComponent) { @@ -720,7 +723,8 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, int newLocation = -1; int location = 0; - for (final Iterator i = components.iterator(); i.hasNext();) { + for (final Iterator i = components.iterator(); i + .hasNext();) { final Component component = i.next(); if (component == oldComponent) { @@ -755,8 +759,10 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, if (selectAfterInserting) { setSelected(newComponent); - //SelectedTabChangeEvent should be fired here as selected Tab is changed. - //Other cases are handled implicitly by removeComponent() and addComponent()addTab() + // SelectedTabChangeEvent should be fired here as selected Tab + // is changed. + // Other cases are handled implicitly by removeComponent() and + // addComponent()addTab() fireSelectedTabChange(); } @@ -790,7 +796,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /** * Selected tab change event. This event is sent when the selected (shown) * tab in the tab sheet is changed. - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -798,7 +804,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /** * New instance of selected tab change event - * + * * @param source * the Source of the event. */ @@ -808,7 +814,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /** * TabSheet where the event occurred. - * + * * @return the Source of the event. */ public TabSheet getTabSheet() { @@ -820,16 +826,16 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, * Selected tab change event listener. The listener is called whenever * another tab is selected, including when adding the first tab to a * tabsheet. - * + * * @author Vaadin Ltd. - * + * * @since 3.0 */ public interface SelectedTabChangeListener extends Serializable { /** * Selected (shown) tab in tab sheet has has been changed. - * + * * @param event * the selected tab change event. */ @@ -838,11 +844,12 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /** * Adds a tab selection listener - * + * * @param listener * the Listener to be added. */ - public void addSelectedTabChangeListener(SelectedTabChangeListener listener) { + public void addSelectedTabChangeListener( + SelectedTabChangeListener listener) { addListener(SelectedTabChangeEvent.class, listener, SELECTED_TAB_CHANGE_METHOD); } @@ -858,7 +865,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /** * Removes a tab selection listener - * + * * @param listener * the Listener to be removed. */ @@ -886,11 +893,11 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /** * Tab meta-data for a component in a {@link TabSheet}. - * + * * The meta-data includes the tab caption, icon, visibility and enabledness, * closability, description (tooltip) and an optional component error shown * in the tab. - * + * * Tabs are identified by the component contained on them in most cases, and * the meta-data can be obtained with {@link TabSheet#getTab(Component)}. */ @@ -898,7 +905,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /** * Returns the visible status for the tab. An invisible tab is not shown * in the tab bar and cannot be selected. - * + * * @return true for visible, false for hidden */ public boolean isVisible(); @@ -907,7 +914,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, * Sets the visible status for the tab. An invisible tab is not shown in * the tab bar and cannot be selected, selection is changed * automatically when there is an attempt to select an invisible tab. - * + * * @param visible * true for visible, false for hidden */ @@ -915,7 +922,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /** * Returns the closability status for the tab. - * + * * @return true if the tab is allowed to be closed by the end user, * false for not allowing closing */ @@ -928,7 +935,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, *

            * Note! Currently only supported by TabSheet, not Accordion. *

            - * + * * @param closable * true if the end user is allowed to close the tab, false * for not allowing to close. Should default to false. @@ -938,7 +945,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /** * Set the component that should automatically focused when the tab is * selected. - * + * * @param component * the component to focus */ @@ -947,7 +954,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /** * Get the component that should be automatically focused when the tab * is selected. - * + * * @return the focusable component */ public Focusable getDefaultFocusComponent(); @@ -955,7 +962,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /** * Returns the enabled status for the tab. A disabled tab is shown as * such in the tab bar and cannot be selected. - * + * * @return true for enabled, false for disabled */ public boolean isEnabled(); @@ -963,7 +970,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /** * Sets the enabled status for the tab. A disabled tab is shown as such * in the tab bar and cannot be selected. - * + * * @param enabled * true for enabled, false for disabled */ @@ -971,7 +978,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /** * Sets the caption for the tab. - * + * * @param caption * the caption to set */ @@ -989,7 +996,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /** * Sets the icon for the tab. - * + * * @param icon * the icon to set */ @@ -997,7 +1004,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /** * Sets the icon and alt text for the tab. - * + * * @param icon * the icon to set */ @@ -1005,16 +1012,16 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /** * Gets the icon alt text for the tab. - * + * * @since 7.2 */ public String getIconAlternateText(); /** * Sets the icon alt text for the tab. - * + * * @since 7.2 - * + * * @param iconAltText * the icon to set */ @@ -1024,7 +1031,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, * Gets the description for the tab. The description can be used to * briefly describe the state of the tab to the user, and is typically * shown as a tooltip when hovering over the tab. - * + * * @return the description for the tab */ public String getDescription(); @@ -1033,7 +1040,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, * Sets the description for the tab. The description can be used to * briefly describe the state of the tab to the user, and is typically * shown as a tooltip when hovering over the tab. - * + * * @param description * the new description string for the tab. */ @@ -1043,9 +1050,9 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, * Sets an error indicator to be shown in the tab. This can be used e.g. * to communicate to the user that there is a problem in the contents of * the tab. - * + * * @see AbstractComponent#setComponentError(ErrorMessage) - * + * * @param componentError * error message or null for none */ @@ -1053,9 +1060,9 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /** * Gets the current error message shown for the tab. - * + * * TODO currently not sent to the client - * + * * @see AbstractComponent#setComponentError(ErrorMessage) */ public ErrorMessage getComponentError(); @@ -1068,7 +1075,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /** * Sets a style name for the tab. The style name will be rendered as a * HTML class name, which can be used in a CSS definition. - * + * *
                      * Tab tab = tabsheet.addTab(tabContent, "Tab text");
                      * tab.setStyleName("mystyle");
            @@ -1080,16 +1087,16 @@ public class TabSheet extends AbstractComponentContainer implements Focusable,
                      * {@code v-tabsheet-tabitemcell-mystyle}" style. You could then style
                      * the component with:
                      * 

            - * + * *
                      * .v-tabsheet-tabitemcell-mystyle {font-style: italic;}
                      * 
            - * + * *

            * This method will trigger a {@link RepaintRequestEvent} on the * TabSheet to which the Tab belongs. *

            - * + * * @param styleName * the new style to be set for tab * @see #getStyleName() @@ -1099,7 +1106,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /** * Gets the user-defined CSS style name of the tab. Built-in style names * defined in Vaadin or GWT are not returned. - * + * * @return the style name or of the tab * @see #setStyleName(String) */ @@ -1109,7 +1116,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, * Adds an unique id for component that is used in the client-side for * testing purposes. Keeping identifiers unique is the responsibility of * the programmer. - * + * * @param id * An alphanumeric id */ @@ -1117,7 +1124,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /** * Gets currently set debug identifier - * + * * @return current id, null if not set */ public String getId(); @@ -1257,8 +1264,8 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, public void setComponentError(ErrorMessage componentError) { this.componentError = componentError; - String formattedHtmlMessage = componentError != null ? componentError - .getFormattedHtmlMessage() : null; + String formattedHtmlMessage = componentError != null + ? componentError.getFormattedHtmlMessage() : null; tabState.componentError = formattedHtmlMessage; markAsDirty(); @@ -1312,17 +1319,17 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /** * CloseHandler is used to process tab closing events. Default behavior is * to remove the tab from the TabSheet. - * + * * @author Jouni Koivuviita / Vaadin Ltd. * @since 6.2.0 - * + * */ public interface CloseHandler extends Serializable { /** * Called when a user has pressed the close icon of a tab in the client * side widget. - * + * * @param tabsheet * the TabSheet to which the tab belongs to * @param tabContent @@ -1336,12 +1343,12 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, * Provide a custom {@link CloseHandler} for this TabSheet if you wish to * perform some additional tasks when a user clicks on a tabs close button, * e.g. show a confirmation dialogue before removing the tab. - * + * * To remove the tab, if you provide your own close handler, you must call * {@link #removeComponent(Component)} yourself. - * + * * The default CloseHandler for TabSheet will only remove the tab. - * + * * @param handler */ public void setCloseHandler(CloseHandler handler) { @@ -1350,7 +1357,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /** * Sets the position of the tab. - * + * * @param tab * The tab * @param position @@ -1367,7 +1374,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /** * Gets the position of the tab - * + * * @param tab * The tab * @return @@ -1459,7 +1466,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /** * Copies properties from one Tab to another. - * + * * @param from * The tab whose data to copy. * @param to @@ -1488,7 +1495,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /* * (non-Javadoc) - * + * * @see com.vaadin.ui.AbstractComponent#readDesign(org.jsoup.nodes .Element, * com.vaadin.ui.declarative.DesignContext) */ @@ -1498,8 +1505,8 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, // create new tabs for (Element tab : design.children()) { if (!tab.tagName().equals("tab")) { - throw new DesignException("Invalid tag name for tabsheet tab " - + tab.tagName()); + throw new DesignException( + "Invalid tag name for tabsheet tab " + tab.tagName()); } readTabFromDesign(tab, designContext); } @@ -1507,9 +1514,9 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /** * Reads the given tab element from design - * + * * @since 7.4 - * + * * @param tabElement * the element to be read * @param designContext @@ -1527,32 +1534,32 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, Component child = designContext.readDesign(content); Tab tab = this.addTab(child); if (attr.hasKey("visible")) { - tab.setVisible(DesignAttributeHandler.readAttribute("visible", - attr, Boolean.class)); + tab.setVisible(DesignAttributeHandler.readAttribute("visible", attr, + Boolean.class)); } if (attr.hasKey("closable")) { tab.setClosable(DesignAttributeHandler.readAttribute("closable", attr, Boolean.class)); } if (attr.hasKey("caption")) { - tab.setCaption(DesignAttributeHandler.readAttribute("caption", - attr, String.class)); + tab.setCaption(DesignAttributeHandler.readAttribute("caption", attr, + String.class)); } if (attr.hasKey("enabled")) { - tab.setEnabled(DesignAttributeHandler.readAttribute("enabled", - attr, Boolean.class)); + tab.setEnabled(DesignAttributeHandler.readAttribute("enabled", attr, + Boolean.class)); } if (attr.hasKey("icon")) { tab.setIcon(DesignAttributeHandler.readAttribute("icon", attr, Resource.class)); } if (attr.hasKey("icon-alt")) { - tab.setIconAlternateText(DesignAttributeHandler.readAttribute( - "icon-alt", attr, String.class)); + tab.setIconAlternateText(DesignAttributeHandler + .readAttribute("icon-alt", attr, String.class)); } if (attr.hasKey("description")) { - tab.setDescription(DesignAttributeHandler.readAttribute( - "description", attr, String.class)); + tab.setDescription(DesignAttributeHandler + .readAttribute("description", attr, String.class)); } if (attr.hasKey("style-name")) { tab.setStyleName(DesignAttributeHandler.readAttribute("style-name", @@ -1573,7 +1580,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /** * Writes the given tab to design - * + * * @since 7.4 * @param design * the design node for tabsheet @@ -1596,8 +1603,8 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, def.isVisible(), Boolean.class); DesignAttributeHandler.writeAttribute("closable", attr, tab.isClosable(), def.isClosable(), Boolean.class); - DesignAttributeHandler.writeAttribute("caption", attr, - tab.getCaption(), def.getCaption(), String.class); + DesignAttributeHandler.writeAttribute("caption", attr, tab.getCaption(), + def.getCaption(), String.class); DesignAttributeHandler.writeAttribute("enabled", attr, tab.isEnabled(), def.isEnabled(), Boolean.class); DesignAttributeHandler.writeAttribute("icon", attr, tab.getIcon(), @@ -1614,14 +1621,14 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, if (getSelectedTab() != null && getSelectedTab().equals(tab.getComponent())) { // use write attribute to get consistent handling for boolean - DesignAttributeHandler.writeAttribute("selected", attr, true, - false, boolean.class); + DesignAttributeHandler.writeAttribute("selected", attr, true, false, + boolean.class); } } /* * (non-Javadoc) - * + * * @see com.vaadin.ui.AbstractComponent#getCustomAttributes() */ @Override @@ -1633,7 +1640,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /* * (non-Javadoc) - * + * * @see com.vaadin.ui.AbstractComponent#writeDesign(org.jsoup.nodes.Element * , com.vaadin.ui.declarative.DesignContext) */ @@ -1661,7 +1668,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, * false, the content is rendered in the browser as plain text. *

            * The default is false, i.e. render tab captions as plain text - * + * * @param tabCaptionsAsHtml * true if the tab captions are rendered as HTML, false if * rendered as plain text @@ -1675,7 +1682,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, * Checks whether HTML is allowed in the tab captions. *

            * The default is false, i.e. render tab captions as plain text - * + * * @return true if the tab captions are rendered as HTML, false if rendered * as plain text * @since 7.4 diff --git a/server/src/main/java/com/vaadin/ui/Table.java b/server/src/main/java/com/vaadin/ui/Table.java index f518f4f161..efc138de08 100644 --- a/server/src/main/java/com/vaadin/ui/Table.java +++ b/server/src/main/java/com/vaadin/ui/Table.java @@ -82,7 +82,7 @@ import com.vaadin.util.ReflectTools; * Table is used for representing data or components in a pageable * and selectable table. *

            - * + * *

            * Scalability of the Table is largely dictated by the container. A table does * not have a limit for the number of items and is just as fast with hundreds of @@ -90,11 +90,11 @@ import com.vaadin.util.ReflectTools; * scrolling however limits the number of rows to around 500000, depending on * the browser and the pixel height of rows. *

            - * + * *

            * Components in a Table will not have their caption nor icon rendered. *

            - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -621,7 +621,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Creates a new empty table with caption. - * + * * @param caption */ public Table(String caption) { @@ -631,7 +631,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Creates a new table with caption and connect it to a Container. - * + * * @param caption * @param dataSource */ @@ -645,11 +645,11 @@ public class Table extends AbstractSelect implements Action.Container, /** * Gets the array of visible column id:s, including generated columns. - * + * *

            * The columns are show in the order of their appearance in this array. *

            - * + * * @return an array of currently visible propertyIds and generated column * ids. */ @@ -662,11 +662,11 @@ public class Table extends AbstractSelect implements Action.Container, /** * Sets the array of visible column property id:s. - * + * *

            * The columns are show in the order of their appearance in this array. *

            - * + * * @param visibleColumns * the Array of shown property id:s. */ @@ -708,7 +708,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Gets the headers of the columns. - * + * *

            * The headers match the property id:s given by the set visible column * headers. The table must be set in either @@ -717,7 +717,7 @@ public class Table extends AbstractSelect implements Action.Container, * headers. In the defaults mode any nulls in the headers array are replaced * with id.toString(). *

            - * + * * @return the Array of column headers. */ public String[] getColumnHeaders() { @@ -735,7 +735,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Sets the headers of the columns. - * + * *

            * The headers match the property id:s given by the set visible column * headers. The table must be set in either @@ -744,7 +744,7 @@ public class Table extends AbstractSelect implements Action.Container, * headers. In the defaults mode any nulls in the headers array are replaced * with id.toString() outputs when rendering. *

            - * + * * @param columnHeaders * the Array of column headers that match the * {@link #getVisibleColumns()} method. @@ -758,8 +758,8 @@ public class Table extends AbstractSelect implements Action.Container, this.columnHeaders.clear(); int i = 0; - for (final Iterator it = visibleColumns.iterator(); it - .hasNext() && i < columnHeaders.length; i++) { + for (final Iterator it = visibleColumns.iterator(); it.hasNext() + && i < columnHeaders.length; i++) { this.columnHeaders.put(it.next(), columnHeaders[i]); } @@ -768,7 +768,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Gets the icons of the columns. - * + * *

            * The icons in headers match the property id:s given by the set visible * column headers. The table must be set in either @@ -776,7 +776,7 @@ public class Table extends AbstractSelect implements Action.Container, * {@link #COLUMN_HEADER_MODE_EXPLICIT_DEFAULTS_ID} mode to show the headers * with icons. *

            - * + * * @return the Array of icons that match the {@link #getVisibleColumns()}. */ public Resource[] getColumnIcons() { @@ -795,7 +795,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Sets the icons of the columns. - * + * *

            * The icons in headers match the property id:s given by the set visible * column headers. The table must be set in either @@ -803,7 +803,7 @@ public class Table extends AbstractSelect implements Action.Container, * {@link #COLUMN_HEADER_MODE_EXPLICIT_DEFAULTS_ID} mode to show the headers * with icons. *

            - * + * * @param columnIcons * the Array of icons that match the {@link #getVisibleColumns()} * . @@ -817,8 +817,8 @@ public class Table extends AbstractSelect implements Action.Container, this.columnIcons.clear(); int i = 0; - for (final Iterator it = visibleColumns.iterator(); it - .hasNext() && i < columnIcons.length; i++) { + for (final Iterator it = visibleColumns.iterator(); it.hasNext() + && i < columnIcons.length; i++) { this.columnIcons.put(it.next(), columnIcons[i]); } @@ -827,7 +827,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Gets the array of column alignments. - * + * *

            * The items in the array must match the properties identified by * {@link #getVisibleColumns()}. The possible values for the alignments @@ -840,7 +840,7 @@ public class Table extends AbstractSelect implements Action.Container, * The alignments default to {@link Align#LEFT}: any null values are * rendered as align lefts. *

            - * + * * @return the Column alignments array. */ public Align[] getColumnAlignments() { @@ -859,7 +859,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Sets the column alignments. - * + * *

            * The amount of items in the array must match the amount of properties * identified by {@link #getVisibleColumns()}. The possible values for the @@ -871,7 +871,7 @@ public class Table extends AbstractSelect implements Action.Container, * * The alignments default to {@link Align#LEFT} *

            - * + * * @param columnAlignments * the Column alignments array. */ @@ -885,8 +885,8 @@ public class Table extends AbstractSelect implements Action.Container, // Resets the alignments final HashMap newCA = new HashMap(); int i = 0; - for (final Iterator it = visibleColumns.iterator(); it - .hasNext() && i < columnAlignments.length; i++) { + for (final Iterator it = visibleColumns.iterator(); it.hasNext() + && i < columnAlignments.length; i++) { newCA.put(it.next(), columnAlignments[i]); } this.columnAlignments = newCA; @@ -900,11 +900,11 @@ public class Table extends AbstractSelect implements Action.Container, * Sets columns width (in pixels). Theme may not necessarily respect very * small or very big values. Setting width to -1 (default) means that theme * will make decision of width. - * + * *

            * Column can either have a fixed width or expand ratio. The latter one set * is used. See @link {@link #setColumnExpandRatio(Object, float)}. - * + * * @param propertyId * columns property id * @param width @@ -938,27 +938,27 @@ public class Table extends AbstractSelect implements Action.Container, * naturally. Excess space is the space that is not used by columns with * explicit width (see {@link #setColumnWidth(Object, int)}) or with natural * width (no width nor expand ratio). - * + * *

            * By default (without expand ratios) the excess space is divided * proportionally to columns natural widths. - * + * *

            * Only expand ratios of visible columns are used in final calculations. - * + * *

            * Column can either have a fixed width or expand ratio. The latter one set * is used. - * + * *

            * A column with expand ratio is considered to be minimum width by default * (if no excess space exists). The minimum width is defined by terminal * implementation. - * + * *

            * If terminal implementation supports re-sizable columns the column becomes * fixed width column if users resizes the column. - * + * * @param propertyId * columns property id * @param expandRatio @@ -987,7 +987,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Gets the column expand ratio for a column. See * {@link #setColumnExpandRatio(Object, float)} - * + * * @param propertyId * columns property id * @return the expandRatio used to divide excess space for this column @@ -1002,7 +1002,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Gets the pixel width of column - * + * * @param propertyId * @return width of column or -1 when value not set */ @@ -1021,11 +1021,11 @@ public class Table extends AbstractSelect implements Action.Container, /** * Gets the page length. - * + * *

            * Setting page length 0 disables paging. *

            - * + * * @return the Length of one page. */ public int getPageLength() { @@ -1034,16 +1034,16 @@ public class Table extends AbstractSelect implements Action.Container, /** * Sets the page length. - * + * *

            * Setting page length 0 disables paging. The page length defaults to 15. *

            - * + * *

            * If Table has height set ({@link #setHeight(float, Unit)} ) the client * side may update the page length automatically the correct value. *

            - * + * * @param pageLength * the length of one page. */ @@ -1057,18 +1057,18 @@ public class Table extends AbstractSelect implements Action.Container, /** * This method adjusts a possible caching mechanism of table implementation. - * + * *

            * Table component may fetch and render some rows outside visible area. With * complex tables (for example containing layouts and components), the * client side may become unresponsive. Setting the value lower, UI will * become more responsive. With higher values scrolling in client will hit * server less frequently. - * + * *

            * The amount of cached rows will be cacheRate multiplied with pageLength ( * {@link #setPageLength(int)} both below and above visible area.. - * + * * @param cacheRate * a value over 0 (fastest rendering time). Higher value will * cache more rows on server (smoother scrolling). Default value @@ -1087,7 +1087,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * @see #setCacheRate(double) - * + * * @return the current cache rate value */ public double getCacheRate() { @@ -1096,7 +1096,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Getter for property currentPageFirstItem. - * + * * @return the Value of property currentPageFirstItem. */ public Object getCurrentPageFirstItemId() { @@ -1124,14 +1124,14 @@ public class Table extends AbstractSelect implements Action.Container, /** * Returns the item ID for the item represented by the index given. Assumes * that the current container implements {@link Container.Indexed}. - * + * * See {@link Container.Indexed#getIdByIndex(int)} for more information * about the exceptions that can be thrown. - * + * * @param index * the index for which the item ID should be fetched * @return the item ID for the given index - * + * * @throws ClassCastException * if container does not implement {@link Container.Indexed} * @throws IndexOutOfBoundsException @@ -1144,7 +1144,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Setter for property currentPageFirstItemId. - * + * * @param currentPageFirstItemId * the New value of property currentPageFirstItemId. */ @@ -1201,7 +1201,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Gets the icon Resource for the specified column. - * + * * @param propertyId * the propertyId identifying the column. * @return the icon for the specified column; null if the column has no icon @@ -1216,7 +1216,7 @@ public class Table extends AbstractSelect implements Action.Container, *

            * Throws IllegalArgumentException if the specified column is not visible. *

            - * + * * @param propertyId * the propertyId identifying the column. * @param icon @@ -1235,7 +1235,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Gets the header for the specified column. - * + * * @param propertyId * the propertyId identifying the column. * @return the header for the specified column if it has one. @@ -1246,7 +1246,8 @@ public class Table extends AbstractSelect implements Action.Container, } String header = columnHeaders.get(propertyId); - if ((header == null && getColumnHeaderMode() == ColumnHeaderMode.EXPLICIT_DEFAULTS_ID) + if ((header == null + && getColumnHeaderMode() == ColumnHeaderMode.EXPLICIT_DEFAULTS_ID) || getColumnHeaderMode() == ColumnHeaderMode.ID) { header = propertyId.toString(); } @@ -1256,7 +1257,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Sets the column header for the specified column; - * + * * @param propertyId * the propertyId identifying the column. * @param header @@ -1275,7 +1276,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Gets the specified column's alignment. - * + * * @param propertyId * the propertyID identifying the column. * @return the specified column's alignment if it as one; {@link Align#LEFT} @@ -1288,13 +1289,13 @@ public class Table extends AbstractSelect implements Action.Container, /** * Sets the specified column's alignment. - * + * *

            * Throws IllegalArgumentException if the alignment is not one of the * following: {@link Align#LEFT}, {@link Align#CENTER} or * {@link Align#RIGHT} *

            - * + * * @param propertyId * the propertyID identifying the column. * @param alignment @@ -1314,7 +1315,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Checks if the specified column is collapsed. - * + * * @param propertyId * the propertyID identifying the column. * @return true if the column is collapsed; false otherwise; @@ -1326,8 +1327,8 @@ public class Table extends AbstractSelect implements Action.Container, /** * Sets whether the specified column is collapsed or not. - * - * + * + * * @param propertyId * the propertyID identifying the column. * @param collapsed @@ -1367,7 +1368,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Checks if column collapsing is allowed. - * + * * @return true if columns can be collapsed; false otherwise. */ public boolean isColumnCollapsingAllowed() { @@ -1376,7 +1377,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Sets whether column collapsing is allowed or not. - * + * * @param collapsingAllowed * specifies whether column collapsing is allowed. */ @@ -1398,7 +1399,7 @@ public class Table extends AbstractSelect implements Action.Container, * {@link #setColumnCollapsed(Object, boolean) setColumnCollapsed()}) if * {@link #isColumnCollapsingAllowed()} is true. By default all columns are * collapsible. - * + * * @param propertyId * the propertyID identifying the column. * @param collapsible @@ -1420,7 +1421,7 @@ public class Table extends AbstractSelect implements Action.Container, * UI or with {@link #setColumnCollapsed(Object, boolean) * setColumnCollapsed()}) if {@link #isColumnCollapsingAllowed()} is also * true. - * + * * @return true if the column can be collapsed; false otherwise. */ public boolean isColumnCollapsible(Object propertyId) { @@ -1429,7 +1430,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Checks if column reordering is allowed. - * + * * @return true if columns can be reordered; false otherwise. */ public boolean isColumnReorderingAllowed() { @@ -1438,7 +1439,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Sets whether column reordering is allowed or not. - * + * * @param columnReorderingAllowed * specifies whether column reordering is allowed. */ @@ -1482,14 +1483,15 @@ public class Table extends AbstractSelect implements Action.Container, /** * Getter for property currentPageFirstItem. - * + * * @return the Value of property currentPageFirstItem. */ public int getCurrentPageFirstItemIndex() { return currentPageFirstItemIndex; } - void setCurrentPageFirstItemIndex(int newIndex, boolean needsPageBufferReset) { + void setCurrentPageFirstItemIndex(int newIndex, + boolean needsPageBufferReset) { if (newIndex < 0) { newIndex = 0; @@ -1614,7 +1616,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Setter for property currentPageFirstItem. - * + * * @param newIndex * the New value of property currentPageFirstItem. */ @@ -1624,12 +1626,12 @@ public class Table extends AbstractSelect implements Action.Container, /** * Returns whether table is selectable. - * + * *

            * The table is not selectable until it's explicitly set as selectable or at * least one {@link ValueChangeListener} is added. *

            - * + * * @return whether table is selectable. */ public boolean isSelectable() { @@ -1641,13 +1643,13 @@ public class Table extends AbstractSelect implements Action.Container, /** * Setter for property selectable. - * + * *

            * The table is not selectable until it's explicitly set as selectable via * this method or alternatively at least one {@link ValueChangeListener} is * added. *

            - * + * * @param selectable * the New value of property selectable. */ @@ -1660,7 +1662,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Getter for property columnHeaderMode. - * + * * @return the Value of property columnHeaderMode. */ public ColumnHeaderMode getColumnHeaderMode() { @@ -1669,7 +1671,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Setter for property columnHeaderMode. - * + * * @param columnHeaderMode * the New value of property columnHeaderMode. */ @@ -1703,8 +1705,8 @@ public class Table extends AbstractSelect implements Action.Container, final int pagelen = getPageLength(); int rows, totalRows; rows = totalRows = size(); - int firstIndex = Math - .min(getCurrentPageFirstItemIndex(), totalRows - 1); + int firstIndex = Math.min(getCurrentPageFirstItemIndex(), + totalRows - 1); if (rows > 0 && firstIndex >= 0) { rows -= firstIndex; } @@ -1778,7 +1780,7 @@ public class Table extends AbstractSelect implements Action.Container, * occurred exception is set as the cause of this exception. All occurred * exceptions can be accessed using {@link #getCauses()}. *

            - * + * */ public static class CacheUpdateException extends RuntimeException { private Throwable[] causes; @@ -1802,7 +1804,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Returns the cause(s) for this exception - * + * * @return the exception(s) which caused this exception */ public Throwable[] getCauses() { @@ -1845,7 +1847,8 @@ public class Table extends AbstractSelect implements Action.Container, firstCacheRowToRemoveInPageBuffer = maxPageBufferIndex + 1; } - if (firstCacheRowToRemoveInPageBuffer - pageBufferFirstIndex < currentlyCachedRowCount) { + if (firstCacheRowToRemoveInPageBuffer + - pageBufferFirstIndex < currentlyCachedRowCount) { /* * Unregister all components that fall beyond the cache limits after * inserting the new rows. @@ -1858,11 +1861,11 @@ public class Table extends AbstractSelect implements Action.Container, /** * Requests that the Table should be repainted as soon as possible. - * + * * Note that a {@code Table} does not necessarily repaint its contents when * this method has been called. See {@link #refreshRowCache()} for forcing * an update of the contents. - * + * * @deprecated As of 7.0, use {@link #markAsDirty()} instead */ @@ -1874,7 +1877,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Requests that the Table should be repainted as soon as possible. - * + * * Note that a {@code Table} does not necessarily repaint its contents when * this method has been called. See {@link #refreshRowCache()} for forcing * an update of the contents. @@ -1973,7 +1976,8 @@ public class Table extends AbstractSelect implements Action.Container, pageBuffer = newPageBuffer; } - private Object[][] getVisibleCellsUpdateCacheRows(int firstIndex, int rows) { + private Object[][] getVisibleCellsUpdateCacheRows(int firstIndex, + int rows) { Object[][] cells = getVisibleCellsNoCache(firstIndex, rows, false); int cacheIx = firstIndex - pageBufferFirstIndex; // update the new rows in the cache. @@ -1996,11 +2000,11 @@ public class Table extends AbstractSelect implements Action.Container, * too small. * @return */ - private Object[][] getVisibleCellsInsertIntoCache(int firstIndex, int rows) { - getLogger() - .log(Level.FINEST, - "Insert {0} rows at index {1} to existing page buffer requested", - new Object[] { rows, firstIndex }); + private Object[][] getVisibleCellsInsertIntoCache(int firstIndex, + int rows) { + getLogger().log(Level.FINEST, + "Insert {0} rows at index {1} to existing page buffer requested", + new Object[] { rows, firstIndex }); int minPageBufferIndex = getMinPageBufferIndex(); int maxPageBufferIndex = getMaxPageBufferIndex(); @@ -2050,9 +2054,9 @@ public class Table extends AbstractSelect implements Action.Container, * IF there is space remaining in the buffer after the rows have been * inserted, we can keep more rows. */ - int numberOfOldRowsAfterInsertedRows = Math.min(pageBufferFirstIndex - + currentlyCachedRowCount + rows, maxPageBufferIndex + 1) - - (firstIndex + rows - 1); + int numberOfOldRowsAfterInsertedRows = Math.min( + pageBufferFirstIndex + currentlyCachedRowCount + rows, + maxPageBufferIndex + 1) - (firstIndex + rows - 1); if (numberOfOldRowsAfterInsertedRows > 0) { firstCacheRowToRemove += numberOfOldRowsAfterInsertedRows; } @@ -2070,11 +2074,12 @@ public class Table extends AbstractSelect implements Action.Container, // Calculate the new cache size int newCachedRowCount = maxBufferSize; - if (pageBufferFirstIndex + currentlyCachedRowCount + rows - 1 < maxPageBufferIndex) { + if (pageBufferFirstIndex + currentlyCachedRowCount + rows + - 1 < maxPageBufferIndex) { // there aren't enough rows to fill the whole potential -> use what // there is - newCachedRowCount -= maxPageBufferIndex - - (pageBufferFirstIndex + currentlyCachedRowCount + rows - 1); + newCachedRowCount -= maxPageBufferIndex - (pageBufferFirstIndex + + currentlyCachedRowCount + rows - 1); } else if (minPageBufferIndex < pageBufferFirstIndex) { newCachedRowCount -= pageBufferFirstIndex - minPageBufferIndex; } @@ -2104,23 +2109,21 @@ public class Table extends AbstractSelect implements Action.Container, newPageBuffer[i][row] = cells[i][row - firstIndexInNewPageBuffer]; } - for (int row = firstIndexInNewPageBuffer + rows; row < newCachedRowCount; row++) { + for (int row = firstIndexInNewPageBuffer + + rows; row < newCachedRowCount; row++) { // Move the old rows down below the newly inserted rows newPageBuffer[i][row] = pageBuffer[i][rowsFromBeginning + row - rows]; } } pageBuffer = newPageBuffer; - pageBufferFirstIndex = Math.max(pageBufferFirstIndex - + rowsFromBeginning, minPageBufferIndex); + pageBufferFirstIndex = Math.max( + pageBufferFirstIndex + rowsFromBeginning, minPageBufferIndex); if (getLogger().isLoggable(Level.FINEST)) { - getLogger().log( - Level.FINEST, + getLogger().log(Level.FINEST, "Page Buffer now contains {0} rows ({1}-{2})", - new Object[] { - pageBuffer[CELL_ITEMID].length, - pageBufferFirstIndex, - (pageBufferFirstIndex + new Object[] { pageBuffer[CELL_ITEMID].length, + pageBufferFirstIndex, (pageBufferFirstIndex + pageBuffer[CELL_ITEMID].length - 1) }); } return cells; @@ -2163,9 +2166,9 @@ public class Table extends AbstractSelect implements Action.Container, /** * Render rows with index "firstIndex" to "firstIndex+rows-1" to a new * buffer. - * + * * Reuses values from the current page buffer if the rows are found there. - * + * * @param firstIndex * @param rows * @param replaceListeners @@ -2222,7 +2225,8 @@ public class Table extends AbstractSelect implements Action.Container, for (int i = 0; i < rows && i < itemIds.size(); i++) { Object id = itemIds.get(i); if (id == null) { - throw new IllegalStateException("Null itemId returned from container"); + throw new IllegalStateException( + "Null itemId returned from container"); } // Start by parsing the values, id should already be set parseItemIdToCells(cells, id, i, firstIndex, headmode, cols, @@ -2271,13 +2275,13 @@ public class Table extends AbstractSelect implements Action.Container, } protected List getItemIds(int firstIndex, int rows) { - return (List) ((Container.Indexed) items).getItemIds( - firstIndex, rows); + return (List) ((Container.Indexed) items).getItemIds(firstIndex, + rows); } /** * Update a cache array for a row, register any relevant listeners etc. - * + * * This is an internal method extracted from * {@link #getVisibleCellsNoCache(int, int, boolean)} and should be removed * when the Table is rewritten. @@ -2310,8 +2314,8 @@ public class Table extends AbstractSelect implements Action.Container, } } - GeneratedRow generatedRow = rowGenerator != null ? rowGenerator - .generateRow(this, id) : null; + GeneratedRow generatedRow = rowGenerator != null + ? rowGenerator.generateRow(this, id) : null; cells[CELL_GENERATED_ROW][i] = generatedRow; for (int j = 0; j < cols; j++) { @@ -2350,7 +2354,8 @@ public class Table extends AbstractSelect implements Action.Container, if (index < firstIndexNotInCache && index >= pageBufferFirstIndex && pageBuffer[CELL_GENERATED_ROW][indexInOldBuffer] == null - && id.equals(pageBuffer[CELL_ITEMID][indexInOldBuffer])) { + && id.equals( + pageBuffer[CELL_ITEMID][indexInOldBuffer])) { // we already have data in our cache, // recycle it instead of fetching it via // getValue/getPropertyValue @@ -2422,11 +2427,8 @@ public class Table extends AbstractSelect implements Action.Container, } protected void registerComponent(Component component) { - getLogger().log( - Level.FINEST, - "Registered {0}: {1}", - new Object[] { component.getClass().getSimpleName(), - component.getCaption() }); + getLogger().log(Level.FINEST, "Registered {0}: {1}", new Object[] { + component.getClass().getSimpleName(), component.getCaption() }); if (!equals(component.getParent())) { component.setParent(this); } @@ -2456,7 +2458,8 @@ public class Table extends AbstractSelect implements Action.Container, * to page buffer. * @param count */ - private void unregisterComponentsAndPropertiesInRows(int firstIx, int count) { + private void unregisterComponentsAndPropertiesInRows(int firstIx, + int count) { if (getLogger().isLoggable(Level.FINEST)) { getLogger().log(Level.FINEST, "Unregistering components in rows {0}-{1}", @@ -2495,7 +2498,7 @@ public class Table extends AbstractSelect implements Action.Container, * Helper method to remove listeners and maintain correct component * hierarchy. Detaches properties and components if those are no more * rendered in client. - * + * * @param oldListenedProperties * set of properties that where listened in last render * @param oldVisibleComponents @@ -2505,8 +2508,8 @@ public class Table extends AbstractSelect implements Action.Container, HashSet> oldListenedProperties, HashSet oldVisibleComponents) { if (oldVisibleComponents != null) { - for (final Iterator i = oldVisibleComponents.iterator(); i - .hasNext();) { + for (final Iterator i = oldVisibleComponents + .iterator(); i.hasNext();) { Component c = i.next(); if (!visibleComponents.contains(c)) { unregisterComponent(c); @@ -2531,21 +2534,18 @@ public class Table extends AbstractSelect implements Action.Container, * if it is a field, it needs to be detached from its property data source * in order to allow garbage collection to take care of removing the unused * component from memory. - * + * * Override this method and getPropertyValue(Object, Object, Property) with * custom logic if you need to deal with buffered fields. - * + * * @see #getPropertyValue(Object, Object, Property) - * + * * @param component * component that should be unregistered. */ protected void unregisterComponent(Component component) { - getLogger().log( - Level.FINEST, - "Unregistered {0}: {1}", - new Object[] { component.getClass().getSimpleName(), - component.getCaption() }); + getLogger().log(Level.FINEST, "Unregistered {0}: {1}", new Object[] { + component.getClass().getSimpleName(), component.getCaption() }); component.setParent(null); /* * Also remove property data sources to unregister listeners keeping the @@ -2587,7 +2587,7 @@ public class Table extends AbstractSelect implements Action.Container, * * The default value is {@link #ROW_HEADER_MODE_HIDDEN} *

            - * + * * @param mode * the One of the modes listed above. */ @@ -2606,7 +2606,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Gets the row header mode. - * + * * @return the Row header mode. * @see #setRowHeaderMode */ @@ -2617,7 +2617,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Adds the new row to table and fill the visible cells (except generated * columns) with given values. - * + * * @param cells * the Object array that is used for filling the visible cells * new row. The types must be settable to visible column property @@ -2686,7 +2686,7 @@ public class Table extends AbstractSelect implements Action.Container, *

            * Note that calling this method is not cheap so avoid calling it * unnecessarily. - * + * * @since 6.7.2 */ public void refreshRowCache() { @@ -2707,7 +2707,7 @@ public class Table extends AbstractSelect implements Action.Container, * Keeps propertyValueConverters if the corresponding id exists in the new * data source and is of a compatible type. *

            - * + * * @param newDataSource * the new data source. */ @@ -2746,11 +2746,11 @@ public class Table extends AbstractSelect implements Action.Container, * Keeps propertyValueConverters if the corresponding id exists in the new * data source and is of a compatible type. *

            - * + * * @see Table#setContainerDataSource(Container) * @see Table#setVisibleColumns(Object[]) * @see Table#setConverter(Object, Converter) - * + * * @param newDataSource * the new data source. * @param visibleIds @@ -2784,8 +2784,8 @@ public class Table extends AbstractSelect implements Action.Container, } } } - propertyValueConverters.keySet().retainAll( - retainableValueConverters); + propertyValueConverters.keySet() + .retainAll(retainableValueConverters); } // Assures that the data source is ordered by making unordered @@ -2793,8 +2793,8 @@ public class Table extends AbstractSelect implements Action.Container, if (newDataSource instanceof Container.Ordered) { super.setContainerDataSource(newDataSource); } else { - super.setContainerDataSource(new ContainerOrderedWrapper( - newDataSource)); + super.setContainerDataSource( + new ContainerOrderedWrapper(newDataSource)); } // Resets page position @@ -2825,7 +2825,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Checks if class b can be safely assigned to class a. - * + * * @param a * @param b * @return @@ -2839,7 +2839,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Gets items ids from a range of key values - * + * * @param itemId * The start key * @param length @@ -2860,7 +2860,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Handles selection if selection is a multiselection - * + * * @param variables * The variables */ @@ -2939,7 +2939,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Invoked when the value of a variable has changed. - * + * * @see com.vaadin.ui.Select#changeVariables(java.lang.Object, * java.util.Map) */ @@ -3031,9 +3031,7 @@ public class Table extends AbstractSelect implements Action.Container, } } if (getLogger().isLoggable(Level.FINEST)) { - getLogger().log( - Level.FINEST, - "Client wants rows {0}-{1}", + getLogger().log(Level.FINEST, "Client wants rows {0}-{1}", new Object[] { reqFirstRowToPaint, (reqFirstRowToPaint + reqRowsToPaint - 1) }); } @@ -3045,7 +3043,8 @@ public class Table extends AbstractSelect implements Action.Container, boolean doSort = false; if (variables.containsKey("sortcolumn")) { final String colId = (String) variables.get("sortcolumn"); - if (colId != null && !"".equals(colId) && !"null".equals(colId)) { + if (colId != null && !"".equals(colId) + && !"null".equals(colId)) { final Object id = columnIdMap.get(colId); setSortContainerPropertyId(id, false); doSort = true; @@ -3076,8 +3075,8 @@ public class Table extends AbstractSelect implements Action.Container, for (Object id : ids) { idSet.add(columnIdMap.get(id.toString())); } - for (final Iterator it = visibleColumns.iterator(); it - .hasNext();) { + for (final Iterator it = visibleColumns + .iterator(); it.hasNext();) { Object propertyId = it.next(); if (isColumnCollapsed(propertyId)) { if (!idSet.contains(propertyId)) { @@ -3141,7 +3140,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Handles click event - * + * * @param variables */ private void handleClickEvent(Map variables) { @@ -3195,7 +3194,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Handles the column resize event sent by the client. - * + * * @param variables */ private void handleColumnResizeEvent(Map variables) { @@ -3258,7 +3257,7 @@ public class Table extends AbstractSelect implements Action.Container, * Go to mode where content updates are not done. This is due we want to * bypass expensive content for some reason (like when we know we may have * other content changes on their way). - * + * * @return true if content refresh flag was enabled prior this call */ protected boolean disableContentRefreshing() { @@ -3269,7 +3268,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Go to mode where content content refreshing has effect. - * + * * @param refreshContent * true if content refresh needs to be done */ @@ -3293,7 +3292,7 @@ public class Table extends AbstractSelect implements Action.Container, /* * (non-Javadoc) - * + * * @see com.vaadin.ui.AbstractSelect#paintContent(com.vaadin. * terminal.PaintTarget) */ @@ -3365,7 +3364,8 @@ public class Table extends AbstractSelect implements Action.Container, if (keyMapperReset) { keyMapperReset = false; - target.addAttribute(TableConstants.ATTRIBUTE_KEY_MAPPER_RESET, true); + target.addAttribute(TableConstants.ATTRIBUTE_KEY_MAPPER_RESET, + true); } if (dropHandler != null) { @@ -3383,8 +3383,8 @@ public class Table extends AbstractSelect implements Action.Container, return rowCacheInvalidated; } - private void paintPartialRowUpdate(PaintTarget target, Set actionSet) - throws PaintException { + private void paintPartialRowUpdate(PaintTarget target, + Set actionSet) throws PaintException { paintPartialRowUpdates(target, actionSet); paintPartialRowAdditions(target, actionSet); } @@ -3469,7 +3469,7 @@ public class Table extends AbstractSelect implements Action.Container, * Subclass and override this to enable partial row updates and additions, * which bypass the normal caching mechanism. This is useful for e.g. * TreeTable. - * + * * @return true if this update is a partial row update, false if not. For * plain Table it is always false. */ @@ -3481,7 +3481,7 @@ public class Table extends AbstractSelect implements Action.Container, * Subclass and override this to enable partial row additions, bypassing the * normal caching mechanism. This is useful for e.g. TreeTable, where * expanding a node should only fetch and add the items inside of that node. - * + * * @return The index of the first added item. For plain Table it is always * 0. */ @@ -3493,7 +3493,7 @@ public class Table extends AbstractSelect implements Action.Container, * Subclass and override this to enable partial row additions, bypassing the * normal caching mechanism. This is useful for e.g. TreeTable, where * expanding a node should only fetch and add the items inside of that node. - * + * * @return the number of rows to be added, starting at the index returned by * {@link #getFirstAddedItemIndex()}. For plain Table it is always * 0. @@ -3506,11 +3506,11 @@ public class Table extends AbstractSelect implements Action.Container, * Subclass and override this to enable removing of rows, bypassing the * normal caching and lazy loading mechanism. This is useful for e.g. * TreeTable, when you need to hide certain rows as a node is collapsed. - * + * * This should return true if the rows pointed to by * {@link #getFirstAddedItemIndex()} and {@link #getAddedRowCount()} should * be hidden instead of added. - * + * * @return whether the rows to add (see {@link #getFirstAddedItemIndex()} * and {@link #getAddedRowCount()}) should be added or hidden. For * plain Table it is always false. @@ -3524,7 +3524,7 @@ public class Table extends AbstractSelect implements Action.Container, * normal caching and lazy loading mechanism. This is useful for updating * the state of certain rows, e.g. in the TreeTable the collapsed state of a * single node is updated using this mechanism. - * + * * @return the index of the first item to be updated. For plain Table it is * always 0. */ @@ -3537,7 +3537,7 @@ public class Table extends AbstractSelect implements Action.Container, * normal caching and lazy loading mechanism. This is useful for updating * the state of certain rows, e.g. in the TreeTable the collapsed state of a * single node is updated using this mechanism. - * + * * @return the number of rows to update, starting at the index returned by * {@link #getFirstUpdatedItemIndex()}. For plain table it is always * 0. @@ -3560,9 +3560,8 @@ public class Table extends AbstractSelect implements Action.Container, target.addAttribute("cols", getVisibleColumns().length); target.addAttribute("rows", rows); - target.addAttribute("firstrow", - (reqFirstRowToPaint >= 0 ? reqFirstRowToPaint - : firstToBeRenderedInClient)); + target.addAttribute("firstrow", (reqFirstRowToPaint >= 0 + ? reqFirstRowToPaint : firstToBeRenderedInClient)); target.addAttribute("totalrows", total); if (getPageLength() != 0) { target.addAttribute("pagelength", getPageLength()); @@ -3631,8 +3630,8 @@ public class Table extends AbstractSelect implements Action.Container, } } if (!Align.LEFT.equals(getColumnAlignment(colId))) { - target.addAttribute("align", getColumnAlignment(colId) - .toString()); + target.addAttribute("align", + getColumnAlignment(colId).toString()); } paintColumnWidth(target, colId); paintColumnExpandRatio(target, colId); @@ -3826,8 +3825,8 @@ public class Table extends AbstractSelect implements Action.Container, target.addAttribute("multiselectmode", multiSelectMode.ordinal()); } if (isSelectable()) { - target.addAttribute("selectmode", (isMultiSelect() ? "multi" - : "single")); + target.addAttribute("selectmode", + (isMultiSelect() ? "multi" : "single")); } else { target.addAttribute("selectmode", "none"); } @@ -3899,7 +3898,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Checks whether row headers are visible. - * + * * @return {@code false} if row headers are hidden, {@code true} otherwise * @since 7.3.9 */ @@ -3937,20 +3936,21 @@ public class Table extends AbstractSelect implements Action.Container, } } - if ((iscomponent[currentColumn] || iseditable || cells[CELL_GENERATED_ROW][indexInRowbuffer] != null) + if ((iscomponent[currentColumn] || iseditable + || cells[CELL_GENERATED_ROW][indexInRowbuffer] != null) && Component.class.isInstance(cells[CELL_FIRSTCOL + currentColumn][indexInRowbuffer])) { final Component c = (Component) cells[CELL_FIRSTCOL + currentColumn][indexInRowbuffer]; - if (c == null - || !LegacyCommunicationManager - .isComponentVisibleToClient(c)) { + if (c == null || !LegacyCommunicationManager + .isComponentVisibleToClient(c)) { target.addText(""); } else { LegacyPaint.paint(c, target); } } else { - target.addText((String) cells[CELL_FIRSTCOL + currentColumn][indexInRowbuffer]); + target.addText((String) cells[CELL_FIRSTCOL + + currentColumn][indexInRowbuffer]); } paintCellTooltips(target, itemId, columnId); } @@ -4033,7 +4033,8 @@ public class Table extends AbstractSelect implements Action.Container, int indexInRowBuffer) throws PaintException { GeneratedRow generatedRow = (GeneratedRow) cells[CELL_GENERATED_ROW][indexInRowBuffer]; if (generatedRow != null) { - target.addAttribute("gen_html", generatedRow.isHtmlContentAllowed()); + target.addAttribute("gen_html", + generatedRow.isHtmlContentAllowed()); target.addAttribute("gen_span", generatedRow.isSpanColumns()); target.addAttribute("gen_widget", generatedRow.getValue() instanceof Component); @@ -4063,7 +4064,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * A method where extended Table implementations may add their custom * attributes for rows. - * + * * @param target * @param itemId */ @@ -4074,7 +4075,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Gets the cached visible table contents. - * + * * @return the cached visible table contents. */ private Object[][] getVisibleCells() { @@ -4086,11 +4087,11 @@ public class Table extends AbstractSelect implements Action.Container, /** * Gets the value of property. - * + * * By default if the table is editable the fieldFactory is used to create * editors for table cells. Otherwise formatPropertyValue is used to format * the value representation. - * + * * @param rowId * the Id of the row (same as item Id). * @param colId @@ -4103,8 +4104,8 @@ public class Table extends AbstractSelect implements Action.Container, protected Object getPropertyValue(Object rowId, Object colId, Property property) { if (isEditable() && fieldFactory != null) { - final Field f = fieldFactory.createField( - getContainerDataSource(), rowId, colId, this); + final Field f = fieldFactory + .createField(getContainerDataSource(), rowId, colId, this); if (f != null) { // Remember that we have made this association so we can remove // it when the component is removed @@ -4122,7 +4123,7 @@ public class Table extends AbstractSelect implements Action.Container, * default behavior is to bind property straight to Field. If * Property.Viewer type property (e.g. PropertyFormatter) is already set for * field, the property is bound to that Property.Viewer. - * + * * @param rowId * @param colId * @param property @@ -4147,7 +4148,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Formats table cell property values. By default the property.toString() * and return a empty string for null properties. - * + * * @param rowId * the Id of the row (same as item Id). * @param colId @@ -4182,7 +4183,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Registers a new action handler for this container - * + * * @see com.vaadin.event.Action.Container#addActionHandler(Action.Handler) */ @@ -4210,7 +4211,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Removes a previously registered action handler for the contents of this * container. - * + * * @see com.vaadin.event.Action.Container#removeActionHandler(Action.Handler) */ @@ -4249,9 +4250,9 @@ public class Table extends AbstractSelect implements Action.Container, /** * Notifies this listener that the Property's value has changed. - * + * * Also listens changes in rendered items to refresh content area. - * + * * @see com.vaadin.data.Property.ValueChangeListener#valueChange(Property.ValueChangeEvent) */ @@ -4282,7 +4283,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Notifies the component that it is connected to an application. - * + * * @see com.vaadin.ui.Component#attach() */ @@ -4295,7 +4296,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Notifies the component that it is detached from the application - * + * * @see com.vaadin.ui.Component#detach() */ @@ -4306,7 +4307,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Removes all Items from the Container. - * + * * @see com.vaadin.data.Container#removeAllItems() */ @@ -4319,7 +4320,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Removes the Item identified by ItemId from the Container. - * + * * @see com.vaadin.data.Container#removeItem(Object) */ @@ -4327,7 +4328,8 @@ public class Table extends AbstractSelect implements Action.Container, public boolean removeItem(Object itemId) { final Object nextItemId = nextItemId(itemId); final boolean ret = super.removeItem(itemId); - if (ret && (itemId != null) && (itemId.equals(currentPageFirstItemId))) { + if (ret && (itemId != null) + && (itemId.equals(currentPageFirstItemId))) { currentPageFirstItemId = nextItemId; } if (!(items instanceof Container.ItemSetChangeNotifier)) { @@ -4338,7 +4340,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Removes a Property specified by the given Property ID from the Container. - * + * * @see com.vaadin.data.Container#removeContainerProperty(Object) */ @@ -4360,7 +4362,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Adds a new property to the table and show it as a visible column. - * + * * @param propertyId * the Id of the property. * @param type @@ -4395,7 +4397,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Adds a new property to the table and show it as a visible column. - * + * * @param propertyId * the Id of the property * @param type @@ -4451,7 +4453,7 @@ public class Table extends AbstractSelect implements Action.Container, * Also note that getVisibleColumns() will return the generated columns, * while getContainerPropertyIds() will not. *

            - * + * * @param id * the id of the column to be added * @param generatedColumn @@ -4480,7 +4482,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Returns the ColumnGenerator used to generate the given column. - * + * * @param columnId * The id of the generated column * @return The ColumnGenerator used for the given columnId or null. @@ -4492,7 +4494,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Removes a generated column previously added with addGeneratedColumn. - * + * * @param columnId * id of the generated column to remove * @return true if the column could be removed (existed in the Table) @@ -4523,7 +4525,7 @@ public class Table extends AbstractSelect implements Action.Container, * architecture. Using {@link #getCurrentPageFirstItemId()} combined with * {@link #getPageLength()} may produce good enough estimates in some * situations. - * + * * @see com.vaadin.ui.Select#getVisibleItemIds() */ @@ -4547,7 +4549,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Container datasource item set change. Table must flush its buffers on * change. - * + * * @see com.vaadin.data.Container.ItemSetChangeListener#containerItemSetChange(com.vaadin.data.Container.ItemSetChangeEvent) */ @@ -4572,7 +4574,7 @@ public class Table extends AbstractSelect implements Action.Container, currentFirstItemIndex = repairOnReAddAllRowsDataScrollPositionItemIndex; /* * Reset repairOnReAddAllRowsDataScrollPositionItemIndex. - * + * * Next string should be commented (removed) if we want to have * possibility to restore scroll position during adding items to * container one by one via add() but not only addAll(). The @@ -4593,7 +4595,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Container datasource property set change. Table must flush its buffers on * change. - * + * * @see com.vaadin.data.Container.PropertySetChangeListener#containerPropertySetChange(com.vaadin.data.Container.PropertySetChangeEvent) */ @@ -4617,8 +4619,8 @@ public class Table extends AbstractSelect implements Action.Container, for (Iterator iterator = newVisibleColumns.iterator(); iterator .hasNext();) { Object id = iterator.next(); - if (!(containerPropertyIds.contains(id) || columnGenerators - .containsKey(id))) { + if (!(containerPropertyIds.contains(id) + || columnGenerators.containsKey(id))) { iterator.remove(); } } @@ -4627,8 +4629,8 @@ public class Table extends AbstractSelect implements Action.Container, for (Iterator iterator = collapsedColumns.iterator(); iterator .hasNext();) { Object id = iterator.next(); - if (!(containerPropertyIds.contains(id) || columnGenerators - .containsKey(id))) { + if (!(containerPropertyIds.contains(id) + || columnGenerators.containsKey(id))) { iterator.remove(); } } @@ -4639,7 +4641,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Adding new items is not supported. - * + * * @throws UnsupportedOperationException * if set to true. * @see com.vaadin.ui.Select#setNewItemsAllowed(boolean) @@ -4655,7 +4657,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Gets the ID of the Item following the Item that corresponds to itemId. - * + * * @see com.vaadin.data.Container.Ordered#nextItemId(java.lang.Object) */ @@ -4667,7 +4669,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Gets the ID of the Item preceding the Item that corresponds to the * itemId. - * + * * @see com.vaadin.data.Container.Ordered#prevItemId(java.lang.Object) */ @@ -4678,7 +4680,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Gets the ID of the first Item in the Container. - * + * * @see com.vaadin.data.Container.Ordered#firstItemId() */ @@ -4689,7 +4691,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Gets the ID of the last Item in the Container. - * + * * @see com.vaadin.data.Container.Ordered#lastItemId() */ @@ -4701,7 +4703,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Tests if the Item corresponding to the given Item ID is the first Item in * the Container. - * + * * @see com.vaadin.data.Container.Ordered#isFirstId(java.lang.Object) */ @@ -4713,7 +4715,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Tests if the Item corresponding to the given Item ID is the last Item in * the Container. - * + * * @see com.vaadin.data.Container.Ordered#isLastId(java.lang.Object) */ @@ -4724,7 +4726,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Adds new item after the given item. - * + * * @see com.vaadin.data.Container.Ordered#addItemAfter(java.lang.Object) */ @@ -4741,7 +4743,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Adds new item after the given item. - * + * * @see com.vaadin.data.Container.Ordered#addItemAfter(java.lang.Object, * java.lang.Object) */ @@ -4759,10 +4761,10 @@ public class Table extends AbstractSelect implements Action.Container, /** * Sets the TableFieldFactory that is used to create editor for table cells. - * + * * The TableFieldFactory is only used if the Table is editable. By default * the DefaultFieldFactory is used. - * + * * @param fieldFactory * the field factory to set. * @see #isEditable @@ -4777,9 +4779,9 @@ public class Table extends AbstractSelect implements Action.Container, /** * Gets the TableFieldFactory that is used to create editor for table cells. - * + * * The FieldFactory is only used if the Table is editable. - * + * * @return TableFieldFactory used to create the Field instances. * @see #isEditable */ @@ -4789,18 +4791,18 @@ public class Table extends AbstractSelect implements Action.Container, /** * Is table editable. - * + * * If table is editable a editor of type Field is created for each table * cell. The assigned FieldFactory is used to create the instances. - * + * * To provide custom editors for table cells create a class implementing the * FieldFactory interface, and assign it to table, and set the editable * property to true. - * + * * @return true if table is editable, false otherwise. * @see Field * @see FieldFactory - * + * */ public boolean isEditable() { return editable; @@ -4808,19 +4810,19 @@ public class Table extends AbstractSelect implements Action.Container, /** * Sets the editable property. - * + * * If table is editable a editor of type Field is created for each table * cell. The assigned FieldFactory is used to create the instances. - * + * * To provide custom editors for table cells create a class implementing the * FieldFactory interface, and assign it to table, and set the editable * property to true. - * + * * @param editable * true if table should be editable by user. * @see Field * @see FieldFactory - * + * */ public void setEditable(boolean editable) { this.editable = editable; @@ -4831,13 +4833,13 @@ public class Table extends AbstractSelect implements Action.Container, /** * Sorts the table. - * + * * @throws UnsupportedOperationException * if the container data source does not implement * Container.Sortable * @see com.vaadin.data.Container.Sortable#sort(java.lang.Object[], * boolean[]) - * + * */ @Override @@ -4869,7 +4871,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Sorts the table by currently selected sorting column. - * + * * @throws UnsupportedOperationException * if the container data source does not implement * Container.Sortable @@ -4889,7 +4891,7 @@ public class Table extends AbstractSelect implements Action.Container, * returns. Disabling sorting causes this method to always return an empty * collection. *

            - * + * * @see com.vaadin.data.Container.Sortable#getSortableContainerPropertyIds() */ @@ -4905,7 +4907,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Gets the currently sorted column property ID. - * + * * @return the Container property id of the currently sorted column. */ public Object getSortContainerPropertyId() { @@ -4914,7 +4916,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Sets the currently sorted column property id. - * + * * @param propertyId * the Container property id of the currently sorted column. */ @@ -4925,13 +4927,13 @@ public class Table extends AbstractSelect implements Action.Container, /** * Internal method to set currently sorted column property id. With doSort * flag actual sorting may be bypassed. - * + * * @param propertyId * @param doSort */ private void setSortContainerPropertyId(Object propertyId, boolean doSort) { - if ((sortContainerPropertyId != null && !sortContainerPropertyId - .equals(propertyId)) + if ((sortContainerPropertyId != null + && !sortContainerPropertyId.equals(propertyId)) || (sortContainerPropertyId == null && propertyId != null)) { sortContainerPropertyId = propertyId; @@ -4946,7 +4948,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Is the table currently sorted in ascending order. - * + * * @return true if ascending, false if descending. */ public boolean isSortAscending() { @@ -4955,7 +4957,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Sets the table in ascending order. - * + * * @param ascending * true if ascending, false if * descending. @@ -4967,7 +4969,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Internal method to set sort ascending. With doSort flag actual sort can * be bypassed. - * + * * @param ascending * @param doSort */ @@ -4985,10 +4987,10 @@ public class Table extends AbstractSelect implements Action.Container, /** * Is sorting disabled altogether. - * + * * True iff no sortable columns are given even in the case where data source * would support this. - * + * * @return True iff sorting is disabled. * @deprecated As of 7.0, use {@link #isSortEnabled()} instead */ @@ -4999,7 +5001,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Checks if sorting is enabled. - * + * * @return true if sorting by the user is allowed, false otherwise */ public boolean isSortEnabled() { @@ -5008,7 +5010,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Disables the sorting by the user altogether. - * + * * @param sortDisabled * True iff sorting is disabled. * @deprecated As of 7.0, use {@link #setSortEnabled(boolean)} instead @@ -5024,7 +5026,7 @@ public class Table extends AbstractSelect implements Action.Container, * Setting this to false disallows sorting by the user. It is still possible * to call {@link #sort()}. *

            - * + * * @param sortEnabled * true to allow the user to sort the table, false to disallow it */ @@ -5039,14 +5041,14 @@ public class Table extends AbstractSelect implements Action.Container, * Used to create "generated columns"; columns that exist only in the Table, * not in the underlying Container. Implement this interface and pass it to * Table.addGeneratedColumn along with an id for the column to be generated. - * + * */ public interface ColumnGenerator extends Serializable { /** * Called by Table when a cell in a generated column needs to be * generated. - * + * * @param source * the source Table * @param itemId @@ -5064,7 +5066,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Set cell style generator for Table. - * + * * @param cellStyleGenerator * New cell style generator or null to remove generator. */ @@ -5078,7 +5080,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Get the current cell style generator. - * + * */ public CellStyleGenerator getCellStyleGenerator() { return cellStyleGenerator; @@ -5095,7 +5097,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Called by Table when a cell (and row) is painted. - * + * * @param source * the source Table * @param itemId @@ -5128,8 +5130,8 @@ public class Table extends AbstractSelect implements Action.Container, @Override public void removeItemClickListener(ItemClickListener listener) { - removeListener(TableConstants.ITEM_CLICK_EVENT_ID, - ItemClickEvent.class, listener); + removeListener(TableConstants.ITEM_CLICK_EVENT_ID, ItemClickEvent.class, + listener); } /** @@ -5158,7 +5160,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Sets the drag start mode of the Table. Drag start mode controls how Table * behaves as a drag source. - * + * * @param newDragMode */ public void setDragMode(TableDragMode newDragMode) { @@ -5177,9 +5179,9 @@ public class Table extends AbstractSelect implements Action.Container, /** * Concrete implementation of {@link DataBoundTransferable} for data * transferred from a table. - * + * * @see {@link DataBoundTransferable}. - * + * * @since 6.3 */ public class TableTransferable extends DataBoundTransferable { @@ -5241,7 +5243,7 @@ public class Table extends AbstractSelect implements Action.Container, * Note, that on some clients the mode may not be respected. E.g. on touch * based devices CTRL/SHIFT base selection method is invalid, so touch based * browsers always use the {@link MultiSelectMode#SIMPLE}. - * + * * @param mode * The select mode of the table */ @@ -5252,7 +5254,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Returns the select mode in which multi-select is used. - * + * * @return The multi select mode */ public MultiSelectMode getMultiSelectMode() { @@ -5264,14 +5266,15 @@ public class Table extends AbstractSelect implements Action.Container, * from server once per drag and drop operation. Developer must override one * method that decides on which rows the currently dragged data can be * dropped. - * + * *

            * Initially pretty much no data is sent to client. On first required * criterion check (per drag request) the client side data structure is * initialized from server and no subsequent requests requests are needed * during that drag and drop operation. */ - public static abstract class TableDropCriterion extends ServerSideCriterion { + public static abstract class TableDropCriterion + extends ServerSideCriterion { private Table table; @@ -5279,7 +5282,7 @@ public class Table extends AbstractSelect implements Action.Container, /* * (non-Javadoc) - * + * * @see * com.vaadin.event.dd.acceptcriteria.ServerSideCriterion#getIdentifier * () @@ -5292,7 +5295,7 @@ public class Table extends AbstractSelect implements Action.Container, /* * (non-Javadoc) - * + * * @see * com.vaadin.event.dd.acceptcriteria.AcceptCriterion#accepts(com.vaadin * .event.dd.DragAndDropEvent) @@ -5312,7 +5315,7 @@ public class Table extends AbstractSelect implements Action.Container, /* * (non-Javadoc) - * + * * @see * com.vaadin.event.dd.acceptcriteria.AcceptCriterion#paintResponse( * com.vaadin.server.PaintTarget) @@ -5381,7 +5384,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Gets the property id of the column which header was pressed - * + * * @return The column property id */ public Object getPropertyId() { @@ -5415,7 +5418,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Constructor - * + * * @param source * The source of the component * @param propertyId @@ -5431,7 +5434,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Gets the property id of the column which header was pressed - * + * * @return The column property id */ public Object getPropertyId() { @@ -5447,7 +5450,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Called when a user clicks a header column cell - * + * * @param event * The event which contains information about the column and * the mouse click event @@ -5463,7 +5466,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Called when a user clicks a footer column cell - * + * * @param event * The event which contains information about the column and * the mouse click event @@ -5478,7 +5481,7 @@ public class Table extends AbstractSelect implements Action.Container, * The listener will receive events which contain information about which * column was clicked and some details about the mouse event. *

            - * + * * @param listener * The handler which should handle the header click events. */ @@ -5499,7 +5502,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Removes a header click listener - * + * * @param listener * The listener to remove. */ @@ -5524,7 +5527,7 @@ public class Table extends AbstractSelect implements Action.Container, * The listener will receive events which contain information about which * column was clicked and some details about the mouse event. *

            - * + * * @param listener * The handler which should handle the footer click events. */ @@ -5545,7 +5548,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Removes a footer click listener - * + * * @param listener * The listener to remove. */ @@ -5565,7 +5568,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Gets the footer caption beneath the rows - * + * * @param propertyId * The propertyId of the column * * @return The caption of the footer or NULL if not set @@ -5577,10 +5580,10 @@ public class Table extends AbstractSelect implements Action.Container, /** * Sets the column footer caption. The column footer caption is the text * displayed beneath the column if footers have been set visible. - * + * * @param propertyId * The properyId of the column - * + * * @param footer * The caption of the footer */ @@ -5600,7 +5603,7 @@ public class Table extends AbstractSelect implements Action.Container, * The footer can be used to add column related data like sums to the bottom * of the Table using setColumnFooter(Object propertyId, String footer). *

            - * + * * @param visible * Should the footer be visible */ @@ -5613,7 +5616,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Is the footer currently visible? - * + * * @return Returns true if visible else false */ public boolean isFooterVisible() { @@ -5645,7 +5648,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Constructor - * + * * @param source * The source of the event * @param propertyId @@ -5665,7 +5668,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Get the column property id of the column that was resized. - * + * * @return The column property id */ public Object getPropertyId() { @@ -5674,7 +5677,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Get the width in pixels of the column before the resize event - * + * * @return Width in pixels */ public int getPreviousWidth() { @@ -5683,7 +5686,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Get the width in pixels of the column after the resize event - * + * * @return Width in pixels */ public int getCurrentWidth() { @@ -5698,7 +5701,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * This method is triggered when the column has been resized - * + * * @param event * The event which contains the column property id, the * previous width of the column and the current width of the @@ -5710,7 +5713,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Adds a column resize listener to the Table. A column resize listener is * called when a user resizes a columns width. - * + * * @param listener * The listener to attach to the Table */ @@ -5731,7 +5734,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Removes a column resize listener from the Table. - * + * * @param listener * The listener to remove */ @@ -5768,7 +5771,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Constructor - * + * * @param source * The source of the event */ @@ -5785,7 +5788,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * This method is triggered when the column has been reordered - * + * * @param event */ public void columnReorder(ColumnReorderEvent event); @@ -5793,7 +5796,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * This event is fired when the collapse state of a column changes. - * + * * @since 7.6 */ public static class ColumnCollapseEvent extends Component.Event { @@ -5805,7 +5808,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Constructor - * + * * @param source * The source of the event * @param propertyId @@ -5818,7 +5821,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Gets the id of the column whose collapse state changed - * + * * @return the property id of the column */ public Object getPropertyId() { @@ -5828,7 +5831,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Interface for listening to column collapse events. - * + * * @since 7.6 */ public interface ColumnCollapseListener extends Serializable { @@ -5836,7 +5839,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * This method is triggered when the collapse state for a column has * changed - * + * * @param event */ public void columnCollapseStateChange(ColumnCollapseEvent event); @@ -5845,7 +5848,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Adds a column reorder listener to the Table. A column reorder listener is * called when a user reorders columns. - * + * * @param listener * The listener to attach to the Table */ @@ -5865,7 +5868,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Removes a column reorder listener from the Table. - * + * * @param listener * The listener to remove */ @@ -5886,15 +5889,16 @@ public class Table extends AbstractSelect implements Action.Container, /** * Adds a column collapse listener to the Table. A column collapse listener * is called when the collapsed state of a column changes. - * + * * @since 7.6 - * + * * @param listener * The listener to attach */ public void addColumnCollapseListener(ColumnCollapseListener listener) { addListener(TableConstants.COLUMN_COLLAPSE_EVENT_ID, - ColumnCollapseEvent.class, listener, ColumnCollapseEvent.METHOD); + ColumnCollapseEvent.class, listener, + ColumnCollapseEvent.METHOD); } /** @@ -5912,11 +5916,12 @@ public class Table extends AbstractSelect implements Action.Container, /** * Set the item description generator which generates tooltips for cells and * rows in the Table - * + * * @param generator * The generator to use or null to disable */ - public void setItemDescriptionGenerator(ItemDescriptionGenerator generator) { + public void setItemDescriptionGenerator( + ItemDescriptionGenerator generator) { if (generator != itemDescriptionGenerator) { itemDescriptionGenerator = generator; // Assures the visual refresh. No need to reset the page buffer @@ -5937,7 +5942,7 @@ public class Table extends AbstractSelect implements Action.Container, * Row generators can be used to replace certain items in a table with a * generated string. The generator is called each time the table is * rendered, which means that new strings can be generated each time. - * + * * Row generators can be used for e.g. summary rows or grouping of items. */ public interface RowGenerator extends Serializable { @@ -5963,7 +5968,7 @@ public class Table extends AbstractSelect implements Action.Container, * For custom styling of a generated row you can combine a RowGenerator * with a CellStyleGenerator. *

            - * + * * @param table * The Table that is being painted * @param itemId @@ -5982,7 +5987,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Creates a new generated row. If only one string is passed in, columns * are automatically spanned. - * + * * @param text */ public GeneratedRow(String... text) { @@ -6017,7 +6022,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * If set to true, all strings passed to {@link #setText(String...)} * will be rendered as HTML. - * + * * @param htmlContentAllowed */ public void setHtmlContentAllowed(boolean htmlContentAllowed) { @@ -6031,7 +6036,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * If set to true, only one string will be rendered, spanning the entire * row. - * + * * @param spanColumns */ public void setSpanColumns(boolean spanColumns) { @@ -6042,7 +6047,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Assigns a row generator to the table. The row generator will be able to * replace rows in the table when it is rendered. - * + * * @param generator * the new row generator */ @@ -6064,23 +6069,24 @@ public class Table extends AbstractSelect implements Action.Container, * The converter is used to format the the data for the given property id * before displaying it in the table. *

            - * + * * @param propertyId * The propertyId to format using the converter * @param converter * The converter to use for the property id */ - public void setConverter(Object propertyId, Converter converter) { + public void setConverter(Object propertyId, + Converter converter) { if (!getContainerPropertyIds().contains(propertyId)) { - throw new IllegalArgumentException("PropertyId " + propertyId - + " must be in the container"); + throw new IllegalArgumentException( + "PropertyId " + propertyId + " must be in the container"); } if (!typeIsCompatible(converter.getModelType(), getType(propertyId))) { - throw new IllegalArgumentException("Property type (" - + getType(propertyId) - + ") must match converter source type (" - + converter.getModelType() + ")"); + throw new IllegalArgumentException( + "Property type (" + getType(propertyId) + + ") must match converter source type (" + + converter.getModelType() + ")"); } propertyValueConverters.put(propertyId, (Converter) converter); @@ -6089,7 +6095,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Checks if there is a converter set explicitly for the given property id. - * + * * @param propertyId * The propertyId to check * @return true if a converter has been set for the property id, false @@ -6101,7 +6107,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Returns the converter used to format the given propertyId. - * + * * @param propertyId * The propertyId to check * @return The converter used to format the propertyId or null if no @@ -6171,10 +6177,8 @@ public class Table extends AbstractSelect implements Action.Container, addContainerProperty(id, String.class, null); if (col.hasAttr("width")) { - setColumnWidth( - id, - DesignAttributeHandler.readAttribute("width", - col.attributes(), Integer.class)); + setColumnWidth(id, DesignAttributeHandler.readAttribute( + "width", col.attributes(), Integer.class)); } if (col.hasAttr("center")) { setColumnAlignment(id, Align.CENTER); @@ -6196,9 +6200,8 @@ public class Table extends AbstractSelect implements Action.Container, col.attributes(), boolean.class)); } if (col.hasAttr("collapsed")) { - setColumnCollapsed(id, - DesignAttributeHandler.readAttribute("collapsed", - col.attributes(), boolean.class)); + setColumnCollapsed(id, DesignAttributeHandler.readAttribute( + "collapsed", col.attributes(), boolean.class)); } } setVisibleColumns(pIds.toArray()); @@ -6240,14 +6243,13 @@ public class Table extends AbstractSelect implements Action.Container, } Iterator propertyIt = propertyIds.iterator(); for (Element e : elems) { - String columnValue = DesignFormatter.decodeFromTextNode(e - .html()); + String columnValue = DesignFormatter + .decodeFromTextNode(e.html()); Object propertyId = propertyIt.next(); if (header) { setColumnHeader(propertyId, columnValue); if (e.hasAttr("icon")) { - setColumnIcon( - propertyId, + setColumnIcon(propertyId, DesignAttributeHandler.readAttribute("icon", e.attributes(), Resource.class)); } @@ -6344,9 +6346,9 @@ public class Table extends AbstractSelect implements Action.Container, col.attributes(), isColumnCollapsible(id), def.isColumnCollapsible(null), boolean.class); - DesignAttributeHandler.writeAttribute("collapsed", - col.attributes(), isColumnCollapsed(id), - def.isColumnCollapsed(null), boolean.class); + DesignAttributeHandler.writeAttribute("collapsed", col.attributes(), + isColumnCollapsed(id), def.isColumnCollapsed(null), + boolean.class); } } @@ -6438,7 +6440,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Returns the item id of context clicked row. - * + * * @return item id of clicked row; null if header, footer * or empty area of Table */ @@ -6448,7 +6450,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Returns the property id of context clicked column. - * + * * @return property id; or null if we've clicked on the * empty area of the Table */ @@ -6458,7 +6460,7 @@ public class Table extends AbstractSelect implements Action.Container, /** * Returns the clicked section of Table. - * + * * @return section of Table */ public Section getSection() { @@ -6506,8 +6508,8 @@ public class Table extends AbstractSelect implements Action.Container, * Sets whether only collapsible columns should be shown to the user in the * column collapse menu. The default is * {@link CollapseMenuContent#ALL_COLUMNS}. - * - * + * + * * @since 7.6 * @param content * the desired collapsible menu content setting @@ -6520,7 +6522,7 @@ public class Table extends AbstractSelect implements Action.Container, * Checks whether only collapsible columns are shown to the user in the * column collapse menu. The default is * {@link CollapseMenuContent#ALL_COLUMNS} . - * + * * @since 7.6 * @return the current collapsible menu content setting */ diff --git a/server/src/main/java/com/vaadin/ui/TableFieldFactory.java b/server/src/main/java/com/vaadin/ui/TableFieldFactory.java index 3c946dcec2..ea7efeef13 100644 --- a/server/src/main/java/com/vaadin/ui/TableFieldFactory.java +++ b/server/src/main/java/com/vaadin/ui/TableFieldFactory.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,9 +25,9 @@ import com.vaadin.data.Container; * for displaying fields). Currently this interface is used by {@link Table}, * but might later be used by some other components for {@link Field} * generation. - * + * *

            - * + * * @author Vaadin Ltd. * @since 6.0 * @see FormFieldFactory @@ -37,7 +37,7 @@ public interface TableFieldFactory extends Serializable { * Creates a field based on the Container, item id, property id and the * component responsible for displaying the field (most commonly * {@link Table}). - * + * * @param container * the Container where the property belongs to. * @param itemId diff --git a/server/src/main/java/com/vaadin/ui/TextArea.java b/server/src/main/java/com/vaadin/ui/TextArea.java index d66fbf0668..35f7c727a3 100644 --- a/server/src/main/java/com/vaadin/ui/TextArea.java +++ b/server/src/main/java/com/vaadin/ui/TextArea.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -37,7 +37,7 @@ public class TextArea extends AbstractTextField { /** * Constructs an empty TextArea with given caption. - * + * * @param caption * the caption for the field. */ @@ -48,7 +48,7 @@ public class TextArea extends AbstractTextField { /** * Constructs a TextArea with given property data source. - * + * * @param dataSource * the data source for the field */ @@ -59,7 +59,7 @@ public class TextArea extends AbstractTextField { /** * Constructs a TextArea with given caption and property data source. - * + * * @param caption * the caption for the field * @param dataSource @@ -72,7 +72,7 @@ public class TextArea extends AbstractTextField { /** * Constructs a TextArea with given caption and value. - * + * * @param caption * the caption for the field * @param value @@ -96,7 +96,7 @@ public class TextArea extends AbstractTextField { /** * Sets the number of rows in the text area. - * + * * @param rows * the number of rows for this text area. */ @@ -109,7 +109,7 @@ public class TextArea extends AbstractTextField { /** * Gets the number of rows in the text area. - * + * * @return number of explicitly set rows. */ public int getRows() { @@ -118,7 +118,7 @@ public class TextArea extends AbstractTextField { /** * Sets the text area's word-wrap mode on or off. - * + * * @param wordwrap * the boolean value specifying if the text area should be in * word-wrap mode. @@ -129,7 +129,7 @@ public class TextArea extends AbstractTextField { /** * Tests if the text area is in word-wrap mode. - * + * * @return true if the component is in word-wrap mode, * false if not. */ @@ -139,7 +139,7 @@ public class TextArea extends AbstractTextField { /* * (non-Javadoc) - * + * * @see com.vaadin.ui.AbstractField#readDesign(org.jsoup.nodes.Element , * com.vaadin.ui.declarative.DesignContext) */ @@ -152,7 +152,7 @@ public class TextArea extends AbstractTextField { /* * (non-Javadoc) - * + * * @see com.vaadin.ui.AbstractTextField#writeDesign(org.jsoup.nodes.Element * , com.vaadin.ui.declarative.DesignContext) */ diff --git a/server/src/main/java/com/vaadin/ui/TextField.java b/server/src/main/java/com/vaadin/ui/TextField.java index 8772f95f3d..00628e0593 100644 --- a/server/src/main/java/com/vaadin/ui/TextField.java +++ b/server/src/main/java/com/vaadin/ui/TextField.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -29,7 +29,7 @@ import com.vaadin.ui.declarative.DesignContext; * editor supports both multiline and single line modes, default is one-line * mode. *

            - * + * *

            * Since TextField extends AbstractField it implements * the {@link com.vaadin.data.Buffered} interface. A TextField is @@ -37,7 +37,7 @@ import com.vaadin.ui.declarative.DesignContext; * {@link com.vaadin.ui.AbstractField#setWriteThrough(boolean)} must be called * to enable buffering. *

            - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -53,7 +53,7 @@ public class TextField extends AbstractTextField { /** * Constructs an empty TextField with given caption. - * + * * @param caption * the caption String for the editor. */ @@ -65,7 +65,7 @@ public class TextField extends AbstractTextField { /** * Constructs a new TextField that's bound to the specified * Property and has no caption. - * + * * @param dataSource * the Property to be edited with this editor. */ @@ -76,7 +76,7 @@ public class TextField extends AbstractTextField { /** * Constructs a new TextField that's bound to the specified * Property and has the given caption String. - * + * * @param caption * the caption String for the editor. * @param dataSource @@ -93,7 +93,7 @@ public class TextField extends AbstractTextField { * to a Property unless * {@link com.vaadin.data.Property.Viewer#setPropertyDataSource(Property)} * is called to bind it. - * + * * @param caption * the caption String for the editor. * @param value @@ -106,7 +106,7 @@ public class TextField extends AbstractTextField { /* * (non-Javadoc) - * + * * @see com.vaadin.ui.AbstractTextField#readDesign(org.jsoup.nodes.Element, * com.vaadin.ui.declarative.DesignContext) */ @@ -115,15 +115,15 @@ public class TextField extends AbstractTextField { super.readDesign(design, designContext); Attributes attr = design.attributes(); if (attr.hasKey("value")) { - String newFieldValue = DesignAttributeHandler.readAttribute( - "value", attr, String.class); + String newFieldValue = DesignAttributeHandler.readAttribute("value", + attr, String.class); setValue(newFieldValue, false, true); } } /* * (non-Javadoc) - * + * * @see com.vaadin.ui.AbstractTextField#writeDesign(org.jsoup.nodes.Element * , com.vaadin.ui.declarative.DesignContext) */ @@ -139,7 +139,7 @@ public class TextField extends AbstractTextField { /* * (non-Javadoc) - * + * * @see com.vaadin.ui.AbstractField#clear() */ @Override diff --git a/server/src/main/java/com/vaadin/ui/TooltipConfiguration.java b/server/src/main/java/com/vaadin/ui/TooltipConfiguration.java index ecb8ac7534..968940f702 100644 --- a/server/src/main/java/com/vaadin/ui/TooltipConfiguration.java +++ b/server/src/main/java/com/vaadin/ui/TooltipConfiguration.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,7 +21,7 @@ import com.vaadin.shared.ui.ui.UIState.TooltipConfigurationState; /** * Provides method for configuring the tooltip. - * + * * @author Vaadin Ltd * @since 7.1 */ @@ -30,7 +30,7 @@ public interface TooltipConfiguration extends Serializable { * Returns the time (in ms) the tooltip should be displayed after an event * that will cause it to be closed (e.g. mouse click outside the component, * key down). - * + * * @return The close timeout */ public int getCloseTimeout(); @@ -39,7 +39,7 @@ public interface TooltipConfiguration extends Serializable { * Sets the time (in ms) the tooltip should be displayed after an event that * will cause it to be closed (e.g. mouse click outside the component, key * down). - * + * * @param closeTimeout * The close timeout */ @@ -50,7 +50,7 @@ public interface TooltipConfiguration extends Serializable { * be used instead of {@link #getOpenDelay()}. The quick open delay is used * when the tooltip has very recently been shown, is currently hidden but * about to be shown again. - * + * * @return The quick open timeout */ public int getQuickOpenTimeout(); @@ -60,7 +60,7 @@ public interface TooltipConfiguration extends Serializable { * should be used instead of {@link #getOpenDelay()}. The quick open delay * is used when the tooltip has very recently been shown, is currently * hidden but about to be shown again. - * + * * @param quickOpenTimeout * The quick open timeout */ @@ -70,7 +70,7 @@ public interface TooltipConfiguration extends Serializable { * Returns the time (in ms) that should elapse before a tooltip will be * shown, in the situation when a tooltip has very recently been shown * (within {@link #getQuickOpenDelay()} ms). - * + * * @return The quick open delay */ public int getQuickOpenDelay(); @@ -79,7 +79,7 @@ public interface TooltipConfiguration extends Serializable { * Sets the time (in ms) that should elapse before a tooltip will be shown, * in the situation when a tooltip has very recently been shown (within * {@link #getQuickOpenDelay()} ms). - * + * * @param quickOpenDelay * The quick open delay */ @@ -90,7 +90,7 @@ public interface TooltipConfiguration extends Serializable { * tooltip showing has occurred (e.g. mouse over) before the tooltip is * shown. If a tooltip has recently been shown, then * {@link #getQuickOpenDelay()} is used instead of this. - * + * * @return The open delay */ public int getOpenDelay(); @@ -100,7 +100,7 @@ public interface TooltipConfiguration extends Serializable { * tooltip showing has occurred (e.g. mouse over) before the tooltip is * shown. If a tooltip has recently been shown, then * {@link #getQuickOpenDelay()} is used instead of this. - * + * * @param openDelay * The open delay */ @@ -108,14 +108,14 @@ public interface TooltipConfiguration extends Serializable { /** * Returns the maximum width of the tooltip popup. - * + * * @return The maximum width the tooltip popup */ public int getMaxWidth(); /** * Sets the maximum width of the tooltip popup. - * + * * @param maxWidth * The maximum width the tooltip popup */ @@ -131,7 +131,7 @@ class TooltipConfigurationImpl implements TooltipConfiguration { /* * (non-Javadoc) - * + * * @see com.vaadin.ui.UI.Tooltip#getCloseTimeout() */ @Override @@ -141,7 +141,7 @@ class TooltipConfigurationImpl implements TooltipConfiguration { /* * (non-Javadoc) - * + * * @see com.vaadin.ui.Tooltip#setCloseTimeout(int) */ @Override @@ -151,7 +151,7 @@ class TooltipConfigurationImpl implements TooltipConfiguration { /* * (non-Javadoc) - * + * * @see com.vaadin.ui.Tooltip#getQuickOpenTimeout() */ @Override @@ -161,7 +161,7 @@ class TooltipConfigurationImpl implements TooltipConfiguration { /* * (non-Javadoc) - * + * * @see com.vaadin.ui.Tooltip#setQuickOpenTimeout(int) */ @Override @@ -171,7 +171,7 @@ class TooltipConfigurationImpl implements TooltipConfiguration { /* * (non-Javadoc) - * + * * @see com.vaadin.ui.Tooltip#getQuickOpenDelay() */ @Override @@ -181,7 +181,7 @@ class TooltipConfigurationImpl implements TooltipConfiguration { /* * (non-Javadoc) - * + * * @see com.vaadin.ui.Tooltip#setQuickOpenDelay(int) */ @Override @@ -191,7 +191,7 @@ class TooltipConfigurationImpl implements TooltipConfiguration { /* * (non-Javadoc) - * + * * @see com.vaadin.ui.Tooltip#getOpenDelay() */ @Override @@ -201,7 +201,7 @@ class TooltipConfigurationImpl implements TooltipConfiguration { /* * (non-Javadoc) - * + * * @see com.vaadin.ui.Tooltip#setOpenDelay(int) */ @Override @@ -211,7 +211,7 @@ class TooltipConfigurationImpl implements TooltipConfiguration { /* * (non-Javadoc) - * + * * @see com.vaadin.ui.Tooltip#getMaxWidth() */ @Override @@ -221,7 +221,7 @@ class TooltipConfigurationImpl implements TooltipConfiguration { /* * (non-Javadoc) - * + * * @see com.vaadin.ui.Tooltip#setMaxWidth(int) */ @Override diff --git a/server/src/main/java/com/vaadin/ui/Tree.java b/server/src/main/java/com/vaadin/ui/Tree.java index 5e6ac55027..c56acff883 100644 --- a/server/src/main/java/com/vaadin/ui/Tree.java +++ b/server/src/main/java/com/vaadin/ui/Tree.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -70,7 +70,7 @@ import com.vaadin.util.ReflectTools; /** * Tree component. A Tree can be used to select an item (or multiple items) from * a hierarchical set of items. - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -100,7 +100,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Returns the item id of context clicked row. - * + * * @return item id of clicked row; null if no row is * present at the location */ @@ -200,7 +200,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Creates a new empty tree with caption. - * + * * @param caption */ public Tree(String caption) { @@ -209,7 +209,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Creates a new tree with caption and connect it to a Container. - * + * * @param caption * @param dataSource */ @@ -224,12 +224,12 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Sets the icon for an item. - * + * * @param itemId * the id of the item to be assigned an icon. * @param icon * the icon to use or null. - * + * * @param altText * the alternative text for the icon */ @@ -250,9 +250,9 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Set the alternate text for an item. - * + * * Used when the item has an icon. - * + * * @param itemId * the id of the item to be assigned an icon. * @param altText @@ -270,7 +270,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Return the alternate text of an icon in a tree item. - * + * * @param itemId * Object with the ID of the item * @return String with the alternate text of the icon, or null when no icon @@ -285,7 +285,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Check is an item is expanded - * + * * @param itemId * the item id. * @return true iff the item is expanded. @@ -296,7 +296,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Expands an item. - * + * * @param itemId * the item id. * @return True iff the expand operation succeeded @@ -309,7 +309,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Expands an item. - * + * * @param itemId * the item id. * @param sendChildTree @@ -356,10 +356,10 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Expands the items recursively - * + * * Expands all the children recursively starting from an item. Operation * succeeds only if all expandable items are expanded. - * + * * @param startItemId * @return True iff the expand operation succeeded */ @@ -387,7 +387,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Collapses an item. - * + * * @param itemId * the item id. * @return True iff the collapse operation succeeded @@ -409,10 +409,10 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Collapses the items recursively. - * + * * Collapse all the children recursively starting from an item. Operation * succeeds only if all expandable items are collapsed. - * + * * @param startItemId * @return True iff the collapse operation succeeded */ @@ -442,11 +442,11 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, * Returns the current selectable state. Selectable determines if the a node * can be selected on the client side. Selectable does not affect * {@link #setValue(Object)} or {@link #select(Object)}. - * + * *

            * The tree is selectable by default. *

            - * + * * @return the current selectable state. */ public boolean isSelectable() { @@ -457,11 +457,11 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, * Sets the selectable state. Selectable determines if the a node can be * selected on the client side. Selectable does not affect * {@link #setValue(Object)} or {@link #select(Object)}. - * + * *

            * The tree is selectable by default. *

            - * + * * @param selectable * The new selectable state. */ @@ -474,7 +474,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Sets the behavior of the multiselect mode - * + * * @param mode * The mode to set */ @@ -488,7 +488,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Returns the mode the multiselect is in. The mode controls how * multiselection can be done. - * + * * @return The mode */ public MultiSelectMode getMultiselectMode() { @@ -499,7 +499,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /* * (non-Javadoc) - * + * * @see com.vaadin.ui.AbstractSelect#changeVariables(java.lang.Object, * java.util.Map) */ @@ -586,7 +586,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Handles the selection - * + * * @param variables * The variables sent to the server from the client */ @@ -617,7 +617,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Paints any needed component-specific things to the given UIDL stream. - * + * * @see com.vaadin.ui.AbstractComponent#paintContent(PaintTarget) */ @Override @@ -637,8 +637,8 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, // Paint tree attributes if (isSelectable()) { - target.addAttribute("selectmode", (isMultiSelect() ? "multi" - : "single")); + target.addAttribute("selectmode", + (isMultiSelect() ? "multi" : "single")); if (isMultiSelect()) { target.addAttribute("multiselectmode", multiSelectMode.toString()); @@ -737,8 +737,8 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, } if (itemStyleGenerator != null) { - String stylename = itemStyleGenerator - .getStyle(this, itemId); + String stylename = itemStyleGenerator.getStyle(this, + itemId); if (stylename != null) { target.addAttribute(TreeConstants.ATTRIBUTE_NODE_STYLE, stylename); @@ -856,7 +856,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Tests if the Item with given ID can have any children. - * + * * @see com.vaadin.data.Container.Hierarchical#areChildrenAllowed(Object) */ @Override @@ -866,7 +866,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Gets the IDs of all Items that are children of the specified Item. - * + * * @see com.vaadin.data.Container.Hierarchical#getChildren(Object) */ @Override @@ -876,7 +876,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Gets the ID of the parent Item of the specified Item. - * + * * @see com.vaadin.data.Container.Hierarchical#getParent(Object) */ @Override @@ -886,7 +886,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Tests if the Item specified with itemId has child Items. - * + * * @see com.vaadin.data.Container.Hierarchical#hasChildren(Object) */ @Override @@ -896,7 +896,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Tests if the Item specified with itemId is a root Item. - * + * * @see com.vaadin.data.Container.Hierarchical#isRoot(Object) */ @Override @@ -906,7 +906,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Gets the IDs of all Items in the container that don't have a parent. - * + * * @see com.vaadin.data.Container.Hierarchical#rootItemIds() */ @Override @@ -916,12 +916,13 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Sets the given Item's capability to have children. - * + * * @see com.vaadin.data.Container.Hierarchical#setChildrenAllowed(Object, * boolean) */ @Override - public boolean setChildrenAllowed(Object itemId, boolean areChildrenAllowed) { + public boolean setChildrenAllowed(Object itemId, + boolean areChildrenAllowed) { final boolean success = ((Container.Hierarchical) items) .setChildrenAllowed(itemId, areChildrenAllowed); if (success) { @@ -932,14 +933,14 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /* * (non-Javadoc) - * + * * @see com.vaadin.data.Container.Hierarchical#setParent(java.lang.Object , * java.lang.Object) */ @Override public boolean setParent(Object itemId, Object newParentId) { - final boolean success = ((Container.Hierarchical) items).setParent( - itemId, newParentId); + final boolean success = ((Container.Hierarchical) items) + .setParent(itemId, newParentId); if (success) { markAsDirty(); } @@ -950,7 +951,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Sets the Container that serves as the data source of the viewer. - * + * * @see com.vaadin.data.Container.Viewer#setContainerDataSource(Container) */ @Override @@ -961,12 +962,12 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, // Assure that the data source is ordered by making unordered // containers ordered by wrapping them - if (Container.Hierarchical.class.isAssignableFrom(newDataSource - .getClass())) { + if (Container.Hierarchical.class + .isAssignableFrom(newDataSource.getClass())) { super.setContainerDataSource(newDataSource); } else { - super.setContainerDataSource(new ContainerHierarchicalWrapper( - newDataSource)); + super.setContainerDataSource( + new ContainerHierarchicalWrapper(newDataSource)); } /* @@ -998,7 +999,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, * by either adding or removing items to the container. To * prevent a memory leak we should cleanup the expanded list * from items which was removed. - * + * * However, there will still be a leak if the container is * filtered to show only a subset of the items in the tree and * later unfiltered items are removed from the container. In @@ -1022,7 +1023,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, * Event to fired when a node is expanded. ExapandEvent is fired when a node * is to be expanded. it can me used to dynamically fill the sub-nodes of * the node. - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -1032,7 +1033,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * New instance of options change event - * + * * @param source * the Source of the event. * @param expandedItemId @@ -1044,7 +1045,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Node where the event occurred. - * + * * @return the Source of the event. */ public Object getItemId() { @@ -1054,7 +1055,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Expand event listener. - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -1065,7 +1066,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * A node has been expanded. - * + * * @param event * the Expand event. */ @@ -1074,7 +1075,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Adds the expand listener. - * + * * @param listener * the Listener to be added. */ @@ -1093,7 +1094,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Removes the expand listener. - * + * * @param listener * the Listener to be removed. */ @@ -1113,7 +1114,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Emits the expand event. - * + * * @param itemId * the item id. */ @@ -1125,7 +1126,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Collapse event - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -1135,7 +1136,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * New instance of options change event. - * + * * @param source * the Source of the event. * @param collapsedItemId @@ -1147,7 +1148,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Gets tge Collapsed Item id. - * + * * @return the collapsed item id. */ public Object getItemId() { @@ -1157,7 +1158,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Collapse event listener. - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -1168,7 +1169,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * A node has been collapsed. - * + * * @param event * the Collapse event. */ @@ -1177,7 +1178,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Adds the collapse listener. - * + * * @param listener * the Listener to be added. */ @@ -1197,7 +1198,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Removes the collapse listener. - * + * * @param listener * the Listener to be removed. */ @@ -1217,7 +1218,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Emits collapse event. - * + * * @param itemId * the item id. */ @@ -1229,7 +1230,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Adds an action handler. - * + * * @see com.vaadin.event.Action.Container#addActionHandler(Action.Handler) */ @Override @@ -1251,7 +1252,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Removes an action handler. - * + * * @see com.vaadin.event.Action.Container#removeActionHandler(Action.Handler) */ @Override @@ -1281,7 +1282,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Gets the visible item ids. - * + * * @see com.vaadin.ui.Select#getVisibleItemIds() */ @Override @@ -1325,7 +1326,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Tree does not support setNullSelectionItemId. - * + * * @see com.vaadin.ui.AbstractSelect#setNullSelectionItemId(java.lang.Object) */ @Override @@ -1339,7 +1340,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Adding new items is not supported. - * + * * @throws UnsupportedOperationException * if set to true. * @see com.vaadin.ui.Select#setNewItemsAllowed(boolean) @@ -1392,7 +1393,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Sets the {@link ItemStyleGenerator} to be used with this tree. - * + * * @param itemStyleGenerator * item style generator or null to remove generator */ @@ -1420,7 +1421,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Called by Tree when an item is painted. - * + * * @param source * the source Tree * @param itemId @@ -1449,7 +1450,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * A {@link TargetDetails} implementation with Tree specific api. - * + * * @since 6.3 */ public class TreeTargetDetails extends AbstractSelectTargetDetails { @@ -1496,7 +1497,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, * ), this method returns the item id of the node after the drag was * targeted. This method is useful when implementing drop into specific * location (between specific nodes) in tree. - * + * * @return the id of the item after the user targets the drop or null if * "target" is a first item in node list (or the first in root * node list) @@ -1533,7 +1534,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /* * (non-Javadoc) - * + * * @see * com.vaadin.event.dd.DropTarget#translateDropTargetDetails(java.util.Map) */ @@ -1545,7 +1546,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Helper API for {@link TreeDropCriterion} - * + * * @param itemId * @return */ @@ -1556,7 +1557,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Sets the drag mode that controls how Tree behaves as a {@link DragSource} * . - * + * * @param dragMode */ public void setDragMode(TreeDragMode dragMode) { @@ -1567,7 +1568,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * @return the drag mode that controls how Tree behaves as a * {@link DragSource}. - * + * * @see TreeDragMode */ public TreeDragMode getDragMode() { @@ -1577,9 +1578,9 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Concrete implementation of {@link DataBoundTransferable} for data * transferred from a tree. - * + * * @see {@link DataBoundTransferable}. - * + * * @since 6.3 */ protected class TreeTransferable extends DataBoundTransferable { @@ -1602,7 +1603,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /* * (non-Javadoc) - * + * * @see com.vaadin.event.dd.DragSource#getTransferable(java.util.Map) */ @Override @@ -1621,7 +1622,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, * Lazy loading accept criterion for Tree. Accepted target nodes are loaded * from server once per drag and drop operation. Developer must override one * method that decides accepted tree nodes for the whole Tree. - * + * *

            * Initially pretty much no data is sent to client. On first required * criterion check (per drag request) the client side data structure is @@ -1636,7 +1637,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /* * (non-Javadoc) - * + * * @see * com.vaadin.event.dd.acceptCriteria.ServerSideCriterion#getIdentifier * () @@ -1648,7 +1649,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /* * (non-Javadoc) - * + * * @see * com.vaadin.event.dd.acceptCriteria.AcceptCriterion#accepts(com.vaadin * .event.dd.DragAndDropEvent) @@ -1665,7 +1666,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /* * (non-Javadoc) - * + * * @see * com.vaadin.event.dd.acceptCriteria.AcceptCriterion#paintResponse( * com.vaadin.server.PaintTarget) @@ -1695,9 +1696,9 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, *

            * Class is singleton, use {@link TargetItemAllowsChildren#get()} to get the * instance. - * + * * @see Tree#setChildrenAllowed(Object, boolean) - * + * * @since 6.3 */ public static class TargetItemAllowsChildren extends TargetDetailIs { @@ -1729,7 +1730,8 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, return false; } // return true if directly over - return eventDetails.getDropLocation() == VerticalDropLocation.MIDDLE; + return eventDetails + .getDropLocation() == VerticalDropLocation.MIDDLE; } catch (Exception e) { return false; } @@ -1753,7 +1755,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Constructs a criteria that accepts the drag if the targeted Item is a * descendant of Item identified by given id - * + * * @param parentItemId * the item identifier of the parent node */ @@ -1764,7 +1766,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Constructs a criteria that accepts drops within given level below the * subtree root identified by given id. - * + * * @param rootId * the item identifier to be sought for * @param depthToCheck @@ -1812,11 +1814,12 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Set the item description generator which generates tooltips for the tree * items - * + * * @param generator * The generator to use or null to disable */ - public void setItemDescriptionGenerator(ItemDescriptionGenerator generator) { + public void setItemDescriptionGenerator( + ItemDescriptionGenerator generator) { if (generator != itemDescriptionGenerator) { itemDescriptionGenerator = generator; markAsDirty(); @@ -1847,7 +1850,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Reads an Item from a design and inserts it into the data source. * Recursively handles any children of the item as well. - * + * * @since 7.5.0 * @param node * an element representing the item (tree node). @@ -1857,7 +1860,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, * @param context * the DesignContext instance used in parsing * @return the item id of the new item - * + * * @throws DesignException * if the tag name of the {@code node} element is not * {@code node}. @@ -1891,7 +1894,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Recursively writes the root items and their children to a design. - * + * * @since 7.5.0 * @param design * the element into which to insert the items @@ -1907,7 +1910,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Recursively writes a data source Item and its children to a design. - * + * * @since 7.5.0 * @param design * the element into which to insert the item @@ -1951,7 +1954,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, * developer is responsible for ensuring no harmful html is used. If set to * false, the content is passed to the browser as plain text. * The default setting is false - * + * * @since 7.6 * @param htmlContentAllowed * true if the captions are used as html, @@ -1964,7 +1967,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Checks whether captions are interpreted as html or plain text. - * + * * @since 7.6 * @return true if the captions are displayed as html, * false if displayed as plain text diff --git a/server/src/main/java/com/vaadin/ui/TreeTable.java b/server/src/main/java/com/vaadin/ui/TreeTable.java index bf38148aa9..e36f672988 100644 --- a/server/src/main/java/com/vaadin/ui/TreeTable.java +++ b/server/src/main/java/com/vaadin/ui/TreeTable.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -123,7 +123,7 @@ public class TreeTable extends Table implements Hierarchical { /** * This strategy is used if current container implements {@link Collapsible} * . - * + * * open-collapsed logic diverted to container, otherwise use default * implementations. */ @@ -190,7 +190,7 @@ public class TreeTable extends Table implements Hierarchical { /** * Strategy for Hierarchical but not Collapsible container like * {@link HierarchicalContainer}. - * + * * Store collapsed/open states internally, fool Table to use preorder when * accessing items from container via Ordered/Indexed methods. */ @@ -278,7 +278,7 @@ public class TreeTable extends Table implements Hierarchical { /** * Preorder of ids currently visible - * + * * @return */ private List getPreOrder() { @@ -296,8 +296,8 @@ public class TreeTable extends Table implements Hierarchical { private void addVisibleChildTree(Object id) { if (isNodeOpen(id)) { - Collection children = getContainerDataSource().getChildren( - id); + Collection children = getContainerDataSource() + .getChildren(id); if (children != null) { for (Object childId : children) { preOrder.add(childId); @@ -336,7 +336,7 @@ public class TreeTable extends Table implements Hierarchical { /** * Creates an empty TreeTable with a default container. - * + * * @param caption * the caption for the TreeTable */ @@ -347,7 +347,7 @@ public class TreeTable extends Table implements Hierarchical { /** * Creates a TreeTable instance with given captions and data source. - * + * * @param caption * the caption for the component * @param dataSource @@ -365,7 +365,7 @@ public class TreeTable extends Table implements Hierarchical { * The item id that was expanded or collapsed during this request. Reset at * the end of paint and only used for determining if a partial or full paint * should be done. - * + * * Can safely be reset to null whenever a change occurs that would prevent a * partial update from rendering the correct result, e.g. rows added or * removed during an expand operation. @@ -408,7 +408,8 @@ public class TreeTable extends Table implements Hierarchical { int indexInRowbuffer) throws PaintException { // always paint if present (in parent only if row headers visible) if (getRowHeaderMode() == ROW_HEADER_MODE_HIDDEN) { - Resource itemIcon = getItemIcon(cells[CELL_ITEMID][indexInRowbuffer]); + Resource itemIcon = getItemIcon( + cells[CELL_ITEMID][indexInRowbuffer]); if (itemIcon != null) { target.addAttribute("icon", itemIcon); } @@ -531,7 +532,8 @@ public class TreeTable extends Table implements Hierarchical { @Override protected int getAddedRowCount() { - return countSubNodesRecursively(getContainerDataSource(), toggledItemId); + return countSubNodesRecursively(getContainerDataSource(), + toggledItemId); } private int countSubNodesRecursively(Hierarchical hc, Object itemId) { @@ -567,7 +569,8 @@ public class TreeTable extends Table implements Hierarchical { return !getContainerStrategy().isNodeOpen(toggledItemId); } - private void toggleChildVisibility(Object itemId, boolean forceFullRefresh) { + private void toggleChildVisibility(Object itemId, + boolean forceFullRefresh) { getContainerStrategy().toggleChildVisibility(itemId); // ensure that page still has first item in page, DON'T clear the // caches. @@ -604,7 +607,8 @@ public class TreeTable extends Table implements Hierarchical { // FIXME: This disables partial updates until TreeTable is fixed so it // does not change component hierarchy during paint - containerSupportsPartialUpdates = (newDataSource instanceof ItemSetChangeNotifier) && false; + containerSupportsPartialUpdates = (newDataSource instanceof ItemSetChangeNotifier) + && false; if (newDataSource != null && !(newDataSource instanceof Hierarchical)) { newDataSource = new ContainerHierarchicalWrapper(newDataSource); @@ -709,7 +713,7 @@ public class TreeTable extends Table implements Hierarchical { /** * Sets the Item specified by given identifier as collapsed or expanded. If * the Item is collapsed, its children are not displayed to the user. - * + * * @param itemId * the identifier of the Item * @param collapsed @@ -734,9 +738,9 @@ public class TreeTable extends Table implements Hierarchical { /** * Checks if Item with given identifier is collapsed in the UI. - * + * *

            - * + * * @param itemId * the identifier of the checked Item * @return true if the Item with given id is collapsed @@ -750,7 +754,7 @@ public class TreeTable extends Table implements Hierarchical { * Explicitly sets the column in which the TreeTable visualizes the * hierarchy. If hierarchyColumnId is not set, the hierarchy is visualized * in the first visible column. - * + * * @param hierarchyColumnId */ public void setHierarchyColumn(Object hierarchyColumnId) { @@ -767,7 +771,7 @@ public class TreeTable extends Table implements Hierarchical { /** * Adds an expand listener. - * + * * @param listener * the Listener to be added. */ @@ -786,7 +790,7 @@ public class TreeTable extends Table implements Hierarchical { /** * Removes an expand listener. - * + * * @param listener * the Listener to be removed. */ @@ -806,7 +810,7 @@ public class TreeTable extends Table implements Hierarchical { /** * Emits an expand event. - * + * * @param itemId * the item id. */ @@ -816,7 +820,7 @@ public class TreeTable extends Table implements Hierarchical { /** * Adds a collapse listener. - * + * * @param listener * the Listener to be added. */ @@ -836,7 +840,7 @@ public class TreeTable extends Table implements Hierarchical { /** * Removes a collapse listener. - * + * * @param listener * the Listener to be removed. */ @@ -856,7 +860,7 @@ public class TreeTable extends Table implements Hierarchical { /** * Emits a collapse event. - * + * * @param itemId * the item id. */ @@ -875,7 +879,7 @@ public class TreeTable extends Table implements Hierarchical { * Animations can be enabled by passing true to this method. Currently * expanding rows slide in from the top and collapsing rows slide out the * same way. NOTE! not supported in Internet Explorer 6 or 7. - * + * * @param animationsEnabled * true or false whether to enable animations or not. */ @@ -935,8 +939,8 @@ public class TreeTable extends Table implements Hierarchical { Object itemId = super.readItem(tr, selected, context); if (tr.hasAttr("collapsed")) { - boolean collapsed = DesignAttributeHandler.readAttribute( - "collapsed", tr.attributes(), boolean.class); + boolean collapsed = DesignAttributeHandler + .readAttribute("collapsed", tr.attributes(), boolean.class); setCollapsed(itemId, collapsed); } diff --git a/server/src/main/java/com/vaadin/ui/TwinColSelect.java b/server/src/main/java/com/vaadin/ui/TwinColSelect.java index 8086220c94..a7f86ad037 100644 --- a/server/src/main/java/com/vaadin/ui/TwinColSelect.java +++ b/server/src/main/java/com/vaadin/ui/TwinColSelect.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -38,7 +38,7 @@ public class TwinColSelect extends AbstractSelect { private String rightColumnCaption; /** - * + * */ public TwinColSelect() { super(); @@ -69,7 +69,7 @@ public class TwinColSelect extends AbstractSelect { * Calling {@code setColumns(10);} is roughly equivalent to calling * {@code setWidth((10*2+4)+"10em");} *

            - * + * * @deprecated As of 7.0. "Columns" does not reflect the exact number of * characters that will be displayed. It is better to use * setWidth together with "em" to control the width of the @@ -90,7 +90,7 @@ public class TwinColSelect extends AbstractSelect { /** * Gets the number of columns for the component. - * + * * @see #setColumns(int) * @deprecated As of 7.0. "Columns" does not reflect the exact number of * characters that will be displayed. It is better to use @@ -115,8 +115,8 @@ public class TwinColSelect extends AbstractSelect { * {@link #setHeight(float, int)}) it overrides the number of rows. Leave * the height undefined to use this method. This is the opposite of how * {@link #setColumns(int)} work. - * - * + * + * * @param rows * the number of rows to set. */ @@ -168,7 +168,7 @@ public class TwinColSelect extends AbstractSelect { /** * Sets the text shown above the right column. - * + * * @param caption * The text to show */ @@ -179,7 +179,7 @@ public class TwinColSelect extends AbstractSelect { /** * Returns the text shown above the right column. - * + * * @return The text shown or null if not set. */ public String getRightColumnCaption() { @@ -188,7 +188,7 @@ public class TwinColSelect extends AbstractSelect { /** * Sets the text shown above the left column. - * + * * @param caption * The text to show */ @@ -199,7 +199,7 @@ public class TwinColSelect extends AbstractSelect { /** * Returns the text shown above the left column. - * + * * @return The text shown or null if not set. */ public String getLeftColumnCaption() { diff --git a/server/src/main/java/com/vaadin/ui/UI.java b/server/src/main/java/com/vaadin/ui/UI.java index 0a0cd46816..fcae3c7b2e 100644 --- a/server/src/main/java/com/vaadin/ui/UI.java +++ b/server/src/main/java/com/vaadin/ui/UI.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -98,15 +98,15 @@ import com.vaadin.util.CurrentInstance; * passing a {@link Component} with the main layout or other content of the view * to {@link #setContent(Component)} or to the constructor of the UI. *

            - * + * * @see #init(VaadinRequest) * @see UIProvider - * + * * @since 7.0 */ -public abstract class UI extends AbstractSingleComponentContainer implements - Action.Container, Action.Notifier, PollNotifier, LegacyComponent, - Focusable { +public abstract class UI extends AbstractSingleComponentContainer + implements Action.Container, Action.Notifier, PollNotifier, + LegacyComponent, Focusable { /** * The application to which this UI belongs @@ -128,7 +128,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements * The id of this UI, used to find the server side instance of the UI form * which a request originates. A negative value indicates that the UI id has * not yet been assigned by the Application. - * + * * @see VaadinSession#getNextUIid() */ private int uiId = -1; @@ -214,16 +214,15 @@ public abstract class UI extends AbstractSingleComponentContainer implements } } json.append("]}"); - getRpcProxy(DebugWindowClientRpc.class).reportLayoutProblems( - json.toString()); + getRpcProxy(DebugWindowClientRpc.class) + .reportLayoutProblems(json.toString()); } @Override public void showServerDesign(Connector connector) { if (!(connector instanceof Component)) { - getLogger().severe( - "Tried to output declarative design for " + connector - + ", which is not a component"); + getLogger().severe("Tried to output declarative design for " + + connector + ", which is not a component"); return; } if (connector instanceof UI) { @@ -234,10 +233,9 @@ public abstract class UI extends AbstractSingleComponentContainer implements ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { Design.write((Component) connector, baos); - getLogger().info( - "Design for " + connector - + " requested from debug window:\n" - + baos.toString("UTF-8")); + getLogger().info("Design for " + connector + + " requested from debug window:\n" + + baos.toString("UTF-8")); } catch (IOException e) { getLogger().log(Level.WARNING, "Error producing design for " + connector, e); @@ -282,10 +280,10 @@ public abstract class UI extends AbstractSingleComponentContainer implements /** * Creates a new UI with the given component (often a layout) as its * content. - * + * * @param content * the component to use as this UIs content. - * + * * @see #setContent(Component) */ public UI(Component content) { @@ -314,9 +312,9 @@ public abstract class UI extends AbstractSingleComponentContainer implements /** * Overridden to return a value instead of referring to the parent. - * + * * @return this UI - * + * * @see com.vaadin.ui.AbstractComponent#getUI() */ @Override @@ -326,12 +324,12 @@ public abstract class UI extends AbstractSingleComponentContainer implements /** * Gets the application object to which the component is attached. - * + * *

            * The method will return {@code null} if the component is not currently * attached to an application. *

            - * + * *

            * Getting a null value is often a problem in constructors of regular * components and in the initializers of custom composite components. A @@ -340,7 +338,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements * Another way is to move the problematic initialization to * {@link #attach()}, as described in the documentation of the method. *

            - * + * * @return the parent application of the component or null. * @see #attach() */ @@ -360,9 +358,8 @@ public abstract class UI extends AbstractSingleComponentContainer implements if (pendingFocus != null) { // ensure focused component is still attached to this main window - if (equals(pendingFocus.getUI()) - || (pendingFocus.getUI() != null && equals(pendingFocus - .getUI().getParent()))) { + if (equals(pendingFocus.getUI()) || (pendingFocus.getUI() != null + && equals(pendingFocus.getUI().getParent()))) { target.addAttribute("focused", pendingFocus); } pendingFocus = null; @@ -379,7 +376,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements /** * Fire a click event to all click listeners. - * + * * @param object * The raw "value" of the variable change from the client side. */ @@ -411,7 +408,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements /* * (non-Javadoc) - * + * * @see com.vaadin.ui.HasComponents#iterator() */ @Override @@ -431,7 +428,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements /* * (non-Javadoc) - * + * * @see com.vaadin.ui.ComponentContainer#getComponentCount() */ @Override @@ -445,13 +442,13 @@ public abstract class UI extends AbstractSingleComponentContainer implements * This method is for internal use by the framework. To explicitly close a * UI, see {@link #close()}. *

            - * + * * @param session * the session to set - * + * * @throws IllegalStateException * if the session has already been set - * + * * @see #getSession() */ public void setSession(VaadinSession session) { @@ -504,7 +501,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements * This method is not intended to be overridden. If it is overridden, care * should be taken since this method might be called in situations where * {@link UI#getCurrent()} does not return this UI. - * + * * @return the id of this UI */ public int getUIId() { @@ -514,15 +511,15 @@ public abstract class UI extends AbstractSingleComponentContainer implements /** * Adds a window as a subwindow inside this UI. To open a new browser window * or tab, you should instead use a {@link UIProvider}. - * + * * @param window * @throws IllegalArgumentException * if the window is already added to an application * @throws NullPointerException * if the given Window is null. */ - public void addWindow(Window window) throws IllegalArgumentException, - NullPointerException { + public void addWindow(Window window) + throws IllegalArgumentException, NullPointerException { if (window == null) { throw new NullPointerException("Argument must not be null"); @@ -538,7 +535,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements /** * Helper method to attach a window. - * + * * @param w * the window to add */ @@ -551,13 +548,13 @@ public abstract class UI extends AbstractSingleComponentContainer implements /** * Remove the given subwindow from this UI. - * + * * Since Vaadin 6.5, {@link Window.CloseListener}s are called also when * explicitly removing a window by calling this method. - * + * * Since Vaadin 6.5, returns a boolean indicating if the window was removed * or not. - * + * * @param window * Window to be removed. * @return true if the subwindow was removed, false otherwise @@ -577,7 +574,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements /** * Gets all the windows added to this UI. - * + * * @return an unmodifiable collection of windows */ public Collection getWindows() { @@ -612,10 +609,10 @@ public abstract class UI extends AbstractSingleComponentContainer implements * Component.Focusable) due we want the last focused component to be focused * in client too. Not the one that is rendered last (the case we'd get if * implemented in Focusable only). - * + * * To focus component from Vaadin application, use Focusable.focus(). See * {@link Focusable}. - * + * * @param focusable * to be focused on next paint */ @@ -628,7 +625,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements * Scrolls any component between the component and UI to a suitable position * so the component is visible to the user. The given component must belong * to this UI. - * + * * @param component * the component to be scrolled into view * @throws IllegalArgumentException @@ -648,7 +645,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements * Internal initialization method, should not be overridden. This method is * not declared as final because that would break compatibility with e.g. * CDI. - * + * * @param request * the initialization request * @param uiId @@ -656,7 +653,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements * @param embedId * the embed id of this UI, or null if no id is * known - * + * * @see #getUIId() * @see #getEmbedId() */ @@ -702,7 +699,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements * The {@link VaadinRequest} can be used to get information about the * request that caused this UI to be created. *

            - * + * * @param request * the Vaadin request that caused this UI to be created */ @@ -710,7 +707,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements /** * Internal reinitialization method, should not be overridden. - * + * * @since 7.2 * @param request * the request that caused this UI to be reloaded @@ -754,7 +751,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements *

            * The {@link VaadinRequest} can be used to get information about the * request that caused this UI to be reloaded. - * + * * @since 7.2 * @param request * the request that caused this UI to be reloaded @@ -773,10 +770,10 @@ public abstract class UI extends AbstractSingleComponentContainer implements *

            * The UI is stored using a weak reference to avoid leaking memory in case * it is not explicitly cleared. - * + * * @param ui * the UI to register as the current UI - * + * * @see #getCurrent() * @see ThreadLocal */ @@ -791,9 +788,9 @@ public abstract class UI extends AbstractSingleComponentContainer implements *

            * The UI is stored using a weak reference to avoid leaking memory in case * it is not explicitly cleared. - * + * * @return the current UI instance if available, otherwise null - * + * * @see #setCurrent(UI) */ public static UI getCurrent() { @@ -802,7 +799,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements /** * Set top offset to which the UI should scroll to. - * + * * @param scrollTop */ public void setScrollTop(int scrollTop) { @@ -822,7 +819,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements /** * Set left offset to which the UI should scroll to. - * + * * @param scrollLeft */ public void setScrollLeft(int scrollLeft) { @@ -886,7 +883,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements * When there are active window resize listeners, lazy resize mode should be * used to avoid a large number of events during resize. *

            - * + * * @param resizeLazy * true to use a delay before recalculating sizes, false to * calculate immediately. @@ -898,7 +895,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements /** * Checks whether lazy resize is enabled. - * + * * @return true if lazy resize is enabled, false * if lazy resize is not enabled */ @@ -911,9 +908,9 @@ public abstract class UI extends AbstractSingleComponentContainer implements * clicks inside the UI. Also when the click targets a component inside the * UI, provided the targeted component does not prevent the click event from * propagating. - * + * * Use {@link #removeListener(ClickListener)} to remove the listener. - * + * * @param listener * The listener to add */ @@ -934,7 +931,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements /** * Remove a click listener from the UI. The listener should earlier have * been added using {@link #addListener(ClickListener)}. - * + * * @param listener * The listener to remove */ @@ -969,7 +966,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements /** * Returns the navigator attached to this UI or null if there is no * navigator. - * + * * @return */ public Navigator getNavigator() { @@ -978,7 +975,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements /** * For internal use only. - * + * * @param navigator */ public void setNavigator(Navigator navigator) { @@ -988,7 +985,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements /** * Setting the caption of a UI is not supported. To set the title of the * HTML page, use Page.setTitle - * + * * @deprecated As of 7.0, use {@link Page#setTitle(String)} */ @Override @@ -1001,16 +998,16 @@ public abstract class UI extends AbstractSingleComponentContainer implements /** * Shows a notification message on the middle of the UI. The message * automatically disappears ("humanized message"). - * + * * Care should be taken to to avoid XSS vulnerabilities as the caption is * rendered as html. - * + * * @see #showNotification(Notification) * @see Notification - * + * * @param caption * The message - * + * * @deprecated As of 7.0, use Notification.show instead but be aware that * Notification.show does not allow HTML. */ @@ -1025,18 +1022,18 @@ public abstract class UI extends AbstractSingleComponentContainer implements * Shows a notification message the UI. The position and behavior of the * message depends on the type, which is one of the basic types defined in * {@link Notification}, for instance Notification.TYPE_WARNING_MESSAGE. - * + * * Care should be taken to to avoid XSS vulnerabilities as the caption is * rendered as html. - * + * * @see #showNotification(Notification) * @see Notification - * + * * @param caption * The message * @param type * The message type - * + * * @deprecated As of 7.0, use Notification.show instead but be aware that * Notification.show does not allow HTML. */ @@ -1051,18 +1048,18 @@ public abstract class UI extends AbstractSingleComponentContainer implements * Shows a notification consisting of a bigger caption and a smaller * description on the middle of the UI. The message automatically disappears * ("humanized message"). - * + * * Care should be taken to to avoid XSS vulnerabilities as the caption and * description are rendered as html. - * + * * @see #showNotification(Notification) * @see Notification - * + * * @param caption * The caption of the message * @param description * The message description - * + * * @deprecated As of 7.0, use new Notification(...).show(Page) instead but * be aware that HTML by default not allowed. */ @@ -1078,27 +1075,28 @@ public abstract class UI extends AbstractSingleComponentContainer implements * description. The position and behavior of the message depends on the * type, which is one of the basic types defined in {@link Notification} , * for instance Notification.TYPE_WARNING_MESSAGE. - * + * * Care should be taken to to avoid XSS vulnerabilities as the caption and * description are rendered as html. - * + * * @see #showNotification(Notification) * @see Notification - * + * * @param caption * The caption of the message * @param description * The message description * @param type * The message type - * + * * @deprecated As of 7.0, use new Notification(...).show(Page) instead but * be aware that HTML by default not allowed. */ @Deprecated public void showNotification(String caption, String description, Notification.Type type) { - Notification notification = new Notification(caption, description, type); + Notification notification = new Notification(caption, description, + type); notification.setHtmlContentAllowed(true);// Backwards compatibility getPage().showNotification(notification); } @@ -1108,13 +1106,13 @@ public abstract class UI extends AbstractSingleComponentContainer implements * description. The position and behavior of the message depends on the * type, which is one of the basic types defined in {@link Notification} , * for instance Notification.TYPE_WARNING_MESSAGE. - * + * * Care should be taken to avoid XSS vulnerabilities if html content is * allowed. - * + * * @see #showNotification(Notification) * @see Notification - * + * * @param caption * The message caption * @param description @@ -1124,30 +1122,28 @@ public abstract class UI extends AbstractSingleComponentContainer implements * @param htmlContentAllowed * Whether html in the caption and description should be * displayed as html or as plain text - * + * * @deprecated As of 7.0, use new Notification(...).show(Page). */ @Deprecated public void showNotification(String caption, String description, Notification.Type type, boolean htmlContentAllowed) { - getPage() - .showNotification( - new Notification(caption, description, type, - htmlContentAllowed)); + getPage().showNotification(new Notification(caption, description, type, + htmlContentAllowed)); } /** * Shows a notification message. - * + * * @see Notification * @see #showNotification(String) * @see #showNotification(String, int) * @see #showNotification(String, String) * @see #showNotification(String, String, int) - * + * * @param notification * The notification message to show - * + * * @deprecated As of 7.0, use Notification.show instead */ @Deprecated @@ -1161,9 +1157,9 @@ public abstract class UI extends AbstractSingleComponentContainer implements * This method is not intended to be overridden. If it is overridden, care * should be taken since this method might be called in situations where * {@link UI#getCurrent()} does not return this UI. - * + * * @see VaadinService#closeInactiveUIs(VaadinSession) - * + * * @return The time the last heartbeat request occurred, in milliseconds * since the epoch. */ @@ -1179,7 +1175,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements * This method is not intended to be overridden. If it is overridden, care * should be taken since this method might be called in situations where * {@link UI#getCurrent()} does not return this UI. - * + * * @param lastHeartbeat * The time the last heartbeat request occurred, in milliseconds * since the epoch. @@ -1190,7 +1186,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements /** * Gets the theme currently in use by this UI - * + * * @return the theme name */ public String getTheme() { @@ -1207,7 +1203,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements * other environment where there are multiple UIs on the same page. The old * CSS file will be removed even if there are other UIs on the page which * are still using it. - * + * * @since 7.3 * @param theme * The new theme name @@ -1240,7 +1236,8 @@ public abstract class UI extends AbstractSingleComponentContainer implements public void close() { closing = true; - boolean sessionExpired = (session == null || session.getState() != State.OPEN); + boolean sessionExpired = (session == null + || session.getState() != State.OPEN); getRpcProxy(UIClientRpc.class).uiClosed(sessionExpired); if (getPushConnection() != null) { // Push the Rpc to the client. The connection will be closed when @@ -1261,9 +1258,9 @@ public abstract class UI extends AbstractSingleComponentContainer implements * This method is not intended to be overridden. If it is overridden, care * should be taken since this method might be called in situations where * {@link UI#getCurrent()} does not return this UI. - * + * * @see #close() - * + * * @return whether this UI is closing. */ public boolean isClosing() { @@ -1274,7 +1271,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements * Called after the UI is added to the session. A UI instance is attached * exactly once, before its {@link #init(VaadinRequest) init} method is * called. - * + * * @see Component#attach */ @Override @@ -1303,7 +1300,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements /* * (non-Javadoc) - * + * * @see * com.vaadin.ui.AbstractSingleComponentContainer#setContent(com.vaadin. * ui.Component) @@ -1349,9 +1346,9 @@ public abstract class UI extends AbstractSingleComponentContainer implements * later point in time. * *

            - * + * * @since 7.1 - * + * * @param runnable * the runnable which accesses the UI * @throws UIDetachedException @@ -1359,7 +1356,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements * therefore not be done) * @throws IllegalStateException * if the current thread holds the lock for another session - * + * * @see #access(Runnable) * @see VaadinSession#accessSynchronously(Runnable) */ @@ -1423,14 +1420,14 @@ public abstract class UI extends AbstractSingleComponentContainer implements * The returned future can be used to check for task completion and to * cancel the task. *

            - * + * * @see #getCurrent() * @see #accessSynchronously(Runnable) * @see VaadinSession#access(Runnable) * @see VaadinSession#lock() - * + * * @since 7.1 - * + * * @param runnable * the runnable which accesses the UI * @throws UIDetachedException @@ -1481,7 +1478,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements /** * Retrieves the object used for configuring tooltips. - * + * * @return The instance used for tooltip configuration */ public TooltipConfiguration getTooltipConfiguration() { @@ -1490,7 +1487,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements /** * Retrieves the object used for configuring notifications. - * + * * @return The instance used for notification configuration */ public NotificationConfiguration getNotificationConfiguration() { @@ -1499,7 +1496,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements /** * Retrieves the object used for configuring the loading indicator. - * + * * @return The instance used for configuring the loading indicator */ public LoadingIndicatorConfiguration getLoadingIndicatorConfiguration() { @@ -1518,14 +1515,14 @@ public abstract class UI extends AbstractSingleComponentContainer implements * return this UI since writing the response may invoke logic in any * attached component or extension. The recommended way of fulfilling these * conditions is to use {@link #access(Runnable)}. - * + * * @throws IllegalStateException * if push is disabled. * @throws UIDetachedException * if this UI is not attached to a session. - * + * * @see #getPushConfiguration() - * + * * @since 7.1 */ public void push() { @@ -1563,12 +1560,13 @@ public abstract class UI extends AbstractSingleComponentContainer implements * This method is not intended to be overridden. If it is overridden, care * should be taken since this method might be called in situations where * {@link UI#getCurrent()} does not return this UI. - * + * * @return the push connection used by this UI, or {@code null} if push is * not available. */ public PushConnection getPushConnection() { - assert !(getPushConfiguration().getPushMode().isEnabled() && pushConnection == null); + assert !(getPushConfiguration().getPushMode().isEnabled() + && pushConnection == null); return pushConnection; } @@ -1578,7 +1576,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements *

            * The {@code pushConnection} argument must be non-null if and only if * {@code getPushConfiguration().getPushMode().isEnabled()}. - * + * * @param pushConnection * the push connection to use for this UI */ @@ -1611,7 +1609,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements * application developer. An add-on should not set the poll interval * directly, rather instruct the user to set it. *

            - * + * * @param intervalInMillis * The interval (in ms) with which the UI should poll the server * or -1 to disable polling @@ -1622,7 +1620,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements /** * Returns the interval with which the UI polls the server. - * + * * @return The interval (in ms) with which the UI polls the server or -1 if * polling is disabled */ @@ -1643,7 +1641,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements /** * Retrieves the object used for configuring the push channel. - * + * * @since 7.1 * @return The instance used for push configuration */ @@ -1653,7 +1651,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements /** * Retrieves the object used for configuring the reconnect dialog. - * + * * @since 7.6 * @return The instance used for reconnect dialog configuration */ @@ -1664,7 +1662,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements /** * Get the label that is added to the container element, where tooltip, * notification and dialogs are added to. - * + * * @return the label of the container */ public String getOverlayContainerLabel() { @@ -1678,7 +1676,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements * This is helpful for users of assistive devices, as this element is * reachable for them. *

            - * + * * @param overlayContainerLabel * label to use for the container */ @@ -1689,7 +1687,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements /** * Returns the locale service which handles transmission of Locale data to * the client. - * + * * @since 7.1 * @return The LocaleService for this UI */ @@ -1706,7 +1704,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements * it is embedded. The embed identifier is based on the * window.name DOM attribute of the browser window where the UI * is displayed and the id of the div element where the UI is embedded. - * + * * @since 7.2 * @return the embed id for this UI, or null if no id known */ @@ -1716,9 +1714,9 @@ public abstract class UI extends AbstractSingleComponentContainer implements /** * Gets the last processed server message id. - * + * * Used internally for communication tracking. - * + * * @return lastProcessedServerMessageId the id of the last processed server * message * @since 7.6 @@ -1729,9 +1727,9 @@ public abstract class UI extends AbstractSingleComponentContainer implements /** * Sets the last processed server message id. - * + * * Used internally for communication tracking. - * + * * @param lastProcessedServerMessageId * the id of the last processed server message * @since 7.6 diff --git a/server/src/main/java/com/vaadin/ui/UIDetachedException.java b/server/src/main/java/com/vaadin/ui/UIDetachedException.java index 7cd7f0889e..4454f8279e 100644 --- a/server/src/main/java/com/vaadin/ui/UIDetachedException.java +++ b/server/src/main/java/com/vaadin/ui/UIDetachedException.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -17,7 +17,7 @@ package com.vaadin.ui; /** * Exception thrown if the UI has been detached when it should not be. - * + * * @author Vaadin Ltd * @since 7.1 */ diff --git a/server/src/main/java/com/vaadin/ui/UniqueSerializable.java b/server/src/main/java/com/vaadin/ui/UniqueSerializable.java index f5d68e8a71..8f5fc9c053 100644 --- a/server/src/main/java/com/vaadin/ui/UniqueSerializable.java +++ b/server/src/main/java/com/vaadin/ui/UniqueSerializable.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -22,10 +22,10 @@ import java.io.Serializable; *

            * This class is abstract but has no abstract methods to force users to create * an anonymous inner class. Otherwise each instance will not be unique. - * + * * @author Vaadin Ltd * @since 6.8.0 - * + * */ public abstract class UniqueSerializable implements Serializable { diff --git a/server/src/main/java/com/vaadin/ui/Upload.java b/server/src/main/java/com/vaadin/ui/Upload.java index a61bcf1bd9..68db6db979 100644 --- a/server/src/main/java/com/vaadin/ui/Upload.java +++ b/server/src/main/java/com/vaadin/ui/Upload.java @@ -73,8 +73,8 @@ import com.vaadin.util.ReflectTools; * @since 3.0 */ @SuppressWarnings("serial") -public class Upload extends AbstractComponent implements Component.Focusable, - LegacyComponent { +public class Upload extends AbstractComponent + implements Component.Focusable, LegacyComponent { /** * Should the field be focused on next repaint? @@ -233,9 +233,8 @@ public class Upload extends AbstractComponent implements Component.Focusable, "uploadFailed", new Class[] { FailedEvent.class }); UPLOAD_STARTED_METHOD = StartedListener.class.getDeclaredMethod( "uploadStarted", new Class[] { StartedEvent.class }); - UPLOAD_SUCCEEDED_METHOD = SucceededListener.class - .getDeclaredMethod("uploadSucceeded", - new Class[] { SucceededEvent.class }); + UPLOAD_SUCCEEDED_METHOD = SucceededListener.class.getDeclaredMethod( + "uploadSucceeded", new Class[] { SucceededEvent.class }); } catch (final java.lang.NoSuchMethodException e) { // This should never happen throw new java.lang.RuntimeException( @@ -907,8 +906,8 @@ public class Upload extends AbstractComponent implements Component.Focusable, // this is implemented differently than other listeners to maintain // backwards compatibility if (progressListeners != null) { - for (Iterator it = progressListeners.iterator(); it - .hasNext();) { + for (Iterator it = progressListeners + .iterator(); it.hasNext();) { ProgressListener l = it.next(); l.updateProgress(totalBytes, contentLength); } @@ -1115,8 +1114,8 @@ public class Upload extends AbstractComponent implements Component.Focusable, @Override public boolean listenProgress() { - return (progressListeners != null && !progressListeners - .isEmpty()); + return (progressListeners != null + && !progressListeners.isEmpty()); } @Override diff --git a/server/src/main/java/com/vaadin/ui/VerticalLayout.java b/server/src/main/java/com/vaadin/ui/VerticalLayout.java index 7002fbc7e6..fe133c1bb0 100644 --- a/server/src/main/java/com/vaadin/ui/VerticalLayout.java +++ b/server/src/main/java/com/vaadin/ui/VerticalLayout.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -19,11 +19,11 @@ import com.vaadin.shared.ui.orderedlayout.VerticalLayoutState; /** * Vertical layout - * + * * VerticalLayout is a component container, which shows the * subcomponents in the order of their addition (vertically). A vertical layout * is by default 100% wide. - * + * * @author Vaadin Ltd. * @since 5.3 */ @@ -40,9 +40,9 @@ public class VerticalLayout extends AbstractOrderedLayout { /** * Constructs a VerticalLayout with the given components. The components are * added in the given order. - * + * * @see AbstractOrderedLayout#addComponents(Component...) - * + * * @param children * The components to add. */ diff --git a/server/src/main/java/com/vaadin/ui/VerticalSplitPanel.java b/server/src/main/java/com/vaadin/ui/VerticalSplitPanel.java index e5e6eb60e1..b2e6f115aa 100644 --- a/server/src/main/java/com/vaadin/ui/VerticalSplitPanel.java +++ b/server/src/main/java/com/vaadin/ui/VerticalSplitPanel.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,7 +20,7 @@ import com.vaadin.shared.ui.splitpanel.VerticalSplitPanelState; /** * A vertical split panel contains two components and lays them vertically. The * first component is above the second component. - * + * *

              *      +--------------------------+
              *      |                          |
            @@ -32,7 +32,7 @@ import com.vaadin.shared.ui.splitpanel.VerticalSplitPanelState;
              *      |                          |
              *      +--------------------------+
              * 
            - * + * */ public class VerticalSplitPanel extends AbstractSplitPanel { @@ -43,7 +43,7 @@ public class VerticalSplitPanel extends AbstractSplitPanel { /** * Creates a horizontal split panel containing the given components - * + * * @param firstComponent * The component to be placed above the splitter * @param secondComponent diff --git a/server/src/main/java/com/vaadin/ui/Video.java b/server/src/main/java/com/vaadin/ui/Video.java index 46a4293b36..1bacc8c5ec 100644 --- a/server/src/main/java/com/vaadin/ui/Video.java +++ b/server/src/main/java/com/vaadin/ui/Video.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -33,19 +33,19 @@ import com.vaadin.ui.declarative.DesignContext; * such is only supported in browsers that support HTML5 media markup. Browsers * that do not support HTML5 display the text or HTML set by calling * {@link #setAltText(String)}. - * + * * A flash-player fallback can be implemented by setting HTML content allowed ( * {@link #setHtmlContentAllowed(boolean)} and calling * {@link #setAltText(String)} with the flash player markup. An example of flash * fallback can be found at the Mozilla Developer Network. - * + * * Multiple sources can be specified. Which of the sources is used is selected - * by the browser depending on which file formats it supports. See wikipedia for a + * by the browser depending on which file formats it supports. See + * wikipedia for a * table of formats supported by different browsers. - * + * * @author Vaadin Ltd * @since 6.7.0 */ @@ -83,7 +83,7 @@ public class Video extends AbstractMedia { /** * Sets the poster image, which is shown in place of the video before the * user presses play. - * + * * @param poster */ public void setPoster(Resource poster) { diff --git a/server/src/main/java/com/vaadin/ui/Window.java b/server/src/main/java/com/vaadin/ui/Window.java index 70399ae566..38781b2f21 100644 --- a/server/src/main/java/com/vaadin/ui/Window.java +++ b/server/src/main/java/com/vaadin/ui/Window.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -55,7 +55,8 @@ import com.vaadin.util.ReflectTools; /** * A component that represents a floating popup window that can be added to a * {@link UI}. A window is added to a {@code UI} using - * {@link UI#addWindow(Window)}.

            + * {@link UI#addWindow(Window)}. + *

            *

            * The contents of a window is set using {@link #setContent(Component)} or by * using the {@link #Window(String, Component)} constructor. @@ -71,13 +72,13 @@ import com.vaadin.util.ReflectTools; * In Vaadin versions prior to 7.0.0, Window was also used as application level * windows. This function is now covered by the {@link UI} class. *

            - * + * * @author Vaadin Ltd. * @since 3.0 */ @SuppressWarnings({ "serial", "deprecation" }) -public class Window extends Panel implements FocusNotifier, BlurNotifier, - LegacyComponent { +public class Window extends Panel + implements FocusNotifier, BlurNotifier, LegacyComponent { private WindowServerRpc rpc = new WindowServerRpc() { @@ -105,7 +106,8 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /** * Holds registered CloseShortcut instances for query and later removal */ - private List closeShortcuts = new ArrayList(4); + private List closeShortcuts = new ArrayList( + 4); /** * Creates a new, empty window @@ -116,7 +118,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /** * Creates a new, empty window with a given title. - * + * * @param caption * the title of the window. */ @@ -126,7 +128,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /** * Creates a new, empty window with the given content and title. - * + * * @param caption * the title of the window. * @param content @@ -143,7 +145,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /* * (non-Javadoc) - * + * * @see com.vaadin.ui.Panel#paintContent(com.vaadin.server.PaintTarget) */ @@ -161,10 +163,9 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /* * (non-Javadoc) - * - * @see - * com.vaadin.ui.AbstractComponent#setParent(com.vaadin.server.ClientConnector - * ) + * + * @see com.vaadin.ui.AbstractComponent#setParent(com.vaadin.server. + * ClientConnector ) */ @Override public void setParent(HasComponents parent) { @@ -178,7 +179,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /* * (non-Javadoc) - * + * * @see com.vaadin.ui.Panel#changeVariables(java.lang.Object, java.util.Map) */ @@ -189,14 +190,12 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, boolean sizeHasChanged = false; // size is handled in super class, but resize events only in windows -> // so detect if size change occurs before super.changeVariables() - if (variables.containsKey("height") - && (getHeightUnits() != Unit.PIXELS || (Integer) variables - .get("height") != getHeight())) { + if (variables.containsKey("height") && (getHeightUnits() != Unit.PIXELS + || (Integer) variables.get("height") != getHeight())) { sizeHasChanged = true; } - if (variables.containsKey("width") - && (getWidthUnits() != Unit.PIXELS || (Integer) variables - .get("width") != getWidth())) { + if (variables.containsKey("width") && (getWidthUnits() != Unit.PIXELS + || (Integer) variables.get("width") != getWidth())) { sizeHasChanged = true; } @@ -241,12 +240,12 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /** * Method that handles window closing (from UI). - * + * *

            * By default, windows are removed from their respective UIs and thus * visually closed on browser-side. *

            - * + * *

            * To react to a window being closed (after it is closed), register a * {@link CloseListener}. @@ -265,7 +264,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /** * Gets the distance of Window left border in pixels from left border of the * containing (main window) when the window is in {@link WindowMode#NORMAL}. - * + * * @return the Distance of Window left border in pixels from left border of * the containing (main window).or -1 if unspecified * @since 4.0.0 @@ -277,7 +276,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /** * Sets the position of the window on the screen using * {@link #setPositionX(int)} and {@link #setPositionY(int)} - * + * * @since 7.5 * @param x * The new x coordinate for the window @@ -293,7 +292,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * Sets the distance of Window left border in pixels from left border of the * containing (main window). Has effect only if in {@link WindowMode#NORMAL} * mode. - * + * * @param positionX * the Distance of Window left border in pixels from left border * of the containing (main window). or -1 if unspecified. @@ -308,10 +307,10 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * Gets the distance of Window top border in pixels from top border of the * containing (main window) when the window is in {@link WindowMode#NORMAL} * state, or when next set to that state. - * + * * @return Distance of Window top border in pixels from top border of the * containing (main window). or -1 if unspecified - * + * * @since 4.0.0 */ public int getPositionY() { @@ -322,11 +321,11 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * Sets the distance of Window top border in pixels from top border of the * containing (main window). Has effect only if in {@link WindowMode#NORMAL} * mode. - * + * * @param positionY * the Distance of Window top border in pixels from top border of * the containing (main window). or -1 if unspecified - * + * * @since 4.0.0 */ public void setPositionY(int positionY) { @@ -349,7 +348,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, public static class CloseEvent extends Component.Event { /** - * + * * @param source */ public CloseEvent(Component source) { @@ -358,7 +357,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /** * Gets the Window. - * + * * @return the window. */ public Window getWindow() { @@ -371,7 +370,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * CloseListener to a window and * {@link CloseListener#windowClose(CloseEvent)} will be called whenever the * user closes the window. - * + * *

            * Since Vaadin 6.5, removing a window using {@link #removeWindow(Window)} * fires the CloseListener. @@ -382,7 +381,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * Called when the user closes a window. Use * {@link CloseEvent#getWindow()} to get a reference to the * {@link Window} that was closed. - * + * * @param e * Event containing */ @@ -391,21 +390,21 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /** * Adds a CloseListener to the window. - * + * * For a window the CloseListener is fired when the user closes it (clicks * on the close button). - * + * * For a browser level window the CloseListener is fired when the browser * level window is closed. Note that closing a browser level window does not * mean it will be destroyed. Also note that Opera does not send events like * all other browsers and therefore the close listener might not be called * if Opera is used. - * + * *

            * Since Vaadin 6.5, removing windows using {@link #removeWindow(Window)} * does fire the CloseListener. *

            - * + * * @param listener * the CloseListener to add. */ @@ -424,11 +423,11 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /** * Removes the CloseListener from the window. - * + * *

            * For more information on CloseListeners see {@link CloseListener}. *

            - * + * * @param listener * the CloseListener to remove. */ @@ -451,17 +450,17 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /** * Event which is fired when the mode of the Window changes. - * + * * @author Vaadin Ltd * @since 7.1 - * + * */ public static class WindowModeChangeEvent extends Component.Event { private final WindowMode windowMode; /** - * + * * @param source */ public WindowModeChangeEvent(Component source, WindowMode windowMode) { @@ -471,7 +470,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /** * Gets the Window. - * + * * @return the window */ public Window getWindow() { @@ -480,7 +479,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /** * Gets the new window mode. - * + * * @return the new mode */ public WindowMode getWindowMode() { @@ -498,8 +497,8 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, public interface WindowModeChangeListener extends Serializable { public static final Method windowModeChangeMethod = ReflectTools - .findMethod(WindowModeChangeListener.class, - "windowModeChanged", WindowModeChangeEvent.class); + .findMethod(WindowModeChangeListener.class, "windowModeChanged", + WindowModeChangeEvent.class); /** * Called when the user maximizes / restores a window. Use @@ -507,7 +506,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * {@link Window} that was maximized / restored. Use * {@link WindowModeChangeEvent#getWindowMode()} to get a reference to * the new state. - * + * * @param event */ public void windowModeChanged(WindowModeChangeEvent event); @@ -515,12 +514,12 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /** * Adds a WindowModeChangeListener to the window. - * + * * The WindowModeChangeEvent is fired when the user changed the display * state by clicking the maximize/restore button or by double clicking on * the window header. The event is also fired if the state is changed using * {@link #setWindowMode(WindowMode)}. - * + * * @param listener * the WindowModeChangeListener to add. */ @@ -531,17 +530,19 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /** * Removes the WindowModeChangeListener from the window. - * + * * @param listener * the WindowModeChangeListener to remove. */ - public void removeWindowModeChangeListener(WindowModeChangeListener listener) { + public void removeWindowModeChangeListener( + WindowModeChangeListener listener) { removeListener(WindowModeChangeEvent.class, listener, WindowModeChangeListener.windowModeChangeMethod); } protected void fireWindowWindowModeChange() { - fireEvent(new Window.WindowModeChangeEvent(this, getState().windowMode)); + fireEvent( + new Window.WindowModeChangeEvent(this, getState().windowMode)); } /** @@ -567,7 +568,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, public static class ResizeEvent extends Component.Event { /** - * + * * @param source */ public ResizeEvent(Component source) { @@ -576,7 +577,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /** * Get the window form which this event originated - * + * * @return the window */ public Window getWindow() { @@ -586,7 +587,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /** * Listener for window resize events. - * + * * @see com.vaadin.ui.Window.ResizeEvent */ public interface ResizeListener extends Serializable { @@ -595,7 +596,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /** * Add a resize listener. - * + * * @param listener */ public void addResizeListener(ResizeListener listener) { @@ -613,7 +614,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /** * Remove a resize listener. - * + * * @param listener */ public void removeResizeListener(ResizeListener listener) { @@ -680,7 +681,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, *

            * Keyboard navigation is restricted by blocking the tab key at the top and * bottom of the window by activating the tab stop function internally. - * + * * @param modal * true if modality is to be turned on */ @@ -698,7 +699,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /** * Sets window resizable. - * + * * @param resizable * true if resizability is to be turned on */ @@ -707,7 +708,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, } /** - * + * * @return true if window is resizable by the end-user, otherwise false. */ public boolean isResizable() { @@ -715,7 +716,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, } /** - * + * * @return true if a delay is used before recalculating sizes, false if * sizes are recalculated immediately. */ @@ -727,10 +728,10 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * Should resize operations be lazy, i.e. should there be a delay before * layout sizes are recalculated. Speeds up resize operations in slow UIs * with the penalty of slightly decreased usability. - * + * * Note, some browser send false resize events for the browser window and * are therefore always lazy. - * + * * @param resizeLazy * true to use a delay before recalculating sizes, false to * calculate immediately. @@ -757,12 +758,12 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * typically shows an X in the upper right corner. Clicking on the X sends a * close event to the server. Setting closable to false will remove the X * from the window and prevent the user from closing the window. - * + * * Note! For historical reasons readonly controls the closability of the * window and therefore readonly and closable affect each other. Setting * readonly to true will set closable to false and vice versa. *

            - * + * * @return true if the window can be closed by the user. */ public boolean isClosable() { @@ -774,12 +775,12 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * typically shows an X in the upper right corner. Clicking on the X sends a * close event to the server. Setting closable to false will remove the X * from the window and prevent the user from closing the window. - * + * * Note! For historical reasons readonly controls the closability of the * window and therefore readonly and closable affect each other. Setting * readonly to true will set closable to false and vice versa. *

            - * + * * @param closable * determines if the window can be closed by the user. */ @@ -791,7 +792,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * Indicates whether a window can be dragged or not. By default a window is * draggable. *

            - * + * * @param draggable * true if the window can be dragged by the user */ @@ -803,7 +804,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * Enables or disables that a window can be dragged (moved) by the user. By * default a window is draggable. *

            - * + * * @param draggable * true if the window can be dragged by the user */ @@ -813,7 +814,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /** * Gets the current mode of the window. - * + * * @see WindowMode * @return the mode of the window. */ @@ -823,7 +824,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /** * Sets the mode for the window - * + * * @see WindowMode * @param windowMode * The new mode @@ -854,13 +855,13 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * Note that this shortcut only reacts while the window has focus, closing * itself - if you want to close a window from a UI, use * {@link UI#addAction(com.vaadin.event.Action)} of the UI instead. - * + * * @param keyCode * the keycode for invoking the shortcut * @param modifiers * the (optional) modifiers for invoking the shortcut. Can be set * to null to be explicit about not having modifiers. - * + * * @deprecated Use {@link #addCloseShortcut(int, int...)} instead. */ @Deprecated @@ -881,7 +882,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * {@link #removeCloseShortcut(int,int...)}, * {@link #removeAllCloseShortcuts()}, {@link #hasCloseShortcut(int,int...)} * and {@link #getCloseShortcuts()}. - * + * * @deprecated Use {@link #removeCloseShortcut(int, int...)} instead. */ @Deprecated @@ -897,7 +898,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /** * Adds a close shortcut - pressing this key while holding down all (if any) * modifiers specified while this Window is in focus will close the Window. - * + * * @since 7.6 * @param keyCode * the keycode for invoking the shortcut @@ -921,7 +922,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /** * Removes a close shortcut previously added with * {@link #addCloseShortcut(int, int...)}. - * + * * @since 7.6 * @param keyCode * the keycode for invoking the shortcut @@ -944,7 +945,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * It is up to the user to add back any and all keyboard close shortcuts * they may require. For more fine-grained control over shortcuts, use * {@link #removeCloseShortcut(int, int...)}. - * + * * @since 7.6 */ public void removeAllCloseShortcuts() { @@ -956,7 +957,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /** * Checks if a close window shortcut key has already been registered. - * + * * @since 7.6 * @param keyCode * the keycode for invoking the shortcut @@ -980,7 +981,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * mainly so that users can implement their own serialization routines. To * check if a certain combination of keys has been registered as a close * shortcut, use the {@link #hasCloseShortcut(int, int...)} method instead. - * + * * @since 7.6 * @return an unmodifiable Collection of CloseShortcut objects. */ @@ -991,17 +992,17 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /** * A {@link ShortcutListener} specifically made to define a keyboard * shortcut that closes the window. - * + * *

                  * 
                  *  // within the window using helper
                  *  window.setCloseShortcut(KeyCode.ESCAPE, null);
            -     * 
            +     *
                  *  // or globally
                  *  getUI().addAction(new Window.CloseShortcut(window, KeyCode.ESCAPE));
                  * 
                  * 
            - * + * */ public static class CloseShortcut extends ShortcutListener { protected Window window; @@ -1009,7 +1010,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /** * Creates a keyboard shortcut for closing the given window using the * shorthand notation defined in {@link ShortcutAction}. - * + * * @param window * to be closed when the shortcut is invoked * @param shorthandCaption @@ -1023,7 +1024,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /** * Creates a keyboard shortcut for closing the given window using the * given {@link KeyCode} and {@link ModifierKey}s. - * + * * @param window * to be closed when the shortcut is invoked * @param keyCode @@ -1039,7 +1040,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /** * Creates a keyboard shortcut for closing the given window using the * given {@link KeyCode}. - * + * * @param window * to be closed when the shortcut is invoked * @param keyCode @@ -1078,7 +1079,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /* * (non-Javadoc) - * + * * @see * com.vaadin.event.FieldEvents.FocusNotifier#addFocusListener(com.vaadin * .event.FieldEvents.FocusListener) @@ -1116,7 +1117,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /* * (non-Javadoc) - * + * * @see * com.vaadin.event.FieldEvents.BlurNotifier#addBlurListener(com.vaadin. * event.FieldEvents.BlurListener) @@ -1153,7 +1154,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /** * {@inheritDoc} - * + * * Cause the window to be brought on top of other windows and gain keyboard * focus. */ @@ -1182,7 +1183,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * Allows to specify which components contain the description for the * window. Text contained in these components will be read by assistive * devices when it is opened. - * + * * @param components * the components to use as description */ @@ -1199,7 +1200,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * Gets the components that are used as assistive description. Text * contained in these components will be read by assistive devices when the * window is opened. - * + * * @return array of previously set components */ public Component[] getAssistiveDescription() { @@ -1217,10 +1218,10 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /** * Sets the accessibility prefix for the window caption. - * + * * This prefix is read to assistive device users before the window caption, * but not visible on the page. - * + * * @param prefix * String that is placed before the window caption */ @@ -1230,10 +1231,10 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /** * Gets the accessibility prefix for the window caption. - * + * * This prefix is read to assistive device users before the window caption, * but not visible on the page. - * + * * @return The accessibility prefix */ public String getAssistivePrefix() { @@ -1242,10 +1243,10 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /** * Sets the accessibility postfix for the window caption. - * + * * This postfix is read to assistive device users after the window caption, * but not visible on the page. - * + * * @param prefix * String that is placed after the window caption */ @@ -1255,10 +1256,10 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /** * Gets the accessibility postfix for the window caption. - * + * * This postfix is read to assistive device users after the window caption, * but not visible on the page. - * + * * @return The accessibility postfix */ public String getAssistivePostfix() { @@ -1267,14 +1268,14 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /** * Sets the WAI-ARIA role the window. - * + * * This role defines how an assistive device handles a window. Available - * roles are alertdialog and dialog (@see Roles + * roles are alertdialog and dialog (@see + * Roles * Model). - * + * * The default role is dialog. - * + * * @param role * WAI-ARIA role to set for the window */ @@ -1284,12 +1285,12 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /** * Gets the WAI-ARIA role the window. - * + * * This role defines how an assistive device handles a window. Available - * roles are alertdialog and dialog (@see Roles + * roles are alertdialog and dialog (@see + * Roles * Model). - * + * * @return WAI-ARIA role set for the window */ public WindowRole getAssistiveRole() { @@ -1305,7 +1306,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, *

            * For modal windows, this function is activated automatically, while * preserving the stored value of tabStop. - * + * * @param tabStop * true to keep the focus inside the window when reaching the top * or bottom, false (default) to allow leaving the window @@ -1316,7 +1317,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /** * Get if it is prevented to leave a window with the tab key. - * + * * @return true when the focus is limited to inside the window, false when * focus can leave the window */ @@ -1330,7 +1331,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * is prevented. *

            * This message is not visible on the screen. - * + * * @param topMessage * String provided when the user navigates with Shift-Tab keys to * the top of the window @@ -1345,7 +1346,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * key is prevented. *

            * This message is not visible on the screen. - * + * * @param bottomMessage * String provided when the user navigates with the Tab key to * the bottom of the window @@ -1358,7 +1359,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * Gets the message that is provided to users of assistive devices when the * user reaches the top of the window when leaving a window with the tab key * is prevented. - * + * * @return the top message */ public String getTabStopTopAssistiveText() { @@ -1369,7 +1370,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * Gets the message that is provided to users of assistive devices when the * user reaches the bottom of the window when leaving a window with the tab * key is prevented. - * + * * @return the bottom message */ public String getTabStopBottomAssistiveText() { @@ -1393,17 +1394,18 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, if (design.hasAttr("close-shortcut")) { // Parse shortcuts - String[] shortcutStrings = DesignAttributeHandler.readAttribute( - "close-shortcut", design.attributes(), String.class).split( - "\\s+"); + String[] shortcutStrings = DesignAttributeHandler + .readAttribute("close-shortcut", design.attributes(), + String.class) + .split("\\s+"); removeAllCloseShortcuts(); for (String part : shortcutStrings) { if (!part.isEmpty()) { ShortcutAction shortcut = DesignAttributeHandler - .getFormatter().parse(part.trim(), - ShortcutAction.class); + .getFormatter() + .parse(part.trim(), ShortcutAction.class); addCloseShortcut(shortcut.getKeyCode(), shortcut.getModifiers()); } @@ -1418,22 +1420,23 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * the list of components used as the assistive description of this Window. * Otherwise, sets the component as the content of this Window. If there are * multiple non-description elements, throws a DesignException. - * + * * @param children * child elements in a design * @param context * the DesignContext instance used to parse the design - * + * * @throws DesignException * if there are multiple non-description child elements * @throws DesignException * if a child element could not be parsed as a Component - * + * * @see #setContent(Component) * @see #setAssistiveDescription(Component...) */ @Override - protected void readDesignChildren(Elements children, DesignContext context) { + protected void readDesignChildren(Elements children, + DesignContext context) { List descriptions = new ArrayList(); Elements content = new Elements(); @@ -1482,8 +1485,8 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, } for (Component c : getAssistiveDescription()) { - Element child = context.createElement(c).attr( - ":assistive-description", true); + Element child = context.createElement(c) + .attr(":assistive-description", true); design.appendChild(child); } } diff --git a/server/src/main/java/com/vaadin/ui/components/calendar/CalendarComponentEvent.java b/server/src/main/java/com/vaadin/ui/components/calendar/CalendarComponentEvent.java index dfb59e148b..86d9e4951a 100644 --- a/server/src/main/java/com/vaadin/ui/components/calendar/CalendarComponentEvent.java +++ b/server/src/main/java/com/vaadin/ui/components/calendar/CalendarComponentEvent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,20 +20,20 @@ import com.vaadin.ui.Component; /** * All Calendar events extends this class. - * + * * @since 7.1 * @author Vaadin Ltd. - * + * */ @SuppressWarnings("serial") public class CalendarComponentEvent extends Component.Event { /** * Set the source of the event - * + * * @param source * The source calendar - * + * */ public CalendarComponentEvent(Calendar source) { super(source); @@ -41,7 +41,7 @@ public class CalendarComponentEvent extends Component.Event { /* * (non-Javadoc) - * + * * @see com.vaadin.ui.Component.Event#getComponent() */ @Override diff --git a/server/src/main/java/com/vaadin/ui/components/calendar/CalendarComponentEvents.java b/server/src/main/java/com/vaadin/ui/components/calendar/CalendarComponentEvents.java index f01b465dd2..1ecf18a682 100644 --- a/server/src/main/java/com/vaadin/ui/components/calendar/CalendarComponentEvents.java +++ b/server/src/main/java/com/vaadin/ui/components/calendar/CalendarComponentEvents.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -27,7 +27,7 @@ import com.vaadin.util.ReflectTools; /** * Interface for all Vaadin Calendar events. - * + * * @since 7.1.0 * @author Vaadin Ltd. */ @@ -39,7 +39,7 @@ public interface CalendarComponentEvents extends Serializable { public interface CalendarEventNotifier extends Serializable { /** * Get the assigned event handler for the given eventId. - * + * * @param eventId * @return the assigned eventHandler, or null if no handler is assigned */ @@ -53,7 +53,7 @@ public interface CalendarComponentEvents extends Serializable { /** * Set the EventMoveHandler. - * + * * @param listener * EventMoveHandler to be added */ @@ -77,7 +77,7 @@ public interface CalendarComponentEvents extends Serializable { /** * MoveEvent needs the target event and new start date. - * + * * @param source * Calendar component. * @param calendarEvent @@ -95,7 +95,7 @@ public interface CalendarComponentEvents extends Serializable { /** * Get target event. - * + * * @return Target event. */ public CalendarEvent getCalendarEvent() { @@ -104,7 +104,7 @@ public interface CalendarComponentEvents extends Serializable { /** * Get new start date. - * + * * @return New start date. */ public Date getNewStart() { @@ -114,7 +114,7 @@ public interface CalendarComponentEvents extends Serializable { /** * Handler interface for when events are being dragged on the calendar - * + * */ public interface EventMoveHandler extends EventListener, Serializable { @@ -125,7 +125,7 @@ public interface CalendarComponentEvents extends Serializable { /** * This method will be called when event has been moved to a new * position. - * + * * @param event * MoveEvent containing specific information of the new * position and target event. @@ -136,12 +136,12 @@ public interface CalendarComponentEvents extends Serializable { /** * Handler interface for day or time cell drag-marking with mouse. */ - public interface RangeSelectNotifier extends Serializable, - CalendarEventNotifier { + public interface RangeSelectNotifier + extends Serializable, CalendarEventNotifier { /** * Set the RangeSelectHandler that listens for drag-marking. - * + * * @param listener * RangeSelectHandler to be added. */ @@ -170,7 +170,7 @@ public interface CalendarComponentEvents extends Serializable { /** * RangeSelectEvent needs a start and end date. - * + * * @param source * Calendar component. * @param start @@ -190,7 +190,7 @@ public interface CalendarComponentEvents extends Serializable { /** * Get start date. - * + * * @return Start date. */ public Date getStart() { @@ -199,7 +199,7 @@ public interface CalendarComponentEvents extends Serializable { /** * Get end date. - * + * * @return End date. */ public Date getEnd() { @@ -209,9 +209,9 @@ public interface CalendarComponentEvents extends Serializable { /** * Gets the event's view mode. Calendar can be be either in monthly or * weekly mode, depending on the active date range. - * + * * @deprecated User {@link Calendar#isMonthlyMode()} instead - * + * * @return Returns true when monthly view is active. */ @Deprecated @@ -224,14 +224,14 @@ public interface CalendarComponentEvents extends Serializable { public interface RangeSelectHandler extends EventListener, Serializable { /** Trigger method for the RangeSelectEvent. */ - public static final Method rangeSelectMethod = ReflectTools - .findMethod(RangeSelectHandler.class, "rangeSelect", - RangeSelectEvent.class); + public static final Method rangeSelectMethod = ReflectTools.findMethod( + RangeSelectHandler.class, "rangeSelect", + RangeSelectEvent.class); /** * This method will be called when day or time cells are drag-marked * with mouse. - * + * * @param event * RangeSelectEvent that contains range start and end date. */ @@ -242,7 +242,7 @@ public interface CalendarComponentEvents extends Serializable { public interface NavigationNotifier extends Serializable { /** * Add a forward navigation listener. - * + * * @param handler * ForwardHandler to be added. */ @@ -250,7 +250,7 @@ public interface CalendarComponentEvents extends Serializable { /** * Add a backward navigation listener. - * + * * @param handler * BackwardHandler to be added. */ @@ -258,7 +258,7 @@ public interface CalendarComponentEvents extends Serializable { /** * Add a date click listener. - * + * * @param handler * DateClickHandler to be added. */ @@ -266,7 +266,7 @@ public interface CalendarComponentEvents extends Serializable { /** * Add a event click listener. - * + * * @param handler * EventClickHandler to be added. */ @@ -274,7 +274,7 @@ public interface CalendarComponentEvents extends Serializable { /** * Add a week click listener. - * + * * @param handler * WeekClickHandler to be added. */ @@ -291,7 +291,7 @@ public interface CalendarComponentEvents extends Serializable { /** * ForwardEvent needs only the source component. - * + * * @param source * Calendar component. */ @@ -309,7 +309,7 @@ public interface CalendarComponentEvents extends Serializable { /** * This method will be called when date range is moved forward. - * + * * @param event * ForwardEvent */ @@ -326,7 +326,7 @@ public interface CalendarComponentEvents extends Serializable { /** * BackwardEvent needs only the source source component. - * + * * @param source * Calendar component. */ @@ -344,7 +344,7 @@ public interface CalendarComponentEvents extends Serializable { /** * This method will be called when date range is moved backwards. - * + * * @param event * BackwardEvent */ @@ -370,7 +370,7 @@ public interface CalendarComponentEvents extends Serializable { /** * Get clicked date. - * + * * @return Clicked date. */ public Date getDate() { @@ -387,7 +387,7 @@ public interface CalendarComponentEvents extends Serializable { /** * This method will be called when a date is clicked. - * + * * @param event * DateClickEvent containing the target date. */ @@ -413,7 +413,7 @@ public interface CalendarComponentEvents extends Serializable { /** * Get the clicked event. - * + * * @return Clicked event. */ public CalendarEvent getCalendarEvent() { @@ -430,7 +430,7 @@ public interface CalendarComponentEvents extends Serializable { /** * This method will be called when an event is clicked. - * + * * @param event * EventClick containing the target event. */ @@ -453,7 +453,7 @@ public interface CalendarComponentEvents extends Serializable { /** * WeekClick needs a target year and week. - * + * * @param source * Target source. * @param week @@ -470,7 +470,7 @@ public interface CalendarComponentEvents extends Serializable { /** * Get week as a integer. See {@link java.util.Calendar} for the allowed * values. - * + * * @return Week as a integer. */ public int getWeek() { @@ -480,7 +480,7 @@ public interface CalendarComponentEvents extends Serializable { /** * Get year as a integer. See {@link java.util.Calendar} for the allowed * values. - * + * * @return Year as a integer */ public int getYear() { @@ -497,7 +497,7 @@ public interface CalendarComponentEvents extends Serializable { /** * This method will be called when a week is clicked. - * + * * @param event * WeekClick containing the target week and year. */ @@ -528,7 +528,7 @@ public interface CalendarComponentEvents extends Serializable { /** * Get target event. - * + * * @return Target event. */ public CalendarEvent getCalendarEvent() { @@ -537,7 +537,7 @@ public interface CalendarComponentEvents extends Serializable { /** * @deprecated Use {@link #getNewStart()} instead - * + * * @return the new start time */ @Deprecated @@ -547,7 +547,7 @@ public interface CalendarComponentEvents extends Serializable { /** * Returns the updated start date/time of the event - * + * * @return The new date for the event */ public Date getNewStart() { @@ -556,7 +556,7 @@ public interface CalendarComponentEvents extends Serializable { /** * @deprecated Use {@link #getNewEnd()} instead - * + * * @return the new end time */ @Deprecated @@ -566,7 +566,7 @@ public interface CalendarComponentEvents extends Serializable { /** * Returns the updates end date/time of the event - * + * * @return The new date for the event */ public Date getNewEnd() { @@ -581,7 +581,7 @@ public interface CalendarComponentEvents extends Serializable { /** * Set a EventResizeHandler. - * + * * @param handler * EventResizeHandler to be set */ diff --git a/server/src/main/java/com/vaadin/ui/components/calendar/CalendarDateRange.java b/server/src/main/java/com/vaadin/ui/components/calendar/CalendarDateRange.java index 18b98e1f6c..9919dba414 100644 --- a/server/src/main/java/com/vaadin/ui/components/calendar/CalendarDateRange.java +++ b/server/src/main/java/com/vaadin/ui/components/calendar/CalendarDateRange.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,10 +21,10 @@ import java.util.TimeZone; /** * Class for representing a date range. - * + * * @since 7.1.0 * @author Vaadin Ltd. - * + * */ @SuppressWarnings("serial") public class CalendarDateRange implements Serializable { @@ -37,7 +37,7 @@ public class CalendarDateRange implements Serializable { /** * Constructor - * + * * @param start * The start date and time of the date range * @param end @@ -52,7 +52,7 @@ public class CalendarDateRange implements Serializable { /** * Get the start date of the date range - * + * * @return the start Date of the range */ public Date getStart() { @@ -61,7 +61,7 @@ public class CalendarDateRange implements Serializable { /** * Get the end date of the date range - * + * * @return the end Date of the range */ public Date getEnd() { @@ -70,7 +70,7 @@ public class CalendarDateRange implements Serializable { /** * Is a date in the date range - * + * * @param date * The date to check * @return true if the date range contains a date start and end of range @@ -86,7 +86,7 @@ public class CalendarDateRange implements Serializable { /* * (non-Javadoc) - * + * * @see java.lang.Object#toString() */ @Override diff --git a/server/src/main/java/com/vaadin/ui/components/calendar/CalendarTargetDetails.java b/server/src/main/java/com/vaadin/ui/components/calendar/CalendarTargetDetails.java index 3ea6c4d8f4..76598cf79b 100644 --- a/server/src/main/java/com/vaadin/ui/components/calendar/CalendarTargetDetails.java +++ b/server/src/main/java/com/vaadin/ui/components/calendar/CalendarTargetDetails.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -28,7 +28,7 @@ import com.vaadin.ui.Calendar; * details of the drop point. Specifically, this class gives access to the date * where the drop happened. If the Calendar was in weekly mode, the date also * includes the start time of the slot. - * + * * @since 7.1 * @author Vaadin Ltd. */ @@ -52,7 +52,7 @@ public class CalendarTargetDetails extends TargetDetailsImpl { /** * Does the dropped item have a time associated with it - * + * * @param hasDropTime */ public void setHasDropTime(boolean hasDropTime) { diff --git a/server/src/main/java/com/vaadin/ui/components/calendar/ContainerEventProvider.java b/server/src/main/java/com/vaadin/ui/components/calendar/ContainerEventProvider.java index 2f51b21f7c..f9e4db0510 100644 --- a/server/src/main/java/com/vaadin/ui/components/calendar/ContainerEventProvider.java +++ b/server/src/main/java/com/vaadin/ui/components/calendar/ContainerEventProvider.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -43,17 +43,17 @@ import com.vaadin.ui.components.calendar.event.CalendarEventProvider.EventSetCha /** * A event provider which uses a {@link Container} as a datasource. Container * used as data source. - * + * * NOTE: The data source must be sorted by date! - * + * * @since 7.1.0 * @author Vaadin Ltd. */ @SuppressWarnings("serial") -public class ContainerEventProvider implements CalendarEditableEventProvider, - EventSetChangeNotifier, EventChangeNotifier, EventMoveHandler, - EventResizeHandler, Container.ItemSetChangeListener, - Property.ValueChangeListener { +public class ContainerEventProvider + implements CalendarEditableEventProvider, EventSetChangeNotifier, + EventChangeNotifier, EventMoveHandler, EventResizeHandler, + Container.ItemSetChangeListener, Property.ValueChangeListener { // Default property ids public static final String CAPTION_PROPERTY = "caption"; @@ -66,7 +66,7 @@ public class ContainerEventProvider implements CalendarEditableEventProvider, /** * Internal class to keep the container index which item this event * represents - * + * */ private class ContainerCalendarEvent extends BasicEvent { private final int index; @@ -111,7 +111,7 @@ public class ContainerEventProvider implements CalendarEditableEventProvider, /** * Constructor - * + * * @param container * Container to use as a data source. */ @@ -122,10 +122,10 @@ public class ContainerEventProvider implements CalendarEditableEventProvider, /** * Set the container data source - * + * * @param container * The container to use as datasource - * + * */ public void setContainerDataSource(Container.Indexed container) { // Detach the previous container @@ -137,7 +137,7 @@ public class ContainerEventProvider implements CalendarEditableEventProvider, /** * Returns the container used as data source - * + * */ public Container.Indexed getContainerDataSource() { return container; @@ -170,7 +170,7 @@ public class ContainerEventProvider implements CalendarEditableEventProvider, /** * Converts an event in the container to an {@link CalendarEvent} - * + * * @param index * The index of the item in the container to get the event for * @return @@ -180,7 +180,8 @@ public class ContainerEventProvider implements CalendarEditableEventProvider, // Check the event cache first for (CalendarEvent e : eventCache) { if (e instanceof ContainerCalendarEvent - && ((ContainerCalendarEvent) e).getContainerIndex() == index) { + && ((ContainerCalendarEvent) e) + .getContainerIndex() == index) { return e; } else if (container.getIdByIndex(index) == e) { return e; @@ -206,18 +207,18 @@ public class ContainerEventProvider implements CalendarEditableEventProvider, // Set values from property values if (captionProperty != null && item.getItemPropertyIds().contains(captionProperty)) { - basicEvent.setCaption(String.valueOf(item.getItemProperty( - captionProperty).getValue())); + basicEvent.setCaption(String.valueOf( + item.getItemProperty(captionProperty).getValue())); } - if (descriptionProperty != null - && item.getItemPropertyIds().contains(descriptionProperty)) { - basicEvent.setDescription(String.valueOf(item.getItemProperty( - descriptionProperty).getValue())); + if (descriptionProperty != null && item.getItemPropertyIds() + .contains(descriptionProperty)) { + basicEvent.setDescription(String.valueOf( + item.getItemProperty(descriptionProperty).getValue())); } if (startDateProperty != null && item.getItemPropertyIds().contains(startDateProperty)) { - basicEvent.setStart((Date) item.getItemProperty( - startDateProperty).getValue()); + basicEvent.setStart((Date) item + .getItemProperty(startDateProperty).getValue()); } if (endDateProperty != null && item.getItemPropertyIds().contains(endDateProperty)) { @@ -226,13 +227,13 @@ public class ContainerEventProvider implements CalendarEditableEventProvider, } if (styleNameProperty != null && item.getItemPropertyIds().contains(styleNameProperty)) { - basicEvent.setStyleName(String.valueOf(item.getItemProperty( - styleNameProperty).getValue())); + basicEvent.setStyleName(String.valueOf( + item.getItemProperty(styleNameProperty).getValue())); } if (allDayProperty != null && item.getItemPropertyIds().contains(allDayProperty)) { - basicEvent.setAllDay((Boolean) item.getItemProperty( - allDayProperty).getValue()); + basicEvent.setAllDay((Boolean) item + .getItemProperty(allDayProperty).getValue()); } event = basicEvent; } @@ -241,7 +242,7 @@ public class ContainerEventProvider implements CalendarEditableEventProvider, /* * (non-Javadoc) - * + * * @see * com.vaadin.addon.calendar.event.CalendarEventProvider#getEvents(java. * util.Date, java.util.Date) @@ -264,8 +265,8 @@ public class ContainerEventProvider implements CalendarEditableEventProvider, } } if (add && endDate != null) { - Date eventStart = (Date) item - .getItemProperty(startDateProperty).getValue(); + Date eventStart = (Date) item.getItemProperty(startDateProperty) + .getValue(); if (eventStart.compareTo(endDate) >= 0) { break; // because container is sorted, all further events // will be even later @@ -280,9 +281,9 @@ public class ContainerEventProvider implements CalendarEditableEventProvider, /* * (non-Javadoc) - * - * @see - * com.vaadin.addon.calendar.event.CalendarEventProvider.EventSetChangeNotifier + * + * @see com.vaadin.addon.calendar.event.CalendarEventProvider. + * EventSetChangeNotifier * #addListener(com.vaadin.addon.calendar.event.CalendarEventProvider. * EventSetChangeListener) */ @@ -295,9 +296,9 @@ public class ContainerEventProvider implements CalendarEditableEventProvider, /* * (non-Javadoc) - * - * @see - * com.vaadin.addon.calendar.event.CalendarEventProvider.EventSetChangeNotifier + * + * @see com.vaadin.addon.calendar.event.CalendarEventProvider. + * EventSetChangeNotifier * #removeListener(com.vaadin.addon.calendar.event.CalendarEventProvider. * EventSetChangeListener) */ @@ -308,9 +309,9 @@ public class ContainerEventProvider implements CalendarEditableEventProvider, /* * (non-Javadoc) - * - * @see - * com.vaadin.addon.calendar.event.CalendarEvent.EventChangeNotifier#addListener + * + * @see com.vaadin.addon.calendar.event.CalendarEvent.EventChangeNotifier# + * addListener * (com.vaadin.addon.calendar.event.CalendarEvent.EventChangeListener) */ @Override @@ -322,7 +323,7 @@ public class ContainerEventProvider implements CalendarEditableEventProvider, /* * (non-Javadoc) - * + * * @see com.vaadin.addon.calendar.event.CalendarEvent.EventChangeNotifier# * removeListener * (com.vaadin.addon.calendar.event.CalendarEvent.EventChangeListener) @@ -422,7 +423,7 @@ public class ContainerEventProvider implements CalendarEditableEventProvider, /* * (non-Javadoc) - * + * * @see * com.vaadin.data.Container.ItemSetChangeListener#containerItemSetChange * (com.vaadin.data.Container.ItemSetChangeEvent) @@ -439,7 +440,7 @@ public class ContainerEventProvider implements CalendarEditableEventProvider, /* * (non-Javadoc) - * + * * @see * com.vaadin.data.Property.ValueChangeListener#valueChange(com.vaadin.data * .Property.ValueChangeEvent) @@ -455,7 +456,7 @@ public class ContainerEventProvider implements CalendarEditableEventProvider, /* * (non-Javadoc) - * + * * @see * com.vaadin.addon.calendar.ui.CalendarComponentEvents.EventMoveHandler * #eventMove @@ -477,8 +478,8 @@ public class ContainerEventProvider implements CalendarEditableEventProvider, ignoreContainerEvents(); Item item = container.getItem(container.getIdByIndex(index)); - item.getItemProperty(startDateProperty).setValue( - event.getNewStart()); + item.getItemProperty(startDateProperty) + .setValue(event.getNewStart()); item.getItemProperty(endDateProperty).setValue(newEnd); listenToContainerEvents(); } @@ -486,7 +487,7 @@ public class ContainerEventProvider implements CalendarEditableEventProvider, /* * (non-Javadoc) - * + * * @see * com.vaadin.addon.calendar.ui.CalendarComponentEvents.EventResizeHandler * #eventResize @@ -504,8 +505,8 @@ public class ContainerEventProvider implements CalendarEditableEventProvider, } ignoreContainerEvents(); Item item = container.getItem(container.getIdByIndex(index)); - item.getItemProperty(startDateProperty).setValue( - event.getNewStart()); + item.getItemProperty(startDateProperty) + .setValue(event.getNewStart()); item.getItemProperty(endDateProperty).setValue(event.getNewEnd()); listenToContainerEvents(); } @@ -523,7 +524,7 @@ public class ContainerEventProvider implements CalendarEditableEventProvider, /* * (non-Javadoc) - * + * * @see * com.vaadin.addon.calendar.event.CalendarEditableEventProvider#addEvent * (com.vaadin.addon.calendar.event.CalendarEvent) @@ -539,21 +540,21 @@ public class ContainerEventProvider implements CalendarEditableEventProvider, item = container.getItem(container.addItem()); } if (item != null) { - item.getItemProperty(getCaptionProperty()).setValue( - event.getCaption()); - item.getItemProperty(getStartDateProperty()).setValue( - event.getStart()); + item.getItemProperty(getCaptionProperty()) + .setValue(event.getCaption()); + item.getItemProperty(getStartDateProperty()) + .setValue(event.getStart()); item.getItemProperty(getEndDateProperty()).setValue(event.getEnd()); - item.getItemProperty(getStyleNameProperty()).setValue( - event.getStyleName()); - item.getItemProperty(getDescriptionProperty()).setValue( - event.getDescription()); + item.getItemProperty(getStyleNameProperty()) + .setValue(event.getStyleName()); + item.getItemProperty(getDescriptionProperty()) + .setValue(event.getDescription()); } } /* * (non-Javadoc) - * + * * @see * com.vaadin.addon.calendar.event.CalendarEditableEventProvider#removeEvent * (com.vaadin.addon.calendar.event.CalendarEvent) diff --git a/server/src/main/java/com/vaadin/ui/components/calendar/event/BasicEvent.java b/server/src/main/java/com/vaadin/ui/components/calendar/event/BasicEvent.java index a1ccad2712..fe734d1246 100644 --- a/server/src/main/java/com/vaadin/ui/components/calendar/event/BasicEvent.java +++ b/server/src/main/java/com/vaadin/ui/components/calendar/event/BasicEvent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -22,10 +22,10 @@ import java.util.List; import com.vaadin.ui.components.calendar.event.CalendarEvent.EventChangeNotifier; /** - * Simple implementation of - * {@link com.vaadin.addon.calendar.event.CalendarEvent CalendarEvent}. Has - * setters for all required fields and fires events when this event is changed. - * + * Simple implementation of {@link com.vaadin.addon.calendar.event.CalendarEvent + * CalendarEvent}. Has setters for all required fields and fires events when + * this event is changed. + * * @since 7.1.0 * @author Vaadin Ltd. */ @@ -50,7 +50,7 @@ public class BasicEvent implements EditableCalendarEvent, EventChangeNotifier { /** * Constructor for creating an event with the same start and end date - * + * * @param caption * The caption for the event * @param description @@ -68,7 +68,7 @@ public class BasicEvent implements EditableCalendarEvent, EventChangeNotifier { /** * Constructor for creating an event with a start date and an end date. * Start date should be before the end date - * + * * @param caption * The caption for the event * @param description @@ -88,7 +88,7 @@ public class BasicEvent implements EditableCalendarEvent, EventChangeNotifier { /* * (non-Javadoc) - * + * * @see com.vaadin.addon.calendar.event.CalendarEvent#getCaption() */ @Override @@ -98,7 +98,7 @@ public class BasicEvent implements EditableCalendarEvent, EventChangeNotifier { /* * (non-Javadoc) - * + * * @see com.vaadin.addon.calendar.event.CalendarEvent#getDescription() */ @Override @@ -108,7 +108,7 @@ public class BasicEvent implements EditableCalendarEvent, EventChangeNotifier { /* * (non-Javadoc) - * + * * @see com.vaadin.addon.calendar.event.CalendarEvent#getEnd() */ @Override @@ -118,7 +118,7 @@ public class BasicEvent implements EditableCalendarEvent, EventChangeNotifier { /* * (non-Javadoc) - * + * * @see com.vaadin.addon.calendar.event.CalendarEvent#getStart() */ @Override @@ -128,7 +128,7 @@ public class BasicEvent implements EditableCalendarEvent, EventChangeNotifier { /* * (non-Javadoc) - * + * * @see com.vaadin.addon.calendar.event.CalendarEvent#getStyleName() */ @Override @@ -138,7 +138,7 @@ public class BasicEvent implements EditableCalendarEvent, EventChangeNotifier { /* * (non-Javadoc) - * + * * @see com.vaadin.addon.calendar.event.CalendarEvent#isAllDay() */ @Override @@ -148,7 +148,7 @@ public class BasicEvent implements EditableCalendarEvent, EventChangeNotifier { /* * (non-Javadoc) - * + * * @see * com.vaadin.addon.calendar.event.CalendarEventEditor#setCaption(java.lang * .String) @@ -161,7 +161,7 @@ public class BasicEvent implements EditableCalendarEvent, EventChangeNotifier { /* * (non-Javadoc) - * + * * @see * com.vaadin.addon.calendar.event.CalendarEventEditor#setDescription(java * .lang.String) @@ -174,7 +174,7 @@ public class BasicEvent implements EditableCalendarEvent, EventChangeNotifier { /* * (non-Javadoc) - * + * * @see * com.vaadin.addon.calendar.event.CalendarEventEditor#setEnd(java.util. * Date) @@ -187,7 +187,7 @@ public class BasicEvent implements EditableCalendarEvent, EventChangeNotifier { /* * (non-Javadoc) - * + * * @see * com.vaadin.addon.calendar.event.CalendarEventEditor#setStart(java.util * .Date) @@ -200,7 +200,7 @@ public class BasicEvent implements EditableCalendarEvent, EventChangeNotifier { /* * (non-Javadoc) - * + * * @see * com.vaadin.addon.calendar.event.CalendarEventEditor#setStyleName(java * .lang.String) @@ -213,7 +213,7 @@ public class BasicEvent implements EditableCalendarEvent, EventChangeNotifier { /* * (non-Javadoc) - * + * * @see * com.vaadin.addon.calendar.event.CalendarEventEditor#setAllDay(boolean) */ @@ -225,7 +225,7 @@ public class BasicEvent implements EditableCalendarEvent, EventChangeNotifier { /* * (non-Javadoc) - * + * * @see * com.vaadin.addon.calendar.ui.CalendarComponentEvents.EventChangeNotifier * #addListener @@ -239,7 +239,7 @@ public class BasicEvent implements EditableCalendarEvent, EventChangeNotifier { /* * (non-Javadoc) - * + * * @see * com.vaadin.addon.calendar.ui.CalendarComponentEvents.EventChangeNotifier * #removeListener diff --git a/server/src/main/java/com/vaadin/ui/components/calendar/event/BasicEventProvider.java b/server/src/main/java/com/vaadin/ui/components/calendar/event/BasicEventProvider.java index 9fa6baadad..d9006ae570 100644 --- a/server/src/main/java/com/vaadin/ui/components/calendar/event/BasicEventProvider.java +++ b/server/src/main/java/com/vaadin/ui/components/calendar/event/BasicEventProvider.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -29,7 +29,7 @@ import com.vaadin.ui.components.calendar.event.CalendarEventProvider.EventSetCha * CalendarEventProvider}. Use {@link #addEvent(CalendarEvent)} and * {@link #removeEvent(CalendarEvent)} to add / remove events. *

            - * + * *

            * {@link com.vaadin.addon.calendar.event.CalendarEventProvider.EventSetChangeNotifier * EventSetChangeNotifier} and @@ -37,7 +37,7 @@ import com.vaadin.ui.components.calendar.event.CalendarEventProvider.EventSetCha * EventChangeListener} are also implemented, so the Calendar is notified when * an event is added, changed or removed. *

            - * + * * @since 7.1.0 * @author Vaadin Ltd. */ @@ -51,7 +51,7 @@ public class BasicEventProvider implements CalendarEditableEventProvider, /* * (non-Javadoc) - * + * * @see * com.vaadin.addon.calendar.event.CalendarEventProvider#getEvents(java. * util.Date, java.util.Date) @@ -81,7 +81,7 @@ public class BasicEventProvider implements CalendarEditableEventProvider, /** * Does this event provider container this event - * + * * @param event * The event to check for * @return If this provider has the event then true is returned, else false @@ -92,12 +92,11 @@ public class BasicEventProvider implements CalendarEditableEventProvider, /* * (non-Javadoc) - * - * @see - * com.vaadin.addon.calendar.ui.CalendarComponentEvents.EventSetChangeNotifier - * #addListener - * (com.vaadin.addon.calendar.ui.CalendarComponentEvents.EventSetChangeListener - * ) + * + * @see com.vaadin.addon.calendar.ui.CalendarComponentEvents. + * EventSetChangeNotifier #addListener + * (com.vaadin.addon.calendar.ui.CalendarComponentEvents. + * EventSetChangeListener ) */ @Override public void addEventSetChangeListener(EventSetChangeListener listener) { @@ -107,12 +106,11 @@ public class BasicEventProvider implements CalendarEditableEventProvider, /* * (non-Javadoc) - * - * @see - * com.vaadin.addon.calendar.ui.CalendarComponentEvents.EventSetChangeNotifier - * #removeListener - * (com.vaadin.addon.calendar.ui.CalendarComponentEvents.EventSetChangeListener - * ) + * + * @see com.vaadin.addon.calendar.ui.CalendarComponentEvents. + * EventSetChangeNotifier #removeListener + * (com.vaadin.addon.calendar.ui.CalendarComponentEvents. + * EventSetChangeListener ) */ @Override public void removeEventSetChangeListener(EventSetChangeListener listener) { @@ -133,7 +131,7 @@ public class BasicEventProvider implements CalendarEditableEventProvider, /* * (non-Javadoc) - * + * * @see * com.vaadin.addon.calendar.ui.CalendarComponentEvents.EventChangeListener * #eventChange @@ -147,7 +145,7 @@ public class BasicEventProvider implements CalendarEditableEventProvider, /* * (non-Javadoc) - * + * * @see * com.vaadin.addon.calendar.event.CalendarEditableEventProvider#addEvent * (com.vaadin.addon.calendar.event.CalendarEvent) @@ -163,7 +161,7 @@ public class BasicEventProvider implements CalendarEditableEventProvider, /* * (non-Javadoc) - * + * * @see * com.vaadin.addon.calendar.event.CalendarEditableEventProvider#removeEvent * (com.vaadin.addon.calendar.event.CalendarEvent) diff --git a/server/src/main/java/com/vaadin/ui/components/calendar/event/CalendarEditableEventProvider.java b/server/src/main/java/com/vaadin/ui/components/calendar/event/CalendarEditableEventProvider.java index 920600368e..d161f0d0c7 100644 --- a/server/src/main/java/com/vaadin/ui/components/calendar/event/CalendarEditableEventProvider.java +++ b/server/src/main/java/com/vaadin/ui/components/calendar/event/CalendarEditableEventProvider.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -18,7 +18,7 @@ package com.vaadin.ui.components.calendar.event; /** * An event provider which allows adding and removing events - * + * * @since 7.1.0 * @author Vaadin Ltd. */ @@ -26,7 +26,7 @@ public interface CalendarEditableEventProvider extends CalendarEventProvider { /** * Adds an event to the event provider - * + * * @param event * The event to add */ @@ -34,7 +34,7 @@ public interface CalendarEditableEventProvider extends CalendarEventProvider { /** * Removes an event from the event provider - * + * * @param event * The event */ diff --git a/server/src/main/java/com/vaadin/ui/components/calendar/event/CalendarEvent.java b/server/src/main/java/com/vaadin/ui/components/calendar/event/CalendarEvent.java index 2ad8c777ff..93592e2ea5 100644 --- a/server/src/main/java/com/vaadin/ui/components/calendar/event/CalendarEvent.java +++ b/server/src/main/java/com/vaadin/ui/components/calendar/event/CalendarEvent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -23,42 +23,42 @@ import java.util.Date; * Event in the calendar. Customize your own event by implementing this * interface. *

            - * + * *
          • Start and end fields are mandatory.
          • - * + * *
          • In "allDay" events longer than one day, starting and ending clock times * are omitted in UI and only dates are shown.
          • - * + * * @since 7.1.0 * @author Vaadin Ltd. - * + * */ public interface CalendarEvent extends Serializable { /** * Gets start date of event. - * + * * @return Start date. */ public Date getStart(); /** * Get end date of event. - * + * * @return End date; */ public Date getEnd(); /** * Gets caption of event. - * + * * @return Caption text */ public String getCaption(); /** * Gets description of event. Shown as a tooltip over the event. - * + * * @return Description text. */ public String getDescription(); @@ -68,13 +68,14 @@ public interface CalendarEvent extends Serializable { * Gets style name of event. In the client, style name will be set to the * event's element class name and can be styled by CSS *

            - * Styling example:
            Java code:
            + * Styling example:
            + * Java code:
            * event.setStyleName("color1"); *

            * CSS:
            * .v-calendar-event-color1 {
            *    background-color: #9effae;
            }
            - * + * * @return Style name. */ public String getStyleName(); @@ -83,7 +84,7 @@ public interface CalendarEvent extends Serializable { * An all-day event typically does not occur at a specific time but targets * a whole day or days. The rendering of all-day events differs from normal * events. - * + * * @return true if this event is an all-day event, false otherwise */ public boolean isAllDay(); @@ -128,7 +129,7 @@ public interface CalendarEvent extends Serializable { /** * Add a listener to listen for EventChangeEvents. These events are * fired when a events properties are changed. - * + * * @param listener * The listener to add */ @@ -136,7 +137,7 @@ public interface CalendarEvent extends Serializable { /** * Remove a listener from the event provider. - * + * * @param listener * The listener to remove */ diff --git a/server/src/main/java/com/vaadin/ui/components/calendar/event/CalendarEventProvider.java b/server/src/main/java/com/vaadin/ui/components/calendar/event/CalendarEventProvider.java index 2a8ec7e834..802242d2d7 100644 --- a/server/src/main/java/com/vaadin/ui/components/calendar/event/CalendarEventProvider.java +++ b/server/src/main/java/com/vaadin/ui/components/calendar/event/CalendarEventProvider.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -22,7 +22,7 @@ import java.util.List; /** * Interface for querying events. The Vaadin Calendar always has a * CalendarEventProvider set. - * + * * @since 7.1.0 * @author Vaadin Ltd. */ @@ -34,14 +34,14 @@ public interface CalendarEventProvider extends Serializable { * shown, which is not guaranteed to be the same as the date range that is * set. *

            - * + * *

            * For example, if you set the date range to be monday 22.2.2010 - wednesday * 24.2.2010, the used Event Provider will be queried for events between * monday 22.2.2010 00:00 and sunday 28.2.2010 23:59. Generally you can * expect the date range to be expanded to whole days and whole weeks. *

            - * + * * @param startDate * Start date * @param endDate @@ -55,7 +55,7 @@ public interface CalendarEventProvider extends Serializable { * should refresh its view from the * {@link com.vaadin.addon.calendar.event.CalendarEventProvider * CalendarEventProvider} . - * + * */ @SuppressWarnings("serial") public class EventSetChangeEvent implements Serializable { @@ -95,7 +95,7 @@ public interface CalendarEventProvider extends Serializable { /** * Add a listener for listening to when new events are adding or removed * from the event provider. - * + * * @param listener * The listener to add */ @@ -103,7 +103,7 @@ public interface CalendarEventProvider extends Serializable { /** * Remove a listener which listens to {@link EventSetChangeEvent}-events - * + * * @param listener * The listener to remove */ diff --git a/server/src/main/java/com/vaadin/ui/components/calendar/event/EditableCalendarEvent.java b/server/src/main/java/com/vaadin/ui/components/calendar/event/EditableCalendarEvent.java index df708697b8..9ff136c3ce 100644 --- a/server/src/main/java/com/vaadin/ui/components/calendar/event/EditableCalendarEvent.java +++ b/server/src/main/java/com/vaadin/ui/components/calendar/event/EditableCalendarEvent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,13 +25,13 @@ import java.util.Date; * CalendarEvent} fields. For descriptions on the fields, refer to the extended * interface. *

            - * + * *

            * This interface is used by some of the basic Calendar event handlers in the * com.vaadin.addon.calendar.ui.handler package to determine * whether an event can be edited. *

            - * + * * @since 7.1 * @author Vaadin Ltd. */ @@ -39,7 +39,7 @@ public interface EditableCalendarEvent extends CalendarEvent { /** * Set the visible text in the calendar for the event. - * + * * @param caption * The text to show in the calendar */ @@ -48,7 +48,7 @@ public interface EditableCalendarEvent extends CalendarEvent { /** * Set the description of the event. This is shown in the calendar when * hoovering over the event. - * + * * @param description * The text which describes the event */ @@ -56,7 +56,7 @@ public interface EditableCalendarEvent extends CalendarEvent { /** * Set the end date of the event. Must be after the start date. - * + * * @param end * The end date to set */ @@ -64,7 +64,7 @@ public interface EditableCalendarEvent extends CalendarEvent { /** * Set the start date for the event. Must be before the end date - * + * * @param start * The start date of the event */ @@ -72,16 +72,16 @@ public interface EditableCalendarEvent extends CalendarEvent { /** * Set the style name for the event used for styling the event cells - * + * * @param styleName * The stylename to use - * + * */ void setStyleName(String styleName); /** * Does the event span the whole day. If so then set this to true - * + * * @param isAllDay * True if the event spans the whole day. In this case the start * and end times are ignored. diff --git a/server/src/main/java/com/vaadin/ui/components/calendar/handler/BasicBackwardHandler.java b/server/src/main/java/com/vaadin/ui/components/calendar/handler/BasicBackwardHandler.java index 0e99b26856..db8cc3627e 100644 --- a/server/src/main/java/com/vaadin/ui/components/calendar/handler/BasicBackwardHandler.java +++ b/server/src/main/java/com/vaadin/ui/components/calendar/handler/BasicBackwardHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -24,7 +24,7 @@ import com.vaadin.ui.components.calendar.CalendarComponentEvents.BackwardHandler /** * Implements basic functionality needed to enable backwards navigation. - * + * * @since 7.1 * @author Vaadin Ltd. */ @@ -33,7 +33,7 @@ public class BasicBackwardHandler implements BackwardHandler { /* * (non-Javadoc) - * + * * @see * com.vaadin.addon.calendar.ui.CalendarComponentEvents.BackwardHandler# * backward @@ -45,7 +45,8 @@ public class BasicBackwardHandler implements BackwardHandler { Date end = event.getComponent().getEndDate(); // calculate amount to move back - int durationInDays = (int) (((end.getTime()) - start.getTime()) / DateConstants.DAYINMILLIS); + int durationInDays = (int) (((end.getTime()) - start.getTime()) + / DateConstants.DAYINMILLIS); durationInDays++; // for week view durationInDays = -7, for day view durationInDays = -1 durationInDays = -durationInDays; @@ -80,7 +81,7 @@ public class BasicBackwardHandler implements BackwardHandler { /** * Set the start and end dates for the event - * + * * @param event * The event that the start and end dates should be set * @param start diff --git a/server/src/main/java/com/vaadin/ui/components/calendar/handler/BasicDateClickHandler.java b/server/src/main/java/com/vaadin/ui/components/calendar/handler/BasicDateClickHandler.java index 8d366ed52f..a42d741b04 100644 --- a/server/src/main/java/com/vaadin/ui/components/calendar/handler/BasicDateClickHandler.java +++ b/server/src/main/java/com/vaadin/ui/components/calendar/handler/BasicDateClickHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -24,7 +24,7 @@ import com.vaadin.ui.components.calendar.CalendarComponentEvents.DateClickHandle /** * Implements basic functionality needed to switch to day view when a single day * is clicked. - * + * * @since 7.1 * @author Vaadin Ltd. */ @@ -33,7 +33,7 @@ public class BasicDateClickHandler implements DateClickHandler { /* * (non-Javadoc) - * + * * @see * com.vaadin.addon.calendar.ui.CalendarComponentEvents.DateClickHandler * #dateClick @@ -55,7 +55,7 @@ public class BasicDateClickHandler implements DateClickHandler { /** * Set the start and end dates for the event - * + * * @param event * The event that the start and end dates should be set * @param start diff --git a/server/src/main/java/com/vaadin/ui/components/calendar/handler/BasicEventMoveHandler.java b/server/src/main/java/com/vaadin/ui/components/calendar/handler/BasicEventMoveHandler.java index 418e03d24a..b9f2758f1d 100644 --- a/server/src/main/java/com/vaadin/ui/components/calendar/handler/BasicEventMoveHandler.java +++ b/server/src/main/java/com/vaadin/ui/components/calendar/handler/BasicEventMoveHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -24,7 +24,7 @@ import com.vaadin.ui.components.calendar.event.EditableCalendarEvent; /** * Implements basic functionality needed to enable moving events. - * + * * @since 7.1 * @author Vaadin Ltd. */ @@ -33,7 +33,7 @@ public class BasicEventMoveHandler implements EventMoveHandler { /* * (non-Javadoc) - * + * * @see * com.vaadin.addon.calendar.ui.CalendarComponentEvents.EventMoveHandler * #eventMove @@ -52,14 +52,14 @@ public class BasicEventMoveHandler implements EventMoveHandler { // Update event dates long length = editableEvent.getEnd().getTime() - editableEvent.getStart().getTime(); - setDates(editableEvent, newFromTime, new Date(newFromTime.getTime() - + length)); + setDates(editableEvent, newFromTime, + new Date(newFromTime.getTime() + length)); } } /** * Set the start and end dates for the event - * + * * @param event * The event that the start and end dates should be set * @param start diff --git a/server/src/main/java/com/vaadin/ui/components/calendar/handler/BasicEventResizeHandler.java b/server/src/main/java/com/vaadin/ui/components/calendar/handler/BasicEventResizeHandler.java index 6141c84c5b..96055fa3b6 100644 --- a/server/src/main/java/com/vaadin/ui/components/calendar/handler/BasicEventResizeHandler.java +++ b/server/src/main/java/com/vaadin/ui/components/calendar/handler/BasicEventResizeHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -24,7 +24,7 @@ import com.vaadin.ui.components.calendar.event.EditableCalendarEvent; /** * Implements basic functionality needed to enable event resizing. - * + * * @since 7.1 * @author Vaadin Ltd. */ @@ -33,7 +33,7 @@ public class BasicEventResizeHandler implements EventResizeHandler { /* * (non-Javadoc) - * + * * @see * com.vaadin.addon.calendar.ui.CalendarComponentEvents.EventResizeHandler * #eventResize @@ -55,7 +55,7 @@ public class BasicEventResizeHandler implements EventResizeHandler { /** * Set the start and end dates for the event - * + * * @param event * The event that the start and end dates should be set * @param start diff --git a/server/src/main/java/com/vaadin/ui/components/calendar/handler/BasicForwardHandler.java b/server/src/main/java/com/vaadin/ui/components/calendar/handler/BasicForwardHandler.java index 45b44cb673..242ceca573 100644 --- a/server/src/main/java/com/vaadin/ui/components/calendar/handler/BasicForwardHandler.java +++ b/server/src/main/java/com/vaadin/ui/components/calendar/handler/BasicForwardHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -24,7 +24,7 @@ import com.vaadin.ui.components.calendar.CalendarComponentEvents.ForwardHandler; /** * Implements basic functionality needed to enable forward navigation. - * + * * @since 7.1 * @author Vaadin Ltd. */ @@ -33,9 +33,9 @@ public class BasicForwardHandler implements ForwardHandler { /* * (non-Javadoc) - * - * @see - * com.vaadin.addon.calendar.ui.CalendarComponentEvents.ForwardHandler#forward + * + * @see com.vaadin.addon.calendar.ui.CalendarComponentEvents.ForwardHandler# + * forward * (com.vaadin.addon.calendar.ui.CalendarComponentEvents.ForwardEvent) */ @Override @@ -44,7 +44,8 @@ public class BasicForwardHandler implements ForwardHandler { Date end = event.getComponent().getEndDate(); // calculate amount to move forward - int durationInDays = (int) (((end.getTime()) - start.getTime()) / DateConstants.DAYINMILLIS); + int durationInDays = (int) (((end.getTime()) - start.getTime()) + / DateConstants.DAYINMILLIS); // for week view durationInDays = 7, for day view durationInDays = 1 durationInDays++; @@ -78,7 +79,7 @@ public class BasicForwardHandler implements ForwardHandler { /** * Set the start and end dates for the event - * + * * @param event * The event that the start and end dates should be set * @param start diff --git a/server/src/main/java/com/vaadin/ui/components/calendar/handler/BasicWeekClickHandler.java b/server/src/main/java/com/vaadin/ui/components/calendar/handler/BasicWeekClickHandler.java index c52d0a5a82..824204f632 100644 --- a/server/src/main/java/com/vaadin/ui/components/calendar/handler/BasicWeekClickHandler.java +++ b/server/src/main/java/com/vaadin/ui/components/calendar/handler/BasicWeekClickHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,7 +25,7 @@ import com.vaadin.ui.components.calendar.CalendarComponentEvents.WeekClickHandle /** * Implements basic functionality needed to change to week view when a week * number is clicked. - * + * * @since 7.1 * @author Vaadin Ltd. */ @@ -34,7 +34,7 @@ public class BasicWeekClickHandler implements WeekClickHandler { /* * (non-Javadoc) - * + * * @see * com.vaadin.addon.calendar.ui.CalendarComponentEvents.WeekClickHandler * #weekClick @@ -66,7 +66,7 @@ public class BasicWeekClickHandler implements WeekClickHandler { /** * Set the start and end dates for the event - * + * * @param event * The event that the start and end dates should be set * @param start diff --git a/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorChangeEvent.java b/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorChangeEvent.java index b55b55357f..b94c267b47 100644 --- a/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorChangeEvent.java +++ b/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorChangeEvent.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -22,7 +22,7 @@ import com.vaadin.ui.Component.Event; /** * The color changed event which is passed to the listeners when a color change * occurs. - * + * * @since 7.0.0 */ public class ColorChangeEvent extends Event { diff --git a/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorChangeListener.java b/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorChangeListener.java index 6db148989c..316935a727 100644 --- a/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorChangeListener.java +++ b/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorChangeListener.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -24,16 +24,16 @@ import java.io.Serializable; * component using the component's addColorChangeListener method. * When the colorChange event occurs, that object's appropriate method is * invoked. - * + * * @since 7.0.0 - * + * * @see ColorChangeEvent */ public interface ColorChangeListener extends Serializable { /** * Called when a new color has been selected. - * + * * @param event * An event containing information about the color change. */ diff --git a/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerGradient.java b/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerGradient.java index 81b178e4f0..7bdf7afcdc 100644 --- a/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerGradient.java +++ b/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerGradient.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,11 +25,11 @@ import com.vaadin.ui.AbstractComponent; /** * A component that represents a color gradient within a color picker. - * + * * @since 7.0.0 */ -public class ColorPickerGradient extends AbstractComponent implements - ColorSelector { +public class ColorPickerGradient extends AbstractComponent + implements ColorSelector { private static final Method COLOR_CHANGE_METHOD; static { @@ -77,7 +77,7 @@ public class ColorPickerGradient extends AbstractComponent implements /** * Instantiates a new color picker gradient. - * + * * @param id * the id * @param converter @@ -114,7 +114,7 @@ public class ColorPickerGradient extends AbstractComponent implements /** * Sets the background color. - * + * * @param color * the new background color */ @@ -129,7 +129,7 @@ public class ColorPickerGradient extends AbstractComponent implements /** * Notifies the listeners that the color has changed - * + * * @param color * The color which it changed to */ diff --git a/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerGrid.java b/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerGrid.java index 002f36d99d..41c1cacf36 100644 --- a/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerGrid.java +++ b/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerGrid.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -27,10 +27,11 @@ import com.vaadin.ui.AbstractComponent; /** * A component that represents a color selection grid within a color picker. - * + * * @since 7.0.0 */ -public class ColorPickerGrid extends AbstractComponent implements ColorSelector { +public class ColorPickerGrid extends AbstractComponent + implements ColorSelector { private static final String STYLENAME = "v-colorpicker-grid"; @@ -98,7 +99,7 @@ public class ColorPickerGrid extends AbstractComponent implements ColorSelector /** * Instantiates a new color picker grid. - * + * * @param rows * the rows * @param columns @@ -113,7 +114,7 @@ public class ColorPickerGrid extends AbstractComponent implements ColorSelector /** * Instantiates a new color picker grid. - * + * * @param colors * the colors */ @@ -162,7 +163,7 @@ public class ColorPickerGrid extends AbstractComponent implements ColorSelector /** * Sets the color grid. - * + * * @param colors * the new color grid */ @@ -183,7 +184,7 @@ public class ColorPickerGrid extends AbstractComponent implements ColorSelector /** * Adds a color change listener - * + * * @param listener * The color change listener */ @@ -199,7 +200,7 @@ public class ColorPickerGrid extends AbstractComponent implements ColorSelector /** * Removes a color change listener - * + * * @param listener * The listener */ @@ -218,7 +219,7 @@ public class ColorPickerGrid extends AbstractComponent implements ColorSelector /** * Sets the position. - * + * * @param x * the x * @param y @@ -233,7 +234,7 @@ public class ColorPickerGrid extends AbstractComponent implements ColorSelector /** * Gets the position. - * + * * @return the position */ public int[] getPosition() { @@ -242,7 +243,7 @@ public class ColorPickerGrid extends AbstractComponent implements ColorSelector /** * Notifies the listeners that a color change has occurred - * + * * @param color * The color which it changed to */ diff --git a/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerHistory.java b/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerHistory.java index a3297a282c..e1b312c1e5 100644 --- a/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerHistory.java +++ b/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerHistory.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -28,11 +28,11 @@ import com.vaadin.ui.CustomComponent; /** * A component that represents color selection history within a color picker. - * + * * @since 7.0.0 */ -public class ColorPickerHistory extends CustomComponent implements - ColorSelector, ColorChangeListener { +public class ColorPickerHistory extends CustomComponent + implements ColorSelector, ColorChangeListener { private static final String STYLENAME = "v-colorpicker-history"; @@ -96,8 +96,8 @@ public class ColorPickerHistory extends CustomComponent implements @SuppressWarnings("unchecked") private ArrayBlockingQueue getColorHistory() { if (isAttached()) { - Object colorHistory = getSession().getAttribute( - "colorPickerHistory"); + Object colorHistory = getSession() + .getAttribute("colorPickerHistory"); if (colorHistory instanceof ArrayBlockingQueue) { return (ArrayBlockingQueue) colorHistory; } @@ -167,7 +167,7 @@ public class ColorPickerHistory extends CustomComponent implements /** * Gets the history. - * + * * @return the history */ public List getHistory() { @@ -178,10 +178,10 @@ public class ColorPickerHistory extends CustomComponent implements /** * Checks if the history contains given color. - * + * * @param c * the color - * + * * @return true, if successful */ public boolean hasColor(Color c) { @@ -190,7 +190,7 @@ public class ColorPickerHistory extends CustomComponent implements /** * Adds a color change listener - * + * * @param listener * The listener */ @@ -201,7 +201,7 @@ public class ColorPickerHistory extends CustomComponent implements /** * Removes a color change listener - * + * * @param listener * The listener */ diff --git a/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerPopup.java b/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerPopup.java index 86ac0111ad..2378c90b77 100644 --- a/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerPopup.java +++ b/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerPopup.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -45,11 +45,11 @@ import com.vaadin.ui.Window; /** * A component that represents color selection popup within a color picker. - * + * * @since 7.0.0 */ -public class ColorPickerPopup extends Window implements ClickListener, - ColorChangeListener, ColorSelector { +public class ColorPickerPopup extends Window + implements ClickListener, ColorChangeListener, ColorSelector { private static final String STYLENAME = "v-colorpicker-popup"; @@ -256,7 +256,7 @@ public class ColorPickerPopup extends Window implements ClickListener, /** * Creates the RGB tab. - * + * * @return the component */ private Component createRGBTab(Color color) { @@ -286,8 +286,8 @@ public class ColorPickerPopup extends Window implements ClickListener, public void valueChange(ValueChangeEvent event) { double red = (Double) event.getProperty().getValue(); if (!updatingColors) { - Color newColor = new Color((int) red, selectedColor - .getGreen(), selectedColor.getBlue()); + Color newColor = new Color((int) red, + selectedColor.getGreen(), selectedColor.getBlue()); setColor(newColor); } } @@ -337,7 +337,7 @@ public class ColorPickerPopup extends Window implements ClickListener, /** * Creates the hsv tab. - * + * * @return the component */ private Component createHSVTab(Color color) { @@ -371,16 +371,18 @@ public class ColorPickerPopup extends Window implements ClickListener, @Override public void valueChange(ValueChangeEvent event) { if (!updatingColors) { - float hue = (Float.parseFloat(event.getProperty() - .getValue().toString())) / 360f; - float saturation = (Float.parseFloat(saturationSlider - .getValue().toString())) / 100f; - float value = (Float.parseFloat(valueSlider.getValue() - .toString())) / 100f; + float hue = (Float.parseFloat( + event.getProperty().getValue().toString())) / 360f; + float saturation = (Float + .parseFloat(saturationSlider.getValue().toString())) + / 100f; + float value = (Float + .parseFloat(valueSlider.getValue().toString())) + / 100f; // Set the color - Color color = new Color(Color.HSVtoRGB(hue, saturation, - value)); + Color color = new Color( + Color.HSVtoRGB(hue, saturation, value)); setColor(color); /* @@ -402,14 +404,16 @@ public class ColorPickerPopup extends Window implements ClickListener, @Override public void valueChange(ValueChangeEvent event) { if (!updatingColors) { - float hue = (Float.parseFloat(hueSlider.getValue() - .toString())) / 360f; - float saturation = (Float.parseFloat(event.getProperty() - .getValue().toString())) / 100f; - float value = (Float.parseFloat(valueSlider.getValue() - .toString())) / 100f; - Color color = new Color(Color.HSVtoRGB(hue, saturation, - value)); + float hue = (Float + .parseFloat(hueSlider.getValue().toString())) + / 360f; + float saturation = (Float.parseFloat( + event.getProperty().getValue().toString())) / 100f; + float value = (Float + .parseFloat(valueSlider.getValue().toString())) + / 100f; + Color color = new Color( + Color.HSVtoRGB(hue, saturation, value)); setColor(color); } } @@ -423,15 +427,17 @@ public class ColorPickerPopup extends Window implements ClickListener, @Override public void valueChange(ValueChangeEvent event) { if (!updatingColors) { - float hue = (Float.parseFloat(hueSlider.getValue() - .toString())) / 360f; - float saturation = (Float.parseFloat(saturationSlider - .getValue().toString())) / 100f; - float value = (Float.parseFloat(event.getProperty() - .getValue().toString())) / 100f; - - Color color = new Color(Color.HSVtoRGB(hue, saturation, - value)); + float hue = (Float + .parseFloat(hueSlider.getValue().toString())) + / 360f; + float saturation = (Float + .parseFloat(saturationSlider.getValue().toString())) + / 100f; + float value = (Float.parseFloat( + event.getProperty().getValue().toString())) / 100f; + + Color color = new Color( + Color.HSVtoRGB(hue, saturation, value)); setColor(color); } } @@ -445,7 +451,7 @@ public class ColorPickerPopup extends Window implements ClickListener, /** * Creates the select tab. - * + * * @return the component */ private Component createSelectTab() { @@ -504,7 +510,7 @@ public class ColorPickerPopup extends Window implements ClickListener, /** * Gets the history. - * + * * @return the history */ public ColorPickerHistory getHistory() { @@ -535,7 +541,7 @@ public class ColorPickerPopup extends Window implements ClickListener, /** * Gets the color history. - * + * * @return the color history */ public List getColorHistory() { @@ -568,10 +574,10 @@ public class ColorPickerPopup extends Window implements ClickListener, blueSlider.setValue(((Integer) color.getBlue()).doubleValue()); greenSlider.setValue(((Integer) color.getGreen()).doubleValue()); } catch (ValueOutOfBoundsException e) { - getLogger().log( - Level.WARNING, + getLogger().log(Level.WARNING, "Unable to set RGB color value to " + color.getRed() + "," - + color.getGreen() + "," + color.getBlue(), e); + + color.getGreen() + "," + color.getBlue(), + e); } } @@ -581,10 +587,8 @@ public class ColorPickerPopup extends Window implements ClickListener, saturationSlider.setValue(((Float) (hsv[1] * 100f)).doubleValue()); valueSlider.setValue(((Float) (hsv[2] * 100f)).doubleValue()); } catch (ValueOutOfBoundsException e) { - getLogger().log( - Level.WARNING, - "Unable to set HSV color value to " + hsv[0] + "," + hsv[1] - + "," + hsv[2], e); + getLogger().log(Level.WARNING, "Unable to set HSV color value to " + + hsv[0] + "," + hsv[1] + "," + hsv[2], e); } } @@ -600,7 +604,7 @@ public class ColorPickerPopup extends Window implements ClickListener, /** * Checks the visibility of the given tab - * + * * @param tab * The tab to check * @return true if tab is visible, false otherwise @@ -617,7 +621,7 @@ public class ColorPickerPopup extends Window implements ClickListener, /** * How many tabs are visible - * + * * @return The number of tabs visible */ private int tabsNumVisible() { @@ -639,7 +643,7 @@ public class ColorPickerPopup extends Window implements ClickListener, /** * Set RGB tab visibility - * + * * @param visible * The visibility of the RGB tab */ @@ -655,7 +659,7 @@ public class ColorPickerPopup extends Window implements ClickListener, /** * Set HSV tab visibility - * + * * @param visible * The visibility of the HSV tab */ @@ -671,7 +675,7 @@ public class ColorPickerPopup extends Window implements ClickListener, /** * Set Swatches tab visibility - * + * * @param visible * The visibility of the Swatches tab */ @@ -687,7 +691,7 @@ public class ColorPickerPopup extends Window implements ClickListener, /** * Set the History visibility - * + * * @param visible */ public void setHistoryVisible(boolean visible) { @@ -697,7 +701,7 @@ public class ColorPickerPopup extends Window implements ClickListener, /** * Set the preview visibility - * + * * @param visible */ public void setPreviewVisible(boolean visible) { @@ -765,7 +769,8 @@ public class ColorPickerPopup extends Window implements ClickListener, public Color calculate(int x, int y) { float saturation = 1f - (y / 220.0f); float value = (x / 220.0f); - float hue = Float.parseFloat(hueSlider.getValue().toString()) / 360f; + float hue = Float.parseFloat(hueSlider.getValue().toString()) + / 360f; Color color = new Color(Color.HSVtoRGB(hue, saturation, value)); return color; diff --git a/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerPreview.java b/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerPreview.java index 21a3630de2..a4af3f6264 100644 --- a/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerPreview.java +++ b/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerPreview.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -26,11 +26,11 @@ import com.vaadin.ui.TextField; /** * A component that represents color selection preview within a color picker. - * + * * @since 7.0.0 */ -public class ColorPickerPreview extends CssLayout implements ColorSelector, - ValueChangeListener { +public class ColorPickerPreview extends CssLayout + implements ColorSelector, ValueChangeListener { private static final String STYLE_DARK_COLOR = "v-textfield-dark"; private static final String STYLE_LIGHT_COLOR = "v-textfield-light"; @@ -98,7 +98,8 @@ public class ColorPickerPreview extends CssLayout implements ColorSelector, // Set the text color field.removeStyleName(STYLE_DARK_COLOR); field.removeStyleName(STYLE_LIGHT_COLOR); - if (this.color.getRed() + this.color.getGreen() + this.color.getBlue() < 3 * 128) { + if (this.color.getRed() + this.color.getGreen() + + this.color.getBlue() < 3 * 128) { field.addStyleName(STYLE_DARK_COLOR); } else { field.addStyleName(STYLE_LIGHT_COLOR); @@ -147,7 +148,8 @@ public class ColorPickerPreview extends CssLayout implements ColorSelector, int green = Integer.parseInt(colors[1]); int blue = Integer.parseInt(colors[2]); if (colors.length > 3) { - int alpha = (int) (Double.parseDouble(colors[3]) * 255d); + int alpha = (int) (Double.parseDouble(colors[3]) + * 255d); color = new Color(red, green, blue, alpha); } else { color = new Color(red, green, blue); @@ -159,14 +161,15 @@ public class ColorPickerPreview extends CssLayout implements ColorSelector, value.length() - 1).split(","); int hue = Integer.parseInt(colors[0]); - int saturation = Integer.parseInt(colors[1] - .replace("%", "")); + int saturation = Integer + .parseInt(colors[1].replace("%", "")); int lightness = Integer .parseInt(colors[2].replace("%", "")); int rgb = Color.HSLtoRGB(hue, saturation, lightness); if (colors.length > 3) { - int alpha = (int) (Double.parseDouble(colors[3]) * 255d); + int alpha = (int) (Double.parseDouble(colors[3]) + * 255d); color = new Color(rgb); color.setAlpha(alpha); } else { diff --git a/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerSelect.java b/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerSelect.java index 8e441b25ee..f247e9c6a7 100644 --- a/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerSelect.java +++ b/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerSelect.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -24,11 +24,11 @@ import com.vaadin.ui.VerticalLayout; /** * A component that represents color selection swatches within a color picker. - * + * * @since 7.0.0 */ -public class ColorPickerSelect extends CustomComponent implements - ColorSelector, ValueChangeListener { +public class ColorPickerSelect extends CustomComponent + implements ColorSelector, ValueChangeListener { /** The range. */ private final ComboBox range; @@ -48,7 +48,7 @@ public class ColorPickerSelect extends CustomComponent implements /** * Instantiates a new color range property id. - * + * * @param caption * the caption */ @@ -64,7 +64,7 @@ public class ColorPickerSelect extends CustomComponent implements /** * Instantiates a new color picker select. - * + * * @param rows * the rows * @param columns @@ -101,12 +101,12 @@ public class ColorPickerSelect extends CustomComponent implements /** * Creates the all colors. - * + * * @param rows * the rows * @param columns * the columns - * + * * @return the color[][] */ private Color[][] createAllColors(int rows, int columns) { @@ -130,8 +130,8 @@ public class ColorPickerSelect extends CustomComponent implements value = 1f - ((row - (rows / 2f)) / (rows / 2f)); } - colors[row][col] = new Color(Color.HSVtoRGB(hue, - saturation, value)); + colors[row][col] = new Color( + Color.HSVtoRGB(hue, saturation, value)); } // The last row should have the black&white gradient @@ -140,8 +140,8 @@ public class ColorPickerSelect extends CustomComponent implements float saturation = 0f; float value = 1f - ((float) col / (float) columns); - colors[row][col] = new Color(Color.HSVtoRGB(hue, - saturation, value)); + colors[row][col] = new Color( + Color.HSVtoRGB(hue, saturation, value)); } } } @@ -151,14 +151,14 @@ public class ColorPickerSelect extends CustomComponent implements /** * Creates the color. - * + * * @param color * the color * @param rows * the rows * @param columns * the columns - * + * * @return the color[][] */ private Color[][] createColors(Color color, int rows, int columns) { @@ -182,12 +182,12 @@ public class ColorPickerSelect extends CustomComponent implements / (((float) rows * (float) columns) / 2f); } else { index -= ((rows * columns) / 2); - value = 1f - index - / (((float) rows * (float) columns) / 2f); + value = 1f + - index / (((float) rows * (float) columns) / 2f); } - colors[row][col] = new Color(Color.HSVtoRGB(hue, saturation, - value)); + colors[row][col] = new Color( + Color.HSVtoRGB(hue, saturation, value)); } } @@ -224,9 +224,11 @@ public class ColorPickerSelect extends CustomComponent implements grid.setColorGrid(createAllColors(14, 10)); } else if (event.getProperty().getValue() == ColorRangePropertyId.RED) { grid.setColorGrid(createColors(new Color(0xFF, 0, 0), 14, 10)); - } else if (event.getProperty().getValue() == ColorRangePropertyId.GREEN) { + } else if (event.getProperty() + .getValue() == ColorRangePropertyId.GREEN) { grid.setColorGrid(createColors(new Color(0, 0xFF, 0), 14, 10)); - } else if (event.getProperty().getValue() == ColorRangePropertyId.BLUE) { + } else if (event.getProperty() + .getValue() == ColorRangePropertyId.BLUE) { grid.setColorGrid(createColors(new Color(0, 0, 0xFF), 14, 10)); } } diff --git a/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorSelector.java b/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorSelector.java index c282c22f62..28e6781aee 100644 --- a/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorSelector.java +++ b/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorSelector.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,14 +21,14 @@ import com.vaadin.shared.ui.colorpicker.Color; /** * An interface for a color selector. - * + * * @since 7.0.0 */ public interface ColorSelector extends Serializable, HasColorChangeListener { /** * Sets the color. - * + * * @param color * the new color */ @@ -36,7 +36,7 @@ public interface ColorSelector extends Serializable, HasColorChangeListener { /** * Gets the color. - * + * * @return the color */ public Color getColor(); diff --git a/server/src/main/java/com/vaadin/ui/components/colorpicker/HasColorChangeListener.java b/server/src/main/java/com/vaadin/ui/components/colorpicker/HasColorChangeListener.java index eb16d8cbbe..c34a191175 100644 --- a/server/src/main/java/com/vaadin/ui/components/colorpicker/HasColorChangeListener.java +++ b/server/src/main/java/com/vaadin/ui/components/colorpicker/HasColorChangeListener.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,14 +21,14 @@ public interface HasColorChangeListener extends Serializable { /** * Adds a {@link ColorChangeListener} to the component. - * + * * @param listener */ void addColorChangeListener(ColorChangeListener listener); /** * Removes a {@link ColorChangeListener} from the component. - * + * * @param listener */ void removeColorChangeListener(ColorChangeListener listener); diff --git a/server/src/main/java/com/vaadin/ui/declarative/Design.java b/server/src/main/java/com/vaadin/ui/declarative/Design.java index a12cd65557..7641a84cf2 100644 --- a/server/src/main/java/com/vaadin/ui/declarative/Design.java +++ b/server/src/main/java/com/vaadin/ui/declarative/Design.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -45,18 +45,18 @@ import com.vaadin.ui.declarative.DesignContext.ComponentCreationListener; * Design is used for reading a component hierarchy from an html string or input * stream and, conversely, for writing an html representation corresponding to a * given component hierarchy. - * + * *

            * In html form a valid nonempty component hierarchy contains a single root * element located under the <body> tag. A hierarchy of components is * achieved by nesting other elements under the root element. An empty component * hierarchy is represented as no elements under the <body> tag. - * + * *

            * For writing a component hierarchy the root element is specified as a * Component parameter or as a DesignContext object containing the root * Component. An empty hierarchy can be written by giving a null root Component. - * + * * @since 7.4 * @author Vaadin Ltd */ @@ -73,19 +73,19 @@ public class Design implements Serializable { *

            * Use {@link Design#setComponentFactory(ComponentFactory)} to configure * Vaadin to use a custom component factory. - * + * * @since 7.4.1 */ public interface ComponentFactory extends Serializable { /** * Creates a component based on the fully qualified name derived from * the tag name in the design. - * + * * @param fullyQualifiedClassName * the fully qualified name of the component to create * @param context * the design context for which the component is created - * + * * @return a newly created component */ public Component createComponent(String fullyQualifiedClassName, @@ -98,7 +98,7 @@ public class Design implements Serializable { *

            * Use {@link Design#setComponentMapper(ComponentMapper)} to configure * Vaadin to use a custom component mapper. - * + * * @since 7.5.0 * @author Vaadin Ltd */ @@ -111,7 +111,7 @@ public class Design implements Serializable { * {@link #componentToTag(Component, DesignContext)} so that the * resolved tag for a created component is the same as the tag for which * the component was created. - * + * * @param tag * the tag name to create a component for * @param componentFactory @@ -126,21 +126,22 @@ public class Design implements Serializable { /** * Resolves a tag name from a component. - * + * * @param component * the component to get a tag name for * @param context * the design context for which the tag name is needed * @return the tag name corresponding to the component */ - public String componentToTag(Component component, DesignContext context); + public String componentToTag(Component component, + DesignContext context); } /** * Default implementation of {@link ComponentFactory}, using * Class.forName(className).newInstance() for finding the * component class and creating a component instance. - * + * * @since 7.4.1 */ public static class DefaultComponentFactory implements ComponentFactory { @@ -156,8 +157,7 @@ public class Design implements Serializable { int lastDot = fullyQualifiedClassName.lastIndexOf('.'); if (lastDot != -1) { String qualifiedInnerClassName = fullyQualifiedClassName - .substring(0, lastDot) - + "$" + .substring(0, lastDot) + "$" + fullyQualifiedClassName.substring(lastDot + 1); return createComponent(qualifiedInnerClassName, context); } else { @@ -165,21 +165,24 @@ public class Design implements Serializable { } } - assert Component.class.isAssignableFrom(componentClass) : "resolveComponentClass returned " - + componentClass + " which is not a Vaadin Component class"; + assert Component.class.isAssignableFrom( + componentClass) : "resolveComponentClass returned " + + componentClass + + " which is not a Vaadin Component class"; try { return componentClass.newInstance(); } catch (Exception e) { - throw new DesignException("Could not create component " - + fullyQualifiedClassName, e); + throw new DesignException( + "Could not create component " + fullyQualifiedClassName, + e); } } /** * Resolves a component class based on the fully qualified name of the * class. - * + * * @param qualifiedClassName * the fully qualified name of the resolved class * @param context @@ -192,8 +195,8 @@ public class Design implements Serializable { Class componentClass = Class.forName(qualifiedClassName); return componentClass.asSubclass(Component.class); } catch (ClassNotFoundException e) { - throw new DesignException( - "Unable to load component for design", e); + throw new DesignException("Unable to load component for design", + e); } } @@ -201,7 +204,7 @@ public class Design implements Serializable { /** * Default implementation of {@link ComponentMapper}, - * + * * @since 7.5.0 */ public static class DefaultComponentMapper implements ComponentMapper { @@ -235,8 +238,8 @@ public class Design implements Serializable { } String qualifiedClassName = packageName + "." + className; - Component component = componentFactory.createComponent( - qualifiedClassName, context); + Component component = componentFactory + .createComponent(qualifiedClassName, context); if (component == null) { throw new DesignException("Got unexpected null component from " @@ -248,18 +251,19 @@ public class Design implements Serializable { } @Override - public String componentToTag(Component component, DesignContext context) { + public String componentToTag(Component component, + DesignContext context) { Class componentClass = component.getClass(); String packageName = getPackageName(componentClass); String prefix = context.getPackagePrefix(packageName); if (prefix == null) { - prefix = packageName.replace('.', '_').toLowerCase( - Locale.ENGLISH); + prefix = packageName.replace('.', '_') + .toLowerCase(Locale.ENGLISH); context.addPackagePrefix(prefix, packageName); } prefix = prefix + "-"; - String className = classNameToElementName(componentClass - .getSimpleName()); + String className = classNameToElementName( + componentClass.getSimpleName()); String tagName = prefix + className; return tagName; @@ -280,7 +284,7 @@ public class Design implements Serializable { * name. The name is derived by converting each uppercase letter to * lowercase and inserting a dash before the letter. No dash is inserted * before the first letter of the class name. - * + * * @param className * the name of the class without a package name * @return the html tag name corresponding to className @@ -311,10 +315,10 @@ public class Design implements Serializable { *

            * Please note that this setting is global, so care should be taken to avoid * conflicting changes. - * + * * @param componentFactory * the component factory to set; not null - * + * * @since 7.4.1 */ public static void setComponentFactory(ComponentFactory componentFactory) { @@ -327,11 +331,11 @@ public class Design implements Serializable { /** * Gets the currently used component factory. - * + * * @see #setComponentFactory(ComponentFactory) - * + * * @return the component factory - * + * * @since 7.4.1 */ public static ComponentFactory getComponentFactory() { @@ -344,10 +348,10 @@ public class Design implements Serializable { *

            * Please note that this setting is global, so care should be taken to avoid * conflicting changes. - * + * * @param componentMapper * the component mapper to set; not null - * + * * @since 7.5.0 */ public static void setComponentMapper(ComponentMapper componentMapper) { @@ -360,11 +364,11 @@ public class Design implements Serializable { /** * Gets the currently used component mapper. - * + * * @see #setComponentMapper(ComponentMapper) - * + * * @return the component mapper - * + * * @since 7.5.0 */ public static ComponentMapper getComponentMapper() { @@ -373,7 +377,7 @@ public class Design implements Serializable { /** * Parses the given input stream into a jsoup document - * + * * @param html * the stream containing the design * @return the parsed jsoup document @@ -392,12 +396,12 @@ public class Design implements Serializable { /** * Constructs a component hierarchy from the design specified as an html * tree. - * + * *

            * If a component root is given, the component instances created during * reading the design are assigned to its member fields based on their id, * local id, and caption - * + * * @param doc * the html tree * @param componentRoot @@ -420,12 +424,12 @@ public class Design implements Serializable { /** * Constructs a component hierarchy from the design specified as an html * tree. - * + * *

            * If a component root is given, the component instances created during * reading the design are assigned to its member fields based on their id, * local id, and caption - * + * * @param doc * the html tree * @param componentRoot @@ -488,8 +492,8 @@ public class Design implements Serializable { designContext.removeComponentCreationListener(creationListener); } else { // createChild creates the entire component hierarchy - componentRoot = element == null ? null : designContext - .readDesign(element); + componentRoot = element == null ? null + : designContext.readDesign(element); } designContext.setRootComponent(componentRoot); return designContext; @@ -500,8 +504,8 @@ public class Design implements Serializable { * the root designContext.getRootComponent(). The hierarchy is stored under * <body> in the tree. The generated tree represents a valid html * document. - * - * + * + * * @param designContext * a DesignContext object specifying the root component * (designContext.getRootComponent()) of the hierarchy @@ -545,7 +549,7 @@ public class Design implements Serializable { * id/local id/caption in the design file. *

            * The type of the root component must match the root element in the design - * + * * @param rootComponent * The root component of the layout * @return The design context used in the load operation @@ -559,10 +563,9 @@ public class Design implements Serializable { Class annotatedClass = findClassWithAnnotation( rootComponent.getClass(), DesignRoot.class); if (annotatedClass == null) { - throw new IllegalArgumentException( - "The class " - + rootComponent.getClass().getName() - + " or any of its superclasses do not have an @DesignRoot annotation"); + throw new IllegalArgumentException("The class " + + rootComponent.getClass().getName() + + " or any of its superclasses do not have an @DesignRoot annotation"); } DesignRoot designAnnotation = annotatedClass @@ -600,7 +603,7 @@ public class Design implements Serializable { /** * Find the first class with the given annotation, starting the search from * the given class and moving upwards in the class hierarchy. - * + * * @param componentClass * the class to check * @param annotationClass @@ -637,7 +640,7 @@ public class Design implements Serializable { * id/local id/caption in the design file. *

            * The type of the root component must match the root element in the design. - * + * * @param filename * The file name to load. Loaded from the same package as the * root component @@ -649,12 +652,12 @@ public class Design implements Serializable { */ public static DesignContext read(String filename, Component rootComponent) throws DesignException { - InputStream stream = rootComponent.getClass().getResourceAsStream( - filename); + InputStream stream = rootComponent.getClass() + .getResourceAsStream(filename); if (stream == null) { - throw new DesignException("File " + filename - + " was not found in the package " - + rootComponent.getClass().getPackage().getName()); + throw new DesignException( + "File " + filename + " was not found in the package " + + rootComponent.getClass().getPackage().getName()); } try { return read(stream, rootComponent); @@ -678,7 +681,7 @@ public class Design implements Serializable { *

            * If rootComponent is not null, its type must match the type of the root * element in the design - * + * * @param stream * The stream to read the design from * @param rootComponent @@ -687,7 +690,8 @@ public class Design implements Serializable { * @throws DesignException * If the design could not be loaded */ - public static DesignContext read(InputStream stream, Component rootComponent) { + public static DesignContext read(InputStream stream, + Component rootComponent) { if (stream == null) { throw new DesignException("Stream cannot be null"); } @@ -699,7 +703,7 @@ public class Design implements Serializable { /** * Loads a design from the given input stream - * + * * @param design * The stream to read the design from * @return The root component of the design @@ -712,7 +716,7 @@ public class Design implements Serializable { /** * Writes the given component tree in design format to the given output * stream. - * + * * @param component * the root component of the component tree, null can be used for * generating an empty design @@ -733,7 +737,7 @@ public class Design implements Serializable { * Writes the component, given in the design context, in design format to * the given output stream. The design context is used for writing local ids * and other information not available in the component tree. - * + * * @param designContext * The DesignContext object specifying the component hierarchy * and the local id values of the objects. If @@ -753,7 +757,7 @@ public class Design implements Serializable { /** * Writes the given jsoup document to the output stream (in UTF-8) - * + * * @param doc * the document to write * @param outputStream diff --git a/server/src/main/java/com/vaadin/ui/declarative/DesignAttributeHandler.java b/server/src/main/java/com/vaadin/ui/declarative/DesignAttributeHandler.java index bbfd90b2cc..6a8b4fb5d4 100644 --- a/server/src/main/java/com/vaadin/ui/declarative/DesignAttributeHandler.java +++ b/server/src/main/java/com/vaadin/ui/declarative/DesignAttributeHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -45,7 +45,7 @@ import com.vaadin.ui.Alignment; * Default attribute handler implementation used when parsing designs to * component trees. Handles all the component attributes that do not require * custom handling. - * + * * @since 7.4 * @author Vaadin Ltd */ @@ -63,7 +63,7 @@ public class DesignAttributeHandler implements Serializable { /** * Returns the currently used formatter. All primitive types and all types * needed by Vaadin components are handled by that formatter. - * + * * @return An instance of the formatter. */ public static DesignFormatter getFormatter() { @@ -72,7 +72,7 @@ public class DesignAttributeHandler implements Serializable { /** * Clears the children and attributes of the given element - * + * * @param design * the element to be cleared */ @@ -90,7 +90,7 @@ public class DesignAttributeHandler implements Serializable { /** * Assigns the specified design attribute to the given component. - * + * * @param target * the target to which the attribute should be set * @param attribute @@ -107,7 +107,8 @@ public class DesignAttributeHandler implements Serializable { } boolean success = false; try { - Method setter = findSetterForAttribute(target.getClass(), attribute); + Method setter = findSetterForAttribute(target.getClass(), + attribute); if (setter == null) { // if we don't have the setter, there is no point in continuing success = false; @@ -119,15 +120,12 @@ public class DesignAttributeHandler implements Serializable { success = true; } } catch (Exception e) { - getLogger().log( - Level.WARNING, - "Failed to set value \"" + value + "\" to attribute " - + attribute, e); + getLogger().log(Level.WARNING, "Failed to set value \"" + value + + "\" to attribute " + attribute, e); } if (!success) { - getLogger().info( - "property " + attribute - + " ignored by default attribute handler"); + getLogger().info("property " + attribute + + " ignored by default attribute handler"); } return success; } @@ -135,7 +133,7 @@ public class DesignAttributeHandler implements Serializable { /** * Searches for supported setter and getter types from the specified class * and returns the list of corresponding design attributes - * + * * @param clazz * the class scanned for setters * @return the list of supported design attributes @@ -149,7 +147,7 @@ public class DesignAttributeHandler implements Serializable { * Resolves the supported attributes and corresponding getters and setters * for the class using introspection. After resolving, the information is * cached internally by this class - * + * * @param clazz * the class to resolve the supported attributes for */ @@ -170,11 +168,12 @@ public class DesignAttributeHandler implements Serializable { + clazz.getName()); } AttributeCacheEntry entry = new AttributeCacheEntry(); - for (PropertyDescriptor descriptor : beanInfo.getPropertyDescriptors()) { + for (PropertyDescriptor descriptor : beanInfo + .getPropertyDescriptors()) { Method getter = descriptor.getReadMethod(); Method setter = descriptor.getWriteMethod(); - if (getter != null && setter != null - && getFormatter().canConvert(descriptor.getPropertyType())) { + if (getter != null && setter != null && getFormatter() + .canConvert(descriptor.getPropertyType())) { String attribute = toAttributeName(descriptor.getName()); entry.addAttribute(attribute, getter, setter); } @@ -185,7 +184,7 @@ public class DesignAttributeHandler implements Serializable { /** * Writes the specified attribute to the design if it differs from the * default value got from the defaultInstance - * + * * @param component * the component used to get the attribute value * @param attribute @@ -210,10 +209,9 @@ public class DesignAttributeHandler implements Serializable { writeAttribute(attribute, attr, value, defaultValue, (Class) getter.getReturnType()); } catch (Exception e) { - getLogger() - .log(Level.SEVERE, - "Failed to invoke getter for attribute " - + attribute, e); + getLogger().log(Level.SEVERE, + "Failed to invoke getter for attribute " + attribute, + e); } } } @@ -221,7 +219,7 @@ public class DesignAttributeHandler implements Serializable { /** * Writes the given attribute value to a set of attributes if it differs * from the default attribute value. - * + * * @param attribute * the attribute key * @param attributes @@ -234,15 +232,16 @@ public class DesignAttributeHandler implements Serializable { * the type of the input value */ public static void writeAttribute(String attribute, - Attributes attributes, T value, T defaultValue, Class inputType) { + Attributes attributes, T value, T defaultValue, + Class inputType) { if (!getFormatter().canConvert(inputType)) { - throw new IllegalArgumentException("input type: " - + inputType.getName() + " not supported"); + throw new IllegalArgumentException( + "input type: " + inputType.getName() + " not supported"); } if (!SharedUtil.equals(value, defaultValue)) { String attributeValue = toAttributeValue(inputType, value); - if ("".equals(attributeValue) - && (inputType == boolean.class || inputType == Boolean.class)) { + if ("".equals(attributeValue) && (inputType == boolean.class + || inputType == Boolean.class)) { attributes.put(attribute, true); } else { attributes.put(attribute, attributeValue); @@ -253,7 +252,7 @@ public class DesignAttributeHandler implements Serializable { /** * Reads the given attribute from a set of attributes. If attribute does not * exist return a given default value. - * + * * @param attribute * the attribute key * @param attributes @@ -276,7 +275,7 @@ public class DesignAttributeHandler implements Serializable { /** * Reads the given attribute from a set of attributes. - * + * * @param attribute * the attribute key * @param attributes @@ -288,8 +287,8 @@ public class DesignAttributeHandler implements Serializable { public static T readAttribute(String attribute, Attributes attributes, Class outputType) { if (!getFormatter().canConvert(outputType)) { - throw new IllegalArgumentException("output type: " - + outputType.getName() + " not supported"); + throw new IllegalArgumentException( + "output type: " + outputType.getName() + " not supported"); } if (!attributes.hasKey(attribute)) { return null; @@ -298,8 +297,8 @@ public class DesignAttributeHandler implements Serializable { String value = attributes.get(attribute); return getFormatter().parse(value, outputType); } catch (Exception e) { - throw new DesignException("Failed to read attribute " - + attribute, e); + throw new DesignException( + "Failed to read attribute " + attribute, e); } } } @@ -308,7 +307,7 @@ public class DesignAttributeHandler implements Serializable { * Returns the design attribute name corresponding the given method name. * For example given a method name setPrimaryStyleName the * return value would be primary-style-name - * + * * @param propertyName * the property name returned by {@link IntroSpector} * @return the design attribute name corresponding the given method name @@ -330,7 +329,7 @@ public class DesignAttributeHandler implements Serializable { * Replaces subsequent UPPERCASE strings of length 2 or more followed either * by another uppercase letter or an end of string. This is to generalise * handling of method names like showISOWeekNumbers. - * + * * @param param * Input string. * @return Input string with sequences of UPPERCASE turned into Normalcase. @@ -346,13 +345,12 @@ public class DesignAttributeHandler implements Serializable { // if this is a beginning of the string, the whole matched group is // written in lower case if (matcher.group(1).isEmpty()) { - matcher.appendReplacement(result, matched.toLowerCase() - + matcher.group(3)); + matcher.appendReplacement(result, + matched.toLowerCase() + matcher.group(3)); // otherwise the first character of the group stays uppercase, // while the others are lower case } else { - matcher.appendReplacement( - result, + matcher.appendReplacement(result, matcher.group(1) + matched.substring(0, 1) + matched.substring(1).toLowerCase() + matcher.group(3)); @@ -368,7 +366,7 @@ public class DesignAttributeHandler implements Serializable { /** * Serializes the given value to valid design attribute representation - * + * * @param sourceType * the type of the value * @param value @@ -381,8 +379,8 @@ public class DesignAttributeHandler implements Serializable { // value is not null. How to represent null value in attributes? return ""; } - Converter converter = getFormatter().findConverterFor( - sourceType); + Converter converter = getFormatter() + .findConverterFor(sourceType); if (converter != null) { return converter.convertToPresentation(value, String.class, null); } else { @@ -393,7 +391,7 @@ public class DesignAttributeHandler implements Serializable { /** * Returns a setter that can be used for assigning the given design * attribute to the class - * + * * @param clazz * the class that is scanned for setters * @param attribute @@ -409,7 +407,7 @@ public class DesignAttributeHandler implements Serializable { /** * Returns a getter that can be used for reading the given design attribute * value from the class - * + * * @param clazz * the class that is scanned for getters * @param attribute @@ -425,13 +423,14 @@ public class DesignAttributeHandler implements Serializable { /** * Cache object for caching supported attributes and their getters and * setters - * + * * @author Vaadin Ltd */ private static class AttributeCacheEntry implements Serializable { private Map accessMethods = new ConcurrentHashMap(); - private void addAttribute(String attribute, Method getter, Method setter) { + private void addAttribute(String attribute, Method getter, + Method setter) { Method[] methods = new Method[2]; methods[0] = getter; methods[1] = setter; @@ -457,7 +456,7 @@ public class DesignAttributeHandler implements Serializable { /** * Read the alignment from the given child component attributes. - * + * * @since 7.6.4 * @param attr * the child component attributes @@ -485,14 +484,15 @@ public class DesignAttributeHandler implements Serializable { /** * Writes the alignment to the given child element attributes. - * + * * @since 7.6.4 * @param childElement * the child element * @param alignment * the component alignment */ - public static void writeAlignment(Element childElement, Alignment alignment) { + public static void writeAlignment(Element childElement, + Alignment alignment) { if (alignment.isMiddle()) { childElement.attr(":middle", true); } else if (alignment.isBottom()) { diff --git a/server/src/main/java/com/vaadin/ui/declarative/DesignContext.java b/server/src/main/java/com/vaadin/ui/declarative/DesignContext.java index 82f1450adc..a9eeddb416 100644 --- a/server/src/main/java/com/vaadin/ui/declarative/DesignContext.java +++ b/server/src/main/java/com/vaadin/ui/declarative/DesignContext.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -44,13 +44,13 @@ import com.vaadin.ui.declarative.Design.ComponentMapper; * mappings from local ids, global ids and captions to components , as well as a * mapping between prefixes and package names (such as "vaadin" -> * "com.vaadin.ui"). - * + * * Versions prior to 7.6 use "v" as the default prefix. Versions starting with * 7.6 support reading designs with either "v" or "vaadin" as the prefix, but * only write "vaadin" by default. Writing with the legacy prefix can be * activated with the property or context parameter * {@link Constants#SERVLET_PARAMETER_LEGACY_DESIGN_PREFIX}. - * + * * @since 7.4 * @author Vaadin Ltd */ @@ -111,7 +111,7 @@ public class DesignContext implements Serializable { /** * Returns a component having the specified local id. If no component is * found, returns null. - * + * * @param localId * The local id of the component * @return a component whose local id equals localId @@ -123,7 +123,7 @@ public class DesignContext implements Serializable { /** * Returns a component having the specified global id. If no component is * found, returns null. - * + * * @param globalId * The global id of the component * @return a component whose global id equals globalId @@ -135,7 +135,7 @@ public class DesignContext implements Serializable { /** * Returns a component having the specified caption. If no component is * found, returns null. - * + * * @param caption * The caption of the component * @return a component whose caption equals the caption given as a parameter @@ -148,15 +148,15 @@ public class DesignContext implements Serializable { * Creates a mapping between the given global id and the component. Returns * true if globalId was already mapped to some component. Otherwise returns * false. Also sets the id of the component to globalId. - * + * * If there is a mapping from the component to a global id (gid) different * from globalId, the mapping from gid to component is removed. - * + * * If the string was mapped to a component c different from the given * component, the mapping from c to the string is removed. Similarly, if * component was mapped to some string s different from globalId, the * mapping from s to component is removed. - * + * * @param globalId * The new global id of the component. * @param component @@ -182,19 +182,19 @@ public class DesignContext implements Serializable { * Creates a mapping between the given local id and the component. Returns * true if localId was already mapped to some component or if component was * mapped to some string. Otherwise returns false. - * + * * If the string was mapped to a component c different from the given * component, the mapping from c to the string is removed. Similarly, if * component was mapped to some string s different from localId, the mapping * from s to component is removed. - * + * * @since 7.5.0 - * + * * @param component * The component whose local id is to be set. * @param localId * The new local id of the component. - * + * * @return true, if there already was a local id mapping from the string to * some component or from the component to some string. Otherwise * returns false. @@ -206,9 +206,9 @@ public class DesignContext implements Serializable { /** * Returns the local id for a component. - * + * * @since 7.5.0 - * + * * @param component * The component whose local id to get. * @return the local id of the component, or null if the component has no @@ -221,13 +221,13 @@ public class DesignContext implements Serializable { /** * Creates a mapping between the given caption and the component. Returns * true if caption was already mapped to some component. - * + * * Note that unlike mapGlobalId, if some component already has the given * caption, the caption is not cleared from the component. This allows * non-unique captions. However, only one of the components corresponding to * a given caption can be found using the map captionToComponent. Hence, any * captions that are used to identify an object should be unique. - * + * * @param caption * The new caption of the component. * @param component @@ -245,10 +245,10 @@ public class DesignContext implements Serializable { * value v different from the given value, the mapping from v to key is * removed. Similarly, if value was mapped to some key k different from key, * the mapping from k to value is removed. - * + * * Returns true if there already was a mapping from key to some value v or * if there was a mapping from value to some key k. Otherwise returns false. - * + * * @param key * The new key in keyToValue. * @param value @@ -275,18 +275,18 @@ public class DesignContext implements Serializable { /** * Creates a two-way mapping between a prefix and a package name. - * + * * Note that modifying the mapping for {@value #VAADIN_UI_PACKAGE} may * invalidate the backwards compatibility mechanism supporting reading such * components with either {@value #LEGACY_PREFIX} or {@value #VAADIN_PREFIX} * as prefix. - * + * * @param prefix * the prefix name without an ending dash (for instance, "vaadin" * is by default used for "com.vaadin.ui") * @param packageName * the name of the package corresponding to prefix - * + * * @see #getPackagePrefixes() * @see #getPackagePrefix(String) * @see #getPackage(String) @@ -299,10 +299,10 @@ public class DesignContext implements Serializable { /** * Gets the prefix mapping for a given package, or null if * there is no mapping for the package. - * + * * @see #addPackagePrefix(String, String) * @see #getPackagePrefixes() - * + * * @since 7.5.0 * @param packageName * the package name to get a prefix for @@ -319,8 +319,8 @@ public class DesignContext implements Serializable { /** * Gets all registered package prefixes. - * - * + * + * * @since 7.5.0 * @see #getPackage(String) * @return a collection of package prefixes @@ -332,7 +332,7 @@ public class DesignContext implements Serializable { /** * Gets the package corresponding to the give prefix, or null * no package has been registered for the prefix - * + * * @since 7.5.0 * @see #addPackagePrefix(String, String) * @param prefix @@ -347,7 +347,7 @@ public class DesignContext implements Serializable { /** * Returns the default instance for the given class. The instance must not * be modified by the caller. - * + * * @param abstractComponent * @return the default instance for the given class. The return value must * not be modified by the caller @@ -391,8 +391,8 @@ public class DesignContext implements Serializable { if ("meta".equals(childElement.tagName())) { Attributes attributes = childElement.attributes(); if (attributes.hasKey("name") - && attributes.hasKey("content") - && "package-mapping".equals(attributes.get("name"))) { + && attributes.hasKey("content") && "package-mapping" + .equals(attributes.get("name"))) { String contentString = attributes.get("content"); String[] parts = contentString.split(":"); if (parts.length != 2) { @@ -413,7 +413,7 @@ public class DesignContext implements Serializable { * the specified document. *

            * The prefixes are stored as tags under in the document. - * + * * @param doc * the Jsoup document tree where the package mappings are written */ @@ -422,7 +422,8 @@ public class DesignContext implements Serializable { for (String prefix : getPackagePrefixes()) { // Only store the prefix-name mapping if it is not a default mapping // (such as "vaadin" -> "com.vaadin.ui") - if (!VAADIN_PREFIX.equals(prefix) && !LEGACY_PREFIX.equals(prefix)) { + if (!VAADIN_PREFIX.equals(prefix) + && !LEGACY_PREFIX.equals(prefix)) { Node newNode = doc.createElement("meta"); newNode.attr("name", "package-mapping"); String prefixToPackageName = prefix + ":" + getPackage(prefix); @@ -437,7 +438,7 @@ public class DesignContext implements Serializable { * be used when writing designs. The property or context parameter * {@link Constants#SERVLET_PARAMETER_LEGACY_DESIGN_PREFIX} can be used to * switch to the legacy prefix. - * + * * @since 7.5.7 * @return true to use the legacy prefix, false by default */ @@ -462,7 +463,7 @@ public class DesignContext implements Serializable { * initializes its attributes by calling writeDesign. As a result of the * writeDesign() call, this method creates the entire subtree rooted at the * returned Node. - * + * * @param childComponent * The component with state that is written in to the node * @return An html tree node corresponding to the given component. The tag @@ -487,7 +488,7 @@ public class DesignContext implements Serializable { /** * Reads the given design node and creates the corresponding component tree - * + * * @param componentDesign * The design element containing the description of the component * to be created. @@ -502,13 +503,13 @@ public class DesignContext implements Serializable { } /** - * + * * Reads the given design node and populates the given component with the * corresponding component tree *

            * Additionally registers the component id, local id and caption of the * given component and all its children in the context - * + * * @param componentDesign * The design element containing the description of the component * to be created @@ -550,7 +551,7 @@ public class DesignContext implements Serializable { /** * Creates a Component corresponding to the given node. Does not set the * attributes for the created object. - * + * * @param node * a node of an html tree * @return a Component corresponding to node, with no attributes set. @@ -579,7 +580,7 @@ public class DesignContext implements Serializable { /** * Instantiates given class via ComponentFactory. - * + * * @param qualifiedClassName * class name to instantiate * @return instance of a given class @@ -599,7 +600,7 @@ public class DesignContext implements Serializable { /** * Returns the root component of a created component hierarchy. - * + * * @return the root component of the hierarchy */ public Component getRootComponent() { @@ -608,7 +609,7 @@ public class DesignContext implements Serializable { /** * Sets the root component of a created component hierarchy. - * + * * @param rootComponent * the root component of the hierarchy */ @@ -619,17 +620,18 @@ public class DesignContext implements Serializable { /** * Adds a component creation listener. The listener will be notified when * components are created while parsing a design template - * + * * @param listener * the component creation listener to be added */ - public void addComponentCreationListener(ComponentCreationListener listener) { + public void addComponentCreationListener( + ComponentCreationListener listener) { listeners.add(listener); } /** * Removes a component creation listener. - * + * * @param listener * the component creation listener to be removed */ @@ -640,13 +642,14 @@ public class DesignContext implements Serializable { /** * Fires component creation event - * + * * @param localId * localId of the component * @param component * the component that was created */ - private void fireComponentCreatedEvent(String localId, Component component) { + private void fireComponentCreatedEvent(String localId, + Component component) { ComponentCreatedEvent event = new ComponentCreatedEvent(localId, component); for (ComponentCreationListener listener : listeners) { @@ -656,14 +659,14 @@ public class DesignContext implements Serializable { /** * Interface to be implemented by component creation listeners - * + * * @author Vaadin Ltd */ public interface ComponentCreationListener extends Serializable { /** * Called when component has been created in the design context - * + * * @param event * the component creation event containing information on the * created component @@ -674,7 +677,7 @@ public class DesignContext implements Serializable { /** * Component creation event that is fired when a component is created in the * context - * + * * @author Vaadin Ltd */ public class ComponentCreatedEvent implements Serializable { @@ -684,7 +687,7 @@ public class DesignContext implements Serializable { /** * Creates a new instance of ComponentCreatedEvent - * + * * @param localId * the local id of the created component * @param component @@ -698,7 +701,7 @@ public class DesignContext implements Serializable { /** * Returns the local id of the created component or null if not exist - * + * * @return the localId */ public String getLocalId() { @@ -707,7 +710,7 @@ public class DesignContext implements Serializable { /** * Returns the created component - * + * * @return the component */ public Component getComponent() { @@ -718,7 +721,7 @@ public class DesignContext implements Serializable { /** * Helper method for component write implementors to determine whether their * children should be written out or not - * + * * @param c * The component being written * @param defaultC @@ -748,7 +751,7 @@ public class DesignContext implements Serializable { * delegate assumes that all component data is provided by a data source * connected to a back end system and that the data should thus not be * written. - * + * * @since 7.5.0 * @see #setShouldWriteDataDelegate(ShouldWriteDataDelegate) * @param component @@ -763,7 +766,7 @@ public class DesignContext implements Serializable { /** * Sets the delegate that determines whether the container data of a * component should be written out. - * + * * @since 7.5.0 * @see #shouldWriteChildren(Component, Component) * @see #getShouldWriteDataDelegate() @@ -783,7 +786,7 @@ public class DesignContext implements Serializable { /** * Gets the delegate that determines whether the container data of a * component should be written out. - * + * * @since 7.5.0 * @see #setShouldWriteDataDelegate(ShouldWriteDataDelegate) * @see #shouldWriteChildren(Component, Component) @@ -795,7 +798,7 @@ public class DesignContext implements Serializable { /** * Gets the attributes that the component did not handle - * + * * @since 7.7 * @param component * the component to get the attributes for @@ -808,7 +811,7 @@ public class DesignContext implements Serializable { /** * Sets a custom attribute not handled by the component. These attributes * are directly written to the component tag. - * + * * @since 7.7 * @param component * the component to set the attribute for diff --git a/server/src/main/java/com/vaadin/ui/declarative/DesignException.java b/server/src/main/java/com/vaadin/ui/declarative/DesignException.java index 01482f84b0..b80e13ef0a 100644 --- a/server/src/main/java/com/vaadin/ui/declarative/DesignException.java +++ b/server/src/main/java/com/vaadin/ui/declarative/DesignException.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -18,8 +18,8 @@ package com.vaadin.ui.declarative; @SuppressWarnings("serial") /** * An exception that is used when reading or writing a design fails. - * - * @since 7.4 + * + * @since 7.4 * @author Vaadin Ltd */ public class DesignException extends RuntimeException { diff --git a/server/src/main/java/com/vaadin/ui/declarative/DesignFormatter.java b/server/src/main/java/com/vaadin/ui/declarative/DesignFormatter.java index 509015130d..b2db59a2a1 100644 --- a/server/src/main/java/com/vaadin/ui/declarative/DesignFormatter.java +++ b/server/src/main/java/com/vaadin/ui/declarative/DesignFormatter.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -49,7 +49,7 @@ import com.vaadin.ui.declarative.converters.DesignToStringConverter; * Class focused on flexible and consistent formatting and parsing of different * values throughout reading and writing {@link Design}. An instance of this * class is used by {@link DesignAttributeHandler}. - * + * * @since 7.4 * @author Vaadin Ltd */ @@ -68,7 +68,7 @@ public class DesignFormatter implements Serializable { /** * Maps default types to their converters. - * + * */ protected void mapDefaultTypes() { // numbers use standard toString/valueOf approach @@ -205,7 +205,7 @@ public class DesignFormatter implements Serializable { /** * Adds a converter for a new type. - * + * * @param converter * Converter to add. */ @@ -215,7 +215,7 @@ public class DesignFormatter implements Serializable { /** * Adds a converter for a given type. - * + * * @param type * Type to convert to/from. * @param converter @@ -228,7 +228,7 @@ public class DesignFormatter implements Serializable { /** * Removes the converter for given type, if it was present. - * + * * @param type * Type to remove converter for. */ @@ -240,7 +240,7 @@ public class DesignFormatter implements Serializable { * Returns a set of classes that have a converter registered. This is not * the same as the list of supported classes - subclasses of classes in * this set are also supported. - * + * * @return An unmodifiable set of classes that have a converter registered. */ protected Set> getRegisteredClasses() { @@ -249,7 +249,7 @@ public class DesignFormatter implements Serializable { /** * Parses a given string as a value of given type - * + * * @param value * String value to convert. * @param type @@ -268,19 +268,20 @@ public class DesignFormatter implements Serializable { /** * Finds a formatter for a given object and attempts to format it. - * + * * @param object * Object to format. * @return String representation of the object, as returned by the * registered converter. */ public String format(Object object) { - return format(object, object == null ? Object.class : object.getClass()); + return format(object, + object == null ? Object.class : object.getClass()); } /** * Formats an object according to a converter suitable for a given type. - * + * * @param object * Object to format. * @param type @@ -292,8 +293,8 @@ public class DesignFormatter implements Serializable { if (object == null) { return null; } else { - Converter converter = findConverterFor(object - .getClass()); + Converter converter = findConverterFor( + object.getClass()); return converter.convertToPresentation(object, String.class, null); } } @@ -301,7 +302,7 @@ public class DesignFormatter implements Serializable { /** * Checks whether or not a value of a given type can be converted. If a * converter for a superclass is found, this will return true. - * + * * @param type * Type to check. * @return true when either a given type or its supertype has a @@ -314,7 +315,7 @@ public class DesignFormatter implements Serializable { /** * Finds a converter for a given type. May return a converter for a * superclass instead, if one is found and {@code strict} is false. - * + * * @param sourceType * Type to find a converter for. * @param strict @@ -353,7 +354,7 @@ public class DesignFormatter implements Serializable { /** * Finds a converter for a given type. May return a converter for a * superclass instead, if one is found. - * + * * @param sourceType * Type to find a converter for. * @return A valid converter for a given type or its subtype, null if @@ -378,7 +379,7 @@ public class DesignFormatter implements Serializable { * Typically, this method will be used by components to encode data (like * option items in {@link AbstractSelect}) when dumping to HTML format *

            - * + * * @since 7.5.7 * @param input * String to be encoded @@ -388,8 +389,8 @@ public class DesignFormatter implements Serializable { if (input == null) { return null; } - return input.replace("&", "&").replace(">", ">") - .replace("<", "<"); + return input.replace("&", "&").replace(">", ">").replace("<", + "<"); } /** @@ -397,13 +398,13 @@ public class DesignFormatter implements Serializable { * Decodes HTML entities in a text from text node and replaces them with * actual characters. *

            - * + * *

            * Typically this method will be used by components to read back data (like * option items in {@link AbstractSelect}) from HTML. Note that this method * unencodes more characters than {@link #encodeForTextNode(String)} encodes *

            - * + * * @since 7.6 * @param input * @return diff --git a/server/src/main/java/com/vaadin/ui/declarative/FieldBinder.java b/server/src/main/java/com/vaadin/ui/declarative/FieldBinder.java index 3766458175..f9955928d9 100644 --- a/server/src/main/java/com/vaadin/ui/declarative/FieldBinder.java +++ b/server/src/main/java/com/vaadin/ui/declarative/FieldBinder.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -31,7 +31,7 @@ import com.vaadin.ui.Component; /** * Binder utility that binds member fields of a design class instance to given * component instances. Only fields of type {@link Component} are bound - * + * * @since 7.4 * @author Vaadin Ltd */ @@ -44,7 +44,7 @@ public class FieldBinder implements Serializable { /** * Creates a new instance of LayoutFieldBinder. - * + * * @param design * the design class instance containing the fields to bind * @throws IntrospectionException @@ -56,7 +56,7 @@ public class FieldBinder implements Serializable { /** * Creates a new instance of LayoutFieldBinder. - * + * * @param design * the instance containing the fields * @param classWithFields @@ -75,7 +75,7 @@ public class FieldBinder implements Serializable { /** * Returns a collection of field names that are not bound. - * + * * @return a collection of fields assignable to Component that are not bound */ public Collection getUnboundFields() throws FieldBindingException { @@ -117,7 +117,7 @@ public class FieldBinder implements Serializable { * id or caption of the instance, depending on which one is defined. If a * field is already bound (not null), {@link FieldBindingException} is * thrown. - * + * * @param instance * the instance to be bound to a field * @return true on success, otherwise false @@ -131,7 +131,7 @@ public class FieldBinder implements Serializable { /** * Tries to bind the given {@link Component} instance to a member field of * the bind target. The fields are matched based on localId, id and caption. - * + * * @param instance * the instance to be bound to a field * @param localId @@ -152,9 +152,8 @@ public class FieldBinder implements Serializable { if (!success) { String idInfo = "localId: " + localId + " id: " + instance.getId() + " caption: " + instance.getCaption(); - getLogger().finest( - "Could not bind component to a field " - + instance.getClass().getName() + " " + idInfo); + getLogger().finest("Could not bind component to a field " + + instance.getClass().getName() + " " + idInfo); } return success; } @@ -164,7 +163,7 @@ public class FieldBinder implements Serializable { * the bind target. The field is matched based on the given identifier. If a * field is already bound (not null), {@link FieldBindingException} is * thrown. - * + * * @param identifier * the identifier for the field. * @param instance @@ -173,7 +172,8 @@ public class FieldBinder implements Serializable { * @throws FieldBindingException * if error occurs when trying to bind the instance to a field */ - private boolean bindFieldByIdentifier(String identifier, Component instance) { + private boolean bindFieldByIdentifier(String identifier, + Component instance) { try { // create and validate field name String fieldName = asFieldName(identifier); @@ -183,27 +183,26 @@ public class FieldBinder implements Serializable { // validate that the field can be found Field field = fieldMap.get(fieldName.toLowerCase(Locale.ENGLISH)); if (field == null) { - getLogger().fine( - "No field was found by identifier " + identifier); + getLogger() + .fine("No field was found by identifier " + identifier); return false; } // validate that the field is not set Object fieldValue = getFieldValue(bindTarget, field); if (fieldValue != null) { - getLogger().fine( - "The field \"" + fieldName - + "\" was already mapped. Ignoring."); + getLogger().fine("The field \"" + fieldName + + "\" was already mapped. Ignoring."); } else { // set the field value field.set(bindTarget, instance); } return true; } catch (IllegalAccessException e) { - throw new FieldBindingException("Field binding failed for " - + identifier, e); + throw new FieldBindingException( + "Field binding failed for " + identifier, e); } catch (IllegalArgumentException e) { - throw new FieldBindingException("Field binding failed for " - + identifier, e); + throw new FieldBindingException( + "Field binding failed for " + identifier, e); } } @@ -219,7 +218,7 @@ public class FieldBinder implements Serializable { /** * Converts the given identifier to a valid field name by stripping away * illegal character and setting the first letter of the name to lower case. - * + * * @param identifier * the identifier to be converted to field name * @return the field name corresponding the identifier @@ -246,7 +245,7 @@ public class FieldBinder implements Serializable { * Returns a list containing Field objects reflecting all the fields of the * class or interface represented by this Class object. The fields in * superclasses are excluded. - * + * * @param searchClass * the class to be scanned for fields * @return the list of fields in this class diff --git a/server/src/main/java/com/vaadin/ui/declarative/FieldBindingException.java b/server/src/main/java/com/vaadin/ui/declarative/FieldBindingException.java index d8b587a14c..12b830ffef 100644 --- a/server/src/main/java/com/vaadin/ui/declarative/FieldBindingException.java +++ b/server/src/main/java/com/vaadin/ui/declarative/FieldBindingException.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -18,7 +18,7 @@ package com.vaadin.ui.declarative; /** * Exception that is thrown when an error occurs during field binding when * reading a design template - * + * * @since 7.4 * @author Vaadin Ltd */ diff --git a/server/src/main/java/com/vaadin/ui/declarative/ShouldWriteDataDelegate.java b/server/src/main/java/com/vaadin/ui/declarative/ShouldWriteDataDelegate.java index 9cb1f1c605..5fbcba0d0c 100644 --- a/server/src/main/java/com/vaadin/ui/declarative/ShouldWriteDataDelegate.java +++ b/server/src/main/java/com/vaadin/ui/declarative/ShouldWriteDataDelegate.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -22,9 +22,9 @@ import com.vaadin.ui.Component; /** * Delegate used by {@link DesignContext} to determine whether container data * should be written out for a component. - * + * * @see DesignContext#shouldWriteData(Component) - * + * * @since 7.5.0 * @author Vaadin Ltd */ @@ -45,7 +45,7 @@ public interface ShouldWriteDataDelegate extends Serializable { /** * Determines whether the container data of a component should be written * out. - * + * * @param component * the component to check * @return true if container data should be written out for the diff --git a/server/src/main/java/com/vaadin/ui/declarative/converters/DesignDateConverter.java b/server/src/main/java/com/vaadin/ui/declarative/converters/DesignDateConverter.java index d2d63ad16e..65d1b73202 100644 --- a/server/src/main/java/com/vaadin/ui/declarative/converters/DesignDateConverter.java +++ b/server/src/main/java/com/vaadin/ui/declarative/converters/DesignDateConverter.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -26,7 +26,7 @@ import com.vaadin.ui.declarative.DesignAttributeHandler; /** * A date converter to be used by {@link DesignAttributeHandler}. Provides * ISO-compliant way of storing date and time. - * + * * @since 7.4 * @author Vaadin Ltd */ diff --git a/server/src/main/java/com/vaadin/ui/declarative/converters/DesignEnumConverter.java b/server/src/main/java/com/vaadin/ui/declarative/converters/DesignEnumConverter.java index 9f07ff9560..acfb2224f8 100644 --- a/server/src/main/java/com/vaadin/ui/declarative/converters/DesignEnumConverter.java +++ b/server/src/main/java/com/vaadin/ui/declarative/converters/DesignEnumConverter.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -23,7 +23,7 @@ import com.vaadin.ui.declarative.DesignAttributeHandler; /** * An converter for Enum to/from String for {@link DesignAttributeHandler} to * use internally. - * + * * @since 7.4 * @author Vaadin Ltd */ diff --git a/server/src/main/java/com/vaadin/ui/declarative/converters/DesignObjectConverter.java b/server/src/main/java/com/vaadin/ui/declarative/converters/DesignObjectConverter.java index f11585d6b8..dfa0b5ca73 100644 --- a/server/src/main/java/com/vaadin/ui/declarative/converters/DesignObjectConverter.java +++ b/server/src/main/java/com/vaadin/ui/declarative/converters/DesignObjectConverter.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -23,7 +23,7 @@ import com.vaadin.ui.declarative.DesignAttributeHandler; /** * An converter for Object to/from String for {@link DesignAttributeHandler} to * use internally. - * + * * @since 7.4 * @author Vaadin Ltd */ diff --git a/server/src/main/java/com/vaadin/ui/declarative/converters/DesignResourceConverter.java b/server/src/main/java/com/vaadin/ui/declarative/converters/DesignResourceConverter.java index ffa51fedd1..40a6911015 100644 --- a/server/src/main/java/com/vaadin/ui/declarative/converters/DesignResourceConverter.java +++ b/server/src/main/java/com/vaadin/ui/declarative/converters/DesignResourceConverter.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -35,7 +35,7 @@ import com.vaadin.ui.declarative.DesignAttributeHandler; /** * A converter for {@link Resource} implementations supported by * {@link DesignAttributeHandler}. - * + * * @since 7.4 * @author Vaadin Ltd */ @@ -73,8 +73,8 @@ public class DesignResourceConverter implements Converter { if (byType != null) { return byType.format(value); } else { - throw new Converter.ConversionException("unknown Resource type - " - + value.getClass().getName()); + throw new Converter.ConversionException( + "unknown Resource type - " + value.getClass().getName()); } } @@ -94,8 +94,8 @@ public class DesignResourceConverter implements Converter { public Resource parse(String value); } - private static enum ResourceConverterByProtocol implements - ProtocolResourceConverter { + private static enum ResourceConverterByProtocol + implements ProtocolResourceConverter { HTTP, HTTPS, FTP, FTPS, THEME { @@ -125,7 +125,8 @@ public class DesignResourceConverter implements Converter { } catch (IllegalArgumentException iae) { throw new ConversionException( "Unknown codepoint in FontAwesome: " - + codepoint, iae); + + codepoint, + iae); } } @@ -154,17 +155,17 @@ public class DesignResourceConverter implements Converter { try { return FontAwesome.valueOf(iconName); } catch (IllegalArgumentException iae) { - throw new ConversionException("Unknown FontIcon constant: " - + iconName, iae); + throw new ConversionException( + "Unknown FontIcon constant: " + iconName, iae); } } @Override public String format(Resource value) throws Converter.ConversionException { - throw new UnsupportedOperationException("Use " - + ResourceConverterByProtocol.FONTICON.toString() - + " instead"); + throw new UnsupportedOperationException( + "Use " + ResourceConverterByProtocol.FONTICON.toString() + + " instead"); } }, FILE { diff --git a/server/src/main/java/com/vaadin/ui/declarative/converters/DesignShortcutActionConverter.java b/server/src/main/java/com/vaadin/ui/declarative/converters/DesignShortcutActionConverter.java index d6f2f65938..8fc98ad410 100644 --- a/server/src/main/java/com/vaadin/ui/declarative/converters/DesignShortcutActionConverter.java +++ b/server/src/main/java/com/vaadin/ui/declarative/converters/DesignShortcutActionConverter.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -28,12 +28,12 @@ import com.vaadin.event.ShortcutAction.ModifierKey; /** * Converter for {@link ShortcutActions}. - * + * * @since 7.4 * @author Vaadin Ltd */ -public class DesignShortcutActionConverter implements - Converter { +public class DesignShortcutActionConverter + implements Converter { private final Map keyCodeMap; private final Map presentationMap; @@ -135,8 +135,8 @@ public class DesignShortcutActionConverter implements String keyCodePart = parts[parts.length - 1]; int keyCode = getKeycodeForString(keyCodePart); if (keyCode < 0) { - throw new IllegalArgumentException("Invalid key '" - + keyCodePart + "'"); + throw new IllegalArgumentException( + "Invalid key '" + keyCodePart + "'"); } // handle modifiers int[] modifiers = null; @@ -148,14 +148,15 @@ public class DesignShortcutActionConverter implements if (modifier > 0) { modifiers[i] = modifier; } else { - throw new IllegalArgumentException("Invalid modifier '" - + parts[i] + "'"); + throw new IllegalArgumentException( + "Invalid modifier '" + parts[i] + "'"); } } return new ShortcutAction(data.length == 2 ? data[1] : null, keyCode, modifiers); } catch (Exception e) { - throw new ConversionException("Invalid shortcut '" + value + "'", e); + throw new ConversionException("Invalid shortcut '" + value + "'", + e); } } diff --git a/server/src/main/java/com/vaadin/ui/declarative/converters/DesignTimeZoneConverter.java b/server/src/main/java/com/vaadin/ui/declarative/converters/DesignTimeZoneConverter.java index 51f47edac9..cbd9892fa7 100644 --- a/server/src/main/java/com/vaadin/ui/declarative/converters/DesignTimeZoneConverter.java +++ b/server/src/main/java/com/vaadin/ui/declarative/converters/DesignTimeZoneConverter.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -24,7 +24,7 @@ import com.vaadin.ui.declarative.DesignAttributeHandler; /** * Utility class for {@link DesignAttributeHandler} that deals with converting * various TimeZones to string. - * + * * @since 7.4 * @author Vaadin Ltd */ diff --git a/server/src/main/java/com/vaadin/ui/declarative/converters/DesignToStringConverter.java b/server/src/main/java/com/vaadin/ui/declarative/converters/DesignToStringConverter.java index 0c6cf55bed..94ed4ea74b 100644 --- a/server/src/main/java/com/vaadin/ui/declarative/converters/DesignToStringConverter.java +++ b/server/src/main/java/com/vaadin/ui/declarative/converters/DesignToStringConverter.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -24,7 +24,7 @@ import com.vaadin.ui.declarative.DesignAttributeHandler; /** * Utility class for {@link DesignAttributeHandler} that deals with converting * various types to string. - * + * * @since 7.4 * @author Vaadin Ltd * @param @@ -45,7 +45,7 @@ public class DesignToStringConverter implements Converter { * Constructs the converter for a given type. Implicitly requires that a * static method {@code valueOf(String)} is present in the type to do the * conversion. - * + * * @param type * Type of values to convert. */ @@ -56,7 +56,7 @@ public class DesignToStringConverter implements Converter { /** * Constructs the converter for a given type, giving the name of the public * static method that does the conversion from String. - * + * * @param type * Type to convert. * @param staticMethodName @@ -74,9 +74,8 @@ public class DesignToStringConverter implements Converter { public TYPE convertToModel(String value, Class targetType, Locale locale) throws Converter.ConversionException { try { - return type.cast(type - .getMethod(this.staticMethodName, String.class).invoke( - null, value)); + return type.cast(type.getMethod(this.staticMethodName, String.class) + .invoke(null, value)); } catch (IllegalAccessException e) { throw new Converter.ConversionException(e); } catch (IllegalArgumentException e) { diff --git a/server/src/main/java/com/vaadin/ui/declarative/converters/ShortcutKeyMapper.java b/server/src/main/java/com/vaadin/ui/declarative/converters/ShortcutKeyMapper.java index 2940c82c06..7796ce90d7 100644 --- a/server/src/main/java/com/vaadin/ui/declarative/converters/ShortcutKeyMapper.java +++ b/server/src/main/java/com/vaadin/ui/declarative/converters/ShortcutKeyMapper.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,7 +25,7 @@ import com.vaadin.event.ShortcutAction.ModifierKey; /** * Provides mappings between shortcut keycodes and their representation in * design attributes. Contains a default framework implementation as a field. - * + * * @since 7.4 * @author Vaadin Ltd */ @@ -33,7 +33,7 @@ public interface ShortcutKeyMapper extends Serializable { /** * Gets the key code for a given string. - * + * * @param attributePresentation * String * @return Key code. @@ -42,7 +42,7 @@ public interface ShortcutKeyMapper extends Serializable { /** * Returns a string for a given key code. - * + * * @param keyCode * Key code. * @return String. diff --git a/server/src/main/java/com/vaadin/ui/renderers/AbstractJavaScriptRenderer.java b/server/src/main/java/com/vaadin/ui/renderers/AbstractJavaScriptRenderer.java index 91a5c0ea45..e196d861c1 100644 --- a/server/src/main/java/com/vaadin/ui/renderers/AbstractJavaScriptRenderer.java +++ b/server/src/main/java/com/vaadin/ui/renderers/AbstractJavaScriptRenderer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -42,7 +42,7 @@ import elemental.json.JsonValue; * com_example_SuperRenderer will also be attempted if * com_example_MyRenderer has not been defined. *

            - * + * * In addition to the general JavaScript extension functionality explained in * {@link AbstractJavaScriptExtension}, this class also provides some * functionality specific for renderers. @@ -90,7 +90,7 @@ import elemental.json.JsonValue; * {@link com.vaadin.client.renderers.ComplexRenderer#onBrowserEvent(com.vaadin.client.widget.grid.CellReference, com.google.gwt.dom.client.NativeEvent)} * . * - * + * *

            * The cell object passed to functions defined by the renderer has these * properties: @@ -105,11 +105,12 @@ import elemental.json.JsonValue; * supported in the object passed to the render function - other * functions should not use the property. Readable and writable. * - * + * * @author Vaadin Ltd * @since 7.4 */ -public abstract class AbstractJavaScriptRenderer extends AbstractRenderer { +public abstract class AbstractJavaScriptRenderer + extends AbstractRenderer { private JavaScriptCallbackHelper callbackHelper = new JavaScriptCallbackHelper( this); @@ -136,14 +137,15 @@ public abstract class AbstractJavaScriptRenderer extends AbstractRenderer * 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) { + protected void addFunction(String functionName, + JavaScriptFunction function) { callbackHelper.registerCallback(functionName, function); } @@ -156,7 +158,7 @@ public abstract class AbstractJavaScriptRenderer extends AbstractRenderer * before sending. This can be done either with * {@link JsonCodec#encode(Object, JsonValue, java.lang.reflect.Type, com.vaadin.ui.ConnectorTracker)} * or using the factory methods in {@link Json}. - * + * * @param name * the name of the function * @param arguments diff --git a/server/src/main/java/com/vaadin/ui/renderers/ButtonRenderer.java b/server/src/main/java/com/vaadin/ui/renderers/ButtonRenderer.java index e7e723ebd6..3c24ecab01 100644 --- a/server/src/main/java/com/vaadin/ui/renderers/ButtonRenderer.java +++ b/server/src/main/java/com/vaadin/ui/renderers/ButtonRenderer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,7 +21,7 @@ import elemental.json.JsonValue; * A Renderer that displays a button with a textual caption. The value of the * corresponding property is used as the caption. Click listeners can be added * to the renderer, invoked when any of the rendered buttons is clicked. - * + * * @since 7.4 * @author Vaadin Ltd */ @@ -39,7 +39,7 @@ public class ButtonRenderer extends ClickableRenderer { /** * Creates a new button renderer and adds the given click listener to it. - * + * * @param listener * the click listener to register * @param nullRepresentation diff --git a/server/src/main/java/com/vaadin/ui/renderers/ClickableRenderer.java b/server/src/main/java/com/vaadin/ui/renderers/ClickableRenderer.java index 7210eb7840..072fe2d471 100644 --- a/server/src/main/java/com/vaadin/ui/renderers/ClickableRenderer.java +++ b/server/src/main/java/com/vaadin/ui/renderers/ClickableRenderer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -30,10 +30,10 @@ import com.vaadin.util.ReflectTools; * An abstract superclass for Renderers that render clickable items. Click * listeners can be added to a renderer to be notified when any of the rendered * items is clicked. - * + * * @param * the type presented by the renderer - * + * * @since 7.4 * @author Vaadin Ltd */ @@ -42,7 +42,7 @@ public class ClickableRenderer extends AbstractRenderer { /** * An interface for listening to {@link RendererClickEvent renderer click * events}. - * + * * @see {@link ButtonRenderer#addClickListener(RendererClickListener)} */ public interface RendererClickListener extends ConnectorEventListener { @@ -52,7 +52,7 @@ public class ClickableRenderer extends AbstractRenderer { /** * Called when a rendered button is clicked. - * + * * @param event * the event representing the click */ @@ -76,7 +76,7 @@ public class ClickableRenderer extends AbstractRenderer { /** * Returns the item ID of the row where the click event originated. - * + * * @return the item ID of the clicked row */ public Object getItemId() { @@ -85,7 +85,7 @@ public class ClickableRenderer extends AbstractRenderer { /** * Returns the {@link Column} where the click event originated. - * + * * @return the column of the click event */ public Column getColumn() { @@ -94,7 +94,7 @@ public class ClickableRenderer extends AbstractRenderer { /** * Returns the property ID where the click event originated. - * + * * @return the property ID of the clicked cell */ public Object getPropertyId() { @@ -122,7 +122,7 @@ public class ClickableRenderer extends AbstractRenderer { /** * Adds a click listener to this button renderer. The listener is invoked * every time one of the buttons rendered by this renderer is clicked. - * + * * @param listener * the click listener to be added */ @@ -133,7 +133,7 @@ public class ClickableRenderer extends AbstractRenderer { /** * Removes the given click listener from this renderer. - * + * * @param listener * the click listener to be removed */ diff --git a/server/src/main/java/com/vaadin/ui/renderers/DateRenderer.java b/server/src/main/java/com/vaadin/ui/renderers/DateRenderer.java index dddeb6cd77..0c7acb4c17 100644 --- a/server/src/main/java/com/vaadin/ui/renderers/DateRenderer.java +++ b/server/src/main/java/com/vaadin/ui/renderers/DateRenderer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,7 +25,7 @@ import elemental.json.JsonValue; /** * A renderer for presenting date values. - * + * * @since 7.4 * @author Vaadin Ltd */ @@ -49,7 +49,7 @@ public class DateRenderer extends AbstractRenderer { *

            * The renderer is configured to render with the {@link Date#toString()} * representation for the given locale. - * + * * @param locale * the locale in which to present dates * @throws IllegalArgumentException @@ -82,13 +82,13 @@ public class DateRenderer extends AbstractRenderer { *

            * The renderer is configured to render with the given string format, as * displayed in the default locale. - * + * * @param formatString * the format string with which to format the date * @throws IllegalArgumentException * if {@code formatString} is {@code null} - * @see Format + * @see Format * String Syntax */ public DateRenderer(String formatString) throws IllegalArgumentException { @@ -107,8 +107,8 @@ public class DateRenderer extends AbstractRenderer { * the textual representation of {@code null} value * @throws IllegalArgumentException * if {@code formatString} is {@code null} - * @see Format + * @see Format * String Syntax */ public DateRenderer(String formatString, String nullRepresentation) @@ -121,15 +121,15 @@ public class DateRenderer extends AbstractRenderer { *

            * The renderer is configured to render with the given string format, as * displayed in the given locale. - * + * * @param formatString * the format string to format the date with * @param locale * the locale to use * @throws IllegalArgumentException * if either argument is {@code null} - * @see Format + * @see Format * String Syntax */ public DateRenderer(String formatString, Locale locale) @@ -151,8 +151,8 @@ public class DateRenderer extends AbstractRenderer { * the textual representation of {@code null} value * @throws IllegalArgumentException * if either argument is {@code null} - * @see Format + * @see Format * String Syntax */ public DateRenderer(String formatString, Locale locale, @@ -176,7 +176,7 @@ public class DateRenderer extends AbstractRenderer { * Creates a new date renderer. *

            * The renderer is configured to render with he given date format. - * + * * @param dateFormat * the date format to use when rendering dates * @throws IllegalArgumentException diff --git a/server/src/main/java/com/vaadin/ui/renderers/HtmlRenderer.java b/server/src/main/java/com/vaadin/ui/renderers/HtmlRenderer.java index 2ec43800c0..bbee5865dd 100644 --- a/server/src/main/java/com/vaadin/ui/renderers/HtmlRenderer.java +++ b/server/src/main/java/com/vaadin/ui/renderers/HtmlRenderer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/server/src/main/java/com/vaadin/ui/renderers/ImageRenderer.java b/server/src/main/java/com/vaadin/ui/renderers/ImageRenderer.java index ad7d5cae2b..87e89af8a5 100644 --- a/server/src/main/java/com/vaadin/ui/renderers/ImageRenderer.java +++ b/server/src/main/java/com/vaadin/ui/renderers/ImageRenderer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -29,7 +29,7 @@ import elemental.json.JsonValue; * The image for each rendered cell is read from a Resource-typed property in * the data source. Only {@link ExternalResource}s and {@link ThemeResource}s * are currently supported. - * + * * @since 7.4 * @author Vaadin Ltd */ @@ -44,7 +44,7 @@ public class ImageRenderer extends ClickableRenderer { /** * Creates a new image renderer and adds the given click listener to it. - * + * * @param listener * the click listener to register */ @@ -55,7 +55,8 @@ public class ImageRenderer extends ClickableRenderer { @Override public JsonValue encode(Resource resource) { - if (!(resource == null || resource instanceof ExternalResource || resource instanceof ThemeResource)) { + if (!(resource == null || resource instanceof ExternalResource + || resource instanceof ThemeResource)) { throw new IllegalArgumentException( "ImageRenderer only supports ExternalResource and ThemeResource (" + resource.getClass().getSimpleName() + " given)"); diff --git a/server/src/main/java/com/vaadin/ui/renderers/NumberRenderer.java b/server/src/main/java/com/vaadin/ui/renderers/NumberRenderer.java index b1ba309c9a..885cb00f24 100644 --- a/server/src/main/java/com/vaadin/ui/renderers/NumberRenderer.java +++ b/server/src/main/java/com/vaadin/ui/renderers/NumberRenderer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -128,8 +128,8 @@ public class NumberRenderer extends AbstractRenderer { * the format string with which to format the number * @throws IllegalArgumentException * if {@code formatString} is {@code null} - * @see Format + * @see Format * String Syntax */ public NumberRenderer(String formatString) throws IllegalArgumentException { @@ -148,8 +148,8 @@ public class NumberRenderer extends AbstractRenderer { * the locale in which to present numbers * @throws IllegalArgumentException * if either argument is {@code null} - * @see Format + * @see Format * String Syntax */ public NumberRenderer(String formatString, Locale locale, @@ -179,9 +179,9 @@ public class NumberRenderer extends AbstractRenderer { } else if (numberFormat != null) { stringValue = numberFormat.format(value); } else { - throw new IllegalStateException(String.format("Internal bug: " - + "%s is in an illegal state: " - + "[locale: %s, numberFormat: %s, formatString: %s]", + throw new IllegalStateException(String.format( + "Internal bug: " + "%s is in an illegal state: " + + "[locale: %s, numberFormat: %s, formatString: %s]", getClass().getSimpleName(), locale, numberFormat, formatString)); } diff --git a/server/src/main/java/com/vaadin/ui/renderers/ProgressBarRenderer.java b/server/src/main/java/com/vaadin/ui/renderers/ProgressBarRenderer.java index 1566c47222..edcc44c719 100644 --- a/server/src/main/java/com/vaadin/ui/renderers/ProgressBarRenderer.java +++ b/server/src/main/java/com/vaadin/ui/renderers/ProgressBarRenderer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/server/src/main/java/com/vaadin/ui/renderers/Renderer.java b/server/src/main/java/com/vaadin/ui/renderers/Renderer.java index ac85174618..2a4d303ca2 100644 --- a/server/src/main/java/com/vaadin/ui/renderers/Renderer.java +++ b/server/src/main/java/com/vaadin/ui/renderers/Renderer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -26,10 +26,10 @@ import elemental.json.JsonValue; * currently extend the Extension interface, but this fact should be regarded as * an implementation detail and subject to change in a future major or minor * Vaadin revision. - * + * * @param * the type this renderer knows how to present - * + * * @since 7.4 * @author Vaadin Ltd */ @@ -37,14 +37,14 @@ public interface Renderer extends Extension { /** * Returns the class literal corresponding to the presentation type T. - * + * * @return the class literal of T */ Class getPresentationType(); /** * Encodes the given value into a {@link JsonValue}. - * + * * @param value * the value to encode * @return a JSON representation of the given value diff --git a/server/src/main/java/com/vaadin/ui/renderers/TextRenderer.java b/server/src/main/java/com/vaadin/ui/renderers/TextRenderer.java index ce8a73d057..d2d4b38b2d 100644 --- a/server/src/main/java/com/vaadin/ui/renderers/TextRenderer.java +++ b/server/src/main/java/com/vaadin/ui/renderers/TextRenderer.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,7 +20,7 @@ import elemental.json.JsonValue; /** * A renderer for presenting simple plain-text string values. - * + * * @since 7.4 * @author Vaadin Ltd */ @@ -35,7 +35,7 @@ public class TextRenderer extends AbstractRenderer { /** * Creates a new text renderer - * + * * @param nullRepresentation * the textual representation of {@code null} value */ diff --git a/server/src/main/java/com/vaadin/ui/themes/BaseTheme.java b/server/src/main/java/com/vaadin/ui/themes/BaseTheme.java index 9421cf2341..5ec3f9dd88 100644 --- a/server/src/main/java/com/vaadin/ui/themes/BaseTheme.java +++ b/server/src/main/java/com/vaadin/ui/themes/BaseTheme.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -30,9 +30,9 @@ package com.vaadin.ui.themes; *

            * All theme class files should follow the convention of specifying the theme * name as a string constant THEME_NAME. - * + * * @since 6.3.0 - * + * */ public class BaseTheme { diff --git a/server/src/main/java/com/vaadin/ui/themes/ChameleonTheme.java b/server/src/main/java/com/vaadin/ui/themes/ChameleonTheme.java index 6e230c426e..766a6b5486 100644 --- a/server/src/main/java/com/vaadin/ui/themes/ChameleonTheme.java +++ b/server/src/main/java/com/vaadin/ui/themes/ChameleonTheme.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -313,9 +313,9 @@ public class ChameleonTheme extends BaseTheme { * segment, and add "first" and "last" style names * for the first and last button in the segment. Then use the * {@link #BUTTON_DOWN} style to indicate button states. - * + * * E.g. - * + * *

                  * HorizontalLayout ("segment")
                  *   + Button ("first down")
            @@ -324,7 +324,7 @@ public class ChameleonTheme extends BaseTheme {
                  *    ...
                  *   + Button ("last")
                  * 
            - * + * * You can also use most of the different button styles for the contained * buttons (e.g. {@link #BUTTON_BIG}, {@link #BUTTON_ICON_ONLY} etc.). */ @@ -335,9 +335,9 @@ public class ChameleonTheme extends BaseTheme { * {@link #COMPOUND_HORIZONTAL_LAYOUT_SEGMENT} style to make buttons with * the "down" style use the themes alternate color (e.g. blue instead of * gray). - * + * * E.g. - * + * *
                  * HorizontalLayout ("segment segment-alternate")
                  *   + Button ("first down")
            @@ -352,9 +352,9 @@ public class ChameleonTheme extends BaseTheme {
                 /**
                  * Creates an iTunes-like menu from a CssLayout or a VerticalLayout. Place
                  * plain Labels and NativeButtons inside the layout, and you're all set.
            -     * 
            +     *
                  * E.g.
            -     * 
            +     *
                  * 
                  * CssLayout ("sidebar-menu")
                  *   + Label
            diff --git a/server/src/main/java/com/vaadin/ui/themes/LiferayTheme.java b/server/src/main/java/com/vaadin/ui/themes/LiferayTheme.java
            index de56be39ac..e1368ea726 100644
            --- a/server/src/main/java/com/vaadin/ui/themes/LiferayTheme.java
            +++ b/server/src/main/java/com/vaadin/ui/themes/LiferayTheme.java
            @@ -1,12 +1,12 @@
             /*
              * Copyright 2000-2014 Vaadin Ltd.
            - * 
            + *
              * Licensed under the Apache 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
            @@ -20,9 +20,9 @@ public class LiferayTheme extends BaseTheme {
                 public static final String THEME_NAME = "liferay";
             
                 /***************************************************************************
            -     * 
            +     *
                  * Panel styles
            -     * 
            +     *
                  **************************************************************************/
             
                 /**
            @@ -31,9 +31,9 @@ public class LiferayTheme extends BaseTheme {
                 public static final String PANEL_LIGHT = "light";
             
                 /***************************************************************************
            -     * 
            +     *
                  * SplitPanel styles
            -     * 
            +     *
                  **************************************************************************/
             
                 /**
            diff --git a/server/src/main/java/com/vaadin/ui/themes/Reindeer.java b/server/src/main/java/com/vaadin/ui/themes/Reindeer.java
            index e0ab792a15..264edd49c5 100644
            --- a/server/src/main/java/com/vaadin/ui/themes/Reindeer.java
            +++ b/server/src/main/java/com/vaadin/ui/themes/Reindeer.java
            @@ -1,12 +1,12 @@
             /*
              * Copyright 2000-2014 Vaadin Ltd.
            - * 
            + *
              * Licensed under the Apache 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
            @@ -20,9 +20,9 @@ public class Reindeer extends BaseTheme {
                 public static final String THEME_NAME = "reindeer";
             
                 /***************************************************************************
            -     * 
            +     *
                  * Label styles
            -     * 
            +     *
                  **************************************************************************/
             
                 /**
            @@ -41,9 +41,9 @@ public class Reindeer extends BaseTheme {
                 public static final String LABEL_SMALL = "light";
             
                 /***************************************************************************
            -     * 
            +     *
                  * Button styles
            -     * 
            +     *
                  **************************************************************************/
             
                 /**
            @@ -59,9 +59,9 @@ public class Reindeer extends BaseTheme {
                 public static final String BUTTON_SMALL = "small";
             
                 /***************************************************************************
            -     * 
            +     *
                  * TextField styles
            -     * 
            +     *
                  **************************************************************************/
             
                 /**
            @@ -70,9 +70,9 @@ public class Reindeer extends BaseTheme {
                 public static final String TEXTFIELD_SMALL = "small";
             
                 /***************************************************************************
            -     * 
            +     *
                  * Panel styles
            -     * 
            +     *
                  **************************************************************************/
             
                 /**
            @@ -81,9 +81,9 @@ public class Reindeer extends BaseTheme {
                 public static final String PANEL_LIGHT = "light";
             
                 /***************************************************************************
            -     * 
            +     *
                  * ProgressBar Styles
            -     * 
            +     *
                  **************************************************************************/
             
                 /**
            @@ -93,9 +93,9 @@ public class Reindeer extends BaseTheme {
                 public static final String PROGRESSBAR_STATIC = "static";
             
                 /***************************************************************************
            -     * 
            +     *
                  * SplitPanel styles
            -     * 
            +     *
                  **************************************************************************/
             
                 /**
            @@ -104,9 +104,9 @@ public class Reindeer extends BaseTheme {
                 public static final String SPLITPANEL_SMALL = "small";
             
                 /***************************************************************************
            -     * 
            +     *
                  * TabSheet styles
            -     * 
            +     *
                  **************************************************************************/
             
                 /**
            @@ -138,9 +138,9 @@ public class Reindeer extends BaseTheme {
                 public static final String TABSHEET_SELECTED_CLOSABLE = "selected-closable";
             
                 /***************************************************************************
            -     * 
            +     *
                  * Table styles
            -     * 
            +     *
                  **************************************************************************/
             
                 /**
            @@ -154,9 +154,9 @@ public class Reindeer extends BaseTheme {
                 public static final String TABLE_STRONG = "strong";
             
                 /***************************************************************************
            -     * 
            +     *
                  * Layout styles
            -     * 
            +     *
                  **************************************************************************/
             
                 /**
            @@ -165,7 +165,7 @@ public class Reindeer extends BaseTheme {
                  * {@link FormLayout}, {@link CssLayout}, {@link VerticalSplitPanel} and
                  * {@link HorizontalSplitPanel}.
                  * 

            - * Does not revert any contained components back to normal if some + * Does not revert any contained components back to normal if some * parent layout has style {@link #LAYOUT_BLACK} applied. */ public static final String LAYOUT_WHITE = "white"; @@ -176,7 +176,7 @@ public class Reindeer extends BaseTheme { * {@link FormLayout}, {@link CssLayout}, {@link VerticalSplitPanel} and * {@link HorizontalSplitPanel}. *

            - * Does not revert any contained components back to normal if some + * Does not revert any contained components back to normal if some * parent layout has style {@link #LAYOUT_BLACK} applied. */ public static final String LAYOUT_BLUE = "blue"; @@ -192,14 +192,14 @@ public class Reindeer extends BaseTheme { * Applies to {@link VerticalLayout}, {@link HorizontalLayout}, * {@link GridLayout}, {@link FormLayout} and {@link CssLayout}. *

            - * + * */ public static final String LAYOUT_BLACK = "black"; /*************************************************************************** - * + * * Window styles - * + * **************************************************************************/ /** diff --git a/server/src/main/java/com/vaadin/ui/themes/Runo.java b/server/src/main/java/com/vaadin/ui/themes/Runo.java index 6f8d5f37d9..e36a7c49af 100644 --- a/server/src/main/java/com/vaadin/ui/themes/Runo.java +++ b/server/src/main/java/com/vaadin/ui/themes/Runo.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -24,9 +24,9 @@ public class Runo extends BaseTheme { } /*************************************************************************** - * + * * Button styles - * + * **************************************************************************/ /** @@ -47,9 +47,9 @@ public class Runo extends BaseTheme { public static final String BUTTON_DEFAULT = "default"; /*************************************************************************** - * + * * Panel styles - * + * **************************************************************************/ /** @@ -58,9 +58,9 @@ public class Runo extends BaseTheme { public static final String PANEL_LIGHT = "light"; /*************************************************************************** - * + * * ProgressBar Styles - * + * **************************************************************************/ /** @@ -70,9 +70,9 @@ public class Runo extends BaseTheme { public static final String PROGRESSBAR_STATIC = "static"; /*************************************************************************** - * + * * TabSheet styles - * + * **************************************************************************/ /** @@ -81,9 +81,9 @@ public class Runo extends BaseTheme { public static final String TABSHEET_SMALL = "light"; /*************************************************************************** - * + * * SplitPanel styles - * + * **************************************************************************/ /** @@ -99,9 +99,9 @@ public class Runo extends BaseTheme { public static final String SPLITPANEL_SMALL = "small"; /*************************************************************************** - * + * * Label styles - * + * **************************************************************************/ /** @@ -123,9 +123,9 @@ public class Runo extends BaseTheme { public static final String LABEL_SMALL = "small"; /*************************************************************************** - * + * * Layout styles - * + * **************************************************************************/ /** @@ -153,9 +153,9 @@ public class Runo extends BaseTheme { public static final String CSSLAYOUT_SELECTABLE_SELECTED = "selectable-selected"; /*************************************************************************** - * + * * TextField styles - * + * **************************************************************************/ /** @@ -164,9 +164,9 @@ public class Runo extends BaseTheme { public static final String TEXTFIELD_SMALL = "small"; /*************************************************************************** - * + * * Table styles - * + * **************************************************************************/ /** @@ -181,9 +181,9 @@ public class Runo extends BaseTheme { public static final String TABLE_BORDERLESS = "borderless"; /*************************************************************************** - * + * * Accordion styles - * + * **************************************************************************/ /** @@ -194,9 +194,9 @@ public class Runo extends BaseTheme { public static final String ACCORDION_LIGHT = "light"; /*************************************************************************** - * + * * Window styles - * + * **************************************************************************/ /** diff --git a/server/src/main/java/com/vaadin/ui/themes/ValoTheme.java b/server/src/main/java/com/vaadin/ui/themes/ValoTheme.java index 3a9986c632..335c9daee8 100644 --- a/server/src/main/java/com/vaadin/ui/themes/ValoTheme.java +++ b/server/src/main/java/com/vaadin/ui/themes/ValoTheme.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -23,23 +23,23 @@ import com.vaadin.ui.Table.ColumnHeaderMode; *

            * Additional style names which can be used with the Valo theme. *

            - * + * *

            * These styles are only available if the * $v-included-additional-styles Sass list variable contains the * name of the component for that additional style name (e.g. * button, textfield, table). *

            - * + * *

            * Most of these additional style names can be included individually into your * custom theme using the component specific Sass mixins, in which case you can * also define the style names yourself. See the Valo theme Sass API * documentation for additional information. *

            - * + * * TODO link to Sass API documentation - * + * * @since 7.3 * @author Vaadin Ltd */ @@ -48,9 +48,9 @@ public class ValoTheme { public static final String THEME_NAME = "valo"; /*************************************************************************** - * + * * Notification styles - * + * **************************************************************************/ /** @@ -113,9 +113,9 @@ public class ValoTheme { public static final String NOTIFICATION_FAILURE = "failure"; /*************************************************************************** - * + * * Label styles - * + * **************************************************************************/ /** @@ -206,9 +206,9 @@ public class ValoTheme { /** * Spinner style. Add this style name to an empty Label to create a spinner. - * + * *

            Example

            - * + * *
                  * Label spinner = new Label();
                  * spinner.addStyleName(ValoTheme.LABEL_SPINNER);
            @@ -217,9 +217,9 @@ public class ValoTheme {
                 public static final String LABEL_SPINNER = "spinner";
             
                 /***************************************************************************
            -     * 
            +     *
                  * Button styles
            -     * 
            +     *
                  **************************************************************************/
             
                 /**
            @@ -307,9 +307,9 @@ public class ValoTheme {
                 public static final String BUTTON_ICON_ONLY = "icon-only";
             
                 /***************************************************************************
            -     * 
            +     *
                  * Link styles
            -     * 
            +     *
                  **************************************************************************/
             
                 /**
            @@ -323,9 +323,9 @@ public class ValoTheme {
                 public static final String LINK_LARGE = "large";
             
                 /***************************************************************************
            -     * 
            +     *
                  * TextField styles
            -     * 
            +     *
                  **************************************************************************/
             
                 /**
            @@ -373,9 +373,9 @@ public class ValoTheme {
                 public static final String TEXTFIELD_INLINE_ICON = "inline-icon";
             
                 /***************************************************************************
            -     * 
            +     *
                  * TextArea styles
            -     * 
            +     *
                  **************************************************************************/
             
                 /**
            @@ -417,9 +417,9 @@ public class ValoTheme {
                 public static final String TEXTAREA_ALIGN_CENTER = "align-center";
             
                 /***************************************************************************
            -     * 
            +     *
                  * DateField styles
            -     * 
            +     *
                  **************************************************************************/
             
                 /**
            @@ -461,9 +461,9 @@ public class ValoTheme {
                 public static final String DATEFIELD_ALIGN_CENTER = "align-center";
             
                 /***************************************************************************
            -     * 
            +     *
                  * ComboBox styles
            -     * 
            +     *
                  **************************************************************************/
             
                 /**
            @@ -505,9 +505,9 @@ public class ValoTheme {
                 public static final String COMBOBOX_ALIGN_CENTER = "align-center";
             
                 /***************************************************************************
            -     * 
            +     *
                  * CheckBox styles
            -     * 
            +     *
                  **************************************************************************/
             
                 /**
            @@ -521,9 +521,9 @@ public class ValoTheme {
                 public static final String CHECKBOX_LARGE = "large";
             
                 /***************************************************************************
            -     * 
            +     *
                  * OptionGroup styles
            -     * 
            +     *
                  **************************************************************************/
             
                 /**
            @@ -545,9 +545,9 @@ public class ValoTheme {
                 public static final String OPTIONGROUP_HORIZONTAL = "horizontal";
             
                 /***************************************************************************
            -     * 
            +     *
                  * Slider styles
            -     * 
            +     *
                  **************************************************************************/
             
                 /**
            @@ -557,9 +557,9 @@ public class ValoTheme {
                 public static final String SLIDER_NO_INDICATOR = "no-indicator";
             
                 /***************************************************************************
            -     * 
            +     *
                  * ProgressBar styles
            -     * 
            +     *
                  **************************************************************************/
             
                 /**
            @@ -569,9 +569,9 @@ public class ValoTheme {
                 public static final String PROGRESSBAR_POINT = "point";
             
                 /***************************************************************************
            -     * 
            +     *
                  * MenuBar styles
            -     * 
            +     *
                  **************************************************************************/
             
                 /**
            @@ -585,9 +585,9 @@ public class ValoTheme {
                 public static final String MENUBAR_BORDERLESS = "borderless";
             
                 /***************************************************************************
            -     * 
            +     *
                  * Table and TreeTable styles
            -     * 
            +     *
                  **************************************************************************/
             
                 /**
            @@ -669,9 +669,9 @@ public class ValoTheme {
                 public static final String TREETABLE_SMALL = TABLE_SMALL;
             
                 /***************************************************************************
            -     * 
            +     *
                  * DragAndDropWrapper styles
            -     * 
            +     *
                  **************************************************************************/
             
                 /**
            @@ -693,9 +693,9 @@ public class ValoTheme {
                 public static final String DRAG_AND_DROP_WRAPPER_NO_HORIZONTAL_DRAG_HINTS = "no-horizontal-drag-hints";
             
                 /***************************************************************************
            -     * 
            +     *
                  * Panel styles
            -     * 
            +     *
                  **************************************************************************/
             
                 /**
            @@ -717,9 +717,9 @@ public class ValoTheme {
                 public static final String PANEL_WELL = "well";
             
                 /***************************************************************************
            -     * 
            +     *
                  * SplitPanel styles
            -     * 
            +     *
                  **************************************************************************/
             
                 /**
            @@ -728,9 +728,9 @@ public class ValoTheme {
                 public static final String SPLITPANEL_LARGE = "large";
             
                 /***************************************************************************
            -     * 
            +     *
                  * TabSheet styles
            -     * 
            +     *
                  **************************************************************************/
             
                 /**
            @@ -783,9 +783,9 @@ public class ValoTheme {
                 public static final String TABSHEET_ONLY_SELECTED_TAB_IS_CLOSABLE = "only-selected-closable";
             
                 /***************************************************************************
            -     * 
            +     *
                  * Accordion styles
            -     * 
            +     *
                  **************************************************************************/
             
                 /**
            @@ -795,9 +795,9 @@ public class ValoTheme {
                 public static final String ACCORDION_BORDERLESS = "borderless";
             
                 /***************************************************************************
            -     * 
            +     *
                  * Window and related styles
            -     * 
            +     *
                  **************************************************************************/
             
                 /**
            @@ -817,9 +817,9 @@ public class ValoTheme {
                 public static final String WINDOW_BOTTOM_TOOLBAR = "v-window-bottom-toolbar";
             
                 /***************************************************************************
            -     * 
            +     *
                  * FormLayout styles
            -     * 
            +     *
                  **************************************************************************/
             
                 /**
            @@ -830,9 +830,9 @@ public class ValoTheme {
                 public static final String FORMLAYOUT_LIGHT = "light";
             
                 /***************************************************************************
            -     * 
            +     *
                  * Layout styles
            -     * 
            +     *
                  **************************************************************************/
             
                 /**
            @@ -858,16 +858,16 @@ public class ValoTheme {
                 /**
                  * Add this style name to a CssLayout to create a grouped set of components,
                  * i.e. a row of components which are joined seamlessly together.
            -     * 
            +     *
                  * 

            Example

            - * + * *
                  * CssLayout group = new CssLayout();
                  * group.addStyleName(ValoTheme.LAYOUT_COMPONENT_GROUP);
            -     * 
            +     *
                  * TextField field = new TextField();
                  * group.addComponent(field);
            -     * 
            +     *
                  * Button button = new Button("Action");
                  * group.addComponent(button);
                  * 
            @@ -875,9 +875,9 @@ public class ValoTheme { public static final String LAYOUT_COMPONENT_GROUP = "v-component-group"; /*************************************************************************** - * + * * Valo menu styles - * + * **************************************************************************/ /** @@ -885,19 +885,19 @@ public class ValoTheme { * When you use the Valo menu and wish to enable responsive features of the * menu, you need to add this style name to the UI containing the menu. *

            - * + * *

            * You only need to add this style name to the UI containing a Valo menu, if * you're using the Responsive extension with the UI. *

            - * + * *

            Example

            - * + * *

            * To enable responsivity in the Valo menu, the following example code * should be executed in your UI containing the menu. *

            - * + * *
                  * Responsive.makeResponsive(this);
                  * addStyleName(ValoTheme.UI_WITH_MENU);
            @@ -910,7 +910,7 @@ public class ValoTheme {
                  * Set the primary style name of a CssLayout to this, and
                  * add any number of layouts with the {@link #MENU_PART} style inside it.
                  * 

            - * + * *

            * The menu style is used to create a sidebar navigation menu for the * application, usually action as the main navigation for the different @@ -918,9 +918,9 @@ public class ValoTheme { * {@link #MENU_ITEM}s, and possibly some {@link #MENU_SUBTITLE}s and a * {@link #MENU_TITLE}. *

            - * + * *

            Example

            - * + * *
                  * CssLayout menuArea = new CssLayout();
                  * menuArea.setPrimaryStyleName(ValoTheme.MENU_ROOT);
            @@ -932,9 +932,9 @@ public class ValoTheme {
                  * Add this style name to any layout and place it inside a layout with the
                  * {@link #MENU_ROOT} style to build a menu component. Use the additional
                  * MENU styles for individual components inside the layout.
            -     * 
            +     *
                  * 

            Example

            - * + * *
                  * CssLayout menu = new CssLayout();
                  * menu.addStyleName(ValoTheme.MENU_PART);
            @@ -948,9 +948,9 @@ public class ValoTheme {
                  * captions. Useful on narrower viewport widths, since the menu width is
                  * decreased quite dramatically, making more space for the content of the
                  * application.
            -     * 
            +     *
                  * 

            Example

            - * + * *
                  * CssLayout menu = new CssLayout();
                  * menu.addStyleName(ValoTheme.MENU_PART);
            @@ -965,7 +965,7 @@ public class ValoTheme {
                  * (intended to be placed in side a {@link #MENU_PART} layout). You can add
                  * any components inside it, but usually you would place a Label inside.
                  * 

            - * + * *

            * Any MenuBar component that you place inside this layout will match the * style of the title, allowing an easy way to add a toolbar to the title @@ -985,15 +985,15 @@ public class ValoTheme { * Set the primary style name of a Button to this style name * to create a clickable menu item in the menu. *

            - * + * *

            Selected item

            *

            * Add an additional style name selected to it to make * it the selected item in the menu. *

            - * + * *

            Example

            - * + * *
                  * Button item = new Button();
                  * item.setPrimaryStyleName(ValoTheme.MENU_ITEM);
            @@ -1007,9 +1007,9 @@ public class ValoTheme {
                  * or {@link #MENU_ITEM} to add an additional badge indicator to the
                  * subtitle/item. The Label/Button needs to allow HTML content in order to
                  * use this style name.
            -     * 
            +     *
                  * 

            Examples

            - * + * *
                  * Button item = new Button();
                  * item.setPrimaryStyleName(ValoTheme.MENU_ITEM);
            @@ -1017,7 +1017,7 @@ public class ValoTheme {
                  * item.setCaption("Item Caption <span class=\"" + ValoTheme.MENU_BADGE
                  *         + "\">Badge text</span>");
                  * 
            - * + * *
                  * Label item = new Label();
                  * item.setPrimaryStyleName(ValoTheme.MENU_ITEM);
            @@ -1034,7 +1034,7 @@ public class ValoTheme {
                  * style name to create an application logo. The logo is designed to be
                  * placed inside a {@link #MENU_PART} layout.
                  * 

            - * + * *

            * The text content of the logo should be very short, since the logo area * only shows approximately three letters. Using one of the @@ -1042,9 +1042,9 @@ public class ValoTheme { * application. *

            *

            - * + * *

            Example

            - * + * *
                  * Label logo = new Label(FontAwesome.ROCKET.getHtml(), ContentMode.HTML);
                  * logo.setSizeUndefined();
            diff --git a/server/src/main/java/com/vaadin/util/ConnectorHelper.java b/server/src/main/java/com/vaadin/util/ConnectorHelper.java
            index b3457068c3..c2a5105072 100644
            --- a/server/src/main/java/com/vaadin/util/ConnectorHelper.java
            +++ b/server/src/main/java/com/vaadin/util/ConnectorHelper.java
            @@ -1,12 +1,12 @@
             /*
              * Copyright 2000-2014 Vaadin Ltd.
            - * 
            + *
              * Licensed under the Apache 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
            @@ -23,7 +23,7 @@ import com.vaadin.ui.Component;
             
             /**
              * Provides various helper methods for connectors. Meant for internal use.
            - * 
            + *
              * @since 7.1
              * @author Vaadin Ltd
              */
            @@ -31,7 +31,7 @@ public class ConnectorHelper {
             
                 /**
                  * Creates a string containing debug info for the connector
            -     * 
            +     *
                  * @since 7.1
                  * @param connector
                  *            The connector to print debug info about
            @@ -57,7 +57,7 @@ public class ConnectorHelper {
             
                 /**
                  * Creates a string containing hierarchy information for the connector
            -     * 
            +     *
                  * @since 7.1
                  * @param connector
                  *            The connector to get hierarchy information for
            diff --git a/server/src/main/java/com/vaadin/util/CurrentInstance.java b/server/src/main/java/com/vaadin/util/CurrentInstance.java
            index e6b58ec65c..d3e0de104a 100644
            --- a/server/src/main/java/com/vaadin/util/CurrentInstance.java
            +++ b/server/src/main/java/com/vaadin/util/CurrentInstance.java
            @@ -112,7 +112,7 @@ public class CurrentInstance implements Serializable {
                              * ThreadLocal should only outlive the referenced object on
                              * threads that are not doing anything related to Vaadin, which
                              * should thus never invoke CurrentInstance.get().
            -                 * 
            +                 *
                              * At this point, there might also be other values that have
                              * been collected, so we'll scan the entire map and remove stale
                              * CurrentInstance objects. Using a ReferenceQueue could make
            @@ -134,7 +134,8 @@ public class CurrentInstance implements Serializable {
                     }
                 }
             
            -    private static void removeStaleInstances(Map, CurrentInstance> map) {
            +    private static void removeStaleInstances(
            +            Map, CurrentInstance> map) {
                     for (Iterator, CurrentInstance>> iterator = map
                             .entrySet().iterator(); iterator.hasNext();) {
                         Entry, CurrentInstance> entry = iterator.next();
            @@ -203,14 +204,12 @@ public class CurrentInstance implements Serializable {
                             instances.set(map);
                         }
             
            -            previousInstance = map.put(type, new CurrentInstance(instance,
            -                    inheritable));
            +            previousInstance = map.put(type,
            +                    new CurrentInstance(instance, inheritable));
                         if (previousInstance != null) {
                             assert previousInstance.inheritable == inheritable : "Inheritable status mismatch for "
            -                        + type
            -                        + " (previous was "
            -                        + previousInstance.inheritable
            -                        + ", new is "
            +                        + type + " (previous was "
            +                        + previousInstance.inheritable + ", new is "
                                     + inheritable + ")";
                         }
                     }
            @@ -250,7 +249,7 @@ public class CurrentInstance implements Serializable {
                              * CurrentInstance. Without this a reference to an already
                              * collected instance may be left in the CurrentInstance when it
                              * really should be restored to null.
            -                 * 
            +                 *
                              * One example case that this fixes:
                              * VaadinService.runPendingAccessTasks() clears all current
                              * instances and then sets everything but the UI. This makes
            diff --git a/server/src/main/java/com/vaadin/util/FileTypeResolver.java b/server/src/main/java/com/vaadin/util/FileTypeResolver.java
            index a49a0e2d01..56cd186fab 100644
            --- a/server/src/main/java/com/vaadin/util/FileTypeResolver.java
            +++ b/server/src/main/java/com/vaadin/util/FileTypeResolver.java
            @@ -1,12 +1,12 @@
             /*
              * Copyright 2000-2014 Vaadin Ltd.
            - * 
            + *
              * Licensed under the Apache 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
            @@ -32,7 +32,7 @@ import com.vaadin.server.ThemeResource;
              * Note : The icons are associated purely to mime-types, so a file may not have
              * a custom icon accessible with this class.
              * 

            - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -241,7 +241,7 @@ public class FileTypeResolver implements Serializable { /** * Gets the mime-type of a file. Currently the mime-type is resolved based * only on the file name extension. - * + * * @param fileName * the name of the file whose mime-type is requested. * @return mime-type String for the given filename @@ -284,7 +284,7 @@ public class FileTypeResolver implements Serializable { * the mime-type for the given filename is resolved, and then the * corresponding icon is fetched from the internal icon storage. If it is * not found the default icon is returned. - * + * * @param fileName * the name of the file whose icon is requested. * @return the icon corresponding to the given file @@ -309,7 +309,7 @@ public class FileTypeResolver implements Serializable { * the given file name is resolved, and then the corresponding icon is * fetched from the internal icon storage. If it is not found the default * icon is returned. - * + * * @param file * the file whose icon is requested. * @return the icon corresponding to the given file @@ -321,7 +321,7 @@ public class FileTypeResolver implements Serializable { /** * Gets the mime-type for a file. Currently the returned file type is * resolved by the filename extension only. - * + * * @param file * the file whose mime-type is requested. * @return the files mime-type String @@ -350,7 +350,7 @@ public class FileTypeResolver implements Serializable { /** * Adds a mime-type mapping for the given filename extension. If the * extension is already in the internal mapping it is overwritten. - * + * * @param extension * the filename extension to be associated with * MIMEType. @@ -364,7 +364,7 @@ public class FileTypeResolver implements Serializable { /** * Adds a icon for the given mime-type. If the mime-type also has a * corresponding icon, it is replaced with the new icon. - * + * * @param MIMEType * the mime-type whose icon is to be changed. * @param icon @@ -376,7 +376,7 @@ public class FileTypeResolver implements Serializable { /** * Gets the internal file extension to mime-type mapping. - * + * * @return unmodifiable map containing the current file extension to * mime-type mapping */ @@ -386,7 +386,7 @@ public class FileTypeResolver implements Serializable { /** * Gets the internal mime-type to icon mapping. - * + * * @return unmodifiable map containing the current mime-type to icon mapping */ public static Map getMIMETypeToIconMapping() { diff --git a/server/src/main/java/com/vaadin/util/ReflectTools.java b/server/src/main/java/com/vaadin/util/ReflectTools.java index 2e2d3fe238..ad1aae1a69 100644 --- a/server/src/main/java/com/vaadin/util/ReflectTools.java +++ b/server/src/main/java/com/vaadin/util/ReflectTools.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,7 +25,7 @@ import java.lang.reflect.Method; * An util class with helpers for reflection operations. Used internally by * Vaadin and should not be used by application developers. Subject to change at * any time. - * + * * @since 6.2 */ public class ReflectTools implements Serializable { @@ -33,7 +33,7 @@ public class ReflectTools implements Serializable { * Locates the method in the given class. Returns null if the method is not * found. Throws an ExceptionInInitializerError if there is a problem * locating the method as this is mainly called from static blocks. - * + * * @param cls * Class that contains the method * @param methodName @@ -59,7 +59,7 @@ public class ReflectTools implements Serializable { *

            * Uses getter if present, otherwise tries to access even private fields * directly. - * + * * @param object * The object containing the field * @param field @@ -101,7 +101,7 @@ public class ReflectTools implements Serializable { * Uses getter if a getter for the correct return type is present, otherwise * tries to access even private fields directly. If the java field is not * assignable to the property type throws an IllegalArgumentException. - * + * * @param object * The object containing the field * @param field @@ -149,7 +149,7 @@ public class ReflectTools implements Serializable { *

            * Uses setter if present, otherwise tries to access even private fields * directly. - * + * * @param object * The object containing the field * @param field diff --git a/server/src/main/java/com/vaadin/util/SerializerHelper.java b/server/src/main/java/com/vaadin/util/SerializerHelper.java index 793488d892..3470684405 100644 --- a/server/src/main/java/com/vaadin/util/SerializerHelper.java +++ b/server/src/main/java/com/vaadin/util/SerializerHelper.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -23,7 +23,7 @@ import java.io.ObjectOutputStream; * Helper class for performing serialization. Most of the methods are here are * workarounds for problems in Google App Engine. Used internally by Vaadin and * should not be used by application developers. Subject to change at any time. - * + * * @since 6.0 */ public class SerializerHelper { @@ -31,7 +31,7 @@ public class SerializerHelper { /** * Serializes the class reference so {@link #readClass(ObjectInputStream)} * can deserialize it. Supports null class references. - * + * * @param out * The {@link ObjectOutputStream} to serialize to. * @param cls @@ -53,7 +53,7 @@ public class SerializerHelper { * Serializes the class references so * {@link #readClassArray(ObjectInputStream)} can deserialize it. Supports * null class arrays. - * + * * @param out * The {@link ObjectOutputStream} to serialize to. * @param classes @@ -78,7 +78,7 @@ public class SerializerHelper { * Deserializes a class references serialized by * {@link #writeClassArray(ObjectOutputStream, Class[])}. Supports null * class arrays. - * + * * @param in * {@link ObjectInputStream} to read from. * @return Class array with the class references or null. @@ -111,7 +111,7 @@ public class SerializerHelper { /** * Resolves the class given by {@code className}. - * + * * @param className * The fully qualified class name. * @return A {@code Class} reference. @@ -133,7 +133,7 @@ public class SerializerHelper { * Deserializes a class reference serialized by * {@link #writeClass(ObjectOutputStream, Class)}. Supports null class * references. - * + * * @param in * {@code ObjectInputStream} to read from. * @return Class reference to the resolved class @@ -142,8 +142,8 @@ public class SerializerHelper { * @throws IOException * Rethrows IOExceptions from the ObjectInputStream */ - public static Class readClass(ObjectInputStream in) throws IOException, - ClassNotFoundException { + public static Class readClass(ObjectInputStream in) + throws IOException, ClassNotFoundException { String className = (String) in.readObject(); if (className == null) { return null; diff --git a/server/src/test/java/ClassInDefaultPackage.java b/server/src/test/java/ClassInDefaultPackage.java index 52dc87e0e2..4c6a2fe1aa 100644 --- a/server/src/test/java/ClassInDefaultPackage.java +++ b/server/src/test/java/ClassInDefaultPackage.java @@ -2,13 +2,13 @@ import org.junit.Ignore; /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -17,9 +17,9 @@ import org.junit.Ignore; */ /** - * + * * This class is test data. Don't delete it. - * + * * @author Vaadin Ltd * @since 7.2 */ diff --git a/server/src/test/java/com/vaadin/benchmarks/PerformanceTester8759.java b/server/src/test/java/com/vaadin/benchmarks/PerformanceTester8759.java index 968edd4b24..af7e613bbf 100644 --- a/server/src/test/java/com/vaadin/benchmarks/PerformanceTester8759.java +++ b/server/src/test/java/com/vaadin/benchmarks/PerformanceTester8759.java @@ -7,17 +7,17 @@ import com.vaadin.ui.Label; * Your results will vary. * The real world use case motivating it was a 10k Row table, which generated labels for 10 columns. * This is 1/10th of what this performance tester demonstrates. - * + * * Please run with -server and -Xloggc:/tmp/gclog.vgc -verbose:gc -XX:+PrintCompilation - * + * * My results Win 7 64, i7 2760QM 2.4Ghz, Java 7 21. - * + * * Proposed Patch with StringTokenizer: * 13 GC activations, 1.009GB allocated memory over time, total time 948ms - * + * * Current String.split implementation: * 31 GC activations, 2.277 GB allocated memory over time, total time 1557ms - * + * */ public class PerformanceTester8759 { diff --git a/server/src/test/java/com/vaadin/data/DefaultFieldGroupFieldFactoryTest.java b/server/src/test/java/com/vaadin/data/DefaultFieldGroupFieldFactoryTest.java index fc258ab138..44665eb9dd 100644 --- a/server/src/test/java/com/vaadin/data/DefaultFieldGroupFieldFactoryTest.java +++ b/server/src/test/java/com/vaadin/data/DefaultFieldGroupFieldFactoryTest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -46,8 +46,8 @@ public class DefaultFieldGroupFieldFactoryTest { Class clazz = DefaultFieldGroupFieldFactory.class; Constructor[] constructors = clazz.getConstructors(); Assert.assertEquals( - "DefaultFieldGroupFieldFactory contains public constructors", - 0, constructors.length); + "DefaultFieldGroupFieldFactory contains public constructors", 0, + constructors.length); } @Test @@ -105,8 +105,8 @@ public class DefaultFieldGroupFieldFactoryTest { @Test public void testEnumAnySelect() { - Field f = fieldFactory - .createField(SomeEnum.class, AbstractSelect.class); + Field f = fieldFactory.createField(SomeEnum.class, + AbstractSelect.class); Assert.assertNotNull(f); Assert.assertEquals(ListSelect.class, f.getClass()); } diff --git a/server/src/test/java/com/vaadin/data/fieldgroup/FieldGroupDateTest.java b/server/src/test/java/com/vaadin/data/fieldgroup/FieldGroupDateTest.java index ce76f8427b..87df063068 100644 --- a/server/src/test/java/com/vaadin/data/fieldgroup/FieldGroupDateTest.java +++ b/server/src/test/java/com/vaadin/data/fieldgroup/FieldGroupDateTest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/server/src/test/java/com/vaadin/data/fieldgroup/FieldGroupExceptionTest.java b/server/src/test/java/com/vaadin/data/fieldgroup/FieldGroupExceptionTest.java index 636162de54..cd6626947c 100644 --- a/server/src/test/java/com/vaadin/data/fieldgroup/FieldGroupExceptionTest.java +++ b/server/src/test/java/com/vaadin/data/fieldgroup/FieldGroupExceptionTest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/server/src/test/java/com/vaadin/data/fieldgroup/FieldGroupTest.java b/server/src/test/java/com/vaadin/data/fieldgroup/FieldGroupTest.java index f8e4d1c2d0..866d0aed5e 100644 --- a/server/src/test/java/com/vaadin/data/fieldgroup/FieldGroupTest.java +++ b/server/src/test/java/com/vaadin/data/fieldgroup/FieldGroupTest.java @@ -67,13 +67,14 @@ public class FieldGroupTest { group.bind(field, "name"); Property propertyDataSource = field.getPropertyDataSource(); - Assert.assertTrue("Custom implementation of transactional property " - + "has not been used", + Assert.assertTrue( + "Custom implementation of transactional property " + + "has not been used", propertyDataSource instanceof TransactionalPropertyImpl); } - public static class TransactionalPropertyImpl extends - TransactionalPropertyWrapper { + public static class TransactionalPropertyImpl + extends TransactionalPropertyWrapper { public TransactionalPropertyImpl(Property wrappedProperty) { super(wrappedProperty); diff --git a/server/src/test/java/com/vaadin/data/util/AbstractBeanContainerTestBase.java b/server/src/test/java/com/vaadin/data/util/AbstractBeanContainerTestBase.java index 3d8f08a7ef..4a9e4f9891 100644 --- a/server/src/test/java/com/vaadin/data/util/AbstractBeanContainerTestBase.java +++ b/server/src/test/java/com/vaadin/data/util/AbstractBeanContainerTestBase.java @@ -2,12 +2,12 @@ package com.vaadin.data.util; /** * Automated test for {@link AbstractBeanContainer}. - * + * * Only a limited subset of the functionality is tested here, the rest in tests * of subclasses including {@link BeanItemContainer} and {@link BeanContainer}. */ -public abstract class AbstractBeanContainerTestBase extends - AbstractInMemoryContainerTestBase { +public abstract class AbstractBeanContainerTestBase + extends AbstractInMemoryContainerTestBase { public static class Person { private String name; diff --git a/server/src/test/java/com/vaadin/data/util/AbstractContainerTestBase.java b/server/src/test/java/com/vaadin/data/util/AbstractContainerTestBase.java index 644f703d9e..955b609735 100644 --- a/server/src/test/java/com/vaadin/data/util/AbstractContainerTestBase.java +++ b/server/src/test/java/com/vaadin/data/util/AbstractContainerTestBase.java @@ -82,8 +82,8 @@ public abstract class AbstractContainerTestBase { // current containers protected void validateContainer(Container container, Object expectedFirstItemId, Object expectedLastItemId, - Object itemIdInSet, Object itemIdNotInSet, - boolean checkGetItemNull, int expectedSize) { + Object itemIdInSet, Object itemIdNotInSet, boolean checkGetItemNull, + int expectedSize) { Container.Indexed indexed = null; if (container instanceof Container.Indexed) { indexed = (Container.Indexed) container; @@ -115,8 +115,8 @@ public abstract class AbstractContainerTestBase { // getContainerProperty for (Object propId : container.getContainerPropertyIds()) { if (checkGetItemNull) { - assertNull(container.getContainerProperty(itemIdNotInSet, - propId)); + assertNull( + container.getContainerProperty(itemIdNotInSet, propId)); } assertNotNull(container.getContainerProperty(itemIdInSet, propId)); } @@ -154,8 +154,8 @@ public abstract class AbstractContainerTestBase { } // getItemProperty - Assert.assertNull(container.getItem(itemIdInSet).getItemProperty( - "notinset")); + Assert.assertNull( + container.getItem(itemIdInSet).getItemProperty("notinset")); } @@ -271,7 +271,8 @@ public abstract class AbstractContainerTestBase { Assert.assertNotNull(item); Assert.assertTrue(container.containsId("foo")); Assert.assertEquals(item, container.getItem("foo")); - Assert.assertEquals("foo", container.getItemIds().iterator().next()); + Assert.assertEquals("foo", + container.getItemIds().iterator().next()); Item itemAtEnd = container.addItemAfter(0, "atend"); Assert.assertNotNull(itemAtEnd); @@ -466,7 +467,8 @@ public abstract class AbstractContainerTestBase { container.addItemAt(itemPosition, newItemId); Assert.assertEquals(itemPosition, container.indexOfId(newItemId)); Assert.assertEquals(itemPosition + 1, container.indexOfId(itemId)); - Assert.assertEquals(newItemId, container.getIdByIndex(itemPosition)); + Assert.assertEquals(newItemId, + container.getIdByIndex(itemPosition)); Assert.assertEquals(itemId, container.getIdByIndex(itemPosition + 1)); Assert.assertTrue(container.removeItem(newItemId)); @@ -504,7 +506,8 @@ public abstract class AbstractContainerTestBase { container.addContainerFilter(filter1); assertTrue(container.getContainerFilters().size() == 1); - assertEquals(filter1, container.getContainerFilters().iterator().next()); + assertEquals(filter1, + container.getContainerFilters().iterator().next()); validateContainer(container, "com.vaadin.data.BufferedValidatable", "com.vaadin.ui.TabSheet", @@ -521,7 +524,8 @@ public abstract class AbstractContainerTestBase { container.addContainerFilter(filter2); assertTrue(container.getContainerFilters().size() == 1); - assertEquals(filter2, container.getContainerFilters().iterator().next()); + assertEquals(filter2, + container.getContainerFilters().iterator().next()); validateContainer(container, "com.vaadin.data.Buffered", "com.vaadin.server.ComponentSizeValidator", @@ -540,7 +544,8 @@ public abstract class AbstractContainerTestBase { return true; } - protected void testContainerSortingAndFiltering(Container.Sortable sortable) { + protected void testContainerSortingAndFiltering( + Container.Sortable sortable) { Filterable filterable = (Filterable) sortable; initializeContainer(sortable); @@ -550,8 +555,8 @@ public abstract class AbstractContainerTestBase { FULLY_QUALIFIED_NAME, "ab", false, false)); // Must be able to sort based on PROP1 for this test - assertTrue(sortable.getSortableContainerPropertyIds().contains( - FULLY_QUALIFIED_NAME)); + assertTrue(sortable.getSortableContainerPropertyIds() + .contains(FULLY_QUALIFIED_NAME)); sortable.sort(new Object[] { FULLY_QUALIFIED_NAME }, new boolean[] { true }); @@ -568,10 +573,10 @@ public abstract class AbstractContainerTestBase { initializeContainer(container); // Must be able to sort based on PROP1 for this test - assertTrue(sortable.getSortableContainerPropertyIds().contains( - FULLY_QUALIFIED_NAME)); - assertTrue(sortable.getSortableContainerPropertyIds().contains( - REVERSE_FULLY_QUALIFIED_NAME)); + assertTrue(sortable.getSortableContainerPropertyIds() + .contains(FULLY_QUALIFIED_NAME)); + assertTrue(sortable.getSortableContainerPropertyIds() + .contains(REVERSE_FULLY_QUALIFIED_NAME)); sortable.sort(new Object[] { FULLY_QUALIFIED_NAME }, new boolean[] { true }); @@ -609,10 +614,10 @@ public abstract class AbstractContainerTestBase { Item item = container.addItem(id); item.getItemProperty(FULLY_QUALIFIED_NAME).setValue(sampleData[i]); - item.getItemProperty(SIMPLE_NAME).setValue( - getSimpleName(sampleData[i])); - item.getItemProperty(REVERSE_FULLY_QUALIFIED_NAME).setValue( - reverse(sampleData[i])); + item.getItemProperty(SIMPLE_NAME) + .setValue(getSimpleName(sampleData[i])); + item.getItemProperty(REVERSE_FULLY_QUALIFIED_NAME) + .setValue(reverse(sampleData[i])); item.getItemProperty(ID_NUMBER).setValue(i); } } @@ -817,13 +822,11 @@ public abstract class AbstractContainerTestBase { "com.vaadin.server.widgetsetutils.WidgetMapGenerator", "com.vaadin.server.widgetsetutils.WidgetSetBuilder", "com.vaadin.server.KeyMapper", "com.vaadin.server.Paintable", - "com.vaadin.server.PaintException", - "com.vaadin.server.PaintTarget", + "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.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", @@ -845,19 +848,19 @@ public abstract class AbstractContainerTestBase { "com.vaadin.ui.Form", "com.vaadin.ui.FormFieldFactory", "com.vaadin.ui.FormLayout", "com.vaadin.ui.GridLayout", "com.vaadin.ui.HorizontalLayout", "com.vaadin.ui.InlineDateField", - "com.vaadin.ui.Label", "com.vaadin.ui.Layout", - "com.vaadin.ui.Link", "com.vaadin.ui.ListSelect", - "com.vaadin.ui.LoginForm", "com.vaadin.ui.MenuBar", - "com.vaadin.ui.NativeButton", "com.vaadin.ui.NativeSelect", - "com.vaadin.ui.OptionGroup", "com.vaadin.ui.OrderedLayout", - "com.vaadin.ui.Panel", "com.vaadin.ui.PopupDateField", - "com.vaadin.ui.PopupView", "com.vaadin.ui.ProgressIndicator", - "com.vaadin.ui.RichTextArea", "com.vaadin.ui.Select", - "com.vaadin.ui.Slider", "com.vaadin.ui.SplitPanel", - "com.vaadin.ui.Table", "com.vaadin.ui.TableFieldFactory", - "com.vaadin.ui.TabSheet", "com.vaadin.ui.TextField", - "com.vaadin.ui.Tree", "com.vaadin.ui.TwinColSelect", - "com.vaadin.ui.Upload", "com.vaadin.ui.UriFragmentUtility", - "com.vaadin.ui.VerticalLayout", "com.vaadin.ui.Window", - "com.vaadin.util.SerializerHelper", "org.vaadin.test.LastClass" }; + "com.vaadin.ui.Label", "com.vaadin.ui.Layout", "com.vaadin.ui.Link", + "com.vaadin.ui.ListSelect", "com.vaadin.ui.LoginForm", + "com.vaadin.ui.MenuBar", "com.vaadin.ui.NativeButton", + "com.vaadin.ui.NativeSelect", "com.vaadin.ui.OptionGroup", + "com.vaadin.ui.OrderedLayout", "com.vaadin.ui.Panel", + "com.vaadin.ui.PopupDateField", "com.vaadin.ui.PopupView", + "com.vaadin.ui.ProgressIndicator", "com.vaadin.ui.RichTextArea", + "com.vaadin.ui.Select", "com.vaadin.ui.Slider", + "com.vaadin.ui.SplitPanel", "com.vaadin.ui.Table", + "com.vaadin.ui.TableFieldFactory", "com.vaadin.ui.TabSheet", + "com.vaadin.ui.TextField", "com.vaadin.ui.Tree", + "com.vaadin.ui.TwinColSelect", "com.vaadin.ui.Upload", + "com.vaadin.ui.UriFragmentUtility", "com.vaadin.ui.VerticalLayout", + "com.vaadin.ui.Window", "com.vaadin.util.SerializerHelper", + "org.vaadin.test.LastClass" }; } diff --git a/server/src/test/java/com/vaadin/data/util/AbstractHierarchicalContainerTestBase.java b/server/src/test/java/com/vaadin/data/util/AbstractHierarchicalContainerTestBase.java index 7a07c553f7..f3eda74100 100644 --- a/server/src/test/java/com/vaadin/data/util/AbstractHierarchicalContainerTestBase.java +++ b/server/src/test/java/com/vaadin/data/util/AbstractHierarchicalContainerTestBase.java @@ -13,8 +13,8 @@ import com.vaadin.data.Container.Hierarchical; import com.vaadin.data.Container.Sortable; import com.vaadin.data.Item; -public abstract class AbstractHierarchicalContainerTestBase extends - AbstractContainerTestBase { +public abstract class AbstractHierarchicalContainerTestBase + extends AbstractContainerTestBase { /** * @param container @@ -45,9 +45,8 @@ public abstract class AbstractHierarchicalContainerTestBase extends */ protected void validateHierarchicalContainer(Hierarchical container, Object expectedFirstItemId, Object expectedLastItemId, - Object itemIdInSet, Object itemIdNotInSet, - boolean checkGetItemNull, int expectedSize, int expectedRootSize, - boolean rootsHaveChildren) { + Object itemIdInSet, Object itemIdNotInSet, boolean checkGetItemNull, + int expectedSize, int expectedRootSize, boolean rootsHaveChildren) { validateContainer(container, expectedFirstItemId, expectedLastItemId, itemIdInSet, itemIdNotInSet, checkGetItemNull, expectedSize); @@ -166,10 +165,10 @@ public abstract class AbstractHierarchicalContainerTestBase extends initializeContainer(container); // Must be able to sort based on PROP1 and PROP2 for this test - assertTrue(sortable.getSortableContainerPropertyIds().contains( - FULLY_QUALIFIED_NAME)); - assertTrue(sortable.getSortableContainerPropertyIds().contains( - REVERSE_FULLY_QUALIFIED_NAME)); + assertTrue(sortable.getSortableContainerPropertyIds() + .contains(FULLY_QUALIFIED_NAME)); + assertTrue(sortable.getSortableContainerPropertyIds() + .contains(REVERSE_FULLY_QUALIFIED_NAME)); sortable.sort(new Object[] { FULLY_QUALIFIED_NAME }, new boolean[] { true }); @@ -218,8 +217,8 @@ public abstract class AbstractHierarchicalContainerTestBase extends Item item = container.getItem(path); item.getItemProperty(FULLY_QUALIFIED_NAME).setValue(path); item.getItemProperty(SIMPLE_NAME).setValue(getSimpleName(path)); - item.getItemProperty(REVERSE_FULLY_QUALIFIED_NAME).setValue( - reverse(path)); + item.getItemProperty(REVERSE_FULLY_QUALIFIED_NAME) + .setValue(reverse(path)); item.getItemProperty(ID_NUMBER).setValue(1); } for (int j = 1; j < paths.length; j++) { @@ -233,16 +232,15 @@ public abstract class AbstractHierarchicalContainerTestBase extends Item item = container.getItem(path); item.getItemProperty(FULLY_QUALIFIED_NAME).setValue(path); - item.getItemProperty(SIMPLE_NAME).setValue( - getSimpleName(path)); + item.getItemProperty(SIMPLE_NAME) + .setValue(getSimpleName(path)); item.getItemProperty(REVERSE_FULLY_QUALIFIED_NAME) .setValue(reverse(path)); item.getItemProperty(ID_NUMBER).setValue(1); } assertTrue(container.setChildrenAllowed(parent, true)); - assertTrue( - "Failed to set " + parent + " as parent for " + path, + assertTrue("Failed to set " + parent + " as parent for " + path, container.setParent(path, parent)); } @@ -251,10 +249,10 @@ public abstract class AbstractHierarchicalContainerTestBase extends String parent = id.substring(0, id.lastIndexOf('.')); assertTrue(container.setParent(id, parent)); item.getItemProperty(FULLY_QUALIFIED_NAME).setValue(sampleData[i]); - item.getItemProperty(SIMPLE_NAME).setValue( - getSimpleName(sampleData[i])); - item.getItemProperty(REVERSE_FULLY_QUALIFIED_NAME).setValue( - reverse(sampleData[i])); + item.getItemProperty(SIMPLE_NAME) + .setValue(getSimpleName(sampleData[i])); + item.getItemProperty(REVERSE_FULLY_QUALIFIED_NAME) + .setValue(reverse(sampleData[i])); item.getItemProperty(ID_NUMBER).setValue(i % 2); } } diff --git a/server/src/test/java/com/vaadin/data/util/AbstractInMemoryContainerTestBase.java b/server/src/test/java/com/vaadin/data/util/AbstractInMemoryContainerTestBase.java index d2c1a17bf8..3858504bc7 100644 --- a/server/src/test/java/com/vaadin/data/util/AbstractInMemoryContainerTestBase.java +++ b/server/src/test/java/com/vaadin/data/util/AbstractInMemoryContainerTestBase.java @@ -1,6 +1,6 @@ package com.vaadin.data.util; -public abstract class AbstractInMemoryContainerTestBase extends - AbstractContainerTestBase { +public abstract class AbstractInMemoryContainerTestBase + extends AbstractContainerTestBase { } diff --git a/server/src/test/java/com/vaadin/data/util/BeanContainerTest.java b/server/src/test/java/com/vaadin/data/util/BeanContainerTest.java index d990f3d123..bdf6ba1958 100644 --- a/server/src/test/java/com/vaadin/data/util/BeanContainerTest.java +++ b/server/src/test/java/com/vaadin/data/util/BeanContainerTest.java @@ -23,8 +23,8 @@ import com.vaadin.data.util.AbstractBeanContainer.BeanIdResolver; public class BeanContainerTest extends AbstractBeanContainerTestBase { - protected static class PersonNameResolver implements - BeanIdResolver { + protected static class PersonNameResolver + implements BeanIdResolver { @Override public String getIdForBean(Person bean) { @@ -33,8 +33,8 @@ public class BeanContainerTest extends AbstractBeanContainerTestBase { } - protected static class NullResolver implements - BeanIdResolver { + protected static class NullResolver + implements BeanIdResolver { @Override public String getIdForBean(Person bean) { @@ -367,8 +367,8 @@ public class BeanContainerTest extends AbstractBeanContainerTestBase { BeanContainer container = new BeanContainer( Person.class); // resolver that returns null as item id - container - .setBeanIdResolver(new BeanIdResolver() { + container.setBeanIdResolver( + new BeanIdResolver() { @Override public String getIdForBean(Person bean) { @@ -434,8 +434,8 @@ public class BeanContainerTest extends AbstractBeanContainerTestBase { assertNotNull(container.addBeanAfter(null, new Person("Jane"))); assertNotNull(container.addBeanAt(0, new Person("Jack"))); - container.addAll(Arrays.asList(new Person[] { new Person("Jill"), - new Person("Joe") })); + container.addAll(Arrays.asList( + new Person[] { new Person("Jill"), new Person("Joe") })); assertTrue(container.containsId("John")); assertTrue(container.containsId("Jane")); @@ -470,8 +470,8 @@ public class BeanContainerTest extends AbstractBeanContainerTestBase { assertNotNull(container.addBeanAfter(null, new Person("Jane"))); assertNotNull(container.addBeanAt(0, new Person("Jack"))); - container.addAll(Arrays.asList(new Person[] { new Person("Jill"), - new Person("Joe") })); + container.addAll(Arrays.asList( + new Person[] { new Person("Jill"), new Person("Joe") })); assertTrue(container.containsId("John")); assertTrue(container.containsId("Jane")); @@ -493,9 +493,8 @@ public class BeanContainerTest extends AbstractBeanContainerTestBase { new NestedMethodPropertyTest.Address("Ruukinkatu 2-4", 20540))); assertTrue(container.addNestedContainerProperty("address.street")); - assertEquals("Ruukinkatu 2-4", - container.getContainerProperty("John", "address.street") - .getValue()); + assertEquals("Ruukinkatu 2-4", container + .getContainerProperty("John", "address.street").getValue()); } @Test diff --git a/server/src/test/java/com/vaadin/data/util/BeanItemContainerTest.java b/server/src/test/java/com/vaadin/data/util/BeanItemContainerTest.java index 0298e57dcc..19b0835fd6 100644 --- a/server/src/test/java/com/vaadin/data/util/BeanItemContainerTest.java +++ b/server/src/test/java/com/vaadin/data/util/BeanItemContainerTest.java @@ -30,7 +30,7 @@ import com.vaadin.data.util.filter.Compare; /** * Test basic functionality of BeanItemContainer. - * + * * Most sorting related tests are in {@link BeanItemContainerSortTest}. */ public class BeanItemContainerTest extends AbstractBeanContainerTestBase { @@ -69,16 +69,15 @@ public class BeanItemContainerTest extends AbstractBeanContainerTestBase { @Override protected void validateContainer(Container container, Object expectedFirstItemId, Object expectedLastItemId, - Object itemIdInSet, Object itemIdNotInSet, - boolean checkGetItemNull, int expectedSize) { + Object itemIdInSet, Object itemIdNotInSet, boolean checkGetItemNull, + int expectedSize) { Object notInSet = nameToBean.get(itemIdNotInSet); if (notInSet == null && itemIdNotInSet != null) { notInSet = new ClassName(String.valueOf(itemIdNotInSet), 9999); } super.validateContainer(container, nameToBean.get(expectedFirstItemId), - nameToBean.get(expectedLastItemId), - nameToBean.get(itemIdInSet), notInSet, checkGetItemNull, - expectedSize); + nameToBean.get(expectedLastItemId), nameToBean.get(itemIdInSet), + notInSet, checkGetItemNull, expectedSize); } @Override @@ -236,13 +235,15 @@ public class BeanItemContainerTest extends AbstractBeanContainerTestBase { public void testEmptyCollectionConstructor() { try { new BeanItemContainer((Collection) null); - Assert.fail("Initializing BeanItemContainer from a null collection should not work!"); + Assert.fail( + "Initializing BeanItemContainer from a null collection should not work!"); } catch (IllegalArgumentException e) { // success } try { new BeanItemContainer(new ArrayList()); - Assert.fail("Initializing BeanItemContainer from an empty collection should not work!"); + Assert.fail( + "Initializing BeanItemContainer from an empty collection should not work!"); } catch (IllegalArgumentException e) { // success } @@ -276,8 +277,7 @@ public class BeanItemContainerTest extends AbstractBeanContainerTestBase { counter.reset(); container.addItemAfter(null, cn1); counter.assertOnce(); - Assert.assertEquals( - "com.example.Test", + Assert.assertEquals("com.example.Test", container.getContainerProperty(container.firstItemId(), FULLY_QUALIFIED_NAME).getValue()); @@ -285,8 +285,7 @@ public class BeanItemContainerTest extends AbstractBeanContainerTestBase { counter.reset(); container.addItemAfter(container.firstItemId(), cn1); counter.assertOnce(); - Assert.assertEquals( - "com.example.Test", + Assert.assertEquals("com.example.Test", container.getContainerProperty(container.getIdByIndex(1), FULLY_QUALIFIED_NAME).getValue()); @@ -294,8 +293,7 @@ public class BeanItemContainerTest extends AbstractBeanContainerTestBase { counter.reset(); container.addItemAfter(container.lastItemId(), cn1); counter.assertOnce(); - Assert.assertEquals( - "com.example.Test", + Assert.assertEquals("com.example.Test", container.getContainerProperty(container.lastItemId(), FULLY_QUALIFIED_NAME).getValue()); @@ -303,8 +301,7 @@ public class BeanItemContainerTest extends AbstractBeanContainerTestBase { counter.reset(); container.addItemAt(0, cn1); counter.assertOnce(); - Assert.assertEquals( - "com.example.Test", + Assert.assertEquals("com.example.Test", container.getContainerProperty(container.firstItemId(), FULLY_QUALIFIED_NAME).getValue()); @@ -312,8 +309,7 @@ public class BeanItemContainerTest extends AbstractBeanContainerTestBase { counter.reset(); container.addItemAt(1, cn1); counter.assertOnce(); - Assert.assertEquals( - "com.example.Test", + Assert.assertEquals("com.example.Test", container.getContainerProperty(container.getIdByIndex(1), FULLY_QUALIFIED_NAME).getValue()); @@ -321,8 +317,7 @@ public class BeanItemContainerTest extends AbstractBeanContainerTestBase { counter.reset(); container.addItemAt(container.size(), cn1); counter.assertOnce(); - Assert.assertEquals( - "com.example.Test", + Assert.assertEquals("com.example.Test", container.getContainerProperty(container.lastItemId(), FULLY_QUALIFIED_NAME).getValue()); @@ -408,8 +403,7 @@ public class BeanItemContainerTest extends AbstractBeanContainerTestBase { counter.reset(); container.addItemAfter(null, cn1); counter.assertOnce(); - Assert.assertEquals( - "com.example.Test", + Assert.assertEquals("com.example.Test", container.getContainerProperty(container.firstItemId(), FULLY_QUALIFIED_NAME).getValue()); @@ -417,8 +411,7 @@ public class BeanItemContainerTest extends AbstractBeanContainerTestBase { counter.reset(); container.addItemAfter(container.firstItemId(), cn1); counter.assertOnce(); - Assert.assertEquals( - "com.example.Test", + Assert.assertEquals("com.example.Test", container.getContainerProperty(container.getIdByIndex(1), FULLY_QUALIFIED_NAME).getValue()); @@ -426,8 +419,7 @@ public class BeanItemContainerTest extends AbstractBeanContainerTestBase { counter.reset(); container.addItemAfter(container.lastItemId(), cn1); counter.assertOnce(); - Assert.assertEquals( - "com.example.Test", + Assert.assertEquals("com.example.Test", container.getContainerProperty(container.lastItemId(), FULLY_QUALIFIED_NAME).getValue()); @@ -435,8 +427,7 @@ public class BeanItemContainerTest extends AbstractBeanContainerTestBase { counter.reset(); container.addItemAt(0, cn1); counter.assertOnce(); - Assert.assertEquals( - "com.example.Test", + Assert.assertEquals("com.example.Test", container.getContainerProperty(container.firstItemId(), FULLY_QUALIFIED_NAME).getValue()); @@ -444,8 +435,7 @@ public class BeanItemContainerTest extends AbstractBeanContainerTestBase { counter.reset(); container.addItemAt(1, cn1); counter.assertOnce(); - Assert.assertEquals( - "com.example.Test", + Assert.assertEquals("com.example.Test", container.getContainerProperty(container.getIdByIndex(1), FULLY_QUALIFIED_NAME).getValue()); @@ -453,8 +443,7 @@ public class BeanItemContainerTest extends AbstractBeanContainerTestBase { counter.reset(); container.addItemAt(container.size(), cn1); counter.assertOnce(); - Assert.assertEquals( - "com.example.Test", + Assert.assertEquals("com.example.Test", container.getContainerProperty(container.lastItemId(), FULLY_QUALIFIED_NAME).getValue()); @@ -704,8 +693,8 @@ public class BeanItemContainerTest extends AbstractBeanContainerTestBase { Person john = new Person("John"); container.addBean(john); - Assert.assertEquals("John", container - .getContainerProperty(john, "name").getValue()); + Assert.assertEquals("John", + container.getContainerProperty(john, "name").getValue()); Assert.assertTrue(container.removeContainerProperty("name")); Assert.assertNull(container.getContainerProperty(john, "name")); @@ -749,14 +738,13 @@ public class BeanItemContainerTest extends AbstractBeanContainerTestBase { NestedMethodPropertyTest.Person.class); NestedMethodPropertyTest.Person john = new NestedMethodPropertyTest.Person( - "John", new NestedMethodPropertyTest.Address("Ruukinkatu 2-4", - 20540)); + "John", + new NestedMethodPropertyTest.Address("Ruukinkatu 2-4", 20540)); container.addBean(john); assertTrue(container.addNestedContainerProperty("address.street")); - assertEquals("Ruukinkatu 2-4", - container.getContainerProperty(john, "address.street") - .getValue()); + assertEquals("Ruukinkatu 2-4", container + .getContainerProperty(john, "address.street").getValue()); } @Test @@ -839,8 +827,8 @@ public class BeanItemContainerTest extends AbstractBeanContainerTestBase { ItemSetChangeListener addListener = createListenerMockFor(container); Capture capturedEvent = captureAddEvent(addListener); EasyMock.replay(addListener); - List beans = Arrays.asList(new Person("Jack"), new Person( - "John")); + List beans = Arrays.asList(new Person("Jack"), + new Person("John")); container.addAll(beans); @@ -854,8 +842,8 @@ public class BeanItemContainerTest extends AbstractBeanContainerTestBase { ItemSetChangeListener addListener = createListenerMockFor(container); Capture capturedEvent = captureAddEvent(addListener); EasyMock.replay(addListener); - List beans = Arrays.asList(new Person("Jack"), new Person( - "John")); + List beans = Arrays.asList(new Person("Jack"), + new Person("John")); container.addFilter(new Compare.Equal("name", "John")); container.addAll(beans); @@ -886,8 +874,8 @@ public class BeanItemContainerTest extends AbstractBeanContainerTestBase { Person bean = new Person("John"); container.addItem(bean); ItemSetChangeListener removeListener = createListenerMockFor(container); - removeListener.containerItemSetChange(EasyMock - .isA(ItemRemoveEvent.class)); + removeListener + .containerItemSetChange(EasyMock.isA(ItemRemoveEvent.class)); EasyMock.replay(removeListener); container.removeItem(bean); @@ -902,7 +890,8 @@ public class BeanItemContainerTest extends AbstractBeanContainerTestBase { Person bean = new Person("John"); container.addItem(bean); ItemSetChangeListener removeListener = createListenerMockFor(container); - Capture capturedEvent = captureRemoveEvent(removeListener); + Capture capturedEvent = captureRemoveEvent( + removeListener); EasyMock.replay(removeListener); container.removeItem(bean); @@ -918,7 +907,8 @@ public class BeanItemContainerTest extends AbstractBeanContainerTestBase { Person secondBean = new Person("John"); container.addItem(secondBean); ItemSetChangeListener removeListener = createListenerMockFor(container); - Capture capturedEvent = captureRemoveEvent(removeListener); + Capture capturedEvent = captureRemoveEvent( + removeListener); EasyMock.replay(removeListener); container.removeItem(secondBean); @@ -933,7 +923,8 @@ public class BeanItemContainerTest extends AbstractBeanContainerTestBase { container.addItem(new Person("Jack")); container.addItem(new Person("John")); ItemSetChangeListener removeListener = createListenerMockFor(container); - Capture capturedEvent = captureRemoveEvent(removeListener); + Capture capturedEvent = captureRemoveEvent( + removeListener); EasyMock.replay(removeListener); container.removeAllItems(); @@ -970,8 +961,8 @@ public class BeanItemContainerTest extends AbstractBeanContainerTestBase { container.addNestedContainerBean("address"); - assertTrue(container.getContainerPropertyIds().contains( - "address.street")); + assertTrue( + container.getContainerPropertyIds().contains("address.street")); NestedMethodPropertyTest.Person john = new NestedMethodPropertyTest.Person( "John", new Address("streetname", 12345)); @@ -979,9 +970,8 @@ public class BeanItemContainerTest extends AbstractBeanContainerTestBase { assertTrue(container.getItem(john).getItemPropertyIds() .contains("address.street")); - assertEquals("streetname", - container.getItem(john).getItemProperty("address.street") - .getValue()); + assertEquals("streetname", container.getItem(john) + .getItemProperty("address.street").getValue()); } @@ -996,13 +986,12 @@ public class BeanItemContainerTest extends AbstractBeanContainerTestBase { container.addNestedContainerBean("address"); - assertTrue(container.getContainerPropertyIds().contains( - "address.street")); + assertTrue( + container.getContainerPropertyIds().contains("address.street")); assertTrue(container.getItem(john).getItemPropertyIds() .contains("address.street")); - assertEquals("streetname", - container.getItem(john).getItemProperty("address.street") - .getValue()); + assertEquals("streetname", container.getItem(john) + .getItemProperty("address.street").getValue()); } } diff --git a/server/src/test/java/com/vaadin/data/util/BeanItemTest.java b/server/src/test/java/com/vaadin/data/util/BeanItemTest.java index e78d518a25..1bbe74818c 100644 --- a/server/src/test/java/com/vaadin/data/util/BeanItemTest.java +++ b/server/src/test/java/com/vaadin/data/util/BeanItemTest.java @@ -16,9 +16,9 @@ import com.vaadin.data.Property; /** * Test BeanItem specific features. - * + * * Only public API is tested, not the methods with package visibility. - * + * * See also {@link PropertySetItemTest}, which tests the base class. */ public class BeanItemTest { @@ -148,8 +148,8 @@ public class BeanItemTest { } } - protected static interface MySubInterface extends MySuperInterface, - MySuperInterface2 { + protected static interface MySubInterface + extends MySuperInterface, MySuperInterface2 { public int getSub(); public void setSub(int i); @@ -203,8 +203,8 @@ public class BeanItemTest { public void testGetInterfaceProperties() throws SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException { - Method method = BeanItem.class.getDeclaredMethod( - "getPropertyDescriptors", Class.class); + Method method = BeanItem.class + .getDeclaredMethod("getPropertyDescriptors", Class.class); method.setAccessible(true); LinkedHashMap> propertyDescriptors = (LinkedHashMap>) method .invoke(null, MySuperInterface.class); @@ -222,8 +222,8 @@ public class BeanItemTest { public void testGetSuperInterfaceProperties() throws SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException { - Method method = BeanItem.class.getDeclaredMethod( - "getPropertyDescriptors", Class.class); + Method method = BeanItem.class + .getDeclaredMethod("getPropertyDescriptors", Class.class); method.setAccessible(true); LinkedHashMap> propertyDescriptors = (LinkedHashMap>) method .invoke(null, MySubInterface.class); @@ -314,14 +314,14 @@ public class BeanItemTest { public void testPropertyTypes() { BeanItem item = new BeanItem(new MyClass("bean1")); - Assert.assertTrue(Integer.class.equals(item.getItemProperty( - "superPrivate").getType())); - Assert.assertTrue(Double.class.equals(item.getItemProperty( - "superProtected").getType())); - Assert.assertTrue(Boolean.class.equals(item.getItemProperty( - "superPublic").getType())); - Assert.assertTrue(String.class.equals(item.getItemProperty("name") - .getType())); + Assert.assertTrue(Integer.class + .equals(item.getItemProperty("superPrivate").getType())); + Assert.assertTrue(Double.class + .equals(item.getItemProperty("superProtected").getType())); + Assert.assertTrue(Boolean.class + .equals(item.getItemProperty("superPublic").getType())); + Assert.assertTrue( + String.class.equals(item.getItemProperty("name").getType())); } @Test @@ -335,12 +335,12 @@ public class BeanItemTest { @Test public void testCustomProperties() throws Exception { LinkedHashMap> propertyDescriptors = new LinkedHashMap>(); - propertyDescriptors.put( - "myname", + propertyDescriptors.put("myname", new MethodPropertyDescriptor("myname", - MyClass.class, MyClass.class - .getDeclaredMethod("getName"), MyClass.class - .getDeclaredMethod("setName", String.class))); + MyClass.class, + MyClass.class.getDeclaredMethod("getName"), + MyClass.class.getDeclaredMethod("setName", + String.class))); MyClass instance = new MyClass("bean1"); Constructor constructor = BeanItem.class .getDeclaredConstructor(Object.class, Map.class); diff --git a/server/src/test/java/com/vaadin/data/util/ContainerHierarchicalWrapperTest.java b/server/src/test/java/com/vaadin/data/util/ContainerHierarchicalWrapperTest.java index a6fec6670b..e41f751bfd 100644 --- a/server/src/test/java/com/vaadin/data/util/ContainerHierarchicalWrapperTest.java +++ b/server/src/test/java/com/vaadin/data/util/ContainerHierarchicalWrapperTest.java @@ -2,25 +2,25 @@ package com.vaadin.data.util; import org.junit.Test; -public class ContainerHierarchicalWrapperTest extends - AbstractHierarchicalContainerTestBase { +public class ContainerHierarchicalWrapperTest + extends AbstractHierarchicalContainerTestBase { @Test public void testBasicOperations() { - testBasicContainerOperations(new ContainerHierarchicalWrapper( - new IndexedContainer())); + testBasicContainerOperations( + new ContainerHierarchicalWrapper(new IndexedContainer())); } @Test public void testHierarchicalContainer() { - testHierarchicalContainer(new ContainerHierarchicalWrapper( - new IndexedContainer())); + testHierarchicalContainer( + new ContainerHierarchicalWrapper(new IndexedContainer())); } @Test public void testRemoveSubtree() { - testRemoveHierarchicalWrapperSubtree(new ContainerHierarchicalWrapper( - new IndexedContainer())); + testRemoveHierarchicalWrapperSubtree( + new ContainerHierarchicalWrapper(new IndexedContainer())); } } diff --git a/server/src/test/java/com/vaadin/data/util/ContainerOrderedWrapperTest.java b/server/src/test/java/com/vaadin/data/util/ContainerOrderedWrapperTest.java index 7e720071be..c3a8b2c4f9 100644 --- a/server/src/test/java/com/vaadin/data/util/ContainerOrderedWrapperTest.java +++ b/server/src/test/java/com/vaadin/data/util/ContainerOrderedWrapperTest.java @@ -56,7 +56,8 @@ public class ContainerOrderedWrapperTest extends AbstractContainerTestBase { } @Override - public Item addItem(Object itemId) throws UnsupportedOperationException { + public Item addItem(Object itemId) + throws UnsupportedOperationException { return container.addItem(itemId); } @@ -93,14 +94,14 @@ public class ContainerOrderedWrapperTest extends AbstractContainerTestBase { @Test public void testBasicOperations() { - testBasicContainerOperations(new ContainerOrderedWrapper( - new NotOrderedContainer())); + testBasicContainerOperations( + new ContainerOrderedWrapper(new NotOrderedContainer())); } @Test public void testOrdered() { - testContainerOrdered(new ContainerOrderedWrapper( - new NotOrderedContainer())); + testContainerOrdered( + new ContainerOrderedWrapper(new NotOrderedContainer())); } } diff --git a/server/src/test/java/com/vaadin/data/util/ContainerSizeAssertTest.java b/server/src/test/java/com/vaadin/data/util/ContainerSizeAssertTest.java index 04fd8d3cd1..4e97328206 100644 --- a/server/src/test/java/com/vaadin/data/util/ContainerSizeAssertTest.java +++ b/server/src/test/java/com/vaadin/data/util/ContainerSizeAssertTest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/server/src/test/java/com/vaadin/data/util/ContainerSortingTest.java b/server/src/test/java/com/vaadin/data/util/ContainerSortingTest.java index dced4b4e72..1c4dc1de5e 100644 --- a/server/src/test/java/com/vaadin/data/util/ContainerSortingTest.java +++ b/server/src/test/java/com/vaadin/data/util/ContainerSortingTest.java @@ -66,15 +66,15 @@ public class ContainerSortingTest { ITEM_STRING_1, ITEM_STRING_2, ITEM_STRING_NULL2 }); ic.sort(new Object[] { PROPERTY_INTEGER_NOT_NULL, - PROPERTY_INTEGER_NULL2, PROPERTY_STRING_ID }, new boolean[] { - true, false, true }); + PROPERTY_INTEGER_NULL2, PROPERTY_STRING_ID }, + new boolean[] { true, false, true }); verifyOrder(ic, new String[] { ITEM_DATA_MINUS2, ITEM_DATA_MINUS2_NULL, ITEM_DATA_MINUS1, ITEM_DATA_MINUS1_NULL, ITEM_ANOTHER_NULL, ITEM_STRING_NULL2, ITEM_STRING_1, ITEM_STRING_2 }); ic.sort(new Object[] { PROPERTY_INTEGER_NOT_NULL, - PROPERTY_INTEGER_NULL2, PROPERTY_STRING_ID }, new boolean[] { - true, true, true }); + PROPERTY_INTEGER_NULL2, PROPERTY_STRING_ID }, + new boolean[] { true, true, true }); verifyOrder(ic, new String[] { ITEM_DATA_MINUS2_NULL, ITEM_DATA_MINUS2, ITEM_DATA_MINUS1_NULL, ITEM_DATA_MINUS1, ITEM_ANOTHER_NULL, ITEM_STRING_NULL2, ITEM_STRING_1, ITEM_STRING_2 }); @@ -86,18 +86,17 @@ public class ContainerSortingTest { HierarchicalContainer hc = new HierarchicalContainer(); populateContainer(hc); hc.sort(new Object[] { "name" }, new boolean[] { true }); - verifyOrder(hc, new String[] { "Audi", "C++", "Call of Duty", "Cars", - "English", "Fallout", "Finnish", "Ford", "Games", "Java", - "Might and Magic", "Natural languages", "PHP", - "Programming languages", "Python", "Red Alert", "Swedish", - "Toyota", "Volvo" }); - TestUtil.assertArrays( - hc.rootItemIds().toArray(), + verifyOrder(hc, + new String[] { "Audi", "C++", "Call of Duty", "Cars", "English", + "Fallout", "Finnish", "Ford", "Games", "Java", + "Might and Magic", "Natural languages", "PHP", + "Programming languages", "Python", "Red Alert", + "Swedish", "Toyota", "Volvo" }); + TestUtil.assertArrays(hc.rootItemIds().toArray(), new Integer[] { nameToId.get("Cars"), nameToId.get("Games"), nameToId.get("Natural languages"), nameToId.get("Programming languages") }); - TestUtil.assertArrays( - hc.getChildren(nameToId.get("Games")).toArray(), + TestUtil.assertArrays(hc.getChildren(nameToId.get("Games")).toArray(), new Integer[] { nameToId.get("Call of Duty"), nameToId.get("Fallout"), nameToId.get("Might and Magic"), diff --git a/server/src/test/java/com/vaadin/data/util/FileSystemContainerTest.java b/server/src/test/java/com/vaadin/data/util/FileSystemContainerTest.java index f4bb794e5c..992b265702 100644 --- a/server/src/test/java/com/vaadin/data/util/FileSystemContainerTest.java +++ b/server/src/test/java/com/vaadin/data/util/FileSystemContainerTest.java @@ -9,8 +9,8 @@ public class FileSystemContainerTest { @Test public void nonExistingDirectory() { - FilesystemContainer fsc = new FilesystemContainer(new File( - "/non/existing")); + FilesystemContainer fsc = new FilesystemContainer( + new File("/non/existing")); Assert.assertTrue(fsc.getItemIds().isEmpty()); } } diff --git a/server/src/test/java/com/vaadin/data/util/GeneratedPropertyContainerBasicTest.java b/server/src/test/java/com/vaadin/data/util/GeneratedPropertyContainerBasicTest.java index 5f7f965c69..11335314f0 100644 --- a/server/src/test/java/com/vaadin/data/util/GeneratedPropertyContainerBasicTest.java +++ b/server/src/test/java/com/vaadin/data/util/GeneratedPropertyContainerBasicTest.java @@ -20,8 +20,8 @@ import com.vaadin.data.Container.ItemSetChangeNotifier; import com.vaadin.data.Item; import com.vaadin.data.util.filter.SimpleStringFilter; -public class GeneratedPropertyContainerBasicTest extends - AbstractInMemoryContainerTestBase { +public class GeneratedPropertyContainerBasicTest + extends AbstractInMemoryContainerTestBase { @Test public void testBasicOperations() { @@ -147,8 +147,8 @@ public class GeneratedPropertyContainerBasicTest extends counter.assertOnce(); container.removeContainerFilter(filter); counter.assertOnce(); - container.addContainerFilter(new SimpleStringFilter(SIMPLE_NAME, "a", - true, false)); + container.addContainerFilter( + new SimpleStringFilter(SIMPLE_NAME, "a", true, false)); counter.assertOnce(); container.removeAllContainerFilters(); counter.assertOnce(); @@ -164,8 +164,8 @@ public class GeneratedPropertyContainerBasicTest extends counter.reset(); ((Container.Filterable) container) - .addContainerFilter(new SimpleStringFilter( - FULLY_QUALIFIED_NAME, "Test", true, false)); + .addContainerFilter(new SimpleStringFilter(FULLY_QUALIFIED_NAME, + "Test", true, false)); // no real change, so no notification required counter.assertNone(); @@ -380,8 +380,8 @@ public class GeneratedPropertyContainerBasicTest extends GeneratedPropertyContainer container = createContainer(); Object itemId = container.addItem(); ItemSetChangeListener removeListener = createListenerMockFor(container); - removeListener.containerItemSetChange(EasyMock - .isA(ItemRemoveEvent.class)); + removeListener + .containerItemSetChange(EasyMock.isA(ItemRemoveEvent.class)); EasyMock.replay(removeListener); container.removeItem(itemId); @@ -394,7 +394,8 @@ public class GeneratedPropertyContainerBasicTest extends GeneratedPropertyContainer container = createContainer(); Object itemId = container.addItem(); ItemSetChangeListener removeListener = createListenerMockFor(container); - Capture capturedEvent = captureRemoveEvent(removeListener); + Capture capturedEvent = captureRemoveEvent( + removeListener); EasyMock.replay(removeListener); container.removeItem(itemId); @@ -408,7 +409,8 @@ public class GeneratedPropertyContainerBasicTest extends container.addItem(); Object secondItemId = container.addItem(); ItemSetChangeListener removeListener = createListenerMockFor(container); - Capture capturedEvent = captureRemoveEvent(removeListener); + Capture capturedEvent = captureRemoveEvent( + removeListener); EasyMock.replay(removeListener); container.removeItem(secondItemId); @@ -422,7 +424,8 @@ public class GeneratedPropertyContainerBasicTest extends container.addItem(); container.addItem(); ItemSetChangeListener removeListener = createListenerMockFor(container); - Capture capturedEvent = captureRemoveEvent(removeListener); + Capture capturedEvent = captureRemoveEvent( + removeListener); EasyMock.replay(removeListener); container.removeAllItems(); diff --git a/server/src/test/java/com/vaadin/data/util/GeneratedPropertyContainerTest.java b/server/src/test/java/com/vaadin/data/util/GeneratedPropertyContainerTest.java index b08437a953..24091f5d5a 100644 --- a/server/src/test/java/com/vaadin/data/util/GeneratedPropertyContainerTest.java +++ b/server/src/test/java/com/vaadin/data/util/GeneratedPropertyContainerTest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -41,8 +41,8 @@ public class GeneratedPropertyContainerTest { Indexed wrappedContainer; private static double MILES_CONVERSION = 0.6214d; - private class GeneratedPropertyListener implements - PropertySetChangeListener { + private class GeneratedPropertyListener + implements PropertySetChangeListener { private int callCount = 0; @@ -99,8 +99,9 @@ public class GeneratedPropertyContainerTest { }); Object itemId = container.addItem(); - assertEquals("Expected value not in item.", container.getItem(itemId) - .getItemProperty("hello").getValue(), "Hello World!"); + assertEquals("Expected value not in item.", + container.getItem(itemId).getItemProperty("hello").getValue(), + "Hello World!"); } @Test @@ -123,8 +124,8 @@ public class GeneratedPropertyContainerTest { @Override public SortOrder[] getSortProperties(SortOrder order) { SortOrder[] sortOrder = new SortOrder[1]; - sortOrder[0] = new SortOrder("bar", order - .getDirection()); + sortOrder[0] = new SortOrder("bar", + order.getDirection()); return sortOrder; } }); @@ -159,7 +160,8 @@ public class GeneratedPropertyContainerTest { } }); - assertFalse(container.getSortableContainerPropertyIds().contains("bar")); + assertFalse( + container.getSortableContainerPropertyIds().contains("bar")); } @Test @@ -273,8 +275,8 @@ public class GeneratedPropertyContainerTest { @Test public void testRemoveProperty() { container.removeContainerProperty("foo"); - assertFalse("Container contained removed property", container - .getContainerPropertyIds().contains("foo")); + assertFalse("Container contained removed property", + container.getContainerPropertyIds().contains("foo")); assertTrue("Wrapped container did not contain removed property", wrappedContainer.getContainerPropertyIds().contains("foo")); @@ -282,8 +284,8 @@ public class GeneratedPropertyContainerTest { .getItemPropertyIds().contains("foo")); container.addContainerProperty("foo", null, null); - assertTrue("Container did not contain returned property", container - .getContainerPropertyIds().contains("foo")); + assertTrue("Container did not contain returned property", + container.getContainerPropertyIds().contains("foo")); } @Test diff --git a/server/src/test/java/com/vaadin/data/util/HierarchicalContainerOrderedWrapperTest.java b/server/src/test/java/com/vaadin/data/util/HierarchicalContainerOrderedWrapperTest.java index 8c7970e554..54984f07ad 100644 --- a/server/src/test/java/com/vaadin/data/util/HierarchicalContainerOrderedWrapperTest.java +++ b/server/src/test/java/com/vaadin/data/util/HierarchicalContainerOrderedWrapperTest.java @@ -2,8 +2,8 @@ package com.vaadin.data.util; import org.junit.Test; -public class HierarchicalContainerOrderedWrapperTest extends - AbstractHierarchicalContainerTestBase { +public class HierarchicalContainerOrderedWrapperTest + extends AbstractHierarchicalContainerTestBase { private HierarchicalContainerOrderedWrapper createContainer() { return new HierarchicalContainerOrderedWrapper( diff --git a/server/src/test/java/com/vaadin/data/util/HierarchicalContainerTest.java b/server/src/test/java/com/vaadin/data/util/HierarchicalContainerTest.java index 280c46efcc..7ab20ca3dd 100644 --- a/server/src/test/java/com/vaadin/data/util/HierarchicalContainerTest.java +++ b/server/src/test/java/com/vaadin/data/util/HierarchicalContainerTest.java @@ -9,8 +9,8 @@ import org.junit.Test; import com.vaadin.data.Container.Filter; import com.vaadin.data.Item; -public class HierarchicalContainerTest extends - AbstractHierarchicalContainerTestBase { +public class HierarchicalContainerTest + extends AbstractHierarchicalContainerTestBase { @Test public void testBasicOperations() { @@ -142,8 +142,8 @@ public class HierarchicalContainerTest extends validateHierarchicalContainer(container, "com", "com.vaadin.terminal.gwt.client.WidgetSet", - "com.vaadin.terminal.gwt.client.ui.VSplitPanelVertical", - "blah", true, expectedSize, expectedRoots, true); + "com.vaadin.terminal.gwt.client.ui.VSplitPanelVertical", "blah", + true, expectedSize, expectedRoots, true); // Additionally remove all without 'm' in the simple name. container.addContainerFilter(SIMPLE_NAME, "m", false, false); @@ -151,9 +151,7 @@ public class HierarchicalContainerTest extends expectedSize = 7 + 18; expectedRoots = 1; - validateHierarchicalContainer( - container, - "com", + validateHierarchicalContainer(container, "com", "com.vaadin.terminal.gwt.client.ui.VUriFragmentUtility", "com.vaadin.terminal.gwt.client.ui.layout.ChildComponentContainer", "blah", true, expectedSize, expectedRoots, true); @@ -249,10 +247,9 @@ public class HierarchicalContainerTest extends int expectedRoots = 20; validateHierarchicalContainer(container, - "com.vaadin.data.BufferedValidatable", - "com.vaadin.ui.TabSheet", - "com.vaadin.terminal.gwt.client.ui.VTabsheetBase", "blah", - true, expectedSize, expectedRoots, false); + "com.vaadin.data.BufferedValidatable", "com.vaadin.ui.TabSheet", + "com.vaadin.terminal.gwt.client.ui.VTabsheetBase", "blah", true, + expectedSize, expectedRoots, false); // only include .gwt.client classes container.removeAllContainerFilters(); diff --git a/server/src/test/java/com/vaadin/data/util/IndexedContainerTest.java b/server/src/test/java/com/vaadin/data/util/IndexedContainerTest.java index 27632846de..b19a425518 100644 --- a/server/src/test/java/com/vaadin/data/util/IndexedContainerTest.java +++ b/server/src/test/java/com/vaadin/data/util/IndexedContainerTest.java @@ -366,8 +366,8 @@ public class IndexedContainerTest extends AbstractInMemoryContainerTestBase { IndexedContainer container = new IndexedContainer(); Object itemId = container.addItem(); ItemSetChangeListener removeListener = createListenerMockFor(container); - removeListener.containerItemSetChange(EasyMock - .isA(ItemRemoveEvent.class)); + removeListener + .containerItemSetChange(EasyMock.isA(ItemRemoveEvent.class)); EasyMock.replay(removeListener); container.removeItem(itemId); @@ -380,7 +380,8 @@ public class IndexedContainerTest extends AbstractInMemoryContainerTestBase { IndexedContainer container = new IndexedContainer(); Object itemId = container.addItem(); ItemSetChangeListener removeListener = createListenerMockFor(container); - Capture capturedEvent = captureRemoveEvent(removeListener); + Capture capturedEvent = captureRemoveEvent( + removeListener); EasyMock.replay(removeListener); container.removeItem(itemId); @@ -394,7 +395,8 @@ public class IndexedContainerTest extends AbstractInMemoryContainerTestBase { container.addItem(); Object secondItemId = container.addItem(); ItemSetChangeListener removeListener = createListenerMockFor(container); - Capture capturedEvent = captureRemoveEvent(removeListener); + Capture capturedEvent = captureRemoveEvent( + removeListener); EasyMock.replay(removeListener); container.removeItem(secondItemId); @@ -408,7 +410,8 @@ public class IndexedContainerTest extends AbstractInMemoryContainerTestBase { container.addItem(); container.addItem(); ItemSetChangeListener removeListener = createListenerMockFor(container); - Capture capturedEvent = captureRemoveEvent(removeListener); + Capture capturedEvent = captureRemoveEvent( + removeListener); EasyMock.replay(removeListener); container.removeAllItems(); diff --git a/server/src/test/java/com/vaadin/data/util/MethodPropertyMemoryConsumptionTest.java b/server/src/test/java/com/vaadin/data/util/MethodPropertyMemoryConsumptionTest.java index b4621b823a..61e939701a 100644 --- a/server/src/test/java/com/vaadin/data/util/MethodPropertyMemoryConsumptionTest.java +++ b/server/src/test/java/com/vaadin/data/util/MethodPropertyMemoryConsumptionTest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -28,15 +28,16 @@ import org.junit.Test; /** * Test for MethodProperty: don't allocate unnecessary Object arrays. - * + * * @since 7.2 * @author Vaadin Ltd */ public class MethodPropertyMemoryConsumptionTest { @Test - public void testSetArguments() throws NoSuchFieldException, - SecurityException, IllegalArgumentException, IllegalAccessException { + public void testSetArguments() + throws NoSuchFieldException, SecurityException, + IllegalArgumentException, IllegalAccessException { TestBean bean = new TestBean(); TestMethodProperty property = new TestMethodProperty( bean, "name"); @@ -51,12 +52,14 @@ public class MethodPropertyMemoryConsumptionTest { .getDeclaredField("setArgs"); setArgsField.setAccessible(true); - Assert.assertSame("setArguments method sets non-default instance" - + " of empty Object array for getArgs", + Assert.assertSame( + "setArguments method sets non-default instance" + + " of empty Object array for getArgs", getArgsField.get(property), getArgs); - Assert.assertSame("setArguments method sets non-default instance" - + " of empty Object array for setArgs", + Assert.assertSame( + "setArguments method sets non-default instance" + + " of empty Object array for setArgs", setArgsField.get(property), setArgs); } @@ -72,17 +75,19 @@ public class MethodPropertyMemoryConsumptionTest { TestBean otherBean = new TestBean(); TestMethodProperty otherProperty = new TestMethodProperty( otherBean, "name"); - Assert.assertSame("setArguments method uses different instance" - + " of empty Object array for getArgs", getArgs, - otherProperty.getGetArgs()); - Assert.assertSame("setArguments method uses different instance" - + " of empty Object array for setArgs", setArgs, - otherProperty.getSetArgs()); + Assert.assertSame( + "setArguments method uses different instance" + + " of empty Object array for getArgs", + getArgs, otherProperty.getGetArgs()); + Assert.assertSame( + "setArguments method uses different instance" + + " of empty Object array for setArgs", + setArgs, otherProperty.getSetArgs()); } @Test - public void testDefaultArgsSerialization() throws IOException, - ClassNotFoundException { + public void testDefaultArgsSerialization() + throws IOException, ClassNotFoundException { TestBean bean = new TestBean(); TestMethodProperty property = new TestMethodProperty( bean, "name"); diff --git a/server/src/test/java/com/vaadin/data/util/NestedMethodPropertyTest.java b/server/src/test/java/com/vaadin/data/util/NestedMethodPropertyTest.java index 79ce425bae..4a1e2a1784 100644 --- a/server/src/test/java/com/vaadin/data/util/NestedMethodPropertyTest.java +++ b/server/src/test/java/com/vaadin/data/util/NestedMethodPropertyTest.java @@ -323,8 +323,8 @@ public class NestedMethodPropertyTest { } @Test - public void testSerializationWithIntermediateNull() throws IOException, - ClassNotFoundException { + public void testSerializationWithIntermediateNull() + throws IOException, ClassNotFoundException { vaadin.setManager(null); NestedMethodProperty streetProperty = new NestedMethodProperty( vaadin, "manager.address.street"); diff --git a/server/src/test/java/com/vaadin/data/util/PerformanceTestIndexedContainerTest.java b/server/src/test/java/com/vaadin/data/util/PerformanceTestIndexedContainerTest.java index fdfc2199b6..5f64c0e8d8 100644 --- a/server/src/test/java/com/vaadin/data/util/PerformanceTestIndexedContainerTest.java +++ b/server/src/test/java/com/vaadin/data/util/PerformanceTestIndexedContainerTest.java @@ -104,8 +104,8 @@ public class PerformanceTestIndexedContainerTest { private void checkMedian(int items, Collection times, String methodName, long threshold) { long median = median(times); - System.out.println(methodName + " timings (ms) for " + items - + " items: " + times); + System.out.println( + methodName + " timings (ms) for " + items + " items: " + times); Assert.assertTrue(methodName + " too slow, median time " + median + "ms for " + items + " items", median <= threshold); } diff --git a/server/src/test/java/com/vaadin/data/util/PropertyDescriptorTest.java b/server/src/test/java/com/vaadin/data/util/PropertyDescriptorTest.java index 86f3968116..af9db229c5 100644 --- a/server/src/test/java/com/vaadin/data/util/PropertyDescriptorTest.java +++ b/server/src/test/java/com/vaadin/data/util/PropertyDescriptorTest.java @@ -36,8 +36,8 @@ public class PropertyDescriptorTest { VaadinPropertyDescriptor descriptor2 = (VaadinPropertyDescriptor) new ObjectInputStream( new ByteArrayInputStream(baos.toByteArray())).readObject(); - Property property = descriptor2.createProperty(new Person("John", - null)); + Property property = descriptor2 + .createProperty(new Person("John", null)); Assert.assertEquals("John", property.getValue()); } diff --git a/server/src/test/java/com/vaadin/data/util/PropertySetItemTest.java b/server/src/test/java/com/vaadin/data/util/PropertySetItemTest.java index b957cb7f20..fc91a20dd0 100644 --- a/server/src/test/java/com/vaadin/data/util/PropertySetItemTest.java +++ b/server/src/test/java/com/vaadin/data/util/PropertySetItemTest.java @@ -181,8 +181,8 @@ public class PropertySetItemTest { PropertysetItem item = createPropertySetItem(); // Expectations and start test - propertySetListenerMock.itemPropertySetChange(EasyMock - .isA(PropertySetChangeEvent.class)); + propertySetListenerMock.itemPropertySetChange( + EasyMock.isA(PropertySetChangeEvent.class)); EasyMock.replay(propertySetListenerMock); // Add listener and add a property -> should end up in listener once @@ -209,8 +209,8 @@ public class PropertySetItemTest { item.addItemProperty(ID2, prop2); // Expectations and start test - propertySetListenerMock.itemPropertySetChange(EasyMock - .isA(PropertySetChangeEvent.class)); + propertySetListenerMock.itemPropertySetChange( + EasyMock.isA(PropertySetChangeEvent.class)); EasyMock.replay(propertySetListenerMock); // Add listener and add a property -> should end up in listener once @@ -425,9 +425,8 @@ public class PropertySetItemTest { item.addItemProperty(ID2, prop2); - Assert.assertEquals( - String.valueOf(prop1.getValue()) + " " - + String.valueOf(prop2.getValue()), item.toString()); + Assert.assertEquals(String.valueOf(prop1.getValue()) + " " + + String.valueOf(prop2.getValue()), item.toString()); } } diff --git a/server/src/test/java/com/vaadin/data/util/ReflectToolsGetSuperFieldTest.java b/server/src/test/java/com/vaadin/data/util/ReflectToolsGetSuperFieldTest.java index 5f31150210..c3efab9114 100644 --- a/server/src/test/java/com/vaadin/data/util/ReflectToolsGetSuperFieldTest.java +++ b/server/src/test/java/com/vaadin/data/util/ReflectToolsGetSuperFieldTest.java @@ -21,8 +21,8 @@ public class ReflectToolsGetSuperFieldTest { } PropertysetItem item = new PropertysetItem(); - item.addItemProperty("testProperty", new ObjectProperty( - "Value of testProperty")); + item.addItemProperty("testProperty", + new ObjectProperty("Value of testProperty")); MySubClass form = new MySubClass(); diff --git a/server/src/test/java/com/vaadin/data/util/TransactionalPropertyWrapperTest.java b/server/src/test/java/com/vaadin/data/util/TransactionalPropertyWrapperTest.java index 5297cd807c..38efe4ba7b 100644 --- a/server/src/test/java/com/vaadin/data/util/TransactionalPropertyWrapperTest.java +++ b/server/src/test/java/com/vaadin/data/util/TransactionalPropertyWrapperTest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -28,15 +28,15 @@ import com.vaadin.ui.TextField; /** * Test verifying that TransactionalPropertyWrapper removes it's listener from * wrapped Property - * + * * @since 7.1.15 * @author Vaadin Ltd */ public class TransactionalPropertyWrapperTest { @SuppressWarnings("serial") - public class TestingProperty extends - ObjectProperty { + public class TestingProperty + extends ObjectProperty { private List listeners = new ArrayList(); @@ -72,8 +72,8 @@ public class TransactionalPropertyWrapperTest { @Test public void fieldGroupBindAndUnbind() { - item.addItemProperty("name", new TestingProperty( - "Just some text")); + item.addItemProperty("name", + new TestingProperty("Just some text")); item.addItemProperty("age", new TestingProperty("42")); final FieldGroup binder = new FieldGroup(item); @@ -97,7 +97,7 @@ public class TransactionalPropertyWrapperTest { /** * Check that all listeners have same hasListeners() response - * + * * @param expected * expected response * @return true if all are the same as expected. false if not diff --git a/server/src/test/java/com/vaadin/data/util/filter/AbstractFilterTestBase.java b/server/src/test/java/com/vaadin/data/util/filter/AbstractFilterTestBase.java index ebd843fb53..979f472e20 100644 --- a/server/src/test/java/com/vaadin/data/util/filter/AbstractFilterTestBase.java +++ b/server/src/test/java/com/vaadin/data/util/filter/AbstractFilterTestBase.java @@ -8,8 +8,8 @@ import com.vaadin.data.Property; import com.vaadin.data.util.ObjectProperty; import com.vaadin.data.util.PropertysetItem; -public abstract class AbstractFilterTestBase extends - TestCase { +public abstract class AbstractFilterTestBase + extends TestCase { protected static final String PROPERTY1 = "property1"; protected static final String PROPERTY2 = "property2"; diff --git a/server/src/test/java/com/vaadin/data/util/filter/AndOrFilterTest.java b/server/src/test/java/com/vaadin/data/util/filter/AndOrFilterTest.java index 21ce685445..f825ef64c6 100644 --- a/server/src/test/java/com/vaadin/data/util/filter/AndOrFilterTest.java +++ b/server/src/test/java/com/vaadin/data/util/filter/AndOrFilterTest.java @@ -7,8 +7,8 @@ import com.vaadin.data.Container.Filter; import com.vaadin.data.Item; import com.vaadin.data.util.BeanItem; -public class AndOrFilterTest extends - AbstractFilterTestBase { +public class AndOrFilterTest + extends AbstractFilterTestBase { protected Item item1 = new BeanItem(1); protected Item item2 = new BeanItem(2); @@ -30,10 +30,10 @@ public class AndOrFilterTest extends @Test public void testTwoFilterAnd() { - Filter filter1 = new And(new SameItemFilter(item1), new SameItemFilter( - item1)); - Filter filter2 = new And(new SameItemFilter(item1), new SameItemFilter( - item2)); + Filter filter1 = new And(new SameItemFilter(item1), + new SameItemFilter(item1)); + Filter filter2 = new And(new SameItemFilter(item1), + new SameItemFilter(item2)); Assert.assertTrue(filter1.passesFilter(null, item1)); Assert.assertFalse(filter1.passesFilter(null, item2)); @@ -44,10 +44,10 @@ public class AndOrFilterTest extends @Test public void testThreeFilterAnd() { - Filter filter1 = new And(new SameItemFilter(item1), new SameItemFilter( - item1), new SameItemFilter(item1)); - Filter filter2 = new And(new SameItemFilter(item1), new SameItemFilter( - item1), new SameItemFilter(item2)); + Filter filter1 = new And(new SameItemFilter(item1), + new SameItemFilter(item1), new SameItemFilter(item1)); + Filter filter2 = new And(new SameItemFilter(item1), + new SameItemFilter(item1), new SameItemFilter(item2)); Assert.assertTrue(filter1.passesFilter(null, item1)); Assert.assertFalse(filter1.passesFilter(null, item2)); @@ -73,10 +73,10 @@ public class AndOrFilterTest extends @Test public void testTwoFilterOr() { - Filter filter1 = new Or(new SameItemFilter(item1), new SameItemFilter( - item1)); - Filter filter2 = new Or(new SameItemFilter(item1), new SameItemFilter( - item2)); + Filter filter1 = new Or(new SameItemFilter(item1), + new SameItemFilter(item1)); + Filter filter2 = new Or(new SameItemFilter(item1), + new SameItemFilter(item2)); Assert.assertTrue(filter1.passesFilter(null, item1)); Assert.assertFalse(filter1.passesFilter(null, item2)); @@ -87,10 +87,10 @@ public class AndOrFilterTest extends @Test public void testThreeFilterOr() { - Filter filter1 = new Or(new SameItemFilter(item1), new SameItemFilter( - item1), new SameItemFilter(item1)); - Filter filter2 = new Or(new SameItemFilter(item1), new SameItemFilter( - item1), new SameItemFilter(item2)); + Filter filter1 = new Or(new SameItemFilter(item1), + new SameItemFilter(item1), new SameItemFilter(item1)); + Filter filter2 = new Or(new SameItemFilter(item1), + new SameItemFilter(item1), new SameItemFilter(item2)); Assert.assertTrue(filter1.passesFilter(null, item1)); Assert.assertFalse(filter1.passesFilter(null, item2)); @@ -146,10 +146,10 @@ public class AndOrFilterTest extends Filter filter1a = new Or(new SameItemFilter(item1)); Filter filter1a2 = new Or(new SameItemFilter(item1)); Filter filter1b = new Or(new SameItemFilter(item2)); - Filter filter2a = new Or(new SameItemFilter(item1), new SameItemFilter( - item1)); - Filter filter2b = new Or(new SameItemFilter(item1), new SameItemFilter( - item2)); + Filter filter2a = new Or(new SameItemFilter(item1), + new SameItemFilter(item1)); + Filter filter2b = new Or(new SameItemFilter(item1), + new SameItemFilter(item2)); Filter filter2b2 = new Or(new SameItemFilter(item1), new SameItemFilter(item2)); Filter other0 = new And(); diff --git a/server/src/test/java/com/vaadin/data/util/filter/CompareFilterDateTest.java b/server/src/test/java/com/vaadin/data/util/filter/CompareFilterDateTest.java index 5908c7d8d4..7c3dba9db3 100644 --- a/server/src/test/java/com/vaadin/data/util/filter/CompareFilterDateTest.java +++ b/server/src/test/java/com/vaadin/data/util/filter/CompareFilterDateTest.java @@ -16,7 +16,6 @@ import com.vaadin.data.util.filter.Compare.GreaterOrEqual; import com.vaadin.data.util.filter.Compare.Less; import com.vaadin.data.util.filter.Compare.LessOrEqual; - public class CompareFilterDateTest extends AbstractFilterTestBase { protected Item itemNullUtilDate; @@ -51,20 +50,20 @@ public class CompareFilterDateTest extends AbstractFilterTestBase { lessEqualCompUtilDate = new LessOrEqual(PROPERTY1, formatter.parse("26072016")); - equalCompSqlDate = new Equal(PROPERTY1, new java.sql.Date(formatter - .parse("26072016").getTime())); - greaterCompSqlDate = new Greater(PROPERTY1, new java.sql.Date(formatter - .parse("26072016").getTime())); - lessCompSqlDate = new Less(PROPERTY1, new java.sql.Date(formatter - .parse("26072016").getTime())); + equalCompSqlDate = new Equal(PROPERTY1, + new java.sql.Date(formatter.parse("26072016").getTime())); + greaterCompSqlDate = new Greater(PROPERTY1, + new java.sql.Date(formatter.parse("26072016").getTime())); + lessCompSqlDate = new Less(PROPERTY1, + new java.sql.Date(formatter.parse("26072016").getTime())); greaterEqualCompSqlDate = new GreaterOrEqual(PROPERTY1, new java.sql.Date(formatter.parse("26072016").getTime())); - lessEqualCompSqlDate = new LessOrEqual(PROPERTY1, new java.sql.Date( - formatter.parse("26072016").getTime())); + lessEqualCompSqlDate = new LessOrEqual(PROPERTY1, + new java.sql.Date(formatter.parse("26072016").getTime())); itemNullUtilDate = new PropertysetItem(); - itemNullUtilDate.addItemProperty(PROPERTY1, new ObjectProperty( - null, Date.class)); + itemNullUtilDate.addItemProperty(PROPERTY1, + new ObjectProperty(null, Date.class)); itemNullSqlDate = new PropertysetItem(); itemNullSqlDate.addItemProperty(PROPERTY1, new ObjectProperty(null, java.sql.Date.class)); @@ -73,8 +72,10 @@ public class CompareFilterDateTest extends AbstractFilterTestBase { formatter.parse("25072016"), Date.class)); itemSqlDate = new PropertysetItem(); itemSqlDate.addItemProperty(PROPERTY1, - new ObjectProperty(new java.sql.Date(formatter - .parse("25072016").getTime()), java.sql.Date.class)); + new ObjectProperty( + new java.sql.Date( + formatter.parse("25072016").getTime()), + java.sql.Date.class)); } @Override @@ -88,50 +89,54 @@ public class CompareFilterDateTest extends AbstractFilterTestBase { @Test public void testCompareUtilDatesAndUtilDates() { - Assert.assertFalse(equalCompUtilDate.passesFilter(null, - itemNullUtilDate)); + Assert.assertFalse( + equalCompUtilDate.passesFilter(null, itemNullUtilDate)); Assert.assertFalse(equalCompUtilDate.passesFilter(null, itemUtilDate)); - Assert.assertFalse(greaterCompUtilDate.passesFilter(null, itemUtilDate)); + Assert.assertFalse( + greaterCompUtilDate.passesFilter(null, itemUtilDate)); Assert.assertTrue(lessCompUtilDate.passesFilter(null, itemUtilDate)); - Assert.assertFalse(greaterEqualCompUtilDate.passesFilter(null, - itemUtilDate)); - Assert.assertTrue(lessEqualCompUtilDate - .passesFilter(null, itemUtilDate)); + Assert.assertFalse( + greaterEqualCompUtilDate.passesFilter(null, itemUtilDate)); + Assert.assertTrue( + lessEqualCompUtilDate.passesFilter(null, itemUtilDate)); } @Test public void testCompareUtilDatesAndSqlDates() { - Assert.assertFalse(equalCompUtilDate - .passesFilter(null, itemNullSqlDate)); + Assert.assertFalse( + equalCompUtilDate.passesFilter(null, itemNullSqlDate)); Assert.assertFalse(equalCompUtilDate.passesFilter(null, itemSqlDate)); Assert.assertFalse(greaterCompUtilDate.passesFilter(null, itemSqlDate)); Assert.assertTrue(lessCompUtilDate.passesFilter(null, itemSqlDate)); - Assert.assertFalse(greaterEqualCompUtilDate.passesFilter(null, - itemSqlDate)); - Assert.assertTrue(lessEqualCompUtilDate.passesFilter(null, itemSqlDate)); + Assert.assertFalse( + greaterEqualCompUtilDate.passesFilter(null, itemSqlDate)); + Assert.assertTrue( + lessEqualCompUtilDate.passesFilter(null, itemSqlDate)); } @Test public void testCompareSqlDatesAndSqlDates() { - Assert.assertFalse(equalCompSqlDate.passesFilter(null, itemNullSqlDate)); + Assert.assertFalse( + equalCompSqlDate.passesFilter(null, itemNullSqlDate)); Assert.assertFalse(equalCompSqlDate.passesFilter(null, itemSqlDate)); Assert.assertFalse(greaterCompSqlDate.passesFilter(null, itemSqlDate)); Assert.assertTrue(lessCompSqlDate.passesFilter(null, itemSqlDate)); - Assert.assertFalse(greaterEqualCompSqlDate.passesFilter(null, - itemSqlDate)); + Assert.assertFalse( + greaterEqualCompSqlDate.passesFilter(null, itemSqlDate)); Assert.assertTrue(lessEqualCompSqlDate.passesFilter(null, itemSqlDate)); } @Test public void testCompareSqlDatesAndUtilDates() { - Assert.assertFalse(equalCompSqlDate - .passesFilter(null, itemNullUtilDate)); + Assert.assertFalse( + equalCompSqlDate.passesFilter(null, itemNullUtilDate)); Assert.assertFalse(equalCompSqlDate.passesFilter(null, itemUtilDate)); Assert.assertFalse(greaterCompSqlDate.passesFilter(null, itemUtilDate)); Assert.assertTrue(lessCompSqlDate.passesFilter(null, itemUtilDate)); - Assert.assertFalse(greaterEqualCompSqlDate.passesFilter(null, - itemUtilDate)); - Assert.assertTrue(lessEqualCompSqlDate.passesFilter(null, itemUtilDate)); + Assert.assertFalse( + greaterEqualCompSqlDate.passesFilter(null, itemUtilDate)); + Assert.assertTrue( + lessEqualCompSqlDate.passesFilter(null, itemUtilDate)); } } diff --git a/server/src/test/java/com/vaadin/data/util/filter/CompareFilterTest.java b/server/src/test/java/com/vaadin/data/util/filter/CompareFilterTest.java index 116d70e188..4bdad3c54d 100644 --- a/server/src/test/java/com/vaadin/data/util/filter/CompareFilterTest.java +++ b/server/src/test/java/com/vaadin/data/util/filter/CompareFilterTest.java @@ -41,20 +41,20 @@ public class CompareFilterTest extends AbstractFilterTestBase { protected void setUp() throws Exception { super.setUp(); itemNull = new PropertysetItem(); - itemNull.addItemProperty(PROPERTY1, new ObjectProperty(null, - String.class)); + itemNull.addItemProperty(PROPERTY1, + new ObjectProperty(null, String.class)); itemEmpty = new PropertysetItem(); - itemEmpty.addItemProperty(PROPERTY1, new ObjectProperty("", - String.class)); + itemEmpty.addItemProperty(PROPERTY1, + new ObjectProperty("", String.class)); itemA = new PropertysetItem(); - itemA.addItemProperty(PROPERTY1, new ObjectProperty("a", - String.class)); + itemA.addItemProperty(PROPERTY1, + new ObjectProperty("a", String.class)); itemB = new PropertysetItem(); - itemB.addItemProperty(PROPERTY1, new ObjectProperty("b", - String.class)); + itemB.addItemProperty(PROPERTY1, + new ObjectProperty("b", String.class)); itemC = new PropertysetItem(); - itemC.addItemProperty(PROPERTY1, new ObjectProperty("c", - String.class)); + itemC.addItemProperty(PROPERTY1, + new ObjectProperty("c", String.class)); } @Override @@ -123,14 +123,14 @@ public class CompareFilterTest extends AbstractFilterTestBase { int positive = 1; Item itemNegative = new PropertysetItem(); - itemNegative.addItemProperty(PROPERTY1, new ObjectProperty( - negative, Integer.class)); + itemNegative.addItemProperty(PROPERTY1, + new ObjectProperty(negative, Integer.class)); Item itemZero = new PropertysetItem(); - itemZero.addItemProperty(PROPERTY1, new ObjectProperty(zero, - Integer.class)); + itemZero.addItemProperty(PROPERTY1, + new ObjectProperty(zero, Integer.class)); Item itemPositive = new PropertysetItem(); - itemPositive.addItemProperty(PROPERTY1, new ObjectProperty( - positive, Integer.class)); + itemPositive.addItemProperty(PROPERTY1, + new ObjectProperty(positive, Integer.class)); Filter equalZero = new Equal(PROPERTY1, zero); Assert.assertFalse(equalZero.passesFilter(null, itemNegative)); @@ -167,14 +167,14 @@ public class CompareFilterTest extends AbstractFilterTestBase { BigDecimal positiveScaleTwo = new BigDecimal(1).setScale(2); Item itemNegative = new PropertysetItem(); - itemNegative.addItemProperty(PROPERTY1, new ObjectProperty( - negative, BigDecimal.class)); + itemNegative.addItemProperty(PROPERTY1, + new ObjectProperty(negative, BigDecimal.class)); Item itemZero = new PropertysetItem(); - itemZero.addItemProperty(PROPERTY1, new ObjectProperty( - zero, BigDecimal.class)); + itemZero.addItemProperty(PROPERTY1, + new ObjectProperty(zero, BigDecimal.class)); Item itemPositive = new PropertysetItem(); - itemPositive.addItemProperty(PROPERTY1, new ObjectProperty( - positive, BigDecimal.class)); + itemPositive.addItemProperty(PROPERTY1, + new ObjectProperty(positive, BigDecimal.class)); Item itemPositiveScaleTwo = new PropertysetItem(); itemPositiveScaleTwo.addItemProperty(PROPERTY1, new ObjectProperty(positiveScaleTwo, @@ -206,8 +206,8 @@ public class CompareFilterTest extends AbstractFilterTestBase { Assert.assertFalse(isNonPositive.passesFilter(null, itemPositive)); Filter isPositiveScaleTwo = new Equal(PROPERTY1, positiveScaleTwo); - Assert.assertTrue(isPositiveScaleTwo.passesFilter(null, - itemPositiveScaleTwo)); + Assert.assertTrue( + isPositiveScaleTwo.passesFilter(null, itemPositiveScaleTwo)); Assert.assertTrue(isPositiveScaleTwo.passesFilter(null, itemPositive)); } @@ -221,14 +221,14 @@ public class CompareFilterTest extends AbstractFilterTestBase { Date later = new Date(now.getTime() + 1); Item itemEarlier = new PropertysetItem(); - itemEarlier.addItemProperty(PROPERTY1, new ObjectProperty( - earlier, Date.class)); + itemEarlier.addItemProperty(PROPERTY1, + new ObjectProperty(earlier, Date.class)); Item itemNow = new PropertysetItem(); - itemNow.addItemProperty(PROPERTY1, new ObjectProperty(now, - Date.class)); + itemNow.addItemProperty(PROPERTY1, + new ObjectProperty(now, Date.class)); Item itemLater = new PropertysetItem(); - itemLater.addItemProperty(PROPERTY1, new ObjectProperty(later, - Date.class)); + itemLater.addItemProperty(PROPERTY1, + new ObjectProperty(later, Date.class)); Filter equalNow = new Equal(PROPERTY1, now); Assert.assertFalse(equalNow.passesFilter(null, itemEarlier)); diff --git a/server/src/test/java/com/vaadin/data/util/filter/IsNullFilterTest.java b/server/src/test/java/com/vaadin/data/util/filter/IsNullFilterTest.java index 7a2ab3af7e..18013cd41c 100644 --- a/server/src/test/java/com/vaadin/data/util/filter/IsNullFilterTest.java +++ b/server/src/test/java/com/vaadin/data/util/filter/IsNullFilterTest.java @@ -13,15 +13,15 @@ public class IsNullFilterTest extends AbstractFilterTestBase { @Test public void testIsNull() { Item item1 = new PropertysetItem(); - item1.addItemProperty("a", new ObjectProperty(null, - String.class)); + item1.addItemProperty("a", + new ObjectProperty(null, String.class)); item1.addItemProperty("b", new ObjectProperty("b", String.class)); Item item2 = new PropertysetItem(); item2.addItemProperty("a", new ObjectProperty("a", String.class)); - item2.addItemProperty("b", new ObjectProperty(null, - String.class)); + item2.addItemProperty("b", + new ObjectProperty(null, String.class)); Filter filter1 = new IsNull("a"); Filter filter2 = new IsNull("b"); diff --git a/server/src/test/java/com/vaadin/data/util/filter/LikeFilterTest.java b/server/src/test/java/com/vaadin/data/util/filter/LikeFilterTest.java index d43650101d..12faedee06 100644 --- a/server/src/test/java/com/vaadin/data/util/filter/LikeFilterTest.java +++ b/server/src/test/java/com/vaadin/data/util/filter/LikeFilterTest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -36,8 +36,8 @@ public class LikeFilterTest extends AbstractFilterTestBase { item1.addItemProperty("value", new ObjectProperty("a")); item2.addItemProperty("value", new ObjectProperty("b")); - item3.addItemProperty("value", new ObjectProperty(null, - String.class)); + item3.addItemProperty("value", + new ObjectProperty(null, String.class)); Assert.assertTrue(filter.passesFilter(null, item1)); Assert.assertFalse(filter.passesFilter(null, item2)); diff --git a/server/src/test/java/com/vaadin/data/util/filter/SimpleStringFilterTest.java b/server/src/test/java/com/vaadin/data/util/filter/SimpleStringFilterTest.java index e085c934c9..dd8267107a 100644 --- a/server/src/test/java/com/vaadin/data/util/filter/SimpleStringFilterTest.java +++ b/server/src/test/java/com/vaadin/data/util/filter/SimpleStringFilterTest.java @@ -3,8 +3,8 @@ package com.vaadin.data.util.filter; import org.junit.Assert; import org.junit.Test; -public class SimpleStringFilterTest extends - AbstractFilterTestBase { +public class SimpleStringFilterTest + extends AbstractFilterTestBase { protected static TestItem createTestItem() { return new TestItem("abcde", "TeSt"); @@ -132,8 +132,8 @@ public class SimpleStringFilterTest extends TestItem item = createTestItem(); item.addItemProperty("other1", new NullProperty()); - Assert.assertFalse(f("other1", "ab", false, true).passesFilter(null, - item)); + Assert.assertFalse( + f("other1", "ab", false, true).passesFilter(null, item)); } } diff --git a/server/src/test/java/com/vaadin/data/util/sqlcontainer/ColumnPropertyTest.java b/server/src/test/java/com/vaadin/data/util/sqlcontainer/ColumnPropertyTest.java index 7cad310d37..edc56035e1 100644 --- a/server/src/test/java/com/vaadin/data/util/sqlcontainer/ColumnPropertyTest.java +++ b/server/src/test/java/com/vaadin/data/util/sqlcontainer/ColumnPropertyTest.java @@ -19,8 +19,8 @@ public class ColumnPropertyTest { @Test public void constructor_legalParameters_shouldSucceed() { - ColumnProperty cp = new ColumnProperty("NAME", false, true, true, - false, "Ville", String.class); + ColumnProperty cp = new ColumnProperty("NAME", false, true, true, false, + "Ville", String.class); Assert.assertNotNull(cp); } @@ -37,15 +37,15 @@ public class ColumnPropertyTest { @Test public void getValue_defaultValue_returnsVille() { - ColumnProperty cp = new ColumnProperty("NAME", false, true, true, - false, "Ville", String.class); + ColumnProperty cp = new ColumnProperty("NAME", false, true, true, false, + "Ville", String.class); Assert.assertEquals("Ville", cp.getValue()); } @Test public void setValue_readWriteNullable_returnsKalle() { - ColumnProperty cp = new ColumnProperty("NAME", false, true, true, - false, "Ville", String.class); + ColumnProperty cp = new ColumnProperty("NAME", false, true, true, false, + "Ville", String.class); SQLContainer container = EasyMock.createMock(SQLContainer.class); RowItem owner = new RowItem(container, new RowId(new Object[] { 1 }), Arrays.asList(cp)); @@ -61,7 +61,8 @@ public class ColumnPropertyTest { ColumnProperty cp = new ColumnProperty("NAME", true, true, true, false, "Ville", String.class); SQLContainer container = EasyMock.createMock(SQLContainer.class); - new RowItem(container, new RowId(new Object[] { 1 }), Arrays.asList(cp)); + new RowItem(container, new RowId(new Object[] { 1 }), + Arrays.asList(cp)); EasyMock.replay(container); cp.setValue("Kalle"); EasyMock.verify(container); @@ -69,8 +70,8 @@ public class ColumnPropertyTest { @Test public void setValue_readWriteNullable_nullShouldWork() { - ColumnProperty cp = new ColumnProperty("NAME", false, true, true, - false, "Ville", String.class); + ColumnProperty cp = new ColumnProperty("NAME", false, true, true, false, + "Ville", String.class); SQLContainer container = EasyMock.createMock(SQLContainer.class); RowItem owner = new RowItem(container, new RowId(new Object[] { 1 }), Arrays.asList(cp)); @@ -97,15 +98,15 @@ public class ColumnPropertyTest { @Test public void getType_normal_returnsStringClass() { - ColumnProperty cp = new ColumnProperty("NAME", false, true, true, - false, "Ville", String.class); + ColumnProperty cp = new ColumnProperty("NAME", false, true, true, false, + "Ville", String.class); Assert.assertSame(String.class, cp.getType()); } @Test public void isReadOnly_readWriteNullable_returnsTrue() { - ColumnProperty cp = new ColumnProperty("NAME", false, true, true, - false, "Ville", String.class); + ColumnProperty cp = new ColumnProperty("NAME", false, true, true, false, + "Ville", String.class); Assert.assertFalse(cp.isReadOnly()); } @@ -118,8 +119,8 @@ public class ColumnPropertyTest { @Test public void setReadOnly_readOnlyChangeAllowed_shouldSucceed() { - ColumnProperty cp = new ColumnProperty("NAME", false, true, true, - false, "Ville", String.class); + ColumnProperty cp = new ColumnProperty("NAME", false, true, true, false, + "Ville", String.class); cp.setReadOnly(true); Assert.assertTrue(cp.isReadOnly()); } @@ -141,8 +142,8 @@ public class ColumnPropertyTest { @Test public void isModified_valueModified_returnsTrue() { - ColumnProperty cp = new ColumnProperty("NAME", false, true, true, - false, "Ville", String.class); + ColumnProperty cp = new ColumnProperty("NAME", false, true, true, false, + "Ville", String.class); SQLContainer container = EasyMock.createMock(SQLContainer.class); RowItem owner = new RowItem(container, new RowId(new Object[] { 1 }), Arrays.asList(cp)); @@ -163,20 +164,22 @@ public class ColumnPropertyTest { @Test public void setValue_nullOnNullable_shouldWork() { - ColumnProperty cp = new ColumnProperty("NAME", false, true, true, - false, "asdf", String.class); + ColumnProperty cp = new ColumnProperty("NAME", false, true, true, false, + "asdf", String.class); SQLContainer container = EasyMock.createMock(SQLContainer.class); - new RowItem(container, new RowId(new Object[] { 1 }), Arrays.asList(cp)); + new RowItem(container, new RowId(new Object[] { 1 }), + Arrays.asList(cp)); cp.setValue(null); Assert.assertNull(cp.getValue()); } @Test public void setValue_resetTonullOnNullable_shouldWork() { - ColumnProperty cp = new ColumnProperty("NAME", false, true, true, - false, null, String.class); + ColumnProperty cp = new ColumnProperty("NAME", false, true, true, false, + null, String.class); SQLContainer container = EasyMock.createMock(SQLContainer.class); - new RowItem(container, new RowId(new Object[] { 1 }), Arrays.asList(cp)); + new RowItem(container, new RowId(new Object[] { 1 }), + Arrays.asList(cp)); cp.setValue("asdf"); Assert.assertEquals("asdf", cp.getValue()); cp.setValue(null); diff --git a/server/src/test/java/com/vaadin/data/util/sqlcontainer/DataGenerator.java b/server/src/test/java/com/vaadin/data/util/sqlcontainer/DataGenerator.java index f6619a33b6..8ce298c065 100644 --- a/server/src/test/java/com/vaadin/data/util/sqlcontainer/DataGenerator.java +++ b/server/src/test/java/com/vaadin/data/util/sqlcontainer/DataGenerator.java @@ -39,14 +39,14 @@ public class DataGenerator { statement.executeUpdate("insert into people values('Pelle', '18')"); statement.executeUpdate("insert into people values('Börje', '64')"); } else { - statement - .executeUpdate("insert into people values(default, 'Ville', '23')"); - statement - .executeUpdate("insert into people values(default, 'Kalle', '7')"); - statement - .executeUpdate("insert into people values(default, 'Pelle', '18')"); - statement - .executeUpdate("insert into people values(default, 'Börje', '64')"); + statement.executeUpdate( + "insert into people values(default, 'Ville', '23')"); + statement.executeUpdate( + "insert into people values(default, 'Kalle', '7')"); + statement.executeUpdate( + "insert into people values(default, 'Pelle', '18')"); + statement.executeUpdate( + "insert into people values(default, 'Börje', '64')"); } statement.close(); statement = conn.createStatement(); @@ -63,12 +63,12 @@ public class DataGenerator { Statement statement = conn.createStatement(); for (int i = 4; i < 5000; i++) { if (SQLTestsConstants.db == DB.MSSQL) { - statement.executeUpdate("insert into people values('Person " - + i + "', '" + i % 99 + "')"); + statement.executeUpdate("insert into people values('Person " + i + + "', '" + i % 99 + "')"); } else { - statement - .executeUpdate("insert into people values(default, 'Person " - + i + "', '" + i % 99 + "')"); + statement.executeUpdate( + "insert into people values(default, 'Person " + i + + "', '" + i % 99 + "')"); } } statement.close(); @@ -94,11 +94,11 @@ public class DataGenerator { statement.execute(stmtString); } if (SQLTestsConstants.db == DB.MSSQL) { - statement - .executeUpdate("insert into VERSIONED values('Junk', default)"); + statement.executeUpdate( + "insert into VERSIONED values('Junk', default)"); } else { - statement - .executeUpdate("insert into VERSIONED values(default, 'Junk', default)"); + statement.executeUpdate( + "insert into VERSIONED values(default, 'Junk', default)"); } statement.close(); statement = conn.createStatement(); diff --git a/server/src/test/java/com/vaadin/data/util/sqlcontainer/FreeformQueryUtil.java b/server/src/test/java/com/vaadin/data/util/sqlcontainer/FreeformQueryUtil.java index 288cb65fae..8688c9ae64 100644 --- a/server/src/test/java/com/vaadin/data/util/sqlcontainer/FreeformQueryUtil.java +++ b/server/src/test/java/com/vaadin/data/util/sqlcontainer/FreeformQueryUtil.java @@ -25,7 +25,8 @@ public class FreeformQueryUtil { query.append(") AS rownum, * FROM \"PEOPLE\""); if (!filters.isEmpty()) { - query.append(QueryBuilder.getWhereStringForFilters(filters, sh)); + query.append( + QueryBuilder.getWhereStringForFilters(filters, sh)); } query.append(") AS a WHERE a.rownum BETWEEN ").append(offset) .append(" AND ").append(Integer.toString(offset + limit)); @@ -40,7 +41,8 @@ public class FreeformQueryUtil { query.append("SELECT * FROM (SELECT x.*, ROWNUM AS " + "\"rownum\" FROM (SELECT * FROM \"PEOPLE\""); if (!filters.isEmpty()) { - query.append(QueryBuilder.getWhereStringForFilters(filters, sh)); + query.append( + QueryBuilder.getWhereStringForFilters(filters, sh)); } query.append(") x) WHERE \"rownum\" BETWEEN ? AND ?"); sh.addParameterValue(offset); @@ -50,7 +52,8 @@ public class FreeformQueryUtil { } else { StringBuilder query = new StringBuilder("SELECT * FROM people"); if (!filters.isEmpty()) { - query.append(QueryBuilder.getWhereStringForFilters(filters, sh)); + query.append( + QueryBuilder.getWhereStringForFilters(filters, sh)); } if (limit != 0 || offset != 0) { query.append(" LIMIT ? OFFSET ?"); diff --git a/server/src/test/java/com/vaadin/data/util/sqlcontainer/RowIdTest.java b/server/src/test/java/com/vaadin/data/util/sqlcontainer/RowIdTest.java index 73f7be9fb2..e93048157b 100644 --- a/server/src/test/java/com/vaadin/data/util/sqlcontainer/RowIdTest.java +++ b/server/src/test/java/com/vaadin/data/util/sqlcontainer/RowIdTest.java @@ -54,7 +54,7 @@ public class RowIdTest { @Test public void toString_defaultCtor_noException() { RowId rowId = new RowId(); - Assert.assertTrue("Unexpected to string for empty Row Id", rowId - .toString().isEmpty()); + Assert.assertTrue("Unexpected to string for empty Row Id", + rowId.toString().isEmpty()); } } diff --git a/server/src/test/java/com/vaadin/data/util/sqlcontainer/SQLContainerTableQueryTest.java b/server/src/test/java/com/vaadin/data/util/sqlcontainer/SQLContainerTableQueryTest.java index b2cc9a5d0c..9de97b4631 100644 --- a/server/src/test/java/com/vaadin/data/util/sqlcontainer/SQLContainerTableQueryTest.java +++ b/server/src/test/java/com/vaadin/data/util/sqlcontainer/SQLContainerTableQueryTest.java @@ -241,8 +241,8 @@ public class SQLContainerTableQueryTest { if (SQLTestsConstants.db == DB.MSSQL) { statement.executeUpdate("insert into people values('Bengt', 30)"); } else { - statement - .executeUpdate("insert into people values(default, 'Bengt', 30)"); + statement.executeUpdate( + "insert into people values(default, 'Bengt', 30)"); } statement.close(); conn.commit(); @@ -255,11 +255,11 @@ public class SQLContainerTableQueryTest { public void indexOfId_tableWithParameterThree_returnsThree() throws SQLException { if (SQLTestsConstants.db == DB.ORACLE) { - assertEquals(3, container.indexOfId(new RowId( - new Object[] { new BigDecimal(3 + offset) }))); + assertEquals(3, container.indexOfId( + new RowId(new Object[] { new BigDecimal(3 + offset) }))); } else { - assertEquals(3, - container.indexOfId(new RowId(new Object[] { 3 + offset }))); + assertEquals(3, container + .indexOfId(new RowId(new Object[] { 3 + offset }))); } } @@ -269,14 +269,14 @@ public class SQLContainerTableQueryTest { DataGenerator.addFiveThousandPeople(connectionPool); if (SQLTestsConstants.db == DB.ORACLE) { - container.getItem(new RowId(new Object[] { new BigDecimal( - 1337 + offset) })); - assertEquals(1337, container.indexOfId(new RowId( - new Object[] { new BigDecimal(1337 + offset) }))); + container.getItem( + new RowId(new Object[] { new BigDecimal(1337 + offset) })); + assertEquals(1337, container.indexOfId( + new RowId(new Object[] { new BigDecimal(1337 + offset) }))); } else { container.getItem(new RowId(new Object[] { 1337 + offset })); - assertEquals(1337, container.indexOfId(new RowId( - new Object[] { 1337 + offset }))); + assertEquals(1337, container + .indexOfId(new RowId(new Object[] { 1337 + offset }))); } } @@ -365,44 +365,44 @@ public class SQLContainerTableQueryTest { @Test public void isFirstId_tableActualFirstId_returnsTrue() throws SQLException { if (SQLTestsConstants.db == DB.ORACLE) { - assertTrue(container.isFirstId(new RowId( - new Object[] { new BigDecimal(0 + offset) }))); + assertTrue(container.isFirstId( + new RowId(new Object[] { new BigDecimal(0 + offset) }))); } else { - assertTrue(container.isFirstId(new RowId( - new Object[] { 0 + offset }))); + assertTrue(container + .isFirstId(new RowId(new Object[] { 0 + offset }))); } } @Test public void isFirstId_tableSecondId_returnsFalse() throws SQLException { if (SQLTestsConstants.db == DB.ORACLE) { - Assert.assertFalse(container.isFirstId(new RowId( - new Object[] { new BigDecimal(1 + offset) }))); + Assert.assertFalse(container.isFirstId( + new RowId(new Object[] { new BigDecimal(1 + offset) }))); } else { - Assert.assertFalse(container.isFirstId(new RowId( - new Object[] { 1 + offset }))); + Assert.assertFalse(container + .isFirstId(new RowId(new Object[] { 1 + offset }))); } } @Test public void isLastId_tableSecondId_returnsFalse() throws SQLException { if (SQLTestsConstants.db == DB.ORACLE) { - Assert.assertFalse(container.isLastId(new RowId( - new Object[] { new BigDecimal(1 + offset) }))); + Assert.assertFalse(container.isLastId( + new RowId(new Object[] { new BigDecimal(1 + offset) }))); } else { - Assert.assertFalse(container.isLastId(new RowId( - new Object[] { 1 + offset }))); + Assert.assertFalse( + container.isLastId(new RowId(new Object[] { 1 + offset }))); } } @Test public void isLastId_tableLastId_returnsTrue() throws SQLException { if (SQLTestsConstants.db == DB.ORACLE) { - assertTrue(container.isLastId(new RowId( - new Object[] { new BigDecimal(3 + offset) }))); + assertTrue(container.isLastId( + new RowId(new Object[] { new BigDecimal(3 + offset) }))); } else { - assertTrue(container - .isLastId(new RowId(new Object[] { 3 + offset }))); + assertTrue( + container.isLastId(new RowId(new Object[] { 3 + offset }))); } } @@ -410,11 +410,11 @@ public class SQLContainerTableQueryTest { public void isLastId_table5000RowsLastId_returnsTrue() throws SQLException { DataGenerator.addFiveThousandPeople(connectionPool); if (SQLTestsConstants.db == DB.ORACLE) { - assertTrue(container.isLastId(new RowId( - new Object[] { new BigDecimal(4999 + offset) }))); + assertTrue(container.isLastId( + new RowId(new Object[] { new BigDecimal(4999 + offset) }))); } else { - assertTrue(container.isLastId(new RowId( - new Object[] { 4999 + offset }))); + assertTrue(container + .isLastId(new RowId(new Object[] { 4999 + offset }))); } } @@ -481,7 +481,8 @@ public class SQLContainerTableQueryTest { } @Test(expected = UnsupportedOperationException.class) - public void addContainerProperty_normal_isUnsupported() throws SQLException { + public void addContainerProperty_normal_isUnsupported() + throws SQLException { container.addContainerProperty("asdf", String.class, ""); } @@ -579,7 +580,8 @@ public class SQLContainerTableQueryTest { } @Test - public void indexOfId_tableNewlyAddedItem_returnsFour() throws SQLException { + public void indexOfId_tableNewlyAddedItem_returnsFour() + throws SQLException { Object id = container.addItem(); assertEquals(4, container.indexOfId(id)); } @@ -604,8 +606,8 @@ public class SQLContainerTableQueryTest { Object id = container.addItem(); Item item = container.getItem(id); item.getItemProperty(NAME).setValue("asdf"); - assertEquals("asdf", container.getContainerProperty(id, NAME) - .getValue()); + assertEquals("asdf", + container.getContainerProperty(id, NAME).getValue()); } @Test @@ -710,7 +712,8 @@ public class SQLContainerTableQueryTest { } @Test - public void getItem_tableAddedItemRemoved_returnsNull() throws SQLException { + public void getItem_tableAddedItemRemoved_returnsNull() + throws SQLException { Object id = container.addItem(); Assert.assertNotNull(container.getItem(id)); @@ -958,7 +961,8 @@ public class SQLContainerTableQueryTest { } @Test - public void commit_tableAddedItem_shouldBeWrittenToDB() throws SQLException { + public void commit_tableAddedItem_shouldBeWrittenToDB() + throws SQLException { Object id = container.addItem(); container.getContainerProperty(id, NAME).setValue("New Name"); @@ -966,9 +970,8 @@ public class SQLContainerTableQueryTest { Assert.assertSame(id, container.lastItemId()); container.commit(); Assert.assertFalse(container.lastItemId() instanceof TemporaryRowId); - assertEquals("New Name", - container.getContainerProperty(container.lastItemId(), NAME) - .getValue()); + assertEquals("New Name", container + .getContainerProperty(container.lastItemId(), NAME).getValue()); } @Test @@ -984,12 +987,11 @@ public class SQLContainerTableQueryTest { Object nextToLast = container.getIdByIndex(container.size() - 2); Assert.assertFalse(nextToLast instanceof TemporaryRowId); - assertEquals("Herbert", container - .getContainerProperty(nextToLast, NAME).getValue()); + assertEquals("Herbert", + container.getContainerProperty(nextToLast, NAME).getValue()); Assert.assertFalse(container.lastItemId() instanceof TemporaryRowId); - assertEquals("Larry", - container.getContainerProperty(container.lastItemId(), NAME) - .getValue()); + assertEquals("Larry", container + .getContainerProperty(container.lastItemId(), NAME).getValue()); } @Test @@ -1009,9 +1011,8 @@ public class SQLContainerTableQueryTest { container.getContainerProperty(last, NAME).setValue("Donald"); container.commit(); - assertEquals("Donald", - container.getContainerProperty(container.lastItemId(), NAME) - .getValue()); + assertEquals("Donald", container + .getContainerProperty(container.lastItemId(), NAME).getValue()); } @Test @@ -1027,15 +1028,17 @@ public class SQLContainerTableQueryTest { } @Test - public void rollback_tableItemAdded_discardsAddedItem() throws SQLException { + public void rollback_tableItemAdded_discardsAddedItem() + throws SQLException { int size = container.size(); Object id = container.addItem(); container.getContainerProperty(id, NAME).setValue("foo"); assertEquals(size + 1, container.size()); container.rollback(); assertEquals(size, container.size()); - Assert.assertFalse("foo".equals(container.getContainerProperty( - container.lastItemId(), NAME).getValue())); + Assert.assertFalse("foo".equals( + container.getContainerProperty(container.lastItemId(), NAME) + .getValue())); } @Test @@ -1051,12 +1054,14 @@ public class SQLContainerTableQueryTest { } @Test - public void rollback_tableItemChanged_discardsChanges() throws SQLException { + public void rollback_tableItemChanged_discardsChanges() + throws SQLException { Object last = container.lastItemId(); container.getContainerProperty(last, NAME).setValue("foo"); container.rollback(); - Assert.assertFalse("foo".equals(container.getContainerProperty( - container.lastItemId(), NAME).getValue())); + Assert.assertFalse("foo".equals( + container.getContainerProperty(container.lastItemId(), NAME) + .getValue())); } @Test @@ -1126,8 +1131,8 @@ public class SQLContainerTableQueryTest { @Test public void isModified_tableChangedItem_returnsTrue() throws SQLException { Assert.assertFalse(container.isModified()); - container.getContainerProperty(container.lastItemId(), NAME).setValue( - "foo"); + container.getContainerProperty(container.lastItemId(), NAME) + .setValue("foo"); assertTrue(container.isModified()); } @@ -1151,18 +1156,16 @@ public class SQLContainerTableQueryTest { assertEquals("Ville", container.getContainerProperty(container.firstItemId(), NAME) .getValue()); - assertEquals("Börje", - container.getContainerProperty(container.lastItemId(), NAME) - .getValue()); + assertEquals("Börje", container + .getContainerProperty(container.lastItemId(), NAME).getValue()); container.addOrderBy(new OrderBy(NAME, true)); // Börje, Kalle, Pelle, Ville assertEquals("Börje", container.getContainerProperty(container.firstItemId(), NAME) .getValue()); - assertEquals("Ville", - container.getContainerProperty(container.lastItemId(), NAME) - .getValue()); + assertEquals("Ville", container + .getContainerProperty(container.lastItemId(), NAME).getValue()); } @Test(expected = IllegalArgumentException.class) @@ -1176,9 +1179,8 @@ public class SQLContainerTableQueryTest { assertEquals("Ville", container.getContainerProperty(container.firstItemId(), NAME) .getValue()); - assertEquals("Börje", - container.getContainerProperty(container.lastItemId(), NAME) - .getValue()); + assertEquals("Börje", container + .getContainerProperty(container.lastItemId(), NAME).getValue()); container.sort(new Object[] { NAME }, new boolean[] { true }); @@ -1186,25 +1188,22 @@ public class SQLContainerTableQueryTest { assertEquals("Börje", container.getContainerProperty(container.firstItemId(), NAME) .getValue()); - assertEquals("Ville", - container.getContainerProperty(container.lastItemId(), NAME) - .getValue()); + assertEquals("Ville", container + .getContainerProperty(container.lastItemId(), NAME).getValue()); } @Test public void addFilter_table_filtersResults() throws SQLException { // Ville, Kalle, Pelle, Börje assertEquals(4, container.size()); - assertEquals("Börje", - container.getContainerProperty(container.lastItemId(), NAME) - .getValue()); + assertEquals("Börje", container + .getContainerProperty(container.lastItemId(), NAME).getValue()); container.addContainerFilter(new Like(NAME, "%lle")); // Ville, Kalle, Pelle assertEquals(3, container.size()); - assertEquals("Pelle", - container.getContainerProperty(container.lastItemId(), NAME) - .getValue()); + assertEquals("Pelle", container + .getContainerProperty(container.lastItemId(), NAME).getValue()); } @Test @@ -1216,9 +1215,8 @@ public class SQLContainerTableQueryTest { // Ville assertEquals(1, container.size()); - assertEquals("Ville", - container.getContainerProperty(container.lastItemId(), NAME) - .getValue()); + assertEquals("Ville", container + .getContainerProperty(container.lastItemId(), NAME).getValue()); } @Test @@ -1231,9 +1229,8 @@ public class SQLContainerTableQueryTest { // Ville assertEquals(1, container.size()); - assertEquals("Ville", - container.getContainerProperty(container.lastItemId(), NAME) - .getValue()); + assertEquals("Ville", container + .getContainerProperty(container.lastItemId(), NAME).getValue()); } @Test @@ -1246,16 +1243,14 @@ public class SQLContainerTableQueryTest { // Ville assertEquals(1, container.size()); - assertEquals("Ville", - container.getContainerProperty(container.lastItemId(), NAME) - .getValue()); + assertEquals("Ville", container + .getContainerProperty(container.lastItemId(), NAME).getValue()); container.removeAllContainerFilters(); assertEquals(4, container.size()); - assertEquals("Börje", - container.getContainerProperty(container.lastItemId(), NAME) - .getValue()); + assertEquals("Börje", container + .getContainerProperty(container.lastItemId(), NAME).getValue()); } @Test @@ -1267,16 +1262,14 @@ public class SQLContainerTableQueryTest { // Ville assertEquals(1, container.size()); - assertEquals("Ville", - container.getContainerProperty(container.lastItemId(), NAME) - .getValue()); + assertEquals("Ville", container + .getContainerProperty(container.lastItemId(), NAME).getValue()); container.removeContainerFilters(NAME); assertEquals(4, container.size()); - assertEquals("Börje", - container.getContainerProperty(container.lastItemId(), NAME) - .getValue()); + assertEquals("Börje", container + .getContainerProperty(container.lastItemId(), NAME).getValue()); } @Test @@ -1284,9 +1277,8 @@ public class SQLContainerTableQueryTest { throws SQLException { // Ville, Kalle, Pelle, Börje assertEquals(4, container.size()); - assertEquals("Börje", - container.getContainerProperty(container.lastItemId(), NAME) - .getValue()); + assertEquals("Börje", container + .getContainerProperty(container.lastItemId(), NAME).getValue()); Object id1 = container.addItem(); container.getContainerProperty(id1, NAME).setValue("Palle"); @@ -1312,7 +1304,8 @@ public class SQLContainerTableQueryTest { try { container.getIdByIndex(4); - Assert.fail("SQLContainer.getIdByIndex() returned a value for an index beyond the end of the container"); + Assert.fail( + "SQLContainer.getIdByIndex() returned a value for an index beyond the end of the container"); } catch (IndexOutOfBoundsException e) { // should throw exception - item is filtered out } @@ -1335,9 +1328,8 @@ public class SQLContainerTableQueryTest { assertEquals("Ville", container.getContainerProperty(container.firstItemId(), NAME) .getValue()); - assertEquals("Börje", - container.getContainerProperty(container.lastItemId(), NAME) - .getValue()); + assertEquals("Börje", container + .getContainerProperty(container.lastItemId(), NAME).getValue()); Object id1 = container.addItem(); container.getContainerProperty(id1, NAME).setValue("Wilbert"); @@ -1350,14 +1342,12 @@ public class SQLContainerTableQueryTest { assertEquals("Börje", container.getContainerProperty(container.firstItemId(), NAME) .getValue()); - assertEquals( - "Wilbert", + assertEquals("Wilbert", container.getContainerProperty( container.getIdByIndex(container.size() - 2), NAME) .getValue()); - assertEquals("Albert", - container.getContainerProperty(container.lastItemId(), NAME) - .getValue()); + assertEquals("Albert", container + .getContainerProperty(container.lastItemId(), NAME).getValue()); } } diff --git a/server/src/test/java/com/vaadin/data/util/sqlcontainer/SQLContainerTest.java b/server/src/test/java/com/vaadin/data/util/sqlcontainer/SQLContainerTest.java index a332d9d9ee..d499ceed92 100644 --- a/server/src/test/java/com/vaadin/data/util/sqlcontainer/SQLContainerTest.java +++ b/server/src/test/java/com/vaadin/data/util/sqlcontainer/SQLContainerTest.java @@ -73,8 +73,8 @@ public class SQLContainerTest { @Test(expected = SQLException.class) public void constructor_withIllegalFreeformQuery_shouldFail() throws SQLException { - SQLContainer c = new SQLContainer(new FreeformQuery( - "SELECT * FROM asdf", connectionPool, "ID")); + SQLContainer c = new SQLContainer( + new FreeformQuery("SELECT * FROM asdf", connectionPool, "ID")); c.getItem(c.firstItemId()); } @@ -91,8 +91,8 @@ public class SQLContainerTest { throws SQLException { SQLContainer container = new SQLContainer(new FreeformQuery( "SELECT * FROM people", connectionPool, "ID")); - Assert.assertFalse(container - .containsId(new RowId(new Object[] { 1337 }))); + Assert.assertFalse( + container.containsId(new RowId(new Object[] { 1337 }))); } @Test @@ -101,15 +101,12 @@ public class SQLContainerTest { SQLContainer container = new SQLContainer(new FreeformQuery( "SELECT * FROM people", connectionPool, "ID")); if (SQLTestsConstants.db == DB.ORACLE) { - Assert.assertEquals( - "Ville", - container - .getContainerProperty( - new RowId(new Object[] { new BigDecimal( - 0 + offset) }), "NAME").getValue()); + Assert.assertEquals("Ville", + container.getContainerProperty(new RowId( + new Object[] { new BigDecimal(0 + offset) }), + "NAME").getValue()); } else { - Assert.assertEquals( - "Ville", + Assert.assertEquals("Ville", container.getContainerProperty( new RowId(new Object[] { 0 + offset }), "NAME") .getValue()); @@ -121,8 +118,8 @@ public class SQLContainerTest { throws SQLException { SQLContainer container = new SQLContainer(new FreeformQuery( "SELECT * FROM people", connectionPool, "ID")); - Assert.assertNull(container.getContainerProperty(new RowId( - new Object[] { 1 + offset }), "asdf")); + Assert.assertNull(container.getContainerProperty( + new RowId(new Object[] { 1 + offset }), "asdf")); } @Test @@ -130,8 +127,8 @@ public class SQLContainerTest { throws SQLException { SQLContainer container = new SQLContainer(new FreeformQuery( "SELECT * FROM people", connectionPool, "ID")); - Assert.assertNull(container.getContainerProperty(new RowId( - new Object[] { 1337 + offset }), "NAME")); + Assert.assertNull(container.getContainerProperty( + new RowId(new Object[] { 1337 + offset }), "NAME")); } @Test @@ -152,8 +149,8 @@ public class SQLContainerTest { "SELECT * FROM people", connectionPool, "ID")); Item item; if (SQLTestsConstants.db == DB.ORACLE) { - item = container.getItem(new RowId(new Object[] { new BigDecimal( - 0 + offset) })); + item = container.getItem( + new RowId(new Object[] { new BigDecimal(0 + offset) })); } else { item = container.getItem(new RowId(new Object[] { 0 + offset })); } @@ -187,19 +184,19 @@ public class SQLContainerTest { "SELECT * FROM people", connectionPool, "ID")); Item item; if (SQLTestsConstants.db == DB.ORACLE) { - item = container.getItem(new RowId(new Object[] { new BigDecimal( - 1337 + offset) })); + item = container.getItem( + new RowId(new Object[] { new BigDecimal(1337 + offset) })); Assert.assertNotNull(item); - Assert.assertEquals(new BigDecimal(1337 + offset), item - .getItemProperty("ID").getValue()); + Assert.assertEquals(new BigDecimal(1337 + offset), + item.getItemProperty("ID").getValue()); } else { item = container.getItem(new RowId(new Object[] { 1337 + offset })); Assert.assertNotNull(item); - Assert.assertEquals(1337 + offset, item.getItemProperty("ID") - .getValue()); + Assert.assertEquals(1337 + offset, + item.getItemProperty("ID").getValue()); } - Assert.assertEquals("Person 1337", item.getItemProperty("NAME") - .getValue()); + Assert.assertEquals("Person 1337", + item.getItemProperty("NAME").getValue()); } @Test @@ -268,8 +265,8 @@ public class SQLContainerTest { if (SQLTestsConstants.db == DB.MSSQL) { statement.executeUpdate("insert into people values('Bengt', '42')"); } else { - statement - .executeUpdate("insert into people values(default, 'Bengt', '42')"); + statement.executeUpdate( + "insert into people values(default, 'Bengt', '42')"); } statement.close(); conn.commit(); @@ -286,11 +283,11 @@ public class SQLContainerTest { SQLContainer container = new SQLContainer(new FreeformQuery( "SELECT * FROM people", connectionPool, "ID")); if (SQLTestsConstants.db == DB.ORACLE) { - Assert.assertEquals(3, container.indexOfId(new RowId( - new Object[] { new BigDecimal(3 + offset) }))); + Assert.assertEquals(3, container.indexOfId( + new RowId(new Object[] { new BigDecimal(3 + offset) }))); } else { - Assert.assertEquals(3, - container.indexOfId(new RowId(new Object[] { 3 + offset }))); + Assert.assertEquals(3, container + .indexOfId(new RowId(new Object[] { 3 + offset }))); } } @@ -298,18 +295,18 @@ public class SQLContainerTest { public void indexOfId_freeform5000RowsWithParameter1337_returns1337() throws SQLException { DataGenerator.addFiveThousandPeople(connectionPool); - SQLContainer container = new SQLContainer(new FreeformQuery( - "SELECT * FROM people ORDER BY \"ID\" ASC", connectionPool, - "ID")); + SQLContainer container = new SQLContainer( + new FreeformQuery("SELECT * FROM people ORDER BY \"ID\" ASC", + connectionPool, "ID")); if (SQLTestsConstants.db == DB.ORACLE) { - container.getItem(new RowId(new Object[] { new BigDecimal( - 1337 + offset) })); - Assert.assertEquals(1337, container.indexOfId(new RowId( - new Object[] { new BigDecimal(1337 + offset) }))); + container.getItem( + new RowId(new Object[] { new BigDecimal(1337 + offset) })); + Assert.assertEquals(1337, container.indexOfId( + new RowId(new Object[] { new BigDecimal(1337 + offset) }))); } else { container.getItem(new RowId(new Object[] { 1337 + offset })); - Assert.assertEquals(1337, container.indexOfId(new RowId( - new Object[] { 1337 + offset }))); + Assert.assertEquals(1337, container + .indexOfId(new RowId(new Object[] { 1337 + offset }))); } } @@ -317,13 +314,14 @@ public class SQLContainerTest { public void getIdByIndex_freeform5000rowsIndex1337_returnsRowId1337() throws SQLException { DataGenerator.addFiveThousandPeople(connectionPool); - SQLContainer container = new SQLContainer(new FreeformQuery( - "SELECT * FROM people ORDER BY \"ID\" ASC", connectionPool, - "ID")); + SQLContainer container = new SQLContainer( + new FreeformQuery("SELECT * FROM people ORDER BY \"ID\" ASC", + connectionPool, "ID")); Object itemId = container.getIdByIndex(1337); if (SQLTestsConstants.db == DB.ORACLE) { - Assert.assertEquals(new RowId(new Object[] { new BigDecimal( - 1337 + offset) }), itemId); + Assert.assertEquals( + new RowId(new Object[] { new BigDecimal(1337 + offset) }), + itemId); } else { Assert.assertEquals(new RowId(new Object[] { 1337 + offset }), itemId); @@ -352,8 +350,7 @@ public class SQLContainerTest { int end = offset + limit + 1; String q = "SELECT * FROM (SELECT row_number() OVER" + " ( ORDER BY \"ID\" ASC) AS rownum, * FROM people)" - + " AS a WHERE a.rownum BETWEEN " - + start + + " AS a WHERE a.rownum BETWEEN " + start + " AND " + end; return q; } else if (SQLTestsConstants.db == DB.ORACLE) { @@ -361,9 +358,7 @@ public class SQLContainerTest { int end = offset + limit + 1; String q = "SELECT * FROM (SELECT x.*, ROWNUM AS r FROM" + " (SELECT * FROM people ORDER BY \"ID\" ASC) x) " - + " WHERE r BETWEEN " - + start - + " AND " + + " WHERE r BETWEEN " + start + " AND " + end; return q; } else { @@ -400,9 +395,9 @@ public class SQLContainerTest { public void nextItemId_freeformCurrentItem1337_returnsItem1338() throws SQLException { DataGenerator.addFiveThousandPeople(connectionPool); - SQLContainer container = new SQLContainer(new FreeformQuery( - "SELECT * FROM people ORDER BY \"ID\" ASC", connectionPool, - "ID")); + SQLContainer container = new SQLContainer( + new FreeformQuery("SELECT * FROM people ORDER BY \"ID\" ASC", + connectionPool, "ID")); Object itemId = container.getIdByIndex(1337); if (SQLTestsConstants.db == DB.ORACLE) { Assert.assertEquals( @@ -418,9 +413,9 @@ public class SQLContainerTest { public void prevItemId_freeformCurrentItem1337_returns1336() throws SQLException { DataGenerator.addFiveThousandPeople(connectionPool); - SQLContainer container = new SQLContainer(new FreeformQuery( - "SELECT * FROM people ORDER BY \"ID\" ASC", connectionPool, - "ID")); + SQLContainer container = new SQLContainer( + new FreeformQuery("SELECT * FROM people ORDER BY \"ID\" ASC", + connectionPool, "ID")); Object itemId = container.getIdByIndex(1337); if (SQLTestsConstants.db == DB.ORACLE) { Assert.assertEquals( @@ -451,9 +446,9 @@ public class SQLContainerTest { throws SQLException { DataGenerator.addFiveThousandPeople(connectionPool); - SQLContainer container = new SQLContainer(new FreeformQuery( - "SELECT * FROM people ORDER BY \"ID\" ASC", connectionPool, - "ID")); + SQLContainer container = new SQLContainer( + new FreeformQuery("SELECT * FROM people ORDER BY \"ID\" ASC", + connectionPool, "ID")); if (SQLTestsConstants.db == DB.ORACLE) { Assert.assertEquals( new RowId(new Object[] { 4999 + offset }).toString(), @@ -470,11 +465,11 @@ public class SQLContainerTest { SQLContainer container = new SQLContainer(new FreeformQuery( "SELECT * FROM people", connectionPool, "ID")); if (SQLTestsConstants.db == DB.ORACLE) { - Assert.assertTrue(container.isFirstId(new RowId( - new Object[] { new BigDecimal(0 + offset) }))); + Assert.assertTrue(container.isFirstId( + new RowId(new Object[] { new BigDecimal(0 + offset) }))); } else { - Assert.assertTrue(container.isFirstId(new RowId( - new Object[] { 0 + offset }))); + Assert.assertTrue(container + .isFirstId(new RowId(new Object[] { 0 + offset }))); } } @@ -483,11 +478,11 @@ public class SQLContainerTest { SQLContainer container = new SQLContainer(new FreeformQuery( "SELECT * FROM people", connectionPool, "ID")); if (SQLTestsConstants.db == DB.ORACLE) { - Assert.assertFalse(container.isFirstId(new RowId( - new Object[] { new BigDecimal(1 + offset) }))); + Assert.assertFalse(container.isFirstId( + new RowId(new Object[] { new BigDecimal(1 + offset) }))); } else { - Assert.assertFalse(container.isFirstId(new RowId( - new Object[] { 1 + offset }))); + Assert.assertFalse(container + .isFirstId(new RowId(new Object[] { 1 + offset }))); } } @@ -496,11 +491,11 @@ public class SQLContainerTest { SQLContainer container = new SQLContainer(new FreeformQuery( "SELECT * FROM people", connectionPool, "ID")); if (SQLTestsConstants.db == DB.ORACLE) { - Assert.assertFalse(container.isLastId(new RowId( - new Object[] { new BigDecimal(1 + offset) }))); + Assert.assertFalse(container.isLastId( + new RowId(new Object[] { new BigDecimal(1 + offset) }))); } else { - Assert.assertFalse(container.isLastId(new RowId( - new Object[] { 1 + offset }))); + Assert.assertFalse( + container.isLastId(new RowId(new Object[] { 1 + offset }))); } } @@ -509,11 +504,11 @@ public class SQLContainerTest { SQLContainer container = new SQLContainer(new FreeformQuery( "SELECT * FROM people", connectionPool, "ID")); if (SQLTestsConstants.db == DB.ORACLE) { - Assert.assertTrue(container.isLastId(new RowId( - new Object[] { new BigDecimal(3 + offset) }))); + Assert.assertTrue(container.isLastId( + new RowId(new Object[] { new BigDecimal(3 + offset) }))); } else { - Assert.assertTrue(container.isLastId(new RowId( - new Object[] { 3 + offset }))); + Assert.assertTrue( + container.isLastId(new RowId(new Object[] { 3 + offset }))); } } @@ -521,15 +516,15 @@ public class SQLContainerTest { public void isLastId_freeform5000RowsLastId_returnsTrue() throws SQLException { DataGenerator.addFiveThousandPeople(connectionPool); - SQLContainer container = new SQLContainer(new FreeformQuery( - "SELECT * FROM people ORDER BY \"ID\" ASC", connectionPool, - "ID")); + SQLContainer container = new SQLContainer( + new FreeformQuery("SELECT * FROM people ORDER BY \"ID\" ASC", + connectionPool, "ID")); if (SQLTestsConstants.db == DB.ORACLE) { - Assert.assertTrue(container.isLastId(new RowId( - new Object[] { new BigDecimal(4999 + offset) }))); + Assert.assertTrue(container.isLastId( + new RowId(new Object[] { new BigDecimal(4999 + offset) }))); } else { - Assert.assertTrue(container.isLastId(new RowId( - new Object[] { 4999 + offset }))); + Assert.assertTrue(container + .isLastId(new RowId(new Object[] { 4999 + offset }))); } } @@ -585,7 +580,8 @@ public class SQLContainerTest { } @Test(expected = UnsupportedOperationException.class) - public void addContainerProperty_normal_isUnsupported() throws SQLException { + public void addContainerProperty_normal_isUnsupported() + throws SQLException { SQLContainer container = new SQLContainer(new FreeformQuery( "SELECT * FROM people", connectionPool, "ID")); container.addContainerProperty("asdf", String.class, ""); @@ -743,8 +739,8 @@ public class SQLContainerTest { Object id = container.addItem(); Item item = container.getItem(id); item.getItemProperty("NAME").setValue("asdf"); - Assert.assertEquals("asdf", container.getContainerProperty(id, "NAME") - .getValue()); + Assert.assertEquals("asdf", + container.getContainerProperty(id, "NAME").getValue()); } @Test @@ -1148,15 +1144,14 @@ public class SQLContainerTest { throws SQLException { FreeformQueryDelegate delegate = EasyMock .createMock(FreeformQueryDelegate.class); - EasyMock.expect( - delegate.storeRow(EasyMock.isA(Connection.class), - EasyMock.isA(RowItem.class))) - .andAnswer(new IAnswer() { + EasyMock.expect(delegate.storeRow(EasyMock.isA(Connection.class), + EasyMock.isA(RowItem.class))).andAnswer(new IAnswer() { @Override public Integer answer() throws Throwable { Connection conn = (Connection) EasyMock .getCurrentArguments()[0]; - RowItem item = (RowItem) EasyMock.getCurrentArguments()[1]; + RowItem item = (RowItem) EasyMock + .getCurrentArguments()[1]; Statement statement = conn.createStatement(); if (SQLTestsConstants.db == DB.MSSQL) { statement @@ -1165,15 +1160,17 @@ public class SQLContainerTest { .getValue() + "', '" + item.getItemProperty("AGE") - .getValue() + "')"); + .getValue() + + "')"); } else { - statement - .executeUpdate("insert into people values(default, '" + statement.executeUpdate( + "insert into people values(default, '" + item.getItemProperty("NAME") .getValue() + "', '" + item.getItemProperty("AGE") - .getValue() + "')"); + .getValue() + + "')"); } statement.close(); conn.commit(); @@ -1194,8 +1191,7 @@ public class SQLContainerTest { int end = offset + limit + 1; String q = "SELECT * FROM (SELECT row_number() OVER" + " ( ORDER BY \"ID\" ASC) AS rownum, * FROM people)" - + " AS a WHERE a.rownum BETWEEN " - + start + + " AS a WHERE a.rownum BETWEEN " + start + " AND " + end; return q; } else if (SQLTestsConstants.db == DB.ORACLE) { @@ -1203,9 +1199,7 @@ public class SQLContainerTest { int end = offset + limit + 1; String q = "SELECT * FROM (SELECT x.*, ROWNUM AS r FROM" + " (SELECT * FROM people ORDER BY \"ID\" ASC) x) " - + " WHERE r BETWEEN " - + start - + " AND " + + " WHERE r BETWEEN " + start + " AND " + end; return q; } else { @@ -1249,15 +1243,14 @@ public class SQLContainerTest { throws SQLException { FreeformQueryDelegate delegate = EasyMock .createMock(FreeformQueryDelegate.class); - EasyMock.expect( - delegate.storeRow(EasyMock.isA(Connection.class), - EasyMock.isA(RowItem.class))) - .andAnswer(new IAnswer() { + EasyMock.expect(delegate.storeRow(EasyMock.isA(Connection.class), + EasyMock.isA(RowItem.class))).andAnswer(new IAnswer() { @Override public Integer answer() throws Throwable { Connection conn = (Connection) EasyMock .getCurrentArguments()[0]; - RowItem item = (RowItem) EasyMock.getCurrentArguments()[1]; + RowItem item = (RowItem) EasyMock + .getCurrentArguments()[1]; Statement statement = conn.createStatement(); if (SQLTestsConstants.db == DB.MSSQL) { statement @@ -1266,15 +1259,17 @@ public class SQLContainerTest { .getValue() + "', '" + item.getItemProperty("AGE") - .getValue() + "')"); + .getValue() + + "')"); } else { - statement - .executeUpdate("insert into people values(default, '" + statement.executeUpdate( + "insert into people values(default, '" + item.getItemProperty("NAME") .getValue() + "', '" + item.getItemProperty("AGE") - .getValue() + "')"); + .getValue() + + "')"); } statement.close(); conn.commit(); @@ -1295,8 +1290,7 @@ public class SQLContainerTest { int end = offset + limit + 1; String q = "SELECT * FROM (SELECT row_number() OVER" + " ( ORDER BY \"ID\" ASC) AS rownum, * FROM people)" - + " AS a WHERE a.rownum BETWEEN " - + start + + " AS a WHERE a.rownum BETWEEN " + start + " AND " + end; return q; } else if (SQLTestsConstants.db == DB.ORACLE) { @@ -1304,9 +1298,7 @@ public class SQLContainerTest { int end = offset + limit + 1; String q = "SELECT * FROM (SELECT x.*, ROWNUM AS r FROM" + " (SELECT * FROM people ORDER BY \"ID\" ASC) x) " - + " WHERE r BETWEEN " - + start - + " AND " + + " WHERE r BETWEEN " + start + " AND " + end; return q; } else { @@ -1357,19 +1349,18 @@ public class SQLContainerTest { throws SQLException { FreeformQueryDelegate delegate = EasyMock .createMock(FreeformQueryDelegate.class); - EasyMock.expect( - delegate.removeRow(EasyMock.isA(Connection.class), - EasyMock.isA(RowItem.class))) - .andAnswer(new IAnswer() { + EasyMock.expect(delegate.removeRow(EasyMock.isA(Connection.class), + EasyMock.isA(RowItem.class))).andAnswer(new IAnswer() { @Override public Boolean answer() throws Throwable { Connection conn = (Connection) EasyMock .getCurrentArguments()[0]; - RowItem item = (RowItem) EasyMock.getCurrentArguments()[1]; + RowItem item = (RowItem) EasyMock + .getCurrentArguments()[1]; Statement statement = conn.createStatement(); - statement - .executeUpdate("DELETE FROM people WHERE \"ID\"=" - + item.getItemProperty("ID").getValue()); + statement.executeUpdate( + "DELETE FROM people WHERE \"ID\"=" + item + .getItemProperty("ID").getValue()); statement.close(); return true; } @@ -1387,8 +1378,7 @@ public class SQLContainerTest { int end = offset + limit + 1; String q = "SELECT * FROM (SELECT row_number() OVER" + " ( ORDER BY \"ID\" ASC) AS rownum, * FROM people)" - + " AS a WHERE a.rownum BETWEEN " - + start + + " AS a WHERE a.rownum BETWEEN " + start + " AND " + end; return q; } else if (SQLTestsConstants.db == DB.ORACLE) { @@ -1396,9 +1386,7 @@ public class SQLContainerTest { int end = offset + limit + 1; String q = "SELECT * FROM (SELECT x.*, ROWNUM AS r FROM" + " (SELECT * FROM people ORDER BY \"ID\" ASC) x) " - + " WHERE r BETWEEN " - + start - + " AND " + + " WHERE r BETWEEN " + start + " AND " + end; return q; } else { @@ -1436,15 +1424,14 @@ public class SQLContainerTest { throws SQLException { FreeformQueryDelegate delegate = EasyMock .createMock(FreeformQueryDelegate.class); - EasyMock.expect( - delegate.storeRow(EasyMock.isA(Connection.class), - EasyMock.isA(RowItem.class))) - .andAnswer(new IAnswer() { + EasyMock.expect(delegate.storeRow(EasyMock.isA(Connection.class), + EasyMock.isA(RowItem.class))).andAnswer(new IAnswer() { @Override public Integer answer() throws Throwable { Connection conn = (Connection) EasyMock .getCurrentArguments()[0]; - RowItem item = (RowItem) EasyMock.getCurrentArguments()[1]; + RowItem item = (RowItem) EasyMock + .getCurrentArguments()[1]; Statement statement = conn.createStatement(); statement.executeUpdate("UPDATE people SET \"NAME\"='" + item.getItemProperty("NAME").getValue() @@ -1469,8 +1456,7 @@ public class SQLContainerTest { int end = offset + limit + 1; String q = "SELECT * FROM (SELECT row_number() OVER" + " ( ORDER BY \"ID\" ASC) AS rownum, * FROM people)" - + " AS a WHERE a.rownum BETWEEN " - + start + + " AS a WHERE a.rownum BETWEEN " + start + " AND " + end; return q; } else if (SQLTestsConstants.db == DB.ORACLE) { @@ -1478,9 +1464,7 @@ public class SQLContainerTest { int end = offset + limit + 1; String q = "SELECT * FROM (SELECT x.*, ROWNUM AS r FROM" + " (SELECT * FROM people ORDER BY \"ID\" ASC) x) " - + " WHERE r BETWEEN " - + start - + " AND " + + " WHERE r BETWEEN " + start + " AND " + end; return q; } else { @@ -1525,8 +1509,9 @@ public class SQLContainerTest { Assert.assertEquals(size + 1, container.size()); container.rollback(); Assert.assertEquals(size, container.size()); - Assert.assertFalse("foo".equals(container.getContainerProperty( - container.lastItemId(), "NAME").getValue())); + Assert.assertFalse("foo".equals( + container.getContainerProperty(container.lastItemId(), "NAME") + .getValue())); } @Test @@ -1551,8 +1536,9 @@ public class SQLContainerTest { Object last = container.lastItemId(); container.getContainerProperty(last, "NAME").setValue("foo"); container.rollback(); - Assert.assertFalse("foo".equals(container.getContainerProperty( - container.lastItemId(), "NAME").getValue())); + Assert.assertFalse("foo".equals( + container.getContainerProperty(container.lastItemId(), "NAME") + .getValue())); } @Test @@ -1694,12 +1680,14 @@ public class SQLContainerTest { if (orderBys == null || orderBys.isEmpty()) { List ob = new ArrayList(); ob.add(new OrderBy("ID", true)); - return gen.generateSelectQuery("people", null, - ob, offset, limit, null) + return gen + .generateSelectQuery("people", null, ob, + offset, limit, null) .getQueryString(); } else { - return gen.generateSelectQuery("people", null, - orderBys, offset, limit, null) + return gen + .generateSelectQuery("people", null, + orderBys, offset, limit, null) .getQueryString(); } } else if (SQLTestsConstants.db == DB.ORACLE) { @@ -1707,12 +1695,14 @@ public class SQLContainerTest { if (orderBys == null || orderBys.isEmpty()) { List ob = new ArrayList(); ob.add(new OrderBy("ID", true)); - return gen.generateSelectQuery("people", null, - ob, offset, limit, null) + return gen + .generateSelectQuery("people", null, ob, + offset, limit, null) .getQueryString(); } else { - return gen.generateSelectQuery("people", null, - orderBys, offset, limit, null) + return gen + .generateSelectQuery("people", null, + orderBys, offset, limit, null) .getQueryString(); } } else { @@ -1721,8 +1711,8 @@ public class SQLContainerTest { if (!orderBys.isEmpty()) { query.append(" ORDER BY "); for (OrderBy orderBy : orderBys) { - query.append("\"" + orderBy.getColumn() - + "\""); + query.append( + "\"" + orderBy.getColumn() + "\""); if (orderBy.isAscending()) { query.append(" ASC"); } else { @@ -1808,12 +1798,14 @@ public class SQLContainerTest { if (orderBys == null || orderBys.isEmpty()) { List ob = new ArrayList(); ob.add(new OrderBy("ID", true)); - return gen.generateSelectQuery("people", null, - ob, offset, limit, null) + return gen + .generateSelectQuery("people", null, ob, + offset, limit, null) .getQueryString(); } else { - return gen.generateSelectQuery("people", null, - orderBys, offset, limit, null) + return gen + .generateSelectQuery("people", null, + orderBys, offset, limit, null) .getQueryString(); } } else if (SQLTestsConstants.db == DB.ORACLE) { @@ -1821,12 +1813,14 @@ public class SQLContainerTest { if (orderBys == null || orderBys.isEmpty()) { List ob = new ArrayList(); ob.add(new OrderBy("ID", true)); - return gen.generateSelectQuery("people", null, - ob, offset, limit, null) + return gen + .generateSelectQuery("people", null, ob, + offset, limit, null) .getQueryString(); } else { - return gen.generateSelectQuery("people", null, - orderBys, offset, limit, null) + return gen + .generateSelectQuery("people", null, + orderBys, offset, limit, null) .getQueryString(); } } else { @@ -1835,8 +1829,8 @@ public class SQLContainerTest { if (!orderBys.isEmpty()) { query.append(" ORDER BY "); for (OrderBy orderBy : orderBys) { - query.append("\"" + orderBy.getColumn() - + "\""); + query.append( + "\"" + orderBy.getColumn() + "\""); if (orderBy.isAscending()) { query.append(" ASC"); } else { @@ -1902,9 +1896,8 @@ public class SQLContainerTest { return null; } }).anyTimes(); - EasyMock.expect( - delegate.getQueryStatement(EasyMock.anyInt(), EasyMock.anyInt())) - .andAnswer(new IAnswer() { + EasyMock.expect(delegate.getQueryStatement(EasyMock.anyInt(), + EasyMock.anyInt())).andAnswer(new IAnswer() { @Override public StatementHelper answer() throws Throwable { Object[] args = EasyMock.getCurrentArguments(); @@ -1922,8 +1915,8 @@ public class SQLContainerTest { StringBuffer query = new StringBuffer( "SELECT COUNT(*) FROM people"); if (!filters.isEmpty()) { - query.append(QueryBuilder.getWhereStringForFilters( - filters, sh)); + query.append(QueryBuilder + .getWhereStringForFilters(filters, sh)); } sh.setQueryString(query.toString()); return sh; @@ -1974,9 +1967,8 @@ public class SQLContainerTest { return null; } }).anyTimes(); - EasyMock.expect( - delegate.getQueryStatement(EasyMock.anyInt(), EasyMock.anyInt())) - .andAnswer(new IAnswer() { + EasyMock.expect(delegate.getQueryStatement(EasyMock.anyInt(), + EasyMock.anyInt())).andAnswer(new IAnswer() { @Override public StatementHelper answer() throws Throwable { Object[] args = EasyMock.getCurrentArguments(); @@ -1994,8 +1986,8 @@ public class SQLContainerTest { StringBuffer query = new StringBuffer( "SELECT COUNT(*) FROM people"); if (!filters.isEmpty()) { - query.append(QueryBuilder.getWhereStringForFilters( - filters, sh)); + query.append(QueryBuilder + .getWhereStringForFilters(filters, sh)); } sh.setQueryString(query.toString()); return sh; @@ -2045,9 +2037,8 @@ public class SQLContainerTest { return null; } }).anyTimes(); - EasyMock.expect( - delegate.getQueryStatement(EasyMock.anyInt(), EasyMock.anyInt())) - .andAnswer(new IAnswer() { + EasyMock.expect(delegate.getQueryStatement(EasyMock.anyInt(), + EasyMock.anyInt())).andAnswer(new IAnswer() { @Override public StatementHelper answer() throws Throwable { Object[] args = EasyMock.getCurrentArguments(); @@ -2065,8 +2056,8 @@ public class SQLContainerTest { StringBuffer query = new StringBuffer( "SELECT COUNT(*) FROM people"); if (!filters.isEmpty()) { - query.append(QueryBuilder.getWhereStringForFilters( - filters, sh)); + query.append(QueryBuilder + .getWhereStringForFilters(filters, sh)); } sh.setQueryString(query.toString()); return sh; @@ -2117,9 +2108,8 @@ public class SQLContainerTest { return null; } }).anyTimes(); - EasyMock.expect( - delegate.getQueryStatement(EasyMock.anyInt(), EasyMock.anyInt())) - .andAnswer(new IAnswer() { + EasyMock.expect(delegate.getQueryStatement(EasyMock.anyInt(), + EasyMock.anyInt())).andAnswer(new IAnswer() { @Override public StatementHelper answer() throws Throwable { Object[] args = EasyMock.getCurrentArguments(); @@ -2137,8 +2127,8 @@ public class SQLContainerTest { StringBuffer query = new StringBuffer( "SELECT COUNT(*) FROM people"); if (!filters.isEmpty()) { - query.append(QueryBuilder.getWhereStringForFilters( - filters, sh)); + query.append(QueryBuilder + .getWhereStringForFilters(filters, sh)); } sh.setQueryString(query.toString()); return sh; @@ -2195,9 +2185,8 @@ public class SQLContainerTest { return null; } }).anyTimes(); - EasyMock.expect( - delegate.getQueryStatement(EasyMock.anyInt(), EasyMock.anyInt())) - .andAnswer(new IAnswer() { + EasyMock.expect(delegate.getQueryStatement(EasyMock.anyInt(), + EasyMock.anyInt())).andAnswer(new IAnswer() { @Override public StatementHelper answer() throws Throwable { Object[] args = EasyMock.getCurrentArguments(); @@ -2215,8 +2204,8 @@ public class SQLContainerTest { StringBuffer query = new StringBuffer( "SELECT COUNT(*) FROM people"); if (!filters.isEmpty()) { - query.append(QueryBuilder.getWhereStringForFilters( - filters, sh)); + query.append(QueryBuilder + .getWhereStringForFilters(filters, sh)); } sh.setQueryString(query.toString()); return sh; @@ -2273,9 +2262,8 @@ public class SQLContainerTest { return null; } }).anyTimes(); - EasyMock.expect( - delegate.getQueryStatement(EasyMock.anyInt(), EasyMock.anyInt())) - .andAnswer(new IAnswer() { + EasyMock.expect(delegate.getQueryStatement(EasyMock.anyInt(), + EasyMock.anyInt())).andAnswer(new IAnswer() { @Override public StatementHelper answer() throws Throwable { Object[] args = EasyMock.getCurrentArguments(); @@ -2293,8 +2281,8 @@ public class SQLContainerTest { StringBuffer query = new StringBuffer( "SELECT COUNT(*) FROM people"); if (!filters.isEmpty()) { - query.append(QueryBuilder.getWhereStringForFilters( - filters, sh)); + query.append(QueryBuilder + .getWhereStringForFilters(filters, sh)); } sh.setQueryString(query.toString()); return sh; @@ -2319,26 +2307,27 @@ public class SQLContainerTest { // Ville, Kalle, Pelle, Palle Assert.assertEquals(4, container.size()); - Assert.assertEquals( - "Ville", - container.getContainerProperty(container.getIdByIndex(0), - "NAME").getValue()); - Assert.assertEquals( - "Kalle", - container.getContainerProperty(container.getIdByIndex(1), - "NAME").getValue()); - Assert.assertEquals( - "Pelle", - container.getContainerProperty(container.getIdByIndex(2), - "NAME").getValue()); - Assert.assertEquals( - "Palle", - container.getContainerProperty(container.getIdByIndex(3), - "NAME").getValue()); + Assert.assertEquals("Ville", + container + .getContainerProperty(container.getIdByIndex(0), "NAME") + .getValue()); + Assert.assertEquals("Kalle", + container + .getContainerProperty(container.getIdByIndex(1), "NAME") + .getValue()); + Assert.assertEquals("Pelle", + container + .getContainerProperty(container.getIdByIndex(2), "NAME") + .getValue()); + Assert.assertEquals("Palle", + container + .getContainerProperty(container.getIdByIndex(3), "NAME") + .getValue()); try { container.getIdByIndex(4); - Assert.fail("SQLContainer.getIdByIndex() returned a value for an index beyond the end of the container"); + Assert.fail( + "SQLContainer.getIdByIndex() returned a value for an index beyond the end of the container"); } catch (IndexOutOfBoundsException e) { // should throw exception - item is filtered out } @@ -2395,12 +2384,14 @@ public class SQLContainerTest { if (orderBys == null || orderBys.isEmpty()) { List ob = new ArrayList(); ob.add(new OrderBy("ID", true)); - return gen.generateSelectQuery("people", null, - ob, offset, limit, null) + return gen + .generateSelectQuery("people", null, ob, + offset, limit, null) .getQueryString(); } else { - return gen.generateSelectQuery("people", null, - orderBys, offset, limit, null) + return gen + .generateSelectQuery("people", null, + orderBys, offset, limit, null) .getQueryString(); } } else if (SQLTestsConstants.db == DB.ORACLE) { @@ -2408,12 +2399,14 @@ public class SQLContainerTest { if (orderBys == null || orderBys.isEmpty()) { List ob = new ArrayList(); ob.add(new OrderBy("ID", true)); - return gen.generateSelectQuery("people", null, - ob, offset, limit, null) + return gen + .generateSelectQuery("people", null, ob, + offset, limit, null) .getQueryString(); } else { - return gen.generateSelectQuery("people", null, - orderBys, offset, limit, null) + return gen + .generateSelectQuery("people", null, + orderBys, offset, limit, null) .getQueryString(); } } else { @@ -2422,8 +2415,8 @@ public class SQLContainerTest { if (!orderBys.isEmpty()) { query.append(" ORDER BY "); for (OrderBy orderBy : orderBys) { - query.append("\"" + orderBy.getColumn() - + "\""); + query.append( + "\"" + orderBy.getColumn() + "\""); if (orderBy.isAscending()) { query.append(" ASC"); } else { @@ -2462,8 +2455,7 @@ public class SQLContainerTest { Assert.assertEquals("Börje", container.getContainerProperty(container.firstItemId(), "NAME") .getValue()); - Assert.assertEquals( - "Wilbert", + Assert.assertEquals("Wilbert", container.getContainerProperty( container.getIdByIndex(container.size() - 2), "NAME") .getValue()); diff --git a/server/src/test/java/com/vaadin/data/util/sqlcontainer/SQLTestsConstants.java b/server/src/test/java/com/vaadin/data/util/sqlcontainer/SQLTestsConstants.java index e03e970048..ce0c8f1286 100755 --- a/server/src/test/java/com/vaadin/data/util/sqlcontainer/SQLTestsConstants.java +++ b/server/src/test/java/com/vaadin/data/util/sqlcontainer/SQLTestsConstants.java @@ -101,8 +101,7 @@ public class SQLTestsConstants { versionStatements = new String[] { "create table VERSIONED (\"ID\" serial primary key, \"TEXT\" VARCHAR(255), \"VERSION\" INTEGER DEFAULT 0)", "CREATE OR REPLACE FUNCTION zz_row_version() RETURNS TRIGGER AS $$" - + "BEGIN" - + " IF TG_OP = 'UPDATE'" + + "BEGIN" + " IF TG_OP = 'UPDATE'" + " AND NEW.\"VERSION\" = old.\"VERSION\"" + " AND ROW(NEW.*) IS DISTINCT FROM ROW (old.*)" + " THEN" @@ -125,7 +124,8 @@ public class SQLTestsConstants { dbPwd = "sa"; peopleFirst = "create table PEOPLE (\"ID\" int identity(1,1) primary key, \"NAME\" VARCHAR(32), \"AGE\" INTEGER)"; peopleSecond = null; - versionStatements = new String[] { "create table VERSIONED (\"ID\" int identity(1,1) primary key, \"TEXT\" VARCHAR(255), \"VERSION\" rowversion not null)" }; + versionStatements = new String[] { + "create table VERSIONED (\"ID\" int identity(1,1) primary key, \"TEXT\" VARCHAR(255), \"VERSION\" rowversion not null)" }; sqlGen = new MSSQLGenerator(); break; case ORACLE: diff --git a/server/src/test/java/com/vaadin/data/util/sqlcontainer/TicketTest.java b/server/src/test/java/com/vaadin/data/util/sqlcontainer/TicketTest.java index 2030096e82..1a19eda542 100644 --- a/server/src/test/java/com/vaadin/data/util/sqlcontainer/TicketTest.java +++ b/server/src/test/java/com/vaadin/data/util/sqlcontainer/TicketTest.java @@ -74,9 +74,8 @@ public class TicketTest { return null; } }).anyTimes(); - EasyMock.expect( - delegate.getQueryStatement(EasyMock.anyInt(), EasyMock.anyInt())) - .andAnswer(new IAnswer() { + EasyMock.expect(delegate.getQueryStatement(EasyMock.anyInt(), + EasyMock.anyInt())).andAnswer(new IAnswer() { @Override public StatementHelper answer() throws Throwable { Object[] args = EasyMock.getCurrentArguments(); @@ -94,8 +93,8 @@ public class TicketTest { StringBuffer query = new StringBuffer( "SELECT COUNT(*) FROM people"); if (!filters.isEmpty()) { - query.append(QueryBuilder.getWhereStringForFilters( - filters, sh)); + query.append(QueryBuilder + .getWhereStringForFilters(filters, sh)); } sh.setQueryString(query.toString()); return sh; @@ -122,10 +121,9 @@ public class TicketTest { .getContainerProperty(container.firstItemId(), "AGE") .getValue()); } else { - Assert.assertEquals( - 18, - container.getContainerProperty(container.firstItemId(), - "AGE").getValue()); + Assert.assertEquals(18, container + .getContainerProperty(container.firstItemId(), "AGE") + .getValue()); } EasyMock.verify(delegate); @@ -151,10 +149,9 @@ public class TicketTest { .getContainerProperty(container.firstItemId(), "AGE") .getValue()); } else { - Assert.assertEquals( - 18, - container.getContainerProperty(container.firstItemId(), - "AGE").getValue()); + Assert.assertEquals(18, container + .getContainerProperty(container.firstItemId(), "AGE") + .getValue()); } } @@ -170,8 +167,8 @@ public class TicketTest { // set a different name item.getItemProperty("NAME").setValue("otherName"); - Assert.assertEquals("otherName", item.getItemProperty("NAME") - .getValue()); + Assert.assertEquals("otherName", + item.getItemProperty("NAME").getValue()); // access the item and reset the name to its old value Item item2 = container.getItem(id); diff --git a/server/src/test/java/com/vaadin/data/util/sqlcontainer/connection/SimpleJDBCConnectionPoolTest.java b/server/src/test/java/com/vaadin/data/util/sqlcontainer/connection/SimpleJDBCConnectionPoolTest.java index b786f5b2de..5a6ae78aeb 100644 --- a/server/src/test/java/com/vaadin/data/util/sqlcontainer/connection/SimpleJDBCConnectionPoolTest.java +++ b/server/src/test/java/com/vaadin/data/util/sqlcontainer/connection/SimpleJDBCConnectionPoolTest.java @@ -44,12 +44,13 @@ public class SimpleJDBCConnectionPoolTest { connectionPool.reserveConnection(); } catch (SQLException e) { e.printStackTrace(); - Assert.fail("Exception before all connections used! " - + e.getMessage()); + Assert.fail( + "Exception before all connections used! " + e.getMessage()); } connectionPool.reserveConnection(); - Assert.fail("Reserving connection didn't fail even though no connections are available!"); + Assert.fail( + "Reserving connection didn't fail even though no connections are available!"); } @Test @@ -59,8 +60,8 @@ public class SimpleJDBCConnectionPoolTest { connectionPool.reserveConnection(); } catch (SQLException e) { e.printStackTrace(); - Assert.fail("Exception before all connections used! " - + e.getMessage()); + Assert.fail( + "Exception before all connections used! " + e.getMessage()); } Connection conn = connectionPool.reserveConnection(); @@ -76,8 +77,8 @@ public class SimpleJDBCConnectionPoolTest { conn2 = connectionPool.reserveConnection(); } catch (SQLException e) { e.printStackTrace(); - Assert.fail("Exception before all connections used! " - + e.getMessage()); + Assert.fail( + "Exception before all connections used! " + e.getMessage()); } connectionPool.releaseConnection(conn2); @@ -101,7 +102,8 @@ public class SimpleJDBCConnectionPoolTest { public void construct_onlyDriverNameAndUrlGiven_shouldFail() throws SQLException { SimpleJDBCConnectionPool cp = new SimpleJDBCConnectionPool( - SQLTestsConstants.dbDriver, SQLTestsConstants.dbURL, null, null); + SQLTestsConstants.dbDriver, SQLTestsConstants.dbURL, null, + null); } @Test(expected = IllegalArgumentException.class) diff --git a/server/src/test/java/com/vaadin/data/util/sqlcontainer/filters/BetweenTest.java b/server/src/test/java/com/vaadin/data/util/sqlcontainer/filters/BetweenTest.java index 6daf730e25..41db88b881 100644 --- a/server/src/test/java/com/vaadin/data/util/sqlcontainer/filters/BetweenTest.java +++ b/server/src/test/java/com/vaadin/data/util/sqlcontainer/filters/BetweenTest.java @@ -144,32 +144,32 @@ public class BetweenTest { public void passesFilter_nullValue_filterIsPassed() { String id = "id"; Between between = new Between(id, null, null); - Assert.assertTrue(between.passesFilter(id, - itemWithPropertyValue(id, null))); + Assert.assertTrue( + between.passesFilter(id, itemWithPropertyValue(id, null))); } @Test public void passesFilter_nullStartValue_filterIsPassed() { String id = "id"; Between between = new Between(id, null, 2); - Assert.assertTrue(between - .passesFilter(id, itemWithPropertyValue(id, 1))); + Assert.assertTrue( + between.passesFilter(id, itemWithPropertyValue(id, 1))); } @Test public void passesFilter_nullEndValue_filterIsPassed() { String id = "id"; Between between = new Between(id, 0, null); - Assert.assertTrue(between - .passesFilter(id, itemWithPropertyValue(id, 1))); + Assert.assertTrue( + between.passesFilter(id, itemWithPropertyValue(id, 1))); } @Test public void passesFilter_nullStartValueAndEndValue_filterIsPassed() { String id = "id"; Between between = new Between(id, null, null); - Assert.assertTrue(between - .passesFilter(id, itemWithPropertyValue(id, 1))); + Assert.assertTrue( + between.passesFilter(id, itemWithPropertyValue(id, 1))); } @Test diff --git a/server/src/test/java/com/vaadin/data/util/sqlcontainer/filters/CompareTest.java b/server/src/test/java/com/vaadin/data/util/sqlcontainer/filters/CompareTest.java index 252acd81fc..fcde69655b 100644 --- a/server/src/test/java/com/vaadin/data/util/sqlcontainer/filters/CompareTest.java +++ b/server/src/test/java/com/vaadin/data/util/sqlcontainer/filters/CompareTest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/server/src/test/java/com/vaadin/data/util/sqlcontainer/generator/SQLGeneratorsTest.java b/server/src/test/java/com/vaadin/data/util/sqlcontainer/generator/SQLGeneratorsTest.java index c2dbf0f12a..dd1db30b72 100644 --- a/server/src/test/java/com/vaadin/data/util/sqlcontainer/generator/SQLGeneratorsTest.java +++ b/server/src/test/java/com/vaadin/data/util/sqlcontainer/generator/SQLGeneratorsTest.java @@ -112,12 +112,9 @@ public class SQLGeneratorsTest { SQLTestsConstants.sqlGen); SQLContainer container = new SQLContainer(query); - StatementHelper sh = sg.generateDeleteQuery( - "people", - query.getPrimaryKeyColumns(), - null, - (RowItem) container.getItem(container.getItemIds().iterator() - .next())); + StatementHelper sh = sg.generateDeleteQuery("people", + query.getPrimaryKeyColumns(), null, (RowItem) container + .getItem(container.getItemIds().iterator().next())); Assert.assertEquals("DELETE FROM people WHERE \"ID\" = ?", sh.getQueryString()); } @@ -137,15 +134,16 @@ public class SQLGeneratorsTest { TableQuery query = new TableQuery("people", connectionPool); SQLContainer container = new SQLContainer(query); - RowItem ri = (RowItem) container.getItem(container.getItemIds() - .iterator().next()); + RowItem ri = (RowItem) container + .getItem(container.getItemIds().iterator().next()); ri.getItemProperty("NAME").setValue("Viljami"); StatementHelper sh = sg.generateUpdateQuery("people", ri); - Assert.assertTrue("UPDATE people SET \"NAME\" = ?, \"AGE\" = ? WHERE \"ID\" = ?" - .equals(sh.getQueryString()) - || "UPDATE people SET \"AGE\" = ?, \"NAME\" = ? WHERE \"ID\" = ?" - .equals(sh.getQueryString())); + Assert.assertTrue( + "UPDATE people SET \"NAME\" = ?, \"AGE\" = ? WHERE \"ID\" = ?" + .equals(sh.getQueryString()) + || "UPDATE people SET \"AGE\" = ?, \"NAME\" = ? WHERE \"ID\" = ?" + .equals(sh.getQueryString())); } @Test @@ -215,8 +213,7 @@ public class SQLGeneratorsTest { List ob = Arrays.asList(new OrderBy("name", true)); StatementHelper sh = sg.generateSelectQuery("TABLE", f, ob, 4, 8, "NAME, ID"); - Assert.assertEquals( - sh.getQueryString(), + Assert.assertEquals(sh.getQueryString(), "SELECT * FROM (SELECT x.*, ROWNUM AS \"rownum\" FROM" + " (SELECT NAME, ID FROM TABLE WHERE (\"name\" LIKE ?" + " OR \"name\" LIKE ?) " diff --git a/server/src/test/java/com/vaadin/data/util/sqlcontainer/generator/StatementHelperTest.java b/server/src/test/java/com/vaadin/data/util/sqlcontainer/generator/StatementHelperTest.java index b89b7e747d..48a2d29639 100644 --- a/server/src/test/java/com/vaadin/data/util/sqlcontainer/generator/StatementHelperTest.java +++ b/server/src/test/java/com/vaadin/data/util/sqlcontainer/generator/StatementHelperTest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,7 +25,7 @@ import org.junit.Test; import com.vaadin.data.util.sqlcontainer.query.generator.StatementHelper; /** - * + * * @author Vaadin Ltd */ public class StatementHelperTest { @@ -44,8 +44,8 @@ public class StatementHelperTest { // Exception should contain info about which parameter and the type // which was unsupported Assert.assertTrue(e.getMessage().contains("parameter 0")); - Assert.assertTrue(e.getMessage().contains( - StatementHelper.class.getName())); + Assert.assertTrue( + e.getMessage().contains(StatementHelper.class.getName())); } } diff --git a/server/src/test/java/com/vaadin/data/util/sqlcontainer/query/FreeformQueryTest.java b/server/src/test/java/com/vaadin/data/util/sqlcontainer/query/FreeformQueryTest.java index bbf083c158..1b9e14b0d8 100644 --- a/server/src/test/java/com/vaadin/data/util/sqlcontainer/query/FreeformQueryTest.java +++ b/server/src/test/java/com/vaadin/data/util/sqlcontainer/query/FreeformQueryTest.java @@ -56,8 +56,8 @@ public class FreeformQueryTest { public void construction_legalParameters_shouldSucceed() { FreeformQuery ffQuery = new FreeformQuery("SELECT * FROM foo", Arrays.asList("ID"), connectionPool); - Assert.assertArrayEquals(new Object[] { "ID" }, ffQuery - .getPrimaryKeyColumns().toArray()); + Assert.assertArrayEquals(new Object[] { "ID" }, + ffQuery.getPrimaryKeyColumns().toArray()); Assert.assertEquals("SELECT * FROM foo", ffQuery.getQueryString()); } @@ -118,10 +118,10 @@ public class FreeformQueryTest { statement.executeUpdate("insert into people values('Bengt', 30)"); statement.executeUpdate("insert into people values('Ingvar', 50)"); } else { - statement - .executeUpdate("insert into people values(default, 'Bengt', 30)"); - statement - .executeUpdate("insert into people values(default, 'Ingvar', 50)"); + statement.executeUpdate( + "insert into people values(default, 'Bengt', 30)"); + statement.executeUpdate( + "insert into people values(default, 'Ingvar', 50)"); } statement.close(); conn.commit(); @@ -177,8 +177,8 @@ public class FreeformQueryTest { Arrays.asList("ID"), connectionPool); FreeformQueryDelegate delegate = EasyMock .createMock(FreeformQueryDelegate.class); - EasyMock.expect(delegate.getCountQuery()).andReturn( - "SELECT COUNT(*) FROM GARBAGE"); + EasyMock.expect(delegate.getCountQuery()) + .andReturn("SELECT COUNT(*) FROM GARBAGE"); EasyMock.replay(delegate); query.setDelegate(delegate); Assert.assertEquals(0, query.getCount()); @@ -186,7 +186,8 @@ public class FreeformQueryTest { } @Test - public void getResults_simpleQuery_returnsFourRecords() throws SQLException { + public void getResults_simpleQuery_returnsFourRecords() + throws SQLException { FreeformQuery query = new FreeformQuery( "SELECT \"ID\",\"NAME\" FROM people", Arrays.asList("ID"), connectionPool); @@ -275,8 +276,8 @@ public class FreeformQueryTest { throws SQLException { FreeformQuery query = new FreeformQuery("SELECT * FROM people", Arrays.asList("ID"), connectionPool); - query.storeRow(new RowItem(new SQLContainer(query), new RowId( - new Object[] { 1 }), null)); + query.storeRow(new RowItem(new SQLContainer(query), + new RowId(new Object[] { 1 }), null)); } @Test @@ -287,8 +288,8 @@ public class FreeformQueryTest { EasyMock.replay(container); query.beginTransaction(); try { - query.storeRow(new RowItem(container, - new RowId(new Object[] { 1 }), null)); + query.storeRow(new RowItem(container, new RowId(new Object[] { 1 }), + null)); Assert.fail("storeRow should fail when there is no delegate"); } catch (UnsupportedOperationException e) { // Cleanup to make test connection pool happy @@ -416,25 +417,24 @@ public class FreeformQueryTest { } @Test - public void getResults_hasDelegate_shouldCallDelegate() throws SQLException { + public void getResults_hasDelegate_shouldCallDelegate() + throws SQLException { FreeformQuery query = new FreeformQuery("SELECT * FROM people", Arrays.asList("ID"), connectionPool); FreeformQueryDelegate delegate = EasyMock .createMock(FreeformQueryDelegate.class); if (SQLTestsConstants.db == DB.MSSQL) { EasyMock.expect(delegate.getQueryString(0, 2)) - .andReturn( - "SELECT * FROM (SELECT row_number()" - + "OVER (ORDER BY id ASC) AS rownum, * FROM people)" - + " AS a WHERE a.rownum BETWEEN 0 AND 2"); + .andReturn("SELECT * FROM (SELECT row_number()" + + "OVER (ORDER BY id ASC) AS rownum, * FROM people)" + + " AS a WHERE a.rownum BETWEEN 0 AND 2"); } else if (SQLTestsConstants.db == DB.ORACLE) { EasyMock.expect(delegate.getQueryString(0, 2)) - .andReturn( - "SELECT * FROM (SELECT x.*, ROWNUM AS r FROM" - + " (SELECT * FROM people) x) WHERE r BETWEEN 1 AND 2"); + .andReturn("SELECT * FROM (SELECT x.*, ROWNUM AS r FROM" + + " (SELECT * FROM people) x) WHERE r BETWEEN 1 AND 2"); } else { - EasyMock.expect(delegate.getQueryString(0, 2)).andReturn( - "SELECT * FROM people LIMIT 2 OFFSET 0"); + EasyMock.expect(delegate.getQueryString(0, 2)) + .andReturn("SELECT * FROM people LIMIT 2 OFFSET 0"); } EasyMock.replay(delegate); @@ -454,18 +454,16 @@ public class FreeformQueryTest { .createMock(FreeformQueryDelegate.class); if (SQLTestsConstants.db == DB.MSSQL) { EasyMock.expect(delegate.getQueryString(0, 2)) - .andReturn( - "SELECT * FROM (SELECT row_number()" - + "OVER (ORDER BY id ASC) AS rownum, * FROM people)" - + " AS a WHERE a.rownum BETWEEN 0 AND 2"); + .andReturn("SELECT * FROM (SELECT row_number()" + + "OVER (ORDER BY id ASC) AS rownum, * FROM people)" + + " AS a WHERE a.rownum BETWEEN 0 AND 2"); } else if (SQLTestsConstants.db == DB.ORACLE) { EasyMock.expect(delegate.getQueryString(0, 2)) - .andReturn( - "SELECT * FROM (SELECT x.*, ROWNUM AS r FROM" - + " (SELECT * FROM people) x) WHERE r BETWEEN 1 AND 2"); + .andReturn("SELECT * FROM (SELECT x.*, ROWNUM AS r FROM" + + " (SELECT * FROM people) x) WHERE r BETWEEN 1 AND 2"); } else { - EasyMock.expect(delegate.getQueryString(0, 2)).andReturn( - "SELECT * FROM people LIMIT 2 OFFSET 0"); + EasyMock.expect(delegate.getQueryString(0, 2)) + .andReturn("SELECT * FROM people LIMIT 2 OFFSET 0"); } EasyMock.replay(delegate); query.setDelegate(delegate); @@ -500,18 +498,16 @@ public class FreeformQueryTest { .createMock(FreeformQueryDelegate.class); if (SQLTestsConstants.db == DB.MSSQL) { EasyMock.expect(delegate.getQueryString(200, 100)) - .andReturn( - "SELECT * FROM (SELECT row_number()" - + "OVER (ORDER BY id ASC) AS rownum, * FROM people)" - + " AS a WHERE a.rownum BETWEEN 201 AND 300"); + .andReturn("SELECT * FROM (SELECT row_number()" + + "OVER (ORDER BY id ASC) AS rownum, * FROM people)" + + " AS a WHERE a.rownum BETWEEN 201 AND 300"); } else if (SQLTestsConstants.db == DB.ORACLE) { EasyMock.expect(delegate.getQueryString(200, 100)) - .andReturn( - "SELECT * FROM (SELECT x.*, ROWNUM AS r FROM" - + " (SELECT * FROM people ORDER BY ID ASC) x) WHERE r BETWEEN 201 AND 300"); + .andReturn("SELECT * FROM (SELECT x.*, ROWNUM AS r FROM" + + " (SELECT * FROM people ORDER BY ID ASC) x) WHERE r BETWEEN 201 AND 300"); } else { - EasyMock.expect(delegate.getQueryString(200, 100)).andReturn( - "SELECT * FROM people LIMIT 100 OFFSET 200"); + EasyMock.expect(delegate.getQueryString(200, 100)) + .andReturn("SELECT * FROM people LIMIT 100 OFFSET 200"); } EasyMock.replay(delegate); query.setDelegate(delegate); @@ -616,9 +612,8 @@ public class FreeformQueryTest { Arrays.asList("ID"), connectionPool); FreeformQueryDelegate delegate = EasyMock .createMock(FreeformQueryDelegate.class); - EasyMock.expect( - delegate.storeRow(EasyMock.isA(Connection.class), - EasyMock.isA(RowItem.class))).andReturn(1); + EasyMock.expect(delegate.storeRow(EasyMock.isA(Connection.class), + EasyMock.isA(RowItem.class))).andReturn(1); SQLContainer container = EasyMock.createNiceMock(SQLContainer.class); EasyMock.replay(delegate, container); query.setDelegate(delegate); @@ -639,10 +634,9 @@ public class FreeformQueryTest { Arrays.asList("ID"), connectionPool); FreeformQueryDelegate delegate = EasyMock .createMock(FreeformQueryDelegate.class); - EasyMock.expect( - delegate.storeRow(EasyMock.isA(Connection.class), - EasyMock.isA(RowItem.class))).andThrow( - new UnsupportedOperationException()); + EasyMock.expect(delegate.storeRow(EasyMock.isA(Connection.class), + EasyMock.isA(RowItem.class))) + .andThrow(new UnsupportedOperationException()); SQLContainer container = EasyMock.createNiceMock(SQLContainer.class); EasyMock.replay(delegate, container); query.setDelegate(delegate); @@ -652,7 +646,8 @@ public class FreeformQueryTest { null); try { query.storeRow(row); - Assert.fail("storeRow should fail when delgate does not implement storeRow"); + Assert.fail( + "storeRow should fail when delgate does not implement storeRow"); } catch (UnsupportedOperationException e) { // Cleanup to make test connection pool happy query.rollback(); @@ -666,9 +661,8 @@ public class FreeformQueryTest { Arrays.asList("ID"), connectionPool); FreeformQueryDelegate delegate = EasyMock .createMock(FreeformQueryDelegate.class); - EasyMock.expect( - delegate.removeRow(EasyMock.isA(Connection.class), - EasyMock.isA(RowItem.class))).andReturn(true); + EasyMock.expect(delegate.removeRow(EasyMock.isA(Connection.class), + EasyMock.isA(RowItem.class))).andReturn(true); SQLContainer container = EasyMock.createNiceMock(SQLContainer.class); EasyMock.replay(delegate, container); query.setDelegate(delegate); @@ -689,10 +683,9 @@ public class FreeformQueryTest { Arrays.asList("ID"), connectionPool); FreeformQueryDelegate delegate = EasyMock .createMock(FreeformQueryDelegate.class); - EasyMock.expect( - delegate.removeRow(EasyMock.isA(Connection.class), - EasyMock.isA(RowItem.class))).andThrow( - new UnsupportedOperationException()); + EasyMock.expect(delegate.removeRow(EasyMock.isA(Connection.class), + EasyMock.isA(RowItem.class))) + .andThrow(new UnsupportedOperationException()); SQLContainer container = EasyMock.createNiceMock(SQLContainer.class); EasyMock.replay(delegate, container); query.setDelegate(delegate); @@ -702,7 +695,8 @@ public class FreeformQueryTest { null); try { query.removeRow(row); - Assert.fail("removeRow should fail when delegate does not implement removeRow"); + Assert.fail( + "removeRow should fail when delegate does not implement removeRow"); } catch (UnsupportedOperationException e) { // Cleanup to make test connection pool happy query.rollback(); @@ -733,7 +727,8 @@ public class FreeformQueryTest { query.beginTransaction(); try { query.beginTransaction(); - Assert.fail("Should throw exception when starting a transaction while already in a transaction"); + Assert.fail( + "Should throw exception when starting a transaction while already in a transaction"); } catch (IllegalStateException e) { // Cleanup to make test connection pool happy query.rollback(); @@ -881,9 +876,8 @@ public class FreeformQueryTest { .createMock(FreeformQueryDelegate.class); // In order to test that this is the query that is actually used, we use // a non-existing id in place of the existing one. - EasyMock.expect(delegate.getContainsRowQueryString(1)) - .andReturn( - "SELECT * FROM people WHERE \"NAME\" LIKE '%lle' AND \"ID\" = 1337"); + EasyMock.expect(delegate.getContainsRowQueryString(1)).andReturn( + "SELECT * FROM people WHERE \"NAME\" LIKE '%lle' AND \"ID\" = 1337"); EasyMock.replay(delegate); query.setDelegate(delegate); @@ -893,8 +887,8 @@ public class FreeformQueryTest { EasyMock.verify(delegate); } - public static class NonMatchingDelegateWithGroupBy implements - FreeformQueryDelegate { + public static class NonMatchingDelegateWithGroupBy + implements FreeformQueryDelegate { private String fromWhere = "FROM people p1 LEFT JOIN people p2 ON p2.id = p1.id WHERE p1.\"NAME\" LIKE 'notfound' GROUP BY p1.ID"; @@ -943,8 +937,9 @@ public class FreeformQueryTest { } } - public static class NonMatchingStatementDelegateWithGroupBy extends - NonMatchingDelegateWithGroupBy implements FreeformStatementDelegate { + public static class NonMatchingStatementDelegateWithGroupBy + extends NonMatchingDelegateWithGroupBy + implements FreeformStatementDelegate { @Override public StatementHelper getQueryStatement(int offset, int limit) @@ -978,8 +973,8 @@ public class FreeformQueryTest { Arrays.asList("ID"), connectionPool); FreeformQueryDelegate delegate = EasyMock .createMock(FreeformQueryDelegate.class); - EasyMock.expect(delegate.getContainsRowQueryString(1)).andThrow( - new UnsupportedOperationException()); + EasyMock.expect(delegate.getContainsRowQueryString(1)) + .andThrow(new UnsupportedOperationException()); EasyMock.replay(delegate); query.setDelegate(delegate); diff --git a/server/src/test/java/com/vaadin/data/util/sqlcontainer/query/QueryBuilderTest.java b/server/src/test/java/com/vaadin/data/util/sqlcontainer/query/QueryBuilderTest.java index 596f28cf5e..7974582147 100644 --- a/server/src/test/java/com/vaadin/data/util/sqlcontainer/query/QueryBuilderTest.java +++ b/server/src/test/java/com/vaadin/data/util/sqlcontainer/query/QueryBuilderTest.java @@ -85,7 +85,8 @@ public class QueryBuilderTest { @Test public void getWhereStringForFilter_simpleStringFilter() { StatementHelper sh = mockedStatementHelper("Vi%"); - SimpleStringFilter f = new SimpleStringFilter("NAME", "Vi", false, true); + SimpleStringFilter f = new SimpleStringFilter("NAME", "Vi", false, + true); Assert.assertEquals("\"NAME\" LIKE ?", QueryBuilder.getWhereStringForFilter(f, sh)); EasyMock.verify(sh); @@ -104,7 +105,8 @@ public class QueryBuilderTest { @Test public void getWhereStringForFilter_simpleStringFilterMatchAnywhereIgnoreCase() { StatementHelper sh = mockedStatementHelper("%VI%"); - SimpleStringFilter f = new SimpleStringFilter("NAME", "Vi", true, false); + SimpleStringFilter f = new SimpleStringFilter("NAME", "Vi", true, + false); Assert.assertEquals("UPPER(\"NAME\") LIKE ?", QueryBuilder.getWhereStringForFilter(f, sh)); EasyMock.verify(sh); @@ -230,8 +232,9 @@ public class QueryBuilderTest { public void getWhereStringForFilters_complexCompoundFilters() { StatementHelper sh = mockedStatementHelper("%lle", 18, 65, "Pelle"); ArrayList filters = new ArrayList(); - filters.add(new Or(new And(new Like("NAME", "%lle"), new Or(new Less( - "AGE", 18), new Greater("AGE", 65))), + filters.add(new Or( + new And(new Like("NAME", "%lle"), + new Or(new Less("AGE", 18), new Greater("AGE", 65))), new Equal("NAME", "Pelle"))); Assert.assertEquals( " WHERE ((\"NAME\" LIKE ? AND (\"AGE\" < ? OR \"AGE\" > ?)) OR \"NAME\" = ?)", @@ -244,8 +247,9 @@ public class QueryBuilderTest { StatementHelper sh = mockedStatementHelper("%lle", 18, 65, "Pelle", "Virtanen"); ArrayList filters = new ArrayList(); - filters.add(new Or(new And(new Like("NAME", "%lle"), new Or(new Less( - "AGE", 18), new Greater("AGE", 65))), + filters.add(new Or( + new And(new Like("NAME", "%lle"), + new Or(new Less("AGE", 18), new Greater("AGE", 65))), new Equal("NAME", "Pelle"))); filters.add(new Equal("LASTNAME", "Virtanen")); Assert.assertEquals( @@ -275,7 +279,8 @@ public class QueryBuilderTest { public void getWhereStringForFilters_complexNegatedFilter() { StatementHelper sh = mockedStatementHelper(65, 18); ArrayList filters = new ArrayList(); - filters.add(new Not(new Or(new Equal("AGE", 65), new Equal("AGE", 18)))); + filters.add( + new Not(new Or(new Equal("AGE", 65), new Equal("AGE", 18)))); Assert.assertEquals(" WHERE NOT (\"AGE\" = ? OR \"AGE\" = ?)", QueryBuilder.getWhereStringForFilters(filters, sh)); EasyMock.verify(sh); diff --git a/server/src/test/java/com/vaadin/data/util/sqlcontainer/query/TableQueryTest.java b/server/src/test/java/com/vaadin/data/util/sqlcontainer/query/TableQueryTest.java index 1cb3d722c6..d2067a85b4 100644 --- a/server/src/test/java/com/vaadin/data/util/sqlcontainer/query/TableQueryTest.java +++ b/server/src/test/java/com/vaadin/data/util/sqlcontainer/query/TableQueryTest.java @@ -57,10 +57,10 @@ public class TableQueryTest { public void construction_legalParameters_shouldSucceed() { TableQuery tQuery = new TableQuery("people", connectionPool, new DefaultSQLGenerator()); - Assert.assertArrayEquals(new Object[] { "ID" }, tQuery - .getPrimaryKeyColumns().toArray()); - boolean correctTableName = "people".equalsIgnoreCase(tQuery - .getTableName()); + Assert.assertArrayEquals(new Object[] { "ID" }, + tQuery.getPrimaryKeyColumns().toArray()); + boolean correctTableName = "people" + .equalsIgnoreCase(tQuery.getTableName()); Assert.assertTrue(correctTableName); } @@ -68,10 +68,10 @@ public class TableQueryTest { public void construction_legalParameters_defaultGenerator_shouldSucceed() { TableQuery tQuery = new TableQuery("people", connectionPool, SQLTestsConstants.sqlGen); - Assert.assertArrayEquals(new Object[] { "ID" }, tQuery - .getPrimaryKeyColumns().toArray()); - boolean correctTableName = "people".equalsIgnoreCase(tQuery - .getTableName()); + Assert.assertArrayEquals(new Object[] { "ID" }, + tQuery.getPrimaryKeyColumns().toArray()); + boolean correctTableName = "people" + .equalsIgnoreCase(tQuery.getTableName()); Assert.assertTrue(correctTableName); } @@ -115,10 +115,10 @@ public class TableQueryTest { statement.executeUpdate("insert into people values('Bengt', 30)"); statement.executeUpdate("insert into people values('Ingvar', 50)"); } else { - statement - .executeUpdate("insert into people values(default, 'Bengt', 30)"); - statement - .executeUpdate("insert into people values(default, 'Ingvar', 50)"); + statement.executeUpdate( + "insert into people values(default, 'Bengt', 30)"); + statement.executeUpdate( + "insert into people values(default, 'Ingvar', 50)"); } statement.close(); conn.commit(); @@ -145,7 +145,8 @@ public class TableQueryTest { * TableQuery get results tests **********************************************************************/ @Test - public void getResults_simpleQuery_returnsFourRecords() throws SQLException { + public void getResults_simpleQuery_returnsFourRecords() + throws SQLException { TableQuery tQuery = new TableQuery("people", connectionPool, SQLTestsConstants.sqlGen); tQuery.beginTransaction(); @@ -200,7 +201,8 @@ public class TableQueryTest { tQuery.beginTransaction(); try { tQuery.beginTransaction(); - Assert.fail("Should throw exception when starting a transaction while already in a transaction"); + Assert.fail( + "Should throw exception when starting a transaction while already in a transaction"); } catch (IllegalStateException e) { // Cleanup to make test connection pool happy tQuery.rollback(); @@ -278,8 +280,8 @@ public class TableQueryTest { SQLTestsConstants.sqlGen); try { tQuery.containsRowWithKey(new Object[] { null }); - org.junit.Assert - .fail("null should throw an IllegalArgumentException from StatementHelper"); + org.junit.Assert.fail( + "null should throw an IllegalArgumentException from StatementHelper"); } catch (IllegalArgumentException e) { // We should now be able to reserve two connections Connection c1 = connectionPool.reserveConnection(); @@ -395,8 +397,8 @@ public class TableQueryTest { SQLTestsConstants.sqlGen); SQLContainer container = new SQLContainer(tQuery); container.setAutoCommit(false); - Assert.assertTrue(container.removeItem(container.getItemIds() - .iterator().next())); + Assert.assertTrue( + container.removeItem(container.getItemIds().iterator().next())); Assert.assertEquals(4, tQuery.getCount()); Assert.assertEquals(3, container.size()); @@ -459,8 +461,8 @@ public class TableQueryTest { tQuery.setFilters(null); /* Fetch first item, modify and commit */ - Object item = container.getItem(container.getItemIds().iterator() - .next()); + Object item = container + .getItem(container.getItemIds().iterator().next()); Assert.assertNotNull(item); RowItem ri = (RowItem) item; @@ -549,8 +551,8 @@ public class TableQueryTest { // Update the version using another connection. Connection conn = connectionPool.reserveConnection(); - PreparedStatement stmt = conn - .prepareStatement("UPDATE VERSIONED SET \"TEXT\" = ? WHERE \"ID\" = ?"); + PreparedStatement stmt = conn.prepareStatement( + "UPDATE VERSIONED SET \"TEXT\" = ? WHERE \"ID\" = ?"); stmt.setString(1, "foo"); stmt.setObject(2, row.getItemProperty("ID").getValue()); stmt.executeUpdate(); @@ -607,8 +609,8 @@ public class TableQueryTest { // Update the version using another connection. Connection conn = connectionPool.reserveConnection(); - PreparedStatement stmt = conn - .prepareStatement("UPDATE VERSIONED SET \"TEXT\" = ? WHERE \"ID\" = ?"); + PreparedStatement stmt = conn.prepareStatement( + "UPDATE VERSIONED SET \"TEXT\" = ? WHERE \"ID\" = ?"); stmt.setString(1, "asdf"); stmt.setObject(2, row.getItemProperty("ID").getValue()); stmt.executeUpdate(); @@ -639,8 +641,8 @@ public class TableQueryTest { // Update the version using another connection. Connection conn = connectionPool.reserveConnection(); - PreparedStatement stmt = conn - .prepareStatement("UPDATE VERSIONED SET \"TEXT\" = ? WHERE \"ID\" = ?"); + PreparedStatement stmt = conn.prepareStatement( + "UPDATE VERSIONED SET \"TEXT\" = ? WHERE \"ID\" = ?"); stmt.setString(1, "asdf"); stmt.setObject(2, row.getItemProperty("ID").getValue()); stmt.executeUpdate(); @@ -665,7 +667,8 @@ public class TableQueryTest { } @Test - public void construction_explicitSchema_shouldSucceed() throws SQLException { + public void construction_explicitSchema_shouldSucceed() + throws SQLException { if (SQLTestsConstants.createSchema == null || SQLTestsConstants.createProductTable == null || SQLTestsConstants.dropSchema == null) { diff --git a/server/src/test/java/com/vaadin/data/util/sqlcontainer/query/ValidatingSimpleJDBCConnectionPool.java b/server/src/test/java/com/vaadin/data/util/sqlcontainer/query/ValidatingSimpleJDBCConnectionPool.java index f40455f1d7..978f79f8ac 100644 --- a/server/src/test/java/com/vaadin/data/util/sqlcontainer/query/ValidatingSimpleJDBCConnectionPool.java +++ b/server/src/test/java/com/vaadin/data/util/sqlcontainer/query/ValidatingSimpleJDBCConnectionPool.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -28,7 +28,7 @@ import com.vaadin.data.util.sqlcontainer.connection.SimpleJDBCConnectionPool; * Connection pool for testing SQLContainer. Ensures that only reserved * connections are released and that all connections are released before the * pool is destroyed. - * + * * @author Vaadin Ltd */ public class ValidatingSimpleJDBCConnectionPool implements JDBCConnectionPool { @@ -60,9 +60,8 @@ public class ValidatingSimpleJDBCConnectionPool implements JDBCConnectionPool { public void releaseConnection(Connection conn) { if (conn != null && !reserved.remove(conn)) { if (alreadyReleased.contains(conn)) { - getLogger().severe( - "Tried to release connection (" + conn - + ") which has already been released"); + getLogger().severe("Tried to release connection (" + conn + + ") which has already been released"); } else { throw new RuntimeException("Tried to release connection (" + conn + ") not reserved using reserveConnection"); @@ -77,13 +76,13 @@ public class ValidatingSimpleJDBCConnectionPool implements JDBCConnectionPool { public void destroy() { realPool.destroy(); if (!reserved.isEmpty()) { - throw new RuntimeException(reserved.size() - + " connections never released"); + throw new RuntimeException( + reserved.size() + " connections never released"); } } private static Logger getLogger() { - return Logger.getLogger(ValidatingSimpleJDBCConnectionPool.class - .getName()); + return Logger + .getLogger(ValidatingSimpleJDBCConnectionPool.class.getName()); } } \ No newline at end of file diff --git a/server/src/test/java/com/vaadin/server/AbstractClientConnectorProxyHandlingTest.java b/server/src/test/java/com/vaadin/server/AbstractClientConnectorProxyHandlingTest.java index c15676c18e..3b06d5e936 100644 --- a/server/src/test/java/com/vaadin/server/AbstractClientConnectorProxyHandlingTest.java +++ b/server/src/test/java/com/vaadin/server/AbstractClientConnectorProxyHandlingTest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,7 +25,7 @@ import org.junit.Test; * We test that AbstractClientConnector has a suitable isThis method which is * needed to correctly perform an equals check between a proxy and it's * underlying instance. - * + * * @author Vaadin Ltd */ public class AbstractClientConnectorProxyHandlingTest { @@ -33,12 +33,13 @@ public class AbstractClientConnectorProxyHandlingTest { @Test public void abstractClientConnectorTest() { try { - Method method = AbstractClientConnector.class.getDeclaredMethod( - "isThis", Object.class); + Method method = AbstractClientConnector.class + .getDeclaredMethod("isThis", Object.class); int modifiers = method.getModifiers(); if (Modifier.isFinal(modifiers) || !Modifier.isProtected(modifiers) || Modifier.isStatic(modifiers)) { - Assert.fail("isThis has invalid modifiers, CDI proxies will not work."); + Assert.fail( + "isThis has invalid modifiers, CDI proxies will not work."); } } catch (SecurityException e) { // Ignore, no can do diff --git a/server/src/test/java/com/vaadin/server/AbstractClientConnectorTest.java b/server/src/test/java/com/vaadin/server/AbstractClientConnectorTest.java index 96ca82a0b3..a4f3741f29 100644 --- a/server/src/test/java/com/vaadin/server/AbstractClientConnectorTest.java +++ b/server/src/test/java/com/vaadin/server/AbstractClientConnectorTest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -31,7 +31,7 @@ import com.vaadin.shared.ui.ClickRpc; * We test that AbstractClientConnector has a suitable isThis method which is * needed to correctly perform an equals check between a proxy and it's * underlying instance. - * + * * @author Vaadin Ltd */ public class AbstractClientConnectorTest { @@ -45,8 +45,7 @@ public class AbstractClientConnectorTest { mock.registerRpc(implementation); Assert.fail("expected exception"); } catch (Exception expected) { - Assert.assertEquals( - expected.getMessage(), + Assert.assertEquals(expected.getMessage(), "Use registerRpc(T implementation, Class rpcInterfaceType) if the Rpc implementation implements more than one interface"); } } @@ -69,8 +68,8 @@ public class AbstractClientConnectorTest { verify(mock, times(1)).registerRpc(implementation, ClickRpc.class); } - private class ServerRpcLastMock implements Comparable, - ClickRpc { + private class ServerRpcLastMock + implements Comparable, ClickRpc { private static final long serialVersionUID = -2822356895755286180L; @Override diff --git a/server/src/test/java/com/vaadin/server/AbstractDeploymentConfigurationTest.java b/server/src/test/java/com/vaadin/server/AbstractDeploymentConfigurationTest.java index 0518bea650..ce58c343ed 100644 --- a/server/src/test/java/com/vaadin/server/AbstractDeploymentConfigurationTest.java +++ b/server/src/test/java/com/vaadin/server/AbstractDeploymentConfigurationTest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,7 +25,7 @@ import com.vaadin.shared.communication.PushMode; /** * Test for {@link AbstractDeploymentConfiguration} - * + * * @author Vaadin Ltd */ public class AbstractDeploymentConfigurationTest { @@ -80,8 +80,7 @@ public class AbstractDeploymentConfigurationTest { public void getClassLoader_returnsClassloaderPropertyValue() { String classLoader = UUID.randomUUID().toString(); DeploymentConfiguration config = getConfig("ClassLoader", classLoader); - Assert.assertEquals( - "Unexpected classLoader configuration option value", + Assert.assertEquals("Unexpected classLoader configuration option value", classLoader, config.getClassLoaderName()); } @@ -93,8 +92,8 @@ public class AbstractDeploymentConfigurationTest { return new DeploymentConfigImpl(props); } - private static class DeploymentConfigImpl extends - AbstractDeploymentConfiguration { + private static class DeploymentConfigImpl + extends AbstractDeploymentConfiguration { private Properties properties; diff --git a/server/src/test/java/com/vaadin/server/BrowserWindowOpenerTest.java b/server/src/test/java/com/vaadin/server/BrowserWindowOpenerTest.java index 7c76f7d421..9b7d946521 100644 --- a/server/src/test/java/com/vaadin/server/BrowserWindowOpenerTest.java +++ b/server/src/test/java/com/vaadin/server/BrowserWindowOpenerTest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,7 +25,7 @@ import com.vaadin.shared.communication.URLReference; import com.vaadin.shared.ui.BrowserWindowOpenerState; /** - * + * * @author Vaadin Ltd */ public class BrowserWindowOpenerTest { @@ -44,8 +44,7 @@ public class BrowserWindowOpenerTest { URLReference ref = opener.getState(false).resources .get(BrowserWindowOpenerState.locationResource); - Assert.assertTrue( - "Url reference in the state is not ResourceReference", + Assert.assertTrue("Url reference in the state is not ResourceReference", ref instanceof ResourceReference); Assert.assertEquals("Unexpected resource saved in state", resource, ((ResourceReference) ref).getResource()); @@ -66,8 +65,7 @@ public class BrowserWindowOpenerTest { URLReference ref = opener.getState(false).resources .get(BrowserWindowOpenerState.locationResource); - Assert.assertTrue( - "Url reference in the state is not ResourceReference", + Assert.assertTrue("Url reference in the state is not ResourceReference", ref instanceof ResourceReference); Resource resource = ((ResourceReference) ref).getResource(); Assert.assertTrue("Resource reference is not ExternalResource", diff --git a/server/src/test/java/com/vaadin/server/ConnectorResourceHandlerTest.java b/server/src/test/java/com/vaadin/server/ConnectorResourceHandlerTest.java index a5746065d6..99667139a5 100644 --- a/server/src/test/java/com/vaadin/server/ConnectorResourceHandlerTest.java +++ b/server/src/test/java/com/vaadin/server/ConnectorResourceHandlerTest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -57,8 +57,8 @@ public class ConnectorResourceHandlerTest { session.lock(); try { - session.setCommunicationManager(new LegacyCommunicationManager( - session)); + session.setCommunicationManager( + new LegacyCommunicationManager(session)); ui.setSession(session); session.addUI(ui); } finally { diff --git a/server/src/test/java/com/vaadin/server/DefaultDeploymentConfigurationTest.java b/server/src/test/java/com/vaadin/server/DefaultDeploymentConfigurationTest.java index 7cbb73af17..dcd70ded9f 100644 --- a/server/src/test/java/com/vaadin/server/DefaultDeploymentConfigurationTest.java +++ b/server/src/test/java/com/vaadin/server/DefaultDeploymentConfigurationTest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -22,7 +22,7 @@ import org.junit.Test; /** * Tests for {@link DefaultDeploymentConfiguration} - * + * * @author Vaadin Ltd * @since 7.2 */ @@ -44,8 +44,10 @@ public class DefaultDeploymentConfigurationTest { public void testGetSystemProperty() throws ClassNotFoundException { String value = "value"; String prop = "prop"; - System.setProperty(DefaultDeploymentConfigurationTest.class - .getPackage().getName() + '.' + prop, value); + System.setProperty( + DefaultDeploymentConfigurationTest.class.getPackage().getName() + + '.' + prop, + value); DefaultDeploymentConfiguration config = new DefaultDeploymentConfiguration( DefaultDeploymentConfigurationTest.class, new Properties()); Assert.assertEquals(value, config.getSystemProperty(prop)); diff --git a/server/src/test/java/com/vaadin/server/DownloadStreamTest.java b/server/src/test/java/com/vaadin/server/DownloadStreamTest.java index 180b2e348b..f302163ef7 100644 --- a/server/src/test/java/com/vaadin/server/DownloadStreamTest.java +++ b/server/src/test/java/com/vaadin/server/DownloadStreamTest.java @@ -30,10 +30,8 @@ public class DownloadStreamTest { String encodedFileName = URLEncoder.encode(filename, "utf-8"); verify(response).setHeader(eq(DownloadStream.CONTENT_DISPOSITION), contains(String.format("filename=\"%s\";", encodedFileName))); - verify(response) - .setHeader( - eq(DownloadStream.CONTENT_DISPOSITION), - contains(String.format("filename*=utf-8''%s", - encodedFileName))); + verify(response).setHeader(eq(DownloadStream.CONTENT_DISPOSITION), + contains( + String.format("filename*=utf-8''%s", encodedFileName))); } } diff --git a/server/src/test/java/com/vaadin/server/DragAndDropServiceTest.java b/server/src/test/java/com/vaadin/server/DragAndDropServiceTest.java index d0cb0ca5a6..5d3be5df01 100644 --- a/server/src/test/java/com/vaadin/server/DragAndDropServiceTest.java +++ b/server/src/test/java/com/vaadin/server/DragAndDropServiceTest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -34,7 +34,7 @@ import com.vaadin.ui.AbstractComponent; /** * Tests for {@link DragAndDropService}. - * + * * @author Vaadin Ltd */ public class DragAndDropServiceTest { @@ -42,8 +42,8 @@ public class DragAndDropServiceTest { @Test public void changeVariables_isSourceConnectorEnabledCalled() { final List levels = new ArrayList(); - Logger.getLogger(DragAndDropService.class.getName()).addHandler( - new StreamHandler() { + Logger.getLogger(DragAndDropService.class.getName()) + .addHandler(new StreamHandler() { @Override public synchronized void publish(LogRecord record) { levels.add(record.getLevel()); @@ -74,8 +74,8 @@ public class DragAndDropServiceTest { @Test public void changeVariables_isTargetConnectorEnabledCalled() { final List levels = new ArrayList(); - Logger.getLogger(DragAndDropService.class.getName()).addHandler( - new StreamHandler() { + Logger.getLogger(DragAndDropService.class.getName()) + .addHandler(new StreamHandler() { @Override public void publish(LogRecord record) { levels.add(record.getLevel()); @@ -96,8 +96,8 @@ public class DragAndDropServiceTest { } - private static class TestDropTarget extends AbstractComponent implements - com.vaadin.event.dd.DropTarget { + private static class TestDropTarget extends AbstractComponent + implements com.vaadin.event.dd.DropTarget { @Override public boolean isConnectorEnabled() { isConnectorEnabledCalled = true; diff --git a/server/src/test/java/com/vaadin/server/JSONSerializerTest.java b/server/src/test/java/com/vaadin/server/JSONSerializerTest.java index bb0be09870..d53fef31c7 100644 --- a/server/src/test/java/com/vaadin/server/JSONSerializerTest.java +++ b/server/src/test/java/com/vaadin/server/JSONSerializerTest.java @@ -2,13 +2,13 @@ package com.vaadin.server; /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -35,10 +35,10 @@ import elemental.json.JsonValue; /** * Tests for {@link JsonCodec} - * + * * @author Vaadin Ltd * @since 7.0 - * + * */ public class JSONSerializerTest { HashMap stringToStateMap; @@ -58,8 +58,9 @@ public class JSONSerializerTest { stringToStateMap.put("string - state 1", s); stringToStateMap.put("String - state 2", s2); - JsonValue encodedMap = JsonCodec.encode(stringToStateMap, null, - mapType, null).getEncodedValue(); + JsonValue encodedMap = JsonCodec + .encode(stringToStateMap, null, mapType, null) + .getEncodedValue(); ensureDecodedCorrectly(stringToStateMap, encodedMap, mapType); } @@ -76,8 +77,9 @@ public class JSONSerializerTest { stateToStringMap.put(s, "string - state 1"); stateToStringMap.put(s2, "String - state 2"); - JsonValue encodedMap = JsonCodec.encode(stateToStringMap, null, - mapType, null).getEncodedValue(); + JsonValue encodedMap = JsonCodec + .encode(stateToStringMap, null, mapType, null) + .getEncodedValue(); ensureDecodedCorrectly(stateToStringMap, encodedMap, mapType); } @@ -87,8 +89,8 @@ public class JSONSerializerTest { JsonArray inputArray = Json.createArray(); inputArray.set(0, "n"); inputArray.set(1, Json.createNull()); - UidlValue decodedObject = (UidlValue) JsonCodec.decodeInternalType( - UidlValue.class, true, inputArray, null); + UidlValue decodedObject = (UidlValue) JsonCodec + .decodeInternalType(UidlValue.class, true, inputArray, null); Assert.assertNull(decodedObject.getValue()); } @@ -97,15 +99,16 @@ public class JSONSerializerTest { JsonArray inputArray = Json.createArray(); inputArray.set(0, "n"); inputArray.set(1, "a"); - UidlValue decodedObject = (UidlValue) JsonCodec.decodeInternalType( - UidlValue.class, true, inputArray, null); + UidlValue decodedObject = (UidlValue) JsonCodec + .decodeInternalType(UidlValue.class, true, inputArray, null); } private void ensureDecodedCorrectly(Object original, JsonValue encoded, Type type) throws Exception { Object serverSideDecoded = JsonCodec.decodeInternalOrCustomType(type, encoded, null); - Assert.assertTrue("Server decoded", equals(original, serverSideDecoded)); + Assert.assertTrue("Server decoded", + equals(original, serverSideDecoded)); } diff --git a/server/src/test/java/com/vaadin/server/JsonEqualsTest.java b/server/src/test/java/com/vaadin/server/JsonEqualsTest.java index ca3bfced79..b44e0e94d9 100644 --- a/server/src/test/java/com/vaadin/server/JsonEqualsTest.java +++ b/server/src/test/java/com/vaadin/server/JsonEqualsTest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/server/src/test/java/com/vaadin/server/MockServletContext.java b/server/src/test/java/com/vaadin/server/MockServletContext.java index 8818ba1c36..3002925992 100644 --- a/server/src/test/java/com/vaadin/server/MockServletContext.java +++ b/server/src/test/java/com/vaadin/server/MockServletContext.java @@ -399,8 +399,8 @@ public class MockServletContext implements ServletContext { * java.lang.String) */ @Override - public javax.servlet.FilterRegistration.Dynamic addFilter( - String filterName, String className) { + public javax.servlet.FilterRegistration.Dynamic addFilter(String filterName, + String className) { return null; } @@ -411,8 +411,8 @@ public class MockServletContext implements ServletContext { * javax.servlet.Filter) */ @Override - public javax.servlet.FilterRegistration.Dynamic addFilter( - String filterName, Filter filter) { + public javax.servlet.FilterRegistration.Dynamic addFilter(String filterName, + Filter filter) { return null; } @@ -423,8 +423,8 @@ public class MockServletContext implements ServletContext { * java.lang.Class) */ @Override - public javax.servlet.FilterRegistration.Dynamic addFilter( - String filterName, Class filterClass) { + public javax.servlet.FilterRegistration.Dynamic addFilter(String filterName, + Class filterClass) { return null; } diff --git a/server/src/test/java/com/vaadin/server/MockVaadinSession.java b/server/src/test/java/com/vaadin/server/MockVaadinSession.java index e1def5bcee..490463f1fc 100644 --- a/server/src/test/java/com/vaadin/server/MockVaadinSession.java +++ b/server/src/test/java/com/vaadin/server/MockVaadinSession.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -19,7 +19,7 @@ import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; /** - * + * * @author Vaadin Ltd */ public class MockVaadinSession extends VaadinSession { diff --git a/server/src/test/java/com/vaadin/server/PageTest.java b/server/src/test/java/com/vaadin/server/PageTest.java index b782b1f67d..5f04a1c2e3 100644 --- a/server/src/test/java/com/vaadin/server/PageTest.java +++ b/server/src/test/java/com/vaadin/server/PageTest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -25,9 +25,9 @@ import com.vaadin.shared.ui.ui.PageState; import com.vaadin.ui.UI; /** - * + * * Tests for {@link Page} - * + * * @author Vaadin Ltd */ public class PageTest { @@ -74,8 +74,8 @@ public class PageTest { } - private static class TestBrowserWindowResizeListener implements - BrowserWindowResizeListener { + private static class TestBrowserWindowResizeListener + implements BrowserWindowResizeListener { @Override public void browserWindowResized(BrowserWindowResizeEvent event) { diff --git a/server/src/test/java/com/vaadin/server/TestAbstractApplicationServletStaticFilesLocation.java b/server/src/test/java/com/vaadin/server/TestAbstractApplicationServletStaticFilesLocation.java index aba29bf9a5..274441824b 100644 --- a/server/src/test/java/com/vaadin/server/TestAbstractApplicationServletStaticFilesLocation.java +++ b/server/src/test/java/com/vaadin/server/TestAbstractApplicationServletStaticFilesLocation.java @@ -49,8 +49,8 @@ public class TestAbstractApplicationServletStaticFilesLocation { // http://dummy.host/contextpath/servlet/extra/stuff // should return ./../.. (relative url resolving to /contextpath) - location = testLocation("http://dummy.host", "/contextpath", - "/servlet", "/extra/stuff"); + location = testLocation("http://dummy.host", "/contextpath", "/servlet", + "/extra/stuff"); Assert.assertEquals("./../..", location); // http://dummy.host/context/path/servlet/extra/stuff @@ -76,8 +76,8 @@ public class TestAbstractApplicationServletStaticFilesLocation { // Set request into replay mode replay(request); - String location = servlet.getService().getStaticFileLocation( - servlet.createVaadinRequest(request)); + String location = servlet.getService() + .getStaticFileLocation(servlet.createVaadinRequest(request)); return location; } @@ -89,8 +89,8 @@ public class TestAbstractApplicationServletStaticFilesLocation { // Set request into replay mode replay(request); - String location = servlet.getService().getStaticFileLocation( - servlet.createVaadinRequest(request)); + String location = servlet.getService() + .getStaticFileLocation(servlet.createVaadinRequest(request)); return location; } @@ -121,7 +121,7 @@ public class TestAbstractApplicationServletStaticFilesLocation { /** * Creates a HttpServletRequest mock using the supplied parameters. - * + * * @param base * The base url, e.g. http://localhost:8080 * @param contextPath @@ -139,8 +139,9 @@ public class TestAbstractApplicationServletStaticFilesLocation { String servletPath, String pathInfo) throws MalformedURLException { URL url = new URL(base + contextPath + pathInfo); HttpServletRequest request = createMock(HttpServletRequest.class); - expect(request.isSecure()).andReturn( - url.getProtocol().equalsIgnoreCase("https")).anyTimes(); + expect(request.isSecure()) + .andReturn(url.getProtocol().equalsIgnoreCase("https")) + .anyTimes(); expect(request.getServerName()).andReturn(url.getHost()).anyTimes(); expect(request.getServerPort()).andReturn(url.getPort()).anyTimes(); expect(request.getRequestURI()).andReturn(url.getPath()).anyTimes(); diff --git a/server/src/test/java/com/vaadin/server/UIProviderTest.java b/server/src/test/java/com/vaadin/server/UIProviderTest.java index 579a3f1858..c6c387d97f 100644 --- a/server/src/test/java/com/vaadin/server/UIProviderTest.java +++ b/server/src/test/java/com/vaadin/server/UIProviderTest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -28,7 +28,7 @@ import com.vaadin.annotations.Widgetset; /** * Tests for {@link UIProvider} class. - * + * * @author Vaadin Ltd */ public class UIProviderTest { @@ -48,8 +48,8 @@ public class UIProviderTest { @Test public void getAnnotationFor_themeAnnotationForSubclass_annotationOverridden() { Assert.assertEquals( - "Theme annotation is not overridden correctly in subclass", - "c", UIProvider.getAnnotationFor(TestClass.class, Theme.class) + "Theme annotation is not overridden correctly in subclass", "c", + UIProvider.getAnnotationFor(TestClass.class, Theme.class) .value()); } @@ -71,10 +71,9 @@ public class UIProviderTest { @Test public void getAnnotationFor_annotationInheritedFromInterface_annotationFound() { - Assert.assertNotNull( - "Theme annotation is not inherited from interface", UIProvider - .getAnnotationFor(ClassImplementingInterface.class, - Theme.class)); + Assert.assertNotNull("Theme annotation is not inherited from interface", + UIProvider.getAnnotationFor(ClassImplementingInterface.class, + Theme.class)); } @Retention(RetentionPolicy.RUNTIME) @@ -106,8 +105,8 @@ public class UIProviderTest { public interface InterfaceWithAnnotation { } - public static class ClassImplementingInterface implements - InterfaceWithAnnotation { + public static class ClassImplementingInterface + implements InterfaceWithAnnotation { } } diff --git a/server/src/test/java/com/vaadin/server/VaadinGateInRequestTest.java b/server/src/test/java/com/vaadin/server/VaadinGateInRequestTest.java index eda2b3a006..f4f0a1c87a 100644 --- a/server/src/test/java/com/vaadin/server/VaadinGateInRequestTest.java +++ b/server/src/test/java/com/vaadin/server/VaadinGateInRequestTest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,8 +20,8 @@ import static org.mockito.Mockito.spy; import com.vaadin.server.VaadinPortlet.VaadinGateInRequest; -public class VaadinGateInRequestTest extends - VaadinHttpAndPortletRequestTestBase { +public class VaadinGateInRequestTest + extends VaadinHttpAndPortletRequestTestBase { @Override protected VaadinGateInRequest createSut() { diff --git a/server/src/test/java/com/vaadin/server/VaadinHttpAndPortletRequestTestBase.java b/server/src/test/java/com/vaadin/server/VaadinHttpAndPortletRequestTestBase.java index 0f7cce5f75..fce9c048f2 100644 --- a/server/src/test/java/com/vaadin/server/VaadinHttpAndPortletRequestTestBase.java +++ b/server/src/test/java/com/vaadin/server/VaadinHttpAndPortletRequestTestBase.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/server/src/test/java/com/vaadin/server/VaadinLiferayRequestTest.java b/server/src/test/java/com/vaadin/server/VaadinLiferayRequestTest.java index 3024cd652f..67305403c0 100644 --- a/server/src/test/java/com/vaadin/server/VaadinLiferayRequestTest.java +++ b/server/src/test/java/com/vaadin/server/VaadinLiferayRequestTest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,8 +20,8 @@ import static org.mockito.Mockito.spy; import com.vaadin.server.VaadinPortlet.VaadinLiferayRequest; -public class VaadinLiferayRequestTest extends - VaadinHttpAndPortletRequestTestBase { +public class VaadinLiferayRequestTest + extends VaadinHttpAndPortletRequestTestBase { @Override protected VaadinLiferayRequest createSut() { diff --git a/server/src/test/java/com/vaadin/server/VaadinPortletServiceTest.java b/server/src/test/java/com/vaadin/server/VaadinPortletServiceTest.java index d8c66e312f..ca874da821 100644 --- a/server/src/test/java/com/vaadin/server/VaadinPortletServiceTest.java +++ b/server/src/test/java/com/vaadin/server/VaadinPortletServiceTest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -56,16 +56,15 @@ public class VaadinPortletServiceTest { } private void mockFileLocationPreference(String location) { - when( - request.getPortletPreference(Constants.PORTAL_PARAMETER_VAADIN_RESOURCE_PATH)) - .thenReturn(location); + when(request.getPortletPreference( + Constants.PORTAL_PARAMETER_VAADIN_RESOURCE_PATH)) + .thenReturn(location); } private void mockLocationDeploymentConfiguration(String location) { - when( - conf.getApplicationOrSystemProperty( - Constants.PORTAL_PARAMETER_VAADIN_RESOURCE_PATH, null)) - .thenReturn(location); + when(conf.getApplicationOrSystemProperty( + Constants.PORTAL_PARAMETER_VAADIN_RESOURCE_PATH, null)) + .thenReturn(location); } private String getStaticFileLocation() { @@ -184,7 +183,8 @@ public class VaadinPortletServiceTest { @Test public void oldDefaultWidgetSetIsNotMappedToDefaultWidgetset() { - mockWidgetsetConfiguration("com.vaadin.portal.gwt.PortalDefaultWidgetSet"); + mockWidgetsetConfiguration( + "com.vaadin.portal.gwt.PortalDefaultWidgetSet"); mockWidgetsetProperty(null); String widgetset = getWidgetset(); @@ -201,14 +201,14 @@ public class VaadinPortletServiceTest { WrappedSession emptyWrappedSession = Mockito .mock(WrappedPortletSession.class); - when(emptyWrappedSession.getAttribute("null.lock")).thenReturn( - mockLock); + when(emptyWrappedSession.getAttribute("null.lock")) + .thenReturn(mockLock); VaadinRequest requestWithUIIDSet = Mockito .mock(VaadinRequest.class); when(requestWithUIIDSet.getParameter(UIConstants.UI_ID_PARAMETER)) .thenReturn("1"); - when(requestWithUIIDSet.getWrappedSession()).thenReturn( - emptyWrappedSession); + when(requestWithUIIDSet.getWrappedSession()) + .thenReturn(emptyWrappedSession); UI ui = sut.findUI(requestWithUIIDSet); Assert.assertNull("Unset session did not return null", ui); diff --git a/server/src/test/java/com/vaadin/server/VaadinPortletTest.java b/server/src/test/java/com/vaadin/server/VaadinPortletTest.java index 4e74f91708..39e3187f93 100644 --- a/server/src/test/java/com/vaadin/server/VaadinPortletTest.java +++ b/server/src/test/java/com/vaadin/server/VaadinPortletTest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/server/src/test/java/com/vaadin/server/VaadinServiceTest.java b/server/src/test/java/com/vaadin/server/VaadinServiceTest.java index bd3da6277a..bec51df485 100644 --- a/server/src/test/java/com/vaadin/server/VaadinServiceTest.java +++ b/server/src/test/java/com/vaadin/server/VaadinServiceTest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -27,7 +27,7 @@ import org.junit.Assert; import org.junit.Test; /** - * + * * @author Vaadin Ltd */ public class VaadinServiceTest { @@ -65,12 +65,13 @@ public class VaadinServiceTest { "'fireSessionDestroy' method doesn't call 'close' for the session", 1, vaadinSession.getCloseCount()); - vaadinSession.valueUnbound(EasyMock - .createMock(HttpSessionBindingEvent.class)); + vaadinSession.valueUnbound( + EasyMock.createMock(HttpSessionBindingEvent.class)); - Assert.assertEquals("'fireSessionDestroy' method may not call 'close' " - + "method for closing session", 1, - vaadinSession.getCloseCount()); + Assert.assertEquals( + "'fireSessionDestroy' method may not call 'close' " + + "method for closing session", + 1, vaadinSession.getCloseCount()); Assert.assertEquals("SessionDestroyListeners not called exactly once", 1, listener.callCount); diff --git a/server/src/test/java/com/vaadin/server/VaadinServletConfigurationTest.java b/server/src/test/java/com/vaadin/server/VaadinServletConfigurationTest.java index 65698d2c44..ebeccf920f 100644 --- a/server/src/test/java/com/vaadin/server/VaadinServletConfigurationTest.java +++ b/server/src/test/java/com/vaadin/server/VaadinServletConfigurationTest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -15,7 +15,7 @@ */ /** - * + * */ package com.vaadin.server; @@ -42,8 +42,8 @@ public class VaadinServletConfigurationTest { Class uiClass = new DefaultUIProvider() .getUIClass(new UIClassSelectionEvent(new VaadinServletRequest( - EasyMock.createMock(HttpServletRequest.class), servlet - .getService()))); + EasyMock.createMock(HttpServletRequest.class), + servlet.getService()))); Assert.assertEquals(MockUIContainingServlet.class, uiClass); } @@ -63,8 +63,8 @@ public class VaadinServletConfigurationTest { Class uiClass = new DefaultUIProvider() .getUIClass(new UIClassSelectionEvent(new VaadinServletRequest( - EasyMock.createMock(HttpServletRequest.class), servlet - .getService()))); + EasyMock.createMock(HttpServletRequest.class), + servlet.getService()))); Assert.assertEquals(MockUIContainingServlet.class, uiClass); } @@ -113,8 +113,8 @@ public class VaadinServletConfigurationTest { Class uiClass = new DefaultUIProvider() .getUIClass(new UIClassSelectionEvent(new VaadinServletRequest( - EasyMock.createMock(HttpServletRequest.class), servlet - .getService()))); + EasyMock.createMock(HttpServletRequest.class), + servlet.getService()))); Assert.assertEquals(MockUIContainingServlet.class, uiClass); } } diff --git a/server/src/test/java/com/vaadin/server/VaadinServletTest.java b/server/src/test/java/com/vaadin/server/VaadinServletTest.java index 566c4ce70a..a582561fc5 100644 --- a/server/src/test/java/com/vaadin/server/VaadinServletTest.java +++ b/server/src/test/java/com/vaadin/server/VaadinServletTest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/server/src/test/java/com/vaadin/server/VaadinSessionTest.java b/server/src/test/java/com/vaadin/server/VaadinSessionTest.java index 85c37d156c..d612ffbaba 100644 --- a/server/src/test/java/com/vaadin/server/VaadinSessionTest.java +++ b/server/src/test/java/com/vaadin/server/VaadinSessionTest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -111,7 +111,8 @@ public class VaadinSessionTest implements Serializable { || "ignoreRestart".equals(name) || "closeApplication".equals(name)) { return null; - } else if (UIInitHandler.BROWSER_DETAILS_PARAMETER.equals(name)) { + } else if (UIInitHandler.BROWSER_DETAILS_PARAMETER + .equals(name)) { return "1"; } return super.getParameter(name); @@ -123,7 +124,8 @@ public class VaadinSessionTest implements Serializable { } @Override - public WrappedSession getWrappedSession(boolean allowSessionCreation) { + public WrappedSession getWrappedSession( + boolean allowSessionCreation) { return mockWrappedSession; } @@ -187,7 +189,8 @@ public class VaadinSessionTest implements Serializable { } }); - session.valueUnbound(EasyMock.createMock(HttpSessionBindingEvent.class)); + session.valueUnbound( + EasyMock.createMock(HttpSessionBindingEvent.class)); mockService.runPendingAccessTasks(session); // as soon as we changed // session.accessSynchronously // to session.access in @@ -227,19 +230,19 @@ public class VaadinSessionTest implements Serializable { public void testValueUnbound() { MockVaadinSession vaadinSession = new MockVaadinSession(mockService); - vaadinSession.valueUnbound(EasyMock - .createMock(HttpSessionBindingEvent.class)); + vaadinSession.valueUnbound( + EasyMock.createMock(HttpSessionBindingEvent.class)); org.junit.Assert.assertEquals( - "'valueUnbound' method doesn't call 'close' for the session", - 1, vaadinSession.getCloseCount()); + "'valueUnbound' method doesn't call 'close' for the session", 1, + vaadinSession.getCloseCount()); - vaadinSession.valueUnbound(EasyMock - .createMock(HttpSessionBindingEvent.class)); + vaadinSession.valueUnbound( + EasyMock.createMock(HttpSessionBindingEvent.class)); org.junit.Assert.assertEquals( "'valueUnbound' method may not call 'close' " - + "method for closing session", 1, - vaadinSession.getCloseCount()); + + "method for closing session", + 1, vaadinSession.getCloseCount()); } // Can't define as an anonymous class since it would have a reference to @@ -264,8 +267,8 @@ public class VaadinSessionTest implements Serializable { private static class SerializationTestLabel extends Label { private transient VaadinSession session = VaadinSession.getCurrent(); - private void readObject(ObjectInputStream in) throws IOException, - ClassNotFoundException { + private void readObject(ObjectInputStream in) + throws IOException, ClassNotFoundException { in.defaultReadObject(); session = VaadinSession.getCurrent(); } @@ -291,13 +294,12 @@ public class VaadinSessionTest implements Serializable { CurrentInstance.clearAll(); - ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream( - bos.toByteArray())); + ObjectInputStream in = new ObjectInputStream( + new ByteArrayInputStream(bos.toByteArray())); VaadinSession deserializedSession = (VaadinSession) in.readObject(); - Assert.assertNull( - "Current session shouldn't leak from deserialisation", + Assert.assertNull("Current session shouldn't leak from deserialisation", VaadinSession.getCurrent()); Assert.assertNotSame("Should get a new session", session, @@ -323,7 +325,8 @@ public class VaadinSessionTest implements Serializable { final AtomicBoolean lockChecked = new AtomicBoolean(false); ui.setContent(new Label() { - private void writeObject(ObjectOutputStream out) throws IOException { + private void writeObject(ObjectOutputStream out) + throws IOException { Assert.assertTrue(session.hasLock()); lockChecked.set(true); out.defaultWriteObject(); diff --git a/server/src/test/java/com/vaadin/server/VaadinWebSpherePortalRequestTest.java b/server/src/test/java/com/vaadin/server/VaadinWebSpherePortalRequestTest.java index 3a4c5c69be..a708f107f1 100644 --- a/server/src/test/java/com/vaadin/server/VaadinWebSpherePortalRequestTest.java +++ b/server/src/test/java/com/vaadin/server/VaadinWebSpherePortalRequestTest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/server/src/test/java/com/vaadin/server/communication/AtmospherePushConnectionTest.java b/server/src/test/java/com/vaadin/server/communication/AtmospherePushConnectionTest.java index a1a833e8af..d3362dc727 100644 --- a/server/src/test/java/com/vaadin/server/communication/AtmospherePushConnectionTest.java +++ b/server/src/test/java/com/vaadin/server/communication/AtmospherePushConnectionTest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/server/src/test/java/com/vaadin/server/communication/FileUploadHandlerTest.java b/server/src/test/java/com/vaadin/server/communication/FileUploadHandlerTest.java index 286163541e..5991d3e7ad 100644 --- a/server/src/test/java/com/vaadin/server/communication/FileUploadHandlerTest.java +++ b/server/src/test/java/com/vaadin/server/communication/FileUploadHandlerTest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -41,14 +41,22 @@ import com.vaadin.ui.UI; public class FileUploadHandlerTest { private FileUploadHandler handler; - @Mock private VaadinResponse response; - @Mock private StreamVariable streamVariable; - @Mock private ClientConnector clientConnector; - @Mock private VaadinRequest request; - @Mock private UI ui; - @Mock private ConnectorTracker connectorTracker; - @Mock private VaadinSession session; - @Mock private OutputStream responseOutput; + @Mock + private VaadinResponse response; + @Mock + private StreamVariable streamVariable; + @Mock + private ClientConnector clientConnector; + @Mock + private VaadinRequest request; + @Mock + private UI ui; + @Mock + private ConnectorTracker connectorTracker; + @Mock + private VaadinSession session; + @Mock + private OutputStream responseOutput; private int uiId = 123; private final String connectorId = "connectorId"; @@ -66,18 +74,24 @@ public class FileUploadHandlerTest { mockUi(); when(clientConnector.isConnectorEnabled()).thenReturn(true); - when(streamVariable.getOutputStream()).thenReturn(mock(OutputStream.class)); + when(streamVariable.getOutputStream()) + .thenReturn(mock(OutputStream.class)); when(response.getOutputStream()).thenReturn(responseOutput); } private void mockConnectorTracker() { - when(connectorTracker.getSeckey(streamVariable)).thenReturn(expectedSecurityKey); - when(connectorTracker.getStreamVariable(connectorId, variableName)).thenReturn(streamVariable); - when(connectorTracker.getConnector(connectorId)).thenReturn(clientConnector); + when(connectorTracker.getSeckey(streamVariable)) + .thenReturn(expectedSecurityKey); + when(connectorTracker.getStreamVariable(connectorId, variableName)) + .thenReturn(streamVariable); + when(connectorTracker.getConnector(connectorId)) + .thenReturn(clientConnector); } private void mockRequest() throws IOException { - when(request.getPathInfo()).thenReturn("/" + ServletPortletHelper.UPLOAD_URL_PREFIX + uiId + "/"+ connectorId + "/" + variableName + "/" + expectedSecurityKey); + when(request.getPathInfo()).thenReturn("/" + + ServletPortletHelper.UPLOAD_URL_PREFIX + uiId + "/" + + connectorId + "/" + variableName + "/" + expectedSecurityKey); when(request.getInputStream()).thenReturn(createInputStream("foobar")); when(request.getHeader("Content-Length")).thenReturn("6"); when(request.getContentType()).thenReturn("foobar"); @@ -90,11 +104,12 @@ public class FileUploadHandlerTest { @Override public int read() throws IOException { - if(counter > msg.length + 1) { - throw new AssertionError("-1 was ignored by FileUploadHandler."); + if (counter > msg.length + 1) { + throw new AssertionError( + "-1 was ignored by FileUploadHandler."); } - if(counter >= msg.length) { + if (counter >= msg.length) { counter++; return -1; } @@ -110,7 +125,8 @@ public class FileUploadHandlerTest { } /** - * Tests whether we get infinite loop if InputStream is already read (#10096) + * Tests whether we get infinite loop if InputStream is already read + * (#10096) */ @Test(expected = IOException.class) public void exceptionIsThrownOnUnexpectedEnd() throws IOException { @@ -123,7 +139,8 @@ public class FileUploadHandlerTest { @Test public void responseIsSentOnCorrectSecurityKey() throws IOException { - when(connectorTracker.getSeckey(streamVariable)).thenReturn(expectedSecurityKey); + when(connectorTracker.getSeckey(streamVariable)) + .thenReturn(expectedSecurityKey); handler.handleRequest(session, request, response); @@ -132,7 +149,8 @@ public class FileUploadHandlerTest { @Test public void responseIsNotSentOnIncorrectSecurityKey() throws IOException { - when(connectorTracker.getSeckey(streamVariable)).thenReturn("another key expected"); + when(connectorTracker.getSeckey(streamVariable)) + .thenReturn("another key expected"); handler.handleRequest(session, request, response); diff --git a/server/src/test/java/com/vaadin/server/communication/MetadataWriterTest.java b/server/src/test/java/com/vaadin/server/communication/MetadataWriterTest.java index afae14007e..f4ca05b6d5 100644 --- a/server/src/test/java/com/vaadin/server/communication/MetadataWriterTest.java +++ b/server/src/test/java/com/vaadin/server/communication/MetadataWriterTest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -62,15 +62,15 @@ public class MetadataWriterTest { @Test public void writeRepaintTag() throws Exception { new MetadataWriter().write(ui, writer, true, false, messages); - Assert.assertEquals("{\"repaintAll\":true}", writer.getBuffer() - .toString()); + Assert.assertEquals("{\"repaintAll\":true}", + writer.getBuffer().toString()); } @Test public void writeRepaintAndAsyncTag() throws Exception { new MetadataWriter().write(ui, writer, true, true, messages); - Assert.assertEquals("{\"repaintAll\":true, \"async\":true}", writer - .getBuffer().toString()); + Assert.assertEquals("{\"repaintAll\":true, \"async\":true}", + writer.getBuffer().toString()); } @Test @@ -90,8 +90,8 @@ public class MetadataWriterTest { new MetadataWriter().write(ui, writer, false, false, messages); Assert.assertEquals( - "{\"timedRedirect\":{\"interval\":15,\"url\":\"\"}}", writer - .getBuffer().toString()); + "{\"timedRedirect\":{\"interval\":15,\"url\":\"\"}}", + writer.getBuffer().toString()); } @Test diff --git a/server/src/test/java/com/vaadin/tests/CompileTransitionPropertyTest.java b/server/src/test/java/com/vaadin/tests/CompileTransitionPropertyTest.java index 337ce19a06..4ae545f60e 100644 --- a/server/src/test/java/com/vaadin/tests/CompileTransitionPropertyTest.java +++ b/server/src/test/java/com/vaadin/tests/CompileTransitionPropertyTest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/server/src/test/java/com/vaadin/tests/VaadinClasses.java b/server/src/test/java/com/vaadin/tests/VaadinClasses.java index b5933bbd10..a68085bcbe 100644 --- a/server/src/test/java/com/vaadin/tests/VaadinClasses.java +++ b/server/src/test/java/com/vaadin/tests/VaadinClasses.java @@ -83,8 +83,8 @@ public class VaadinClasses { public static List> getAllServerSideClasses() { try { - return findClassesNoTests(Object.class, "com.vaadin", new String[] { - "com.vaadin.tests", "com.vaadin.client" }); + return findClassesNoTests(Object.class, "com.vaadin", + new String[] { "com.vaadin.tests", "com.vaadin.client" }); } catch (IOException e) { e.printStackTrace(); return null; @@ -126,7 +126,8 @@ public class VaadinClasses { try { // Given as name to avoid dependencies on testbench source folder return (List) findClasses( - Class.forName("com.vaadin.tests.components.AbstractComponentTest"), + Class.forName( + "com.vaadin.tests.components.AbstractComponentTest"), "com.vaadin.tests.components"); } catch (Exception e) { e.printStackTrace(); @@ -149,8 +150,8 @@ public class VaadinClasses { try { File f = new File(location.toURI()); if (!f.exists()) { - throw new IOException("Directory " + f.toString() - + " does not exist"); + throw new IOException( + "Directory " + f.toString() + " does not exist"); } findPackages(f, basePackage, baseClass, classes, ignoredPackages); diff --git a/server/src/test/java/com/vaadin/tests/components/draganddropwrapper/DragAndDropWrapperDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/components/draganddropwrapper/DragAndDropWrapperDeclarativeTest.java index a590b3ec1f..bd0eebd97e 100644 --- a/server/src/test/java/com/vaadin/tests/components/draganddropwrapper/DragAndDropWrapperDeclarativeTest.java +++ b/server/src/test/java/com/vaadin/tests/components/draganddropwrapper/DragAndDropWrapperDeclarativeTest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -23,8 +23,8 @@ import com.vaadin.ui.DragAndDropWrapper; import com.vaadin.ui.DragAndDropWrapper.DragStartMode; import com.vaadin.ui.declarative.DesignContext; -public class DragAndDropWrapperDeclarativeTest extends - DeclarativeTestBase { +public class DragAndDropWrapperDeclarativeTest + extends DeclarativeTestBase { @Test public void testDefaultDnDWrapper() { @@ -55,8 +55,8 @@ public class DragAndDropWrapperDeclarativeTest extends Button okButton = new Button("OK"); String input = "" + new DesignContext().createElement(okButton) - + new DesignContext().createElement(dragImage).attr( - ":drag-image", true) + + new DesignContext().createElement(dragImage) + .attr(":drag-image", true) + ""; DragAndDropWrapper wrapper = new DragAndDropWrapper(okButton); wrapper.setDragStartMode(DragStartMode.COMPONENT_OTHER); diff --git a/server/src/test/java/com/vaadin/tests/components/menubar/MenuBarDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/components/menubar/MenuBarDeclarativeTest.java index 321d41152b..79ce622816 100644 --- a/server/src/test/java/com/vaadin/tests/components/menubar/MenuBarDeclarativeTest.java +++ b/server/src/test/java/com/vaadin/tests/components/menubar/MenuBarDeclarativeTest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -29,7 +29,7 @@ import com.vaadin.ui.MenuBar.MenuItem; /** * Tests declarative support for menu bars. - * + * * @since 7.4 * @author Vaadin Ltd */ @@ -54,8 +54,8 @@ public class MenuBarDeclarativeTest extends DeclarativeTestBase { bar.addItem("Save", null).setCheckable(true); bar.addItem("Open", null).setDescription("Open a file"); bar.addItem("Close", null).setEnabled(false); - bar.addItem("Help", null).setIcon( - new ExternalResource("http://foo.bar/ico.png")); + bar.addItem("Help", null) + .setIcon(new ExternalResource("http://foo.bar/ico.png")); bar.addItem("About", null).setVisible(false); bar.addItem("Sub", null).addItem("Item", null); @@ -70,13 +70,10 @@ public class MenuBarDeclarativeTest extends DeclarativeTestBase { // #16328 public void testTicketSpec1() throws IOException { String design = " " - + "File" - + "Save" + + "File" + "Save" + "Open" - + "" - + "Exit" - + "Not for everybody" - + "" + + "" + "Exit" + + "Not for everybody" + "" + "Other" + "Sub" + "Option 1 - no html" @@ -95,8 +92,8 @@ public class MenuBarDeclarativeTest extends DeclarativeTestBase { // File menu MenuItem fileMenu = menuBar.addItem("File", null); fileMenu.addItem("Save", null); - fileMenu.addItem("Open", new ThemeResource( - "../runo/icons/16/folder.png"), null); + fileMenu.addItem("Open", + new ThemeResource("../runo/icons/16/folder.png"), null); fileMenu.addSeparator(); fileMenu.addItem("Exit", null).setEnabled(false); fileMenu.addItem("Not for everybody", null).setVisible(false); @@ -120,8 +117,7 @@ public class MenuBarDeclarativeTest extends DeclarativeTestBase { @Test // #16328 public void testTicketSpec2() throws IOException { - String design = "" - + "File" + String design = "" + "File" + "Save" + "Open" + "" + "Exit" // @@ -130,8 +126,8 @@ public class MenuBarDeclarativeTest extends DeclarativeTestBase { menuBar.setHtmlContentAllowed(true); MenuItem fileMenu = menuBar.addItem("File", null); fileMenu.addItem("Save", null); - fileMenu.addItem("Open", new ThemeResource( - "../runo/icons/16/folder.png"), null); + fileMenu.addItem("Open", + new ThemeResource("../runo/icons/16/folder.png"), null); fileMenu.addSeparator(); fileMenu.addItem("Exit", null).setEnabled(false); testRead(design, menuBar); diff --git a/server/src/test/java/com/vaadin/tests/data/bean/Country.java b/server/src/test/java/com/vaadin/tests/data/bean/Country.java index afdf8dcfa1..159333212f 100644 --- a/server/src/test/java/com/vaadin/tests/data/bean/Country.java +++ b/server/src/test/java/com/vaadin/tests/data/bean/Country.java @@ -2,8 +2,8 @@ package com.vaadin.tests.data.bean; public enum Country { - FINLAND("Finland"), SWEDEN("Sweden"), USA("USA"), RUSSIA("Russia"), NETHERLANDS( - "Netherlands"), SOUTH_AFRICA("South Africa"); + FINLAND("Finland"), SWEDEN("Sweden"), USA("USA"), RUSSIA( + "Russia"), NETHERLANDS("Netherlands"), SOUTH_AFRICA("South Africa"); private String name; diff --git a/server/src/test/java/com/vaadin/tests/data/bean/Person.java b/server/src/test/java/com/vaadin/tests/data/bean/Person.java index f7bad31d0e..00d28a1cd8 100644 --- a/server/src/test/java/com/vaadin/tests/data/bean/Person.java +++ b/server/src/test/java/com/vaadin/tests/data/bean/Person.java @@ -136,8 +136,8 @@ public class Person { } public static Person createTestPerson2() { - return new Person("Maya", "Dinkelstein", "maya@foo.bar", 18, - Sex.FEMALE, new Address("Red street", 12, "Amsterdam", + return new Person("Maya", "Dinkelstein", "maya@foo.bar", 18, Sex.FEMALE, + new Address("Red street", 12, "Amsterdam", Country.NETHERLANDS)); } } diff --git a/server/src/test/java/com/vaadin/tests/data/converter/AnyEnumToStringConverterTest.java b/server/src/test/java/com/vaadin/tests/data/converter/AnyEnumToStringConverterTest.java index 83b4abad3f..2575b27074 100644 --- a/server/src/test/java/com/vaadin/tests/data/converter/AnyEnumToStringConverterTest.java +++ b/server/src/test/java/com/vaadin/tests/data/converter/AnyEnumToStringConverterTest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -99,8 +99,8 @@ public class AnyEnumToStringConverterTest { public void stringToEnumConversion() { Assert.assertEquals(TestEnum.TWO, converter.convertToPresentation( TestEnum.TWO.toString(), TestEnum.class, null)); - Assert.assertEquals(AnotherTestEnum.TWO, converter - .convertToPresentation(AnotherTestEnum.TWO.toString(), + Assert.assertEquals(AnotherTestEnum.TWO, + converter.convertToPresentation(AnotherTestEnum.TWO.toString(), AnotherTestEnum.class, null)); } @@ -113,15 +113,16 @@ public class AnyEnumToStringConverterTest { tf.setValue(AnotherTestEnum.ONE.toString()); Assert.assertEquals(AnotherTestEnum.ONE.toString(), tf.getValue()); Assert.assertEquals(AnotherTestEnum.ONE, tf.getConvertedValue()); - Assert.assertEquals(AnotherTestEnum.ONE, tf.getPropertyDataSource() - .getValue()); + Assert.assertEquals(AnotherTestEnum.ONE, + tf.getPropertyDataSource().getValue()); tf.setPropertyDataSource(new ObjectProperty(TestEnum.TWO)); Assert.assertEquals(TestEnum.TWO.toString(), tf.getValue()); tf.setValue(TestEnum.ONE.toString()); Assert.assertEquals(TestEnum.ONE.toString(), tf.getValue()); Assert.assertEquals(TestEnum.ONE, tf.getConvertedValue()); - Assert.assertEquals(TestEnum.ONE, tf.getPropertyDataSource().getValue()); + Assert.assertEquals(TestEnum.ONE, + tf.getPropertyDataSource().getValue()); } } diff --git a/server/src/test/java/com/vaadin/tests/data/converter/ConverterFactoryTest.java b/server/src/test/java/com/vaadin/tests/data/converter/ConverterFactoryTest.java index 766c2309a0..4f06a576f4 100644 --- a/server/src/test/java/com/vaadin/tests/data/converter/ConverterFactoryTest.java +++ b/server/src/test/java/com/vaadin/tests/data/converter/ConverterFactoryTest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/server/src/test/java/com/vaadin/tests/data/converter/DateToLongConverterTest.java b/server/src/test/java/com/vaadin/tests/data/converter/DateToLongConverterTest.java index 02b36d3e4a..3b33895e3e 100644 --- a/server/src/test/java/com/vaadin/tests/data/converter/DateToLongConverterTest.java +++ b/server/src/test/java/com/vaadin/tests/data/converter/DateToLongConverterTest.java @@ -21,7 +21,8 @@ public class DateToLongConverterTest { public void testValueConversion() { Date d = new Date(100, 0, 1); Assert.assertEquals( - Long.valueOf(946677600000l + (d.getTimezoneOffset() + 120) * 60 * 1000L), + Long.valueOf(946677600000l + + (d.getTimezoneOffset() + 120) * 60 * 1000L), converter.convertToModel(d, Long.class, null)); } } diff --git a/server/src/test/java/com/vaadin/tests/data/converter/DefaultConverterFactoryTest.java b/server/src/test/java/com/vaadin/tests/data/converter/DefaultConverterFactoryTest.java index 2bbcf43e2d..9849b5a6b0 100644 --- a/server/src/test/java/com/vaadin/tests/data/converter/DefaultConverterFactoryTest.java +++ b/server/src/test/java/com/vaadin/tests/data/converter/DefaultConverterFactoryTest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -62,8 +62,8 @@ public class DefaultConverterFactoryTest { @SuppressWarnings("deprecation") @Test public void stringToDate() { - assertConverter("Oct 12, 2014 12:00:00 AM", new Date(2014 - 1900, - 10 - 1, 12)); + assertConverter("Oct 12, 2014 12:00:00 AM", + new Date(2014 - 1900, 10 - 1, 12)); } @Test @@ -105,25 +105,19 @@ public class DefaultConverterFactoryTest { U tConvertedToU = factory.createConverter(tClass, uClass) .convertToModel(t, uClass, Locale.ENGLISH); - Assert.assertEquals( - "Incorrect type of value converted from " - + tClass.getSimpleName() + " to " - + uClass.getSimpleName(), uClass, - tConvertedToU.getClass()); - Assert.assertEquals( - "Incorrect conversion of " + t + " to " - + uClass.getSimpleName(), u, tConvertedToU); + Assert.assertEquals("Incorrect type of value converted from " + + tClass.getSimpleName() + " to " + uClass.getSimpleName(), + uClass, tConvertedToU.getClass()); + Assert.assertEquals("Incorrect conversion of " + t + " to " + + uClass.getSimpleName(), u, tConvertedToU); T uConvertedToT = factory.createConverter(uClass, tClass) .convertToModel(u, tClass, Locale.ENGLISH); - Assert.assertEquals( - "Incorrect type of value converted from " - + uClass.getSimpleName() + " to " - + tClass.getSimpleName(), tClass, - uConvertedToT.getClass()); - Assert.assertEquals( - "Incorrect conversion of " + u + " to " - + tClass.getSimpleName(), t, uConvertedToT); + Assert.assertEquals("Incorrect type of value converted from " + + uClass.getSimpleName() + " to " + tClass.getSimpleName(), + tClass, uConvertedToT.getClass()); + Assert.assertEquals("Incorrect conversion of " + u + " to " + + tClass.getSimpleName(), t, uConvertedToT); } diff --git a/server/src/test/java/com/vaadin/tests/data/converter/SpecificEnumToStringConverterTest.java b/server/src/test/java/com/vaadin/tests/data/converter/SpecificEnumToStringConverterTest.java index 377998db1e..bb60a6a472 100644 --- a/server/src/test/java/com/vaadin/tests/data/converter/SpecificEnumToStringConverterTest.java +++ b/server/src/test/java/com/vaadin/tests/data/converter/SpecificEnumToStringConverterTest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -31,8 +31,8 @@ import com.vaadin.ui.TextField; public class SpecificEnumToStringConverterTest { - public class SpecificEnumToStringConverter implements - Converter { + public class SpecificEnumToStringConverter + implements Converter { private Class enumClass; @@ -104,9 +104,9 @@ public class SpecificEnumToStringConverterTest { @Test public void stringToEnumConversion() { - Assert.assertEquals(TestEnum.TWO, testEnumConverter - .convertToPresentation(TestEnum.TWO.toString(), TestEnum.class, - null)); + Assert.assertEquals(TestEnum.TWO, + testEnumConverter.convertToPresentation(TestEnum.TWO.toString(), + TestEnum.class, null)); } @Test @@ -118,8 +118,8 @@ public class SpecificEnumToStringConverterTest { tf.setValue(AnotherTestEnum.ONE.toString()); Assert.assertEquals(AnotherTestEnum.ONE.toString(), tf.getValue()); Assert.assertEquals(AnotherTestEnum.ONE, tf.getConvertedValue()); - Assert.assertEquals(AnotherTestEnum.ONE, tf.getPropertyDataSource() - .getValue()); + Assert.assertEquals(AnotherTestEnum.ONE, + tf.getPropertyDataSource().getValue()); } } diff --git a/server/src/test/java/com/vaadin/tests/data/converter/StringToBigDecimalConverterTest.java b/server/src/test/java/com/vaadin/tests/data/converter/StringToBigDecimalConverterTest.java index 48ebebdaff..925cf5eeee 100644 --- a/server/src/test/java/com/vaadin/tests/data/converter/StringToBigDecimalConverterTest.java +++ b/server/src/test/java/com/vaadin/tests/data/converter/StringToBigDecimalConverterTest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/server/src/test/java/com/vaadin/tests/data/converter/StringToBigIntegerConverterTest.java b/server/src/test/java/com/vaadin/tests/data/converter/StringToBigIntegerConverterTest.java index 312595746d..6b87b47417 100644 --- a/server/src/test/java/com/vaadin/tests/data/converter/StringToBigIntegerConverterTest.java +++ b/server/src/test/java/com/vaadin/tests/data/converter/StringToBigIntegerConverterTest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 diff --git a/server/src/test/java/com/vaadin/tests/data/converter/StringToBooleanConverterTest.java b/server/src/test/java/com/vaadin/tests/data/converter/StringToBooleanConverterTest.java index ea5af1efd9..ed26b478b2 100644 --- a/server/src/test/java/com/vaadin/tests/data/converter/StringToBooleanConverterTest.java +++ b/server/src/test/java/com/vaadin/tests/data/converter/StringToBooleanConverterTest.java @@ -18,17 +18,19 @@ public class StringToBooleanConverterTest { @Override public String getFalseString(Locale locale) { Date d = new Date(3000000000000L); - return SimpleDateFormat.getDateInstance(SimpleDateFormat.LONG, - locale).format( - d.getTime() + (d.getTimezoneOffset() + 120) * 60 * 1000L); + return SimpleDateFormat + .getDateInstance(SimpleDateFormat.LONG, locale) + .format(d.getTime() + + (d.getTimezoneOffset() + 120) * 60 * 1000L); } @Override public String getTrueString(Locale locale) { Date d = new Date(2000000000000L); - return SimpleDateFormat.getDateInstance(SimpleDateFormat.LONG, - locale).format( - d.getTime() + (d.getTimezoneOffset() + 120) * 60 * 1000L); + return SimpleDateFormat + .getDateInstance(SimpleDateFormat.LONG, locale) + .format(d.getTime() + + (d.getTimezoneOffset() + 120) * 60 * 1000L); } }; @@ -46,22 +48,23 @@ public class StringToBooleanConverterTest { @Test public void testValueConversion() { - Assert.assertTrue(converter.convertToModel("true", Boolean.class, null)); - Assert.assertFalse(converter.convertToModel("false", Boolean.class, - null)); + Assert.assertTrue( + converter.convertToModel("true", Boolean.class, null)); + Assert.assertFalse( + converter.convertToModel("false", Boolean.class, null)); } @Test public void testYesNoValueConversion() { - Assert.assertTrue(yesNoConverter.convertToModel("yes", Boolean.class, - null)); - Assert.assertFalse(yesNoConverter.convertToModel("no", Boolean.class, - null)); + Assert.assertTrue( + yesNoConverter.convertToModel("yes", Boolean.class, null)); + Assert.assertFalse( + yesNoConverter.convertToModel("no", Boolean.class, null)); Assert.assertEquals("yes", yesNoConverter.convertToPresentation(true, String.class, null)); - Assert.assertEquals("no", - yesNoConverter.convertToPresentation(false, String.class, null)); + Assert.assertEquals("no", yesNoConverter.convertToPresentation(false, + String.class, null)); } @Test diff --git a/server/src/test/java/com/vaadin/tests/data/converter/StringToByteConverterTest.java b/server/src/test/java/com/vaadin/tests/data/converter/StringToByteConverterTest.java index 2de72093d8..569cba8ba5 100644 --- a/server/src/test/java/com/vaadin/tests/data/converter/StringToByteConverterTest.java +++ b/server/src/test/java/com/vaadin/tests/data/converter/StringToByteConverterTest.java @@ -23,7 +23,8 @@ public class StringToByteConverterTest { @Test public void testReverseNullConversion() { Assert.assertEquals("Null value reversely was converted incorrectly", - null, reverseConverter.convertToModel(null, String.class, null)); + null, + reverseConverter.convertToModel(null, String.class, null)); } @Test diff --git a/server/src/test/java/com/vaadin/tests/data/converter/StringToCollectionConverterTest.java b/server/src/test/java/com/vaadin/tests/data/converter/StringToCollectionConverterTest.java index 4f2dc1df81..f16a984972 100644 --- a/server/src/test/java/com/vaadin/tests/data/converter/StringToCollectionConverterTest.java +++ b/server/src/test/java/com/vaadin/tests/data/converter/StringToCollectionConverterTest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -36,7 +36,7 @@ import com.vaadin.data.util.converter.StringToIntegerConverter; /** * Tests for {@link StringToCollectionConverter}. - * + * * @author Vaadin Ltd */ public class StringToCollectionConverterTest { @@ -83,8 +83,8 @@ public class StringToCollectionConverterTest { public void convertToModel_setAsCollection() { StringToCollectionConverter converter = new StringToCollectionConverter( " ", new StringToEnumConverter(), TestEnum.class); - Collection model = converter - .convertToModel("Z X Y", Set.class, null); + Collection model = converter.convertToModel("Z X Y", Set.class, + null); Assert.assertTrue("Unexpected model class", model instanceof HashSet); EnumSet set = EnumSet.allOf(TestEnum.class); set.removeAll(model); diff --git a/server/src/test/java/com/vaadin/tests/data/converter/StringToEnumConverterTest.java b/server/src/test/java/com/vaadin/tests/data/converter/StringToEnumConverterTest.java index 6660ecc9d5..0b231fc971 100644 --- a/server/src/test/java/com/vaadin/tests/data/converter/StringToEnumConverterTest.java +++ b/server/src/test/java/com/vaadin/tests/data/converter/StringToEnumConverterTest.java @@ -82,26 +82,26 @@ public class StringToEnumConverterTest { converter.convertToModel("Foo bar baz", FooEnum.class, null)); Assert.assertEquals(FooEnum.Bar, converter.convertToModel("Bar", FooEnum.class, null)); - Assert.assertEquals(FooEnum.nonStandardCase, converter.convertToModel( - "Nonstandardcase", FooEnum.class, null)); + Assert.assertEquals(FooEnum.nonStandardCase, converter + .convertToModel("Nonstandardcase", FooEnum.class, null)); Assert.assertEquals(FooEnum._HUGH, converter.convertToModel("_hugh", FooEnum.class, null)); } @Test public void testReverseValueConversion() { - Assert.assertEquals("Value1", reverseConverter.convertToModel( - FooEnum.VALUE1, String.class, null)); - Assert.assertEquals("Some value", reverseConverter.convertToModel( - FooEnum.SOME_VALUE, String.class, null)); - Assert.assertEquals("Foo bar baz", reverseConverter.convertToModel( - FooEnum.FOO_BAR_BAZ, String.class, null)); + Assert.assertEquals("Value1", reverseConverter + .convertToModel(FooEnum.VALUE1, String.class, null)); + Assert.assertEquals("Some value", reverseConverter + .convertToModel(FooEnum.SOME_VALUE, String.class, null)); + Assert.assertEquals("Foo bar baz", reverseConverter + .convertToModel(FooEnum.FOO_BAR_BAZ, String.class, null)); Assert.assertEquals("Bar", reverseConverter.convertToModel(FooEnum.Bar, String.class, null)); - Assert.assertEquals("Nonstandardcase", reverseConverter.convertToModel( - FooEnum.nonStandardCase, String.class, null)); - Assert.assertEquals("_hugh", reverseConverter.convertToModel( - FooEnum._HUGH, String.class, null)); + Assert.assertEquals("Nonstandardcase", reverseConverter + .convertToModel(FooEnum.nonStandardCase, String.class, null)); + Assert.assertEquals("_hugh", reverseConverter + .convertToModel(FooEnum._HUGH, String.class, null)); } diff --git a/server/src/test/java/com/vaadin/tests/data/converter/StringToShortConverterTest.java b/server/src/test/java/com/vaadin/tests/data/converter/StringToShortConverterTest.java index 3faa65c863..ce763cf3c8 100644 --- a/server/src/test/java/com/vaadin/tests/data/converter/StringToShortConverterTest.java +++ b/server/src/test/java/com/vaadin/tests/data/converter/StringToShortConverterTest.java @@ -23,7 +23,8 @@ public class StringToShortConverterTest { @Test public void testReverseNullConversion() { Assert.assertEquals("Null value reversely was converted incorrectly", - null, reverseConverter.convertToModel(null, String.class, null)); + null, + reverseConverter.convertToModel(null, String.class, null)); } @Test @@ -41,8 +42,7 @@ public class StringToShortConverterTest { @Test public void testReverseValueConversion() { - Assert.assertEquals( - "Short value reversely was converted incorrectly", + Assert.assertEquals("Short value reversely was converted incorrectly", reverseConverter.convertToModel((short) 10, String.class, null), "10"); } diff --git a/server/src/test/java/com/vaadin/tests/data/validator/ByteRangeValidatorTest.java b/server/src/test/java/com/vaadin/tests/data/validator/ByteRangeValidatorTest.java index 203c7847e9..5f1525c4de 100644 --- a/server/src/test/java/com/vaadin/tests/data/validator/ByteRangeValidatorTest.java +++ b/server/src/test/java/com/vaadin/tests/data/validator/ByteRangeValidatorTest.java @@ -30,7 +30,8 @@ public class ByteRangeValidatorTest { public void testMinValue() { assertTrue("Validator without ranges didn't accept value", cleanValidator.isValid((byte) -15)); - assertTrue("Didn't accept valid value", minValidator.isValid((byte) 15)); + assertTrue("Didn't accept valid value", + minValidator.isValid((byte) 15)); assertFalse("Accepted too small value", minValidator.isValid((byte) 9)); } @@ -38,7 +39,8 @@ public class ByteRangeValidatorTest { public void testMaxValue() { assertTrue("Validator without ranges didn't accept value", cleanValidator.isValid((byte) 112)); - assertTrue("Didn't accept valid value", maxValidator.isValid((byte) 15)); + assertTrue("Didn't accept valid value", + maxValidator.isValid((byte) 15)); assertFalse("Accepted too large value", maxValidator.isValid((byte) 120)); } diff --git a/server/src/test/java/com/vaadin/tests/data/validator/FloatRangeValidatorTest.java b/server/src/test/java/com/vaadin/tests/data/validator/FloatRangeValidatorTest.java index db4b73fd1b..2292028e0e 100644 --- a/server/src/test/java/com/vaadin/tests/data/validator/FloatRangeValidatorTest.java +++ b/server/src/test/java/com/vaadin/tests/data/validator/FloatRangeValidatorTest.java @@ -45,8 +45,10 @@ public class FloatRangeValidatorTest { @Test public void testMinMaxValue() { assertTrue("Didn't accept valid value", minMaxValidator.isValid(10.5f)); - assertTrue("Didn't accept valid value", minMaxValidator.isValid(100.5f)); + assertTrue("Didn't accept valid value", + minMaxValidator.isValid(100.5f)); assertFalse("Accepted too small value", minMaxValidator.isValid(10.4f)); - assertFalse("Accepted too large value", minMaxValidator.isValid(100.6f)); + assertFalse("Accepted too large value", + minMaxValidator.isValid(100.6f)); } } diff --git a/server/src/test/java/com/vaadin/tests/data/validator/ShortRangeValidatorTest.java b/server/src/test/java/com/vaadin/tests/data/validator/ShortRangeValidatorTest.java index d3534ebe97..51ac6f1a13 100644 --- a/server/src/test/java/com/vaadin/tests/data/validator/ShortRangeValidatorTest.java +++ b/server/src/test/java/com/vaadin/tests/data/validator/ShortRangeValidatorTest.java @@ -32,7 +32,8 @@ public class ShortRangeValidatorTest { cleanValidator.isValid((short) -15)); assertTrue("Didn't accept valid value", minValidator.isValid((short) 15)); - assertFalse("Accepted too small value", minValidator.isValid((short) 9)); + assertFalse("Accepted too small value", + minValidator.isValid((short) 9)); } @Test diff --git a/server/src/test/java/com/vaadin/tests/data/validator/StringLengthValidatorTest.java b/server/src/test/java/com/vaadin/tests/data/validator/StringLengthValidatorTest.java index de925f479f..ee7a3784df 100644 --- a/server/src/test/java/com/vaadin/tests/data/validator/StringLengthValidatorTest.java +++ b/server/src/test/java/com/vaadin/tests/data/validator/StringLengthValidatorTest.java @@ -9,7 +9,8 @@ import com.vaadin.data.validator.StringLengthValidator; public class StringLengthValidatorTest { - private StringLengthValidator validator = new StringLengthValidator("Error"); + private StringLengthValidator validator = new StringLengthValidator( + "Error"); private StringLengthValidator validatorNoNull = new StringLengthValidator( "Error", 1, 5, false); private StringLengthValidator validatorMinValue = new StringLengthValidator( @@ -48,16 +49,16 @@ public class StringLengthValidatorTest { @Test public void testNoUpperBound() { - assertTrue( - "String not accepted even though no upper bound", - validatorMinValue - .isValid("This is a really long string to test that no upper bound exists")); + assertTrue("String not accepted even though no upper bound", + validatorMinValue.isValid( + "This is a really long string to test that no upper bound exists")); } @Test public void testNoLowerBound() { assertTrue("Didn't accept short string", validatorMaxValue.isValid("")); - assertTrue("Didn't accept short string", validatorMaxValue.isValid("1")); + assertTrue("Didn't accept short string", + validatorMaxValue.isValid("1")); } @Test diff --git a/server/src/test/java/com/vaadin/tests/design/AbstractComponentSetResponsiveTest.java b/server/src/test/java/com/vaadin/tests/design/AbstractComponentSetResponsiveTest.java index 175a03cd78..7e076e7b04 100644 --- a/server/src/test/java/com/vaadin/tests/design/AbstractComponentSetResponsiveTest.java +++ b/server/src/test/java/com/vaadin/tests/design/AbstractComponentSetResponsiveTest.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache 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 @@ -20,8 +20,8 @@ import org.junit.Test; import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.ui.Label; -public class AbstractComponentSetResponsiveTest extends - DeclarativeTestBase