]> source.dussan.org Git - vaadin-framework.git/commitdiff
Duplicate shared classes of the Vaadin 7 Grid
authorTeemu Suo-Anttila <teemusa@vaadin.com>
Tue, 30 Aug 2016 09:30:37 +0000 (12:30 +0300)
committerArtur Signell <artur@vaadin.com>
Tue, 30 Aug 2016 10:11:56 +0000 (10:11 +0000)
Change-Id: I50cdcef0beb2f384636eb40c2f3f7493db52ac87

55 files changed:
compatibility-client/pom.xml
compatibility-client/src/main/java/com/vaadin/v7/client/connectors/AbstractSelectionModelConnector.java
compatibility-client/src/main/java/com/vaadin/v7/client/connectors/ClickableRendererConnector.java
compatibility-client/src/main/java/com/vaadin/v7/client/connectors/GridConnector.java
compatibility-client/src/main/java/com/vaadin/v7/client/connectors/MultiSelectionModelConnector.java
compatibility-client/src/main/java/com/vaadin/v7/client/connectors/RpcDataSourceConnector.java
compatibility-client/src/main/java/com/vaadin/v7/client/connectors/SingleSelectionModelConnector.java
compatibility-client/src/main/java/com/vaadin/v7/client/renderers/ClickableRenderer.java
compatibility-client/src/main/java/com/vaadin/v7/client/widget/grid/EventCellReference.java
compatibility-client/src/main/java/com/vaadin/v7/client/widget/grid/events/GridClickEvent.java
compatibility-client/src/main/java/com/vaadin/v7/client/widget/grid/events/GridDoubleClickEvent.java
compatibility-client/src/main/java/com/vaadin/v7/client/widget/grid/events/GridKeyDownEvent.java
compatibility-client/src/main/java/com/vaadin/v7/client/widget/grid/events/GridKeyPressEvent.java
compatibility-client/src/main/java/com/vaadin/v7/client/widget/grid/events/GridKeyUpEvent.java
compatibility-client/src/main/java/com/vaadin/v7/client/widget/grid/selection/SpaceSelectHandler.java
compatibility-client/src/main/java/com/vaadin/v7/client/widgets/Escalator.java
compatibility-client/src/main/java/com/vaadin/v7/client/widgets/Grid.java
compatibility-server/src/main/java/com/vaadin/v7/server/communication/data/RpcDataProviderExtension.java
compatibility-server/src/main/java/com/vaadin/v7/ui/Grid.java
compatibility-server/src/main/java/com/vaadin/v7/ui/renderers/ClickableRenderer.java
compatibility-server/src/test/java/com/vaadin/v7/tests/server/component/grid/GridColumnsTest.java
compatibility-server/src/test/java/com/vaadin/v7/tests/server/component/grid/GridStateTest.java
compatibility-server/src/test/java/com/vaadin/v7/tests/server/component/grid/declarative/GridDeclarativeAttributeTest.java
compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/ColumnGroupState.java [new file with mode: 0644]
compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/DetailsConnectorChange.java [new file with mode: 0644]
compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/EditorClientRpc.java [new file with mode: 0644]
compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/EditorServerRpc.java [new file with mode: 0644]
compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/GridClientRpc.java [new file with mode: 0644]
compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/GridColumnState.java [new file with mode: 0644]
compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/GridConstants.java [new file with mode: 0644]
compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/GridServerRpc.java [new file with mode: 0644]
compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/GridState.java [new file with mode: 0644]
compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/GridStaticCellType.java [new file with mode: 0644]
compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/GridStaticSectionState.java [new file with mode: 0644]
compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/HeightMode.java [new file with mode: 0644]
compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/ScrollDestination.java [new file with mode: 0644]
compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/renderers/RendererClickRpc.java [new file with mode: 0644]
compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/selection/MultiSelectionModelServerRpc.java [new file with mode: 0644]
compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/selection/MultiSelectionModelState.java [new file with mode: 0644]
compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/selection/SingleSelectionModelServerRpc.java [new file with mode: 0644]
compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/selection/SingleSelectionModelState.java [new file with mode: 0644]
uitest/src/main/java/com/vaadin/tests/components/grid/GridHeight.java
uitest/src/main/java/com/vaadin/tests/components/grid/GridRowHeightChange.java
uitest/src/main/java/com/vaadin/tests/components/grid/GridScrolling.java
uitest/src/main/java/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java
uitest/src/main/java/com/vaadin/tests/components/grid/basicfeatures/GridHeightByRowOnInit.java
uitest/src/main/java/com/vaadin/tests/contextclick/GridContextClick.java
uitest/src/main/java/com/vaadin/tests/minitutorials/v7_4/ShowingInlineDataInGrid.java
uitest/src/main/java/com/vaadin/tests/widgetset/client/grid/EscalatorBasicClientFeaturesWidget.java
uitest/src/main/java/com/vaadin/tests/widgetset/client/grid/GridBasicClientFeaturesWidget.java
uitest/src/main/java/com/vaadin/tests/widgetset/client/grid/GridDefaultTextRendererWidget.java
uitest/src/main/java/com/vaadin/tests/widgetset/client/grid/GridHeightByRowOnInitWidget.java
uitest/src/test/java/com/vaadin/tests/components/grid/basicfeatures/client/GridDetailsClientTest.java
uitest/src/test/java/com/vaadin/tests/components/grid/basicfeatures/client/GridEditorClientTest.java
uitest/src/test/java/com/vaadin/tests/components/grid/basicfeatures/server/GridEditorBufferedTest.java

index 28ab3f01077bd29bbfa7465c7937b2a4c435156a..d427a0bdff9cabd88a83db4ba68188ca9032f766 100644 (file)
                        <artifactId>vaadin-compatibility-server</artifactId>
                        <version>${project.version}</version>
                </dependency>
+               <dependency>
+                       <groupId>${project.groupId}</groupId>
+                       <artifactId>vaadin-compatibility-shared</artifactId>
+                       <version>${project.version}</version>
+               </dependency>
        </dependencies>
 
        <build>
                                </executions>
                        </plugin>
 
-            <plugin>
-                <artifactId>maven-resources-plugin</artifactId>
-                <executions>
-                    <!-- Copy .java files to package -->
-                    <execution>
-                        <id>copy-sources</id>
-                        <!-- here the phase you need -->
-                        <phase>prepare-package</phase>
-                        <goals>
-                            <goal>copy-resources</goal>
-                        </goals>
-                        <configuration>
-                            <outputDirectory>${project.build.outputDirectory}</outputDirectory>
-                            <resources>
-                                <resource>
-                                    <directory>src/main/resources</directory>
-                                    <filtering>false</filtering>
-                                </resource>
-                                <resource>
-                                    <directory>src/main/java</directory>
-                                    <filtering>false</filtering>
-                                </resource>
-                            </resources>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
+                       <plugin>
+                               <artifactId>maven-resources-plugin</artifactId>
+                               <executions>
+                                       <!-- Copy .java files to package -->
+                                       <execution>
+                                               <id>copy-sources</id>
+                                               <!-- here the phase you need -->
+                                               <phase>prepare-package</phase>
+                                               <goals>
+                                                       <goal>copy-resources</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <outputDirectory>${project.build.outputDirectory}</outputDirectory>
+                                                       <resources>
+                                                               <resource>
+                                                                       <directory>src/main/resources</directory>
+                                                                       <filtering>false</filtering>
+                                                               </resource>
+                                                               <resource>
+                                                                       <directory>src/main/java</directory>
+                                                                       <filtering>false</filtering>
+                                                               </resource>
+                                                       </resources>
+                                               </configuration>
+                                       </execution>
+                               </executions>
+                       </plugin>
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-surefire-plugin</artifactId>
index 577f7d67b2ced02c0569708afd9d68d22afa7e2a..d30288e6b65189ae21f92671d2dfc3c3685a17b5 100644 (file)
@@ -19,9 +19,9 @@ import java.util.Collection;
 
 import com.vaadin.client.data.DataSource.RowHandle;
 import com.vaadin.client.extensions.AbstractExtensionConnector;
-import com.vaadin.shared.ui.grid.GridState;
 import com.vaadin.v7.client.widget.grid.selection.SelectionModel;
 import com.vaadin.v7.client.widgets.Grid;
+import com.vaadin.v7.shared.ui.grid.GridState;
 
 import elemental.json.JsonObject;
 
index 6a4bf0bb057bf0ce679d079b6bc99f2f978fa601..a7db9628c43fe691a3fa3fb8bb9c59f5bc5f5438 100644 (file)
@@ -17,10 +17,10 @@ package com.vaadin.v7.client.connectors;
 
 import com.google.web.bindery.event.shared.HandlerRegistration;
 import com.vaadin.client.MouseEventDetailsBuilder;
-import com.vaadin.shared.ui.grid.renderers.RendererClickRpc;
 import com.vaadin.v7.client.renderers.ClickableRenderer;
 import com.vaadin.v7.client.renderers.ClickableRenderer.RendererClickEvent;
 import com.vaadin.v7.client.renderers.ClickableRenderer.RendererClickHandler;
+import com.vaadin.v7.shared.ui.grid.renderers.RendererClickRpc;
 
 import elemental.json.JsonObject;
 
index fb634f0d907539aa69ee1babb401e1a8ade89ff1..6a89b6c938e445662375e1c927e0d6d3b336e3aa 100644 (file)
@@ -53,18 +53,6 @@ import com.vaadin.client.ui.SimpleManagedLayout;
 import com.vaadin.shared.MouseEventDetails;
 import com.vaadin.shared.data.sort.SortDirection;
 import com.vaadin.shared.ui.Connect;
