diff options
author | Ilia Motornyi <elmot@vaadin.com> | 2018-04-19 15:14:53 +0300 |
---|---|---|
committer | Teemu Suo-Anttila <tsuoanttila@users.noreply.github.com> | 2018-04-19 15:14:53 +0300 |
commit | d543e47becc77e5b18c69a416e6e84122ac10fe1 (patch) | |
tree | 49b4e4e245319b0e93a4b1d3739096eb2d082eea | |
parent | bdbb0b4328a36a66bb492973ca72497bfd34f6ad (diff) | |
download | vaadin-framework-d543e47becc77e5b18c69a416e6e84122ac10fe1.tar.gz vaadin-framework-d543e47becc77e5b18c69a416e6e84122ac10fe1.zip |
Enable Maven plugin for Eclipse formatting (#10829)
191 files changed, 1000 insertions, 898 deletions
diff --git a/client/pom.xml b/client/pom.xml index 323a5b54aa..f44821fd6d 100644 --- a/client/pom.xml +++ b/client/pom.xml @@ -47,6 +47,15 @@ <build> <plugins> <plugin> + <groupId>net.revelc.code.formatter</groupId> + <artifactId>formatter-maven-plugin</artifactId> + </plugin> + <plugin> + <groupId>com.github.dantwining.whitespace-maven-plugin</groupId> + <artifactId>whitespace-maven-plugin</artifactId> + </plugin> + + <plugin> <artifactId>maven-resources-plugin</artifactId> <executions> <!-- Copy .java files to package --> diff --git a/client/src/main/java/com/vaadin/client/ApplicationConfiguration.java b/client/src/main/java/com/vaadin/client/ApplicationConfiguration.java index e9245deff4..1e234eab5e 100644 --- a/client/src/main/java/com/vaadin/client/ApplicationConfiguration.java +++ b/client/src/main/java/com/vaadin/client/ApplicationConfiguration.java @@ -147,17 +147,15 @@ public class ApplicationConfiguration implements EntryPoint { }-*/; /** - * Reads a configuration parameter as an {@link Element} object. - * Please note - * that the javascript value of the parameter should also be an Element - * object, - * or else an undefined exception may be thrown when calling this method - * or methods on the returned object. + * Reads a configuration parameter as an {@link Element} object. Please + * note that the javascript value of the parameter should also be an + * Element object, or else an undefined exception may be thrown when + * calling this method or methods on the returned object. * * @param name - * name of the configuration parameter - * @return element for the configuration parameter, or <code>null</code> if no - * value is defined + * name of the configuration parameter + * @return element for the configuration parameter, or <code>null</code> + * if no value is defined * @since 8.4 */ private native Element getConfigElement(String name) diff --git a/client/src/main/java/com/vaadin/client/ComputedStyle.java b/client/src/main/java/com/vaadin/client/ComputedStyle.java index 5be53155a3..fd137289cd 100644 --- a/client/src/main/java/com/vaadin/client/ComputedStyle.java +++ b/client/src/main/java/com/vaadin/client/ComputedStyle.java @@ -263,8 +263,8 @@ public class ComputedStyle { * * @param String * a value starting with a number - * @return the value from the string before any non-numeric characters. - * If the value cannot be parsed to a number, returns 0. + * @return the value from the string before any non-numeric characters. If + * the value cannot be parsed to a number, returns 0. */ private static native int parseIntNative(final String value) /*-{ diff --git a/client/src/main/java/com/vaadin/client/HasChildMeasurementHintConnector.java b/client/src/main/java/com/vaadin/client/HasChildMeasurementHintConnector.java index cec4092bc6..453f199465 100644 --- a/client/src/main/java/com/vaadin/client/HasChildMeasurementHintConnector.java +++ b/client/src/main/java/com/vaadin/client/HasChildMeasurementHintConnector.java @@ -41,9 +41,9 @@ public interface HasChildMeasurementHintConnector /** * Measure child component only if child component is an - * {@link com.vaadin.client.ui.AbstractLayoutConnector AbstractLayoutConnector} - * or implements either {@link ManagedLayout} or - * {@link ElementResizeListener}. + * {@link com.vaadin.client.ui.AbstractLayoutConnector + * AbstractLayoutConnector} or implements either {@link ManagedLayout} + * or {@link ElementResizeListener}. */ MEASURE_IF_NEEDED, diff --git a/client/src/main/java/com/vaadin/client/VErrorMessage.java b/client/src/main/java/com/vaadin/client/VErrorMessage.java index f888bf49bd..6e1d6c91ee 100644 --- a/client/src/main/java/com/vaadin/client/VErrorMessage.java +++ b/client/src/main/java/com/vaadin/client/VErrorMessage.java @@ -64,7 +64,7 @@ public class VErrorMessage extends FlowPanel { * all previous style names. * * @param errorLevel - * error level + * error level * @since 8.2 */ public void updateErrorLevel(ErrorLevel errorLevel) { diff --git a/client/src/main/java/com/vaadin/client/WidgetSet.java b/client/src/main/java/com/vaadin/client/WidgetSet.java index e40286bb63..ff84169b64 100644 --- a/client/src/main/java/com/vaadin/client/WidgetSet.java +++ b/client/src/main/java/com/vaadin/client/WidgetSet.java @@ -83,10 +83,9 @@ public class WidgetSet { return connector; } } catch (NoDataException e) { - throw new IllegalStateException( - "There is no information about " + classType - + ". Did you remember to compile the right widgetset?", - e); + throw new IllegalStateException("There is no information about " + + classType + + ". Did you remember to compile the right widgetset?", e); } finally { Profiler.leave("WidgetSet.createConnector"); } diff --git a/client/src/main/java/com/vaadin/client/WidgetUtil.java b/client/src/main/java/com/vaadin/client/WidgetUtil.java index 2bbed2b92f..7a05241dca 100644 --- a/client/src/main/java/com/vaadin/client/WidgetUtil.java +++ b/client/src/main/java/com/vaadin/client/WidgetUtil.java @@ -53,7 +53,7 @@ public class WidgetUtil { /** * Simple object to store another object. - * + * * @param <T> * the object type to store * @since 8.4 @@ -64,7 +64,7 @@ public class WidgetUtil { /** * Gets the current object. - * + * * @return the stored object */ public T get() { @@ -73,7 +73,7 @@ public class WidgetUtil { /** * Sets the current object. - * + * * @param reference * the object to store */ @@ -809,7 +809,7 @@ public class WidgetUtil { com.google.gwt.dom.client.Element el, String p) /*-{ try { - + if (el.currentStyle) { // IE return el.currentStyle[p]; @@ -824,7 +824,7 @@ public class WidgetUtil { } catch (e) { return ""; } - + }-*/; /** @@ -838,7 +838,7 @@ public class WidgetUtil { try { el.focus(); } catch (e) { - + } }-*/; @@ -1191,7 +1191,7 @@ public class WidgetUtil { if ($wnd.document.activeElement) { return $wnd.document.activeElement; } - + return null; }-*/; @@ -1262,11 +1262,11 @@ public class WidgetUtil { /*-{ var top = elem.offsetTop; var height = elem.offsetHeight; - + if (elem.parentNode != elem.offsetParent) { top -= elem.parentNode.offsetTop; } - + var cur = elem.parentNode; while (cur && (cur.nodeType == 1)) { if (top < cur.scrollTop) { @@ -1275,12 +1275,12 @@ public class WidgetUtil { if (top + height > cur.scrollTop + cur.clientHeight) { cur.scrollTop = (top + height) - cur.clientHeight; } - + var offsetTop = cur.offsetTop; if (cur.parentNode != cur.offsetParent) { offsetTop -= cur.parentNode.offsetTop; } - + top += offsetTop - cur.scrollTop; cur = cur.parentNode; } @@ -1729,7 +1729,7 @@ public class WidgetUtil { } var heightWithoutBorder = cloneElement.offsetHeight; parentElement.removeChild(cloneElement); - + return heightWithBorder - heightWithoutBorder; } }-*/; 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 d95d438f7d..2a396b6fe2 100644 --- a/client/src/main/java/com/vaadin/client/communication/AtmospherePushConnection.java +++ b/client/src/main/java/com/vaadin/client/communication/AtmospherePushConnection.java @@ -149,16 +149,15 @@ public class AtmospherePushConnection implements PushConnection { final PushConfigurationState pushConfiguration) { this.connection = connection; - connection.addHandler(ApplicationStoppedEvent.TYPE, - event -> { - if (state == State.DISCONNECT_PENDING - || state == State.DISCONNECTED) { - return; - } - - disconnect(() -> { - }); - }); + connection.addHandler(ApplicationStoppedEvent.TYPE, event -> { + if (state == State.DISCONNECT_PENDING + || state == State.DISCONNECTED) { + return; + } + + disconnect(() -> { + }); + }); config = createConfig(); String debugParameter = Location.getParameter("debug"); if ("push".equals(debugParameter)) { 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 b1765c1ced..27c7052d30 100644 --- a/client/src/main/java/com/vaadin/client/communication/DefaultConnectionStateHandler.java +++ b/client/src/main/java/com/vaadin/client/communication/DefaultConnectionStateHandler.java @@ -92,16 +92,14 @@ public class DefaultConnectionStateHandler implements ConnectionStateHandler { public void setConnection(ApplicationConnection connection) { this.connection = connection; - connection.addHandler(ApplicationStoppedEvent.TYPE, - event -> { - if (isReconnecting()) { - giveUp(); - } - if (scheduledReconnect != null - && scheduledReconnect.isRunning()) { - scheduledReconnect.cancel(); - } - }); + connection.addHandler(ApplicationStoppedEvent.TYPE, event -> { + if (isReconnecting()) { + giveUp(); + } + if (scheduledReconnect != null && scheduledReconnect.isRunning()) { + scheduledReconnect.cancel(); + } + }); // Allow dialog to cache needed resources to make them available when we // are offline 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 55e6bde4f0..c9c478d62a 100644 --- a/client/src/main/java/com/vaadin/client/communication/RpcManager.java +++ b/client/src/main/java/com/vaadin/client/communication/RpcManager.java @@ -58,10 +58,9 @@ 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); } } @@ -92,10 +91,9 @@ 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); } } 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 46c2b37102..f81793aa7a 100644 --- a/client/src/main/java/com/vaadin/client/communication/XhrConnectionError.java +++ b/client/src/main/java/com/vaadin/client/communication/XhrConnectionError.java @@ -21,8 +21,8 @@ import com.google.gwt.http.client.Response; import elemental.json.JsonObject; /** - * XhrConnectionError provides detail about an error which occurred during - * an XHR request to the server. + * XhrConnectionError provides detail about an error which occurred during an + * XHR request to the server. * * @since 7.6 * @author Vaadin Ltd diff --git a/client/src/main/java/com/vaadin/client/connectors/data/HierarchicalDataCommunicatorConnector.java b/client/src/main/java/com/vaadin/client/connectors/data/HierarchicalDataCommunicatorConnector.java index 9ebd11bdca..25b926e40a 100644 --- a/client/src/main/java/com/vaadin/client/connectors/data/HierarchicalDataCommunicatorConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/data/HierarchicalDataCommunicatorConnector.java @@ -46,11 +46,11 @@ public class HierarchicalDataCommunicatorConnector */ JsonObject hierarchyData = newRowData.getObject( HierarchicalDataCommunicatorConstants.ROW_HIERARCHY_DESCRIPTION); - if (!hierarchyData.hasKey(HierarchicalDataCommunicatorConstants.ROW_DEPTH)) { + if (!hierarchyData + .hasKey(HierarchicalDataCommunicatorConstants.ROW_DEPTH)) { hierarchyData.put(HierarchicalDataCommunicatorConstants.ROW_DEPTH, - oldRowData - .getObject( - HierarchicalDataCommunicatorConstants.ROW_HIERARCHY_DESCRIPTION) + oldRowData.getObject( + HierarchicalDataCommunicatorConstants.ROW_HIERARCHY_DESCRIPTION) .getNumber( HierarchicalDataCommunicatorConstants.ROW_DEPTH)); } diff --git a/client/src/main/java/com/vaadin/client/connectors/grid/AbstractGridRendererConnector.java b/client/src/main/java/com/vaadin/client/connectors/grid/AbstractGridRendererConnector.java index 032d02ae8c..ada6e22199 100644 --- a/client/src/main/java/com/vaadin/client/connectors/grid/AbstractGridRendererConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/grid/AbstractGridRendererConnector.java @@ -25,12 +25,13 @@ import elemental.json.JsonObject; /** * An abstract base class for renderer connectors. A renderer connector is used - * to link a client-side {@link com.vaadin.client.renderers.Renderer Renderer} to a server-side - * {@link com.vaadin.ui.renderers.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. + * to link a client-side {@link com.vaadin.client.renderers.Renderer Renderer} + * to a server-side {@link com.vaadin.ui.renderers.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. * * @param <T> * the presentation type of the renderer diff --git a/client/src/main/java/com/vaadin/client/connectors/grid/ColumnConnector.java b/client/src/main/java/com/vaadin/client/connectors/grid/ColumnConnector.java index 9c2c2f09f9..3bd8609873 100644 --- a/client/src/main/java/com/vaadin/client/connectors/grid/ColumnConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/grid/ColumnConnector.java @@ -39,7 +39,7 @@ import elemental.json.JsonValue; public class ColumnConnector extends AbstractExtensionConnector { public abstract static class CustomColumn - extends Column<Object, JsonObject> { + extends Column<Object, JsonObject> { private final String connectorId; private ContentMode tooltipContentMode; diff --git a/client/src/main/java/com/vaadin/client/connectors/grid/GridConnector.java b/client/src/main/java/com/vaadin/client/connectors/grid/GridConnector.java index c11be38814..62e04fdb9c 100644 --- a/client/src/main/java/com/vaadin/client/connectors/grid/GridConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/grid/GridConnector.java @@ -110,8 +110,8 @@ public class GridConnector extends AbstractListingConnector String columnId = columnToIdMap.get(cell.getColumn()); int rowIndex = cell.getRowIndex(); getRpcProxy(GridServerRpc.class).itemClick(rowKey, columnId, - MouseEventDetailsBuilder - .buildMouseEventDetails(mouseEvent), rowIndex); + MouseEventDetailsBuilder.buildMouseEventDetails(mouseEvent), + rowIndex); } } 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 57b5c0e6ce..78ad56abaa 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 @@ -54,7 +54,9 @@ public class InfoSection implements Section { public void run() { refresh(); } - }; public InfoSection() { + }; + + public InfoSection() { createContent(); } 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 71d49e7015..38fb537822 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 @@ -223,7 +223,8 @@ public class LogSection implements Section { /** * Sets the log row limit. * - * @param limit The limit + * @param limit + * The limit */ public void setLimit(int limit) { this.limit = limit; diff --git a/client/src/main/java/com/vaadin/client/extensions/FileDropTargetConnector.java b/client/src/main/java/com/vaadin/client/extensions/FileDropTargetConnector.java index acd73f7a5c..698518fe2c 100644 --- a/client/src/main/java/com/vaadin/client/extensions/FileDropTargetConnector.java +++ b/client/src/main/java/com/vaadin/client/extensions/FileDropTargetConnector.java @@ -144,9 +144,9 @@ public class FileDropTargetConnector extends DropTargetExtensionConnector { * Returns the files parameter of the dataTransfer object. * * @param dataTransfer - * DataTransfer object to retrieve files from. + * DataTransfer object to retrieve files from. * @return {@code DataTransfer.files} parameter of the given dataTransfer - * object. + * object. */ private native FileList getFiles(DataTransfer dataTransfer) /*-{ @@ -157,13 +157,13 @@ public class FileDropTargetConnector extends DropTargetExtensionConnector { * Checks whether the file on the given index is indeed a file or a folder. * * @param file - * File object to prove it is not a folder. + * File object to prove it is not a folder. * @param fileIndex - * Index of the file object. + * Index of the file object. * @param dataTransfer - * DataTransfer object that contains the list of files. + * DataTransfer object that contains the list of files. * @return {@code true} if the given file at the given index is not a - * folder, {@code false} otherwise. + * folder, {@code false} otherwise. */ private native boolean isFile(File file, int fileIndex, DataTransfer dataTransfer) 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 0f42f1f834..c0ab5c7ab3 100644 --- a/client/src/main/java/com/vaadin/client/ui/AbstractComponentConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/AbstractComponentConnector.java @@ -105,17 +105,16 @@ public abstract class AbstractComponentConnector extends AbstractConnector @OnStateChange("registeredEventListeners") void handleContextClickListenerChange() { if (contextHandler == null && hasEventListener(EventId.CONTEXT_CLICK)) { - contextHandler = getWidget() - .addDomHandler(event -> { - final MouseEventDetails mouseEventDetails = MouseEventDetailsBuilder - .buildMouseEventDetails(event.getNativeEvent(), - getWidget().getElement()); - - event.preventDefault(); - event.stopPropagation(); - sendContextClickEvent(mouseEventDetails, - event.getNativeEvent().getEventTarget()); - }, ContextMenuEvent.getType()); + contextHandler = getWidget().addDomHandler(event -> { + final MouseEventDetails mouseEventDetails = MouseEventDetailsBuilder + .buildMouseEventDetails(event.getNativeEvent(), + getWidget().getElement()); + + event.preventDefault(); + event.stopPropagation(); + sendContextClickEvent(mouseEventDetails, + event.getNativeEvent().getEventTarget()); + }, ContextMenuEvent.getType()); // if the widget has a contextclick listener, add touch support as // well. @@ -178,8 +177,7 @@ public abstract class AbstractComponentConnector extends AbstractConnector } // Prevent selection for the element while pending long tap. - WidgetUtil.setTextSelectionEnabled(widget.getElement(), - false); + WidgetUtil.setTextSelectionEnabled(widget.getElement(), false); if (BrowserInfo.get().isAndroid()) { // Android fires ContextMenu events automatically. @@ -187,9 +185,9 @@ public abstract class AbstractComponentConnector extends AbstractConnector } /* - * we need to build mouseEventDetails eagerly - the event won't - * be guaranteed to be around when the timer executes. At least - * this was the case with iOS devices. + * we need to build mouseEventDetails eagerly - the event won't be + * guaranteed to be around when the timer executes. At least this + * was the case with iOS devices. */ final MouseEventDetails mouseEventDetails = MouseEventDetailsBuilder @@ -487,7 +485,8 @@ public abstract class AbstractComponentConnector extends AbstractConnector HasErrorIndicatorElement hasErrorIndicatorElement = (HasErrorIndicatorElement) widget; if (getState().errorMessage != null) { hasErrorIndicatorElement.setErrorIndicatorElementVisible(true); - ErrorUtil.setErrorLevelStyle(hasErrorIndicatorElement.getErrorIndicatorElement(), + ErrorUtil.setErrorLevelStyle( + hasErrorIndicatorElement.getErrorIndicatorElement(), StyleConstants.STYLE_NAME_ERROR_INDICATOR, getState().errorLevel); } else { 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 23a36f1303..7450d4894b 100644 --- a/client/src/main/java/com/vaadin/client/ui/FocusUtil.java +++ b/client/src/main/java/com/vaadin/client/ui/FocusUtil.java @@ -98,7 +98,7 @@ public class FocusUtil { /** * Finds all the focusable children of given parent element. - * + * * @param parent * the parent element * @return array of focusable children @@ -112,7 +112,7 @@ public class FocusUtil { /** * Moves the focus to the first focusable child of given parent element. - * + * * @param parent * the parent element * @since 8.1.7 @@ -126,7 +126,8 @@ public class FocusUtil { for (int i = 0; i < focusableChildren.length; i++) { Element element = focusableChildren[i]; String classes = element.getAttribute("class"); - if (classes == null || !classes.toLowerCase().contains("disabled")) { + if (classes == null + || !classes.toLowerCase().contains("disabled")) { element.focus(); return; } @@ -135,7 +136,7 @@ public class FocusUtil { /** * Moves the focus to the last focusable child of given parent element. - * + * * @param parent * the parent element * @since 8.1.7 diff --git a/client/src/main/java/com/vaadin/client/ui/HasErrorIndicatorElement.java b/client/src/main/java/com/vaadin/client/ui/HasErrorIndicatorElement.java index 506732974c..6c82d71aab 100644 --- a/client/src/main/java/com/vaadin/client/ui/HasErrorIndicatorElement.java +++ b/client/src/main/java/com/vaadin/client/ui/HasErrorIndicatorElement.java @@ -35,8 +35,8 @@ public interface HasErrorIndicatorElement { * Sets the visibility of the error indicator element. * * @param visible - * {@code true} to show the error indicator element, {@code false} - * to hide it + * {@code true} to show the error indicator element, + * {@code false} to hide it */ void setErrorIndicatorElementVisible(boolean visible); } 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 0d7738ce06..2374e2e426 100644 --- a/client/src/main/java/com/vaadin/client/ui/JavaScriptComponentConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/JavaScriptComponentConnector.java @@ -31,8 +31,7 @@ public final class JavaScriptComponentConnector extends private final JavaScriptConnectorHelper helper = new JavaScriptConnectorHelper( this) { @Override - protected void showInitProblem( - List<String> attemptedNames) { + protected void showInitProblem(List<String> attemptedNames) { getWidget().showNoInitFound(attemptedNames); } }; 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 28237115a2..7dcfb45850 100644 --- a/client/src/main/java/com/vaadin/client/ui/TouchScrollDelegate.java +++ b/client/src/main/java/com/vaadin/client/ui/TouchScrollDelegate.java @@ -101,8 +101,8 @@ public class TouchScrollDelegate implements NativePreviewHandler { private static TouchScrollDelegate activeScrollDelegate; - private static final boolean ANDROID_WITH_BROKEN_SCROLL_TOP = BrowserInfo.get() - .isAndroidWithBrokenScrollTop(); + private static final boolean ANDROID_WITH_BROKEN_SCROLL_TOP = BrowserInfo + .get().isAndroidWithBrokenScrollTop(); /** * A helper class for making a widget scrollable. Uses native scrolling if @@ -562,8 +562,8 @@ public class TouchScrollDelegate implements NativePreviewHandler { finalScrollTop = finalY; if (Math.abs(pixelsToMove) < 3 || duration < 20) { - getLogger().info("Small 'momentum' " + pixelsToMove + " | " + duration - + " Skipping animation,"); + getLogger().info("Small 'momentum' " + pixelsToMove + " | " + + duration + " Skipping animation,"); moveTransformationToScrolloffset(); return; } @@ -701,7 +701,8 @@ public class TouchScrollDelegate implements NativePreviewHandler { } break; default: - getLogger().info("Non touch event:" + event.getNativeEvent().getType()); + getLogger().info( + "Non touch event:" + event.getNativeEvent().getType()); event.cancel(); break; } diff --git a/client/src/main/java/com/vaadin/client/ui/VAbstractCalendarPanel.java b/client/src/main/java/com/vaadin/client/ui/VAbstractCalendarPanel.java index 67436339b5..8a3c6c3325 100644 --- a/client/src/main/java/com/vaadin/client/ui/VAbstractCalendarPanel.java +++ b/client/src/main/java/com/vaadin/client/ui/VAbstractCalendarPanel.java @@ -722,8 +722,8 @@ public abstract class VAbstractCalendarPanel<R extends Enum<R>> } String dateStrResolution = dateStrResolution(date, minResolution); - return rangeStart.substring(0,dateStrResolution.length()) - .compareTo(dateStrResolution) <=0; + return rangeStart.substring(0, dateStrResolution.length()) + .compareTo(dateStrResolution) <= 0; } private String dateStrResolution(Date date, R minResolution) { @@ -760,7 +760,7 @@ public abstract class VAbstractCalendarPanel<R extends Enum<R>> } String dateStrResolution = dateStrResolution(date, minResolution); - return rangeEnd.substring(0,dateStrResolution.length()) + return rangeEnd.substring(0, dateStrResolution.length()) .compareTo(dateStrResolution) >= 0; } @@ -868,10 +868,9 @@ public abstract class VAbstractCalendarPanel<R extends Enum<R>> // Set assistive label to read focused date and month/year Roles.getButtonRole().set(day.getElement()); - Roles.getButtonRole() - .setAriaLabelledbyProperty(day.getElement(), - Id.of(day.getElement()), - Id.of(getFlexCellFormatter().getElement(0, 2))); + Roles.getButtonRole().setAriaLabelledbyProperty( + day.getElement(), Id.of(day.getElement()), + Id.of(getFlexCellFormatter().getElement(0, 2))); day.setStyleName(getDateField().getStylePrimaryName() + "-calendarpanel-day"); @@ -895,9 +894,8 @@ public abstract class VAbstractCalendarPanel<R extends Enum<R>> day.addStyleDependentName(CN_FOCUSED); // Reference focused day from calendar panel - Roles.getGridRole() - .setAriaActivedescendantProperty(getElement(), - Id.of(day.getElement())); + Roles.getGridRole().setAriaActivedescendantProperty( + getElement(), Id.of(day.getElement())); } } if (curr.getMonth() != displayedMonth.getMonth()) { @@ -1682,30 +1680,33 @@ public abstract class VAbstractCalendarPanel<R extends Enum<R>> * @param date */ private Date adjustDateToFitInsideRange(Date date) { - if(!isAcceptedByRangeStart(date,resolution)) { + if (!isAcceptedByRangeStart(date, resolution)) { date = parseRangeString(rangeStart); - } else - if(!isAcceptedByRangeEnd(date,resolution)) { + } else if (!isAcceptedByRangeEnd(date, resolution)) { date = parseRangeString(rangeEnd); } return date; } private Date parseRangeString(String dateStr) { - if(dateStr == null || "".equals(dateStr)) return null; - int year = Integer.parseInt(dateStr.substring(0,4)) - 1900; - int month = parsePart(dateStr, 5, 2,1) - 1; - int day = parsePart(dateStr, 8, 2,1); - int hrs = parsePart(dateStr, 11, 2,0); - int min = parsePart(dateStr, 14, 2,0); - int sec = parsePart(dateStr, 17, 2,0); + if (dateStr == null || "".equals(dateStr)) + return null; + int year = Integer.parseInt(dateStr.substring(0, 4)) - 1900; + int month = parsePart(dateStr, 5, 2, 1) - 1; + int day = parsePart(dateStr, 8, 2, 1); + int hrs = parsePart(dateStr, 11, 2, 0); + int min = parsePart(dateStr, 14, 2, 0); + int sec = parsePart(dateStr, 17, 2, 0); - return new Date(year,month,day,hrs,min,sec); + return new Date(year, month, day, hrs, min, sec); } - private int parsePart(String dateStr, int beginIndex, int length, int defValue) { - if(dateStr.length() < beginIndex + length) return defValue; - return Integer.parseInt(dateStr.substring(beginIndex, beginIndex + length)); + private int parsePart(String dateStr, int beginIndex, int length, + int defValue) { + if (dateStr.length() < beginIndex + length) + return defValue; + return Integer + .parseInt(dateStr.substring(beginIndex, beginIndex + length)); } /** @@ -2112,7 +2113,7 @@ public abstract class VAbstractCalendarPanel<R extends Enum<R>> * Set assistive label for the previous year element. * * @param label - * the label to set + * the label to set * @since 8.4 */ public void setAssistiveLabelPreviousYear(String label) { @@ -2123,7 +2124,7 @@ public abstract class VAbstractCalendarPanel<R extends Enum<R>> * Set assistive label for the next year element. * * @param label - * the label to set + * the label to set * @since 8.4 */ public void setAssistiveLabelNextYear(String label) { @@ -2134,7 +2135,7 @@ public abstract class VAbstractCalendarPanel<R extends Enum<R>> * Set assistive label for the previous month element. * * @param label - * the label to set + * the label to set * @since 8.4 */ public void setAssistiveLabelPreviousMonth(String label) { @@ -2145,7 +2146,7 @@ public abstract class VAbstractCalendarPanel<R extends Enum<R>> * Set assistive label for the next month element. * * @param label - * the label to set + * the label to set * @since 8.4 */ public void setAssistiveLabelNextMonth(String label) { diff --git a/client/src/main/java/com/vaadin/client/ui/VAbstractTextualDate.java b/client/src/main/java/com/vaadin/client/ui/VAbstractTextualDate.java index 18001b9ff0..bf79fec545 100644 --- a/client/src/main/java/com/vaadin/client/ui/VAbstractTextualDate.java +++ b/client/src/main/java/com/vaadin/client/ui/VAbstractTextualDate.java @@ -55,9 +55,8 @@ import com.vaadin.shared.EventId; */ public abstract class VAbstractTextualDate<R extends Enum<R>> extends VDateField<R> - implements ChangeHandler, Focusable, - SubPartAware, HandlesAriaCaption, HandlesAriaInvalid, - HandlesAriaRequired, KeyDownHandler { + implements ChangeHandler, Focusable, SubPartAware, HandlesAriaCaption, + HandlesAriaInvalid, HandlesAriaRequired, KeyDownHandler { private static final String PARSE_ERROR_CLASSNAME = "-parseerror"; private static final String ISO_DATE_TIME_PATTERN = "yyyy-MM-dd'T'HH:mm:ss"; @@ -86,10 +85,8 @@ public abstract class VAbstractTextualDate<R extends Enum<R>> super(resoluton); text = new TextBox(); text.addChangeHandler(this); - text.addFocusHandler( - event -> fireBlurFocusEvent(event, true)); - text.addBlurHandler( - event -> fireBlurFocusEvent(event, false)); + text.addFocusHandler(event -> fireBlurFocusEvent(event, true)); + text.addBlurHandler(event -> fireBlurFocusEvent(event, false)); if (BrowserInfo.get().isIE()) { addDomHandler(this, KeyDownEvent.getType()); } @@ -278,7 +275,7 @@ public abstract class VAbstractTextualDate<R extends Enum<R>> * * @since 8.2 * @deprecated Use {@link #updateBufferedResolutions()} and - * {@link #sendBufferedValues()} instead. + * {@link #sendBufferedValues()} instead. */ @Deprecated protected final void updateAndSendBufferedValues() { @@ -409,8 +406,7 @@ public abstract class VAbstractTextualDate<R extends Enum<R>> } } - private void fireBlurFocusEvent(DomEvent<?> event, - boolean focus) { + private void fireBlurFocusEvent(DomEvent<?> event, boolean focus) { String styleName = VTextField.CLASSNAME + "-" + VTextField.CLASSNAME_FOCUS; if (focus) { diff --git a/client/src/main/java/com/vaadin/client/ui/VComboBox.java b/client/src/main/java/com/vaadin/client/ui/VComboBox.java index c29102cc4f..72797991d1 100644 --- a/client/src/main/java/com/vaadin/client/ui/VComboBox.java +++ b/client/src/main/java/com/vaadin/client/ui/VComboBox.java @@ -257,12 +257,12 @@ public class VComboBox 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; } - + @com.vaadin.client.ui.VComboBox.JsniUtil::moveScrollFromEvent(*)(widget, deltaX, deltaY, e, e.deltaMode); }); }-*/; 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 0402875206..2d4136bd76 100644 --- a/client/src/main/java/com/vaadin/client/ui/VDateField.java +++ b/client/src/main/java/com/vaadin/client/ui/VDateField.java @@ -283,8 +283,8 @@ public abstract class VDateField<R extends Enum<R>> extends FlowPanel */ public void sendBufferedValues() { rpc.update(bufferedDateString, - bufferedResolutions.entrySet().stream().collect(Collectors - .toMap(entry -> entry.getKey().name(), + bufferedResolutions.entrySet().stream().collect( + Collectors.toMap(entry -> entry.getKey().name(), entry -> entry.getValue()))); bufferedDateString = null; bufferedResolutions.clear(); 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 6ae3154f85..77e7b53c56 100644 --- a/client/src/main/java/com/vaadin/client/ui/VDragAndDropWrapper.java +++ b/client/src/main/java/com/vaadin/client/ui/VDragAndDropWrapper.java @@ -387,8 +387,8 @@ public class VDragAndDropWrapper extends VCustomComponent if (event.isFile(i)) { final int fileId = filecounter++; final VHtml5File file = event.getFile(i); - getLogger().info("Preparing to upload file " + file.getName() - + " with id " + fileId + ", size=" + getLogger().info("Preparing to upload file " + + file.getName() + " with id " + fileId + ", size=" + file.getSize()); transferable.setData("fi" + fileIndex, "" + fileId); transferable.setData("fn" + fileIndex, file.getName()); 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 7a75cdf765..26360bd6ab 100644 --- a/client/src/main/java/com/vaadin/client/ui/VLink.java +++ b/client/src/main/java/com/vaadin/client/ui/VLink.java @@ -28,8 +28,8 @@ import com.vaadin.client.Util; import com.vaadin.client.WidgetUtil.ErrorUtil; import com.vaadin.shared.ui.BorderStyle; -public class VLink extends HTML implements ClickHandler, HasEnabled, - HasErrorIndicatorElement { +public class VLink extends HTML + implements ClickHandler, HasEnabled, HasErrorIndicatorElement { public static final String CLASSNAME = "v-link"; 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 016e67e7da..70af301be0 100644 --- a/client/src/main/java/com/vaadin/client/ui/VMenuBar.java +++ b/client/src/main/java/com/vaadin/client/ui/VMenuBar.java @@ -60,9 +60,9 @@ import com.vaadin.client.extensions.EventTrigger; import com.vaadin.shared.ui.ContentMode; import com.vaadin.shared.ui.menubar.MenuBarConstants; -public class VMenuBar extends FocusableFlowPanel - implements CloseHandler<PopupPanel>, KeyPressHandler, KeyDownHandler, - FocusHandler, SubPartAware, MouseOutHandler, MouseOverHandler, EventTrigger { +public class VMenuBar extends FocusableFlowPanel implements + CloseHandler<PopupPanel>, KeyPressHandler, KeyDownHandler, FocusHandler, + SubPartAware, MouseOutHandler, MouseOverHandler, EventTrigger { // The hierarchy of VMenuBar is a bit weird as VMenuBar is the Paintable, // used for the root menu but also used for the sub menus. @@ -803,7 +803,7 @@ public class VMenuBar extends FocusableFlowPanel * */ public static class CustomMenuItem extends Widget - implements HasHTML, SubPartAware { + implements HasHTML, SubPartAware { protected String html = null; protected Command command = null; @@ -1924,7 +1924,8 @@ public class VMenuBar extends FocusableFlowPanel "The 'partInformation' parameter must contain the menu item id"); } - getTriggers().computeIfAbsent(partInformation, s-> new ArrayList<>()).add(command); + getTriggers().computeIfAbsent(partInformation, s -> new ArrayList<>()) + .add(command); return () -> { List<Command> commands = getTriggers().get(partInformation); if (commands != null) { 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 2c6400cacb..ac0f728ffe 100644 --- a/client/src/main/java/com/vaadin/client/ui/VNativeButton.java +++ b/client/src/main/java/com/vaadin/client/ui/VNativeButton.java @@ -31,8 +31,8 @@ import com.vaadin.client.WidgetUtil.ErrorUtil; import com.vaadin.shared.MouseEventDetails; import com.vaadin.shared.ui.button.ButtonServerRpc; -public class VNativeButton extends Button implements ClickHandler, - HasErrorIndicatorElement { +public class VNativeButton extends Button + implements ClickHandler, HasErrorIndicatorElement { public static final String CLASSNAME = "v-nativebutton"; @@ -171,8 +171,8 @@ public class VNativeButton extends Button implements ClickHandler, if (visible) { if (errorIndicatorElement == null) { errorIndicatorElement = ErrorUtil.createErrorIndicatorElement(); - getElement() - .insertBefore(errorIndicatorElement, captionElement); + getElement().insertBefore(errorIndicatorElement, + captionElement); } } else if (errorIndicatorElement != null) { getElement().removeChild(errorIndicatorElement); 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 0be7b42c44..e2046d47e5 100644 --- a/client/src/main/java/com/vaadin/client/ui/VNotification.java +++ b/client/src/main/java/com/vaadin/client/ui/VNotification.java @@ -294,13 +294,12 @@ public class VNotification extends VOverlay { // in some browsers) if (getStyleName() .contains(VOverlay.ADDITIONAL_CLASSNAME_ANIMATE_IN)) { - AnimationUtil.addAnimationEndListener(getElement(), - event -> { - if (AnimationUtil.getAnimationName(event).contains( - VOverlay.ADDITIONAL_CLASSNAME_ANIMATE_IN)) { - VNotification.this.hide(); - } - }); + AnimationUtil.addAnimationEndListener(getElement(), event -> { + if (AnimationUtil.getAnimationName(event).contains( + VOverlay.ADDITIONAL_CLASSNAME_ANIMATE_IN)) { + VNotification.this.hide(); + } + }); } else { VNotification.super.hide(); fireEvent(new HideEvent(this)); @@ -481,8 +480,8 @@ public class VNotification extends VOverlay { * @param description * The Notification description, can be {@code null}. * @param htmlContentAllowed - * Whether {@code caption} and {@code description} - * are interpreted as HTML or not. + * Whether {@code caption} and {@code description} are + * interpreted as HTML or not. * @param iconUri * The icon URI, can be {@code null}. * @param styleName @@ -496,7 +495,8 @@ public class VNotification extends VOverlay { */ public static VNotification showNotification(ApplicationConnection client, String caption, String description, boolean htmlContentAllowed, - String iconUri, String styleName, Position position, int delayMsec) { + String iconUri, String styleName, Position position, + int delayMsec) { String html = ""; if (iconUri != null) { html += client.getIcon(iconUri).getElement().getString(); 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 e719a722a5..664c476ca6 100644 --- a/client/src/main/java/com/vaadin/client/ui/VPopupView.java +++ b/client/src/main/java/com/vaadin/client/ui/VPopupView.java @@ -245,9 +245,8 @@ public class VPopupView extends HTML // directly attached to the RootPanel. addDomHandler(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/VTextArea.java b/client/src/main/java/com/vaadin/client/ui/VTextArea.java index 207ce4a1ee..c68505d4be 100644 --- a/client/src/main/java/com/vaadin/client/ui/VTextArea.java +++ b/client/src/main/java/com/vaadin/client/ui/VTextArea.java @@ -34,8 +34,7 @@ import com.vaadin.client.ui.dd.DragImageModifier; * @author Vaadin Ltd. * */ -public class VTextArea extends VTextField - implements DragImageModifier { +public class VTextArea extends VTextField implements DragImageModifier { public static final String CLASSNAME = "v-textarea"; 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 1cf103f157..97167847a5 100644 --- a/client/src/main/java/com/vaadin/client/ui/VTwinColSelect.java +++ b/client/src/main/java/com/vaadin/client/ui/VTwinColSelect.java @@ -359,17 +359,15 @@ public class VTwinColSelect extends Composite implements MultiSelectWidget, private void moveSelectedItemsLeftToRight() { Set<String> movedItems = moveSelectedItems(optionsListBox, selectionsListBox); - selectionChangeListeners - .forEach(listener -> listener.accept(movedItems, - Collections.emptySet())); + selectionChangeListeners.forEach(listener -> listener.accept(movedItems, + Collections.emptySet())); } private void moveSelectedItemsRightToLeft() { Set<String> movedItems = moveSelectedItems(selectionsListBox, optionsListBox); - selectionChangeListeners - .forEach(listener -> listener.accept(Collections.emptySet(), - movedItems)); + selectionChangeListeners.forEach(listener -> listener + .accept(Collections.emptySet(), movedItems)); } private static Set<String> moveSelectedItems(ListBox source, 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 653cdc2400..ad50ca3115 100644 --- a/client/src/main/java/com/vaadin/client/ui/VUpload.java +++ b/client/src/main/java/com/vaadin/client/ui/VUpload.java @@ -318,7 +318,8 @@ public class VUpload extends SimplePanel { /** For internal use only. May be removed or replaced in the future. */ public void submit() { if (submitted || !enabled) { - getLogger().info("Submit cancelled (disabled or already submitted)"); + getLogger() + .info("Submit cancelled (disabled or already submitted)"); return; } if (fu.getFilename().isEmpty()) { 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 5957364086..482ea781e4 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 @@ -176,8 +176,8 @@ public class AriaHelper { * @param element * Element to move out of sight * @param assistiveOnly - * {@code true} when element should only be visible for - * assistive devices, {@code false} to make the element visible for all + * {@code true} when element should only be visible for assistive + * devices, {@code 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/datefield/AbstractDateFieldConnector.java b/client/src/main/java/com/vaadin/client/ui/datefield/AbstractDateFieldConnector.java index 02c0f85243..9057acefe4 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 @@ -150,17 +150,17 @@ public abstract class AbstractDateFieldConnector<R extends Enum<R>> * updates these labels. * * @param calendar - * the calendar panel for which to set the assistive labels + * the calendar panel for which to set the assistive labels * @since 8.4 */ protected void setAndUpdateAssistiveLabels( VAbstractCalendarPanel calendar) { - calendar.setAssistiveLabelPreviousMonth( - getState().assistiveLabels.get(AccessibleElement.PREVIOUS_MONTH)); + calendar.setAssistiveLabelPreviousMonth(getState().assistiveLabels + .get(AccessibleElement.PREVIOUS_MONTH)); calendar.setAssistiveLabelNextMonth( getState().assistiveLabels.get(AccessibleElement.NEXT_MONTH)); - calendar.setAssistiveLabelPreviousYear( - getState().assistiveLabels.get(AccessibleElement.PREVIOUS_YEAR)); + calendar.setAssistiveLabelPreviousYear(getState().assistiveLabels + .get(AccessibleElement.PREVIOUS_YEAR)); calendar.setAssistiveLabelNextYear( getState().assistiveLabels.get(AccessibleElement.NEXT_YEAR)); diff --git a/client/src/main/java/com/vaadin/client/ui/datefield/AbstractInlineDateFieldConnector.java b/client/src/main/java/com/vaadin/client/ui/datefield/AbstractInlineDateFieldConnector.java index 46f3c81d31..baecff729c 100644 --- a/client/src/main/java/com/vaadin/client/ui/datefield/AbstractInlineDateFieldConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/datefield/AbstractInlineDateFieldConnector.java @@ -51,24 +51,22 @@ public abstract class AbstractInlineDateFieldConnector<PANEL extends VAbstractCa protected void updateListeners() { VAbstractDateFieldCalendar<PANEL, R> widget = getWidget(); if (isResolutionMonthOrHigher()) { - widget.calendarPanel - .setFocusChangeListener(date -> { - Date date2 = new Date(); - if (widget.calendarPanel.getDate() != null) { - date2.setTime(widget.calendarPanel.getDate() - .getTime()); - } - /* - * Update the value of calendarPanel - */ - date2.setYear(date.getYear()); - date2.setMonth(date.getMonth()); - widget.calendarPanel.setDate(date2); - /* - * Then update the value from panel to server - */ - widget.updateValueFromPanel(); - }); + widget.calendarPanel.setFocusChangeListener(date -> { + Date date2 = new Date(); + if (widget.calendarPanel.getDate() != null) { + date2.setTime(widget.calendarPanel.getDate().getTime()); + } + /* + * Update the value of calendarPanel + */ + date2.setYear(date.getYear()); + date2.setMonth(date.getMonth()); + widget.calendarPanel.setDate(date2); + /* + * Then update the value from panel to server + */ + widget.updateValueFromPanel(); + }); } else { widget.calendarPanel.setFocusChangeListener(null); } @@ -124,4 +122,4 @@ public abstract class AbstractInlineDateFieldConnector<PANEL extends VAbstractCa */ protected abstract boolean isResolutionMonthOrHigher(); -}
\ No newline at end of file +} diff --git a/client/src/main/java/com/vaadin/client/ui/datefield/DateTimeFieldConnector.java b/client/src/main/java/com/vaadin/client/ui/datefield/DateTimeFieldConnector.java index 9a1ce33ff8..1b3362d006 100644 --- a/client/src/main/java/com/vaadin/client/ui/datefield/DateTimeFieldConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/datefield/DateTimeFieldConnector.java @@ -57,26 +57,25 @@ public class DateTimeFieldConnector extends VPopupTimeCalendar widget = getWidget(); if (widget.getCurrentResolution() .compareTo(DateTimeResolution.DAY) < 0) { - widget.calendar - .setTimeChangeListener((hour, min, sec, msec) -> { - Date d = widget.getDate(); - if (d == null) { - // date currently null, use the value from - // calendarPanel - // (~ client time at the init of the widget) - d = (Date) widget.calendar.getDate().clone(); - } - d.setHours(hour); - d.setMinutes(min); - d.setSeconds(sec); - DateTimeService.setMilliseconds(d, msec); + widget.calendar.setTimeChangeListener((hour, min, sec, msec) -> { + Date d = widget.getDate(); + if (d == null) { + // date currently null, use the value from + // calendarPanel + // (~ client time at the init of the widget) + d = (Date) widget.calendar.getDate().clone(); + } + d.setHours(hour); + d.setMinutes(min); + d.setSeconds(sec); + DateTimeService.setMilliseconds(d, msec); - // Always update time changes to the server - widget.updateValue(d); + // Always update time changes to the server + widget.updateValue(d); - // Update text field - widget.buildDate(); - }); + // Update text field + widget.buildDate(); + }); } } -}
\ No newline at end of file +} 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 763f2b2aa7..728f96558b 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 @@ -34,7 +34,8 @@ public final class VTargetDetailIs extends VAcceptCriterion { protected boolean accept(VDragEvent drag, UIDL configuration) { String name = configuration.getStringAttribute("p"); String t = configuration.hasAttribute("t") - ? configuration.getStringAttribute("t").intern() : "s"; + ? 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/draganddropwrapper/DragAndDropWrapperConnector.java b/client/src/main/java/com/vaadin/client/ui/draganddropwrapper/DragAndDropWrapperConnector.java index af24f045ac..3f3247dd92 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 @@ -83,10 +83,8 @@ public class DragAndDropWrapperConnector extends CustomComponentConnector } } else { if (widget.fileIdToReceiver.containsKey(fileId) - && receiverUrl != null - && !receiverUrl - .equals(widget.fileIdToReceiver - .get(fileId))) { + && receiverUrl != null && !receiverUrl.equals( + widget.fileIdToReceiver.get(fileId))) { getLogger().severe( "Overwriting file receiver mapping for fileId " + fileId + " . Old receiver URL: " 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 92fcd441e9..3d7ef5f2ae 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 @@ -134,8 +134,8 @@ public class EmbeddedConnector extends AbstractComponentConnector { setResourceUrl(getResourceUrl("src")); clearBrowserElement = false; } else { - getLogger().severe( - "Unknown Embedded type '" + widget.type + "'"); + getLogger() + .severe("Unknown Embedded type '" + widget.type + "'"); } } else if (state.mimeType != null) { // remove old style name related to type @@ -152,8 +152,8 @@ public class EmbeddedConnector extends AbstractComponentConnector { widget.mimetype = "flash"; // Handle embedding of Flash widget.addStyleName(VEmbedded.CLASSNAME + "-flash"); - widget.setHTML(widget.createFlashEmbed(state, - getResourceUrl("src"))); + widget.setHTML( + widget.createFlashEmbed(state, getResourceUrl("src"))); } else if (mime.equals("image/svg+xml")) { widget.mimetype = "svg"; @@ -202,7 +202,8 @@ public class EmbeddedConnector extends AbstractComponentConnector { getLogger().severe("Unknown Embedded mimetype '" + mime + "'"); } } else { - getLogger().severe("Unknown Embedded; no type or mimetype attribute"); + getLogger() + .severe("Unknown Embedded; no type or mimetype attribute"); } if (clearBrowserElement) { 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 6d52e3ff84..046b27712c 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 @@ -40,14 +40,16 @@ public class ComponentConnectorLayoutSlot extends VLayoutSlot { protected int getCaptionHeight() { VCaption caption = getCaption(); return caption != null - ? getLayoutManager().getOuterHeight(caption.getElement()) : 0; + ? getLayoutManager().getOuterHeight(caption.getElement()) + : 0; } @Override protected int getCaptionWidth() { VCaption caption = getCaption(); return caption != null - ? getLayoutManager().getOuterWidth(caption.getElement()) : 0; + ? getLayoutManager().getOuterWidth(caption.getElement()) + : 0; } public LayoutManager getLayoutManager() { 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 ec08903149..7c39840b59 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 @@ -168,7 +168,8 @@ public abstract class VLayoutSlot { int captionHeight; VCaption caption = getCaption(); - Style captionStyle = caption == null ? null : caption.getElement().getStyle(); + Style captionStyle = caption == null ? null + : caption.getElement().getStyle(); if (caption == null || caption.shouldBePlacedAfterComponent()) { style.clearPaddingTop(); captionHeight = 0; 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 e0a390976b..44b6c3b831 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 @@ -158,8 +158,8 @@ public class NativeSelectConnector if (widgetEnabled) { getWidget().getListBox().getElement().removeAttribute("disabled"); } else { - getWidget().getListBox().getElement() - .setAttribute("disabled", "disabled"); + getWidget().getListBox().getElement().setAttribute("disabled", + "disabled"); } } } 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 7640e9b88a..5fd8c766b6 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 @@ -459,8 +459,7 @@ public abstract class AbstractOrderedLayoutConnector // Update slot style names List<String> childStyles = child.getState().styles; if (childStyles == null) { - widget.setSlotStyleNames(child.getWidget(), - (String[]) null); + widget.setSlotStyleNames(child.getWidget(), (String[]) null); } else { widget.setSlotStyleNames(child.getWidget(), childStyles.toArray(new String[childStyles.size()])); @@ -489,11 +488,11 @@ public abstract class AbstractOrderedLayoutConnector if (needsFixedHeight()) { // Add resize listener to ensure the widget itself is measured - getLayoutManager().addElementResizeListener( - widget.getElement(), childComponentResizeListener); + getLayoutManager().addElementResizeListener(widget.getElement(), + childComponentResizeListener); } else { - getLayoutManager().removeElementResizeListener( - widget.getElement(), childComponentResizeListener); + getLayoutManager().removeElementResizeListener(widget.getElement(), + childComponentResizeListener); } // Then update listeners based on bookkeeping @@ -507,8 +506,8 @@ public abstract class AbstractOrderedLayoutConnector // updateExpandedSizes causes fixed size components to temporarily // lose their size. updateExpandCompensation must be delayed until // the browser has a chance to measure them. - Scheduler.get().scheduleFinally( - () -> widget.updateExpandCompensation()); + Scheduler.get() + .scheduleFinally(() -> widget.updateExpandCompensation()); } else { widget.clearExpand(); } @@ -694,4 +693,4 @@ public abstract class AbstractOrderedLayoutConnector super.onUnregister(); } -}
\ No newline at end of file +} 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 64dd7f738b..f454e511be 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 @@ -93,16 +93,14 @@ public class PanelConnector extends AbstractSingleComponentContainerConnector // Restore default stylenames panel.contentNode.setClassName(VPanel.CLASSNAME + "-content"); - panel.bottomDecoration - .setClassName(VPanel.CLASSNAME + "-deco"); + panel.bottomDecoration.setClassName(VPanel.CLASSNAME + "-deco"); panel.captionNode.setClassName(VPanel.CLASSNAME + "-caption"); boolean hasCaption = hasCaption(); if (hasCaption) { panel.setCaption(getState().caption); } else { panel.setCaption(""); - panel.captionNode - .setClassName(VPanel.CLASSNAME + "-nocaption"); + panel.captionNode.setClassName(VPanel.CLASSNAME + "-nocaption"); } // Add proper stylenames for all elements. This way we can prevent 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 eecc6ac57b..03fad4e658 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 @@ -70,8 +70,8 @@ public class PopupViewConnector extends AbstractHasComponentsConnector if (popup.captionWrapper != null) { popup.captionWrapper.updateCaption(); } else { - popup.captionWrapper = new VCaptionWrapper( - childConnector, getConnection()); + popup.captionWrapper = new VCaptionWrapper(childConnector, + getConnection()); popup.setWidget(popup.captionWrapper); popup.captionWrapper.updateCaption(); } @@ -135,7 +135,7 @@ public class PopupViewConnector extends AbstractHasComponentsConnector } else { // The popup shouldn't be visible, try to hide it. - popup.hide(false,false,false); + popup.hide(false, false, false); } } 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 ba1558d857..9c5382c303 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 @@ -139,8 +139,7 @@ public abstract class AbstractSplitPanelConnector extends panel.maximumPosition = splitterState.maxPosition + splitterState.maxPositionUnit; - panel.position = splitterState.position - + splitterState.positionUnit; + panel.position = splitterState.position + splitterState.positionUnit; panel.setPositionReversed(splitterState.positionReversed); 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 ffb6ece368..d8f34e9917 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 @@ -59,8 +59,8 @@ public abstract class TabsheetBaseConnector // Widgets in the TabSheet before update List<Widget> oldWidgets = new ArrayList<>(); - for (Iterator<Widget> iterator = widget - .getWidgetIterator(); iterator.hasNext();) { + for (Iterator<Widget> iterator = widget.getWidgetIterator(); iterator + .hasNext();) { oldWidgets.add(iterator.next()); } diff --git a/client/src/main/java/com/vaadin/client/ui/textfield/AbstractTextFieldConnector.java b/client/src/main/java/com/vaadin/client/ui/textfield/AbstractTextFieldConnector.java index 4d678bfc65..978cc22c45 100644 --- a/client/src/main/java/com/vaadin/client/ui/textfield/AbstractTextFieldConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/textfield/AbstractTextFieldConnector.java @@ -40,8 +40,9 @@ public abstract class AbstractTextFieldConnector extends AbstractFieldConnector @Override public void selectRange(int start, int length) { int textLength = getAbstractTextField().getValue().length(); - //Enable setting cursor position after the last character - start = restrictTo(start, 0, length == 0 ? textLength : (textLength - 1)); + // Enable setting cursor position after the last character + start = restrictTo(start, 0, + length == 0 ? textLength : (textLength - 1)); length = restrictTo(length, 0, textLength - start); getAbstractTextField().setSelectionRange(start, length); } diff --git a/client/src/main/java/com/vaadin/client/ui/treegrid/TreeGridConnector.java b/client/src/main/java/com/vaadin/client/ui/treegrid/TreeGridConnector.java index ae967a28c8..b1d60734e8 100644 --- a/client/src/main/java/com/vaadin/client/ui/treegrid/TreeGridConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/treegrid/TreeGridConnector.java @@ -421,12 +421,11 @@ public class TreeGridConnector extends GridConnector { } private static boolean isCollapsed(JsonObject rowData) { - assert rowData - .hasKey(HierarchicalDataCommunicatorConstants.ROW_HIERARCHY_DESCRIPTION) : "missing hierarchy data for row " + assert rowData.hasKey( + HierarchicalDataCommunicatorConstants.ROW_HIERARCHY_DESCRIPTION) : "missing hierarchy data for row " + rowData.asString(); - return rowData - .getObject( - HierarchicalDataCommunicatorConstants.ROW_HIERARCHY_DESCRIPTION) + return rowData.getObject( + HierarchicalDataCommunicatorConstants.ROW_HIERARCHY_DESCRIPTION) .getBoolean( HierarchicalDataCommunicatorConstants.ROW_COLLAPSED); } 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 1929f290b6..adb06a450a 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 @@ -511,16 +511,18 @@ public class UIConnector extends AbstractSingleComponentContainerConnector * Initialize UIConnector and attach UI to the rootPanelElement. * * @param rootPanelElement - * element to attach ui into + * element to attach ui into * @param applicationConnection - * application connection + * application connection * @since 8.4 */ public void init(Element rootPanelElement, ApplicationConnection applicationConnection) { - Panel root = new AbsolutePanel(rootPanelElement) {{ - onAttach(); - }}; + Panel root = new AbsolutePanel(rootPanelElement) { + { + onAttach(); + } + }; initConnector(root, applicationConnection); } @@ -530,9 +532,9 @@ public class UIConnector extends AbstractSingleComponentContainerConnector * element. * * @param rootPanelId - * root panel element id + * root panel element id * @param applicationConnection - * application connection + * application connection */ public void init(String rootPanelId, ApplicationConnection applicationConnection) { @@ -566,7 +568,6 @@ public class UIConnector extends AbstractSingleComponentContainerConnector DOM.sinkEvents(ui.getElement(), Event.ONSCROLL); - // Remove the v-app-loading or any splash screen added inside the div by // the user root.getElement().setInnerHTML(""); 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 5e9aa9ce58..400c61a4f5 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 @@ -70,8 +70,8 @@ public class UploadConnector extends AbstractComponentConnector upload.submitButton .setText(uidl.getStringAttribute("buttoncaption")); if (uidl.hasAttribute("buttonstylename")) { - upload.submitButton - .setStyleName(uidl.getStringAttribute("buttonstylename")); + upload.submitButton.setStyleName( + uidl.getStringAttribute("buttonstylename")); } upload.submitButton.setVisible(true); } else { 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 34f43a682d..51e8663749 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 @@ -172,8 +172,8 @@ public interface ColumnConfiguration { throws IllegalArgumentException; /** - * Refreshes a range of columns in the current row containers in each Escalator - * section. + * Refreshes a range of columns in the current row containers in each + * Escalator section. * <p> * The data for the refreshed columns is queried from the current cell * renderer. 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 002e4681ea..7985555ac3 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 @@ -27,8 +27,8 @@ import com.vaadin.client.widgets.Escalator; * should the displayed data need to be fetched remotely. * <p> * This has a similar function to {@link com.vaadin.client.widgets.Grid Grid's} - * {@link com.vaadin.client.renderers.Renderer Renderers} - * , although they operate on different abstraction levels. + * {@link com.vaadin.client.renderers.Renderer Renderers} , although they + * operate on different abstraction levels. * * @since 7.4 * @author Vaadin Ltd 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 144b53891b..9b33c2205f 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 @@ -241,8 +241,7 @@ public class FlyweightRow implements Row { assert offset >= 0 && offset + numberOfCells <= cells .size() : "Invalid range of cells"; return () -> CellIterator - .attached( - cells.subList(offset, offset + numberOfCells)); + .attached(cells.subList(offset, offset + numberOfCells)); } /** @@ -266,8 +265,7 @@ public class FlyweightRow implements Row { assert offset >= 0 && offset + numberOfCells <= cells .size() : "Invalid range of cells"; return () -> CellIterator - .unattached( - cells.subList(offset, offset + numberOfCells)); + .unattached(cells.subList(offset, offset + numberOfCells)); } /** diff --git a/client/src/main/java/com/vaadin/client/widget/escalator/events/SpacerVisibilityChangedEvent.java b/client/src/main/java/com/vaadin/client/widget/escalator/events/SpacerVisibilityChangedEvent.java index 7963854a21..443422978a 100644 --- a/client/src/main/java/com/vaadin/client/widget/escalator/events/SpacerVisibilityChangedEvent.java +++ b/client/src/main/java/com/vaadin/client/widget/escalator/events/SpacerVisibilityChangedEvent.java @@ -23,7 +23,8 @@ import com.google.gwt.event.shared.GwtEvent; * @author Vaadin Ltd * @since 8.3.2 */ -public class SpacerVisibilityChangedEvent extends GwtEvent<SpacerVisibilityChangedHandler> { +public class SpacerVisibilityChangedEvent + extends GwtEvent<SpacerVisibilityChangedHandler> { /** * Handler type. @@ -41,10 +42,10 @@ public class SpacerVisibilityChangedEvent extends GwtEvent<SpacerVisibilityChang * Creates a spacer visibility changed event. * * @param rowIndex - * index of row to which the spacer belongs + * index of row to which the spacer belongs * @param visible - * {@code true} if the spacer element is shown, {@code false} if the - * spacer element is hidden + * {@code true} if the spacer element is shown, {@code false} if + * the spacer element is hidden */ public SpacerVisibilityChangedEvent(int rowIndex, boolean visible) { this.rowIndex = rowIndex; @@ -64,7 +65,7 @@ public class SpacerVisibilityChangedEvent extends GwtEvent<SpacerVisibilityChang * Gets whether the spacer element is displayed. * * @return {@code true} if the spacer element is shown, {@code false} if the - * spacer element is hidden + * spacer element is hidden */ public boolean isSpacerVisible() { return visible; 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 d193769396..62032c9f51 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 @@ -356,8 +356,9 @@ public class AutoScroller { endBound = Math.max(finalEndBound, pageCordinate); } else { /* - * Subsequent runs make sure that the scroll area grows (but doesn't - * shrink) with the finger, but no further than the final bound. + * Subsequent runs make sure that the scroll area grows (but + * doesn't shrink) with the finger, but no further than the + * final bound. */ int oldTopBound = startBound; if (startBound < finalStartBound) { 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 4841b749c0..78d5224640 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 @@ -34,8 +34,8 @@ public class DataAvailableEvent extends GwtEvent<DataAvailableHandler> { } /** - * Returns the range of available rows in {@link com.vaadin.client.data.DataSource DataSource} - * for this event. + * Returns the range of available rows in + * {@link com.vaadin.client.data.DataSource DataSource} for this event. * * @return range of available rows */ 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 dc655443e6..3c95353a32 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 @@ -122,7 +122,8 @@ public class MultiSelectionRenderer<T> @Override public void onKeyUp(KeyUpEvent event) { - if (event.getNativeKeyCode() != KeyCodes.KEY_SPACE || !checkBox.isEnabled()) { + if (event.getNativeKeyCode() != KeyCodes.KEY_SPACE + || !checkBox.isEnabled()) { return; } int logicalRow = getLogicalRowIndex(grid, checkBox.getElement()); @@ -460,8 +461,9 @@ public class MultiSelectionRenderer<T> bottomBound = Math.max(finalBottomBound, pageY); } else { /* - * Subsequent runs make sure that the scroll area grows (but doesn't - * shrink) with the finger, but no further than the final bound. + * Subsequent runs make sure that the scroll area grows (but + * doesn't shrink) with the finger, but no further than the + * final bound. */ int oldTopBound = topBound; if (topBound < finalTopBound) { @@ -645,7 +647,7 @@ public class MultiSelectionRenderer<T> checkBox.setEnabled(grid.isEnabled() && !grid.isEditorActive()); } - private int getDOMRowIndex(RendererCellReference cell){ + private int getDOMRowIndex(RendererCellReference cell) { // getRowIndex starts with zero, that's why we add an additional 1. // getDOMRowIndex should include getHeaderRows as well, this number // should be equals to aria-rowindex. 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 003a2263c2..05c47188ff 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 @@ -124,8 +124,8 @@ public interface SelectionModel<T> { * Checks if the user is allowed to have more than on item selected. * <p> * - * @return <code>true</code> if the user is allowed to select multiple items, - * <code>false</code> otherwise + * @return <code>true</code> if the user is allowed to select multiple + * items, <code>false</code> otherwise * @since 8.2 */ boolean isMultiSelectionAllowed(); 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 a47297d34a..b19f8c7a6d 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 @@ -56,15 +56,13 @@ public class SpaceSelectHandler<T> { scrollHandler = null; } - scrollHandler = grid - .addDataAvailableHandler(dataAvailableEvent -> { - if (dataAvailableEvent.getAvailableRows() - .contains(rowIndex)) { - setSelected(grid, rowIndex); - scrollHandler.removeHandler(); - scrollHandler = null; - } - }); + scrollHandler = grid.addDataAvailableHandler(dataAvailableEvent -> { + if (dataAvailableEvent.getAvailableRows().contains(rowIndex)) { + setSelected(grid, rowIndex); + scrollHandler.removeHandler(); + scrollHandler = null; + } + }); grid.scrollToRow(rowIndex, ScrollDestination.ANY); } 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 785febc90c..fc7dc534f3 100644 --- a/client/src/main/java/com/vaadin/client/widgets/Escalator.java +++ b/client/src/main/java/com/vaadin/client/widgets/Escalator.java @@ -1150,8 +1150,8 @@ public class Escalator extends Widget * The following WAI-ARIA attributes are added through this class: * * <ul> - * <li>aria-rowcount (since 8.2)</li> - * <li>roles provided by {@link AriaGridRole} (since 8.2)</li> + * <li>aria-rowcount (since 8.2)</li> + * <li>roles provided by {@link AriaGridRole} (since 8.2)</li> * </ul> * * @since 8.2 @@ -1213,8 +1213,10 @@ public class Escalator extends Widget /** * Sets the {@code role} attribute to the given element. * - * @param element element that should get the role attribute - * @param role role to be added + * @param element + * element that should get the role attribute + * @param role + * role to be added * * @since 8.2 */ @@ -1230,15 +1232,11 @@ public class Escalator extends Widget */ public enum AriaGridRole { - ROW("row"), - ROWHEADER("rowheader"), - ROWGROUP("rowgroup"), - GRIDCELL("gridcell"), - COLUMNHEADER("columnheader"); + ROW("row"), ROWHEADER("rowheader"), ROWGROUP("rowgroup"), GRIDCELL( + "gridcell"), COLUMNHEADER("columnheader"); private final String name; - AriaGridRole(String name) { this.name = name; } @@ -1304,8 +1302,8 @@ public class Escalator extends Widget /** * Gets the role attribute of an element to represent a cell in a row. * <p> - * Usually {@link AriaGridRole#GRIDCELL} except for a cell in - * the header. + * Usually {@link AriaGridRole#GRIDCELL} except for a cell in the + * header. * * @return the role attribute for the element to represent cells * @@ -1318,8 +1316,7 @@ public class Escalator extends Widget /** * Gets the role attribute of an element to represent a row in a grid. * <p> - * Usually {@link AriaGridRole#ROW} except for a row in - * the header. + * Usually {@link AriaGridRole#ROW} except for a row in the header. * * @return the role attribute for the element to represent rows * @@ -1573,7 +1570,8 @@ public class Escalator extends Widget .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 if (col < columnConfiguration.frozenColumns) { 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 12bb50de0f..a8b070dbd0 100755 --- a/client/src/main/java/com/vaadin/client/widgets/Grid.java +++ b/client/src/main/java/com/vaadin/client/widgets/Grid.java @@ -5624,7 +5624,7 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>, /** * Returns whether Grid should handle events from Widgets in this * Column. - * + * * @return {@code true} to handle events from widgets; {@code false} to * not * @since 8.3 @@ -7377,7 +7377,7 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>, /** * Helper method for making sure desired row is visible and it is properly * rendered. - * + * * @param rowIndex * the row to look for * @param destination @@ -7402,7 +7402,7 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>, /** * Helper method for making sure desired row is visible and it is properly * rendered. - * + * * @param rowIndex * the row to look for * @param whenRendered @@ -7452,7 +7452,7 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>, /** * Helper method for scrolling and making sure row is visible. - * + * * @param rowIndex * the row index to make visible * @param destination diff --git a/client/src/main/resources/com/vaadin/DefaultWidgetSet.gwt.xml b/client/src/main/resources/com/vaadin/DefaultWidgetSet.gwt.xml index 29e8b0ca9e..393e67b238 100755 --- a/client/src/main/resources/com/vaadin/DefaultWidgetSet.gwt.xml +++ b/client/src/main/resources/com/vaadin/DefaultWidgetSet.gwt.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.8.1//EN" "http://gwtproject.org/doctype/2.8.1/gwt-module.dtd"> <module> - <!-- This GWT module defines the Vaadin DefaultWidgetSet. This is the module - you want to extend when creating an extended widget set, or when creating + <!-- This GWT module defines the Vaadin DefaultWidgetSet. This is the module + you want to extend when creating an extended widget set, or when creating a specialized widget set with a subset of the components. --> <!-- Hint for WidgetSetBuilder not to automatically update the file --> @@ -35,8 +35,8 @@ <when-type-is class="com.vaadin.client.widgets.Overlay" /> </replace-with> - <!-- Since 7.2. Compile all permutations (browser support) into one Javascript - file. Speeds up compilation and does not make the Javascript significantly + <!-- Since 7.2. Compile all permutations (browser support) into one Javascript + file. Speeds up compilation and does not make the Javascript significantly larger. --> <collapse-all-properties /> diff --git a/client/src/main/resources/com/vaadin/Vaadin.gwt.xml b/client/src/main/resources/com/vaadin/Vaadin.gwt.xml index ede232e101..347530db2c 100644 --- a/client/src/main/resources/com/vaadin/Vaadin.gwt.xml +++ b/client/src/main/resources/com/vaadin/Vaadin.gwt.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.8.1//EN" "http://gwtproject.org/doctype/2.8.1/gwt-module.dtd"> <module> - <!-- This GWT module inherits all Vaadin client side functionality modules. - This is the module you want to inherit in your client side project to be + <!-- This GWT module inherits all Vaadin client side functionality modules. + This is the module you want to inherit in your client side project to be able to use com.vaadin.* classes. --> <!-- Hint for WidgetSetBuilder not to automatically update the file --> @@ -18,7 +18,7 @@ <source path="client" /> <source path="shared" /> - <!-- Use own Scheduler implementation to be able to track if commands + <!-- Use own Scheduler implementation to be able to track if commands are running --> <replace-with class="com.vaadin.client.VSchedulerImpl"> <when-type-is class="com.google.gwt.core.client.impl.SchedulerImpl" /> @@ -29,7 +29,7 @@ <when-type-is class="com.vaadin.client.communication.PushConnection" /> </replace-with> - <!-- Set vaadin.profiler to true to include profiling support in the + <!-- Set vaadin.profiler to true to include profiling support in the module --> <define-property name="vaadin.profiler" values="true,false" /> <set-property name="vaadin.profiler" value="false" /> @@ -59,11 +59,11 @@ <when-property-is name="user.agent" value="gecko1_8" /> </none> </set-property> - + <!-- If no proper user agent is found, at least try some, e.g. with crawlers --> <set-property-fallback name="user.agent" value="safari" /> - <!-- Fall through to this rule when the browser doesn't support pointer + <!-- Fall through to this rule when the browser doesn't support pointer event --> <replace-with class="com.vaadin.client.event.PointerEventSupportImpl"> <when-type-is class="com.vaadin.client.event.PointerEventSupportImpl" /> diff --git a/client/src/test/java/com/vaadin/client/ApplicationConnectionURLGenerationTest.java b/client/src/test/java/com/vaadin/client/ApplicationConnectionURLGenerationTest.java index b901cadf24..bb9291459c 100644 --- a/client/src/test/java/com/vaadin/client/ApplicationConnectionURLGenerationTest.java +++ b/client/src/test/java/com/vaadin/client/ApplicationConnectionURLGenerationTest.java @@ -8,8 +8,7 @@ import com.vaadin.shared.util.SharedUtil; public class ApplicationConnectionURLGenerationTest { - private static final String[] URIS = { - "http://demo.vaadin.com/", // + private static final String[] URIS = { "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", "http://demo.vaadin.com:1234/foo?a", @@ -454,6 +454,38 @@ <version>${vaadin.plugin.version}</version> </plugin> <plugin> + <groupId>net.revelc.code.formatter</groupId> + <artifactId>formatter-maven-plugin</artifactId> + <version>2.7.2</version> + <configuration> + <configFile>${project.basedir}/../eclipse/VaadinJavaConventions.xml</configFile> + <skipJsFormatting>true</skipJsFormatting> + </configuration> + <executions> + <execution> + <id>format-source</id> + <goals> + <goal>format</goal> + </goals> + <phase>process-sources</phase> + </execution> + </executions> + </plugin> + <plugin> + <groupId>com.github.dantwining.whitespace-maven-plugin</groupId> + <artifactId>whitespace-maven-plugin</artifactId> + <version>1.0.4</version> + <executions> + <execution> + <id>trim-trailing-spaces-source</id> + <goals> + <goal>trim</goal> + </goals> + <phase>process-sources</phase> + </execution> + </executions> + </plugin> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-checkstyle-plugin</artifactId> <version>2.17</version> @@ -541,16 +573,6 @@ <plugins> <plugin> - <groupId>com.marvinformatics.formatter</groupId> - <artifactId>formatter-maven-plugin</artifactId> - <version>1.8.1</version> - <configuration> - <configFile>classpath:/eclipse/VaadinJavaConventions.xml</configFile> - <!-- Provide a dummy JS config file to avoid errors --> - <configJsFile>classpath:/eclipse/VaadinJavaConventions.xml</configJsFile> - </configuration> - </plugin> - <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>animal-sniffer-maven-plugin</artifactId> <executions> diff --git a/server/pom.xml b/server/pom.xml index 784e7ae41c..846a21cf54 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -140,6 +140,14 @@ <build> <plugins> <plugin> + <groupId>net.revelc.code.formatter</groupId> + <artifactId>formatter-maven-plugin</artifactId> + </plugin> + <plugin> + <groupId>com.github.dantwining.whitespace-maven-plugin</groupId> + <artifactId>whitespace-maven-plugin</artifactId> + </plugin> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <executions> diff --git a/server/src/main/java/com/vaadin/annotations/HtmlImport.java b/server/src/main/java/com/vaadin/annotations/HtmlImport.java index 244eeadd15..9b2286af8b 100644 --- a/server/src/main/java/com/vaadin/annotations/HtmlImport.java +++ b/server/src/main/java/com/vaadin/annotations/HtmlImport.java @@ -42,9 +42,9 @@ import com.vaadin.server.ClientConnector; * </ul> * Note that you should (almost) always use URLs starting with * {@literal frontend://} so that the framework can resolve the files to either - * {@literal VAADIN/frontend/es5} or {@literal VAADIN/frontend/es6} depending on if the browser - * supports ES6 classes (most browers) or not (IE11 and Safari <= 9). Polymer - * elements rely on importing dependencies using relative paths + * {@literal VAADIN/frontend/es5} or {@literal VAADIN/frontend/es6} depending on + * if the browser supports ES6 classes (most browers) or not (IE11 and Safari <= + * 9). Polymer elements rely on importing dependencies using relative paths * {@literal ../../other-element/other-element.html}, which will not work if * they are installed in different locations. * <p> diff --git a/server/src/main/java/com/vaadin/annotations/PropertyId.java b/server/src/main/java/com/vaadin/annotations/PropertyId.java index 081db3aa7c..49ebac0a63 100644 --- a/server/src/main/java/com/vaadin/annotations/PropertyId.java +++ b/server/src/main/java/com/vaadin/annotations/PropertyId.java @@ -35,22 +35,23 @@ import com.vaadin.data.HasValue; * <p> * In following usage example, the text field would be bound to property "foo" * in the Entity class. + * * <pre> - class Editor extends FormLayout { - @PropertyId("foo") - TextField myField = new TextField(); - } - - class Entity { - String foo; - } - - { - Editor editor = new Editor(); - Binder<Entity> binder = new Binder(Entity.class); - binder.bindInstanceFields(editor); - } - </pre> + * class Editor extends FormLayout { + * @PropertyId("foo") + * TextField myField = new TextField(); + * } + * + * class Entity { + * String foo; + * } + * + * { + * Editor editor = new Editor(); + * Binder<Entity> binder = new Binder(Entity.class); + * binder.bindInstanceFields(editor); + * } + * </pre> * * @since 8.0 * @author Vaadin Ltd diff --git a/server/src/main/java/com/vaadin/data/BeanPropertySet.java b/server/src/main/java/com/vaadin/data/BeanPropertySet.java index 3b57e64ff3..90c264eaa1 100644 --- a/server/src/main/java/com/vaadin/data/BeanPropertySet.java +++ b/server/src/main/java/com/vaadin/data/BeanPropertySet.java @@ -67,8 +67,9 @@ public class BeanPropertySet<T> implements PropertySet<T> { * When this instance is deserialized, it will be replaced with a * property set for the corresponding bean type and property name. */ - return get(instanceKey.type,instanceKey.checkNestedDefinitions, - new PropertyFilterDefinition(instanceKey.depth,instanceKey.ignorePackageNames)); + return get(instanceKey.type, instanceKey.checkNestedDefinitions, + new PropertyFilterDefinition(instanceKey.depth, + instanceKey.ignorePackageNames)); } } @@ -144,8 +145,8 @@ public class BeanPropertySet<T> implements PropertySet<T> { * serialize a DTO that when deserialized will get the corresponding * property definition from the cache. */ - return new SerializedPropertyDefinition(getPropertySet().instanceKey.type, - getName()); + return new SerializedPropertyDefinition( + getPropertySet().instanceKey.type, getName()); } } @@ -177,7 +178,7 @@ public class BeanPropertySet<T> implements PropertySet<T> { super(propertySet, parent.getType(), descriptor); this.parent = parent; } - + @Override public ValueProvider<T, V> getGetter() { return bean -> { @@ -210,22 +211,21 @@ public class BeanPropertySet<T> implements PropertySet<T> { public String getName() { return parent.getName() + "." + super.getName(); } - + @Override public String getTopLevelName() { return super.getName(); } - + private Object writeReplace() { /* * Instead of serializing this actual property definition, only * serialize a DTO that when deserialized will get the corresponding * property definition from the cache. */ - return new SerializedPropertyDefinition(getPropertySet().instanceKey.type, - getName()); + return new SerializedPropertyDefinition( + getPropertySet().instanceKey.type, getName()); } - /** * Gets the parent property definition. @@ -308,8 +308,8 @@ public class BeanPropertySet<T> implements PropertySet<T> { this.instanceKey = instanceKey; try { - definitions = BeanUtil.getBeanPropertyDescriptors(instanceKey.type).stream() - .filter(BeanPropertySet::hasNonObjectReadMethod) + definitions = BeanUtil.getBeanPropertyDescriptors(instanceKey.type) + .stream().filter(BeanPropertySet::hasNonObjectReadMethod) .map(descriptor -> new BeanPropertyDefinition<>(this, instanceKey.type, descriptor)) .collect(Collectors.toMap(PropertyDefinition::getName, @@ -322,13 +322,15 @@ public class BeanPropertySet<T> implements PropertySet<T> { } } - private BeanPropertySet(InstanceKey<T> instanceKey, Map<String, PropertyDefinition<T, ?>> definitions) { + private BeanPropertySet(InstanceKey<T> instanceKey, + Map<String, PropertyDefinition<T, ?>> definitions) { this.instanceKey = instanceKey; this.definitions = new HashMap<>(definitions); } - private BeanPropertySet(InstanceKey<T> instanceKey, boolean checkNestedDefinitions, - PropertyFilterDefinition propertyFilterDefinition) { + private BeanPropertySet(InstanceKey<T> instanceKey, + boolean checkNestedDefinitions, + PropertyFilterDefinition propertyFilterDefinition) { this(instanceKey); if (checkNestedDefinitions) { Objects.requireNonNull(propertyFilterDefinition, @@ -400,12 +402,13 @@ public class BeanPropertySet<T> implements PropertySet<T> { Objects.requireNonNull(beanType, "Bean type cannot be null"); InstanceKey key = new InstanceKey(beanType, false, 0, null); // Cache the reflection results - return (PropertySet<T>) INSTANCES.computeIfAbsent(key, - ignored -> new BeanPropertySet<>(key)).copy(); + return (PropertySet<T>) INSTANCES + .computeIfAbsent(key, ignored -> new BeanPropertySet<>(key)) + .copy(); } private BeanPropertySet<T> copy() { - return new BeanPropertySet<>(instanceKey,definitions); + return new BeanPropertySet<>(instanceKey, definitions); } /** @@ -428,9 +431,10 @@ public class BeanPropertySet<T> implements PropertySet<T> { InstanceKey key = new InstanceKey(beanType, false, filterDefinition.getMaxNestingDepth(), filterDefinition.getIgnorePackageNamesStartingWith()); - return (PropertySet<T>) INSTANCES.computeIfAbsent(key, - k -> new BeanPropertySet<>(key, checkNestedDefinitions, - filterDefinition)).copy(); + return (PropertySet<T>) INSTANCES + .computeIfAbsent(key, k -> new BeanPropertySet<>(key, + checkNestedDefinitions, filterDefinition)) + .copy(); } @Override @@ -479,7 +483,7 @@ public class BeanPropertySet<T> implements PropertySet<T> { /** * Gets the bean type of this bean property set. - * + * * @since 8.2 * @return the bean type of this bean property set */ diff --git a/server/src/main/java/com/vaadin/data/BeanValidationBinder.java b/server/src/main/java/com/vaadin/data/BeanValidationBinder.java index 0c1055597d..e98ce96b37 100644 --- a/server/src/main/java/com/vaadin/data/BeanValidationBinder.java +++ b/server/src/main/java/com/vaadin/data/BeanValidationBinder.java @@ -51,11 +51,11 @@ public class BeanValidationBinder<BEAN> extends Binder<BEAN> { public BeanValidationBinder(Class<BEAN> beanType) { super(beanType); if (!BeanUtil.checkBeanValidationAvailable()) { - throw new IllegalStateException( - BeanValidationBinder.class.getSimpleName() - + " cannot be used because a JSR-303 Bean Validation " - + "implementation not found on the classpath or could not be initialized. Use " - + Binder.class.getSimpleName() + " instead"); + throw new IllegalStateException(BeanValidationBinder.class + .getSimpleName() + + " cannot be used because a JSR-303 Bean Validation " + + "implementation not found on the classpath or could not be initialized. Use " + + Binder.class.getSimpleName() + " instead"); } this.beanType = beanType; } diff --git a/server/src/main/java/com/vaadin/data/Binder.java b/server/src/main/java/com/vaadin/data/Binder.java index 52c290a5ee..ef391d8369 100644 --- a/server/src/main/java/com/vaadin/data/Binder.java +++ b/server/src/main/java/com/vaadin/data/Binder.java @@ -197,9 +197,9 @@ public class Binder<BEAN> implements Serializable { /** * Gets the current read-only status for this Binding. - * + * * @see #setReadOnly(boolean) - * + * * @return {@code true} if read-only; {@code false} if not * @since 8.4 */ diff --git a/server/src/main/java/com/vaadin/data/BinderValidationStatusHandler.java b/server/src/main/java/com/vaadin/data/BinderValidationStatusHandler.java index 235e1bb068..d38845aca2 100644 --- a/server/src/main/java/com/vaadin/data/BinderValidationStatusHandler.java +++ b/server/src/main/java/com/vaadin/data/BinderValidationStatusHandler.java @@ -25,9 +25,9 @@ import com.vaadin.event.SerializableEventListener; * handling. * <p> * The default handler will show - * {@link com.vaadin.ui.AbstractComponent#setComponentError(com.vaadin.server.ErrorMessage) an - * error message} for failed field validations. For bean level validation errors - * it will display the first error message in + * {@link com.vaadin.ui.AbstractComponent#setComponentError(com.vaadin.server.ErrorMessage) + * an error message} for failed field validations. For bean level validation + * errors it will display the first error message in * {@link Binder#setStatusLabel(com.vaadin.ui.Label) status label}, if one has * been set. * diff --git a/server/src/main/java/com/vaadin/data/BindingValidationStatusHandler.java b/server/src/main/java/com/vaadin/data/BindingValidationStatusHandler.java index 4d6b23cb9e..c1a4a96e87 100644 --- a/server/src/main/java/com/vaadin/data/BindingValidationStatusHandler.java +++ b/server/src/main/java/com/vaadin/data/BindingValidationStatusHandler.java @@ -24,8 +24,8 @@ import com.vaadin.event.SerializableEventListener; * {@link BindingBuilder#withValidationStatusHandler(BindingValidationStatusHandler)} * Register} an instance of this class to be able to override the default * handling, which is to show - * {@link com.vaadin.ui.AbstractComponent#setComponentError(com.vaadin.server.ErrorMessage) an - * error message} for failed field validations. + * {@link com.vaadin.ui.AbstractComponent#setComponentError(com.vaadin.server.ErrorMessage) + * an error message} for failed field validations. * * @author Vaadin Ltd * diff --git a/server/src/main/java/com/vaadin/data/PropertyDefinition.java b/server/src/main/java/com/vaadin/data/PropertyDefinition.java index 3cd4a52912..ca5f16bba4 100644 --- a/server/src/main/java/com/vaadin/data/PropertyDefinition.java +++ b/server/src/main/java/com/vaadin/data/PropertyDefinition.java @@ -72,7 +72,7 @@ public interface PropertyDefinition<T, V> extends Serializable { /** * Gets the top level name of this property. - * + * * @return the top level property name, not <code>null</code> * @since 8.3 */ diff --git a/server/src/main/java/com/vaadin/data/PropertyFilterDefinition.java b/server/src/main/java/com/vaadin/data/PropertyFilterDefinition.java index 02825ec575..7f6d211ec1 100644 --- a/server/src/main/java/com/vaadin/data/PropertyFilterDefinition.java +++ b/server/src/main/java/com/vaadin/data/PropertyFilterDefinition.java @@ -25,21 +25,19 @@ import java.util.List; * @author Vaadin Ltd * @since 8.2 */ -public class PropertyFilterDefinition - implements Serializable { +public class PropertyFilterDefinition implements Serializable { private int maxNestingDepth; private List<String> ignorePackageNamesStartingWith; /** - * Create a property filter with max nesting depth and package names - * to ignore. + * Create a property filter with max nesting depth and package names to + * ignore. * * @param maxNestingDepth - * The maximum amount of nesting levels for - * sub-properties. + * The maximum amount of nesting levels for sub-properties. * @param ignorePackageNamesStartingWith - * Ignore package names that start with this string, for - * example "java.lang". + * Ignore package names that start with this string, for example + * "java.lang". */ public PropertyFilterDefinition(int maxNestingDepth, List<String> ignorePackageNamesStartingWith) { @@ -71,7 +69,8 @@ public class PropertyFilterDefinition * @return default property filter */ public static PropertyFilterDefinition getDefaultFilter() { - return new PropertyFilterDefinition(BeanPropertySet.NestedBeanPropertyDefinition.MAX_PROPERTY_NESTING_DEPTH, + return new PropertyFilterDefinition( + BeanPropertySet.NestedBeanPropertyDefinition.MAX_PROPERTY_NESTING_DEPTH, Arrays.asList("java")); } } diff --git a/server/src/main/java/com/vaadin/data/TreeData.java b/server/src/main/java/com/vaadin/data/TreeData.java index 817402c6e1..4dd634ae64 100644 --- a/server/src/main/java/com/vaadin/data/TreeData.java +++ b/server/src/main/java/com/vaadin/data/TreeData.java @@ -357,11 +357,11 @@ public class TreeData<T> implements Serializable { * Get the parent item for the given item. * * @param item - * the item for which to retrieve the parent item for + * the item for which to retrieve the parent item for * @return parent item for the given item or {@code null} if the item is a * root item. * @throws IllegalArgumentException - * if the item does not exist in this structure + * if the item does not exist in this structure * @since 8.1.1 */ public T getParent(T item) { @@ -375,14 +375,14 @@ public class TreeData<T> implements Serializable { /** * Moves an item to become a child of the given parent item. The new parent * item must exist in the hierarchy. Setting the parent to {@code null} - * makes the item a root item. After making changes to the tree data, {@link - * TreeDataProvider#refreshAll()} should be called. + * makes the item a root item. After making changes to the tree data, + * {@link TreeDataProvider#refreshAll()} should be called. * * @param item - * the item to be set as the child of {@code parent} + * the item to be set as the child of {@code parent} * @param parent - * the item to be set as parent or {@code null} to set the item as - * root + * the item to be set as parent or {@code null} to set the item + * as root * @since 8.1 */ public void setParent(T item, T parent) { @@ -422,9 +422,9 @@ public class TreeData<T> implements Serializable { * {@link TreeDataProvider#refreshAll()} should be called. * * @param item - * the item to be moved + * the item to be moved * @param sibling - * the item after which the moved item will be located, or {@code + * the item after which the moved item will be located, or {@code * null} to move item to first position * @since 8.1 */ @@ -451,9 +451,8 @@ public class TreeData<T> implements Serializable { if (!Objects.equals(parent, itemToWrapperMap.get(sibling).getParent())) { - throw new IllegalArgumentException( - "Items '" + item + "' and '" + sibling - + "' don't have the same parent"); + throw new IllegalArgumentException("Items '" + item + "' and '" + + sibling + "' don't have the same parent"); } List<T> children = itemToWrapperMap.get(parent).getChildren(); diff --git a/server/src/main/java/com/vaadin/data/ValidationException.java b/server/src/main/java/com/vaadin/data/ValidationException.java index e63fdf9672..1d368aba2c 100644 --- a/server/src/main/java/com/vaadin/data/ValidationException.java +++ b/server/src/main/java/com/vaadin/data/ValidationException.java @@ -59,10 +59,8 @@ public class ValidationException extends Exception { * @return a list of all validation errors */ public List<ValidationResult> getValidationErrors() { - List<ValidationResult> errors = - getFieldValidationErrors().stream() - .map(s -> s.getResult().get()) - .collect(Collectors.toList()); + List<ValidationResult> errors = getFieldValidationErrors().stream() + .map(s -> s.getResult().get()).collect(Collectors.toList()); errors.addAll(getBeanValidationErrors()); return errors; } diff --git a/server/src/main/java/com/vaadin/data/converter/LocalDateTimeToDateConverter.java b/server/src/main/java/com/vaadin/data/converter/LocalDateTimeToDateConverter.java index 6ee8411a13..5e45bab20e 100644 --- a/server/src/main/java/com/vaadin/data/converter/LocalDateTimeToDateConverter.java +++ b/server/src/main/java/com/vaadin/data/converter/LocalDateTimeToDateConverter.java @@ -35,21 +35,25 @@ import com.vaadin.ui.InlineDateTimeField; * @author Vaadin Ltd * @since 8.0 */ -public class LocalDateTimeToDateConverter implements Converter<LocalDateTime, Date> { +public class LocalDateTimeToDateConverter + implements Converter<LocalDateTime, Date> { private ZoneId zoneId; /** * Creates a new converter using the given time zone. * - * @param zoneId the time zone to use, not <code>null</code> + * @param zoneId + * the time zone to use, not <code>null</code> */ public LocalDateTimeToDateConverter(ZoneId zoneId) { - this.zoneId = Objects.requireNonNull(zoneId, "Zone identifier cannot be null"); + this.zoneId = Objects.requireNonNull(zoneId, + "Zone identifier cannot be null"); } @Override - public Result<Date> convertToModel(LocalDateTime localDate, ValueContext context) { + public Result<Date> convertToModel(LocalDateTime localDate, + ValueContext context) { if (localDate == null) { return Result.ok(null); } @@ -58,12 +62,14 @@ public class LocalDateTimeToDateConverter implements Converter<LocalDateTime, Da } @Override - public LocalDateTime convertToPresentation(Date date, ValueContext context) { + public LocalDateTime convertToPresentation(Date date, + ValueContext context) { if (date == null) { return null; } - return Instant.ofEpochMilli(date.getTime()).atZone(zoneId).toLocalDateTime(); + return Instant.ofEpochMilli(date.getTime()).atZone(zoneId) + .toLocalDateTime(); } } diff --git a/server/src/main/java/com/vaadin/data/converter/StringToDateConverter.java b/server/src/main/java/com/vaadin/data/converter/StringToDateConverter.java index 8d6d87acfe..92481618ea 100644 --- a/server/src/main/java/com/vaadin/data/converter/StringToDateConverter.java +++ b/server/src/main/java/com/vaadin/data/converter/StringToDateConverter.java @@ -41,8 +41,9 @@ import com.vaadin.data.ValueContext; public class StringToDateConverter implements Converter<String, Date> { /** - * Returns the format used by {@link #convertToPresentation(Date, ValueContext)} - * and {@link #convertToModel(String, ValueContext)}. + * Returns the format used by + * {@link #convertToPresentation(Date, ValueContext)} and + * {@link #convertToModel(String, ValueContext)}. * * @param locale * The locale to use diff --git a/server/src/main/java/com/vaadin/data/provider/AbstractHierarchicalDataProvider.java b/server/src/main/java/com/vaadin/data/provider/AbstractHierarchicalDataProvider.java index 99e226c775..b8b5e60ab6 100644 --- a/server/src/main/java/com/vaadin/data/provider/AbstractHierarchicalDataProvider.java +++ b/server/src/main/java/com/vaadin/data/provider/AbstractHierarchicalDataProvider.java @@ -27,8 +27,7 @@ package com.vaadin.data.provider; * @param <F> * filter type */ -public abstract class AbstractHierarchicalDataProvider<T, F> - extends AbstractDataProvider<T, F> - implements HierarchicalDataProvider<T, F> { +public abstract class AbstractHierarchicalDataProvider<T, F> extends + AbstractDataProvider<T, F> implements HierarchicalDataProvider<T, F> { } diff --git a/server/src/main/java/com/vaadin/data/provider/DataProvider.java b/server/src/main/java/com/vaadin/data/provider/DataProvider.java index 33a5c64150..e785aef1df 100644 --- a/server/src/main/java/com/vaadin/data/provider/DataProvider.java +++ b/server/src/main/java/com/vaadin/data/provider/DataProvider.java @@ -161,8 +161,8 @@ public interface DataProvider<T, F> extends Serializable { * // ComboBox uses String as the filter type * DataProvider<Person, String> wrappedProvider = dataProvider * .withConvertedFilter(filterText -> { - * SerializablePredicate<Person> predicate = person -> person.getName() - * .startsWith(filterText); + * SerializablePredicate<Person> predicate = person -> person + * .getName().startsWith(filterText); * return predicate; * }); * comboBox.setDataProvider(wrappedProvider); diff --git a/server/src/main/java/com/vaadin/data/provider/GridSortOrder.java b/server/src/main/java/com/vaadin/data/provider/GridSortOrder.java index c90e7aeb16..9f0293ef5f 100644 --- a/server/src/main/java/com/vaadin/data/provider/GridSortOrder.java +++ b/server/src/main/java/com/vaadin/data/provider/GridSortOrder.java @@ -28,7 +28,8 @@ import com.vaadin.ui.Grid.Column; public class GridSortOrder<T> extends SortOrder<Column<T, ?>> { /** - * Construct sorting information for usage in a {@link com.vaadin.ui.Grid Grid}. + * Construct sorting information for usage in a {@link com.vaadin.ui.Grid + * Grid}. * * @param column * the column to be sorted diff --git a/server/src/main/java/com/vaadin/data/provider/HierarchicalDataCommunicator.java b/server/src/main/java/com/vaadin/data/provider/HierarchicalDataCommunicator.java index 5e8905ea59..73bd9e0221 100644 --- a/server/src/main/java/com/vaadin/data/provider/HierarchicalDataCommunicator.java +++ b/server/src/main/java/com/vaadin/data/provider/HierarchicalDataCommunicator.java @@ -116,14 +116,17 @@ public class HierarchicalDataCommunicator<T> extends DataCommunicator<T> { } /** - * Create new {@code HierarchyMapper} for the given data provider. - * May be overridden in subclasses. + * Create new {@code HierarchyMapper} for the given data provider. May be + * overridden in subclasses. * - * @param dataProvider the data provider - * @param <F> Query type + * @param dataProvider + * the data provider + * @param <F> + * Query type * @return new {@link HierarchyMapper} */ - protected <F> HierarchyMapper<T, F> createHierarchyMapper(HierarchicalDataProvider<T, F> dataProvider) { + protected <F> HierarchyMapper<T, F> createHierarchyMapper( + HierarchicalDataProvider<T, F> dataProvider) { return new HierarchyMapper<>(dataProvider); } @@ -171,7 +174,7 @@ public class HierarchicalDataCommunicator<T> extends DataCommunicator<T> { * method will have no effect if the row is already collapsed. * {@code syncAndRefresh} indicates whether the changes should be * synchronised to the client and the data provider be notified. - * + * * @param item * the item to collapse * @param syncAndRefresh @@ -180,7 +183,8 @@ public class HierarchicalDataCommunicator<T> extends DataCommunicator<T> { * changes, {@code false} otherwise. */ public void collapse(T item, boolean syncAndRefresh) { - Integer index = syncAndRefresh ? mapper.getIndexOf(item).orElse(null) : null; + Integer index = syncAndRefresh ? mapper.getIndexOf(item).orElse(null) + : null; doCollapse(item, index, syncAndRefresh); } @@ -202,7 +206,7 @@ public class HierarchicalDataCommunicator<T> extends DataCommunicator<T> { * will have no effect if the row is already collapsed. The index is * provided by the client-side or calculated from a full data request. * - * + * * @param item * the item to collapse * @param index @@ -220,7 +224,7 @@ public class HierarchicalDataCommunicator<T> extends DataCommunicator<T> { * provided by the client-side or calculated from a full data request. * {@code syncAndRefresh} indicates whether the changes should be * synchronised to the client and the data provider be notified. - * + * * @param item * the item to collapse * @param index @@ -267,7 +271,8 @@ public class HierarchicalDataCommunicator<T> extends DataCommunicator<T> { * false} otherwise. */ public void expand(T item, boolean syncAndRefresh) { - Integer index = syncAndRefresh ? mapper.getIndexOf(item).orElse(null) : null; + Integer index = syncAndRefresh ? mapper.getIndexOf(item).orElse(null) + : null; doExpand(item, index, syncAndRefresh); } @@ -304,11 +309,10 @@ public class HierarchicalDataCommunicator<T> extends DataCommunicator<T> { Range addedRows = mapper.expand(item, index); if (syncAndRefresh) { if (!reset && !addedRows.isEmpty()) { - getClientRpc() - .insertRows(addedRows.getStart(), addedRows.length()); - Stream<T> children = mapper - .fetchItems(item, - Range.withLength(0, addedRows.length())); + getClientRpc().insertRows(addedRows.getStart(), + addedRows.length()); + Stream<T> children = mapper.fetchItems(item, + Range.withLength(0, addedRows.length())); pushData(addedRows.getStart(), children.collect(Collectors.toList())); } diff --git a/server/src/main/java/com/vaadin/data/provider/HierarchyMapper.java b/server/src/main/java/com/vaadin/data/provider/HierarchyMapper.java index ef7ea945c7..d03a601492 100644 --- a/server/src/main/java/com/vaadin/data/provider/HierarchyMapper.java +++ b/server/src/main/java/com/vaadin/data/provider/HierarchyMapper.java @@ -397,8 +397,11 @@ public class HierarchyMapper<T, F> implements DataGenerator<T> { /** * Find parent for the given item among open folders. - * @param item the item - * @return parent item or {@code null} for root items or if the parent is closed + * + * @param item + * the item + * @return parent item or {@code null} for root items or if the parent is + * closed */ protected T getParentOfItem(T item) { Objects.requireNonNull(item, "Can not find the parent of null"); @@ -408,8 +411,8 @@ public class HierarchyMapper<T, F> implements DataGenerator<T> { /** * Removes all children of an item identified by a given id. Items removed * by this method as well as the original item are all marked to be - * collapsed. - * May be overridden in subclasses for removing obsolete data to avoid memory leaks. + * collapsed. May be overridden in subclasses for removing obsolete data to + * avoid memory leaks. * * @param id * the item id @@ -427,10 +430,11 @@ public class HierarchyMapper<T, F> implements DataGenerator<T> { } } expandedItemIds.remove(id); - invalidatedChildren.stream().map(getDataProvider()::getId).forEach(x -> { - removeChildren(x); - parentIdMap.remove(x); - }); + invalidatedChildren.stream().map(getDataProvider()::getId) + .forEach(x -> { + removeChildren(x); + parentIdMap.remove(x); + }); } /** @@ -532,15 +536,18 @@ public class HierarchyMapper<T, F> implements DataGenerator<T> { } /** - * Register parent and children items into inner structures. - * May be overridden in subclasses. + * Register parent and children items into inner structures. May be + * overridden in subclasses. * - * @param parent the parent item - * @param childList list of parents children to be registered. + * @param parent + * the parent item + * @param childList + * list of parents children to be registered. */ protected void registerChildren(T parent, List<T> childList) { childMap.put(parent, new HashSet<>(childList)); - childList.forEach(x -> parentIdMap.put(getDataProvider().getId(x), parent)); + childList.forEach( + x -> parentIdMap.put(getDataProvider().getId(x), parent)); } /** diff --git a/server/src/main/java/com/vaadin/data/provider/InMemoryDataProvider.java b/server/src/main/java/com/vaadin/data/provider/InMemoryDataProvider.java index 514596a90e..ee301f0aa9 100644 --- a/server/src/main/java/com/vaadin/data/provider/InMemoryDataProvider.java +++ b/server/src/main/java/com/vaadin/data/provider/InMemoryDataProvider.java @@ -383,8 +383,7 @@ public interface InMemoryDataProvider<T> extends ValueProvider<T, String> valueProvider, Locale locale) { Objects.requireNonNull(locale, "Locale cannot be null"); return InMemoryDataProviderHelpers.filteringByCaseInsensitiveString( - this, valueProvider, - String::contains, () -> locale); + this, valueProvider, String::contains, () -> locale); } /** @@ -425,8 +424,8 @@ public interface InMemoryDataProvider<T> extends */ public default DataProvider<T, String> filteringByPrefix( ValueProvider<T, String> valueProvider, Locale locale) { - return InMemoryDataProviderHelpers.filteringByCaseInsensitiveString(this, valueProvider, - String::startsWith, () -> locale); + return InMemoryDataProviderHelpers.filteringByCaseInsensitiveString( + this, valueProvider, String::startsWith, () -> locale); } /** @@ -445,7 +444,8 @@ public interface InMemoryDataProvider<T> extends */ public default DataProvider<T, String> filteringByPrefix( ValueProvider<T, String> valueProvider) { - return InMemoryDataProviderHelpers.filteringByCaseInsensitiveString(this, valueProvider, - String::startsWith, InMemoryDataProviderHelpers.CURRENT_LOCALE_SUPPLIER); + return InMemoryDataProviderHelpers.filteringByCaseInsensitiveString( + this, valueProvider, String::startsWith, + InMemoryDataProviderHelpers.CURRENT_LOCALE_SUPPLIER); } } diff --git a/server/src/main/java/com/vaadin/event/ActionManager.java b/server/src/main/java/com/vaadin/event/ActionManager.java index 6cdb83e332..7ae89950b0 100644 --- a/server/src/main/java/com/vaadin/event/ActionManager.java +++ b/server/src/main/java/com/vaadin/event/ActionManager.java @@ -41,8 +41,7 @@ import com.vaadin.ui.Component; * * */ -public class ActionManager - implements Action.Handler, Action.Notifier { +public class ActionManager implements Action.Handler, Action.Notifier { private static final long serialVersionUID = 1641868163608066491L; diff --git a/server/src/main/java/com/vaadin/event/CollapseEvent.java b/server/src/main/java/com/vaadin/event/CollapseEvent.java index 9d739917d7..9bcadf08f2 100644 --- a/server/src/main/java/com/vaadin/event/CollapseEvent.java +++ b/server/src/main/java/com/vaadin/event/CollapseEvent.java @@ -30,7 +30,8 @@ import com.vaadin.util.ReflectTools; * @param <T> * collapsed item type */ -public class CollapseEvent<T> extends Component.Event implements HasUserOriginated { +public class CollapseEvent<T> extends Component.Event + implements HasUserOriginated { private final T collapsedItem; diff --git a/server/src/main/java/com/vaadin/event/MarkedAsDirtyConnectorEvent.java b/server/src/main/java/com/vaadin/event/MarkedAsDirtyConnectorEvent.java index 7a18cbd16c..a588f6c5c2 100644 --- a/server/src/main/java/com/vaadin/event/MarkedAsDirtyConnectorEvent.java +++ b/server/src/main/java/com/vaadin/event/MarkedAsDirtyConnectorEvent.java @@ -19,8 +19,8 @@ import com.vaadin.server.ClientConnector; import com.vaadin.ui.UI; /** - * Event which is fired for all registered MarkDirtyListeners when a - * connector is marked as dirty. + * Event which is fired for all registered MarkDirtyListeners when a connector + * is marked as dirty. * * @since 8.4 */ diff --git a/server/src/main/java/com/vaadin/event/MarkedAsDirtyListener.java b/server/src/main/java/com/vaadin/event/MarkedAsDirtyListener.java index f973de322a..bc99cec7ed 100644 --- a/server/src/main/java/com/vaadin/event/MarkedAsDirtyListener.java +++ b/server/src/main/java/com/vaadin/event/MarkedAsDirtyListener.java @@ -27,7 +27,7 @@ public interface MarkedAsDirtyListener extends ConnectorEventListener { * Method called when a client connector has been marked as dirty. * * @param event - * marked as dirty connector event object + * marked as dirty connector event object */ void connectorMarkedAsDirty(MarkedAsDirtyConnectorEvent event); } 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 8c42fc66f5..4a7018b7d4 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 @@ -60,10 +60,11 @@ public interface AcceptCriterion extends Serializable { public void paint(PaintTarget target) throws PaintException; /** - * This needs to be implemented if and only if a criterion does some lazy server side - * 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. + * This needs to be implemented if and only if a criterion does some lazy + * server side 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 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 7460096417..66abd5bace 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 @@ -30,8 +30,7 @@ import com.vaadin.server.PaintTarget; * * @since 6.3 */ -public abstract class ClientSideCriterion - implements AcceptCriterion { +public abstract class ClientSideCriterion implements AcceptCriterion { /* * All criteria that extend this must be completely validatable on client 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 ca02a5730e..d03c9ce2b5 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 @@ -36,8 +36,7 @@ import com.vaadin.server.PaintTarget; * * @since 6.3 */ -public abstract class ServerSideCriterion - implements AcceptCriterion { +public abstract class ServerSideCriterion implements AcceptCriterion { private static final long serialVersionUID = 2128510128911628902L; diff --git a/server/src/main/java/com/vaadin/server/BootstrapFragmentResponse.java b/server/src/main/java/com/vaadin/server/BootstrapFragmentResponse.java index 8e61786471..5b7024e517 100644 --- a/server/src/main/java/com/vaadin/server/BootstrapFragmentResponse.java +++ b/server/src/main/java/com/vaadin/server/BootstrapFragmentResponse.java @@ -36,7 +36,8 @@ public class BootstrapFragmentResponse extends BootstrapResponse { /** * Crate a new bootstrap fragment response. * - * @see BootstrapResponse#BootstrapResponse(BootstrapHandler, VaadinRequest, VaadinSession, Class, UIProvider) + * @see BootstrapResponse#BootstrapResponse(BootstrapHandler, VaadinRequest, + * VaadinSession, Class, UIProvider) * * @param handler * the bootstrap handler that is firing the event diff --git a/server/src/main/java/com/vaadin/server/BootstrapHandler.java b/server/src/main/java/com/vaadin/server/BootstrapHandler.java index dc687a6254..8f52b67085 100644 --- a/server/src/main/java/com/vaadin/server/BootstrapHandler.java +++ b/server/src/main/java/com/vaadin/server/BootstrapHandler.java @@ -325,8 +325,7 @@ public abstract class BootstrapHandler extends SynchronizedRequestHandler { protected String encodeQueryStringParameterValue(String queryString) { String encodedString = null; try { - encodedString = URLEncoder.encode(queryString, - UTF_8.name()); + encodedString = URLEncoder.encode(queryString, UTF_8.name()); } catch (UnsupportedEncodingException e) { // should never happen throw new RuntimeException("Could not find UTF-8", e); @@ -661,8 +660,8 @@ public abstract class BootstrapHandler extends SynchronizedRequestHandler { mainDiv.attr("id", context.getAppId()); mainDiv.addClass("v-app"); mainDiv.addClass(context.getThemeName()); - mainDiv.addClass(context.getUIClass().getSimpleName() - .toLowerCase(Locale.ROOT)); + mainDiv.addClass( + context.getUIClass().getSimpleName().toLowerCase(Locale.ROOT)); if (style != null && !style.isEmpty()) { mainDiv.attr("style", style); } diff --git a/server/src/main/java/com/vaadin/server/BootstrapPageResponse.java b/server/src/main/java/com/vaadin/server/BootstrapPageResponse.java index 6c98a0d1c0..75777808d5 100644 --- a/server/src/main/java/com/vaadin/server/BootstrapPageResponse.java +++ b/server/src/main/java/com/vaadin/server/BootstrapPageResponse.java @@ -38,7 +38,8 @@ public class BootstrapPageResponse extends BootstrapResponse { /** * Crate a new bootstrap page response. * - * @see BootstrapResponse#BootstrapResponse(BootstrapHandler, VaadinRequest, VaadinSession, Class, UIProvider) + * @see BootstrapResponse#BootstrapResponse(BootstrapHandler, VaadinRequest, + * VaadinSession, Class, UIProvider) * * @param handler * the bootstrap handler that is firing the event diff --git a/server/src/main/java/com/vaadin/server/JsonCodec.java b/server/src/main/java/com/vaadin/server/JsonCodec.java index 95c0661be8..eeb27b0e5a 100644 --- a/server/src/main/java/com/vaadin/server/JsonCodec.java +++ b/server/src/main/java/com/vaadin/server/JsonCodec.java @@ -329,7 +329,8 @@ public class JsonCodec implements Serializable { Class<?> classForType = getClassForType(targetType); return decodeEnum(classForType.asSubclass(Enum.class), (JsonString) value); - } else if (CUSTOM_SERIALIZERS.containsKey(getClassForType(targetType))) { + } else if (CUSTOM_SERIALIZERS + .containsKey(getClassForType(targetType))) { return CUSTOM_SERIALIZERS.get(getClassForType(targetType)) .deserialize(targetType, value, connectorTracker); } else { @@ -695,7 +696,8 @@ public class JsonCodec implements Serializable { public static Collection<BeanProperty> getProperties(Class<?> type) throws IntrospectionException { - Collection<BeanProperty> cachedProperties = TYPE_PROPERTY_CACHE.get(type); + Collection<BeanProperty> cachedProperties = TYPE_PROPERTY_CACHE + .get(type); if (cachedProperties != null) { return cachedProperties; } diff --git a/server/src/main/java/com/vaadin/server/StreamVariable.java b/server/src/main/java/com/vaadin/server/StreamVariable.java index decff522b6..698f3c2b35 100644 --- a/server/src/main/java/com/vaadin/server/StreamVariable.java +++ b/server/src/main/java/com/vaadin/server/StreamVariable.java @@ -53,8 +53,8 @@ public interface StreamVariable extends Serializable { * {@link #onProgress(long, long)} is called in a synchronized block when * the content is being received. This is potentially bit slow, so we are * calling that method only if requested. The value is requested after the - * {@link #streamingStarted(StreamingStartEvent)} event, but not after reading - * each buffer. + * {@link #streamingStarted(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. @@ -116,8 +116,8 @@ public interface StreamVariable extends Serializable { } /** - * Event passed to {@link #streamingStarted(StreamingStartEvent)} method before - * the streaming of the content to {@link StreamVariable} starts. + * Event passed to {@link #streamingStarted(StreamingStartEvent)} method + * before the streaming of the content to {@link StreamVariable} starts. */ public interface StreamingStartEvent extends StreamingEvent { /** diff --git a/server/src/main/java/com/vaadin/server/SystemMessages.java b/server/src/main/java/com/vaadin/server/SystemMessages.java index 0515845a59..9bb403b2d0 100644 --- a/server/src/main/java/com/vaadin/server/SystemMessages.java +++ b/server/src/main/java/com/vaadin/server/SystemMessages.java @@ -138,7 +138,8 @@ public class SystemMessages implements Serializable { */ public String getCommunicationErrorCaption() { return (communicationErrorNotificationEnabled - ? communicationErrorCaption : null); + ? communicationErrorCaption + : null); } /** @@ -147,7 +148,8 @@ public class SystemMessages implements Serializable { */ public String getCommunicationErrorMessage() { return (communicationErrorNotificationEnabled - ? communicationErrorMessage : null); + ? communicationErrorMessage + : null); } /** @@ -170,7 +172,8 @@ public class SystemMessages implements Serializable { */ public String getAuthenticationErrorCaption() { return (authenticationErrorNotificationEnabled - ? authenticationErrorCaption : null); + ? authenticationErrorCaption + : null); } /** @@ -179,7 +182,8 @@ public class SystemMessages implements Serializable { */ public String getAuthenticationErrorMessage() { return (authenticationErrorNotificationEnabled - ? authenticationErrorMessage : null); + ? authenticationErrorMessage + : null); } /** diff --git a/server/src/main/java/com/vaadin/server/VaadinResponse.java b/server/src/main/java/com/vaadin/server/VaadinResponse.java index e719a47ea6..bc5f0afffd 100644 --- a/server/src/main/java/com/vaadin/server/VaadinResponse.java +++ b/server/src/main/java/com/vaadin/server/VaadinResponse.java @@ -194,8 +194,7 @@ public interface VaadinResponse extends Serializable { public default void setNoCacheHeaders() { // no-store to disallow storing even if cache would be revalidated // must-revalidate to not use stored value even if someone asks for it - setHeader("Cache-Control", - "no-cache, no-store, must-revalidate"); + setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); // Also set legacy values in case of old proxies in between setHeader("Pragma", "no-cache"); diff --git a/server/src/main/java/com/vaadin/server/VaadinServletService.java b/server/src/main/java/com/vaadin/server/VaadinServletService.java index caec60362b..ce2f257242 100644 --- a/server/src/main/java/com/vaadin/server/VaadinServletService.java +++ b/server/src/main/java/com/vaadin/server/VaadinServletService.java @@ -47,9 +47,9 @@ public class VaadinServletService extends VaadinService { } /** - * Creates a servlet service. This method is for use by dependency - * injection frameworks etc. {@link #getServlet()} should be overridden (or otherwise intercepted) - * so it does not return <code>null</code>. + * Creates a servlet service. This method is for use by dependency injection + * frameworks etc. {@link #getServlet()} should be overridden (or otherwise + * intercepted) so it does not return <code>null</code>. * * @since 8.2 */ @@ -79,9 +79,9 @@ public class VaadinServletService extends VaadinService { } /** - * Retrieves a reference to the servlet associated with this service. - * Should be overridden (or otherwise intercepted) if the no-arg - * constructor is used to prevent NPEs. + * Retrieves a reference to the servlet associated with this service. Should + * be overridden (or otherwise intercepted) if the no-arg constructor is + * used to prevent NPEs. * * @return A reference to the VaadinServlet this service is using */ 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 0497b03d10..33c2041f8c 100644 --- a/server/src/main/java/com/vaadin/server/communication/PushHandler.java +++ b/server/src/main/java/com/vaadin/server/communication/PushHandler.java @@ -468,7 +468,8 @@ public class PushHandler { "sendNotificationAndDisconnect called for resource no longer in scope"); return; } - resource.getResponse().setContentType(JsonConstants.JSON_CONTENT_TYPE); + resource.getResponse() + .setContentType(JsonConstants.JSON_CONTENT_TYPE); resource.getResponse().getWriter().write(notificationJson); resource.resume(); } catch (Exception e) { 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 bbc0ea4eea..178347fdf2 100644 --- a/server/src/main/java/com/vaadin/server/communication/PushRequestHandler.java +++ b/server/src/main/java/com/vaadin/server/communication/PushRequestHandler.java @@ -55,8 +55,7 @@ import com.vaadin.shared.communication.PushConstants; * @author Vaadin Ltd * @since 7.1 */ -public class PushRequestHandler - implements SessionExpiredHandler { +public class PushRequestHandler implements SessionExpiredHandler { private AtmosphereFramework atmosphere; private PushHandler pushHandler; 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 4f9b00b613..5edc86b6f7 100644 --- a/server/src/main/java/com/vaadin/server/communication/UIInitHandler.java +++ b/server/src/main/java/com/vaadin/server/communication/UIInitHandler.java @@ -222,7 +222,7 @@ public abstract class UIInitHandler extends SynchronizedRequestHandler { session.addUI(ui); if (initException != null) { ui.getSession().getCommunicationManager() - .handleConnectorRelatedException(ui, initException); + .handleConnectorRelatedException(ui, initException); } // Warn if the window can't be preserved if (embedId == null @@ -310,7 +310,7 @@ public abstract class UIInitHandler extends SynchronizedRequestHandler { String seckey = session.getCsrfToken(); return "\"" + ApplicationConstants.UIDL_SECURITY_TOKEN_ID + "\":\"" - + seckey + "\","; + + seckey + "\","; } /** diff --git a/server/src/main/java/com/vaadin/ui/AbstractColorPicker.java b/server/src/main/java/com/vaadin/ui/AbstractColorPicker.java index f73aa74414..8a0427b035 100644 --- a/server/src/main/java/com/vaadin/ui/AbstractColorPicker.java +++ b/server/src/main/java/com/vaadin/ui/AbstractColorPicker.java @@ -567,7 +567,7 @@ public abstract class AbstractColorPicker extends AbstractField<Color> { * Note: It must be set to {@code true} if ColorPicker is a child of modal * {@link Window} * </p> - * + * * @see Window#setModal * @since * @param modal diff --git a/server/src/main/java/com/vaadin/ui/AbstractListing.java b/server/src/main/java/com/vaadin/ui/AbstractListing.java index 0bcf3497db..4d7f567728 100644 --- a/server/src/main/java/com/vaadin/ui/AbstractListing.java +++ b/server/src/main/java/com/vaadin/ui/AbstractListing.java @@ -430,9 +430,8 @@ public abstract class AbstractListing<T> extends AbstractComponent ((DeclarativeCaptionGenerator) captionGenerator).setCaption(item, caption); } else { - throw new IllegalStateException(String.format( - "Don't know how " - + "to set caption using current caption generator '%s'", + throw new IllegalStateException(String.format("Don't know how " + + "to set caption using current caption generator '%s'", captionGenerator.getClass().getName())); } @@ -443,9 +442,8 @@ public abstract class AbstractListing<T> extends AbstractComponent DesignAttributeHandler.readAttribute("icon", child.attributes(), Resource.class)); } else { - throw new IllegalStateException(String.format( - "Don't know how " - + "to set icon using current caption generator '%s'", + throw new IllegalStateException(String.format("Don't know how " + + "to set icon using current caption generator '%s'", iconGenerator.getClass().getName())); } } diff --git a/server/src/main/java/com/vaadin/ui/AbstractLocalDateField.java b/server/src/main/java/com/vaadin/ui/AbstractLocalDateField.java index 55df895e9a..7bd245382f 100644 --- a/server/src/main/java/com/vaadin/ui/AbstractLocalDateField.java +++ b/server/src/main/java/com/vaadin/ui/AbstractLocalDateField.java @@ -160,6 +160,7 @@ public abstract class AbstractLocalDateField @Override protected LocalDate toType(TemporalAccessor temporalAccessor) { - return temporalAccessor == null? null : LocalDate.from(temporalAccessor); + return temporalAccessor == null ? null + : LocalDate.from(temporalAccessor); } } diff --git a/server/src/main/java/com/vaadin/ui/AbstractLocalDateTimeField.java b/server/src/main/java/com/vaadin/ui/AbstractLocalDateTimeField.java index cba5f5b068..6f7037d732 100644 --- a/server/src/main/java/com/vaadin/ui/AbstractLocalDateTimeField.java +++ b/server/src/main/java/com/vaadin/ui/AbstractLocalDateTimeField.java @@ -183,6 +183,7 @@ public abstract class AbstractLocalDateTimeField @Override protected LocalDateTime toType(TemporalAccessor temporalAccessor) { - return temporalAccessor == null? null : LocalDateTime.from(temporalAccessor); + return temporalAccessor == null ? null + : LocalDateTime.from(temporalAccessor); } } diff --git a/server/src/main/java/com/vaadin/ui/AbstractMultiSelect.java b/server/src/main/java/com/vaadin/ui/AbstractMultiSelect.java index 43a2724a7a..3654db8a3f 100644 --- a/server/src/main/java/com/vaadin/ui/AbstractMultiSelect.java +++ b/server/src/main/java/com/vaadin/ui/AbstractMultiSelect.java @@ -326,8 +326,8 @@ public abstract class AbstractMultiSelect<T> extends AbstractListing<T> DataProvider<T, ?> dataProvider = internalGetDataProvider(); addedItems.removeIf(item -> { Object addedId = dataProvider.getId(item); - return removedItems.stream().map(dataProvider::getId) - .anyMatch(addedId::equals)? removedItems.remove(item):false; + return removedItems.stream().map(dataProvider::getId).anyMatch( + addedId::equals) ? removedItems.remove(item) : false; }); if (isAllSelected(addedItems) && isNoneSelected(removedItems)) { diff --git a/server/src/main/java/com/vaadin/ui/AbstractTextField.java b/server/src/main/java/com/vaadin/ui/AbstractTextField.java index 091213fbbc..e10f7e4425 100644 --- a/server/src/main/java/com/vaadin/ui/AbstractTextField.java +++ b/server/src/main/java/com/vaadin/ui/AbstractTextField.java @@ -45,7 +45,8 @@ import elemental.json.Json; * @since 8.0 */ public abstract class AbstractTextField extends AbstractField<String> - implements HasValueChangeMode, FieldEvents.FocusNotifier, FieldEvents.BlurNotifier { + implements HasValueChangeMode, FieldEvents.FocusNotifier, + FieldEvents.BlurNotifier { private final class AbstractTextFieldServerRpcImpl implements AbstractTextFieldServerRpc { diff --git a/server/src/main/java/com/vaadin/ui/CheckBoxGroup.java b/server/src/main/java/com/vaadin/ui/CheckBoxGroup.java index dcefeafe3d..7f911b428c 100644 --- a/server/src/main/java/com/vaadin/ui/CheckBoxGroup.java +++ b/server/src/main/java/com/vaadin/ui/CheckBoxGroup.java @@ -223,9 +223,8 @@ public class CheckBoxGroup<T> extends AbstractMultiSelect<T> ((DeclarativeItemEnabledProvider) provider).addDisabled(item); } } else { - throw new IllegalStateException(String.format( - "Don't know how " - + "to disable item using current item enabled provider '%s'", + throw new IllegalStateException(String.format("Don't know how " + + "to disable item using current item enabled provider '%s'", provider.getClass().getName())); } return item; diff --git a/server/src/main/java/com/vaadin/ui/ConnectorTracker.java b/server/src/main/java/com/vaadin/ui/ConnectorTracker.java index 0c331ae8ee..0c6cce3077 100644 --- a/server/src/main/java/com/vaadin/ui/ConnectorTracker.java +++ b/server/src/main/java/com/vaadin/ui/ConnectorTracker.java @@ -75,7 +75,8 @@ public class ConnectorTracker implements Serializable { private final Set<ClientConnector> dirtyConnectors = new HashSet<>(); private final Set<ClientConnector> uninitializedConnectors = new HashSet<>(); - private List<MarkedAsDirtyListener> markedDirtyListeners = new ArrayList<>(0); + private List<MarkedAsDirtyListener> markedDirtyListeners = new ArrayList<>( + 0); /** * Connectors that have been unregistered and should be cleaned up the next @@ -509,8 +510,7 @@ public class ConnectorTracker implements Serializable { /** * Mark the connector as dirty and notifies any marked as dirty listeners. - * This should not be done while the response - * is being written. + * This should not be done while the response is being written. * * @see #getDirtyConnectors() * @see #isWritingResponse() @@ -531,7 +531,7 @@ public class ConnectorTracker implements Serializable { } } - if(!isDirty(connector)) { + if (!isDirty(connector)) { notifyMarkedAsDirtyListeners(connector); } @@ -916,7 +916,7 @@ public class ConnectorTracker implements Serializable { * connector is marked as dirty. * * @param listener - * listener to add + * listener to add * @since 8.4 * @return registration for removing listener registration */ @@ -931,7 +931,7 @@ public class ConnectorTracker implements Serializable { * has been marked as dirty. * * @param connector - * client connector marked as dirty + * client connector marked as dirty * @since 8.4 */ public void notifyMarkedAsDirtyListeners(ClientConnector connector) { diff --git a/server/src/main/java/com/vaadin/ui/DateField.java b/server/src/main/java/com/vaadin/ui/DateField.java index 090156c89d..a79cbd8400 100644 --- a/server/src/main/java/com/vaadin/ui/DateField.java +++ b/server/src/main/java/com/vaadin/ui/DateField.java @@ -92,8 +92,8 @@ public class DateField extends AbstractLocalDateField { } /** - * Constructs a new {@code DateField} with the given caption, initial - * text contents and a value change listener. + * Constructs a new {@code DateField} with the given caption, initial text + * contents and a value change listener. * <p> * The listener is called when the value of this {@code DateField} is * changed either by the user or programmatically. diff --git a/server/src/main/java/com/vaadin/ui/Grid.java b/server/src/main/java/com/vaadin/ui/Grid.java index 887a43f5c8..aedd32035c 100644 --- a/server/src/main/java/com/vaadin/ui/Grid.java +++ b/server/src/main/java/com/vaadin/ui/Grid.java @@ -2100,7 +2100,7 @@ public class Grid<T> extends AbstractListing<T> implements HasComponents, * a row when a component is clicked. For example in the case of a * {@link ComboBox} or {@link TextField} it might be problematic as the * component gets re-rendered and might lose focus. - * + * * @param handleWidgetEvents * {@code true} to handle events; {@code false} to not * @return this column @@ -2114,9 +2114,9 @@ public class Grid<T> extends AbstractListing<T> implements HasComponents, /** * Gets whether Grid is handling the events in this Column from * Component and Widgets. - * + * * @see #setHandleWidgetEvents(boolean) - * + * * @return {@code true} if handling events; {@code false} if not * @since 8.3 */ @@ -2648,7 +2648,7 @@ public class Grid<T> extends AbstractListing<T> implements HasComponents, * <p> * You can add columns for nested properties with dot notation, eg. * <code>"property.nestedProperty"</code> - * + * * @param propertyName * the property name of the new column, not <code>null</code> * @return the newly added column, not <code>null</code> @@ -2669,7 +2669,7 @@ public class Grid<T> extends AbstractListing<T> implements HasComponents, * You can add columns for nested properties with dot notation, eg. * <code>"property.nestedProperty"</code> * - * + * * @param propertyName * the property name of the new column, not <code>null</code> * @param renderer diff --git a/server/src/main/java/com/vaadin/ui/ItemCollapseAllowedProvider.java b/server/src/main/java/com/vaadin/ui/ItemCollapseAllowedProvider.java index 687b2c7196..5118713c1c 100644 --- a/server/src/main/java/com/vaadin/ui/ItemCollapseAllowedProvider.java +++ b/server/src/main/java/com/vaadin/ui/ItemCollapseAllowedProvider.java @@ -31,7 +31,8 @@ import com.vaadin.server.SerializablePredicate; * item data type */ @FunctionalInterface -public interface ItemCollapseAllowedProvider<T> extends SerializablePredicate<T> { +public interface ItemCollapseAllowedProvider<T> + extends SerializablePredicate<T> { /** * Returns whether collapsing is allowed for the given item. diff --git a/server/src/main/java/com/vaadin/ui/MenuBar.java b/server/src/main/java/com/vaadin/ui/MenuBar.java index 8f07b371e0..7b2437e772 100644 --- a/server/src/main/java/com/vaadin/ui/MenuBar.java +++ b/server/src/main/java/com/vaadin/ui/MenuBar.java @@ -49,7 +49,7 @@ import com.vaadin.ui.declarative.DesignContext; */ @SuppressWarnings("serial") public class MenuBar extends AbstractComponent -implements LegacyComponent, Focusable { + implements LegacyComponent, Focusable { // Items of the top-level menu private final List<MenuItem> menuItems; @@ -147,8 +147,10 @@ implements LegacyComponent, Focusable { } ContentMode contentMode = item.getDescriptionContentMode(); - // If the contentMode is equal to ContentMode.PREFORMATTED, we don't add any attribute. - if (contentMode != null && contentMode != ContentMode.PREFORMATTED) { + // If the contentMode is equal to ContentMode.PREFORMATTED, we don't + // add any attribute. + if (contentMode != null + && contentMode != ContentMode.PREFORMATTED) { target.addAttribute( MenuBarConstants.ATTRIBUTE_ITEM_DESCRIPTION_CONTENT_MODE, contentMode.name()); @@ -631,7 +633,7 @@ implements LegacyComponent, Focusable { */ public MenuBar.MenuItem addItemBefore(String caption, Resource icon, MenuBar.Command command, MenuBar.MenuItem itemToAddBefore) - throws IllegalStateException { + throws IllegalStateException { if (isCheckable()) { throw new IllegalStateException( "A checkable item cannot have children"); @@ -1153,11 +1155,13 @@ implements LegacyComponent, Focusable { attr, boolean.class)); } if (menuElement.hasAttr("description")) { - String description = DesignAttributeHandler.readAttribute("description", attr, String.class); + String description = DesignAttributeHandler + .readAttribute("description", attr, String.class); if (menuElement.hasAttr("descriptioncontentmode")) { String contentModeString = DesignAttributeHandler.readAttribute( "descriptioncontentmode", attr, String.class); - menu.setDescription(description, ContentMode.valueOf(contentModeString)); + menu.setDescription(description, + ContentMode.valueOf(contentModeString)); } else { menu.setDescription(description); } diff --git a/server/src/main/java/com/vaadin/ui/RadioButtonGroup.java b/server/src/main/java/com/vaadin/ui/RadioButtonGroup.java index a57234f59f..649c35d736 100644 --- a/server/src/main/java/com/vaadin/ui/RadioButtonGroup.java +++ b/server/src/main/java/com/vaadin/ui/RadioButtonGroup.java @@ -287,9 +287,8 @@ public class RadioButtonGroup<T> extends AbstractSingleSelect<T> ((DeclarativeItemEnabledProvider) provider).addDisabled(item); } } else { - throw new IllegalStateException(String.format( - "Don't know how " - + "to disable item using current item enabled provider '%s'", + throw new IllegalStateException(String.format("Don't know how " + + "to disable item using current item enabled provider '%s'", provider.getClass().getName())); } return item; diff --git a/server/src/main/java/com/vaadin/ui/TabSheet.java b/server/src/main/java/com/vaadin/ui/TabSheet.java index 39621b075e..8cb7243473 100644 --- a/server/src/main/java/com/vaadin/ui/TabSheet.java +++ b/server/src/main/java/com/vaadin/ui/TabSheet.java @@ -585,7 +585,9 @@ public class TabSheet extends AbstractComponentContainer */ private void setSelected(Component component) { Tab tab = tabs.get(selected); - if (tab != null && !Objects.equals(tab.getComponent(), component) && tab.getComponent() != null && tab.getComponent().isAttached()) { + if (tab != null && !Objects.equals(tab.getComponent(), component) + && tab.getComponent() != null + && tab.getComponent().isAttached()) { tab.getComponent().detach(); tab.getComponent().attach(); // ugly hack } diff --git a/server/src/main/java/com/vaadin/ui/UI.java b/server/src/main/java/com/vaadin/ui/UI.java index e3264a89ff..30c01d8cb8 100644 --- a/server/src/main/java/com/vaadin/ui/UI.java +++ b/server/src/main/java/com/vaadin/ui/UI.java @@ -121,8 +121,7 @@ import com.vaadin.util.ReflectTools; * @since 7.0 */ public abstract class UI extends AbstractSingleComponentContainer - implements Action.Notifier, PollNotifier, - LegacyComponent, Focusable { + implements Action.Notifier, PollNotifier, LegacyComponent, Focusable { /** * The application to which this UI belongs diff --git a/server/src/main/java/com/vaadin/ui/Window.java b/server/src/main/java/com/vaadin/ui/Window.java index d0aeb145b3..f53659bdd3 100644 --- a/server/src/main/java/com/vaadin/ui/Window.java +++ b/server/src/main/java/com/vaadin/ui/Window.java @@ -79,8 +79,7 @@ import com.vaadin.util.ReflectTools; * @since 3.0 */ @SuppressWarnings({ "serial", "deprecation" }) -public class Window extends Panel - implements FocusNotifier, BlurNotifier { +public class Window extends Panel implements FocusNotifier, BlurNotifier { private WindowServerRpc rpc = new WindowServerRpc() { diff --git a/server/src/main/java/com/vaadin/ui/components/grid/EditorImpl.java b/server/src/main/java/com/vaadin/ui/components/grid/EditorImpl.java index e9663eb5ac..d252cfed99 100644 --- a/server/src/main/java/com/vaadin/ui/components/grid/EditorImpl.java +++ b/server/src/main/java/com/vaadin/ui/components/grid/EditorImpl.java @@ -273,15 +273,16 @@ public class EditorImpl<T> extends AbstractGridExtension<T> if (!isEnabled()) { throw new IllegalStateException("Item editor is not enabled"); } - T beanToEdit = getParent().getDataCommunicator(). - fetchItemsWithRange(rowNumber, 1). - stream().findFirst().orElseThrow(() -> new IllegalArgumentException( - "Row number " + rowNumber+ "did not yield any item from data provider")); + T beanToEdit = getParent().getDataCommunicator() + .fetchItemsWithRange(rowNumber, 1).stream().findFirst() + .orElseThrow(() -> new IllegalArgumentException( + "Row number " + rowNumber + + "did not yield any item from data provider")); if (!beanToEdit.equals(edited)) { if (isBuffered() && edited != null) { throw new IllegalStateException("Editing item " + beanToEdit - + " failed. Item editor is already editing item " - + edited); + + " failed. Item editor is already editing item " + + edited); } else { rpc.bind(rowNumber); } diff --git a/server/src/main/java/com/vaadin/ui/components/grid/GridRowDragger.java b/server/src/main/java/com/vaadin/ui/components/grid/GridRowDragger.java index 02fab10174..5e4a4c96f6 100644 --- a/server/src/main/java/com/vaadin/ui/components/grid/GridRowDragger.java +++ b/server/src/main/java/com/vaadin/ui/components/grid/GridRowDragger.java @@ -489,17 +489,17 @@ public class GridRowDragger<T> implements Serializable { private static void throwUnsupportedOperationExceptionForUnsupportedDataProvider( boolean sourceGrid) { - throw new UnsupportedOperationException( - new StringBuilder().append(sourceGrid ? "Source " : "Target ") - .append("grid does not have a ListDataProvider, cannot automatically ") - .append(sourceGrid ? "remove " : "add ") - .append("items. Use GridRowDragger.set") - .append(sourceGrid ? "Source" : "Target") - .append("DataProviderUpdater(...) ") - .append(sourceGrid ? "" - : "and setDropIndexCalculator(...) " - + "to customize how to handle updating the data provider.") - .toString()); + throw new UnsupportedOperationException(new StringBuilder() + .append(sourceGrid ? "Source " : "Target ") + .append("grid does not have a ListDataProvider, cannot automatically ") + .append(sourceGrid ? "remove " : "add ") + .append("items. Use GridRowDragger.set") + .append(sourceGrid ? "Source" : "Target") + .append("DataProviderUpdater(...) ") + .append(sourceGrid ? "" + : "and setDropIndexCalculator(...) " + + "to customize how to handle updating the data provider.") + .toString()); } private static void throwUnsupportedOperationExceptionForUnsupportedCollectionInListDataProvider( diff --git a/server/src/main/java/com/vaadin/ui/components/grid/TreeGridDropEvent.java b/server/src/main/java/com/vaadin/ui/components/grid/TreeGridDropEvent.java index 6ad98ae7aa..19010d1715 100644 --- a/server/src/main/java/com/vaadin/ui/components/grid/TreeGridDropEvent.java +++ b/server/src/main/java/com/vaadin/ui/components/grid/TreeGridDropEvent.java @@ -29,7 +29,7 @@ import com.vaadin.ui.dnd.DragSourceExtension; * Drop event on an HTML5 drop target {@link TreeGrid} row. * * @param <T> - * The TreeGrid bean type. + * The TreeGrid bean type. * @author Vaadin Ltd. * @see TreeGridDropTarget#addTreeGridDropListener(TreeGridDropListener) * @since 8.1 @@ -43,27 +43,28 @@ public class TreeGridDropEvent<T> extends GridDropEvent<T> { * Creates a TreeGrid row drop event. * * @param target - * TreeGrid that received the drop. + * TreeGrid that received the drop. * @param data - * Map containing all types and corresponding data from the {@code + * Map containing all types and corresponding data from the + * {@code * DataTransfer} object. * @param dropEffect - * the desired drop effect + * the desired drop effect * @param dragSourceExtension - * Drag source extension of the component that initiated the drop - * event. + * Drag source extension of the component that initiated the drop + * event. * @param dropTargetRow - * Target row that received the drop, or {@code null} if dropped on - * empty grid + * Target row that received the drop, or {@code null} if dropped + * on empty grid * @param dropLocation - * Location of the drop within the target row. + * Location of the drop within the target row. * @param mouseEventDetails - * Mouse event details object containing information about the drop - * event + * Mouse event details object containing information about the + * drop event * @param depth - * depth of the row in the hierarchy + * depth of the row in the hierarchy * @param collapsed - * whether the target row is collapsed + * whether the target row is collapsed */ public TreeGridDropEvent(TreeGrid<T> target, Map<String, String> data, DropEffect dropEffect, @@ -91,7 +92,7 @@ public class TreeGridDropEvent<T> extends GridDropEvent<T> { * Tells whether the drop target row is collapsed. * * @return {@code true} if the drop target row is collapsed, {@code false} - * otherwise + * otherwise */ public Optional<Boolean> isDropTargetRowCollapsed() { return Optional.ofNullable(collapsed); 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 789f6c8a7b..0b78a9cbde 100644 --- a/server/src/main/java/com/vaadin/ui/declarative/Design.java +++ b/server/src/main/java/com/vaadin/ui/declarative/Design.java @@ -264,8 +264,7 @@ public class Design implements Serializable { String packageName = getPackageName(componentClass); String prefix = context.getPackagePrefix(packageName); if (prefix == null) { - prefix = packageName.replace('.', '_') - .toLowerCase(Locale.ROOT); + prefix = packageName.replace('.', '_').toLowerCase(Locale.ROOT); context.addPackagePrefix(prefix, packageName); } prefix += "-"; 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 7395aece96..0e9acd2a68 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 @@ -52,8 +52,7 @@ public class DesignEnumConverter<T extends Enum> return Result.ok(null); } try { - T result = (T) Enum.valueOf(type, - value.toUpperCase(Locale.ROOT)); + T result = (T) Enum.valueOf(type, value.toUpperCase(Locale.ROOT)); return Result.ok(result); } catch (Exception e) { return Result.error(e.getMessage()); 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 6f43ecd576..153b419a5e 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 @@ -116,7 +116,8 @@ public class DesignResourceConverter implements Converter<String, Resource> { return CODE_POINTS.get(codepoint); } - if (FontAwesome.FONT_FAMILY.equals(familyAndCode[0])) { // Left for compatibility + if (FontAwesome.FONT_FAMILY.equals(familyAndCode[0])) { + // Left for compatibility return FontAwesome.fromCodepoint(codepoint); } // all vaadin icons should have a codepoint diff --git a/server/src/main/java/com/vaadin/ui/dnd/DragSourceExtension.java b/server/src/main/java/com/vaadin/ui/dnd/DragSourceExtension.java index 859c556e2e..325f48dd44 100644 --- a/server/src/main/java/com/vaadin/ui/dnd/DragSourceExtension.java +++ b/server/src/main/java/com/vaadin/ui/dnd/DragSourceExtension.java @@ -39,7 +39,7 @@ import com.vaadin.ui.dnd.event.DragStartListener; * functionality. * * @param <T> - * Type of the component to be extended. + * Type of the component to be extended. * @author Vaadin Ltd * @since 8.1 */ @@ -59,7 +59,7 @@ public class DragSourceExtension<T extends AbstractComponent> * Extends {@code target} component and makes it a drag source. * * @param target - * Component to be extended. + * Component to be extended. */ public DragSourceExtension(T target) { super.extend(target); @@ -126,7 +126,7 @@ public class DragSourceExtension<T extends AbstractComponent> * side. Fires the {@link DragEndEvent}. * * @param dropEffect - * the drop effect on the dragend + * the drop effect on the dragend */ protected void onDragEnd(DropEffect dropEffect) { DragEndEvent<T> event = new DragEndEvent<>(getParent(), dropEffect); @@ -151,7 +151,7 @@ public class DragSourceExtension<T extends AbstractComponent> * equivalent to {@link EffectAllowed#ALL}. * * @param effect - * Effects to allow for this draggable element. Cannot be {@code + * Effects to allow for this draggable element. Cannot be {@code * null}. */ public void setEffectAllowed(EffectAllowed effect) { @@ -170,11 +170,12 @@ public class DragSourceExtension<T extends AbstractComponent> * <p> * You can use different types of data to support dragging to different * targets. Accepted types depend on the drop target and those can be - * platform specific. See https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API/Recommended_drag_types + * platform specific. See + * https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API/Recommended_drag_types * for examples on different types. * <p> - * <em>NOTE: IE11 only supports type ' text', which can be set using {@link - * #setDataTransferText(String data)}</em> + * <em>NOTE: IE11 only supports type ' text', which can be set using + * {@link #setDataTransferText(String data)}</em> * * @return Effects that are allowed for this draggable element. */ @@ -192,11 +193,11 @@ public class DragSourceExtension<T extends AbstractComponent> * application supports IE11. * * @param type - * Type of the data to be set for the client side draggable element, - * e.g. {@code text/plain}. Cannot be {@code null}. + * Type of the data to be set for the client side draggable + * element, e.g. {@code text/plain}. Cannot be {@code null}. * @param data - * Data to be set for the client side draggable element. Cannot be - * {@code null}. + * Data to be set for the client side draggable element. Cannot + * be {@code null}. */ public void setDataTransferData(String type, String data) { if (type == null) { @@ -218,7 +219,7 @@ public class DragSourceExtension<T extends AbstractComponent> * element. * * @param type - * Type of the requested data, e.g. {@code text/plain}. + * Type of the requested data, e.g. {@code text/plain}. * @return Data of type {@code type} stored in this drag source element. */ public String getDataTransferData(String type) { @@ -230,7 +231,7 @@ public class DragSourceExtension<T extends AbstractComponent> * map preserves the order of storage and is unmodifiable. * * @return Unmodifiable copy of the map of data in the order the data was - * stored. + * stored. */ public Map<String, String> getDataTransferData() { Map<String, String> data = getState(false).data; @@ -253,7 +254,7 @@ public class DragSourceExtension<T extends AbstractComponent> * Use this method if your application supports IE11. * * @param data - * Data to be set for the client side draggable element. + * Data to be set for the client side draggable element. * @see #setDataTransferData(String, String) */ public void setDataTransferText(String data) { @@ -275,7 +276,7 @@ public class DragSourceExtension<T extends AbstractComponent> * present. * * @param type - * Type of data to be cleared. Cannot be {@code null}. + * Type of data to be cleared. Cannot be {@code null}. */ public void clearDataTransferData(String type) { if (type == null) { @@ -305,9 +306,9 @@ public class DragSourceExtension<T extends AbstractComponent> * the browser's limitations. * * @param key - * key of the payload to be transferred + * key of the payload to be transferred * @param value - * value of the payload to be transferred + * value of the payload to be transferred * @see DropTargetExtension#setDropCriterion(String, String) */ public void setPayload(String key, String value) { @@ -325,12 +326,13 @@ public class DragSourceExtension<T extends AbstractComponent> * the browser's limitations. * * @param key - * key of the payload to be transferred + * key of the payload to be transferred * @param value - * value of the payload to be transferred - * @see DropTargetExtension#setDropCriterion(String, com.vaadin.shared.ui.dnd.criteria.ComparisonOperator, - * int) - * DropTargetExtension#setDropCriterion(String, ComparisonOperator, int) + * value of the payload to be transferred + * @see DropTargetExtension#setDropCriterion(String, + * com.vaadin.shared.ui.dnd.criteria.ComparisonOperator, int) + * DropTargetExtension#setDropCriterion(String, ComparisonOperator, + * int) */ public void setPayload(String key, int value) { setPayload(key, String.valueOf(value), Payload.ValueType.INTEGER); @@ -347,12 +349,13 @@ public class DragSourceExtension<T extends AbstractComponent> * the browser's limitations. * * @param key - * key of the payload to be transferred + * key of the payload to be transferred * @param value - * value of the payload to be transferred - * @see DropTargetExtension#setDropCriterion(String, com.vaadin.shared.ui.dnd.criteria.ComparisonOperator, - * double) - * DropTargetExtension#setDropCriterion(String, ComparisonOperator, double) + * value of the payload to be transferred + * @see DropTargetExtension#setDropCriterion(String, + * com.vaadin.shared.ui.dnd.criteria.ComparisonOperator, double) + * DropTargetExtension#setDropCriterion(String, ComparisonOperator, + * double) */ public void setPayload(String key, double value) { setPayload(key, String.valueOf(value), Payload.ValueType.DOUBLE); @@ -392,7 +395,7 @@ public class DragSourceExtension<T extends AbstractComponent> * dragstart event happens on the client side. * * @param listener - * Listener to handle dragstart event. + * Listener to handle dragstart event. * @return Handle to be used to remove this listener. */ public Registration addDragStartListener(DragStartListener<T> listener) { @@ -407,7 +410,7 @@ public class DragSourceExtension<T extends AbstractComponent> * event happens on the client side. * * @param listener - * Listener to handle dragend event. + * Listener to handle dragend event. * @return Handle to be used to remove this listener. */ public Registration addDragEndListener(DragEndListener<T> listener) { @@ -419,7 +422,7 @@ public class DragSourceExtension<T extends AbstractComponent> * Set a custom drag image for the current drag source. * * @param imageResource - * Resource of the image to be displayed as drag image. + * Resource of the image to be displayed as drag image. */ public void setDragImage(Resource imageResource) { setResource(DragSourceState.RESOURCE_DRAG_IMAGE, imageResource); diff --git a/server/src/main/java/com/vaadin/ui/dnd/DropTargetExtension.java b/server/src/main/java/com/vaadin/ui/dnd/DropTargetExtension.java index 58d3a3f7e3..68f30c8cbf 100644 --- a/server/src/main/java/com/vaadin/ui/dnd/DropTargetExtension.java +++ b/server/src/main/java/com/vaadin/ui/dnd/DropTargetExtension.java @@ -73,9 +73,8 @@ public class DropTargetExtension<T extends AbstractComponent> * {@link #onDrop(List, Map, DropEffect, MouseEventDetails)} instead. */ protected void registerDropTargetRpc() { - registerRpc( - (DropTargetRpc) (types, data, dropEffect, mouseEventDetails) -> - onDrop(types, data, + registerRpc((DropTargetRpc) (types, data, dropEffect, + mouseEventDetails) -> onDrop(types, data, DropEffect.valueOf(dropEffect.toUpperCase(Locale.ROOT)), mouseEventDetails)); } @@ -85,15 +84,16 @@ public class DropTargetExtension<T extends AbstractComponent> * Fires the {@link DropEvent}. * * @param types - * List of data types from {@code DataTransfer.types} object. + * List of data types from {@code DataTransfer.types} object. * @param data - * Map containing all types and corresponding data from the {@code + * Map containing all types and corresponding data from the + * {@code * DataTransfer} object. * @param dropEffect - * the drop effect + * the drop effect * @param mouseEventDetails - * mouse event details object containing information about the drop - * event + * mouse event details object containing information about the + * drop event */ protected void onDrop(List<String> types, Map<String, String> data, DropEffect dropEffect, MouseEventDetails mouseEventDetails) { @@ -165,13 +165,12 @@ public class DropTargetExtension<T extends AbstractComponent> * * <pre> * target.setDropCriterion( - * // If dragged source contains a URL, allow it to be dropped - * "if (event.dataTransfer.types.includes('text/uri-list')) {" + - * " return true;" + - * "}" + + * // If dragged source contains a URL, allow it to be dropped + * "if (event.dataTransfer.types.includes('text/uri-list')) {" + * + " return true;" + "}" + * - * // Otherwise cancel the event - * "return false;"); + * // Otherwise cancel the event + * "return false;"); * </pre> * * @param criteriaScript @@ -203,17 +202,17 @@ public class DropTargetExtension<T extends AbstractComponent> * if the value of the payload and the value given here are equal. * <p> * Note that calling this method will overwrite the previously set criteria. - * To set multiple criteria, call the {@link #setDropCriteria(Criterion.Match, - * Criterion...)} method. + * To set multiple criteria, call the + * {@link #setDropCriteria(Criterion.Match, Criterion...)} method. * <p> - * To handle more complex criteria, define a custom script with {@link - * #setDropCriteriaScript(String)}. Drop will be allowed if both this + * To handle more complex criteria, define a custom script with + * {@link #setDropCriteriaScript(String)}. Drop will be allowed if both this * criterion and the criteria script are passed. * * @param key - * key of the payload to be compared + * key of the payload to be compared * @param value - * value to be compared to the payload's value + * value to be compared to the payload's value * @see DragSourceExtension#setPayload(String, String) */ public void setDropCriterion(String key, String value) { @@ -228,19 +227,19 @@ public class DropTargetExtension<T extends AbstractComponent> * operator holds. * <p> * Note that calling this method will overwrite the previously set criteria. - * To set multiple criteria, call the {@link #setDropCriteria(Criterion.Match, - * Criterion...)} method. + * To set multiple criteria, call the + * {@link #setDropCriteria(Criterion.Match, Criterion...)} method. * <p> - * To handle more complex criteria, define a custom script with {@link - * #setDropCriteriaScript(String)}. Drop will be allowed if both this + * To handle more complex criteria, define a custom script with + * {@link #setDropCriteriaScript(String)}. Drop will be allowed if both this * criterion and the criteria script are passed. * * @param key - * key of the payload to be compared + * key of the payload to be compared * @param operator - * comparison operator to be used + * comparison operator to be used * @param value - * value to be compared to the payload's value + * value to be compared to the payload's value * @see DragSourceExtension#setPayload(String, int) */ public void setDropCriterion(String key, ComparisonOperator operator, @@ -257,19 +256,19 @@ public class DropTargetExtension<T extends AbstractComponent> * operator holds. * <p> * Note that calling this method will overwrite the previously set criteria. - * To set multiple criteria, call the {@link #setDropCriteria(Criterion.Match, - * Criterion...)} method. + * To set multiple criteria, call the + * {@link #setDropCriteria(Criterion.Match, Criterion...)} method. * <p> - * To handle more complex criteria, define a custom script with {@link - * #setDropCriteriaScript(String)}. Drop will be allowed if both this + * To handle more complex criteria, define a custom script with + * {@link #setDropCriteriaScript(String)}. Drop will be allowed if both this * criterion and the criteria script are passed. * * @param key - * key of the payload to be compared + * key of the payload to be compared * @param operator - * comparison operator to be used + * comparison operator to be used * @param value - * value to be compared to the payload's value + * value to be compared to the payload's value * @see DragSourceExtension#setPayload(String, double) */ public void setDropCriterion(String key, ComparisonOperator operator, @@ -288,18 +287,17 @@ public class DropTargetExtension<T extends AbstractComponent> * compared to the value of the criterion using the criterion's operator * holds. * <p> - * Note that calling this method will overwrite the previously set - * criteria. + * Note that calling this method will overwrite the previously set criteria. * <p> - * To handle more complex criteria, define a custom script with {@link - * #setDropCriteriaScript(String)}. Drop will be allowed if both this + * To handle more complex criteria, define a custom script with + * {@link #setDropCriteriaScript(String)}. Drop will be allowed if both this * criterion and the criteria script are passed. * * @param match - * defines whether any or all of the given criteria should match to - * allow drop on this drop target + * defines whether any or all of the given criteria should match + * to allow drop on this drop target * @param criteria - * criteria to be compared to the payload + * criteria to be compared to the payload */ public void setDropCriteria(Criterion.Match match, Criterion... criteria) { getState().criteriaMatch = match; diff --git a/server/src/main/java/com/vaadin/ui/dnd/FileDropHandler.java b/server/src/main/java/com/vaadin/ui/dnd/FileDropHandler.java index 5df562169f..20cf34a1d4 100644 --- a/server/src/main/java/com/vaadin/ui/dnd/FileDropHandler.java +++ b/server/src/main/java/com/vaadin/ui/dnd/FileDropHandler.java @@ -24,22 +24,22 @@ import com.vaadin.ui.dnd.event.FileDropEvent; * Handles the drop event on a file drop target. * * @param <T> - * Type of the file drop target component. + * Type of the file drop target component. * @author Vaadin Ltd * @see FileDropEvent * @see com.vaadin.ui.dnd.FileDropTarget * @since 8.1 */ -public interface FileDropHandler<T extends AbstractComponent> extends - Serializable { +public interface FileDropHandler<T extends AbstractComponent> + extends Serializable { /** * Handles the drop event. The method is called when files are dropped onto * the file drop target this handler is registered to. * * @param event - * The file drop event containing the list of files that were - * dropped onto the component. + * The file drop event containing the list of files that were + * dropped onto the component. */ public void drop(FileDropEvent<T> event); } diff --git a/server/src/main/java/com/vaadin/ui/dnd/event/DragEndEvent.java b/server/src/main/java/com/vaadin/ui/dnd/event/DragEndEvent.java index f4169f7438..8d2fd1d1ae 100644 --- a/server/src/main/java/com/vaadin/ui/dnd/event/DragEndEvent.java +++ b/server/src/main/java/com/vaadin/ui/dnd/event/DragEndEvent.java @@ -25,7 +25,7 @@ import com.vaadin.ui.dnd.DropTargetExtension; * HTML5 drag end event. * * @param <T> - * Type of the component that was dragged. + * Type of the component that was dragged. * @author Vaadin Ltd * @see DragSourceExtension#addDragEndListener(DragEndListener) * @since 8.1 @@ -37,9 +37,9 @@ public class DragEndEvent<T extends AbstractComponent> extends Component.Event { * Creates a drag end event. * * @param source - * Component that was dragged. + * Component that was dragged. * @param dropEffect - * Drop effect from {@code DataTransfer.dropEffect} object. + * Drop effect from {@code DataTransfer.dropEffect} object. */ public DragEndEvent(T source, DropEffect dropEffect) { super(source); @@ -60,7 +60,7 @@ public class DragEndEvent<T extends AbstractComponent> extends Component.Event { * should be removed from the source. * * @return The {@code DataTransfer.dropEffect} parameter of the client side - * dragend event. + * dragend event. * @see DragSourceExtension#setEffectAllowed(com.vaadin.shared.ui.dnd.EffectAllowed) * DragSourceExtension#setEffectAllowed(EffectAllowed) * @see DropTargetExtension#setDropEffect(DropEffect) @@ -75,7 +75,7 @@ public class DragEndEvent<T extends AbstractComponent> extends Component.Event { * {@code dropEffect == NONE}. * * @return {@code true} if the drop event was cancelled, {@code false} - * otherwise. + * otherwise. */ public boolean isCanceled() { return getDropEffect() == DropEffect.NONE; diff --git a/server/src/main/java/com/vaadin/ui/dnd/event/DragStartEvent.java b/server/src/main/java/com/vaadin/ui/dnd/event/DragStartEvent.java index 02ff6e34e2..d2fc677e80 100644 --- a/server/src/main/java/com/vaadin/ui/dnd/event/DragStartEvent.java +++ b/server/src/main/java/com/vaadin/ui/dnd/event/DragStartEvent.java @@ -24,22 +24,23 @@ import com.vaadin.ui.dnd.DragSourceExtension; * HTML5 drag start event. * * @param <T> - * Type of the component that is dragged. + * Type of the component that is dragged. * @author Vaadin Ltd * @see DragSourceExtension#addDragStartListener(DragStartListener) * @since 8.1 */ -public class DragStartEvent<T extends AbstractComponent> extends - Component.Event { +public class DragStartEvent<T extends AbstractComponent> + extends Component.Event { private final EffectAllowed effectAllowed; /** * Creates a drag start event. * * @param source - * Component that is dragged. + * Component that is dragged. * @param effectAllowed - * Allowed effects from {@code DataTransfer.effectAllowed} object. + * Allowed effects from {@code DataTransfer.effectAllowed} + * object. */ public DragStartEvent(T source, EffectAllowed effectAllowed) { super(source); diff --git a/server/src/main/java/com/vaadin/ui/dnd/event/DropEvent.java b/server/src/main/java/com/vaadin/ui/dnd/event/DropEvent.java index a5aa4e4f90..23b2786f6a 100644 --- a/server/src/main/java/com/vaadin/ui/dnd/event/DropEvent.java +++ b/server/src/main/java/com/vaadin/ui/dnd/event/DropEvent.java @@ -46,18 +46,19 @@ public class DropEvent<T extends AbstractComponent> extends Component.Event { * Creates a server side drop event. * * @param target - * Component that received the drop. + * Component that received the drop. * @param data - * Map containing all types and corresponding data from the {@code + * Map containing all types and corresponding data from the + * {@code * DataTransfer} object. * @param dropEffect - * the desired drop effect + * the desired drop effect * @param dragSourceExtension - * Drag source extension of the component that initiated the drop - * event. + * Drag source extension of the component that initiated the drop + * event. * @param mouseEventDetails - * Mouse event details object containing information about the drop - * event + * Mouse event details object containing information about the + * drop event */ public DropEvent(T target, Map<String, String> data, DropEffect dropEffect, DragSourceExtension<? extends AbstractComponent> dragSourceExtension, @@ -76,7 +77,7 @@ public class DropEvent<T extends AbstractComponent> extends Component.Event { * Get data from the {@code DataTransfer} object. * * @param type - * Data format, e.g. {@code text/plain} or {@code text/uri-list}. + * Data format, e.g. {@code text/plain} or {@code text/uri-list}. * @return Optional data for the given format if exists in the {@code * DataTransfer}, otherwise {@code Optional.empty()}. */ @@ -175,7 +176,7 @@ public class DropEvent<T extends AbstractComponent> extends Component.Event { * Gets the mouse event details for the drop event. * * @return Mouse event details object containing information about the drop - * event. + * event. */ public MouseEventDetails getMouseEventDetails() { return mouseEventDetails; diff --git a/server/src/main/java/com/vaadin/ui/dnd/event/FileDropEvent.java b/server/src/main/java/com/vaadin/ui/dnd/event/FileDropEvent.java index bf798c2a6d..04c973f69f 100644 --- a/server/src/main/java/com/vaadin/ui/dnd/event/FileDropEvent.java +++ b/server/src/main/java/com/vaadin/ui/dnd/event/FileDropEvent.java @@ -27,13 +27,13 @@ import com.vaadin.ui.dnd.FileDropHandler; * target. * * @param <T> - * Type of the file drop target component. + * Type of the file drop target component. * @author Vaadin Ltd * @see FileDropHandler * @since 8.1 */ -public class FileDropEvent<T extends AbstractComponent> extends - Component.Event { +public class FileDropEvent<T extends AbstractComponent> + extends Component.Event { private final Collection<Html5File> files; @@ -41,9 +41,9 @@ public class FileDropEvent<T extends AbstractComponent> extends * Creates a file drop event. * * @param target - * The file drop target component. + * The file drop target component. * @param files - * Collection of files. + * Collection of files. */ public FileDropEvent(T target, Collection<Html5File> files) { super(target); @@ -55,7 +55,7 @@ public class FileDropEvent<T extends AbstractComponent> extends * Gets the collection of files dropped onto the file drop target component. * * @return Collection of files that were dropped onto the file drop target - * component. + * component. */ public Collection<Html5File> getFiles() { return files; diff --git a/server/src/main/java/com/vaadin/ui/renderers/LocalDateTimeRenderer.java b/server/src/main/java/com/vaadin/ui/renderers/LocalDateTimeRenderer.java index e940b8a81a..c0faae9dd9 100644 --- a/server/src/main/java/com/vaadin/ui/renderers/LocalDateTimeRenderer.java +++ b/server/src/main/java/com/vaadin/ui/renderers/LocalDateTimeRenderer.java @@ -86,7 +86,8 @@ public class LocalDateTimeRenderer * @throws IllegalArgumentException * if formatter is null */ - public LocalDateTimeRenderer(DateTimeFormatter formatter, String nullRepresentation) { + public LocalDateTimeRenderer(DateTimeFormatter formatter, + String nullRepresentation) { super(LocalDateTime.class, nullRepresentation); if (formatter == null) { diff --git a/server/src/main/java/com/vaadin/util/FileTypeResolver.java b/server/src/main/java/com/vaadin/util/FileTypeResolver.java index e2b9979c25..4606463683 100644 --- a/server/src/main/java/com/vaadin/util/FileTypeResolver.java +++ b/server/src/main/java/com/vaadin/util/FileTypeResolver.java @@ -221,8 +221,8 @@ public class FileTypeResolver implements Serializable { static { // Initialize extension to MIME map - final StringTokenizer lines = new StringTokenizer(INITIAL_EXT_TO_MIME_MAP, - ","); + final StringTokenizer lines = new StringTokenizer( + INITIAL_EXT_TO_MIME_MAP, ","); while (lines.hasMoreTokens()) { final String line = lines.nextToken(); final StringTokenizer exts = new StringTokenizer(line); diff --git a/server/src/test/java/com/vaadin/data/BeanBinderTest.java b/server/src/test/java/com/vaadin/data/BeanBinderTest.java index e6740f35ba..bdcfb16d7b 100644 --- a/server/src/test/java/com/vaadin/data/BeanBinderTest.java +++ b/server/src/test/java/com/vaadin/data/BeanBinderTest.java @@ -322,17 +322,21 @@ public class BeanBinderTest binder.bind(nameField, "readOnlyProperty"); binder.setReadOnly(true); - assertTrue("Name field should be ignored and be readonly", nameField.isReadOnly()); + assertTrue("Name field should be ignored and be readonly", + nameField.isReadOnly()); binder.setReadOnly(false); - assertTrue("Name field should be ignored and be readonly", nameField.isReadOnly()); + assertTrue("Name field should be ignored and be readonly", + nameField.isReadOnly()); nameField.setReadOnly(false); binder.setReadOnly(true); - assertFalse("Name field should be ignored and not be readonly", nameField.isReadOnly()); + assertFalse("Name field should be ignored and not be readonly", + nameField.isReadOnly()); binder.setReadOnly(false); - assertFalse("Name field should be ignored and not be readonly", nameField.isReadOnly()); + assertFalse("Name field should be ignored and not be readonly", + nameField.isReadOnly()); } @Test diff --git a/server/src/test/java/com/vaadin/data/BeanPropertySetTest.java b/server/src/test/java/com/vaadin/data/BeanPropertySetTest.java index 60c2f5a905..583afc2dd6 100644 --- a/server/src/test/java/com/vaadin/data/BeanPropertySetTest.java +++ b/server/src/test/java/com/vaadin/data/BeanPropertySetTest.java @@ -36,10 +36,12 @@ public class BeanPropertySetTest { PropertySet<Person> deserializedPropertySet = ClassesSerializableTest .serializeAndDeserialize(originalPropertySet); - comparePropertySet(originalPropertySet, deserializedPropertySet, "Deserialized instance should be the same as the original"); + comparePropertySet(originalPropertySet, deserializedPropertySet, + "Deserialized instance should be the same as the original"); } - private void comparePropertySet(PropertySet<?> propertySetA, PropertySet<?> propertySetB, String message) { + private void comparePropertySet(PropertySet<?> propertySetA, + PropertySet<?> propertySetB, String message) { PropertyDefinition<?, ?>[] propertiesA = propertySetA.getProperties() .sorted(Comparator.comparing(PropertyDefinition::getName)) @@ -50,8 +52,7 @@ public class BeanPropertySetTest { assertEquals(message, propertiesA.length, propertiesB.length); for (int i = 0; i < propertiesB.length; i++) { - assertSame(message, - propertiesA[i], propertiesB[i]); + assertSame(message, propertiesA[i], propertiesB[i]); } } @@ -79,7 +80,9 @@ public class BeanPropertySetTest { PropertySet<Person> deserializedPropertySet = (PropertySet<Person>) in .readObject(); - comparePropertySet(BeanPropertySet.get(Person.class), deserializedPropertySet, "Deserialized instance should be the same as in the cache"); + comparePropertySet(BeanPropertySet.get(Person.class), + deserializedPropertySet, + "Deserialized instance should be the same as in the cache"); assertNotSame( "Deserialized instance should not be the same as the original", originalPropertySet, deserializedPropertySet); @@ -112,9 +115,10 @@ public class BeanPropertySetTest { throws Exception { PropertyDefinition<com.vaadin.tests.data.bean.Person, ?> definition = BeanPropertySet - .get(com.vaadin.tests.data.bean.Person.class,true, getDefaultFilter()) - .getProperty("address.postalCode").orElseThrow(AssertionFailedError::new); - + .get(com.vaadin.tests.data.bean.Person.class, true, + getDefaultFilter()) + .getProperty("address.postalCode") + .orElseThrow(AssertionFailedError::new); PropertyDefinition<com.vaadin.tests.data.bean.Person, ?> deserializedDefinition = ClassesSerializableTest .serializeAndDeserialize(definition); diff --git a/server/src/test/java/com/vaadin/data/BinderTest.java b/server/src/test/java/com/vaadin/data/BinderTest.java index 5ca469011c..f4515dc211 100644 --- a/server/src/test/java/com/vaadin/data/BinderTest.java +++ b/server/src/test/java/com/vaadin/data/BinderTest.java @@ -530,7 +530,8 @@ public class BinderTest extends BinderTestBase<Binder<Person>, Person> { textField.setValue(" "); ErrorMessage errorMessage = textField.getErrorMessage(); assertNotNull(errorMessage); - assertEquals("Input is required.", errorMessage.getFormattedHtmlMessage()); + assertEquals("Input is required.", + errorMessage.getFormattedHtmlMessage()); // validation is done for all changed bindings once. assertEquals(1, invokes.get()); @@ -547,7 +548,8 @@ public class BinderTest extends BinderTestBase<Binder<Person>, Person> { Converter<String, String> stringBasicPreProcessingConverter = new Converter<String, String>() { @Override - public Result<String> convertToModel(String value, ValueContext context) { + public Result<String> convertToModel(String value, + ValueContext context) { if (StringUtils.isBlank(value)) { return Result.ok(null); } @@ -555,7 +557,8 @@ public class BinderTest extends BinderTestBase<Binder<Person>, Person> { } @Override - public String convertToPresentation(String value, ValueContext context) { + public String convertToPresentation(String value, + ValueContext context) { if (value == null) { return ""; } @@ -584,7 +587,8 @@ public class BinderTest extends BinderTestBase<Binder<Person>, Person> { textField.setValue(" "); ErrorMessage errorMessage = textField.getErrorMessage(); assertNotNull(errorMessage); - assertEquals("Input required.", errorMessage.getFormattedHtmlMessage()); + assertEquals("Input required.", + errorMessage.getFormattedHtmlMessage()); // validation is done for all changed bindings once. assertEquals(1, invokes.get()); diff --git a/server/src/test/java/com/vaadin/data/BinderTestBase.java b/server/src/test/java/com/vaadin/data/BinderTestBase.java index 2cb560562b..ca3e2d0779 100644 --- a/server/src/test/java/com/vaadin/data/BinderTestBase.java +++ b/server/src/test/java/com/vaadin/data/BinderTestBase.java @@ -17,7 +17,8 @@ import com.vaadin.ui.TextField; * * @since 8.0 */ -public abstract class BinderTestBase<BINDER extends Binder<ITEM>, ITEM> implements Serializable { +public abstract class BinderTestBase<BINDER extends Binder<ITEM>, ITEM> + implements Serializable { protected static final String NEGATIVE_ERROR_MESSAGE = "Value must be non-negative"; @@ -35,13 +36,13 @@ public abstract class BinderTestBase<BINDER extends Binder<ITEM>, ITEM> implemen protected Validator<String> notEmpty = Validator.from(val -> !val.isEmpty(), EMPTY_ERROR_MESSAGE); protected Converter<String, Integer> stringToInteger = Converter.from( - Integer::valueOf, String::valueOf, - e -> NOT_NUMBER_ERROR_MESSAGE); + Integer::valueOf, String::valueOf, e -> NOT_NUMBER_ERROR_MESSAGE); protected Validator<Integer> notNegative = Validator.from(x -> x >= 0, NEGATIVE_ERROR_MESSAGE); public static void testSerialization(Object toSerialize) { - try (ObjectOutputStream objectOutputStream = new ObjectOutputStream(new ByteArrayOutputStream())) { + try (ObjectOutputStream objectOutputStream = new ObjectOutputStream( + new ByteArrayOutputStream())) { objectOutputStream.writeObject(toSerialize); } catch (Exception e) { throw new RuntimeException(e); diff --git a/server/src/test/java/com/vaadin/data/HasItemsTest.java b/server/src/test/java/com/vaadin/data/HasItemsTest.java index 6bbdb46f4b..8522bcee72 100644 --- a/server/src/test/java/com/vaadin/data/HasItemsTest.java +++ b/server/src/test/java/com/vaadin/data/HasItemsTest.java @@ -45,16 +45,14 @@ public class HasItemsTest { DataProvider dataProvider = hasItems.getDataProvider(); - Assert.assertTrue( - hasItemsType.getSimpleName() - + " setItems method with varargs parameters of does not create a list data provider", + Assert.assertTrue(hasItemsType.getSimpleName() + + " setItems method with varargs parameters of does not create a list data provider", dataProvider instanceof ListDataProvider); ListDataProvider listDataProvider = (ListDataProvider) dataProvider; - Assert.assertTrue( - hasItemsType.getSimpleName() - + " does not have setItems method with varargs parameters of does not create an ArrayList backed list data provider", + Assert.assertTrue(hasItemsType.getSimpleName() + + " does not have setItems method with varargs parameters of does not create an ArrayList backed list data provider", listDataProvider.getItems() instanceof ArrayList); List list = (List) listDataProvider.getItems(); diff --git a/server/src/test/java/com/vaadin/data/NestedPropertyNameTest.java b/server/src/test/java/com/vaadin/data/NestedPropertyNameTest.java index 070a3de40a..24e0cae331 100644 --- a/server/src/test/java/com/vaadin/data/NestedPropertyNameTest.java +++ b/server/src/test/java/com/vaadin/data/NestedPropertyNameTest.java @@ -5,36 +5,36 @@ import org.junit.Test; import com.vaadin.ui.Grid; public class NestedPropertyNameTest { - + @Test public void nestedProperty_sameNameCanBeAdded() { Grid<Person> grid = new Grid<>(Person.class); grid.addColumn("street.name"); } - private class Person{ + private class Person { String name; Street street; - + public String getName() { return name; } - + public void setName(String name) { this.name = name; } - + public Street getStreet() { return street; } - + public void setStreet(Street street) { this.street = street; } - + } - - private class Street{ + + private class Street { String name; public String getName() { diff --git a/server/src/test/java/com/vaadin/data/PropertyRetrospectionTest.java b/server/src/test/java/com/vaadin/data/PropertyRetrospectionTest.java index 3b3a611345..01ccdedae7 100644 --- a/server/src/test/java/com/vaadin/data/PropertyRetrospectionTest.java +++ b/server/src/test/java/com/vaadin/data/PropertyRetrospectionTest.java @@ -67,35 +67,40 @@ public class PropertyRetrospectionTest { } @Test - public void testGridBeanProperties() - { + public void testGridBeanProperties() { Grid<BeanOne> grid1 = new Grid<>(BeanOne.class); - assertEquals(2,BeanPropertySet.get(BeanOne.class).getProperties().count()); - assertEquals(2,grid1.getColumns().size()); + assertEquals(2, + BeanPropertySet.get(BeanOne.class).getProperties().count()); + assertEquals(2, grid1.getColumns().size()); grid1.addColumn("innerBean.innerString"); - assertEquals(3,grid1.getColumns().size()); - assertEquals(2,BeanPropertySet.get(BeanOne.class).getProperties().count()); - + assertEquals(3, grid1.getColumns().size()); + assertEquals(2, + BeanPropertySet.get(BeanOne.class).getProperties().count()); Grid<BeanOne> grid2 = new Grid<>(BeanOne.class); - assertEquals(2,BeanPropertySet.get(BeanOne.class).getProperties().count()); - assertEquals(2,grid2.getColumns().size()); + assertEquals(2, + BeanPropertySet.get(BeanOne.class).getProperties().count()); + assertEquals(2, grid2.getColumns().size()); grid2.addColumn("innerBean.innerString"); - assertEquals(3,grid2.getColumns().size()); - assertEquals(2,BeanPropertySet.get(BeanOne.class).getProperties().count()); + assertEquals(3, grid2.getColumns().size()); + assertEquals(2, + BeanPropertySet.get(BeanOne.class).getProperties().count()); } @Test - public void testBinder() - { + public void testBinder() { Binder<BeanTwo> binder1 = new Binder<>(BeanTwo.class); - assertEquals(2,BeanPropertySet.get(BeanTwo.class).getProperties().count()); + assertEquals(2, + BeanPropertySet.get(BeanTwo.class).getProperties().count()); binder1.forField(new TextField()).bind("innerBean.innerString"); - assertEquals(2,BeanPropertySet.get(BeanTwo.class).getProperties().count()); + assertEquals(2, + BeanPropertySet.get(BeanTwo.class).getProperties().count()); Binder<BeanTwo> binder2 = new Binder<>(BeanTwo.class); - assertEquals(2,BeanPropertySet.get(BeanTwo.class).getProperties().count()); + assertEquals(2, + BeanPropertySet.get(BeanTwo.class).getProperties().count()); binder2.forField(new TextField()).bind("innerBean.innerString"); - assertEquals(2,BeanPropertySet.get(BeanTwo.class).getProperties().count()); + assertEquals(2, + BeanPropertySet.get(BeanTwo.class).getProperties().count()); } } diff --git a/server/src/test/java/com/vaadin/data/ReadOnlyHasValueTest.java b/server/src/test/java/com/vaadin/data/ReadOnlyHasValueTest.java index 38338e8a22..6ed172a56a 100644 --- a/server/src/test/java/com/vaadin/data/ReadOnlyHasValueTest.java +++ b/server/src/test/java/com/vaadin/data/ReadOnlyHasValueTest.java @@ -83,12 +83,11 @@ public class ReadOnlyHasValueTest { public void testEmptyValue() { Binder<Bean> beanBinder = new Binder<>(Bean.class); Label label = new Label(); - ReadOnlyHasValue<String> strHasValue = - new ReadOnlyHasValue<>(label::setValue, NO_VALUE); + ReadOnlyHasValue<String> strHasValue = new ReadOnlyHasValue<>( + label::setValue, NO_VALUE); beanBinder.forField(strHasValue) - .withConverter(Long::parseLong,(Long i)->"" + i) - .bind("v"); + .withConverter(Long::parseLong, (Long i) -> "" + i).bind("v"); beanBinder.readBean(new Bean(42)); assertEquals("42", label.getValue()); diff --git a/server/src/test/java/com/vaadin/data/provider/hierarchical/HierarchicalCommunicatorTest.java b/server/src/test/java/com/vaadin/data/provider/hierarchical/HierarchicalCommunicatorTest.java index 9c1c47215c..3475be5520 100644 --- a/server/src/test/java/com/vaadin/data/provider/hierarchical/HierarchicalCommunicatorTest.java +++ b/server/src/test/java/com/vaadin/data/provider/hierarchical/HierarchicalCommunicatorTest.java @@ -69,7 +69,7 @@ public class HierarchicalCommunicatorTest { communicator.pushData(1, Arrays.asList(ROOT, FOLDER, LEAF)); communicator.expand(ROOT); communicator.expand(FOLDER); - //Put the item into client queue + // Put the item into client queue communicator.refresh(item); treeData.removeItem(item); if (refreshAll) { @@ -83,20 +83,22 @@ public class HierarchicalCommunicatorTest { @Test public void testReplaceAll() { communicator.pushData(1, Arrays.asList(ROOT, FOLDER, LEAF)); - //Some modifications + // Some modifications communicator.expand(ROOT); communicator.expand(FOLDER); communicator.refresh(LEAF); - //Replace dataprovider - communicator.setDataProvider(new TreeDataProvider<>(new TreeData<>()), null); + // Replace dataprovider + communicator.setDataProvider(new TreeDataProvider<>(new TreeData<>()), + null); dataProvider.refreshAll(); communicator.beforeClientResponse(false); assertFalse("Stalled object in KeyMapper", communicator.getKeyMapper().has(ROOT)); - assertEquals(-1,communicator.getParentIndex(FOLDER).longValue()); + assertEquals(-1, communicator.getParentIndex(FOLDER).longValue()); } - private static class TestHierarchicalDataCommunicator<T> extends HierarchicalDataCommunicator<T> { + private static class TestHierarchicalDataCommunicator<T> + extends HierarchicalDataCommunicator<T> { @Override public void extend(AbstractClientConnector target) { super.extend(target); diff --git a/server/src/test/java/com/vaadin/server/communication/HugeFileUploadTest.java b/server/src/test/java/com/vaadin/server/communication/HugeFileUploadTest.java index 50e779c804..eb13ccf32a 100644 --- a/server/src/test/java/com/vaadin/server/communication/HugeFileUploadTest.java +++ b/server/src/test/java/com/vaadin/server/communication/HugeFileUploadTest.java @@ -40,12 +40,15 @@ public class HugeFileUploadTest { public void setup() throws IOException { MockitoAnnotations.initMocks(this); // 0= UIid, 1 = cid, 2= name, 3 = sec key - when(request.getPathInfo()).thenReturn("/" + UPLOAD_URL_PREFIX + UI_ID + "/" + CONN_ID + "/var/" + SEC_KEY); - when(request.getContentType()).thenReturn("application/multipart-attached;boundary=bbbbb"); + when(request.getPathInfo()).thenReturn("/" + UPLOAD_URL_PREFIX + UI_ID + + "/" + CONN_ID + "/var/" + SEC_KEY); + when(request.getContentType()) + .thenReturn("application/multipart-attached;boundary=bbbbb"); when(session.hasLock()).thenReturn(true); when(session.getUIById(UI_ID)).thenReturn(ui); when(ui.getConnectorTracker()).thenReturn(connectorTracker); - when(connectorTracker.getStreamVariable(CONN_ID,"var")).thenReturn(streamVariable); + when(connectorTracker.getStreamVariable(CONN_ID, "var")) + .thenReturn(streamVariable); when(connectorTracker.getSeckey(streamVariable)).thenReturn(SEC_KEY); when(request.getInputStream()).thenReturn(new InputStream() { @Override diff --git a/server/src/test/java/com/vaadin/tests/CompileTransitionPropertyTest.java b/server/src/test/java/com/vaadin/tests/CompileTransitionPropertyTest.java index 685baae509..0f84855c89 100644 --- a/server/src/test/java/com/vaadin/tests/CompileTransitionPropertyTest.java +++ b/server/src/test/java/com/vaadin/tests/CompileTransitionPropertyTest.java @@ -21,8 +21,7 @@ public class CompileTransitionPropertyTest { if (file.contains("%20")) { fail("path contains spaces, please move the project"); } - ScssStylesheet ss = ScssStylesheet - .get(file); + ScssStylesheet ss = ScssStylesheet.get(file); ss.compile(); // extract the style rules for .my-label String compiled = ss.printState(); @@ -56,4 +55,4 @@ public class CompileTransitionPropertyTest { assertTrue("Unexpected style rules for .my-label: " + modifiedStyle, modifiedStyle.isEmpty()); } -}
\ No newline at end of file +} diff --git a/server/src/test/java/com/vaadin/tests/components/TreeTest.java b/server/src/test/java/com/vaadin/tests/components/TreeTest.java index d48109e669..517ee6a56b 100644 --- a/server/src/test/java/com/vaadin/tests/components/TreeTest.java +++ b/server/src/test/java/com/vaadin/tests/components/TreeTest.java @@ -88,9 +88,9 @@ public class TreeTest { tree.setDescription(TEST_DESCRIPTION); tree.setIcon(new ThemeResource(TEST_RESOURCE_ID)); - assertEquals(TEST_CAPTION,tree.getCaption()); - assertEquals(TEST_DESCRIPTION,tree.getDescription()); - assertEquals(TEST_RESOURCE_ID,tree.getIcon().toString()); + assertEquals(TEST_CAPTION, tree.getCaption()); + assertEquals(TEST_DESCRIPTION, tree.getDescription()); + assertEquals(TEST_RESOURCE_ID, tree.getIcon().toString()); assertFalse(tree.isCaptionAsHtml()); tree.setCaptionAsHtml(true); diff --git a/server/src/test/java/com/vaadin/tests/components/grid/GridNullValueSortTest.java b/server/src/test/java/com/vaadin/tests/components/grid/GridNullValueSortTest.java index ddf4844490..392a20afa2 100644 --- a/server/src/test/java/com/vaadin/tests/components/grid/GridNullValueSortTest.java +++ b/server/src/test/java/com/vaadin/tests/components/grid/GridNullValueSortTest.java @@ -26,9 +26,11 @@ public class GridNullValueSortTest { VaadinSession.setCurrent(null); this.grid = new Grid<TestClass>(); this.stringColumn = this.grid.addColumn(bean -> bean.stringField); - this.nonComparableColumn = this.grid.addColumn(bean -> bean.nonComparableField); + this.nonComparableColumn = this.grid + .addColumn(bean -> bean.nonComparableField); - this.grid.setItems(new TestClass(null, new Object()), new TestClass("something", null)); + this.grid.setItems(new TestClass(null, new Object()), + new TestClass("something", null)); new MockUI().setContent(grid); } 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 9167257bd1..4c974a59c8 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 @@ -63,13 +63,15 @@ public class MenuBarDeclarativeTest extends DeclarativeTestBase<MenuBar> { + "<menu descriptioncontentmode=\"TEXT\" description=\"Just plain text\">plain text</menu>" + "</vaadin-menu-bar>"; MenuBar menuBar = new MenuBar(); - menuBar.addItem("One", null).setDescription("This description is implicitly preformatted"); - menuBar.addItem("preformatted", null) - .setDescription("This description\nis explicitly\n\npreformatted", ContentMode.PREFORMATTED); - menuBar.addItem("HTML", null) - .setDescription("<b>I</b> contain <br/> <e>html</e>", ContentMode.HTML); - menuBar.addItem("plain text", null) - .setDescription("Just plain text", ContentMode.TEXT); + menuBar.addItem("One", null) + .setDescription("This description is implicitly preformatted"); + menuBar.addItem("preformatted", null).setDescription( + "This description\nis explicitly\n\npreformatted", + ContentMode.PREFORMATTED); + menuBar.addItem("HTML", null).setDescription( + "<b>I</b> contain <br/> <e>html</e>", ContentMode.HTML); + menuBar.addItem("plain text", null).setDescription("Just plain text", + ContentMode.TEXT); testWrite(design, menuBar); testRead(design, menuBar); @@ -177,7 +179,8 @@ public class MenuBarDeclarativeTest extends DeclarativeTestBase<MenuBar> { actual.getDescription()); assertEquals(baseError + "Style Name", expected.getStyleName(), actual.getStyleName()); - assertEquals(baseError + "Content Mode", expected.getDescriptionContentMode(), + assertEquals(baseError + "Content Mode", + expected.getDescriptionContentMode(), actual.getDescriptionContentMode()); if (expected.getIcon() != null) { diff --git a/server/src/test/java/com/vaadin/tests/data/bean/BeanWithEnums.java b/server/src/test/java/com/vaadin/tests/data/bean/BeanWithEnums.java index 22c1af75ba..73b818a801 100644 --- a/server/src/test/java/com/vaadin/tests/data/bean/BeanWithEnums.java +++ b/server/src/test/java/com/vaadin/tests/data/bean/BeanWithEnums.java @@ -4,7 +4,7 @@ import java.io.Serializable; import java.util.HashSet; import java.util.Set; -public class BeanWithEnums implements Serializable{ +public class BeanWithEnums implements Serializable { private Set<TestEnum> enums = new HashSet<>(); public Set<TestEnum> getEnums() { diff --git a/server/src/test/java/com/vaadin/tests/design/LocaleTest.java b/server/src/test/java/com/vaadin/tests/design/LocaleTest.java index 9293e56983..ab04cbc727 100644 --- a/server/src/test/java/com/vaadin/tests/design/LocaleTest.java +++ b/server/src/test/java/com/vaadin/tests/design/LocaleTest.java @@ -77,19 +77,19 @@ public class LocaleTest { assertTrue( "The element should not have a locale specification, found locale " + eb1.attr("locale"), - eb1.attr("locale").isEmpty()); + eb1.attr("locale").isEmpty()); Element eb2 = ehLayout.child(1); assertEquals("Wrong locale information.", "en_US", eb2.attr("locale")); Element ehLayout2 = evLayout.child(1); assertTrue( "The element should not have a locale specification, found locale " + ehLayout2.attr("locale"), - ehLayout2.attr("locale").isEmpty()); + ehLayout2.attr("locale").isEmpty()); Element el1 = ehLayout2.child(0); assertTrue( "The element should not have a locale specification, found locale " + el1.attr("locale"), - el1.attr("locale").isEmpty()); + el1.attr("locale").isEmpty()); Element el2 = ehLayout2.child(1); assertEquals("Wrong locale information.", "en_CA", el2.attr("locale")); } @@ -163,4 +163,4 @@ public class LocaleTest { assertEquals("The component should have the same locale as its parent.", hLayout.getLocale(), b3.getLocale()); } -}
\ No newline at end of file +} diff --git a/server/src/test/java/com/vaadin/tests/design/UPPERCASE/InUpperCasePackage.java b/server/src/test/java/com/vaadin/tests/design/UPPERCASE/InUpperCasePackage.java index 255581d9f3..1708bd5f96 100644 --- a/server/src/test/java/com/vaadin/tests/design/UPPERCASE/InUpperCasePackage.java +++ b/server/src/test/java/com/vaadin/tests/design/UPPERCASE/InUpperCasePackage.java @@ -4,4 +4,4 @@ import com.vaadin.ui.VerticalLayout; public class InUpperCasePackage extends VerticalLayout { -}
\ No newline at end of file +} diff --git a/server/src/test/java/com/vaadin/tests/design/designroot/CustomComponentDesignRootForVerticalLayout.java b/server/src/test/java/com/vaadin/tests/design/designroot/CustomComponentDesignRootForVerticalLayout.java index 0394e7b70c..840fdf1488 100644 --- a/server/src/test/java/com/vaadin/tests/design/designroot/CustomComponentDesignRootForVerticalLayout.java +++ b/server/src/test/java/com/vaadin/tests/design/designroot/CustomComponentDesignRootForVerticalLayout.java @@ -7,7 +7,8 @@ import com.vaadin.ui.Label; import com.vaadin.ui.declarative.Design; @DesignRoot("DesignWithEmptyAnnotation.html") -public class CustomComponentDesignRootForVerticalLayout extends CustomComponent { +public class CustomComponentDesignRootForVerticalLayout + extends CustomComponent { public Button ok; public Button cancel; diff --git a/server/src/test/java/com/vaadin/tests/event/MarkAsDirtyListenerTest.java b/server/src/test/java/com/vaadin/tests/event/MarkAsDirtyListenerTest.java index 461ab74bcf..0ac04db157 100644 --- a/server/src/test/java/com/vaadin/tests/event/MarkAsDirtyListenerTest.java +++ b/server/src/test/java/com/vaadin/tests/event/MarkAsDirtyListenerTest.java @@ -29,8 +29,9 @@ public class MarkAsDirtyListenerTest { UI ui = new MockUI(); AtomicReference<MarkedAsDirtyConnectorEvent> events = new AtomicReference<>(); - ui.getConnectorTracker().addMarkedAsDirtyListener(event -> Assert - .assertTrue("No reference should have been registered", + ui.getConnectorTracker() + .addMarkedAsDirtyListener(event -> Assert.assertTrue( + "No reference should have been registered", events.compareAndSet(null, event))); // UI is marked dirty on creation and when adding a listener ComponentTest.syncToClient(ui); @@ -48,9 +49,12 @@ public class MarkAsDirtyListenerTest { @Test public void fire_event_for_setContent() { List<MarkedAsDirtyConnectorEvent> events = new ArrayList<>(); - UI ui = new MockUI() {{ - getConnectorTracker().addMarkedAsDirtyListener(event -> events.add(event)); - }}; + UI ui = new MockUI() { + { + getConnectorTracker() + .addMarkedAsDirtyListener(event -> events.add(event)); + } + }; ComponentTest.syncToClient(ui); Button button = new Button("Button"); @@ -72,8 +76,9 @@ public class MarkAsDirtyListenerTest { ComponentTest.syncToClient(button); AtomicReference<MarkedAsDirtyConnectorEvent> events = new AtomicReference<>(); - ui.getConnectorTracker().addMarkedAsDirtyListener(event -> Assert - .assertTrue("No reference should have been registered", + ui.getConnectorTracker() + .addMarkedAsDirtyListener(event -> Assert.assertTrue( + "No reference should have been registered", events.compareAndSet(null, event))); button.setIconAlternateText("alternate"); @@ -89,9 +94,12 @@ public class MarkAsDirtyListenerTest { @Test public void fire_events_for_each_component() { List<MarkedAsDirtyConnectorEvent> events = new ArrayList<>(); - UI ui = new MockUI() {{ - getConnectorTracker().addMarkedAsDirtyListener(event -> events.add(event)); - }}; + UI ui = new MockUI() { + { + getConnectorTracker() + .addMarkedAsDirtyListener(event -> events.add(event)); + } + }; HorizontalLayout layout = new HorizontalLayout(); // UI initially marked as dirty so should not show as event. @@ -126,8 +134,9 @@ public class MarkAsDirtyListenerTest { ComponentTest.syncToClient(button); AtomicReference<MarkedAsDirtyConnectorEvent> events = new AtomicReference<>(); - ui.getConnectorTracker().addMarkedAsDirtyListener(event -> Assert - .assertTrue("Only one event should have registered", + ui.getConnectorTracker() + .addMarkedAsDirtyListener(event -> Assert.assertTrue( + "Only one event should have registered", events.compareAndSet(null, event))); button.setIconAlternateText("alternate"); diff --git a/server/src/test/java/com/vaadin/tests/server/KeyMapperIdGetterTest.java b/server/src/test/java/com/vaadin/tests/server/KeyMapperIdGetterTest.java index de51b5cffc..3e64eaf963 100644 --- a/server/src/test/java/com/vaadin/tests/server/KeyMapperIdGetterTest.java +++ b/server/src/test/java/com/vaadin/tests/server/KeyMapperIdGetterTest.java @@ -3,13 +3,14 @@ package com.vaadin.tests.server; import com.vaadin.server.KeyMapper; /** - * The test checks the same functionality as {@link KeyMapperTest} does, but uses custom {@code identifierGetter} - * instead of default trivial one. {@code BrokenBean} intentionally has broken {@code hashCode} and {@code equals}, and the test should pass - * despite of that, because {@code BrokenBean.getId()} is used for bean identification. + * The test checks the same functionality as {@link KeyMapperTest} does, but + * uses custom {@code identifierGetter} instead of default trivial one. + * {@code BrokenBean} intentionally has broken {@code hashCode} and + * {@code equals}, and the test should pass despite of that, because + * {@code BrokenBean.getId()} is used for bean identification. */ public class KeyMapperIdGetterTest extends KeyMapperTest { - private static class BrokenBean { private final Object id = new Object(); diff --git a/server/src/test/java/com/vaadin/tests/server/SimpleMultiPartInputStreamTest.java b/server/src/test/java/com/vaadin/tests/server/SimpleMultiPartInputStreamTest.java index 06ae1570b2..ac37645cbf 100644 --- a/server/src/test/java/com/vaadin/tests/server/SimpleMultiPartInputStreamTest.java +++ b/server/src/test/java/com/vaadin/tests/server/SimpleMultiPartInputStreamTest.java @@ -22,8 +22,8 @@ public class SimpleMultiPartInputStreamTest { protected void checkBoundaryDetection(byte[] input, String boundary, byte[] expected) throws Exception { ByteArrayInputStream bais = new ByteArrayInputStream(input); - try (SimpleMultiPartInputStream smpis = new SimpleMultiPartInputStream(bais, - boundary)) { + try (SimpleMultiPartInputStream smpis = new SimpleMultiPartInputStream( + bais, boundary)) { ByteArrayOutputStream resultStream = new ByteArrayOutputStream(); int outbyte; try { @@ -33,7 +33,7 @@ public class SimpleMultiPartInputStreamTest { } catch (IOException e) { throw new IOException( e.getMessage() + "; expected " + new String(expected) - + " but got " + resultStream.toString()); + + " but got " + resultStream.toString()); } if (!Arrays.equals(expected, resultStream.toByteArray())) { throw new Exception("Mismatch: expected " + new String(expected) diff --git a/server/src/test/java/com/vaadin/tests/server/component/ReadEmptyDesignTest.java b/server/src/test/java/com/vaadin/tests/server/component/ReadEmptyDesignTest.java index 1156d72b71..2757fd6c3d 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/ReadEmptyDesignTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/ReadEmptyDesignTest.java @@ -67,4 +67,4 @@ public class ReadEmptyDesignTest { html.appendChild(doc.createElement("body")); return doc; } -}
\ No newline at end of file +} diff --git a/server/src/test/java/com/vaadin/tests/server/component/abstractlisting/AbstractListingDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/abstractlisting/AbstractListingDeclarativeTest.java index 5c04a493c5..9ebcad433d 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/abstractlisting/AbstractListingDeclarativeTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/abstractlisting/AbstractListingDeclarativeTest.java @@ -72,11 +72,11 @@ public abstract class AbstractListingDeclarativeTest<T extends AbstractListing> List<String> items = Arrays.asList("foo", "bar", "foobar", "barfoo"); - String design = String.format( - "<%s>\n" + "<option item='foo' icon='%s'>foo</option>\n" - + "<option item='bar' icon='%s'>bar</option>" - + "<option item='foobar' icon='theme://%s'>foobar</option>" - + "<option item='barfoo'>barfoo</option>" + "</%s>", + String design = String.format("<%s>\n" + + "<option item='foo' icon='%s'>foo</option>\n" + + "<option item='bar' icon='%s'>bar</option>" + + "<option item='foobar' icon='theme://%s'>foobar</option>" + + "<option item='barfoo'>barfoo</option>" + "</%s>", getComponentTag(), EXTERNAL_URL, FILE_PATH, THEME_PATH, getComponentTag()); diff --git a/server/src/test/java/com/vaadin/tests/server/component/abstractmultiselect/AbstractMultiSelectDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/abstractmultiselect/AbstractMultiSelectDeclarativeTest.java index 0745ba0f5c..7291db35bb 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/abstractmultiselect/AbstractMultiSelectDeclarativeTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/abstractmultiselect/AbstractMultiSelectDeclarativeTest.java @@ -39,10 +39,10 @@ public abstract class AbstractMultiSelectDeclarativeTest<T extends AbstractMulti String type = "com.vaadin.SomeType"; String attribute = "data-type"; - String design = String.format( - "<%s %s='%s'>\n" + "<option item='foo' selected>foo1</option>\n" - + "<option item='bar'>bar1</option>" - + "<option item='foobar' selected>foobar1</option></%s>", + String design = String.format("<%s %s='%s'>\n" + + "<option item='foo' selected>foo1</option>\n" + + "<option item='bar'>bar1</option>" + + "<option item='foobar' selected>foobar1</option></%s>", getComponentTag(), attribute, type, getComponentTag()); T component = getComponentClass().newInstance(); component.setItems(items); @@ -69,10 +69,10 @@ public abstract class AbstractMultiSelectDeclarativeTest<T extends AbstractMulti String type = "com.vaadin.SomeType"; String attribute = "data-type"; - String design = String.format( - "<%s %s='%s'>\n" + "<option item='foo' selected>foo1</option>\n" - + "<option item='bar'>bar1</option>" - + "<option item='foobar' selected>foobar1</option></%s>", + String design = String.format("<%s %s='%s'>\n" + + "<option item='foo' selected>foo1</option>\n" + + "<option item='bar'>bar1</option>" + + "<option item='foobar' selected>foobar1</option></%s>", getComponentTag(), attribute, type, getComponentTag()); T component = getComponentClass().newInstance(); component.setItems(items); diff --git a/server/src/test/java/com/vaadin/tests/server/component/abstractorderedlayout/AddComponentsTest.java b/server/src/test/java/com/vaadin/tests/server/component/abstractorderedlayout/AddComponentsTest.java index 7ea028a594..bf1df307e8 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/abstractorderedlayout/AddComponentsTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/abstractorderedlayout/AddComponentsTest.java @@ -18,8 +18,8 @@ import com.vaadin.ui.VerticalLayout; public class AddComponentsTest { - Component[] children = { new Label("A"), new Label("B"), - new Label("C"), new Label("D") }; + Component[] children = { new Label("A"), new Label("B"), new Label("C"), + new Label("D") }; @Test public void moveComponentsBetweenLayouts() { diff --git a/server/src/test/java/com/vaadin/tests/server/component/button/ButtonDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/button/ButtonDeclarativeTest.java index 8487f7f7cd..d66de9961c 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/button/ButtonDeclarativeTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/button/ButtonDeclarativeTest.java @@ -70,8 +70,7 @@ public class ButtonDeclarativeTest extends DeclarativeTestBase<Button> { designPlainText = designPlainText.replace("vaadin-button", "vaadin-native-button"); Button nativeButton = read(designPlainText); - assertEquals(expectedCaptionPlainText, - nativeButton.getCaption()); + assertEquals(expectedCaptionPlainText, nativeButton.getCaption()); String designHtml = "<vaadin-button>> One</vaadin-button>"; String expectedCaptionHtml = "> One"; diff --git a/server/src/test/java/com/vaadin/tests/server/component/checkboxgroup/CheckBoxGroupDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/checkboxgroup/CheckBoxGroupDeclarativeTest.java index b7a5d069ae..dcac4529ea 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/checkboxgroup/CheckBoxGroupDeclarativeTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/checkboxgroup/CheckBoxGroupDeclarativeTest.java @@ -75,4 +75,4 @@ public class CheckBoxGroupDeclarativeTest return null; } -}
\ No newline at end of file +} diff --git a/server/src/test/java/com/vaadin/tests/server/component/combobox/ComboBoxDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/combobox/ComboBoxDeclarativeTest.java index 080f83cc36..6b21b0c463 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/combobox/ComboBoxDeclarativeTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/combobox/ComboBoxDeclarativeTest.java @@ -74,10 +74,10 @@ public class ComboBoxDeclarativeTest IllegalAccessException, InvocationTargetException { List<String> items = Arrays.asList("foo", "bar", "foobar"); - String design = String.format( - "<%s>\n" + "<option item='foo' style='foo-style'>foo</option>\n" - + "<option item='bar' style='bar-style'>bar</option>" - + "<option item='foobar' style='foobar-style'>foobar</option></%s>", + String design = String.format("<%s>\n" + + "<option item='foo' style='foo-style'>foo</option>\n" + + "<option item='bar' style='bar-style'>bar</option>" + + "<option item='foobar' style='foobar-style'>foobar</option></%s>", getComponentTag(), getComponentTag()); ComboBox<String> comboBox = new ComboBox<>(); comboBox.setItems(items); diff --git a/server/src/test/java/com/vaadin/tests/server/component/csslayout/AddComponentsTest.java b/server/src/test/java/com/vaadin/tests/server/component/csslayout/AddComponentsTest.java index ac571fd7ac..c5b3cc9c87 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/csslayout/AddComponentsTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/csslayout/AddComponentsTest.java @@ -16,8 +16,8 @@ import com.vaadin.ui.Layout; public class AddComponentsTest { - private final Component[] children = { new Label("A"), - new Label("B"), new Label("C"), new Label("D") }; + private final Component[] children = { new Label("A"), new Label("B"), + new Label("C"), new Label("D") }; @Test public void moveComponentsBetweenLayouts() { diff --git a/server/src/test/java/com/vaadin/tests/server/component/grid/TestGrid.java b/server/src/test/java/com/vaadin/tests/server/component/grid/TestGrid.java index b6a6ab548f..9de8ba5c98 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/grid/TestGrid.java +++ b/server/src/test/java/com/vaadin/tests/server/component/grid/TestGrid.java @@ -5,6 +5,7 @@ import com.vaadin.ui.Grid; /** * {@link Grid} class for testing purposes + * * @param <T> * the grid bean type */ diff --git a/server/src/test/java/com/vaadin/tests/server/component/gridlayout/GridLayoutTest.java b/server/src/test/java/com/vaadin/tests/server/component/gridlayout/GridLayoutTest.java index 414768d028..abf2e823d5 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/gridlayout/GridLayoutTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/gridlayout/GridLayoutTest.java @@ -16,8 +16,8 @@ import com.vaadin.ui.Label; import com.vaadin.ui.Layout; public class GridLayoutTest { - Component[] children = { new Label("A"), new Label("B"), - new Label("C"), new Label("D") }; + Component[] children = { new Label("A"), new Label("B"), new Label("C"), + new Label("D") }; @Test public void testConstructorWithComponents() { diff --git a/server/src/test/java/com/vaadin/tests/server/component/link/LinkDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/link/LinkDeclarativeTest.java index cb970e4ac9..315d016d89 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/link/LinkDeclarativeTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/link/LinkDeclarativeTest.java @@ -48,4 +48,4 @@ public class LinkDeclarativeTest extends DeclarativeTestBase<Link> { testWrite("<vaadin-link />", new Link()); } -}
\ No newline at end of file +} diff --git a/server/src/test/java/com/vaadin/tests/server/component/radiobuttongroup/RadioButtonGroupDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/radiobuttongroup/RadioButtonGroupDeclarativeTest.java index 20c5a5b265..fa9a2ccda9 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/radiobuttongroup/RadioButtonGroupDeclarativeTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/radiobuttongroup/RadioButtonGroupDeclarativeTest.java @@ -75,4 +75,4 @@ public class RadioButtonGroupDeclarativeTest return null; } -}
\ No newline at end of file +} diff --git a/server/src/test/java/com/vaadin/tests/server/component/treegrid/TreeGridDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/treegrid/TreeGridDeclarativeTest.java index c116c08146..a9dd11fc24 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/treegrid/TreeGridDeclarativeTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/treegrid/TreeGridDeclarativeTest.java @@ -77,7 +77,6 @@ public class TreeGridDeclarativeTest testWrite(design, grid, true); } - @Override public void valueSerialization() throws InstantiationException, IllegalAccessException, InvocationTargetException { diff --git a/server/src/test/java/com/vaadin/tests/server/component/twincolselect/TwinColSelectDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/twincolselect/TwinColSelectDeclarativeTest.java index 6b330077b3..76caf30f3a 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/twincolselect/TwinColSelectDeclarativeTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/twincolselect/TwinColSelectDeclarativeTest.java @@ -68,4 +68,4 @@ public class TwinColSelectDeclarativeTest return TwinColSelect.class; } -}
\ No newline at end of file +} diff --git a/server/src/test/java/com/vaadin/tests/server/component/window/AttachDetachWindowTest.java b/server/src/test/java/com/vaadin/tests/server/component/window/AttachDetachWindowTest.java index 9b20015b37..69b37ba1f8 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/window/AttachDetachWindowTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/window/AttachDetachWindowTest.java @@ -219,9 +219,8 @@ public class AttachDetachWindowTest { final Window window = new Window(); final boolean[] eventFired = new boolean[1]; - ui.addComponentAttachListener( - event -> eventFired[0] = event.getAttachedComponent() - .equals(window)); + ui.addComponentAttachListener(event -> eventFired[0] = event + .getAttachedComponent().equals(window)); ui.addWindow(window); assertTrue("Attach event is not fired for added window", eventFired[0]); } @@ -232,9 +231,8 @@ public class AttachDetachWindowTest { final Window window = new Window(); final boolean[] eventFired = new boolean[1]; - ui.addComponentDetachListener( - event -> eventFired[0] = event.getDetachedComponent() - .equals(window)); + ui.addComponentDetachListener(event -> eventFired[0] = event + .getDetachedComponent().equals(window)); ui.addWindow(window); ui.removeWindow(window); diff --git a/shared/pom.xml b/shared/pom.xml index 4fab22a343..56b17a1ee8 100644 --- a/shared/pom.xml +++ b/shared/pom.xml @@ -37,6 +37,15 @@ <build> <plugins> + <plugin> + <groupId>net.revelc.code.formatter</groupId> + <artifactId>formatter-maven-plugin</artifactId> + </plugin> + <plugin> + <groupId>com.github.dantwining.whitespace-maven-plugin</groupId> + <artifactId>whitespace-maven-plugin</artifactId> + </plugin> + <!-- Generated Version.java --> <plugin> <groupId>org.codehaus.mojo</groupId> diff --git a/shared/src/main/java/com/vaadin/shared/Range.java b/shared/src/main/java/com/vaadin/shared/Range.java index 24fe0e6799..18939596fc 100644 --- a/shared/src/main/java/com/vaadin/shared/Range.java +++ b/shared/src/main/java/com/vaadin/shared/Range.java @@ -298,8 +298,7 @@ public final class Range implements Serializable { * * @param other * the other range to compare against - * @return <code>true</code> if this range ends after the - * <code>other</code> + * @return <code>true</code> if this range ends after the <code>other</code> */ public boolean endsAfter(final Range other) { return getEnd() > other.getEnd(); diff --git a/shared/src/main/java/com/vaadin/shared/communication/MethodInvocation.java b/shared/src/main/java/com/vaadin/shared/communication/MethodInvocation.java index 39cd086a6b..f41c4ef39e 100644 --- a/shared/src/main/java/com/vaadin/shared/communication/MethodInvocation.java +++ b/shared/src/main/java/com/vaadin/shared/communication/MethodInvocation.java @@ -115,9 +115,12 @@ public class MethodInvocation implements Serializable { public int hashCode() { final int prime = 31; int result = 1; - result = prime * result + ((connectorId == null) ? 0 : connectorId.hashCode()); - result = prime * result + ((interfaceName == null) ? 0 : interfaceName.hashCode()); - result = prime * result + ((methodName == null) ? 0 : methodName.hashCode()); + result = prime * result + + ((connectorId == null) ? 0 : connectorId.hashCode()); + result = prime * result + + ((interfaceName == null) ? 0 : interfaceName.hashCode()); + result = prime * result + + ((methodName == null) ? 0 : methodName.hashCode()); result = prime * result + Arrays.hashCode(parameters); return result; } diff --git a/shared/src/main/java/com/vaadin/shared/extension/PartInformationState.java b/shared/src/main/java/com/vaadin/shared/extension/PartInformationState.java index 59bd787fca..a240e8506a 100644 --- a/shared/src/main/java/com/vaadin/shared/extension/PartInformationState.java +++ b/shared/src/main/java/com/vaadin/shared/extension/PartInformationState.java @@ -20,7 +20,7 @@ import com.vaadin.shared.communication.SharedState; /** * Shared state for {@code AbstractEventTriggerExtensionConnector} extension. * - * @since 8.4 + * @since 8.4 */ public class PartInformationState extends SharedState { diff --git a/shared/src/main/java/com/vaadin/shared/ui/datefield/AbstractDateFieldState.java b/shared/src/main/java/com/vaadin/shared/ui/datefield/AbstractDateFieldState.java index 9437785f53..575ef59e73 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/datefield/AbstractDateFieldState.java +++ b/shared/src/main/java/com/vaadin/shared/ui/datefield/AbstractDateFieldState.java @@ -122,7 +122,7 @@ public class AbstractDateFieldState extends AbstractFieldState { /** * Map of custom style names that correspond with given dates. Each date * must be set to midnight for the handling logic to work correctly. - * + * * @since 8.3 */ public Map<String, String> dateStyles = new HashMap<String, String>(); diff --git a/shared/src/main/java/com/vaadin/shared/ui/dnd/DragSourceRpc.java b/shared/src/main/java/com/vaadin/shared/ui/dnd/DragSourceRpc.java index 32ac95a482..a6cd19d893 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/dnd/DragSourceRpc.java +++ b/shared/src/main/java/com/vaadin/shared/ui/dnd/DragSourceRpc.java @@ -35,7 +35,7 @@ public interface DragSourceRpc extends ServerRpc { * Called when dragend event happens on client side. * * @param dropEffect - * Drop effect of the dragend event, extracted from {@code + * Drop effect of the dragend event, extracted from {@code * DataTransfer.dropEffect} parameter. */ public void dragEnd(DropEffect dropEffect); diff --git a/shared/src/main/java/com/vaadin/shared/ui/dnd/DropTargetRpc.java b/shared/src/main/java/com/vaadin/shared/ui/dnd/DropTargetRpc.java index c3600bf943..7170254311 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/dnd/DropTargetRpc.java +++ b/shared/src/main/java/com/vaadin/shared/ui/dnd/DropTargetRpc.java @@ -34,15 +34,16 @@ public interface DropTargetRpc extends ServerRpc { * Called when drop event happens on client side. * * @param types - * List of data types from {@code DataTransfer.types} object. + * List of data types from {@code DataTransfer.types} object. * @param data - * Map containing all types and corresponding data from the {@code + * Map containing all types and corresponding data from the + * {@code * DataTransfer} object. * @param dropEffect - * The desired drop effect. + * The desired drop effect. * @param mouseEventDetails - * mouse event details object containing information about the drop - * event + * mouse event details object containing information about the + * drop event */ public void drop(List<String> types, Map<String, String> data, String dropEffect, MouseEventDetails mouseEventDetails); diff --git a/shared/src/main/java/com/vaadin/shared/ui/dnd/FileDropTargetClientRpc.java b/shared/src/main/java/com/vaadin/shared/ui/dnd/FileDropTargetClientRpc.java index 97ad4a64d5..8ee0417430 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/dnd/FileDropTargetClientRpc.java +++ b/shared/src/main/java/com/vaadin/shared/ui/dnd/FileDropTargetClientRpc.java @@ -31,7 +31,7 @@ public interface FileDropTargetClientRpc extends ClientRpc { * Sends the of upload URLs mapped to the generated file ID. * * @param urls - * File IDs and URLs for uploading files to the server. + * File IDs and URLs for uploading files to the server. */ void sendUploadUrl(Map<String, String> urls); } diff --git a/shared/src/main/java/com/vaadin/shared/ui/dnd/FileDropTargetRpc.java b/shared/src/main/java/com/vaadin/shared/ui/dnd/FileDropTargetRpc.java index 50d34f3820..b9d1e2ca80 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/dnd/FileDropTargetRpc.java +++ b/shared/src/main/java/com/vaadin/shared/ui/dnd/FileDropTargetRpc.java @@ -31,7 +31,7 @@ public interface FileDropTargetRpc extends ServerRpc { * Called when files are dropped onto the file drop target. * * @param fileParams - * Generated file IDs and file parameters of dropped files. + * Generated file IDs and file parameters of dropped files. */ public void drop(Map<String, FileParameters> fileParams); diff --git a/shared/src/main/java/com/vaadin/shared/ui/dnd/FileParameters.java b/shared/src/main/java/com/vaadin/shared/ui/dnd/FileParameters.java index 24d2407bdc..0e648a70c0 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/dnd/FileParameters.java +++ b/shared/src/main/java/com/vaadin/shared/ui/dnd/FileParameters.java @@ -39,11 +39,11 @@ public class FileParameters implements Serializable { * Creates a file parameters object. * * @param name - * Name of the file. + * Name of the file. * @param size - * Size of the file. + * Size of the file. * @param mime - * Mime type of the file. + * Mime type of the file. */ public FileParameters(String name, long size, String mime) { this.name = name; @@ -64,7 +64,7 @@ public class FileParameters implements Serializable { * Sets the file name. * * @param name - * Name of the file. + * Name of the file. */ public void setName(String name) { this.name = name; @@ -83,7 +83,7 @@ public class FileParameters implements Serializable { * Sets the file size. * * @param size - * Size of the file. + * Size of the file. */ public void setSize(long size) { this.size = size; @@ -102,7 +102,7 @@ public class FileParameters implements Serializable { * Sets the mime type. * * @param mime - * Mime type of the file. + * Mime type of the file. */ public void setMime(String mime) { this.mime = mime; diff --git a/shared/src/main/java/com/vaadin/shared/ui/dnd/criteria/Payload.java b/shared/src/main/java/com/vaadin/shared/ui/dnd/criteria/Payload.java index 4e3f901185..701879ae4b 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/dnd/criteria/Payload.java +++ b/shared/src/main/java/com/vaadin/shared/ui/dnd/criteria/Payload.java @@ -79,7 +79,7 @@ public class Payload implements Serializable { * Sets the key of this payload. * * @param key - * key that identifies the payload + * key that identifies the payload */ public void setKey(String key) { this.key = key; @@ -98,7 +98,7 @@ public class Payload implements Serializable { * Sets the value of this payload. * * @param value - * value of the payload + * value of the payload */ public void setValue(String value) { this.value = value; @@ -117,7 +117,7 @@ public class Payload implements Serializable { * Sets the value type of this payload. * * @param valueType - * type of the payload value + * type of the payload value */ public void setValueType(ValueType valueType) { this.valueType = valueType; diff --git a/shared/src/main/java/com/vaadin/shared/ui/grid/ColumnState.java b/shared/src/main/java/com/vaadin/shared/ui/grid/ColumnState.java index 9b6fde9c33..b3467d0267 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/grid/ColumnState.java +++ b/shared/src/main/java/com/vaadin/shared/ui/grid/ColumnState.java @@ -34,7 +34,7 @@ public class ColumnState extends AbstractGridExtensionState { /** * Sets whether Grid should handle events from Widgets from this column or * not. - * + * * @since 8.3 */ public boolean handleWidgetEvents = false; diff --git a/shared/src/main/java/com/vaadin/shared/ui/grid/HeightMode.java b/shared/src/main/java/com/vaadin/shared/ui/grid/HeightMode.java index 7f6f52e0ed..7bed238fdd 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/grid/HeightMode.java +++ b/shared/src/main/java/com/vaadin/shared/ui/grid/HeightMode.java @@ -16,10 +16,10 @@ package com.vaadin.shared.ui.grid; /** - * The modes for height calculation that are supported by Grid ( - * client ({@code com.vaadin.client.widgets.Grid}), - * server ({@code com.vaadin.ui.Grid server}), and - * Escalator ({@code com.vaadin.client.widgets.Escalator Escalator}). + * The modes for height calculation that are supported by Grid ( client + * ({@code com.vaadin.client.widgets.Grid}), server + * ({@code com.vaadin.ui.Grid server}), and Escalator + * ({@code com.vaadin.client.widgets.Escalator Escalator}). * * @since 7.4 * @author Vaadin Ltd diff --git a/shared/src/main/java/com/vaadin/shared/ui/notification/NotificationState.java b/shared/src/main/java/com/vaadin/shared/ui/notification/NotificationState.java index 1ea913c73a..8823836e64 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/notification/NotificationState.java +++ b/shared/src/main/java/com/vaadin/shared/ui/notification/NotificationState.java @@ -39,7 +39,8 @@ public class NotificationState extends SharedState { public String description; /** - * Whether texts are interpreted as HTML ({@code true}) or not ({@code false}). + * Whether texts are interpreted as HTML ({@code true}) or not + * ({@code false}). */ public boolean htmlContentAllowed; @@ -49,8 +50,8 @@ public class NotificationState extends SharedState { public String styleName; /** - * The {@link Position} of the {@link com.vaadin.ui.Notification}, - * can not be {@code null}. + * The {@link Position} of the {@link com.vaadin.ui.Notification}, can not + * be {@code null}. */ public Position position = Position.MIDDLE_CENTER; diff --git a/shared/src/main/java/com/vaadin/shared/ui/orderedlayout/AbstractOrderedLayoutServerRpc.java b/shared/src/main/java/com/vaadin/shared/ui/orderedlayout/AbstractOrderedLayoutServerRpc.java index 34e0ea77d4..5bee6076d9 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/orderedlayout/AbstractOrderedLayoutServerRpc.java +++ b/shared/src/main/java/com/vaadin/shared/ui/orderedlayout/AbstractOrderedLayoutServerRpc.java @@ -17,7 +17,6 @@ package com.vaadin.shared.ui.orderedlayout; import com.vaadin.shared.ui.LayoutClickRpc; -public interface AbstractOrderedLayoutServerRpc - extends LayoutClickRpc { +public interface AbstractOrderedLayoutServerRpc extends LayoutClickRpc { } diff --git a/shared/src/main/java/com/vaadin/shared/ui/treegrid/TreeGridDropTargetRpc.java b/shared/src/main/java/com/vaadin/shared/ui/treegrid/TreeGridDropTargetRpc.java index 2ac0137c68..b915461518 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/treegrid/TreeGridDropTargetRpc.java +++ b/shared/src/main/java/com/vaadin/shared/ui/treegrid/TreeGridDropTargetRpc.java @@ -35,23 +35,24 @@ public interface TreeGridDropTargetRpc extends ServerRpc { * Called when drop event happens on client side. * * @param types - * list of data types from {@code DataTransfer.types} object + * list of data types from {@code DataTransfer.types} object * @param data - * map containing all types and corresponding data from the {@code + * map containing all types and corresponding data from the + * {@code * DataTransfer} object * @param dropEffect - * the desired drop effect + * the desired drop effect * @param rowKey - * key of the row on which the drop event occurred + * key of the row on which the drop event occurred * @param depth - * depth of the row in the hierarchy + * depth of the row in the hierarchy * @param collapsed - * whether the target row is collapsed + * whether the target row is collapsed * @param dropLocation - * location of the drop within the row + * location of the drop within the row * @param mouseEventDetails - * Mouse event details object containing information about the drop - * event + * Mouse event details object containing information about the + * drop event */ public void drop(List<String> types, Map<String, String> data, String dropEffect, String rowKey, Integer depth, Boolean collapsed, |