diff options
author | Denis <denis@vaadin.com> | 2016-12-08 10:57:38 +0200 |
---|---|---|
committer | Pekka Hyvönen <pekka@vaadin.com> | 2016-12-08 10:57:38 +0200 |
commit | 9fb43988c7335167d40b01479265e41cad55d301 (patch) | |
tree | 941d5c15b403776a83b9474df39ffb52eb320768 | |
parent | 414de3c4b2ea5267808980bd23a9e56aa865e96b (diff) | |
download | vaadin-framework-9fb43988c7335167d40b01479265e41cad55d301.tar.gz vaadin-framework-9fb43988c7335167d40b01479265e41cad55d301.zip |
Introduce dedicated shared states for every core vaadin component/ext. (#98)
* Introduce dedicated shared states for every core vaadin component/ext.
Updated components are:
- PasswordField
- CustomField
- AbstractListing
- AbstractMultiSelect
- ColorPicker
- ColorPickerArea
- DataCommunicator
- Responsive
- AbstractListingExtension
- DetailsManager
- AbstractRenderer
- ClickableRenderer
- ButtonRenderer
- CheckBoxRenderer
- DateRenderer
- HtmlRenderer
- ImageRenderer
- NumberRenderer
- ProgressBarRenderer
- TextRenderer
Fixes vaadin/framework8-issues#480.
81 files changed, 1161 insertions, 104 deletions
diff --git a/client/src/main/java/com/vaadin/client/connectors/AbstractListingConnector.java b/client/src/main/java/com/vaadin/client/connectors/AbstractListingConnector.java index 88fccab32e..41af07bca9 100644 --- a/client/src/main/java/com/vaadin/client/connectors/AbstractListingConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/AbstractListingConnector.java @@ -19,6 +19,7 @@ import com.vaadin.client.connectors.data.HasDataSource; import com.vaadin.client.data.DataSource; import com.vaadin.client.ui.AbstractFieldConnector; import com.vaadin.shared.data.DataCommunicatorConstants; +import com.vaadin.shared.ui.abstractlisting.AbstractListingState; import com.vaadin.ui.AbstractListing; import elemental.json.JsonObject; @@ -78,4 +79,9 @@ public abstract class AbstractListingConnector extends AbstractFieldConnector protected boolean isRowSelected(JsonObject row) { return row.hasKey(DataCommunicatorConstants.SELECTED); } + + @Override + public AbstractListingState getState() { + return (AbstractListingState) super.getState(); + } } diff --git a/client/src/main/java/com/vaadin/client/connectors/AbstractMultiSelectConnector.java b/client/src/main/java/com/vaadin/client/connectors/AbstractMultiSelectConnector.java index 1550f86292..ee85b50ebe 100644 --- a/client/src/main/java/com/vaadin/client/connectors/AbstractMultiSelectConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/AbstractMultiSelectConnector.java @@ -26,11 +26,11 @@ import com.google.gwt.user.client.ui.IsWidget; import com.google.gwt.user.client.ui.Widget; import com.vaadin.client.data.DataSource; import com.vaadin.client.ui.HasRequiredIndicator; -import com.vaadin.shared.AbstractFieldState; import com.vaadin.shared.Range; import com.vaadin.shared.Registration; import com.vaadin.shared.data.selection.MultiSelectServerRpc; import com.vaadin.shared.ui.ListingJsonConstants; +import com.vaadin.shared.ui.abstractmultiselect.AbstractMultiSelectState; import elemental.json.JsonObject; @@ -156,8 +156,8 @@ public abstract class AbstractMultiSelectConnector } @Override - public AbstractFieldState getState() { - return (AbstractFieldState) super.getState(); + public AbstractMultiSelectState getState() { + return (AbstractMultiSelectState) super.getState(); } @Override diff --git a/client/src/main/java/com/vaadin/client/connectors/AbstractRendererConnector.java b/client/src/main/java/com/vaadin/client/connectors/AbstractRendererConnector.java index 989f10f266..ce41ae38ac 100644 --- a/client/src/main/java/com/vaadin/client/connectors/AbstractRendererConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/AbstractRendererConnector.java @@ -23,6 +23,7 @@ import com.vaadin.client.metadata.Type; import com.vaadin.client.metadata.TypeData; import com.vaadin.client.metadata.TypeDataStore; import com.vaadin.client.renderers.Renderer; +import com.vaadin.shared.ui.grid.renderers.AbstractRendererState; import elemental.json.JsonValue; @@ -125,4 +126,8 @@ public abstract class AbstractRendererConnector<T> // NOOP } + @Override + public AbstractRendererState getState() { + return (AbstractRendererState) super.getState(); + } } diff --git a/client/src/main/java/com/vaadin/client/connectors/ButtonRendererConnector.java b/client/src/main/java/com/vaadin/client/connectors/ButtonRendererConnector.java index 2c353e484a..6fbe428edc 100644 --- a/client/src/main/java/com/vaadin/client/connectors/ButtonRendererConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/ButtonRendererConnector.java @@ -19,6 +19,7 @@ import com.google.gwt.event.shared.HandlerRegistration; import com.vaadin.client.renderers.ButtonRenderer; import com.vaadin.client.renderers.ClickableRenderer.RendererClickHandler; import com.vaadin.shared.ui.Connect; +import com.vaadin.shared.ui.grid.renderers.ButtonRendererState; import elemental.json.JsonObject; @@ -42,4 +43,9 @@ public class ButtonRendererConnector RendererClickHandler<JsonObject> handler) { return getRenderer().addClickHandler(handler); } + + @Override + public ButtonRendererState getState() { + return (ButtonRendererState) super.getState(); + } } diff --git a/client/src/main/java/com/vaadin/client/connectors/CheckBoxRendererConnector.java b/client/src/main/java/com/vaadin/client/connectors/CheckBoxRendererConnector.java index 8a2317c0a4..4d9ec782c7 100644 --- a/client/src/main/java/com/vaadin/client/connectors/CheckBoxRendererConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/CheckBoxRendererConnector.java @@ -19,6 +19,7 @@ import com.google.gwt.event.shared.HandlerRegistration; import com.vaadin.client.renderers.CheckBoxRenderer; import com.vaadin.client.renderers.ClickableRenderer.RendererClickHandler; import com.vaadin.shared.ui.Connect; +import com.vaadin.shared.ui.grid.renderers.CheckBoxRendererState; import elemental.json.JsonObject; @@ -42,4 +43,9 @@ public class CheckBoxRendererConnector RendererClickHandler<JsonObject> handler) { return getRenderer().addClickHandler(handler); } + + @Override + public CheckBoxRendererState getState() { + return (CheckBoxRendererState) super.getState(); + } } diff --git a/client/src/main/java/com/vaadin/client/connectors/ClickableRendererConnector.java b/client/src/main/java/com/vaadin/client/connectors/ClickableRendererConnector.java index bed09ca75c..a7d2bbf6b4 100644 --- a/client/src/main/java/com/vaadin/client/connectors/ClickableRendererConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/ClickableRendererConnector.java @@ -20,6 +20,7 @@ import com.vaadin.client.MouseEventDetailsBuilder; import com.vaadin.client.connectors.grid.AbstractGridRendererConnector; import com.vaadin.client.renderers.ClickableRenderer.RendererClickEvent; import com.vaadin.client.renderers.ClickableRenderer.RendererClickHandler; +import com.vaadin.shared.ui.grid.renderers.ClickableRendererState; import com.vaadin.shared.ui.grid.renderers.RendererClickRpc; import elemental.json.JsonObject; @@ -60,4 +61,9 @@ public abstract class ClickableRendererConnector<T> protected abstract HandlerRegistration addClickHandler( RendererClickHandler<JsonObject> handler); + + @Override + public ClickableRendererState getState() { + return (ClickableRendererState) super.getState(); + } } diff --git a/client/src/main/java/com/vaadin/client/connectors/ImageRendererConnector.java b/client/src/main/java/com/vaadin/client/connectors/ImageRendererConnector.java index 7ebeb33638..0bd2f16fd3 100644 --- a/client/src/main/java/com/vaadin/client/connectors/ImageRendererConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/ImageRendererConnector.java @@ -22,6 +22,7 @@ import com.vaadin.client.renderers.ClickableRenderer.RendererClickHandler; import com.vaadin.client.renderers.ImageRenderer; import com.vaadin.shared.communication.URLReference; import com.vaadin.shared.ui.Connect; +import com.vaadin.shared.ui.grid.renderers.ImageRendererState; import elemental.json.JsonObject; import elemental.json.JsonValue; @@ -54,4 +55,9 @@ public class ImageRendererConnector extends ClickableRendererConnector<String> { RendererClickHandler<JsonObject> handler) { return getRenderer().addClickHandler(handler); } + + @Override + public ImageRendererState getState() { + return (ImageRendererState) super.getState(); + } } diff --git a/client/src/main/java/com/vaadin/client/connectors/data/DataCommunicatorConnector.java b/client/src/main/java/com/vaadin/client/connectors/data/DataCommunicatorConnector.java index 380e4681d5..cceedf9bf9 100644 --- a/client/src/main/java/com/vaadin/client/connectors/data/DataCommunicatorConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/data/DataCommunicatorConnector.java @@ -28,6 +28,7 @@ import com.vaadin.server.data.DataCommunicator; import com.vaadin.shared.data.DataCommunicatorClientRpc; import com.vaadin.shared.data.DataCommunicatorConstants; import com.vaadin.shared.data.DataRequestRpc; +import com.vaadin.shared.extension.datacommunicator.DataCommunicatorState; import com.vaadin.shared.ui.Connect; import elemental.json.Json; @@ -133,4 +134,9 @@ public class DataCommunicatorConnector extends AbstractExtensionConnector { assert false : "Parent not implementing HasDataSource"; } } + + @Override + public DataCommunicatorState getState() { + return (DataCommunicatorState) super.getState(); + } } diff --git a/client/src/main/java/com/vaadin/client/connectors/grid/DateRendererConnector.java b/client/src/main/java/com/vaadin/client/connectors/grid/DateRendererConnector.java index da22c77548..ddda1a778a 100644 --- a/client/src/main/java/com/vaadin/client/connectors/grid/DateRendererConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/grid/DateRendererConnector.java @@ -16,6 +16,7 @@ package com.vaadin.client.connectors.grid; import com.vaadin.shared.ui.Connect; +import com.vaadin.shared.ui.grid.renderers.DateRendererState; /** * A connector for {@link com.vaadin.ui.renderers.DateRenderer DateRenderer}. @@ -29,5 +30,9 @@ import com.vaadin.shared.ui.Connect; */ @Connect(com.vaadin.ui.renderers.DateRenderer.class) public class DateRendererConnector extends TextRendererConnector { - // No implementation needed + + @Override + public DateRendererState getState() { + return (DateRendererState) super.getState(); + } } diff --git a/client/src/main/java/com/vaadin/client/connectors/grid/DetailsManagerConnector.java b/client/src/main/java/com/vaadin/client/connectors/grid/DetailsManagerConnector.java index 5488799f61..009de4e99e 100644 --- a/client/src/main/java/com/vaadin/client/connectors/grid/DetailsManagerConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/grid/DetailsManagerConnector.java @@ -30,6 +30,7 @@ import com.vaadin.client.widget.grid.HeightAwareDetailsGenerator; import com.vaadin.client.widgets.Grid; import com.vaadin.shared.Registration; import com.vaadin.shared.ui.Connect; +import com.vaadin.shared.ui.grid.DetailsManagerState; import com.vaadin.shared.ui.grid.GridState; import com.vaadin.ui.Grid.DetailsManager; @@ -159,6 +160,11 @@ public class DetailsManagerConnector extends AbstractExtensionConnector { return (GridConnector) super.getParent(); } + @Override + public DetailsManagerState getState() { + return (DetailsManagerState) super.getState(); + } + private Grid<JsonObject> getWidget() { return getParent().getWidget(); } diff --git a/client/src/main/java/com/vaadin/client/connectors/grid/NumberRendererConnector.java b/client/src/main/java/com/vaadin/client/connectors/grid/NumberRendererConnector.java index dd5d4fae40..4dd089c555 100644 --- a/client/src/main/java/com/vaadin/client/connectors/grid/NumberRendererConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/grid/NumberRendererConnector.java @@ -16,6 +16,7 @@ package com.vaadin.client.connectors.grid; import com.vaadin.shared.ui.Connect; +import com.vaadin.shared.ui.grid.renderers.NumberRendererState; /** * A connector for {@link com.vaadin.ui.renderers.NumberRenderer @@ -30,5 +31,9 @@ import com.vaadin.shared.ui.Connect; */ @Connect(com.vaadin.ui.renderers.NumberRenderer.class) public class NumberRendererConnector extends TextRendererConnector { - // no implementation needed + + @Override + public NumberRendererState getState() { + return (NumberRendererState) super.getState(); + } } diff --git a/client/src/main/java/com/vaadin/client/connectors/grid/ProgressBarRendererConnector.java b/client/src/main/java/com/vaadin/client/connectors/grid/ProgressBarRendererConnector.java index a5f6bec479..5374a87436 100644 --- a/client/src/main/java/com/vaadin/client/connectors/grid/ProgressBarRendererConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/grid/ProgressBarRendererConnector.java @@ -17,6 +17,7 @@ package com.vaadin.client.connectors.grid; import com.vaadin.client.renderers.ProgressBarRenderer; import com.vaadin.shared.ui.Connect; +import com.vaadin.shared.ui.grid.renderers.ProgressBarRendererState; /** * A connector for {@link ProgressBarRenderer}. @@ -32,4 +33,9 @@ public class ProgressBarRendererConnector public ProgressBarRenderer getRenderer() { return (ProgressBarRenderer) super.getRenderer(); } + + @Override + public ProgressBarRendererState getState() { + return (ProgressBarRendererState) super.getState(); + } } diff --git a/client/src/main/java/com/vaadin/client/connectors/grid/TextRendererConnector.java b/client/src/main/java/com/vaadin/client/connectors/grid/TextRendererConnector.java index 4a368a975d..9d9fe75407 100644 --- a/client/src/main/java/com/vaadin/client/connectors/grid/TextRendererConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/grid/TextRendererConnector.java @@ -17,6 +17,7 @@ package com.vaadin.client.connectors.grid; import com.vaadin.client.renderers.TextRenderer; import com.vaadin.shared.ui.Connect; +import com.vaadin.shared.ui.grid.renderers.TextRendererState; /** * A connector for {@link TextRenderer}. @@ -32,4 +33,9 @@ public class TextRendererConnector public TextRenderer getRenderer() { return (TextRenderer) super.getRenderer(); } + + @Override + public TextRendererState getState() { + return (TextRendererState) super.getState(); + } } diff --git a/client/src/main/java/com/vaadin/client/connectors/grid/UnsafeHtmlRendererConnector.java b/client/src/main/java/com/vaadin/client/connectors/grid/UnsafeHtmlRendererConnector.java index 42c9a64bd4..f91497687a 100644 --- a/client/src/main/java/com/vaadin/client/connectors/grid/UnsafeHtmlRendererConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/grid/UnsafeHtmlRendererConnector.java @@ -18,6 +18,7 @@ package com.vaadin.client.connectors.grid; import com.vaadin.client.renderers.Renderer; import com.vaadin.client.widget.grid.RendererCellReference; import com.vaadin.shared.ui.Connect; +import com.vaadin.shared.ui.grid.renderers.HtmlRendererState; /** * A connector for {@link UnsafeHtmlRenderer} @@ -40,4 +41,9 @@ public class UnsafeHtmlRendererConnector public UnsafeHtmlRenderer getRenderer() { return (UnsafeHtmlRenderer) super.getRenderer(); } + + @Override + public HtmlRendererState getState() { + return (HtmlRendererState) super.getState(); + } } diff --git a/client/src/main/java/com/vaadin/client/extensions/FileDownloaderConnector.java b/client/src/main/java/com/vaadin/client/extensions/FileDownloaderConnector.java index 114cada56c..0c43a1f8ff 100644 --- a/client/src/main/java/com/vaadin/client/extensions/FileDownloaderConnector.java +++ b/client/src/main/java/com/vaadin/client/extensions/FileDownloaderConnector.java @@ -30,6 +30,7 @@ import com.vaadin.client.BrowserInfo; import com.vaadin.client.ComponentConnector; import com.vaadin.client.ServerConnector; import com.vaadin.server.FileDownloader; +import com.vaadin.shared.extension.filedownloader.FileDownloaderState; import com.vaadin.shared.ui.Connect; @Connect(FileDownloader.class) @@ -81,4 +82,9 @@ public class FileDownloaderConnector extends AbstractExtensionConnector } } + @Override + public FileDownloaderState getState() { + return (FileDownloaderState) super.getState(); + } + } diff --git a/client/src/main/java/com/vaadin/client/extensions/ResponsiveConnector.java b/client/src/main/java/com/vaadin/client/extensions/ResponsiveConnector.java index cf0fc55292..314d167bfe 100644 --- a/client/src/main/java/com/vaadin/client/extensions/ResponsiveConnector.java +++ b/client/src/main/java/com/vaadin/client/extensions/ResponsiveConnector.java @@ -27,6 +27,7 @@ import com.vaadin.client.ui.AbstractComponentConnector; import com.vaadin.client.ui.layout.ElementResizeEvent; import com.vaadin.client.ui.layout.ElementResizeListener; import com.vaadin.server.Responsive; +import com.vaadin.shared.extension.responsive.ResponsiveState; import com.vaadin.shared.ui.Connect; import com.vaadin.shared.util.SharedUtil; @@ -164,26 +165,26 @@ public class ResponsiveConnector extends AbstractExtensionConnector */ private static native void searchForBreakPointsNative() /*-{ - + // Initialize variables @com.vaadin.client.extensions.ResponsiveConnector::widthRangeCache = []; @com.vaadin.client.extensions.ResponsiveConnector::heightRangeCache = []; - + var widthRanges = @com.vaadin.client.extensions.ResponsiveConnector::widthRangeCache; var heightRanges = @com.vaadin.client.extensions.ResponsiveConnector::heightRangeCache; - + // Can't do squat if we can't parse stylesheets if(!$doc.styleSheets) return; - + var sheets = $doc.styleSheets; - + // Loop all stylesheets on the page and process them individually for(var i = 0, len = sheets.length; i < len; i++) { var sheet = sheets[i]; @com.vaadin.client.extensions.ResponsiveConnector::searchStylesheetForBreakPoints(Lcom/google/gwt/core/client/JavaScriptObject;)(sheet); } - + }-*/; /** @@ -196,15 +197,15 @@ public class ResponsiveConnector extends AbstractExtensionConnector private static native void searchStylesheetForBreakPoints( final JavaScriptObject sheet) /*-{ - + // Inline variables for easier reading var widthRanges = @com.vaadin.client.extensions.ResponsiveConnector::widthRangeCache; var heightRanges = @com.vaadin.client.extensions.ResponsiveConnector::heightRangeCache; - + // Get all the rulesets from the stylesheet var theRules = new Array(); var IEOrEdge = @com.vaadin.client.BrowserInfo::get()().@com.vaadin.client.BrowserInfo::isIE()() || @com.vaadin.client.BrowserInfo::get()().@com.vaadin.client.BrowserInfo::isEdge()(); - + try { if (sheet.cssRules) { theRules = sheet.cssRules @@ -217,18 +218,18 @@ public class ResponsiveConnector extends AbstractExtensionConnector ", probably because of cross domain issues: " + e); return; } - + // Loop through the rulesets for(var i = 0, len = theRules.length; i < len; i++) { var rule = theRules[i]; - + if(rule.type == 3) { // @import rule, traverse recursively @com.vaadin.client.extensions.ResponsiveConnector::searchStylesheetForBreakPoints(Lcom/google/gwt/core/client/JavaScriptObject;)(rule.styleSheet); - + } else if(rule.type == 1 || !rule.type) { // Regular selector rule - + // Helper function var pushToCache = function(ranges, selector, min, max) { // Avoid adding duplicates @@ -244,46 +245,46 @@ public class ResponsiveConnector extends AbstractExtensionConnector ranges.push([selector, min, max]); } }; - + // Array of all of the separate selectors in this ruleset var haystack = rule.selectorText.split(","); - + // IE/Edge parses CSS like .class[attr="val"] into [attr="val"].class so we need to check for both var selectorRegEx = IEOrEdge ? /\[.*\]([\.|#]\S+)/ : /([\.|#]\S+?)\[.*\]/; - + // Loop all the selectors in this ruleset for(var k = 0, len2 = haystack.length; k < len2; k++) { - + // Split the haystack into parts. var widthRange = haystack[k].match(/\[width-range.*?\]/); var heightRange = haystack[k].match(/\[height-range.*?\]/); var selector = haystack[k].match(selectorRegEx); - + if (selector != null) { selector = selector[1]; - + // Check for width-ranges. if (widthRange != null) { var minMax = widthRange[0].match(/\[width-range~?=["|'](.*?)-(.*?)["|']\]/i); var min = minMax[1]; var max = minMax[2]; - + pushToCache(widthRanges, selector, min, max); } - + // Check for height-ranges. if (heightRange != null) { var minMax = heightRange[0].match(/\[height-range~?=["|'](.*?)-(.*?)["|']\]/i); var min = minMax[1]; var max = minMax[2]; - + pushToCache(heightRanges, selector, min, max); } } } } } - + }-*/; /** @@ -293,15 +294,15 @@ public class ResponsiveConnector extends AbstractExtensionConnector */ private native void getBreakPointsFor(final String selectors) /*-{ - + var selectors = selectors.split(","); - + var widthBreakpoints = this.@com.vaadin.client.extensions.ResponsiveConnector::widthBreakpoints = []; var heightBreakpoints = this.@com.vaadin.client.extensions.ResponsiveConnector::heightBreakpoints = []; - + var widthRanges = @com.vaadin.client.extensions.ResponsiveConnector::widthRangeCache; var heightRanges = @com.vaadin.client.extensions.ResponsiveConnector::heightRangeCache; - + for(var i = 0, len = widthRanges.length; i < len; i++) { var bp = widthRanges[i]; for(var j = 0, len2 = selectors.length; j < len2; j++) { @@ -309,7 +310,7 @@ public class ResponsiveConnector extends AbstractExtensionConnector widthBreakpoints.push(bp); } } - + for(var i = 0, len = heightRanges.length; i < len; i++) { var bp = heightRanges[i]; for(var j = 0, len2 = selectors.length; j < len2; j++) { @@ -317,10 +318,10 @@ public class ResponsiveConnector extends AbstractExtensionConnector heightBreakpoints.push(bp); } } - + // Only for debugging // console.log("Breakpoints for", selectors.join(","), widthBreakpoints, heightBreakpoints); - + }-*/; private String currentWidthRanges = ""; @@ -331,6 +332,11 @@ public class ResponsiveConnector extends AbstractExtensionConnector updateRanges(); } + @Override + public ResponsiveState getState() { + return (ResponsiveState) super.getState(); + } + private void updateRanges() { LayoutManager layoutManager = LayoutManager.get(getConnection()); com.google.gwt.user.client.Element element = target.getWidget() @@ -370,24 +376,24 @@ public class ResponsiveConnector extends AbstractExtensionConnector private native String resolveBreakpoint(String which, int size) /*-{ - + // Default to "width" breakpoints var breakpoints = this.@com.vaadin.client.extensions.ResponsiveConnector::widthBreakpoints; - + // Use height breakpoints if we're measuring the height if(which == "height") breakpoints = this.@com.vaadin.client.extensions.ResponsiveConnector::heightBreakpoints; - + // Output string that goes into either the "width-range" or "height-range" attribute in the element var ranges = ""; - + // Loop the breakpoints for(var i = 0, len = breakpoints.length; i < len; i++) { var bp = breakpoints[i]; - + var min = parseInt(bp[1]); var max = parseInt(bp[2]); - + if(!isNaN(min) && !isNaN(max)) { if(min <= size && size <= max) { ranges += " " + bp[1] + "-" + bp[2]; @@ -402,10 +408,10 @@ public class ResponsiveConnector extends AbstractExtensionConnector } } } - + // Trim the output and return it return ranges.replace(/^\s+/, ""); - + }-*/; } diff --git a/client/src/main/java/com/vaadin/client/renderers/CheckBoxRenderer.java b/client/src/main/java/com/vaadin/client/renderers/CheckBoxRenderer.java index 12a92f4574..b004b1c2fa 100644 --- a/client/src/main/java/com/vaadin/client/renderers/CheckBoxRenderer.java +++ b/client/src/main/java/com/vaadin/client/renderers/CheckBoxRenderer.java @@ -45,4 +45,5 @@ public class CheckBoxRenderer extends ClickableRenderer<Boolean, CheckBox> { CheckBox widget) { widget.setValue(data); } + } diff --git a/client/src/main/java/com/vaadin/client/ui/colorpicker/AbstractColorPickerConnector.java b/client/src/main/java/com/vaadin/client/ui/colorpicker/AbstractColorPickerConnector.java index 6f480538e0..e027775793 100644 --- a/client/src/main/java/com/vaadin/client/ui/colorpicker/AbstractColorPickerConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/colorpicker/AbstractColorPickerConnector.java @@ -19,7 +19,7 @@ import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.event.dom.client.HasClickHandlers; import com.vaadin.client.communication.StateChangeEvent; import com.vaadin.client.ui.AbstractComponentConnector; -import com.vaadin.shared.ui.colorpicker.ColorPickerState; +import com.vaadin.shared.ui.colorpicker.AbstractColorPickerState; /** * An abstract class that defines default implementation for a color picker @@ -33,8 +33,8 @@ public abstract class AbstractColorPickerConnector private static final String DEFAULT_WIDTH_STYLE = "v-default-caption-width"; @Override - public ColorPickerState getState() { - return (ColorPickerState) super.getState(); + public AbstractColorPickerState getState() { + return (AbstractColorPickerState) super.getState(); } @Override diff --git a/client/src/main/java/com/vaadin/client/ui/colorpicker/ColorPickerAreaConnector.java b/client/src/main/java/com/vaadin/client/ui/colorpicker/ColorPickerAreaConnector.java index 828cc689c7..fe775aaf44 100644 --- a/client/src/main/java/com/vaadin/client/ui/colorpicker/ColorPickerAreaConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/colorpicker/ColorPickerAreaConnector.java @@ -23,6 +23,7 @@ import com.vaadin.client.communication.RpcProxy; import com.vaadin.client.ui.VColorPickerArea; import com.vaadin.shared.ui.Connect; import com.vaadin.shared.ui.Connect.LoadStyle; +import com.vaadin.shared.ui.colorpicker.ColorPickerAreaState; import com.vaadin.shared.ui.colorpicker.ColorPickerServerRpc; import com.vaadin.ui.ColorPickerArea; @@ -64,4 +65,9 @@ public class ColorPickerAreaConnector extends AbstractColorPickerConnector { getWidget().refreshColor(); } + @Override + public ColorPickerAreaState getState() { + return (ColorPickerAreaState) super.getState(); + } + } diff --git a/client/src/main/java/com/vaadin/client/ui/colorpicker/ColorPickerConnector.java b/client/src/main/java/com/vaadin/client/ui/colorpicker/ColorPickerConnector.java index 6254e7adbe..9a4368b0a4 100644 --- a/client/src/main/java/com/vaadin/client/ui/colorpicker/ColorPickerConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/colorpicker/ColorPickerConnector.java @@ -23,6 +23,7 @@ import com.vaadin.client.ui.VColorPicker; import com.vaadin.shared.ui.Connect; import com.vaadin.shared.ui.Connect.LoadStyle; import com.vaadin.shared.ui.colorpicker.ColorPickerServerRpc; +import com.vaadin.shared.ui.colorpicker.ColorPickerState; import com.vaadin.ui.ColorPicker; /** @@ -66,4 +67,9 @@ public class ColorPickerConnector extends AbstractColorPickerConnector { protected void refreshColor() { getWidget().refreshColor(); } + + @Override + public ColorPickerState getState() { + return (ColorPickerState) super.getState(); + } } diff --git a/client/src/main/java/com/vaadin/client/ui/customfield/CustomFieldConnector.java b/client/src/main/java/com/vaadin/client/ui/customfield/CustomFieldConnector.java index 22abb495d9..c058522c4e 100644 --- a/client/src/main/java/com/vaadin/client/ui/customfield/CustomFieldConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/customfield/CustomFieldConnector.java @@ -27,6 +27,7 @@ import com.vaadin.client.HasComponentsConnector; import com.vaadin.client.ui.AbstractFieldConnector; import com.vaadin.client.ui.VCustomComponent; import com.vaadin.shared.ui.Connect; +import com.vaadin.shared.ui.customfield.CustomFieldState; import com.vaadin.ui.CustomField; @Connect(value = CustomField.class) @@ -121,4 +122,9 @@ public class CustomFieldConnector extends AbstractFieldConnector } } + @Override + public CustomFieldState getState() { + return (CustomFieldState) super.getState(); + } + } diff --git a/client/src/main/java/com/vaadin/client/ui/passwordfield/PasswordFieldConnector.java b/client/src/main/java/com/vaadin/client/ui/passwordfield/PasswordFieldConnector.java index c129c12c8f..03cc60caca 100644 --- a/client/src/main/java/com/vaadin/client/ui/passwordfield/PasswordFieldConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/passwordfield/PasswordFieldConnector.java @@ -18,6 +18,7 @@ package com.vaadin.client.ui.passwordfield; import com.vaadin.client.ui.VPasswordField; import com.vaadin.client.ui.textfield.TextFieldConnector; import com.vaadin.shared.ui.Connect; +import com.vaadin.shared.ui.passwordfield.PasswordFieldState; import com.vaadin.ui.PasswordField; @Connect(PasswordField.class) @@ -27,4 +28,9 @@ public class PasswordFieldConnector extends TextFieldConnector { public VPasswordField getWidget() { return (VPasswordField) super.getWidget(); } + + @Override + public PasswordFieldState getState() { + return (PasswordFieldState) super.getState(); + } } diff --git a/server/src/main/java/com/vaadin/server/AbstractJavaScriptExtension.java b/server/src/main/java/com/vaadin/server/AbstractJavaScriptExtension.java index 82a9fed2bb..8af7e38838 100644 --- a/server/src/main/java/com/vaadin/server/AbstractJavaScriptExtension.java +++ b/server/src/main/java/com/vaadin/server/AbstractJavaScriptExtension.java @@ -208,4 +208,9 @@ public abstract class AbstractJavaScriptExtension extends AbstractExtension { protected JavaScriptExtensionState getState() { return (JavaScriptExtensionState) super.getState(); } + + @Override + protected JavaScriptExtensionState getState(boolean markAsDirty) { + return (JavaScriptExtensionState) super.getState(markAsDirty); + } } diff --git a/server/src/main/java/com/vaadin/server/FileDownloader.java b/server/src/main/java/com/vaadin/server/FileDownloader.java index c277d58f12..684e12dc6e 100644 --- a/server/src/main/java/com/vaadin/server/FileDownloader.java +++ b/server/src/main/java/com/vaadin/server/FileDownloader.java @@ -18,6 +18,7 @@ package com.vaadin.server; import java.io.IOException; +import com.vaadin.shared.extension.filedownloader.FileDownloaderState; import com.vaadin.ui.AbstractComponent; /** @@ -163,4 +164,14 @@ public class FileDownloader extends AbstractExtension { return true; } + @Override + protected FileDownloaderState getState() { + return (FileDownloaderState) super.getState(); + } + + @Override + protected FileDownloaderState getState(boolean markAsDirty) { + return (FileDownloaderState) super.getState(markAsDirty); + } + } diff --git a/server/src/main/java/com/vaadin/server/Responsive.java b/server/src/main/java/com/vaadin/server/Responsive.java index 3354f744e0..5d0bbfb2ab 100644 --- a/server/src/main/java/com/vaadin/server/Responsive.java +++ b/server/src/main/java/com/vaadin/server/Responsive.java @@ -16,6 +16,7 @@ package com.vaadin.server; +import com.vaadin.shared.extension.responsive.ResponsiveState; import com.vaadin.ui.Component; /** @@ -158,4 +159,14 @@ public class Responsive extends AbstractExtension { } } } + + @Override + protected ResponsiveState getState() { + return (ResponsiveState) super.getState(); + } + + @Override + protected ResponsiveState getState(boolean markAsDirty) { + return (ResponsiveState) super.getState(markAsDirty); + } } diff --git a/server/src/main/java/com/vaadin/server/data/DataCommunicator.java b/server/src/main/java/com/vaadin/server/data/DataCommunicator.java index 61545ada83..9d84b1bcc9 100644 --- a/server/src/main/java/com/vaadin/server/data/DataCommunicator.java +++ b/server/src/main/java/com/vaadin/server/data/DataCommunicator.java @@ -34,6 +34,7 @@ import com.vaadin.shared.Registration; import com.vaadin.shared.data.DataCommunicatorClientRpc; import com.vaadin.shared.data.DataCommunicatorConstants; import com.vaadin.shared.data.DataRequestRpc; +import com.vaadin.shared.extension.datacommunicator.DataCommunicatorState; import elemental.json.Json; import elemental.json.JsonArray; @@ -515,6 +516,16 @@ public class DataCommunicator<T, F> extends AbstractExtension { return minPushSize; } + @Override + protected DataCommunicatorState getState(boolean markAsDirty) { + return (DataCommunicatorState) super.getState(markAsDirty); + } + + @Override + protected DataCommunicatorState getState() { + return (DataCommunicatorState) super.getState(); + } + private void attachDataProviderListener() { dataProviderUpdateRegistration = getDataProvider() .addDataProviderListener( diff --git a/server/src/main/java/com/vaadin/ui/AbstractColorPicker.java b/server/src/main/java/com/vaadin/ui/AbstractColorPicker.java index 7a40798815..1630a18e65 100644 --- a/server/src/main/java/com/vaadin/ui/AbstractColorPicker.java +++ b/server/src/main/java/com/vaadin/ui/AbstractColorPicker.java @@ -24,7 +24,7 @@ import org.jsoup.nodes.Element; import com.vaadin.shared.ui.colorpicker.Color; import com.vaadin.shared.ui.colorpicker.ColorPickerServerRpc; -import com.vaadin.shared.ui.colorpicker.ColorPickerState; +import com.vaadin.shared.ui.colorpicker.AbstractColorPickerState; import com.vaadin.ui.components.colorpicker.ColorPickerPopup; import com.vaadin.ui.declarative.DesignAttributeHandler; import com.vaadin.ui.declarative.DesignContext; @@ -390,13 +390,13 @@ public abstract class AbstractColorPicker extends AbstractField<Color> { } @Override - protected ColorPickerState getState() { - return (ColorPickerState) super.getState(); + protected AbstractColorPickerState getState() { + return (AbstractColorPickerState) super.getState(); } @Override - protected ColorPickerState getState(boolean markAsDirty) { - return (ColorPickerState) super.getState(markAsDirty); + protected AbstractColorPickerState getState(boolean markAsDirty) { + return (AbstractColorPickerState) super.getState(markAsDirty); } /** diff --git a/server/src/main/java/com/vaadin/ui/AbstractJavaScriptComponent.java b/server/src/main/java/com/vaadin/ui/AbstractJavaScriptComponent.java index 8e70e9cb03..f643615b81 100644 --- a/server/src/main/java/com/vaadin/ui/AbstractJavaScriptComponent.java +++ b/server/src/main/java/com/vaadin/ui/AbstractJavaScriptComponent.java @@ -201,4 +201,9 @@ public abstract class AbstractJavaScriptComponent extends AbstractComponent { protected JavaScriptComponentState getState() { return (JavaScriptComponentState) super.getState(); } + + @Override + protected JavaScriptComponentState getState(boolean markAsDirty) { + return (JavaScriptComponentState) super.getState(markAsDirty); + } } diff --git a/server/src/main/java/com/vaadin/ui/AbstractListing.java b/server/src/main/java/com/vaadin/ui/AbstractListing.java index 6f0463b822..de742e2145 100644 --- a/server/src/main/java/com/vaadin/ui/AbstractListing.java +++ b/server/src/main/java/com/vaadin/ui/AbstractListing.java @@ -29,6 +29,8 @@ import com.vaadin.server.data.DataCommunicator; import com.vaadin.server.data.DataGenerator; import com.vaadin.server.data.DataProvider; import com.vaadin.server.data.Query; +import com.vaadin.shared.extension.abstractlisting.AbstractListingExtensionState; +import com.vaadin.shared.ui.abstractlisting.AbstractListingState; import com.vaadin.ui.declarative.DesignAttributeHandler; import com.vaadin.ui.declarative.DesignContext; import com.vaadin.ui.declarative.DesignException; @@ -117,6 +119,16 @@ public abstract class AbstractListing<T> extends AbstractComponent { protected void refresh(T item) { getParent().getDataCommunicator().refresh(item); } + + @Override + protected AbstractListingExtensionState getState() { + return (AbstractListingExtensionState) super.getState(); + } + + @Override + protected AbstractListingExtensionState getState(boolean markAsDirty) { + return (AbstractListingExtensionState) super.getState(markAsDirty); + } } private final DataCommunicator<T, ?> dataCommunicator; @@ -438,4 +450,14 @@ public abstract class AbstractListing<T> extends AbstractComponent { protected String serializeDeclarativeRepresentation(T item) { return item.toString(); } + + @Override + protected AbstractListingState getState() { + return (AbstractListingState) super.getState(); + } + + @Override + protected AbstractListingState getState(boolean markAsDirty) { + return (AbstractListingState) super.getState(markAsDirty); + } } diff --git a/server/src/main/java/com/vaadin/ui/AbstractMultiSelect.java b/server/src/main/java/com/vaadin/ui/AbstractMultiSelect.java index 4bf1ce72e1..c0c3af15d7 100644 --- a/server/src/main/java/com/vaadin/ui/AbstractMultiSelect.java +++ b/server/src/main/java/com/vaadin/ui/AbstractMultiSelect.java @@ -39,10 +39,10 @@ import com.vaadin.server.Resource; import com.vaadin.server.ResourceReference; import com.vaadin.server.SerializablePredicate; import com.vaadin.server.data.DataGenerator; -import com.vaadin.shared.AbstractFieldState; import com.vaadin.shared.Registration; import com.vaadin.shared.data.selection.MultiSelectServerRpc; import com.vaadin.shared.ui.ListingJsonConstants; +import com.vaadin.shared.ui.abstractmultiselect.AbstractMultiSelectState; import com.vaadin.ui.declarative.DesignContext; import com.vaadin.ui.declarative.DesignException; import com.vaadin.util.ReflectTools; @@ -282,13 +282,13 @@ public abstract class AbstractMultiSelect<T> extends AbstractListing<T> } @Override - protected AbstractFieldState getState() { - return (AbstractFieldState) super.getState(); + protected AbstractMultiSelectState getState() { + return (AbstractMultiSelectState) super.getState(); } @Override - protected AbstractFieldState getState(boolean markAsDirty) { - return (AbstractFieldState) super.getState(markAsDirty); + protected AbstractMultiSelectState getState(boolean markAsDirty) { + return (AbstractMultiSelectState) super.getState(markAsDirty); } @Override diff --git a/server/src/main/java/com/vaadin/ui/ColorPicker.java b/server/src/main/java/com/vaadin/ui/ColorPicker.java index 706fd6518b..8a137ea652 100644 --- a/server/src/main/java/com/vaadin/ui/ColorPicker.java +++ b/server/src/main/java/com/vaadin/ui/ColorPicker.java @@ -16,6 +16,7 @@ package com.vaadin.ui; import com.vaadin.shared.ui.colorpicker.Color; +import com.vaadin.shared.ui.colorpicker.ColorPickerState; /** * A class that defines default (button-like) implementation for a color picker @@ -63,4 +64,14 @@ public class ColorPicker extends AbstractColorPicker { setPrimaryStyleName(STYLENAME_BUTTON); addStyleName(STYLENAME_DEFAULT); } + + @Override + protected ColorPickerState getState() { + return (ColorPickerState) super.getState(); + } + + @Override + protected ColorPickerState getState(boolean markAsDirty) { + return (ColorPickerState) super.getState(markAsDirty); + } } diff --git a/server/src/main/java/com/vaadin/ui/ColorPickerArea.java b/server/src/main/java/com/vaadin/ui/ColorPickerArea.java index dc2adfed3a..166ed05f23 100644 --- a/server/src/main/java/com/vaadin/ui/ColorPickerArea.java +++ b/server/src/main/java/com/vaadin/ui/ColorPickerArea.java @@ -16,6 +16,7 @@ package com.vaadin.ui; import com.vaadin.shared.ui.colorpicker.Color; +import com.vaadin.shared.ui.colorpicker.ColorPickerAreaState; /** * A class that defines area-like implementation for a color picker component. @@ -73,4 +74,14 @@ public class ColorPickerArea extends AbstractColorPicker { getState().width = "30px"; } } + + @Override + protected ColorPickerAreaState getState() { + return (ColorPickerAreaState) super.getState(); + } + + @Override + protected ColorPickerAreaState getState(boolean markAsDirty) { + return (ColorPickerAreaState) super.getState(markAsDirty); + } } diff --git a/server/src/main/java/com/vaadin/ui/CustomField.java b/server/src/main/java/com/vaadin/ui/CustomField.java index b36cb053a6..397346a8cb 100644 --- a/server/src/main/java/com/vaadin/ui/CustomField.java +++ b/server/src/main/java/com/vaadin/ui/CustomField.java @@ -20,6 +20,7 @@ import java.io.Serializable; import java.util.Iterator; import com.vaadin.data.HasValue; +import com.vaadin.shared.ui.customfield.CustomFieldState; /** * A {@link HasValue} whose UI content can be constructed by the user, enabling @@ -117,6 +118,16 @@ public abstract class CustomField<T> extends AbstractField<T> markAsDirtyRecursive(); } + @Override + protected CustomFieldState getState() { + return (CustomFieldState) super.getState(); + } + + @Override + protected CustomFieldState getState(boolean markAsDirty) { + return (CustomFieldState) super.getState(markAsDirty); + } + // ComponentContainer methods private class ComponentIterator diff --git a/server/src/main/java/com/vaadin/ui/Grid.java b/server/src/main/java/com/vaadin/ui/Grid.java index 7034d2d028..acb93e9fe3 100644 --- a/server/src/main/java/com/vaadin/ui/Grid.java +++ b/server/src/main/java/com/vaadin/ui/Grid.java @@ -58,7 +58,9 @@ import com.vaadin.shared.MouseEventDetails; import com.vaadin.shared.Registration; import com.vaadin.shared.data.DataCommunicatorConstants; import com.vaadin.shared.data.sort.SortDirection; +import com.vaadin.shared.ui.grid.AbstractGridExtensionState; import com.vaadin.shared.ui.grid.ColumnState; +import com.vaadin.shared.ui.grid.DetailsManagerState; import com.vaadin.shared.ui.grid.GridConstants; import com.vaadin.shared.ui.grid.GridConstants.Section; import com.vaadin.shared.ui.grid.GridServerRpc; @@ -656,6 +658,16 @@ public class Grid<T> extends AbstractListing<T> public Grid<T> getParent() { return (Grid<T>) super.getParent(); } + + @Override + protected AbstractGridExtensionState getState() { + return (AbstractGridExtensionState) super.getState(); + } + + @Override + protected AbstractGridExtensionState getState(boolean markAsDirty) { + return (AbstractGridExtensionState) super.getState(markAsDirty); + } } private final class GridServerRpcImpl implements GridServerRpc { @@ -889,6 +901,16 @@ public class Grid<T> extends AbstractListing<T> public Grid<T> getParent() { return super.getParent(); } + + @Override + protected DetailsManagerState getState() { + return (DetailsManagerState) super.getState(); + } + + @Override + protected DetailsManagerState getState(boolean markAsDirty) { + return (DetailsManagerState) super.getState(markAsDirty); + } } /** diff --git a/server/src/main/java/com/vaadin/ui/JavaScript.java b/server/src/main/java/com/vaadin/ui/JavaScript.java index 97fd0ad3f3..429f52c3cc 100644 --- a/server/src/main/java/com/vaadin/ui/JavaScript.java +++ b/server/src/main/java/com/vaadin/ui/JavaScript.java @@ -52,15 +52,16 @@ public class JavaScript extends AbstractExtension { * object. */ public JavaScript() { - registerRpc((JavaScriptCallbackRpc) (String name, JsonArray arguments) -> { - JavaScriptFunction function = functions.get(name); - // TODO handle situation if name is not registered - try { - function.call(arguments); - } catch (JsonException e) { - throw new IllegalArgumentException(e); - } - }); + registerRpc( + (JavaScriptCallbackRpc) (String name, JsonArray arguments) -> { + JavaScriptFunction function = functions.get(name); + // TODO handle situation if name is not registered + try { + function.call(arguments); + } catch (JsonException e) { + throw new IllegalArgumentException(e); + } + }); } @Override @@ -68,6 +69,11 @@ public class JavaScript extends AbstractExtension { return (JavaScriptManagerState) super.getState(); } + @Override + protected JavaScriptManagerState getState(boolean markAsDirty) { + return (JavaScriptManagerState) super.getState(markAsDirty); + } + /** * Add a new function to the global JavaScript namespace (i.e. the window * object). The <code>call</code> method in the passed diff --git a/server/src/main/java/com/vaadin/ui/PasswordField.java b/server/src/main/java/com/vaadin/ui/PasswordField.java index d357019539..661d848730 100644 --- a/server/src/main/java/com/vaadin/ui/PasswordField.java +++ b/server/src/main/java/com/vaadin/ui/PasswordField.java @@ -19,6 +19,7 @@ package com.vaadin.ui; import org.jsoup.nodes.Attributes; import org.jsoup.nodes.Element; +import com.vaadin.shared.ui.passwordfield.PasswordFieldState; import com.vaadin.ui.declarative.DesignAttributeHandler; import com.vaadin.ui.declarative.DesignContext; @@ -72,10 +73,19 @@ public class PasswordField extends TextField { @Override public void writeDesign(Element design, DesignContext designContext) { super.writeDesign(design, designContext); - AbstractTextField def = designContext - .getDefaultInstance(this); + AbstractTextField def = designContext.getDefaultInstance(this); Attributes attr = design.attributes(); DesignAttributeHandler.writeAttribute("value", attr, getValue(), def.getValue(), String.class, designContext); } + + @Override + protected PasswordFieldState getState() { + return (PasswordFieldState) super.getState(); + } + + @Override + protected PasswordFieldState getState(boolean markAsDirty) { + return (PasswordFieldState) super.getState(markAsDirty); + } } diff --git a/server/src/main/java/com/vaadin/ui/renderers/AbstractJavaScriptRenderer.java b/server/src/main/java/com/vaadin/ui/renderers/AbstractJavaScriptRenderer.java index 5663569939..f372954e27 100644 --- a/server/src/main/java/com/vaadin/ui/renderers/AbstractJavaScriptRenderer.java +++ b/server/src/main/java/com/vaadin/ui/renderers/AbstractJavaScriptRenderer.java @@ -176,4 +176,9 @@ public abstract class AbstractJavaScriptRenderer<T, V> protected JavaScriptExtensionState getState() { return (JavaScriptExtensionState) super.getState(); } + + @Override + protected JavaScriptExtensionState getState(boolean markAsDirty) { + return (JavaScriptExtensionState) super.getState(markAsDirty); + } } diff --git a/server/src/main/java/com/vaadin/ui/renderers/AbstractRenderer.java b/server/src/main/java/com/vaadin/ui/renderers/AbstractRenderer.java index 43ab4108a9..9b9f590945 100644 --- a/server/src/main/java/com/vaadin/ui/renderers/AbstractRenderer.java +++ b/server/src/main/java/com/vaadin/ui/renderers/AbstractRenderer.java @@ -20,6 +20,7 @@ import java.util.Objects; import com.vaadin.server.AbstractClientConnector; import com.vaadin.server.AbstractExtension; import com.vaadin.server.JsonCodec; +import com.vaadin.shared.ui.grid.renderers.AbstractRendererState; import com.vaadin.ui.Grid; import com.vaadin.ui.Grid.Column; import com.vaadin.ui.renderers.ClickableRenderer.RendererClickEvent; @@ -157,4 +158,14 @@ public abstract class AbstractRenderer<T, V> extends AbstractExtension } return (Grid<T>) super.getParent().getParent(); } + + @Override + protected AbstractRendererState getState() { + return (AbstractRendererState) super.getState(); + } + + @Override + protected AbstractRendererState getState(boolean markAsDirty) { + return (AbstractRendererState) super.getState(markAsDirty); + } } diff --git a/server/src/main/java/com/vaadin/ui/renderers/ButtonRenderer.java b/server/src/main/java/com/vaadin/ui/renderers/ButtonRenderer.java index 30e098492f..b9eec4714b 100644 --- a/server/src/main/java/com/vaadin/ui/renderers/ButtonRenderer.java +++ b/server/src/main/java/com/vaadin/ui/renderers/ButtonRenderer.java @@ -15,6 +15,8 @@ */ package com.vaadin.ui.renderers; +import com.vaadin.shared.ui.grid.renderers.ButtonRendererState; + /** * A Renderer that displays a button with a textual caption. The value of the * corresponding property is used as the caption. Click listeners can be added @@ -71,4 +73,14 @@ public class ButtonRenderer<T> extends ClickableRenderer<T, String> { return super.getNullRepresentation(); } + @Override + protected ButtonRendererState getState() { + return (ButtonRendererState) super.getState(); + } + + @Override + protected ButtonRendererState getState(boolean markAsDirty) { + return (ButtonRendererState) super.getState(markAsDirty); + } + } diff --git a/server/src/main/java/com/vaadin/ui/renderers/CheckBoxRenderer.java b/server/src/main/java/com/vaadin/ui/renderers/CheckBoxRenderer.java index 92c52c1c0d..c57776d3c0 100644 --- a/server/src/main/java/com/vaadin/ui/renderers/CheckBoxRenderer.java +++ b/server/src/main/java/com/vaadin/ui/renderers/CheckBoxRenderer.java @@ -18,6 +18,8 @@ package com.vaadin.ui.renderers; import java.util.function.BiConsumer; import java.util.function.Function; +import com.vaadin.shared.ui.grid.renderers.CheckBoxRendererState; + /** * A renderer that displays boolean valued grid columns as checkboxes. * @@ -43,4 +45,14 @@ public class CheckBoxRenderer<T> extends ClickableRenderer<T, Boolean> { addClickListener(clickEvent -> setter.accept(clickEvent.getItem(), !getter.apply(clickEvent.getItem()))); } + + @Override + protected CheckBoxRendererState getState() { + return (CheckBoxRendererState) super.getState(); + } + + @Override + protected CheckBoxRendererState getState(boolean markAsDirty) { + return (CheckBoxRendererState) super.getState(markAsDirty); + } } diff --git a/server/src/main/java/com/vaadin/ui/renderers/ClickableRenderer.java b/server/src/main/java/com/vaadin/ui/renderers/ClickableRenderer.java index 8a6c9049f2..28a26620a8 100644 --- a/server/src/main/java/com/vaadin/ui/renderers/ClickableRenderer.java +++ b/server/src/main/java/com/vaadin/ui/renderers/ClickableRenderer.java @@ -21,6 +21,7 @@ import com.vaadin.event.ConnectorEventListener; import com.vaadin.event.MouseEvents.ClickEvent; import com.vaadin.shared.MouseEventDetails; import com.vaadin.shared.Registration; +import com.vaadin.shared.ui.grid.renderers.ClickableRendererState; import com.vaadin.shared.ui.grid.renderers.RendererClickRpc; import com.vaadin.ui.Grid; import com.vaadin.ui.Grid.Column; @@ -159,4 +160,14 @@ public abstract class ClickableRenderer<T, V> extends AbstractRenderer<T, V> { public void removeClickListener(RendererClickListener<T> listener) { removeListener(RendererClickEvent.class, listener); } + + @Override + protected ClickableRendererState getState() { + return (ClickableRendererState) super.getState(); + } + + @Override + protected ClickableRendererState getState(boolean markAsDirty) { + return (ClickableRendererState) super.getState(markAsDirty); + } } diff --git a/server/src/main/java/com/vaadin/ui/renderers/DateRenderer.java b/server/src/main/java/com/vaadin/ui/renderers/DateRenderer.java index 85f06697f0..484f88e882 100644 --- a/server/src/main/java/com/vaadin/ui/renderers/DateRenderer.java +++ b/server/src/main/java/com/vaadin/ui/renderers/DateRenderer.java @@ -19,6 +19,8 @@ import java.text.DateFormat; import java.util.Date; import java.util.Locale; +import com.vaadin.shared.ui.grid.renderers.DateRendererState; + import elemental.json.JsonValue; /** @@ -235,4 +237,14 @@ public class DateRenderer extends AbstractRenderer<Object, Date> { return String.format("%s [%s]", getClass().getSimpleName(), fieldInfo); } + + @Override + protected DateRendererState getState() { + return (DateRendererState) super.getState(); + } + + @Override + protected DateRendererState getState(boolean markAsDirty) { + return (DateRendererState) super.getState(markAsDirty); + } } diff --git a/server/src/main/java/com/vaadin/ui/renderers/HtmlRenderer.java b/server/src/main/java/com/vaadin/ui/renderers/HtmlRenderer.java index c2571b5e3a..a1aa411bbe 100644 --- a/server/src/main/java/com/vaadin/ui/renderers/HtmlRenderer.java +++ b/server/src/main/java/com/vaadin/ui/renderers/HtmlRenderer.java @@ -15,6 +15,8 @@ */ package com.vaadin.ui.renderers; +import com.vaadin.shared.ui.grid.renderers.HtmlRendererState; + /** * A renderer for presenting HTML content. * @@ -43,4 +45,14 @@ public class HtmlRenderer extends AbstractRenderer<Object, String> { public String getNullRepresentation() { return super.getNullRepresentation(); } + + @Override + protected HtmlRendererState getState() { + return (HtmlRendererState) super.getState(); + } + + @Override + protected HtmlRendererState getState(boolean markAsDirty) { + return (HtmlRendererState) super.getState(markAsDirty); + } } diff --git a/server/src/main/java/com/vaadin/ui/renderers/ImageRenderer.java b/server/src/main/java/com/vaadin/ui/renderers/ImageRenderer.java index 2969d516b8..4af28cf5c1 100644 --- a/server/src/main/java/com/vaadin/ui/renderers/ImageRenderer.java +++ b/server/src/main/java/com/vaadin/ui/renderers/ImageRenderer.java @@ -20,6 +20,7 @@ import com.vaadin.server.Resource; import com.vaadin.server.ResourceReference; import com.vaadin.server.ThemeResource; import com.vaadin.shared.communication.URLReference; +import com.vaadin.shared.ui.grid.renderers.ImageRendererState; import elemental.json.JsonValue; @@ -68,4 +69,14 @@ public class ImageRenderer<T> extends ClickableRenderer<T, Resource> { return encode(ResourceReference.create(resource, this, null), URLReference.class); } + + @Override + protected ImageRendererState getState() { + return (ImageRendererState) super.getState(); + } + + @Override + protected ImageRendererState getState(boolean markAsDirty) { + return (ImageRendererState) super.getState(markAsDirty); + } } diff --git a/server/src/main/java/com/vaadin/ui/renderers/NumberRenderer.java b/server/src/main/java/com/vaadin/ui/renderers/NumberRenderer.java index b5f64308bd..17730901ff 100644 --- a/server/src/main/java/com/vaadin/ui/renderers/NumberRenderer.java +++ b/server/src/main/java/com/vaadin/ui/renderers/NumberRenderer.java @@ -18,6 +18,8 @@ package com.vaadin.ui.renderers; import java.text.NumberFormat; import java.util.Locale; +import com.vaadin.shared.ui.grid.renderers.NumberRendererState; + import elemental.json.JsonValue; /** @@ -202,4 +204,14 @@ public class NumberRenderer extends AbstractRenderer<Object, Number> { public String getNullRepresentation() { return super.getNullRepresentation(); } + + @Override + protected NumberRendererState getState() { + return (NumberRendererState) super.getState(); + } + + @Override + protected NumberRendererState getState(boolean markAsDirty) { + return (NumberRendererState) super.getState(markAsDirty); + } } diff --git a/server/src/main/java/com/vaadin/ui/renderers/ProgressBarRenderer.java b/server/src/main/java/com/vaadin/ui/renderers/ProgressBarRenderer.java index e06f98865d..bf851e5567 100644 --- a/server/src/main/java/com/vaadin/ui/renderers/ProgressBarRenderer.java +++ b/server/src/main/java/com/vaadin/ui/renderers/ProgressBarRenderer.java @@ -15,6 +15,8 @@ */ package com.vaadin.ui.renderers; +import com.vaadin.shared.ui.grid.renderers.ProgressBarRendererState; + import elemental.json.JsonValue; /** @@ -42,4 +44,14 @@ public class ProgressBarRenderer extends AbstractRenderer<Object, Double> { } return super.encode(value); } + + @Override + protected ProgressBarRendererState getState() { + return (ProgressBarRendererState) super.getState(); + } + + @Override + protected ProgressBarRendererState getState(boolean markAsDirty) { + return (ProgressBarRendererState) super.getState(markAsDirty); + } } diff --git a/server/src/main/java/com/vaadin/ui/renderers/TextRenderer.java b/server/src/main/java/com/vaadin/ui/renderers/TextRenderer.java index d6cd527edf..b85e3230bc 100644 --- a/server/src/main/java/com/vaadin/ui/renderers/TextRenderer.java +++ b/server/src/main/java/com/vaadin/ui/renderers/TextRenderer.java @@ -15,6 +15,8 @@ */ package com.vaadin.ui.renderers; +import com.vaadin.shared.ui.grid.renderers.TextRendererState; + /** * A renderer for presenting simple plain-text string values. * @@ -44,4 +46,14 @@ public class TextRenderer extends AbstractRenderer<Object, String> { public String getNullRepresentation() { return super.getNullRepresentation(); } + + @Override + protected TextRendererState getState() { + return (TextRendererState) super.getState(); + } + + @Override + protected TextRendererState getState(boolean markAsDirty) { + return (TextRendererState) super.getState(markAsDirty); + } } diff --git a/server/src/test/java/com/vaadin/server/DedicatedStateTest.java b/server/src/test/java/com/vaadin/server/DedicatedStateTest.java new file mode 100644 index 0000000000..6d8fa485c6 --- /dev/null +++ b/server/src/test/java/com/vaadin/server/DedicatedStateTest.java @@ -0,0 +1,101 @@ +/* + * Copyright 2000-2016 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.server; + +import java.lang.reflect.Method; +import java.util.HashSet; +import java.util.Set; + +import org.junit.Assert; +import org.junit.Test; + +import com.vaadin.navigator.Navigator; +import com.vaadin.tests.VaadinClasses; +import com.vaadin.ui.LegacyWindow; +import com.vaadin.ui.components.colorpicker.ColorPickerHistory; +import com.vaadin.ui.components.colorpicker.ColorPickerPopup; +import com.vaadin.ui.components.colorpicker.ColorPickerPreview; +import com.vaadin.ui.components.colorpicker.ColorPickerSelect; +import com.vaadin.ui.components.grid.NoSelectionModel; + +/** + * @author Vaadin Ltd + * + */ +public class DedicatedStateTest { + + private static final Set<String> WHITE_LIST = createWhiteList(); + + @Test + public void checkDedicatedStates() { + VaadinClasses.getAllServerSideClasses().stream().filter( + clazz -> AbstractClientConnector.class.isAssignableFrom(clazz)) + .forEach(this::checkState); + } + + private void checkState(Class<?> clazz) { + if (WHITE_LIST.contains(clazz.getCanonicalName())) { + return; + } + Method getStateNoArg = getStateNoArg(clazz); + Class<?> stateType = getStateNoArg.getReturnType(); + // check that stateType differs from the super class's state type + Class<?> superclass = clazz.getSuperclass(); + if (!clazz.equals(AbstractClientConnector.class) + && !superclass.equals(AbstractExtension.class)) { + Assert.assertNotEquals( + "Class " + clazz + + " has the same state type as its super class " + + clazz.getSuperclass(), + stateType, getStateNoArg(superclass).getReturnType()); + } + try { + Method getStateOneArg = clazz.getDeclaredMethod("getState", + boolean.class); + Assert.assertEquals(stateType, getStateOneArg.getReturnType()); + } catch (NoSuchMethodException e) { + Assert.fail("Class " + clazz + + " doesn't have its own getState(boolean) method"); + } catch (SecurityException e) { + throw new RuntimeException(e); + } + } + + private Method getStateNoArg(Class<?> clazz) { + try { + return clazz.getDeclaredMethod("getState"); + } catch (NoSuchMethodException e) { + Assert.fail("Class " + clazz + + " doesn't have its own getState() method"); + return null; + } catch (SecurityException e) { + throw new RuntimeException(e); + } + } + + private static Set<String> createWhiteList() { + Set<String> list = new HashSet<>(); + list.add(AbstractExtension.class.getCanonicalName()); + list.add(Navigator.EmptyView.class.getCanonicalName()); + list.add(ColorPickerHistory.class.getCanonicalName()); + list.add(ColorPickerPopup.class.getCanonicalName()); + list.add(ColorPickerPreview.class.getCanonicalName()); + list.add(ColorPickerSelect.class.getCanonicalName()); + list.add(NoSelectionModel.class.getCanonicalName()); + list.add(LegacyWindow.class.getCanonicalName()); + return list; + } +} diff --git a/shared/src/main/java/com/vaadin/shared/JavaScriptExtensionState.java b/shared/src/main/java/com/vaadin/shared/JavaScriptExtensionState.java index a37e453835..eeb71fc9b0 100644 --- a/shared/src/main/java/com/vaadin/shared/JavaScriptExtensionState.java +++ b/shared/src/main/java/com/vaadin/shared/JavaScriptExtensionState.java @@ -21,9 +21,9 @@ import java.util.HashSet; import java.util.Map; import java.util.Set; -import com.vaadin.shared.communication.SharedState; +import com.vaadin.shared.ui.grid.renderers.AbstractRendererState; -public class JavaScriptExtensionState extends SharedState +public class JavaScriptExtensionState extends AbstractRendererState implements JavaScriptConnectorState { private Set<String> callbackNames = new HashSet<>(); diff --git a/shared/src/main/java/com/vaadin/shared/extension/abstractlisting/AbstractListingExtensionState.java b/shared/src/main/java/com/vaadin/shared/extension/abstractlisting/AbstractListingExtensionState.java new file mode 100644 index 0000000000..ec64db3e3e --- /dev/null +++ b/shared/src/main/java/com/vaadin/shared/extension/abstractlisting/AbstractListingExtensionState.java @@ -0,0 +1,29 @@ +/* + * Copyright 2000-2016 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.shared.extension.abstractlisting; + +import com.vaadin.shared.communication.SharedState; + +/** + * Default shared state implementation for AbstractListingExtension. + * + * @author Vaadin Ltd. + * + * @since 8.0 + */ +public class AbstractListingExtensionState extends SharedState { + +} diff --git a/shared/src/main/java/com/vaadin/shared/extension/datacommunicator/DataCommunicatorState.java b/shared/src/main/java/com/vaadin/shared/extension/datacommunicator/DataCommunicatorState.java new file mode 100644 index 0000000000..3ee6508b61 --- /dev/null +++ b/shared/src/main/java/com/vaadin/shared/extension/datacommunicator/DataCommunicatorState.java @@ -0,0 +1,27 @@ +/* + * Copyright 2000-2016 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.shared.extension.datacommunicator; + +import com.vaadin.shared.communication.SharedState; + +/** + * Shared state for DataCommunicator. + * + * @since 8.0 + */ +public class DataCommunicatorState extends SharedState { + +} diff --git a/shared/src/main/java/com/vaadin/shared/extension/filedownloader/FileDownloaderState.java b/shared/src/main/java/com/vaadin/shared/extension/filedownloader/FileDownloaderState.java new file mode 100644 index 0000000000..dd8fb81b98 --- /dev/null +++ b/shared/src/main/java/com/vaadin/shared/extension/filedownloader/FileDownloaderState.java @@ -0,0 +1,29 @@ +/* + * Copyright 2000-2016 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.shared.extension.filedownloader; + +import com.vaadin.shared.communication.SharedState; + +/** + * Shared state for FileDownloader. + * + * @author Vaadin Ltd. + * + * @since 8.0 + */ +public class FileDownloaderState extends SharedState { + +} diff --git a/shared/src/main/java/com/vaadin/shared/extension/responsive/ResponsiveState.java b/shared/src/main/java/com/vaadin/shared/extension/responsive/ResponsiveState.java new file mode 100644 index 0000000000..18c77a2d0c --- /dev/null +++ b/shared/src/main/java/com/vaadin/shared/extension/responsive/ResponsiveState.java @@ -0,0 +1,27 @@ +/* + * Copyright 2000-2016 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.shared.extension.responsive; + +import com.vaadin.shared.communication.SharedState; + +/** + * Shared state for Responsive extension. + * + * @since 8.0 + */ +public class ResponsiveState extends SharedState { + +} diff --git a/shared/src/main/java/com/vaadin/shared/ui/AbstractSingleSelectState.java b/shared/src/main/java/com/vaadin/shared/ui/AbstractSingleSelectState.java index 4cd9bdc9a2..cb9fd61860 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/AbstractSingleSelectState.java +++ b/shared/src/main/java/com/vaadin/shared/ui/AbstractSingleSelectState.java @@ -15,7 +15,7 @@ */ package com.vaadin.shared.ui; -import com.vaadin.shared.AbstractFieldState; +import com.vaadin.shared.ui.abstractlisting.AbstractListingState; /** * Shared state for {@code AbstractSingleSelect}. @@ -24,7 +24,7 @@ import com.vaadin.shared.AbstractFieldState; * * @since 8.0 */ -public class AbstractSingleSelectState extends AbstractFieldState { +public class AbstractSingleSelectState extends AbstractListingState { /** * The key of the currently selected item or {@code null} if no item is diff --git a/shared/src/main/java/com/vaadin/shared/ui/BrowserWindowOpenerState.java b/shared/src/main/java/com/vaadin/shared/ui/BrowserWindowOpenerState.java index f1a4ea9be3..aff6380cc4 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/BrowserWindowOpenerState.java +++ b/shared/src/main/java/com/vaadin/shared/ui/BrowserWindowOpenerState.java @@ -19,9 +19,9 @@ package com.vaadin.shared.ui; import java.util.HashMap; import java.util.Map; -import com.vaadin.shared.AbstractComponentState; +import com.vaadin.shared.communication.SharedState; -public class BrowserWindowOpenerState extends AbstractComponentState { +public class BrowserWindowOpenerState extends SharedState { public static final String locationResource = "url"; public String target = "_blank"; diff --git a/shared/src/main/java/com/vaadin/shared/ui/abstractlisting/AbstractListingState.java b/shared/src/main/java/com/vaadin/shared/ui/abstractlisting/AbstractListingState.java new file mode 100644 index 0000000000..894443f171 --- /dev/null +++ b/shared/src/main/java/com/vaadin/shared/ui/abstractlisting/AbstractListingState.java @@ -0,0 +1,29 @@ +/* + * Copyright 2000-2016 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.shared.ui.abstractlisting; + +import com.vaadin.shared.AbstractFieldState; + +/** + * Shared state for {@code AbstractListing}. + * + * @author Vaadin Ltd + * @since 8.0 + * + */ +public class AbstractListingState extends AbstractFieldState { + +} diff --git a/shared/src/main/java/com/vaadin/shared/ui/abstractmultiselect/AbstractMultiSelectState.java b/shared/src/main/java/com/vaadin/shared/ui/abstractmultiselect/AbstractMultiSelectState.java new file mode 100644 index 0000000000..9019cfbc92 --- /dev/null +++ b/shared/src/main/java/com/vaadin/shared/ui/abstractmultiselect/AbstractMultiSelectState.java @@ -0,0 +1,29 @@ +/* + * Copyright 2000-2016 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.shared.ui.abstractmultiselect; + +import com.vaadin.shared.ui.abstractlisting.AbstractListingState; + +/** + * Shared state for {@code AbstractMultiSelect}. + * + * @author Vaadin Ltd + * @since 8.0 + * + */ +public class AbstractMultiSelectState extends AbstractListingState { + +} diff --git a/shared/src/main/java/com/vaadin/shared/ui/colorpicker/AbstractColorPickerState.java b/shared/src/main/java/com/vaadin/shared/ui/colorpicker/AbstractColorPickerState.java new file mode 100644 index 0000000000..aac0102846 --- /dev/null +++ b/shared/src/main/java/com/vaadin/shared/ui/colorpicker/AbstractColorPickerState.java @@ -0,0 +1,38 @@ +/* + * Copyright 2000-2016 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.shared.ui.colorpicker; + +import com.vaadin.shared.AbstractFieldState; +import com.vaadin.shared.annotations.DelegateToWidget; + +/** + * Default shared state implementation for AbstractColorPicker. + * + * @since + */ +public class AbstractColorPickerState extends AbstractFieldState { + { + primaryStyleName = "v-colorpicker"; + } + + @DelegateToWidget("setOpen") + public boolean popupVisible = false; + + @DelegateToWidget("setColor") + public String color = null; + + public boolean showDefaultCaption; +} diff --git a/shared/src/main/java/com/vaadin/shared/ui/colorpicker/ColorPickerAreaState.java b/shared/src/main/java/com/vaadin/shared/ui/colorpicker/ColorPickerAreaState.java new file mode 100644 index 0000000000..eba6571b7b --- /dev/null +++ b/shared/src/main/java/com/vaadin/shared/ui/colorpicker/ColorPickerAreaState.java @@ -0,0 +1,27 @@ +/* + * Copyright 2000-2016 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.shared.ui.colorpicker; + +/** + * Default shared state implementation for ColorPickerArea. + * + * @author Vaadin Ltd. + * + * @since 8.0 + */ +public class ColorPickerAreaState extends AbstractColorPickerState { + +} diff --git a/shared/src/main/java/com/vaadin/shared/ui/colorpicker/ColorPickerState.java b/shared/src/main/java/com/vaadin/shared/ui/colorpicker/ColorPickerState.java index 922534b8b9..171b3837f7 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/colorpicker/ColorPickerState.java +++ b/shared/src/main/java/com/vaadin/shared/ui/colorpicker/ColorPickerState.java @@ -15,24 +15,13 @@ */ package com.vaadin.shared.ui.colorpicker; -import com.vaadin.shared.AbstractFieldState; -import com.vaadin.shared.annotations.DelegateToWidget; - /** - * Default shared state implementation for AbstractColorPicker. + * Default shared state implementation for ColorPicker. + * + * @author Vaadin Ltd. * - * @since 7.0.0 + * @since */ -public class ColorPickerState extends AbstractFieldState { - { - primaryStyleName = "v-colorpicker"; - } - - @DelegateToWidget("setOpen") - public boolean popupVisible = false; - - @DelegateToWidget("setColor") - public String color = null; +public class ColorPickerState extends AbstractColorPickerState { - public boolean showDefaultCaption; } diff --git a/shared/src/main/java/com/vaadin/shared/ui/customfield/CustomFieldState.java b/shared/src/main/java/com/vaadin/shared/ui/customfield/CustomFieldState.java new file mode 100644 index 0000000000..467a5ebe99 --- /dev/null +++ b/shared/src/main/java/com/vaadin/shared/ui/customfield/CustomFieldState.java @@ -0,0 +1,29 @@ +/* + * Copyright 2000-2016 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.shared.ui.customfield; + +import com.vaadin.shared.AbstractFieldState; + +/** + * State class for CustomField. + * + * @author Vaadin Ltd + * @since 8.0 + * + */ +public class CustomFieldState extends AbstractFieldState { + +} diff --git a/shared/src/main/java/com/vaadin/shared/ui/grid/AbstractGridExtensionState.java b/shared/src/main/java/com/vaadin/shared/ui/grid/AbstractGridExtensionState.java new file mode 100644 index 0000000000..18dfce3556 --- /dev/null +++ b/shared/src/main/java/com/vaadin/shared/ui/grid/AbstractGridExtensionState.java @@ -0,0 +1,28 @@ +/* + * Copyright 2000-2016 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.shared.ui.grid; + +import com.vaadin.shared.extension.abstractlisting.AbstractListingExtensionState; + +/** + * State object for AbstractGridExtension. + * + * @author Vaadin Ltd + * @since 8.0 + */ +public class AbstractGridExtensionState extends AbstractListingExtensionState { + +} diff --git a/shared/src/main/java/com/vaadin/shared/ui/grid/AbstractSelectionModelState.java b/shared/src/main/java/com/vaadin/shared/ui/grid/AbstractSelectionModelState.java index 4e0e05c8bd..50047af9c2 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/grid/AbstractSelectionModelState.java +++ b/shared/src/main/java/com/vaadin/shared/ui/grid/AbstractSelectionModelState.java @@ -15,8 +15,6 @@ */ package com.vaadin.shared.ui.grid; -import com.vaadin.shared.communication.SharedState; - /** * Shared state for grid's abstract selection model. * @@ -24,7 +22,7 @@ import com.vaadin.shared.communication.SharedState; * * @since 8.0 */ -public class AbstractSelectionModelState extends SharedState { +public class AbstractSelectionModelState extends AbstractGridExtensionState { /** * Whether the selection model allows selection from the client side. 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 c2f4f6a07e..8d4429484b 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 @@ -16,9 +16,8 @@ package com.vaadin.shared.ui.grid; import com.vaadin.shared.Connector; -import com.vaadin.shared.communication.SharedState; -public class ColumnState extends SharedState { +public class ColumnState extends AbstractGridExtensionState { public String caption; public String id; diff --git a/shared/src/main/java/com/vaadin/shared/ui/grid/DetailsManagerState.java b/shared/src/main/java/com/vaadin/shared/ui/grid/DetailsManagerState.java new file mode 100644 index 0000000000..18432940fe --- /dev/null +++ b/shared/src/main/java/com/vaadin/shared/ui/grid/DetailsManagerState.java @@ -0,0 +1,25 @@ +/* + * Copyright 2000-2016 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.shared.ui.grid; + +/** + * Shared state for DetailsManager extension. + * + * @since 8.0 + */ +public class DetailsManagerState extends AbstractGridExtensionState { + +} diff --git a/shared/src/main/java/com/vaadin/shared/ui/grid/editor/EditorState.java b/shared/src/main/java/com/vaadin/shared/ui/grid/editor/EditorState.java index 1cae17e135..6d167270c5 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/grid/editor/EditorState.java +++ b/shared/src/main/java/com/vaadin/shared/ui/grid/editor/EditorState.java @@ -18,7 +18,7 @@ package com.vaadin.shared.ui.grid.editor; import java.util.HashMap; import java.util.Map; -import com.vaadin.shared.communication.SharedState; +import com.vaadin.shared.ui.grid.AbstractGridExtensionState; import com.vaadin.shared.ui.grid.GridConstants; /** @@ -27,7 +27,7 @@ import com.vaadin.shared.ui.grid.GridConstants; * @author Vaadin Ltd * @since */ -public class EditorState extends SharedState { +public class EditorState extends AbstractGridExtensionState { { // Disable editor by default. diff --git a/shared/src/main/java/com/vaadin/shared/ui/grid/renderers/AbstractRendererState.java b/shared/src/main/java/com/vaadin/shared/ui/grid/renderers/AbstractRendererState.java new file mode 100644 index 0000000000..ef6390fd60 --- /dev/null +++ b/shared/src/main/java/com/vaadin/shared/ui/grid/renderers/AbstractRendererState.java @@ -0,0 +1,29 @@ +/* + * Copyright 2000-2016 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.shared.ui.grid.renderers; + +import com.vaadin.shared.communication.SharedState; + +/** + * Default shared state implementation for AbstractRenderer. + * + * @author Vaadin Ltd. + * + * @since 8.0 + */ +public class AbstractRendererState extends SharedState { + +} diff --git a/shared/src/main/java/com/vaadin/shared/ui/grid/renderers/ButtonRendererState.java b/shared/src/main/java/com/vaadin/shared/ui/grid/renderers/ButtonRendererState.java new file mode 100644 index 0000000000..9774eec90f --- /dev/null +++ b/shared/src/main/java/com/vaadin/shared/ui/grid/renderers/ButtonRendererState.java @@ -0,0 +1,25 @@ +/* + * Copyright 2000-2016 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.shared.ui.grid.renderers; + +/** + * Shared state for ButtonRenderer. + * + * @since 8.0 + */ +public class ButtonRendererState extends ClickableRendererState { + +} diff --git a/shared/src/main/java/com/vaadin/shared/ui/grid/renderers/CheckBoxRendererState.java b/shared/src/main/java/com/vaadin/shared/ui/grid/renderers/CheckBoxRendererState.java new file mode 100644 index 0000000000..6d2c30265e --- /dev/null +++ b/shared/src/main/java/com/vaadin/shared/ui/grid/renderers/CheckBoxRendererState.java @@ -0,0 +1,25 @@ +/* + * Copyright 2000-2016 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.shared.ui.grid.renderers; + +/** + * Shared state for CheckBoxRenderer. + * + * @since 8.0 + */ +public class CheckBoxRendererState extends ClickableRendererState { + +} diff --git a/shared/src/main/java/com/vaadin/shared/ui/grid/renderers/ClickableRendererState.java b/shared/src/main/java/com/vaadin/shared/ui/grid/renderers/ClickableRendererState.java new file mode 100644 index 0000000000..d2d8ec977f --- /dev/null +++ b/shared/src/main/java/com/vaadin/shared/ui/grid/renderers/ClickableRendererState.java @@ -0,0 +1,25 @@ +/* + * Copyright 2000-2016 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.shared.ui.grid.renderers; + +/** + * Shared state for ClickableRenderer. + * + * @since 8.0 + */ +public class ClickableRendererState extends AbstractRendererState { + +} diff --git a/shared/src/main/java/com/vaadin/shared/ui/grid/renderers/DateRendererState.java b/shared/src/main/java/com/vaadin/shared/ui/grid/renderers/DateRendererState.java new file mode 100644 index 0000000000..50207f96ca --- /dev/null +++ b/shared/src/main/java/com/vaadin/shared/ui/grid/renderers/DateRendererState.java @@ -0,0 +1,25 @@ +/* + * Copyright 2000-2016 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.shared.ui.grid.renderers; + +/** + * Shared state for DateRenderer. + * + * @since 8.0 + */ +public class DateRendererState extends TextRendererState { + +} diff --git a/shared/src/main/java/com/vaadin/shared/ui/grid/renderers/HtmlRendererState.java b/shared/src/main/java/com/vaadin/shared/ui/grid/renderers/HtmlRendererState.java new file mode 100644 index 0000000000..10501798ff --- /dev/null +++ b/shared/src/main/java/com/vaadin/shared/ui/grid/renderers/HtmlRendererState.java @@ -0,0 +1,25 @@ +/* + * Copyright 2000-2016 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.shared.ui.grid.renderers; + +/** + * Shared state for HtmlRenderer. + * + * @since 8.0 + */ +public class HtmlRendererState extends AbstractRendererState { + +} diff --git a/shared/src/main/java/com/vaadin/shared/ui/grid/renderers/ImageRendererState.java b/shared/src/main/java/com/vaadin/shared/ui/grid/renderers/ImageRendererState.java new file mode 100644 index 0000000000..94b2e577d2 --- /dev/null +++ b/shared/src/main/java/com/vaadin/shared/ui/grid/renderers/ImageRendererState.java @@ -0,0 +1,25 @@ +/* + * Copyright 2000-2016 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.shared.ui.grid.renderers; + +/** + * Shared state for ImageRenderer. + * + * @since 8.0 + */ +public class ImageRendererState extends ClickableRendererState { + +} diff --git a/shared/src/main/java/com/vaadin/shared/ui/grid/renderers/NumberRendererState.java b/shared/src/main/java/com/vaadin/shared/ui/grid/renderers/NumberRendererState.java new file mode 100644 index 0000000000..6508ff175e --- /dev/null +++ b/shared/src/main/java/com/vaadin/shared/ui/grid/renderers/NumberRendererState.java @@ -0,0 +1,25 @@ +/* + * Copyright 2000-2016 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.shared.ui.grid.renderers; + +/** + * Shared state for HtmlRenderer. + * + * @since 8.0 + */ +public class NumberRendererState extends TextRendererState { + +} diff --git a/shared/src/main/java/com/vaadin/shared/ui/grid/renderers/ProgressBarRendererState.java b/shared/src/main/java/com/vaadin/shared/ui/grid/renderers/ProgressBarRendererState.java new file mode 100644 index 0000000000..6cb3a1e497 --- /dev/null +++ b/shared/src/main/java/com/vaadin/shared/ui/grid/renderers/ProgressBarRendererState.java @@ -0,0 +1,25 @@ +/* + * Copyright 2000-2016 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.shared.ui.grid.renderers; + +/** + * Shared state for HtmlRenderer. + * + * @since 8.0 + */ +public class ProgressBarRendererState extends AbstractRendererState { + +} diff --git a/shared/src/main/java/com/vaadin/shared/ui/grid/renderers/TextRendererState.java b/shared/src/main/java/com/vaadin/shared/ui/grid/renderers/TextRendererState.java new file mode 100644 index 0000000000..952f1d6c13 --- /dev/null +++ b/shared/src/main/java/com/vaadin/shared/ui/grid/renderers/TextRendererState.java @@ -0,0 +1,25 @@ +/* + * Copyright 2000-2016 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.shared.ui.grid.renderers; + +/** + * Shared state for TextRenderer. + * + * @since 8.0 + */ +public class TextRendererState extends AbstractRendererState { + +} diff --git a/shared/src/main/java/com/vaadin/shared/ui/listselect/ListSelectState.java b/shared/src/main/java/com/vaadin/shared/ui/listselect/ListSelectState.java index f90ca79368..add408b868 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/listselect/ListSelectState.java +++ b/shared/src/main/java/com/vaadin/shared/ui/listselect/ListSelectState.java @@ -15,8 +15,8 @@ */ package com.vaadin.shared.ui.listselect; -import com.vaadin.shared.AbstractFieldState; import com.vaadin.shared.annotations.DelegateToWidget; +import com.vaadin.shared.ui.abstractmultiselect.AbstractMultiSelectState; /** * Shared state for ListSelect component. @@ -24,7 +24,7 @@ import com.vaadin.shared.annotations.DelegateToWidget; * @author Vaadin Ltd * */ -public class ListSelectState extends AbstractFieldState { +public class ListSelectState extends AbstractMultiSelectState { { primaryStyleName = "v-select"; } diff --git a/shared/src/main/java/com/vaadin/shared/ui/optiongroup/CheckBoxGroupState.java b/shared/src/main/java/com/vaadin/shared/ui/optiongroup/CheckBoxGroupState.java index 93647c2a22..6a1d5ca18c 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/optiongroup/CheckBoxGroupState.java +++ b/shared/src/main/java/com/vaadin/shared/ui/optiongroup/CheckBoxGroupState.java @@ -15,8 +15,8 @@ */ package com.vaadin.shared.ui.optiongroup; -import com.vaadin.shared.AbstractFieldState; import com.vaadin.shared.annotations.DelegateToWidget; +import com.vaadin.shared.ui.abstractmultiselect.AbstractMultiSelectState; /** * Shared state for the CheckBoxGroup component. @@ -24,7 +24,7 @@ import com.vaadin.shared.annotations.DelegateToWidget; * @author Vaadin Ltd. * @since 8.0 */ -public class CheckBoxGroupState extends AbstractFieldState { +public class CheckBoxGroupState extends AbstractMultiSelectState { { primaryStyleName = "v-select-optiongroup"; diff --git a/shared/src/main/java/com/vaadin/shared/ui/passwordfield/PasswordFieldState.java b/shared/src/main/java/com/vaadin/shared/ui/passwordfield/PasswordFieldState.java new file mode 100644 index 0000000000..35efc468d0 --- /dev/null +++ b/shared/src/main/java/com/vaadin/shared/ui/passwordfield/PasswordFieldState.java @@ -0,0 +1,29 @@ +/* + * Copyright 2000-2016 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.shared.ui.passwordfield; + +import com.vaadin.shared.ui.textfield.TextFieldState; + +/** + * State class for PasswordField. + * + * @author Vaadin Ltd + * @since 8.0 + * + */ +public class PasswordFieldState extends TextFieldState { + +} diff --git a/shared/src/main/java/com/vaadin/shared/ui/twincolselect/TwinColSelectState.java b/shared/src/main/java/com/vaadin/shared/ui/twincolselect/TwinColSelectState.java index b0e148e656..de030e3464 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/twincolselect/TwinColSelectState.java +++ b/shared/src/main/java/com/vaadin/shared/ui/twincolselect/TwinColSelectState.java @@ -15,15 +15,15 @@ */ package com.vaadin.shared.ui.twincolselect; -import com.vaadin.shared.AbstractFieldState; import com.vaadin.shared.annotations.DelegateToWidget; +import com.vaadin.shared.ui.abstractmultiselect.AbstractMultiSelectState; /** * Shared state for the TwinColSelect component. * * @since 7.0 */ -public class TwinColSelectState extends AbstractFieldState { +public class TwinColSelectState extends AbstractMultiSelectState { { primaryStyleName = "v-select-twincol"; } diff --git a/uitest/src/main/java/com/vaadin/tests/widgetset/client/SerializerTestState.java b/uitest/src/main/java/com/vaadin/tests/widgetset/client/SerializerTestState.java index 6029759911..ef8a20fb26 100644 --- a/uitest/src/main/java/com/vaadin/tests/widgetset/client/SerializerTestState.java +++ b/uitest/src/main/java/com/vaadin/tests/widgetset/client/SerializerTestState.java @@ -20,14 +20,14 @@ import java.util.List; import java.util.Map; import java.util.Set; -import com.vaadin.shared.AbstractComponentState; import com.vaadin.shared.Connector; +import com.vaadin.shared.communication.SharedState; import com.vaadin.shared.ui.label.ContentMode; import elemental.json.JsonBoolean; import elemental.json.JsonValue; -public class SerializerTestState extends AbstractComponentState { +public class SerializerTestState extends SharedState { public boolean booleanValue; public Boolean booleanObjectValue; |