-import com.vaadin.shared.ui.grid.EditorClientRpc;
-import com.vaadin.shared.ui.grid.EditorServerRpc;
-import com.vaadin.shared.ui.grid.GridClientRpc;
-import com.vaadin.shared.ui.grid.GridColumnState;
-import com.vaadin.shared.ui.grid.GridConstants;
-import com.vaadin.shared.ui.grid.GridConstants.Section;
-import com.vaadin.shared.ui.grid.GridServerRpc;
-import com.vaadin.shared.ui.grid.GridState;
-import com.vaadin.shared.ui.grid.GridStaticSectionState;
-import com.vaadin.shared.ui.grid.GridStaticSectionState.CellState;
-import com.vaadin.shared.ui.grid.GridStaticSectionState.RowState;
-import com.vaadin.shared.ui.grid.ScrollDestination;
 import com.vaadin.v7.client.connectors.RpcDataSourceConnector.DetailsListener;
 import com.vaadin.v7.client.connectors.RpcDataSourceConnector.RpcDataSource;
 import com.vaadin.v7.client.widget.escalator.events.RowHeightChangedEvent;
@@ -95,6 +83,18 @@ import com.vaadin.v7.client.widgets.Grid.FooterCell;
 import com.vaadin.v7.client.widgets.Grid.FooterRow;
 import com.vaadin.v7.client.widgets.Grid.HeaderCell;
 import com.vaadin.v7.client.widgets.Grid.HeaderRow;
+import com.vaadin.v7.shared.ui.grid.EditorClientRpc;
+import com.vaadin.v7.shared.ui.grid.EditorServerRpc;
+import com.vaadin.v7.shared.ui.grid.GridClientRpc;
+import com.vaadin.v7.shared.ui.grid.GridColumnState;
+import com.vaadin.v7.shared.ui.grid.GridConstants;
+import com.vaadin.v7.shared.ui.grid.GridServerRpc;
+import com.vaadin.v7.shared.ui.grid.GridState;
+import com.vaadin.v7.shared.ui.grid.GridStaticSectionState;
+import com.vaadin.v7.shared.ui.grid.ScrollDestination;
+import com.vaadin.v7.shared.ui.grid.GridConstants.Section;
+import com.vaadin.v7.shared.ui.grid.GridStaticSectionState.CellState;
+import com.vaadin.v7.shared.ui.grid.GridStaticSectionState.RowState;
 
 import elemental.json.JsonObject;
 import elemental.json.JsonValue;
index ffb100bd71288788ef755f370f2f3f615cc9a7ee..ff40816d936406f59e09f844c0c5339d50a50ba9 100644 (file)
@@ -30,10 +30,7 @@ import com.vaadin.client.annotations.OnStateChange;
 import com.vaadin.client.data.DataSource;
 import com.vaadin.client.data.DataSource.RowHandle;
 import com.vaadin.shared.ui.Connect;
-import com.vaadin.shared.ui.grid.GridState;
 import com.vaadin.shared.ui.grid.Range;
-import com.vaadin.shared.ui.grid.selection.MultiSelectionModelServerRpc;
-import com.vaadin.shared.ui.grid.selection.MultiSelectionModelState;
 import com.vaadin.v7.client.renderers.ComplexRenderer;
 import com.vaadin.v7.client.renderers.Renderer;
 import com.vaadin.v7.client.widget.grid.DataAvailableEvent;
@@ -46,6 +43,9 @@ import com.vaadin.v7.client.widget.grid.selection.SpaceSelectHandler;
 import com.vaadin.v7.client.widget.grid.selection.SelectionModel.Multi;
 import com.vaadin.v7.client.widgets.Grid;
 import com.vaadin.v7.client.widgets.Grid.HeaderCell;
+import com.vaadin.v7.shared.ui.grid.GridState;
+import com.vaadin.v7.shared.ui.grid.selection.MultiSelectionModelServerRpc;
+import com.vaadin.v7.shared.ui.grid.selection.MultiSelectionModelState;
 import com.vaadin.v7.ui.Grid.MultiSelectionModel;
 
 import elemental.json.JsonObject;
index 5eee89261671246df49914f5739d6666ef72634b..439305d71899023f419616384fdfeeb61de3efaf 100644 (file)
@@ -26,8 +26,8 @@ import com.vaadin.client.extensions.AbstractExtensionConnector;
 import com.vaadin.shared.data.DataProviderRpc;
 import com.vaadin.shared.data.DataRequestRpc;
 import com.vaadin.shared.ui.Connect;
-import com.vaadin.shared.ui.grid.GridState;
 import com.vaadin.shared.ui.grid.Range;
+import com.vaadin.v7.shared.ui.grid.GridState;
 
 import elemental.json.Json;
 import elemental.json.JsonArray;
index 9d5233607dcfb15a5e54703b89428374fb000de8..8c206b8defb5435366900b945880e76198dab296 100644 (file)
@@ -19,14 +19,14 @@ import com.vaadin.client.ServerConnector;
 import com.vaadin.client.annotations.OnStateChange;
 import com.vaadin.client.data.DataSource.RowHandle;
 import com.vaadin.shared.ui.Connect;
-import com.vaadin.shared.ui.grid.GridState;
-import com.vaadin.shared.ui.grid.selection.SingleSelectionModelServerRpc;
-import com.vaadin.shared.ui.grid.selection.SingleSelectionModelState;
 import com.vaadin.v7.client.renderers.Renderer;
 import com.vaadin.v7.client.widget.grid.selection.ClickSelectHandler;
 import com.vaadin.v7.client.widget.grid.selection.SelectionModel;
 import com.vaadin.v7.client.widget.grid.selection.SpaceSelectHandler;
 import com.vaadin.v7.client.widget.grid.selection.SelectionModel.Single;
+import com.vaadin.v7.shared.ui.grid.GridState;
+import com.vaadin.v7.shared.ui.grid.selection.SingleSelectionModelServerRpc;
+import com.vaadin.v7.shared.ui.grid.selection.SingleSelectionModelState;
 import com.vaadin.v7.ui.Grid.SingleSelectionModel;
 
 import elemental.json.JsonObject;
index e99d03d3d17487f3f6f7bc708fadea39d2ff9061..940ac209821a0cd7ae62dba851179328f9b11909 100644 (file)
@@ -28,13 +28,13 @@ import com.google.gwt.user.client.ui.Composite;
 import com.google.gwt.user.client.ui.Widget;
 import com.google.web.bindery.event.shared.HandlerRegistration;
 import com.vaadin.client.WidgetUtil;
-import com.vaadin.shared.ui.grid.GridConstants.Section;
 import com.vaadin.v7.client.widget.escalator.Cell;
 import com.vaadin.v7.client.widget.escalator.RowContainer;
 import com.vaadin.v7.client.widget.grid.CellReference;
 import com.vaadin.v7.client.widget.grid.EventCellReference;
 import com.vaadin.v7.client.widgets.Escalator;
 import com.vaadin.v7.client.widgets.Grid;
+import com.vaadin.v7.shared.ui.grid.GridConstants.Section;
 
 /**
  * An abstract superclass for renderers that render clickable widgets. Click
index b4fc74c6e158a39eb8f1e1c0a29db82d20ccdade..e12714d4e3fc645ab78b6f2796de73fde15a151e 100644 (file)
 package com.vaadin.v7.client.widget.grid;
 
 import com.google.gwt.dom.client.TableCellElement;
-import com.vaadin.shared.ui.grid.GridConstants.Section;
 import com.vaadin.v7.client.widget.escalator.Cell;
 import com.vaadin.v7.client.widgets.Grid;
 import com.vaadin.v7.client.widgets.Grid.Column;
+import com.vaadin.v7.shared.ui.grid.GridConstants.Section;
 
 /**
  * A data class which contains information which identifies a cell being the
index 1dfd1dc42df625292d2347ca785edc778581e2f2..8f2350727fa6702c3222efd272b933558a672778 100644 (file)
 package com.vaadin.v7.client.widget.grid.events;
 
 import com.google.gwt.dom.client.BrowserEvents;
-import com.vaadin.shared.ui.grid.GridConstants.Section;
 import com.vaadin.v7.client.widget.grid.CellReference;
 import com.vaadin.v7.client.widget.grid.events.AbstractGridMouseEventHandler.GridClickHandler;
 import com.vaadin.v7.client.widgets.Grid;
 import com.vaadin.v7.client.widgets.Grid.AbstractGridMouseEvent;
+import com.vaadin.v7.shared.ui.grid.GridConstants.Section;
 
 /**
  * Represents native mouse click event in Grid.
index f8383303aa63ba446e1c223fd90912dd5a7e663e..711e70f3b4fda0d94791288b074a8c3605aff5e8 100644 (file)
 package com.vaadin.v7.client.widget.grid.events;
 
 import com.google.gwt.dom.client.BrowserEvents;
-import com.vaadin.shared.ui.grid.GridConstants.Section;
 import com.vaadin.v7.client.widget.grid.CellReference;
 import com.vaadin.v7.client.widget.grid.events.AbstractGridMouseEventHandler.GridDoubleClickHandler;
 import com.vaadin.v7.client.widgets.Grid;
 import com.vaadin.v7.client.widgets.Grid.AbstractGridMouseEvent;
+import com.vaadin.v7.shared.ui.grid.GridConstants.Section;
 
 /**
  * Represents native mouse double click event in Grid.
index 3afd060307a5252e1a474ae31f899aad17c9d8bd..e4405b69a57f5b671eed6685ef93647f350eadea 100644 (file)
@@ -17,11 +17,11 @@ package com.vaadin.v7.client.widget.grid.events;
 
 import com.google.gwt.dom.client.BrowserEvents;
 import com.google.gwt.event.dom.client.KeyCodes;
-import com.vaadin.shared.ui.grid.GridConstants.Section;
 import com.vaadin.v7.client.widget.grid.CellReference;
 import com.vaadin.v7.client.widget.grid.events.AbstractGridKeyEventHandler.GridKeyDownHandler;
 import com.vaadin.v7.client.widgets.Grid;
 import com.vaadin.v7.client.widgets.Grid.AbstractGridKeyEvent;
+import com.vaadin.v7.shared.ui.grid.GridConstants.Section;
 
 /**
  * Represents native key down event in Grid.
index 3fb3bb94e5d8479140842d3ed74912b44dfad44e..86a4664df03a678c141fd9930cc03af64c41d141 100644 (file)
 package com.vaadin.v7.client.widget.grid.events;
 
 import com.google.gwt.dom.client.BrowserEvents;
-import com.vaadin.shared.ui.grid.GridConstants.Section;
 import com.vaadin.v7.client.widget.grid.CellReference;
 import com.vaadin.v7.client.widget.grid.events.AbstractGridKeyEventHandler.GridKeyPressHandler;
 import com.vaadin.v7.client.widgets.Grid;
 import com.vaadin.v7.client.widgets.Grid.AbstractGridKeyEvent;
+import com.vaadin.v7.shared.ui.grid.GridConstants.Section;
 
 /**
  * Represents native key press event in Grid.
index 485468b8797f775331b0c803a6a67d8366bca108..770f0214f9974673d52f7dee1a0ddfc1a3d18799 100644 (file)
@@ -17,11 +17,11 @@ package com.vaadin.v7.client.widget.grid.events;
 
 import com.google.gwt.dom.client.BrowserEvents;
 import com.google.gwt.event.dom.client.KeyCodes;
-import com.vaadin.shared.ui.grid.GridConstants.Section;
 import com.vaadin.v7.client.widget.grid.CellReference;
 import com.vaadin.v7.client.widget.grid.events.AbstractGridKeyEventHandler.GridKeyUpHandler;
 import com.vaadin.v7.client.widgets.Grid;
 import com.vaadin.v7.client.widgets.Grid.AbstractGridKeyEvent;
+import com.vaadin.v7.shared.ui.grid.GridConstants.Section;
 
 /**
  * Represents native key up event in Grid.
index a3b05ff887ae7d1100cd13ad121d777b1c0320ca..d4c0f2219fddf23b92fe1c4c9a520aff7da4126f 100644 (file)
@@ -17,7 +17,6 @@ package com.vaadin.v7.client.widget.grid.selection;
 
 import com.google.gwt.event.dom.client.KeyCodes;
 import com.google.gwt.event.shared.HandlerRegistration;
-import com.vaadin.shared.ui.grid.ScrollDestination;
 import com.vaadin.v7.client.widget.grid.DataAvailableEvent;
 import com.vaadin.v7.client.widget.grid.DataAvailableHandler;
 import com.vaadin.v7.client.widget.grid.events.BodyKeyDownHandler;
@@ -25,6 +24,7 @@ import com.vaadin.v7.client.widget.grid.events.BodyKeyUpHandler;
 import com.vaadin.v7.client.widget.grid.events.GridKeyDownEvent;
 import com.vaadin.v7.client.widget.grid.events.GridKeyUpEvent;
 import com.vaadin.v7.client.widgets.Grid;
+import com.vaadin.v7.shared.ui.grid.ScrollDestination;
 
 /**
  * Generic class to perform selections when pressing space key.
index 322a2e54c401d2c8bb316c75293a77c339edfc24..745ffa24cfabee7001e65c8ba26380aaf14d2106 100644 (file)
@@ -65,9 +65,7 @@ import com.vaadin.client.DeferredWorker;
 import com.vaadin.client.Profiler;
 import com.vaadin.client.WidgetUtil;
 import com.vaadin.client.ui.SubPartAware;
-import com.vaadin.shared.ui.grid.HeightMode;
 import com.vaadin.shared.ui.grid.Range;
-import com.vaadin.shared.ui.grid.ScrollDestination;
 import com.vaadin.shared.util.SharedUtil;
 import com.vaadin.v7.client.widget.escalator.Cell;
 import com.vaadin.v7.client.widget.escalator.ColumnConfiguration;
@@ -93,6 +91,8 @@ import com.vaadin.v7.client.widget.escalator.events.RowHeightChangedEvent;
 import com.vaadin.v7.client.widget.grid.events.ScrollEvent;
 import com.vaadin.v7.client.widget.grid.events.ScrollHandler;
 import com.vaadin.v7.client.widgets.Escalator.JsniUtil.TouchHandlerBundle;
+import com.vaadin.v7.shared.ui.grid.HeightMode;
+import com.vaadin.v7.shared.ui.grid.ScrollDestination;
 
 /*-
 
index e6eb36f8c9193e81a2b0eba4f56b620da49d072d..ca565e01c29d59e050a398871c78ad8ff7c62859 100644 (file)
@@ -92,12 +92,7 @@ import com.vaadin.client.ui.dd.DragHandle.DragHandleCallback;
 import com.vaadin.client.widgets.Overlay;
 import com.vaadin.shared.Registration;
 import com.vaadin.shared.data.sort.SortDirection;
-import com.vaadin.shared.ui.grid.GridConstants;
-import com.vaadin.shared.ui.grid.GridConstants.Section;
-import com.vaadin.shared.ui.grid.GridStaticCellType;
-import com.vaadin.shared.ui.grid.HeightMode;
 import com.vaadin.shared.ui.grid.Range;
-import com.vaadin.shared.ui.grid.ScrollDestination;
 import com.vaadin.shared.util.SharedUtil;
 import com.vaadin.v7.client.renderers.ComplexRenderer;
 import com.vaadin.v7.client.renderers.Renderer;
@@ -184,6 +179,11 @@ import com.vaadin.v7.client.widgets.Escalator.SubPartArguments;
 import com.vaadin.v7.client.widgets.Grid.Editor.State;
 import com.vaadin.v7.client.widgets.Grid.StaticSection.StaticCell;
 import com.vaadin.v7.client.widgets.Grid.StaticSection.StaticRow;
+import com.vaadin.v7.shared.ui.grid.GridConstants;
+import com.vaadin.v7.shared.ui.grid.GridStaticCellType;
+import com.vaadin.v7.shared.ui.grid.HeightMode;
+import com.vaadin.v7.shared.ui.grid.ScrollDestination;
+import com.vaadin.v7.shared.ui.grid.GridConstants.Section;
 
 /**
  * A data grid view that supports columns and lazy loading of data rows from a
index dce3eb1cfa170cd5352b4a74a495de1861a79ef9..ce960fa5fd06beae6bc729963c736eb019948727 100644 (file)
@@ -31,7 +31,6 @@ import com.vaadin.server.ClientConnector;
 import com.vaadin.server.KeyMapper;
 import com.vaadin.shared.data.DataProviderRpc;
 import com.vaadin.shared.data.DataRequestRpc;
-import com.vaadin.shared.ui.grid.GridState;
 import com.vaadin.shared.ui.grid.Range;
 import com.vaadin.v7.data.Container;
 import com.vaadin.v7.data.Container.Indexed;
@@ -45,6 +44,7 @@ import com.vaadin.v7.data.Property;
 import com.vaadin.v7.data.Property.ValueChangeEvent;
 import com.vaadin.v7.data.Property.ValueChangeListener;
 import com.vaadin.v7.data.Property.ValueChangeNotifier;
+import com.vaadin.v7.shared.ui.grid.GridState;
 import com.vaadin.v7.ui.Grid;
 import com.vaadin.v7.ui.Grid.Column;
 
index 371520d5d5698fc6bb1eda6a9de6df30086a9f63..6c7de83fc27c620f2da07d1b08f07d95e1df9db8 100644 (file)
@@ -61,24 +61,6 @@ import com.vaadin.server.KeyMapper;
 import com.vaadin.server.VaadinSession;
 import com.vaadin.shared.MouseEventDetails;
 import com.vaadin.shared.data.sort.SortDirection;
-import com.vaadin.shared.ui.grid.EditorClientRpc;
-import com.vaadin.shared.ui.grid.EditorServerRpc;
-import com.vaadin.shared.ui.grid.GridClientRpc;
-import com.vaadin.shared.ui.grid.GridColumnState;
-import com.vaadin.shared.ui.grid.GridConstants;
-import com.vaadin.shared.ui.grid.GridConstants.Section;
-import com.vaadin.shared.ui.grid.GridServerRpc;
-import com.vaadin.shared.ui.grid.GridState;
-import com.vaadin.shared.ui.grid.GridStaticCellType;
-import com.vaadin.shared.ui.grid.GridStaticSectionState;
-import com.vaadin.shared.ui.grid.GridStaticSectionState.CellState;
-import com.vaadin.shared.ui.grid.GridStaticSectionState.RowState;
-import com.vaadin.shared.ui.grid.HeightMode;
-import com.vaadin.shared.ui.grid.ScrollDestination;
-import com.vaadin.shared.ui.grid.selection.MultiSelectionModelServerRpc;
-import com.vaadin.shared.ui.grid.selection.MultiSelectionModelState;
-import com.vaadin.shared.ui.grid.selection.SingleSelectionModelServerRpc;
-import com.vaadin.shared.ui.grid.selection.SingleSelectionModelState;
 import com.vaadin.shared.util.SharedUtil;
 import com.vaadin.ui.AbstractFocusable;
 import com.vaadin.ui.Component;
@@ -114,6 +96,24 @@ import com.vaadin.v7.event.ItemClickEvent.ItemClickListener;
 import com.vaadin.v7.event.ItemClickEvent.ItemClickNotifier;
 import com.vaadin.v7.server.communication.data.DataGenerator;
 import com.vaadin.v7.server.communication.data.RpcDataProviderExtension;
+import com.vaadin.v7.shared.ui.grid.EditorClientRpc;
+import com.vaadin.v7.shared.ui.grid.EditorServerRpc;
+import com.vaadin.v7.shared.ui.grid.GridClientRpc;
+import com.vaadin.v7.shared.ui.grid.GridColumnState;
+import com.vaadin.v7.shared.ui.grid.GridConstants;
+import com.vaadin.v7.shared.ui.grid.GridServerRpc;
+import com.vaadin.v7.shared.ui.grid.GridState;
+import com.vaadin.v7.shared.ui.grid.GridStaticCellType;
+import com.vaadin.v7.shared.ui.grid.GridStaticSectionState;
+import com.vaadin.v7.shared.ui.grid.HeightMode;
+import com.vaadin.v7.shared.ui.grid.ScrollDestination;
+import com.vaadin.v7.shared.ui.grid.GridConstants.Section;
+import com.vaadin.v7.shared.ui.grid.GridStaticSectionState.CellState;
+import com.vaadin.v7.shared.ui.grid.GridStaticSectionState.RowState;
+import com.vaadin.v7.shared.ui.grid.selection.MultiSelectionModelServerRpc;
+import com.vaadin.v7.shared.ui.grid.selection.MultiSelectionModelState;
+import com.vaadin.v7.shared.ui.grid.selection.SingleSelectionModelServerRpc;
+import com.vaadin.v7.shared.ui.grid.selection.SingleSelectionModelState;
 import com.vaadin.v7.ui.renderers.HtmlRenderer;
 import com.vaadin.v7.ui.renderers.Renderer;
 import com.vaadin.v7.ui.renderers.TextRenderer;
index a1f48a99c402eb4fbbe38ebd96115f7079054fcc..bd63e08c9332b4945387dd73200f049b84ff3fa1 100644 (file)
@@ -20,8 +20,8 @@ import java.lang.reflect.Method;
 import com.vaadin.event.ConnectorEventListener;
 import com.vaadin.event.MouseEvents.ClickEvent;
 import com.vaadin.shared.MouseEventDetails;
-import com.vaadin.shared.ui.grid.renderers.RendererClickRpc;
 import com.vaadin.util.ReflectTools;
+import com.vaadin.v7.shared.ui.grid.renderers.RendererClickRpc;
 import com.vaadin.v7.ui.Grid;
 import com.vaadin.v7.ui.Grid.AbstractRenderer;
 import com.vaadin.v7.ui.Grid.Column;
index a438bed25cd3292fe19c47b3975ac2367c379c93..a0b2dc54bdff058d1ace778320e64c37d7fd9f3b 100644 (file)
@@ -40,10 +40,10 @@ import org.junit.Before;
 import org.junit.Test;
 
 import com.vaadin.server.KeyMapper;
-import com.vaadin.shared.ui.grid.GridColumnState;
-import com.vaadin.shared.ui.grid.GridState;
 import com.vaadin.shared.util.SharedUtil;
 import com.vaadin.v7.data.util.IndexedContainer;
+import com.vaadin.v7.shared.ui.grid.GridColumnState;
+import com.vaadin.v7.shared.ui.grid.GridState;
 import com.vaadin.v7.ui.Grid;
 import com.vaadin.v7.ui.Grid.Column;
 import com.vaadin.v7.ui.Grid.ColumnResizeEvent;
index 2170af060dbe835aa623450a2f72e1cbede1043a..b9ae44301bc77fcfee0f521de8db1558b6f1422e 100644 (file)
@@ -18,7 +18,7 @@ package com.vaadin.v7.tests.server.component.grid;
 import org.junit.Assert;
 import org.junit.Test;
 
-import com.vaadin.shared.ui.grid.GridState;
+import com.vaadin.v7.shared.ui.grid.GridState;
 import com.vaadin.v7.ui.Grid;
 
 /**
index df46c6c70a94b00b408bf7b4708e5c4bee01ebcd..c026d5a51e8d6f4c0e3a0bb7e50a3dc685b5ac34 100644 (file)
@@ -19,8 +19,8 @@ import static org.junit.Assert.assertSame;
 
 import org.junit.Test;
 
-import com.vaadin.shared.ui.grid.HeightMode;
 import com.vaadin.tests.design.DeclarativeTestBase;
+import com.vaadin.v7.shared.ui.grid.HeightMode;
 import com.vaadin.v7.ui.Grid;
 import com.vaadin.v7.ui.Grid.MultiSelectionModel;
 import com.vaadin.v7.ui.Grid.NoSelectionModel;
diff --git a/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/ColumnGroupState.java b/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/ColumnGroupState.java
new file mode 100644 (file)
index 0000000..f3751f4
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * 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.v7.shared.ui.grid;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * The column group data shared between the server and the client
+ *
+ * @since 7.4
+ * @author Vaadin Ltd
+ */
+public class ColumnGroupState implements Serializable {
+
+    /**
+     * The columns that is included in the group
+     */
+    public List<String> columns = new ArrayList<String>();
+
+    /**
+     * The header text of the group
+     */
+    public String header;
+
+    /**
+     * The footer text of the group
+     */
+    public String footer;
+}
diff --git a/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/DetailsConnectorChange.java b/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/DetailsConnectorChange.java
new file mode 100644 (file)
index 0000000..ff274ca
--- /dev/null
@@ -0,0 +1,189 @@
+/*
+ * 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.v7.shared.ui.grid;
+
+import java.io.Serializable;
+import java.util.Comparator;
+
+import com.vaadin.shared.Connector;
+
+/**
+ * A description of an indexing modification for a connector. This is used by
+ * Grid for internal bookkeeping updates.
+ *
+ * @since 7.5.0
+ * @author Vaadin Ltd
+ */
+public class DetailsConnectorChange implements Serializable {
+
+    public static final Comparator<DetailsConnectorChange> REMOVED_FIRST_COMPARATOR = new Comparator<DetailsConnectorChange>() {
+        @Override
+        public int compare(DetailsConnectorChange a, DetailsConnectorChange b) {
+            boolean deleteA = a.getNewIndex() == null;
+            boolean deleteB = b.getNewIndex() == null;
+            if (deleteA && !deleteB) {
+                return -1;
+            } else if (!deleteA && deleteB) {
+                return 1;
+            } else {
+                return 0;
+            }
+        }
+    };
+
+    private Connector connector;
+    private Integer oldIndex;
+    private Integer newIndex;
+    private boolean shouldStillBeVisible;
+
+    /** Create a new connector index change */
+    public DetailsConnectorChange() {
+    }
+
+    /**
+     * Convenience constructor for setting all the fields in one line.
+     * <p>
+     * Calling this constructor will also assert that the state of the pojo is
+     * consistent by internal assumptions.
+     *
+     * @param connector
+     *            the changed connector
+     * @param oldIndex
+     *            the old index
+     * @param newIndex
+     *            the new index
+     * @param shouldStillBeVisible
+     *            details should be visible regardless of {@code connector}
+     */
+    public DetailsConnectorChange(Connector connector, Integer oldIndex,
+            Integer newIndex, boolean shouldStillBeVisible) {
+        this.connector = connector;
+        this.oldIndex = oldIndex;
+        this.newIndex = newIndex;
+        this.shouldStillBeVisible = shouldStillBeVisible;
+
+        assert assertStateIsOk();
+    }
+
+    private boolean assertStateIsOk() {
+        boolean connectorAndNewIndexIsNotNull = connector != null
+                && newIndex != null;
+        boolean connectorAndNewIndexIsNullThenOldIndexIsSet = connector == null
+                && newIndex == null && oldIndex != null;
+
+        assert (connectorAndNewIndexIsNotNull
+                || connectorAndNewIndexIsNullThenOldIndexIsSet) : "connector: "
+                        + nullityString(connector) + ", oldIndex: "
+                        + nullityString(oldIndex) + ", newIndex: "
+                        + nullityString(newIndex);
+        return true;
+    }
+
+    private static String nullityString(Object object) {
+        return object == null ? "null" : "non-null";
+    }
+
+    /**
+     * Gets the old index for the connector.
+     * <p>
+     * If <code>null</code>, the connector is recently added. This means that
+     * {@link #getConnector()} is expected not to return <code>null</code>.
+     *
+     * @return the old index for the connector
+     */
+    public Integer getOldIndex() {
+        assert assertStateIsOk();
+        return oldIndex;
+    }
+
+    /**
+     * Gets the new index for the connector.
+     * <p>
+     * If <code>null</code>, the connector should be removed. This means that
+     * {@link #getConnector()} is expected to return <code>null</code> as well.
+     *
+     * @return the new index for the connector
+     */
+    public Integer getNewIndex() {
+        assert assertStateIsOk();
+        return newIndex;
+    }
+
+    /**
+     * Gets the changed connector.
+     *
+     * @return the changed connector. Might be <code>null</code>
+     */
+    public Connector getConnector() {
+        assert assertStateIsOk();
+        return connector;
+    }
+
+    /**
+     * Sets the changed connector.
+     *
+     * @param connector
+     *            the changed connector. May be <code>null</code>
+     */
+    public void setConnector(Connector connector) {
+        this.connector = connector;
+    }
+
+    /**
+     * Sets the old index
+     *
+     * @param oldIndex
+     *            the old index. May be <code>null</code> if a new connector is
+     *            being inserted
+     */
+    public void setOldIndex(Integer oldIndex) {
+        this.oldIndex = oldIndex;
+    }
+
+    /**
+     * Sets the new index
+     *
+     * @param newIndex
+     *            the new index. May be <code>null</code> if a connector is
+     *            being removed
+     */
+    public void setNewIndex(Integer newIndex) {
+        this.newIndex = newIndex;
+    }
+
+    /**
+     * Checks whether whether the details should remain open, even if connector
+     * might be <code>null</code>.
+     *
+     * @return <code>true</code> iff the details should remain open, even if
+     *         connector might be <code>null</code>
+     */
+    public boolean isShouldStillBeVisible() {
+        return shouldStillBeVisible;
+    }
+
+    /**
+     * Sets whether the details should remain open, even if connector might be
+     * <code>null</code>.
+     *
+     * @param shouldStillBeVisible
+     *            <code>true</code> iff the details should remain open, even if
+     *            connector might be <code>null</code>
+     */
+    public void setShouldStillBeVisible(boolean shouldStillBeVisible) {
+        this.shouldStillBeVisible = shouldStillBeVisible;
+    }
+}
diff --git a/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/EditorClientRpc.java b/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/EditorClientRpc.java
new file mode 100644 (file)
index 0000000..72c7c83
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * 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.v7.shared.ui.grid;
+
+import java.util.List;
+
+import com.vaadin.shared.communication.ClientRpc;
+
+/**
+ * An RPC interface for the grid editor server-to-client communications.
+ *
+ * @since 7.4
+ * @author Vaadin Ltd
+ */
+public interface EditorClientRpc extends ClientRpc {
+
+    /**
+     * Tells the client to open the editor and bind data to it.
+     *
+     * @param rowIndex
+     *            the index of the edited row
+     */
+    void bind(int rowIndex);
+
+    /**
+     * Tells the client to cancel editing and hide the editor.
+     *
+     * @param rowIndex
+     *            the index of the edited row
+     */
+    void cancel(int rowIndex);
+
+    /**
+     * Confirms a pending {@link EditorServerRpc#bind(int) bind request} sent by
+     * the client.
+     *
+     * @param bindSucceeded
+     *            <code>true</code> iff the bind action was successful
+     */
+    void confirmBind(boolean bindSucceeded);
+
+    /**
+     * Confirms a pending {@link EditorServerRpc#save(int) save request} sent by
+     * the client.
+     *
+     * @param saveSucceeded
+     *            <code>true</code> iff the save action was successful
+     * @param errorMessage
+     *            the error message to show the user
+     * @param errorColumnsIds
+     *            a list of column keys that should get error markers, or
+     *            <code>null</code> if there should be no error markers
+     */
+    void confirmSave(boolean saveSucceeded, String errorMessage,
+            List<String> errorColumnsIds);
+}
diff --git a/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/EditorServerRpc.java b/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/EditorServerRpc.java
new file mode 100644 (file)
index 0000000..df7b090
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * 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.v7.shared.ui.grid;
+
+import com.vaadin.shared.communication.ServerRpc;
+
+/**
+ * An RPC interface for the grid editor client-to-server communications.
+ *
+ * @since 7.4
+ * @author Vaadin Ltd
+ */
+public interface EditorServerRpc extends ServerRpc {
+
+    /**
+     * Asks the server to open the editor and bind data to it. When a bind
+     * request is sent, it must be acknowledged with a
+     * {@link EditorClientRpc#confirmBind() confirm call} before the client can
+     * open the editor.
+     *
+     * @param rowIndex
+     *            the index of the edited row
+     */
+    void bind(int rowIndex);
+
+    /**
+     * Asks the server to save unsaved changes in the editor to the data source.
+     * When a save request is sent, it must be acknowledged with a
+     * {@link EditorClientRpc#confirmSave() confirm call}.
+     *
+     * @param rowIndex
+     *            the index of the edited row
+     */
+    void save(int rowIndex);
+
+    /**
+     * Tells the server to cancel editing. When sending a cancel request, the
+     * client does not need to wait for confirmation by the server before hiding
+     * the editor.
+     *
+     * @param rowIndex
+     *            the index of the edited row
+     */
+    void cancel(int rowIndex);
+}
diff --git a/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/GridClientRpc.java b/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/GridClientRpc.java
new file mode 100644 (file)
index 0000000..64515d2
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * 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.v7.shared.ui.grid;
+
+import com.vaadin.shared.communication.ClientRpc;
+
+/**
+ * Server-to-client RPC interface for the Grid component.
+ *
+ * @since 7.4
+ * @author Vaadin Ltd
+ */
+public interface GridClientRpc extends ClientRpc {
+
+    /**
+     * Command client Grid to scroll to a specific data row and its (optional)
+     * details.
+     *
+     * @param row
+     *            zero-based row index. If the row index is below zero or above
+     *            the row count of the client-side data source, a client-side
+     *            exception will be triggered. Since this exception has no
+     *            handling by default, an out-of-bounds value will cause a
+     *            client-side crash.
+     * @param destination
+     *            desired placement of scrolled-to row. See the documentation
+     *            for {@link ScrollDestination} for more information.
+     */
+    public void scrollToRow(int row, ScrollDestination destination);
+
+    /**
+     * Command client Grid to scroll to the first row.
+     */
+    public void scrollToStart();
+
+    /**
+     * Command client Grid to scroll to the last row.
+     */
+    public void scrollToEnd();
+
+    /**
+     * Command client Grid to recalculate column widths.
+     */
+    public void recalculateColumnWidths();
+}
diff --git a/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/GridColumnState.java b/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/GridColumnState.java
new file mode 100644 (file)
index 0000000..b1bf184
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ * 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.v7.shared.ui.grid;
+
+import java.io.Serializable;
+
+import com.vaadin.shared.Connector;
+
+/**
+ * Column state DTO for transferring column properties from the server to the
+ * client
+ *
+ * @since 7.4
+ * @author Vaadin Ltd
+ */
+public class GridColumnState implements Serializable {
+
+    /**
+     * Id used by grid connector to map server side column with client side
+     * column
+     */
+    public String id;
+
+    /**
+     * Column width in pixels. Default column width is
+     * {@value GridConstants#DEFAULT_COLUMN_WIDTH_PX}.
+     */
+    public double width = GridConstants.DEFAULT_COLUMN_WIDTH_PX;
+
+    /**
+     * The connector for the renderer used to render the cells in this column.
+     */
+    public Connector rendererConnector;
+
+    /**
+     * Whether the values in this column are editable when the editor interface
+     * is active.
+     */
+    public boolean editable = true;
+
+    /**
+     * The connector for the field used to edit cells in this column when the
+     * editor interface is active.
+     */
+    public Connector editorConnector;
+
+    /**
+     * Whether this column is sortable by the user
+     */
+    public boolean sortable = false;
+
+    /** How much of the remaining space this column will reserve. */
+    public int expandRatio = GridConstants.DEFAULT_EXPAND_RATIO;
+
+    /**
+     * The maximum expansion width of this column. -1 for "no maximum". If
+     * maxWidth is less than the calculated width, maxWidth is ignored.
+     */
+    public double maxWidth = GridConstants.DEFAULT_MAX_WIDTH;
+
+    /**
+     * The minimum expansion width of this column. -1 for "no minimum". If
+     * minWidth is less than the calculated width, minWidth will win.
+     */
+    public double minWidth = GridConstants.DEFAULT_MIN_WIDTH;
+
+    /** Whether this column is currently hidden. */
+    public boolean hidden = false;
+
+    /** Whether the column can be hidden by the user. */
+    public boolean hidable = false;
+
+    /** The caption for the column hiding toggle. */
+    public String hidingToggleCaption;
+
+    /** Column header caption */
+    public String headerCaption;
+
+    /** Whether this column is resizable by the user. */
+    public boolean resizable = true;
+}
diff --git a/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/GridConstants.java b/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/GridConstants.java
new file mode 100644 (file)
index 0000000..dc9b220
--- /dev/null
@@ -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.v7.shared.ui.grid;
+
+import java.io.Serializable;
+
+/**
+ * Container class for common constants and default values used by the Grid
+ * component.
+ *
+ * @since 7.4
+ * @author Vaadin Ltd
+ */
+public final class GridConstants implements Serializable {
+
+    /**
+     * Enum describing different sections of Grid.
+     *
+     * @since 7.6
+     */
+    public enum Section {
+        HEADER, BODY, FOOTER
+    }
+
+    /**
+     * Default padding in pixels when scrolling programmatically, without an
+     * explicitly defined padding value.
+     */
+    public static final int DEFAULT_PADDING = 0;
+
+    /**
+     * Delay before a long tap action is triggered. Number in milliseconds.
+     */
+    public static final int LONG_TAP_DELAY = 500;
+
+    /**
+     * The threshold in pixels a finger can move while long tapping.
+     */
+    public static final int LONG_TAP_THRESHOLD = 3;
+
+    /* Column constants */
+
+    /**
+     * Default maximum width for columns.
+     */
+    public static final double DEFAULT_MAX_WIDTH = -1;
+
+    /**
+     * Default minimum width for columns.
+     */
+    public static final double DEFAULT_MIN_WIDTH = 10.0d;
+
+    /**
+     * Default expand ratio for columns.
+     */
+    public static final int DEFAULT_EXPAND_RATIO = -1;
+
+    /**
+     * Default width for columns.
+     */
+    public static final double DEFAULT_COLUMN_WIDTH_PX = -1;
+
+    /**
+     * Event ID for item click events
+     */
+    public static final String ITEM_CLICK_EVENT_ID = "itemClick";
+
+    /** The default save button caption in the editor */
+    public static final String DEFAULT_SAVE_CAPTION = "Save";
+
+    /** The default cancel button caption in the editor */
+    public static final String DEFAULT_CANCEL_CAPTION = "Cancel";
+
+    /**
+     * Event ID constant for editor open event
+     */
+    public static final String EDITOR_OPEN_EVENT_ID = "editorOpen";
+
+    /**
+     * Event ID constant for editor move event
+     */
+    public static final String EDITOR_MOVE_EVENT_ID = "editorMove";
+
+    /**
+     * Event ID constant for editor close event
+     */
+    public static final String EDITOR_CLOSE_EVENT_ID = "editorClose";
+}
diff --git a/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/GridServerRpc.java b/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/GridServerRpc.java
new file mode 100644 (file)
index 0000000..7fcf461
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+ * 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.v7.shared.ui.grid;
+
+import java.util.List;
+
+import com.vaadin.shared.MouseEventDetails;
+import com.vaadin.shared.communication.ServerRpc;
+import com.vaadin.shared.data.sort.SortDirection;
+import com.vaadin.v7.shared.ui.grid.GridConstants.Section;
+
+/**
+ * Client-to-server RPC interface for the Grid component
+ *
+ * @since 7.4
+ * @author Vaadin Ltd
+ */
+public interface GridServerRpc extends ServerRpc {
+
+    void sort(String[] columnIds, SortDirection[] directions,
+            boolean userOriginated);
+
+    /**
+     * Informs the server that an item has been clicked in Grid.
+     *
+     * @param rowKey
+     *            a key identifying the clicked item
+     * @param columnId
+     *            column id identifying the clicked property
+     * @param details
+     *            mouse event details
+     */
+    void itemClick(String rowKey, String columnId, MouseEventDetails details);
+
+    /**
+     * Informs the server that a context click has happened inside of Grid.
+     *
+     * @since 7.6
+     * @param rowIndex
+     *            index of clicked row in Grid section
+     * @param rowKey
+     *            a key identifying the clicked item
+     * @param columnId
+     *            column id identifying the clicked property
+     * @param section
+     *            grid section (header, footer, body)
+     * @param details
+     *            mouse event details
+     */
+    void contextClick(int rowIndex, String rowKey, String columnId,
+            Section section, MouseEventDetails details);
+
+    /**
+     * Informs the server that the columns of the Grid have been reordered.
+     *
+     * @since 7.5.0
+     * @param newColumnOrder
+     *            a list of column ids in the new order
+     * @param oldColumnOrder
+     *            a list of column ids in order before the change
+     */
+    void columnsReordered(List<String> newColumnOrder,
+            List<String> oldColumnOrder);
+
+    /**
+     * Informs the server that a column's visibility has been changed.
+     *
+     * @since 7.5.0
+     * @param id
+     *            the id of the column
+     * @param hidden
+     *            <code>true</code> if hidden, <code>false</code> if unhidden
+     * @param userOriginated
+     *            <code>true</code> if triggered by user, <code>false</code> if
+     *            by code
+     */
+    void columnVisibilityChanged(String id, boolean hidden,
+            boolean userOriginated);
+
+    /**
+     * Informs the server that a column has been resized by the user.
+     *
+     * @since 7.6
+     * @param id
+     *            the id of the column
+     * @param pixels
+     *            the new width of the column in pixels
+     */
+    void columnResized(String id, double pixels);
+}
diff --git a/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/GridState.java b/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/GridState.java
new file mode 100644 (file)
index 0000000..4befc1f
--- /dev/null
@@ -0,0 +1,205 @@
+/*
+ * 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.v7.shared.ui.grid;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.vaadin.shared.annotations.DelegateToWidget;
+import com.vaadin.shared.data.sort.SortDirection;
+import com.vaadin.shared.ui.TabIndexState;
+
+/**
+ * The shared state for the {@link com.vaadin.ui.components.grid.Grid} component
+ *
+ * @since 7.4
+ * @author Vaadin Ltd
+ */
+public class GridState extends TabIndexState {
+
+    /**
+     * A description of which of the three bundled SelectionModels is currently
+     * in use.
+     * <p>
+     * Used as a data transfer object instead of the client/server ones, because
+     * they don't know about each others classes.
+     *
+     * @see com.vaadin.ui.components.grid.Grid.SelectionMode
+     * @see com.vaadin.client.ui.grid.Grid.SelectionMode
+     */
+    public enum SharedSelectionMode {
+        /**
+         * Representation of a single selection mode
+         *
+         * @see com.vaadin.ui.components.grid.Grid.SelectionMode#SINGLE
+         * @see com.vaadin.client.ui.grid.Grid.SelectionMode#SINGLE
+         */
+        SINGLE,
+
+        /**
+         * Representation of a multiselection mode
+         *
+         * @see com.vaadin.ui.components.grid.Grid.SelectionMode#MULTI
+         * @see com.vaadin.client.ui.grid.Grid.SelectionMode#MULTI
+         */
+        MULTI,
+
+        /**
+         * Representation of a no-selection mode
+         *
+         * @see com.vaadin.ui.components.grid.Grid.SelectionMode#NONE
+         * @see com.vaadin.client.ui.grid.Grid.SelectionMode#NONE
+         */
+        NONE;
+    }
+
+    /**
+     * The default value for height-by-rows for both GWT widgets
+     * {@link com.vaadin.ui.components.grid Grid} and
+     * {@link com.vaadin.client.ui.grid.Escalator Escalator}
+     */
+    public static final double DEFAULT_HEIGHT_BY_ROWS = 10.0d;
+
+    /**
+     * The key in which a row's data can be found
+     *
+     * @see com.vaadin.shared.data.DataProviderRpc#setRowData(int, String)
+     */
+    public static final String JSONKEY_DATA = "d";
+
+    /**
+     * The key in which a row's own key can be found
+     *
+     * @see com.vaadin.shared.data.DataProviderRpc#setRowData(int, String)
+     */
+    public static final String JSONKEY_ROWKEY = "k";
+
+    /**
+     * The key in which a row's generated style can be found
+     *
+     * @see com.vaadin.shared.data.DataProviderRpc#setRowData(int, String)
+     */
+    public static final String JSONKEY_ROWSTYLE = "rs";
+
+    /**
+     * The key in which a generated styles for a row's cells can be found
+     *
+     * @see com.vaadin.shared.data.DataProviderRpc#setRowData(int, String)
+     */
+    public static final String JSONKEY_CELLSTYLES = "cs";
+
+    /**
+     * The key in which a row's description can be found
+     *
+     * @since 7.6
+     * @see com.vaadin.shared.data.DataProviderRpc#setRowData(int, String)
+     */
+    public static final String JSONKEY_ROWDESCRIPTION = "rd";
+
+    /**
+     * The key in which a cell's description can be found
+     *
+     * @since 7.6
+     * @see com.vaadin.shared.data.DataProviderRpc#setRowData(int, String)
+     */
+    public static final String JSONKEY_CELLDESCRIPTION = "cd";
+
+    /**
+     * The key that tells whether details are visible for the row.
+     *
+     * @since 7.5.0
+     *
+     * @see com.vaadin.ui.Grid#setDetailsGenerator(com.vaadin.ui.Grid.DetailsGenerator)
+     * @see com.vaadin.ui.Grid#setDetailsVisible(Object, boolean)
+     * @see com.vaadin.shared.data.DataProviderRpc#setRowData(int,
+     *      elemental.json.JsonArray)
+     */
+    public static final String JSONKEY_DETAILS_VISIBLE = "dv";
+
+    /**
+     * The key that tells whether row is selected.
+     *
+     * @since 7.6
+     */
+    public static final String JSONKEY_SELECTED = "s";
+
+    {
+        primaryStyleName = "v-grid";
+    }
+
+    /**
+     * Columns in grid.
+     */
+    public List<GridColumnState> columns = new ArrayList<GridColumnState>();
+
+    /**
+     * Column order in grid.
+     */
+    public List<String> columnOrder = new ArrayList<String>();
+
+    public GridStaticSectionState header = new GridStaticSectionState();
+
+    public GridStaticSectionState footer = new GridStaticSectionState();
+
+    /** The number of frozen columns */
+    public int frozenColumnCount = 0;
+
+    /** The height of the Grid in terms of body rows. */
+    @DelegateToWidget
+    public double heightByRows = DEFAULT_HEIGHT_BY_ROWS;
+
+    /** The mode by which Grid defines its height. */
+    @DelegateToWidget
+    public HeightMode heightMode = HeightMode.CSS;
+
+    /** Keys of the currently sorted columns */
+    public String[] sortColumns = new String[0];
+
+    /** Directions for each sorted column */
+    public SortDirection[] sortDirs = new SortDirection[0];
+
+    /** The enabled state of the editor interface */
+    public boolean editorEnabled = false;
+
+    /**
+     * Buffered editor mode
+     *
+     * @since 7.6
+     */
+    @DelegateToWidget
+    public boolean editorBuffered = true;
+
+    /**
+     * Whether rows and/or cells have generated descriptions (tooltips)
+     *
+     * @since 7.6
+     */
+    public boolean hasDescriptions;
+
+    /** The caption for the save button in the editor */
+    @DelegateToWidget
+    public String editorSaveCaption = GridConstants.DEFAULT_SAVE_CAPTION;
+
+    /** The caption for the cancel button in the editor */
+    @DelegateToWidget
+    public String editorCancelCaption = GridConstants.DEFAULT_CANCEL_CAPTION;
+
+    /** Whether the columns can be reordered */
+    @DelegateToWidget
+    public boolean columnReorderingAllowed;
+
+}
diff --git a/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/GridStaticCellType.java b/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/GridStaticCellType.java
new file mode 100644 (file)
index 0000000..70da93f
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * 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.v7.shared.ui.grid;
+
+/**
+ * Enumeration, specifying the content type of a Cell in a GridStaticSection.
+ *
+ * @since 7.4
+ * @author Vaadin Ltd
+ */
+public enum GridStaticCellType {
+    /**
+     * Text content
+     */
+    TEXT,
+
+    /**
+     * HTML content
+     */
+    HTML,
+
+    /**
+     * Widget content
+     */
+    WIDGET;
+}
diff --git a/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/GridStaticSectionState.java b/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/GridStaticSectionState.java
new file mode 100644 (file)
index 0000000..560f0f1
--- /dev/null
@@ -0,0 +1,68 @@
+/*
+ * 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.v7.shared.ui.grid;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import com.vaadin.shared.Connector;
+
+/**
+ * Shared state for Grid headers and footers.
+ *
+ * @since 7.4
+ * @author Vaadin Ltd
+ */
+public class GridStaticSectionState implements Serializable {
+
+    public static class CellState implements Serializable {
+        public String text = "";
+
+        public String html = "";
+
+        public Connector connector = null;
+
+        public GridStaticCellType type = GridStaticCellType.TEXT;
+
+        public String columnId;
+
+        public String styleName = null;
+    }
+
+    public static class RowState implements Serializable {
+        public List<CellState> cells = new ArrayList<CellState>();
+
+        public boolean defaultRow = false;
+
+        /**
+         * Map from column id set to cell state for merged state.
+         */
+        public Map<Set<String>, CellState> cellGroups = new HashMap<Set<String>, CellState>();
+
+        /**
+         * The style name for the row. Null if none.
+         */
+        public String styleName = null;
+    }
+
+    public List<RowState> rows = new ArrayList<RowState>();
+
+    public boolean visible = true;
+}
diff --git a/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/HeightMode.java b/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/HeightMode.java
new file mode 100644 (file)
index 0000000..2647a17
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * 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.v7.shared.ui.grid;
+
+/**
+ * The modes for height calculation that are supported by Grid (
+ * {@link com.vaadin.client.ui.grid.Grid client} and
+ * {@link com.vaadin.ui.components.grid.Grid server}) /
+ * {@link com.vaadin.client.ui.grid.Escalator Escalator}.
+ *
+ * @since 7.4
+ * @author Vaadin Ltd
+ * @see com.vaadin.client.ui.grid.Grid#setHeightMode(HeightMode)
+ * @see com.vaadin.ui.components.grid.Grid#setHeightMode(HeightMode)
+ * @see com.vaadin.client.ui.grid.Escalator#setHeightMode(HeightMode)
+ */
+public enum HeightMode {
+    /**
+     * The height of the Component or Widget is defined by a CSS-like value.
+     * (e.g. "100px", "50em" or "25%")
+     */
+    CSS,
+
+    /**
+     * The height of the Component or Widget in question is defined by a number
+     * of rows.
+     */
+    ROW,
+
+    /**
+     * The height of the Component or Widget in question is defined by its
+     * contents.
+     */
+    UNDEFINED;
+}
diff --git a/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/ScrollDestination.java b/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/ScrollDestination.java
new file mode 100644 (file)
index 0000000..faa212c
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * 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.v7.shared.ui.grid;
+
+/**
+ * Enumeration, specifying the destinations that are supported when scrolling
+ * rows or columns into view.
+ *
+ * @since 7.4
+ * @author Vaadin Ltd
+ */
+public enum ScrollDestination {
+
+    /**
+     * Scroll as little as possible to show the target element. If the element
+     * fits into view, this works as START or END depending on the current
+     * scroll position. If the element does not fit into view, this works as
+     * START.
+     */
+    ANY,
+
+    /**
+     * Scrolls so that the element is shown at the start of the viewport. The
+     * viewport will, however, not scroll beyond its contents.
+     */
+    START,
+
+    /**
+     * Scrolls so that the element is shown in the middle of the viewport. The
+     * viewport will, however, not scroll beyond its contents, given more
+     * elements than what the viewport is able to show at once. Under no
+     * circumstances will the viewport scroll before its first element.
+     */
+    MIDDLE,
+
+    /**
+     * Scrolls so that the element is shown at the end of the viewport. The
+     * viewport will, however, not scroll before its first element.
+     */
+    END
+
+}
diff --git a/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/renderers/RendererClickRpc.java b/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/renderers/RendererClickRpc.java
new file mode 100644 (file)
index 0000000..cad4a1a
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * 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.v7.shared.ui.grid.renderers;
+
+import com.vaadin.shared.MouseEventDetails;
+import com.vaadin.shared.communication.ServerRpc;
+
+public interface RendererClickRpc extends ServerRpc {
+    /**
+     * Called when a click event has occurred and there are server side
+     * listeners for the event.
+     *
+     * @param mouseDetails
+     *            Details about the mouse when the event took place
+     */
+    public void click(String rowKey, String columnId,
+            MouseEventDetails mouseDetails);
+}
diff --git a/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/selection/MultiSelectionModelServerRpc.java b/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/selection/MultiSelectionModelServerRpc.java
new file mode 100644 (file)
index 0000000..ba8ed0f
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * 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.v7.shared.ui.grid.selection;
+
+import java.util.List;
+
+import com.vaadin.shared.communication.ServerRpc;
+
+/**
+ * ServerRpc for MultiSelectionModel.
+ *
+ * @since 7.6
+ * @author Vaadin Ltd
+ */
+public interface MultiSelectionModelServerRpc extends ServerRpc {
+
+    /**
+     * Select a list of rows based on their row keys on the server-side.
+     *
+     * @param rowKeys
+     *            list of row keys to select
+     */
+    public void select(List<String> rowKeys);
+
+    /**
+     * Deselect a list of rows based on their row keys on the server-side.
+     *
+     * @param rowKeys
+     *            list of row keys to deselect
+     */
+    public void deselect(List<String> rowKeys);
+
+    /**
+     * Selects all rows on the server-side.
+     */
+    public void selectAll();
+
+    /**
+     * Deselects all rows on the server-side.
+     */
+    public void deselectAll();
+}
diff --git a/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/selection/MultiSelectionModelState.java b/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/selection/MultiSelectionModelState.java
new file mode 100644 (file)
index 0000000..c04d9aa
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * 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.v7.shared.ui.grid.selection;
+
+import com.vaadin.shared.communication.SharedState;
+
+/**
+ * SharedState object for MultiSelectionModel.
+ *
+ * @since 7.6
+ * @author Vaadin Ltd
+ */
+public class MultiSelectionModelState extends SharedState {
+
+    /* Select All -checkbox status */
+    public boolean allSelected;
+
+}
diff --git a/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/selection/SingleSelectionModelServerRpc.java b/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/selection/SingleSelectionModelServerRpc.java
new file mode 100644 (file)
index 0000000..a5561f4
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * 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.v7.shared.ui.grid.selection;
+
+import com.vaadin.shared.communication.ServerRpc;
+
+/**
+ * ServerRpc for SingleSelectionModel.
+ *
+ * @since 7.6
+ * @author Vaadin Ltd
+ */
+public interface SingleSelectionModelServerRpc extends ServerRpc {
+
+    /**
+     * Selects a row on server-side.
+     *
+     * @param rowKey
+     *            row key of selected row; {@code null} if deselect
+     */
+    public void select(String rowKey);
+}
diff --git a/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/selection/SingleSelectionModelState.java b/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/selection/SingleSelectionModelState.java
new file mode 100644 (file)
index 0000000..a9fb816
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * 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.v7.shared.ui.grid.selection;
+
+import com.vaadin.shared.communication.SharedState;
+
+/**
+ * SharedState object for SingleSelectionModel.
+ *
+ * @since 7.6
+ * @author Vaadin Ltd
+ */
+public class SingleSelectionModelState extends SharedState {
+
+    /* Allow deselecting rows */
+    public boolean deselectAllowed = true;
+}
index 14d179017fbebc8611cbde81f6ca83ee2de7ca10..f5caf9431eadeb2aef62666c58bce061bd3e052a 100644 (file)
@@ -20,7 +20,6 @@ import java.util.HashMap;
 import java.util.Map;
 
 import com.vaadin.server.VaadinRequest;
-import com.vaadin.shared.ui.grid.HeightMode;
 import com.vaadin.tests.components.AbstractTestUI;
 import com.vaadin.ui.Alignment;
 import com.vaadin.ui.Component;
@@ -31,6 +30,7 @@ import com.vaadin.v7.data.Property.ValueChangeEvent;
 import com.vaadin.v7.data.Property.ValueChangeListener;
 import com.vaadin.v7.event.ItemClickEvent;
 import com.vaadin.v7.event.ItemClickEvent.ItemClickListener;
+import com.vaadin.v7.shared.ui.grid.HeightMode;
 import com.vaadin.v7.ui.Grid;
 import com.vaadin.v7.ui.Grid.DetailsGenerator;
 import com.vaadin.v7.ui.Grid.RowReference;
index f47052bff8ca0fb13665bac3631e2bb48e9f9d91..091cc45ff30698796c4714830a24022f18cd3458 100644 (file)
@@ -4,11 +4,11 @@ import java.util.Arrays;
 import java.util.List;
 
 import com.vaadin.server.VaadinRequest;
-import com.vaadin.shared.ui.grid.HeightMode;
 import com.vaadin.tests.components.AbstractTestUI;
 import com.vaadin.ui.TabSheet;
 import com.vaadin.ui.VerticalLayout;
 import com.vaadin.v7.data.Property;
+import com.vaadin.v7.shared.ui.grid.HeightMode;
 import com.vaadin.v7.ui.Grid;
 import com.vaadin.v7.ui.NativeSelect;
 
index f7dcf61cbe5108b9ba08bb7ae51d628f57cb47e6..8ed3f4e9f86085c2e81126a3be5a132b2bf46a84 100644 (file)
@@ -16,7 +16,6 @@
 package com.vaadin.tests.components.grid;
 
 import com.vaadin.server.VaadinRequest;
-import com.vaadin.shared.ui.grid.ScrollDestination;
 import com.vaadin.tests.components.AbstractTestUI;
 import com.vaadin.ui.Button;
 import com.vaadin.ui.Button.ClickEvent;
@@ -25,6 +24,7 @@ import com.vaadin.ui.HorizontalLayout;
 import com.vaadin.ui.VerticalLayout;
 import com.vaadin.v7.data.Item;
 import com.vaadin.v7.data.util.IndexedContainer;
+import com.vaadin.v7.shared.ui.grid.ScrollDestination;
 import com.vaadin.v7.ui.Grid;
 
 @SuppressWarnings("serial")
index b04f6a5a9c36a92e0cd9c60525a2077442325240..f18b6408b89338fc8ca2ba3fe588cebf246bc3de 100644 (file)
@@ -35,8 +35,6 @@ import com.vaadin.event.SelectionEvent.SelectionListener;
 import com.vaadin.event.SortEvent;
 import com.vaadin.event.SortEvent.SortListener;
 import com.vaadin.shared.data.sort.SortDirection;
-import com.vaadin.shared.ui.grid.GridStaticCellType;
-import com.vaadin.shared.ui.grid.HeightMode;
 import com.vaadin.tests.components.AbstractComponentTest;
 import com.vaadin.ui.Button;
 import com.vaadin.ui.Button.ClickEvent;
@@ -55,6 +53,8 @@ import com.vaadin.v7.data.fieldgroup.FieldGroup.CommitException;
 import com.vaadin.v7.data.util.IndexedContainer;
 import com.vaadin.v7.event.ItemClickEvent;
 import com.vaadin.v7.event.ItemClickEvent.ItemClickListener;
+import com.vaadin.v7.shared.ui.grid.GridStaticCellType;
+import com.vaadin.v7.shared.ui.grid.HeightMode;
 import com.vaadin.v7.ui.Field;
 import com.vaadin.v7.ui.Grid;
 import com.vaadin.v7.ui.Grid.CellDescriptionGenerator;
index 8dd1b6785635bb28eb4b41c35458df4a87eec59b..bd43bc5065146847956c968eeebf445fed693223 100644 (file)
@@ -18,10 +18,10 @@ package com.vaadin.tests.components.grid.basicfeatures;
 import com.vaadin.annotations.Theme;
 import com.vaadin.annotations.Title;
 import com.vaadin.server.VaadinRequest;
-import com.vaadin.shared.ui.grid.HeightMode;
 import com.vaadin.ui.UI;
 import com.vaadin.ui.themes.ValoTheme;
 import com.vaadin.v7.data.Container;
+import com.vaadin.v7.shared.ui.grid.HeightMode;
 import com.vaadin.v7.ui.Grid;
 
 @Title("Server Grid height by row on init")
index 487772a8d04135c7bd344b8f07f6985c2a6ebef7..22c0331059c39a49a26c962189a2d2f4b0c04be5 100644 (file)
  */
 package com.vaadin.tests.contextclick;
 
-import com.vaadin.shared.ui.grid.GridConstants.Section;
 import com.vaadin.tests.util.PersonContainer;
 import com.vaadin.ui.Button;
 import com.vaadin.ui.Button.ClickEvent;
 import com.vaadin.ui.HorizontalLayout;
 import com.vaadin.v7.data.Item;
+import com.vaadin.v7.shared.ui.grid.GridConstants.Section;
 import com.vaadin.v7.ui.Grid;
 import com.vaadin.v7.ui.Grid.GridContextClickEvent;
 
index ed9fe507f7b918f99cb994c3893d950b5ee2429e..21261875b32601215a42ddb5bad5d5523ee51738 100644 (file)
@@ -17,8 +17,8 @@ package com.vaadin.tests.minitutorials.v7_4;
 
 import com.vaadin.annotations.Theme;
 import com.vaadin.server.VaadinRequest;
-import com.vaadin.shared.ui.grid.HeightMode;
 import com.vaadin.ui.UI;
+import com.vaadin.v7.shared.ui.grid.HeightMode;
 import com.vaadin.v7.ui.Grid;
 
 @Theme("valo")
index fee6f93b731928d04929599519bffb8533f82f84..c15c1c6070019b1146407e7ef6c71285e56d4eb3 100644 (file)
@@ -9,7 +9,6 @@ import com.google.gwt.dom.client.TableCellElement;
 import com.google.gwt.user.client.DOM;
 import com.google.gwt.user.client.ui.Composite;
 import com.google.gwt.user.client.ui.HTML;
-import com.vaadin.shared.ui.grid.ScrollDestination;
 import com.vaadin.v7.client.widget.escalator.EscalatorUpdater;
 import com.vaadin.v7.client.widget.escalator.FlyweightCell;
 import com.vaadin.v7.client.widget.escalator.Row;
@@ -18,6 +17,7 @@ import com.vaadin.v7.client.widget.escalator.Spacer;
 import com.vaadin.v7.client.widget.escalator.SpacerUpdater;
 import com.vaadin.v7.client.widget.escalator.RowContainer.BodyRowContainer;
 import com.vaadin.v7.client.widgets.Escalator;
+import com.vaadin.v7.shared.ui.grid.ScrollDestination;
 
 public class EscalatorBasicClientFeaturesWidget
         extends PureGWTTestApplication<Escalator> {
index a168e78d544f537e9fd994a3a5b8f75b95c83da2..7edba039e13721d6e4dc8b2497ef8d6c0f4d1290 100644 (file)
@@ -47,7 +47,6 @@ import com.google.gwt.user.client.ui.Widget;
 import com.vaadin.client.data.DataSource;
 import com.vaadin.client.data.DataSource.RowHandle;
 import com.vaadin.client.ui.VLabel;
-import com.vaadin.shared.ui.grid.ScrollDestination;
 import com.vaadin.tests.widgetset.client.grid.GridBasicClientFeaturesWidget.Data;
 import com.vaadin.v7.client.renderers.DateRenderer;
 import com.vaadin.v7.client.renderers.HtmlRenderer;
@@ -89,6 +88,7 @@ import com.vaadin.v7.client.widgets.Grid.Column;
 import com.vaadin.v7.client.widgets.Grid.FooterRow;
 import com.vaadin.v7.client.widgets.Grid.HeaderRow;
 import com.vaadin.v7.client.widgets.Grid.SelectionMode;
+import com.vaadin.v7.shared.ui.grid.ScrollDestination;
 
 /**
  * Grid basic client features test application.
index db33a92594054b21bfc5d5e665fb2f864749056b..2ed5e171448c019c7deaf9aedcd541682ba12507 100644 (file)
  */
 package com.vaadin.tests.widgetset.client.grid;
 
-import com.vaadin.shared.ui.grid.HeightMode;
 import com.vaadin.v7.client.widget.grid.datasources.ListDataSource;
 import com.vaadin.v7.client.widgets.Grid;
 import com.vaadin.v7.client.widgets.Grid.Column;
 import com.vaadin.v7.client.widgets.Grid.SelectionMode;
+import com.vaadin.v7.shared.ui.grid.HeightMode;
 
 public class GridDefaultTextRendererWidget
         extends PureGWTTestApplication<Grid<String>> {
index 6654f7b3d753f59c5722bf86ed8fedc1c6c343e5..b740090c9e53a4afe8d14a9332287b974fe553e2 100644 (file)
@@ -4,10 +4,10 @@ import java.util.Arrays;
 
 import com.google.gwt.user.client.ui.Composite;
 import com.google.gwt.user.client.ui.SimplePanel;
-import com.vaadin.shared.ui.grid.HeightMode;
 import com.vaadin.v7.client.widget.grid.datasources.ListDataSource;
 import com.vaadin.v7.client.widgets.Grid;
 import com.vaadin.v7.client.widgets.Grid.Column;
+import com.vaadin.v7.shared.ui.grid.HeightMode;
 
 public class GridHeightByRowOnInitWidget extends Composite {
     private final SimplePanel panel = new SimplePanel();
index 430a8ad5ce1187590a8e509aa385b7b822b3adac..ed15f13f347ad890e7ef99627fb7c9f66abcb0bc 100644 (file)
@@ -31,12 +31,12 @@ import org.openqa.selenium.NoSuchElementException;
 import org.openqa.selenium.WebElement;
 
 import com.vaadin.shared.ui.grid.Range;
-import com.vaadin.shared.ui.grid.ScrollDestination;
 import com.vaadin.testbench.By;
 import com.vaadin.testbench.ElementQuery;
 import com.vaadin.testbench.TestBenchElement;
 import com.vaadin.testbench.customelements.FixedNotificationElement;
 import com.vaadin.tests.components.grid.basicfeatures.GridBasicClientFeaturesTest;
+import com.vaadin.v7.shared.ui.grid.ScrollDestination;
 
 public class GridDetailsClientTest extends GridBasicClientFeaturesTest {
 
index fee503f6dc4cf9253b2cf7a581cd73f04c4c4cce..abbd954b9b03ead42cafa7b9b673c902c2455476 100644 (file)
@@ -32,12 +32,12 @@ import org.openqa.selenium.NoSuchElementException;
 import org.openqa.selenium.WebElement;
 import org.openqa.selenium.interactions.Actions;
 
-import com.vaadin.shared.ui.grid.GridConstants;
 import com.vaadin.testbench.elements.GridElement.GridCellElement;
 import com.vaadin.testbench.elements.GridElement.GridEditorElement;
 import com.vaadin.testbench.parallel.BrowserUtil;
 import com.vaadin.tests.components.grid.basicfeatures.GridBasicClientFeaturesTest;
 import com.vaadin.tests.components.grid.basicfeatures.GridBasicFeatures;
+import com.vaadin.v7.shared.ui.grid.GridConstants;
 
 public class GridEditorClientTest extends GridBasicClientFeaturesTest {
 
index 452dfb681db7089b4fbc98e4c03ba00c242f6c29..923592fc3147290cac804c6ebd04203150e387c3 100644 (file)
@@ -28,10 +28,10 @@ import org.openqa.selenium.NoSuchElementException;
 import org.openqa.selenium.WebElement;
 import org.openqa.selenium.interactions.Actions;
 
-import com.vaadin.shared.ui.grid.GridConstants;
 import com.vaadin.testbench.TestBenchElement;
 import com.vaadin.testbench.elements.GridElement.GridCellElement;
 import com.vaadin.testbench.elements.GridElement.GridEditorElement;
+import com.vaadin.v7.shared.ui.grid.GridConstants;
 import com.vaadin.testbench.elements.NotificationElement;
 
 public class GridEditorBufferedTest extends GridEditorTest {