diff options
author | elmot <elmot@vaadin.com> | 2016-08-18 11:32:19 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2016-08-18 09:34:17 +0000 |
commit | 86cee1ad6bd8e8d9ab3e9128c9b3d0059266fde6 (patch) | |
tree | a174998f7a06a8d050ebedc34df42c8c45c84134 | |
parent | 7f80616bec4874b70e6fc5245925d7ca0b0cfd98 (diff) | |
download | vaadin-framework-86cee1ad6bd8e8d9ab3e9128c9b3d0059266fde6.tar.gz vaadin-framework-86cee1ad6bd8e8d9ab3e9128c9b3d0059266fde6.zip |
Rename Grid into LegacyGrid
Change-Id: Ie99e3a5af908ada42a6d0eba421241ad65c0d6b4
200 files changed, 5413 insertions, 5379 deletions
diff --git a/client/src/main/java/com/vaadin/client/connectors/DetailComponentManagerConnector.java b/client/src/main/java/com/vaadin/client/connectors/DetailComponentManagerConnector.java index 2400fce2f8..000a24af00 100644 --- a/client/src/main/java/com/vaadin/client/connectors/DetailComponentManagerConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/DetailComponentManagerConnector.java @@ -18,7 +18,7 @@ package com.vaadin.client.connectors; import com.vaadin.client.ServerConnector; import com.vaadin.client.extensions.AbstractExtensionConnector; import com.vaadin.shared.ui.Connect; -import com.vaadin.ui.Grid.DetailComponentManager; +import com.vaadin.ui.LegacyGrid.DetailComponentManager; /** * Client-side connector for the DetailComponentManager of Grid. diff --git a/client/src/main/java/com/vaadin/client/connectors/GridConnector.java b/client/src/main/java/com/vaadin/client/connectors/GridConnector.java index 07b2bad04b..5ad90b7a45 100644 --- a/client/src/main/java/com/vaadin/client/connectors/GridConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/GridConnector.java @@ -96,6 +96,7 @@ 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.ui.LegacyGrid; import elemental.json.JsonObject; import elemental.json.JsonValue; @@ -110,7 +111,7 @@ import elemental.json.JsonValue; * @since 7.4 * @author Vaadin Ltd */ -@Connect(com.vaadin.ui.Grid.class) +@Connect(LegacyGrid.class) public class GridConnector extends AbstractHasComponentsConnector implements SimpleManagedLayout, DeferredWorker { diff --git a/client/src/main/java/com/vaadin/client/connectors/MultiSelectionModelConnector.java b/client/src/main/java/com/vaadin/client/connectors/MultiSelectionModelConnector.java index 9fd1efadf6..e7494737cb 100644 --- a/client/src/main/java/com/vaadin/client/connectors/MultiSelectionModelConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/MultiSelectionModelConnector.java @@ -46,7 +46,7 @@ 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.ui.Grid.MultiSelectionModel; +import com.vaadin.ui.LegacyGrid.MultiSelectionModel; import elemental.json.JsonObject; diff --git a/client/src/main/java/com/vaadin/client/connectors/NoSelectionModelConnector.java b/client/src/main/java/com/vaadin/client/connectors/NoSelectionModelConnector.java index 78e84da802..1a080f5082 100644 --- a/client/src/main/java/com/vaadin/client/connectors/NoSelectionModelConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/NoSelectionModelConnector.java @@ -19,7 +19,7 @@ import com.vaadin.client.ServerConnector; import com.vaadin.client.widget.grid.selection.SelectionModel; import com.vaadin.client.widget.grid.selection.SelectionModelNone; import com.vaadin.shared.ui.Connect; -import com.vaadin.ui.Grid.NoSelectionModel; +import com.vaadin.ui.LegacyGrid.NoSelectionModel; import elemental.json.JsonObject; diff --git a/client/src/main/java/com/vaadin/client/connectors/SingleSelectionModelConnector.java b/client/src/main/java/com/vaadin/client/connectors/SingleSelectionModelConnector.java index c864616d37..980c4458d4 100644 --- a/client/src/main/java/com/vaadin/client/connectors/SingleSelectionModelConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/SingleSelectionModelConnector.java @@ -27,7 +27,7 @@ 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.ui.Grid.SingleSelectionModel; +import com.vaadin.ui.LegacyGrid.SingleSelectionModel; import elemental.json.JsonObject; diff --git a/server/src/main/java/com/vaadin/server/communication/data/DataGenerator.java b/server/src/main/java/com/vaadin/server/communication/data/DataGenerator.java index 0c07c36810..f7459a7dd3 100644 --- a/server/src/main/java/com/vaadin/server/communication/data/DataGenerator.java +++ b/server/src/main/java/com/vaadin/server/communication/data/DataGenerator.java @@ -18,7 +18,7 @@ package com.vaadin.server.communication.data; import java.io.Serializable; import com.vaadin.data.Item; -import com.vaadin.ui.Grid.AbstractGridExtension; +import com.vaadin.ui.LegacyGrid.AbstractGridExtension; import elemental.json.JsonObject; diff --git a/server/src/main/java/com/vaadin/server/communication/data/RpcDataProviderExtension.java b/server/src/main/java/com/vaadin/server/communication/data/RpcDataProviderExtension.java index 6ab41ab514..341c3f1a45 100644 --- a/server/src/main/java/com/vaadin/server/communication/data/RpcDataProviderExtension.java +++ b/server/src/main/java/com/vaadin/server/communication/data/RpcDataProviderExtension.java @@ -45,8 +45,8 @@ 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.ui.Grid; -import com.vaadin.ui.Grid.Column; +import com.vaadin.ui.LegacyGrid; +import com.vaadin.ui.LegacyGrid.Column; import elemental.json.Json; import elemental.json.JsonArray; @@ -151,7 +151,7 @@ public class RpcDataProviderExtension extends AbstractExtension { /** * A class to listen to changes in property values in the Container added - * with {@link Grid#setContainerDatasource(Container.Indexed)}, and notifies + * with {@link LegacyGrid#setContainerDatasource(Container.Indexed)}, and notifies * the data source to update the client-side representation of the modified * item. * <p> @@ -164,8 +164,8 @@ public class RpcDataProviderExtension extends AbstractExtension { * value changes, an instance of this class needs to be attached to each and * every Item's Property in the container. * - * @see Grid#addValueChangeListener(Container, Object, Object) - * @see Grid#valueChangeListeners + * @see LegacyGrid#addValueChangeListener(Container, Object, Object) + * @see LegacyGrid#valueChangeListeners */ private class GridValueChangeListener implements ValueChangeListener { private final Object itemId; @@ -408,14 +408,14 @@ public class RpcDataProviderExtension extends AbstractExtension { } /** - * Makes the data source available to the given {@link Grid} component. + * Makes the data source available to the given {@link LegacyGrid} component. * * @param component * the remote data grid component to extend * @param columnKeys * the key mapper for columns */ - public void extend(Grid component) { + public void extend(LegacyGrid component) { super.extend(component); } @@ -568,7 +568,7 @@ public class RpcDataProviderExtension extends AbstractExtension { .removeItemSetChangeListener(itemListener); } - } else if (!(parent instanceof Grid)) { + } else if (!(parent instanceof LegacyGrid)) { throw new IllegalStateException( "Grid is the only accepted parent type"); } @@ -626,7 +626,7 @@ public class RpcDataProviderExtension extends AbstractExtension { return activeItemHandler.keyMapper; } - protected Grid getGrid() { - return (Grid) getParent(); + protected LegacyGrid getGrid() { + return (LegacyGrid) getParent(); } } diff --git a/server/src/main/java/com/vaadin/ui/Grid.java b/server/src/main/java/com/vaadin/ui/LegacyGrid.java index 8bb8116647..2212568587 100644 --- a/server/src/main/java/com/vaadin/ui/Grid.java +++ b/server/src/main/java/com/vaadin/ui/LegacyGrid.java @@ -181,7 +181,7 @@ import elemental.json.JsonValue; * @since 7.4 * @author Vaadin Ltd */ -public class Grid extends AbstractFocusable implements SelectionNotifier, +public class LegacyGrid extends AbstractFocusable implements SelectionNotifier, SortNotifier, SelectiveRenderer, ItemClickNotifier { /** @@ -223,7 +223,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * <code>true</code> iff the event was triggered by an UI * interaction */ - public ColumnVisibilityChangeEvent(Grid source, Column column, + public ColumnVisibilityChangeEvent(LegacyGrid source, Column column, boolean hidden, boolean isUserOriginated) { super(source); this.column = column; @@ -335,11 +335,11 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, */ private final Set<Object> openDetails = new HashSet<>(); - public DetailComponentManager(Grid grid) { + public DetailComponentManager(LegacyGrid grid) { this(grid, DetailsGenerator.NULL); } - public DetailComponentManager(Grid grid, + public DetailComponentManager(LegacyGrid grid, DetailsGenerator detailsGenerator) { super(grid); setDetailsGenerator(detailsGenerator); @@ -349,7 +349,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * Creates a details component with the help of the user-defined * {@link DetailsGenerator}. * <p> - * This method attaches created components to the parent {@link Grid}. + * This method attaches created components to the parent {@link LegacyGrid}. * * @param itemId * the item id for which to create the details component. @@ -397,7 +397,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Destroys a details component correctly. * <p> - * This method will detach the component from parent {@link Grid}. + * This method will detach the component from parent {@link LegacyGrid}. * * @param itemId * the item id for which to destroy the details component @@ -631,7 +631,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, private final Object propertyId; private final Section section; - public GridContextClickEvent(Grid source, + public GridContextClickEvent(LegacyGrid source, MouseEventDetails mouseEventDetails, Section section, int rowIndex, Object itemId, Object propertyId) { super(source, mouseEventDetails); @@ -672,7 +672,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * Returns the clicked row index relative to Grid section. In the body * of the Grid the index is the item index in the Container. Header and * Footer rows for index can be fetched with - * {@link Grid#getHeaderRow(int)} and {@link Grid#getFooterRow(int)}. + * {@link LegacyGrid#getHeaderRow(int)} and {@link LegacyGrid#getFooterRow(int)}. * * @return row index in section */ @@ -681,8 +681,8 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, } @Override - public Grid getComponent() { - return (Grid) super.getComponent(); + public LegacyGrid getComponent() { + return (LegacyGrid) super.getComponent(); } } @@ -697,7 +697,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, private String userErrorMessage; - public CommitErrorEvent(Grid grid, CommitException cause) { + public CommitErrorEvent(LegacyGrid grid, CommitException cause) { super(grid); this.cause = cause; userErrorMessage = cause.getLocalizedMessage(); @@ -713,8 +713,8 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, } @Override - public Grid getComponent() { - return (Grid) super.getComponent(); + public LegacyGrid getComponent() { + return (LegacyGrid) super.getComponent(); } /** @@ -800,7 +800,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * <code>true</code> if event is a result of user * interaction, <code>false</code> if from API call */ - public ColumnReorderEvent(Grid source, boolean userOriginated) { + public ColumnReorderEvent(LegacyGrid source, boolean userOriginated) { super(source); this.userOriginated = userOriginated; } @@ -852,7 +852,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * <code>true</code> if event is a result of user * interaction, <code>false</code> if from API call */ - public ColumnResizeEvent(Grid source, Column column, + public ColumnResizeEvent(LegacyGrid source, Column column, boolean userOriginated) { super(source); this.column = column; @@ -926,7 +926,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, private Object itemID; - protected EditorEvent(Grid source, Object itemID) { + protected EditorEvent(LegacyGrid source, Object itemID) { super(source); this.itemID = itemID; } @@ -945,7 +945,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, */ public static class EditorOpenEvent extends EditorEvent { - public EditorOpenEvent(Grid source, Object itemID) { + public EditorOpenEvent(LegacyGrid source, Object itemID) { super(source, itemID); } } @@ -956,7 +956,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, */ public static class EditorMoveEvent extends EditorEvent { - public EditorMoveEvent(Grid source, Object itemID) { + public EditorMoveEvent(LegacyGrid source, Object itemID) { super(source, itemID); } } @@ -967,7 +967,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, */ public static class EditorCloseEvent extends EditorEvent { - public EditorCloseEvent(Grid source, Object itemID) { + public EditorCloseEvent(LegacyGrid source, Object itemID) { super(source, itemID); } } @@ -1012,8 +1012,8 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, event.setUserErrorMessage(caption + ": " + message); } else { - com.vaadin.server.ErrorEvent.findErrorHandler(Grid.this).error( - new ConnectorErrorEvent(Grid.this, event.getCause())); + com.vaadin.server.ErrorEvent.findErrorHandler(LegacyGrid.this).error( + new ConnectorErrorEvent(LegacyGrid.this, event.getCause())); } } @@ -1032,15 +1032,15 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * Selection modes representing built-in {@link SelectionModel - * SelectionModels} that come bundled with {@link Grid}. + * SelectionModels} that come bundled with {@link LegacyGrid}. * <p> * Passing one of these enums into - * {@link Grid#setSelectionMode(SelectionMode)} is equivalent to calling - * {@link Grid#setSelectionModel(SelectionModel)} with one of the built-in + * {@link LegacyGrid#setSelectionMode(SelectionMode)} is equivalent to calling + * {@link LegacyGrid#setSelectionModel(SelectionModel)} with one of the built-in * implementations of {@link SelectionModel}. * - * @see Grid#setSelectionMode(SelectionMode) - * @see Grid#setSelectionModel(SelectionModel) + * @see LegacyGrid#setSelectionMode(SelectionMode) + * @see LegacyGrid#setSelectionModel(SelectionModel) */ public enum SelectionMode { /** A SelectionMode that maps to {@link SingleSelectionModel} */ @@ -1093,7 +1093,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, Collection<Object> getSelectedRows(); /** - * Injects the current {@link Grid} instance into the SelectionModel. + * Injects the current {@link LegacyGrid} instance into the SelectionModel. * This method should usually call the extend method of * {@link AbstractExtension}. * <p> @@ -1104,7 +1104,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * <code>null</code> when a selection model is being detached * from a Grid. */ - void setGrid(Grid grid); + void setGrid(LegacyGrid grid); /** * Resets the SelectiomModel to an initial state. @@ -1352,7 +1352,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, } @Override - public void setGrid(final Grid grid) { + public void setGrid(final LegacyGrid grid) { if (grid != null) { extend(grid); } @@ -1891,7 +1891,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * A data class which contains information which identifies a row in a - * {@link Grid}. + * {@link LegacyGrid}. * <p> * Since this class follows the <code>Flyweight</code>-pattern any instance * of this object is subject to change without the user knowing it and so @@ -1899,7 +1899,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * instances. */ public static class RowReference implements Serializable { - private final Grid grid; + private final LegacyGrid grid; private Object itemId; @@ -1909,7 +1909,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * @param grid * the grid that the row belongs to */ - public RowReference(Grid grid) { + public RowReference(LegacyGrid grid) { this.grid = grid; } @@ -1928,7 +1928,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * * @return the grid that contains referenced row */ - public Grid getGrid() { + public LegacyGrid getGrid() { return grid; } @@ -1953,7 +1953,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * A data class which contains information which identifies a cell in a - * {@link Grid}. + * {@link LegacyGrid}. * <p> * Since this class follows the <code>Flyweight</code>-pattern any instance * of this object is subject to change without the user knowing it and so @@ -1984,7 +1984,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * * @return the grid that contains referenced cell */ - public Grid getGrid() { + public LegacyGrid getGrid() { return rowReference.getGrid(); } @@ -2033,7 +2033,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * A callback interface for generating custom style names for Grid rows. * - * @see Grid#setRowStyleGenerator(RowStyleGenerator) + * @see LegacyGrid#setRowStyleGenerator(RowStyleGenerator) */ public interface RowStyleGenerator extends Serializable { @@ -2051,7 +2051,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * A callback interface for generating custom style names for Grid cells. * - * @see Grid#setCellStyleGenerator(CellStyleGenerator) + * @see LegacyGrid#setCellStyleGenerator(CellStyleGenerator) */ public interface CellStyleGenerator extends Serializable { @@ -2072,7 +2072,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * the cells in the row for which a {@link CellDescriptionGenerator cell * description} is not generated. * - * @see Grid#setRowDescriptionGenerator + * @see LegacyGrid#setRowDescriptionGenerator * * @since 7.6 */ @@ -2096,7 +2096,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * Grid cells. If a cell has both a {@link RowDescriptionGenerator row * description} and a cell description, the latter has precedence. * - * @see Grid#setCellDescriptionGenerator(CellDescriptionGenerator) + * @see LegacyGrid#setCellDescriptionGenerator(CellDescriptionGenerator) * * @since 7.6 */ @@ -2129,7 +2129,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, @Override public void generateData(Object itemId, Item item, JsonObject rowData) { - RowReference row = new RowReference(Grid.this); + RowReference row = new RowReference(LegacyGrid.this); row.set(itemId); if (rowStyleGenerator != null) { @@ -2399,7 +2399,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, protected void writeDesign(Element trElement, DesignContext designContext) { Set<CELLTYPE> visited = new HashSet<>(); - for (Grid.Column column : section.grid.getColumns()) { + for (LegacyGrid.Column column : section.grid.getColumns()) { CELLTYPE cell = getCell(column.getPropertyId()); if (visited.contains(cell)) { continue; @@ -2686,7 +2686,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, } } - protected Grid grid; + protected LegacyGrid grid; protected List<ROWTYPE> rows = new ArrayList<>(); /** @@ -2968,7 +2968,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, private HeaderRow defaultRow = null; private final GridStaticSectionState headerState = new GridStaticSectionState(); - protected Header(Grid grid) { + protected Header(LegacyGrid grid) { this.grid = grid; grid.getState(true).header = headerState; HeaderRow row = createRow(); @@ -3137,7 +3137,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, private final GridStaticSectionState footerState = new GridStaticSectionState(); - protected Footer(Grid grid) { + protected Footer(LegacyGrid grid) { this.grid = grid; grid.getState(true).footer = footerState; } @@ -3191,7 +3191,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * A column in the grid. Can be obtained by calling - * {@link Grid#getColumn(Object propertyId)}. + * {@link LegacyGrid#getColumn(Object propertyId)}. */ public static class Column implements Serializable { @@ -3203,7 +3203,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * The grid this column is associated with */ - private final Grid grid; + private final LegacyGrid grid; /** * Backing property for column @@ -3214,7 +3214,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, /** * A check for allowing the - * {@link #Column(Grid, GridColumnState, Object) constructor} to call + * {@link #Column(LegacyGrid, GridColumnState, Object) constructor} to call * {@link #setConverter(LegacyConverter)} with a <code>null</code>, even * if model and renderer aren't compatible. */ @@ -3230,7 +3230,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * @param propertyId * the backing property id for this column */ - Column(Grid grid, GridColumnState state, Object propertyId) { + Column(LegacyGrid grid, GridColumnState state, Object propertyId) { this.grid = grid; this.state = state; this.propertyId = propertyId; @@ -3433,7 +3433,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * * @throws IllegalArgumentException * if the column is no longer attached to any grid - * @see Grid#setFrozenColumnCount(int) + * @see LegacyGrid#setFrozenColumnCount(int) */ public Column setLastFrozenColumn() { checkColumnIsAttached(); @@ -3837,8 +3837,8 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * @throws IllegalStateException * if the editor is currently active * - * @see Grid#editItem(Object) - * @see Grid#isEditorActive() + * @see LegacyGrid#editItem(Object) + * @see LegacyGrid#isEditorActive() */ public Column setEditable(boolean editable) { checkColumnIsAttached(); @@ -3858,7 +3858,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * @return {@code true} if this column is editable, {@code false} * otherwise * - * @see Grid#editItem(Object) + * @see LegacyGrid#editItem(Object) * @see #setEditable(boolean) */ @@ -4146,8 +4146,8 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, */ @Deprecated @Override - protected Class<Grid> getSupportedParentType() { - return Grid.class; + protected Class<LegacyGrid> getSupportedParentType() { + return LegacyGrid.class; } /** @@ -4297,7 +4297,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * @param grid * a grid instance */ - public AbstractGridExtension(Grid grid) { + public AbstractGridExtension(LegacyGrid grid) { super(); extend(grid); } @@ -4359,9 +4359,9 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * @throws IllegalStateException * if parent is not Grid */ - protected Grid getParentGrid() { - if (getParent() instanceof Grid) { - Grid grid = (Grid) getParent(); + protected LegacyGrid getParentGrid() { + if (getParent() instanceof LegacyGrid) { + LegacyGrid grid = (LegacyGrid) getParent(); return grid; } else if (getParent() == null) { throw new IllegalStateException( @@ -4525,7 +4525,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * own Container. * * @see #setContainerDataSource(Indexed) - * @see #Grid() + * @see #LegacyGrid() */ private boolean defaultContainer = true; @@ -4559,7 +4559,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * Creates a new Grid with a new {@link IndexedContainer} as the data * source. */ - public Grid() { + public LegacyGrid() { this(null, null); } @@ -4569,7 +4569,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * @param dataSource * the indexed container to use as a data source */ - public Grid(final Container.Indexed dataSource) { + public LegacyGrid(final Container.Indexed dataSource) { this(null, dataSource); } @@ -4580,7 +4580,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * @param caption * the caption of the grid */ - public Grid(String caption) { + public LegacyGrid(String caption) { this(caption, null); } @@ -4593,7 +4593,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * @param dataSource * the indexed container to use as a data source */ - public Grid(String caption, Container.Indexed dataSource) { + public LegacyGrid(String caption, Container.Indexed dataSource) { if (dataSource == null) { internalSetContainerDataSource(new IndexedContainer()); } else { @@ -4631,7 +4631,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, ConnectorTracker connectorTracker = getUI() .getConnectorTracker(); JsonObject diffState = connectorTracker - .getDiffState(Grid.this); + .getDiffState(LegacyGrid.this); diffState.remove("sortColumns"); diffState.remove("sortDirs"); markAsDirty(); @@ -4644,7 +4644,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, Object itemId = getKeyMapper().get(rowKey); Item item = datasource.getItem(itemId); Object propertyId = getPropertyIdByColumnId(columnId); - fireEvent(new ItemClickEvent(Grid.this, item, itemId, + fireEvent(new ItemClickEvent(LegacyGrid.this, item, itemId, propertyId, details)); } @@ -4654,7 +4654,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, final String diffStateKey = "columnOrder"; ConnectorTracker connectorTracker = getUI() .getConnectorTracker(); - JsonObject diffState = connectorTracker.getDiffState(Grid.this); + JsonObject diffState = connectorTracker.getDiffState(LegacyGrid.this); // discard the change if the columns have been reordered from // the server side, as the server side is always right if (getState(false).columnOrder.equals(oldColumnOrder)) { @@ -4701,7 +4701,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, ConnectorTracker connectorTracker = getUI() .getConnectorTracker(); JsonObject diffState = connectorTracker - .getDiffState(Grid.this); + .getDiffState(LegacyGrid.this); assert diffState .hasKey(diffStateKey) : "Field name has changed"; @@ -4734,7 +4734,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, if (rowKey != null) { itemId = getKeyMapper().get(rowKey); } - fireEvent(new GridContextClickEvent(Grid.this, details, section, + fireEvent(new GridContextClickEvent(LegacyGrid.this, details, section, rowIndex, itemId, getPropertyIdByColumnId(columnId))); } @@ -4806,7 +4806,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, success = true; } catch (CommitException e) { try { - CommitErrorEvent event = new CommitErrorEvent(Grid.this, + CommitErrorEvent event = new CommitErrorEvent(LegacyGrid.this, e); getEditorErrorHandler().commitError(event); @@ -4829,8 +4829,8 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, } private void handleError(Exception e) { - com.vaadin.server.ErrorEvent.findErrorHandler(Grid.this) - .error(new ConnectorErrorEvent(Grid.this, e)); + com.vaadin.server.ErrorEvent.findErrorHandler(LegacyGrid.this) + .error(new ConnectorErrorEvent(LegacyGrid.this, e)); } }); } @@ -5154,9 +5154,9 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, } /** - * Used internally by the {@link Grid} to get a {@link Column} by + * Used internally by the {@link LegacyGrid} to get a {@link Column} by * referencing its generated state id. Also used by {@link Column} to verify - * if it has been detached from the {@link Grid}. + * if it has been detached from the {@link LegacyGrid}. * * @param columnId * the client id generated for the column when the column is @@ -5169,7 +5169,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, } /** - * Used internally by the {@link Grid} to get a property id by referencing + * Used internally by the {@link LegacyGrid} to get a property id by referencing * the columns generated state id. * * @param columnId @@ -6652,7 +6652,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, } private static Logger getLogger() { - return Logger.getLogger(Grid.class.getName()); + return Logger.getLogger(LegacyGrid.class.getName()); } /** @@ -6764,7 +6764,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, editor = editorFieldGroup.getField(propertyId); } - if (editor != null && editor.getParent() != Grid.this) { + if (editor != null && editor.getParent() != LegacyGrid.this) { assert editor.getParent() == null; editor.setParent(this); } @@ -7264,7 +7264,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, super.writeDesign(design, context); Attributes attrs = design.attributes(); - Grid def = context.getDefaultInstance(this); + LegacyGrid def = context.getDefaultInstance(this); DesignAttributeHandler.writeAttribute("editable", attrs, isEditorEnabled(), def.isEditorEnabled(), boolean.class); 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 b95ca47fcf..63c6f5aeaf 100644 --- a/server/src/main/java/com/vaadin/ui/renderers/AbstractJavaScriptRenderer.java +++ b/server/src/main/java/com/vaadin/ui/renderers/AbstractJavaScriptRenderer.java @@ -20,7 +20,7 @@ import com.vaadin.server.JavaScriptCallbackHelper; import com.vaadin.server.JsonCodec; import com.vaadin.shared.JavaScriptExtensionState; import com.vaadin.shared.communication.ServerRpc; -import com.vaadin.ui.Grid.AbstractRenderer; +import com.vaadin.ui.LegacyGrid.AbstractRenderer; import com.vaadin.ui.JavaScriptFunction; import elemental.json.Json; 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 95349f2cda..d8fcdc3b4e 100644 --- a/server/src/main/java/com/vaadin/ui/renderers/ClickableRenderer.java +++ b/server/src/main/java/com/vaadin/ui/renderers/ClickableRenderer.java @@ -21,9 +21,9 @@ 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.ui.Grid; -import com.vaadin.ui.Grid.AbstractRenderer; -import com.vaadin.ui.Grid.Column; +import com.vaadin.ui.LegacyGrid; +import com.vaadin.ui.LegacyGrid.AbstractRenderer; +import com.vaadin.ui.LegacyGrid.Column; import com.vaadin.util.ReflectTools; /** @@ -67,7 +67,7 @@ public class ClickableRenderer<T> extends AbstractRenderer<T> { private Object itemId; private Column column; - protected RendererClickEvent(Grid source, Object itemId, Column column, + protected RendererClickEvent(LegacyGrid source, Object itemId, Column column, MouseEventDetails mouseEventDetails) { super(source, mouseEventDetails); this.itemId = itemId; 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 068e090e66..eea18e7445 100644 --- a/server/src/main/java/com/vaadin/ui/renderers/DateRenderer.java +++ b/server/src/main/java/com/vaadin/ui/renderers/DateRenderer.java @@ -19,7 +19,7 @@ import java.text.DateFormat; import java.util.Date; import java.util.Locale; -import com.vaadin.ui.Grid.AbstractRenderer; +import com.vaadin.ui.LegacyGrid.AbstractRenderer; import elemental.json.JsonValue; 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 df6202b107..c197f7415a 100644 --- a/server/src/main/java/com/vaadin/ui/renderers/HtmlRenderer.java +++ b/server/src/main/java/com/vaadin/ui/renderers/HtmlRenderer.java @@ -15,7 +15,7 @@ */ package com.vaadin.ui.renderers; -import com.vaadin.ui.Grid.AbstractRenderer; +import com.vaadin.ui.LegacyGrid.AbstractRenderer; import elemental.json.JsonValue; /** 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 dd53151fad..e54eecc6ef 100644 --- a/server/src/main/java/com/vaadin/ui/renderers/NumberRenderer.java +++ b/server/src/main/java/com/vaadin/ui/renderers/NumberRenderer.java @@ -18,7 +18,7 @@ package com.vaadin.ui.renderers; import java.text.NumberFormat; import java.util.Locale; -import com.vaadin.ui.Grid.AbstractRenderer; +import com.vaadin.ui.LegacyGrid.AbstractRenderer; import elemental.json.JsonValue; 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 e5a63dd9a4..fe90dfdee0 100644 --- a/server/src/main/java/com/vaadin/ui/renderers/ProgressBarRenderer.java +++ b/server/src/main/java/com/vaadin/ui/renderers/ProgressBarRenderer.java @@ -15,7 +15,7 @@ */ package com.vaadin.ui.renderers; -import com.vaadin.ui.Grid.AbstractRenderer; +import com.vaadin.ui.LegacyGrid.AbstractRenderer; import elemental.json.JsonValue; 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 f17cf673f8..ac73615272 100644 --- a/server/src/main/java/com/vaadin/ui/renderers/TextRenderer.java +++ b/server/src/main/java/com/vaadin/ui/renderers/TextRenderer.java @@ -15,7 +15,7 @@ */ package com.vaadin.ui.renderers; -import com.vaadin.ui.Grid.AbstractRenderer; +import com.vaadin.ui.LegacyGrid.AbstractRenderer; import elemental.json.JsonValue; /** diff --git a/server/src/test/java/com/vaadin/tests/server/ContextClickListenerTest.java b/server/src/test/java/com/vaadin/tests/server/ContextClickListenerTest.java index 8ad4458f41..1b93a3063d 100644 --- a/server/src/test/java/com/vaadin/tests/server/ContextClickListenerTest.java +++ b/server/src/test/java/com/vaadin/tests/server/ContextClickListenerTest.java @@ -24,7 +24,7 @@ import org.junit.Test; import com.vaadin.event.ContextClickEvent; import com.vaadin.event.ContextClickEvent.ContextClickListener; import com.vaadin.ui.AbstractComponent; -import com.vaadin.ui.Grid.GridContextClickEvent; +import com.vaadin.ui.LegacyGrid.GridContextClickEvent; import com.vaadin.ui.Table.TableContextClickEvent; /** diff --git a/server/src/test/java/com/vaadin/tests/server/component/grid/GridAddRowBuiltinContainerTest.java b/server/src/test/java/com/vaadin/tests/server/component/grid/GridAddRowBuiltinContainerTest.java index cf4c40ab38..3bff93c042 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/grid/GridAddRowBuiltinContainerTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/grid/GridAddRowBuiltinContainerTest.java @@ -25,10 +25,10 @@ import com.vaadin.data.util.BeanItem; import com.vaadin.data.util.BeanItemContainer; import com.vaadin.data.util.MethodProperty.MethodException; import com.vaadin.tests.data.bean.Person; -import com.vaadin.ui.Grid; +import com.vaadin.ui.LegacyGrid; public class GridAddRowBuiltinContainerTest { - Grid grid = new Grid(); + LegacyGrid grid = new LegacyGrid(); Container.Indexed container; @Before diff --git a/server/src/test/java/com/vaadin/tests/server/component/grid/GridChildrenTest.java b/server/src/test/java/com/vaadin/tests/server/component/grid/GridChildrenTest.java index d18dbc5219..f126e636ba 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/grid/GridChildrenTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/grid/GridChildrenTest.java @@ -17,20 +17,20 @@ package com.vaadin.tests.server.component.grid; import java.util.Iterator; +import com.vaadin.ui.LegacyGrid; import org.junit.Assert; import org.junit.Test; import com.vaadin.ui.Component; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.FooterCell; -import com.vaadin.ui.Grid.HeaderCell; +import com.vaadin.ui.LegacyGrid.FooterCell; +import com.vaadin.ui.LegacyGrid.HeaderCell; import com.vaadin.ui.Label; public class GridChildrenTest { @Test public void componentsInMergedHeader() { - Grid grid = new Grid(); + LegacyGrid grid = new LegacyGrid(); grid.addColumn("foo"); grid.addColumn("bar"); grid.addColumn("baz"); @@ -45,7 +45,7 @@ public class GridChildrenTest { @Test public void componentsInMergedFooter() { - Grid grid = new Grid(); + LegacyGrid grid = new LegacyGrid(); grid.addColumn("foo"); grid.addColumn("bar"); grid.addColumn("baz"); diff --git a/server/src/test/java/com/vaadin/tests/server/component/grid/GridColumnAddingAndRemovingTest.java b/server/src/test/java/com/vaadin/tests/server/component/grid/GridColumnAddingAndRemovingTest.java index db5f4e298c..1af2577fa3 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/grid/GridColumnAddingAndRemovingTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/grid/GridColumnAddingAndRemovingTest.java @@ -19,17 +19,17 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; +import com.vaadin.ui.LegacyGrid; import org.junit.Before; import org.junit.Test; import com.vaadin.data.Container; import com.vaadin.data.Property; import com.vaadin.data.util.IndexedContainer; -import com.vaadin.ui.Grid; public class GridColumnAddingAndRemovingTest { - Grid grid = new Grid(); + LegacyGrid grid = new LegacyGrid(); Container.Indexed container; @Before @@ -104,7 +104,7 @@ public class GridColumnAddingAndRemovingTest { grid.getColumn("foo")); assertNotNull("Grid did should have a column for property bar", grid.getColumn("bar")); - for (Grid.Column column : grid.getColumns()) { + for (LegacyGrid.Column column : grid.getColumns()) { assertNotNull("Grid getColumns returned a null value", column); } diff --git a/server/src/test/java/com/vaadin/tests/server/component/grid/GridColumnsTest.java b/server/src/test/java/com/vaadin/tests/server/component/grid/GridColumnsTest.java index a217d1eff7..bf0a5c8ae1 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/grid/GridColumnsTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/grid/GridColumnsTest.java @@ -34,6 +34,7 @@ import java.util.Iterator; import java.util.LinkedHashSet; import java.util.Set; +import com.vaadin.ui.LegacyGrid; import org.easymock.Capture; import org.easymock.EasyMock; import org.junit.Before; @@ -45,14 +46,13 @@ 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.ui.Grid; -import com.vaadin.ui.Grid.Column; -import com.vaadin.ui.Grid.ColumnResizeEvent; -import com.vaadin.ui.Grid.ColumnResizeListener; +import com.vaadin.ui.LegacyGrid.Column; +import com.vaadin.ui.LegacyGrid.ColumnResizeEvent; +import com.vaadin.ui.LegacyGrid.ColumnResizeListener; public class GridColumnsTest { - private Grid grid; + private LegacyGrid grid; private GridState state; @@ -70,14 +70,14 @@ public class GridColumnsTest { ds.addContainerProperty("column" + c, String.class, ""); } ds.addContainerProperty("noSort", Object.class, null); - grid = new Grid(ds); + grid = new LegacyGrid(ds); - getStateMethod = Grid.class.getDeclaredMethod("getState"); + getStateMethod = LegacyGrid.class.getDeclaredMethod("getState"); getStateMethod.setAccessible(true); state = (GridState) getStateMethod.invoke(grid); - columnIdGeneratorField = Grid.class.getDeclaredField("columnKeys"); + columnIdGeneratorField = LegacyGrid.class.getDeclaredField("columnKeys"); columnIdGeneratorField.setAccessible(true); columnIdMapper = (KeyMapper<Object>) columnIdGeneratorField.get(grid); @@ -333,7 +333,7 @@ public class GridColumnsTest { @Test public void testAddingColumnsWithSetColumns() { - Grid g = new Grid(); + LegacyGrid g = new LegacyGrid(); g.setColumns("c1", "c2", "c3"); Iterator<Column> it = g.getColumns().iterator(); assertEquals(it.next().getPropertyId(), "c1"); diff --git a/server/src/test/java/com/vaadin/tests/server/component/grid/GridContainerNotSortableTest.java b/server/src/test/java/com/vaadin/tests/server/component/grid/GridContainerNotSortableTest.java index ee59470d7a..fa6c57df93 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/grid/GridContainerNotSortableTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/grid/GridContainerNotSortableTest.java @@ -21,13 +21,13 @@ import java.util.Collection; import java.util.LinkedHashMap; import java.util.Map; +import com.vaadin.ui.LegacyGrid; import org.junit.Test; import com.vaadin.data.Item; import com.vaadin.data.Property; import com.vaadin.data.util.AbstractInMemoryContainer; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.Column; +import com.vaadin.ui.LegacyGrid.Column; public class GridContainerNotSortableTest { @@ -88,12 +88,12 @@ public class GridContainerNotSortableTest { @Test public void testGridWithNotSortableContainer() { - new Grid(notSortableDataSource); + new LegacyGrid(notSortableDataSource); } @Test(expected = IllegalStateException.class) public void testNotSortableGridSetColumnSortable() { - Grid grid = new Grid(); + LegacyGrid grid = new LegacyGrid(); grid.setContainerDataSource(notSortableDataSource); Column column = grid.getColumn("Foo"); assertFalse("Column should not be sortable initially.", diff --git a/server/src/test/java/com/vaadin/tests/server/component/grid/GridContainerTest.java b/server/src/test/java/com/vaadin/tests/server/component/grid/GridContainerTest.java index 083204a1fb..7b07aefcb2 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/grid/GridContainerTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/grid/GridContainerTest.java @@ -18,21 +18,16 @@ package com.vaadin.tests.server.component.grid; import java.io.IOException; import java.io.ObjectOutputStream; import java.io.OutputStream; -import java.lang.reflect.Field; +import com.vaadin.ui.LegacyGrid; import org.junit.Assert; import org.junit.Test; import com.vaadin.data.util.IndexedContainer; -import com.vaadin.server.VaadinRequest; -import com.vaadin.server.communication.data.RpcDataProviderExtension; import com.vaadin.ui.Component; -import com.vaadin.ui.ConnectorTracker; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.DetailsGenerator; -import com.vaadin.ui.Grid.RowReference; +import com.vaadin.ui.LegacyGrid.DetailsGenerator; +import com.vaadin.ui.LegacyGrid.RowReference; import com.vaadin.ui.Label; -import com.vaadin.ui.UI; public class GridContainerTest { @@ -47,7 +42,7 @@ public class GridContainerTest { @Test public void testDetailsGeneratorDoesNotResetOnContainerChange() { - Grid grid = new Grid(); + LegacyGrid grid = new LegacyGrid(); DetailsGenerator detGen = new DetailsGenerator() { @Override @@ -88,7 +83,7 @@ public class GridContainerTest { @Test public void setColumnsOrder() { - Grid grid = new Grid(); + LegacyGrid grid = new LegacyGrid(); IndexedContainer ic = new IndexedContainer(); ic.addContainerProperty("foo", String.class, ""); ic.addContainerProperty("baz", String.class, ""); @@ -103,7 +98,7 @@ public class GridContainerTest { @Test public void addColumnNotInContainer() { - Grid grid = new Grid(); + LegacyGrid grid = new LegacyGrid(); grid.setContainerDataSource(new IndexedContainer()); try { grid.addColumn("notInContainer"); @@ -118,7 +113,7 @@ public class GridContainerTest { @Test public void setColumnsForPropertyIdNotInContainer() { - Grid grid = new Grid(); + LegacyGrid grid = new LegacyGrid(); grid.setContainerDataSource(new IndexedContainer()); try { grid.setColumns("notInContainer", "notThereEither"); @@ -135,7 +130,7 @@ public class GridContainerTest { @Test(expected = IllegalStateException.class) public void multipleAddColumnsForDefaultContainer() { - Grid grid = new Grid(); + LegacyGrid grid = new LegacyGrid(); grid.addColumn("foo"); grid.addColumn("foo"); } @@ -143,7 +138,7 @@ public class GridContainerTest { @Test public void testSerializeRpcDataProviderWithRowChanges() throws IOException { - Grid grid = new Grid(); + LegacyGrid grid = new LegacyGrid(); IndexedContainer container = new IndexedContainer(); grid.setContainerDataSource(container); container.addItem(); diff --git a/server/src/test/java/com/vaadin/tests/server/component/grid/GridEditorTest.java b/server/src/test/java/com/vaadin/tests/server/component/grid/GridEditorTest.java index 3a17841b48..d30a84bd49 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/grid/GridEditorTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/grid/GridEditorTest.java @@ -24,6 +24,7 @@ import static org.junit.Assert.assertTrue; import java.lang.reflect.Method; +import com.vaadin.ui.LegacyGrid; import org.easymock.EasyMock; import org.junit.After; import org.junit.Assert; @@ -40,7 +41,6 @@ import com.vaadin.legacy.ui.LegacyTextField; import com.vaadin.server.MockVaadinSession; import com.vaadin.server.VaadinService; import com.vaadin.server.VaadinSession; -import com.vaadin.ui.Grid; public class GridEditorTest { @@ -53,7 +53,7 @@ public class GridEditorTest { // Explicit field for the test session to save it from GC private VaadinSession session; - private final Grid grid = new Grid(); + private final LegacyGrid grid = new LegacyGrid(); private Method doEditMethod; @Before @@ -77,7 +77,7 @@ public class GridEditorTest { session.lock(); // Access to method for actual editing. - doEditMethod = Grid.class.getDeclaredMethod("doEditItem"); + doEditMethod = LegacyGrid.class.getDeclaredMethod("doEditItem"); doEditMethod.setAccessible(true); } diff --git a/server/src/test/java/com/vaadin/tests/server/component/grid/GridExtensionTest.java b/server/src/test/java/com/vaadin/tests/server/component/grid/GridExtensionTest.java index a9f5a07761..452d2713a4 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/grid/GridExtensionTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/grid/GridExtensionTest.java @@ -17,23 +17,23 @@ package com.vaadin.tests.server.component.grid; import static org.junit.Assert.assertTrue; +import com.vaadin.ui.LegacyGrid; import org.junit.Test; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.AbstractGridExtension; +import com.vaadin.ui.LegacyGrid.AbstractGridExtension; public class GridExtensionTest { public static class DummyGridExtension extends AbstractGridExtension { - public DummyGridExtension(Grid grid) { + public DummyGridExtension(LegacyGrid grid) { super(grid); } } @Test public void testCreateExtension() { - Grid grid = new Grid(); + LegacyGrid grid = new LegacyGrid(); DummyGridExtension dummy = new DummyGridExtension(grid); assertTrue("DummyGridExtension never made it to Grid", grid.getExtensions().contains(dummy)); diff --git a/server/src/test/java/com/vaadin/tests/server/component/grid/GridSelectionTest.java b/server/src/test/java/com/vaadin/tests/server/component/grid/GridSelectionTest.java index 8828d941ee..7e910d2428 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/grid/GridSelectionTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/grid/GridSelectionTest.java @@ -21,15 +21,15 @@ import static org.junit.Assert.assertTrue; import java.util.Collection; +import com.vaadin.ui.LegacyGrid; import org.junit.Before; import org.junit.Test; import com.vaadin.data.util.IndexedContainer; import com.vaadin.event.SelectionEvent; import com.vaadin.event.SelectionEvent.SelectionListener; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.SelectionMode; -import com.vaadin.ui.Grid.SelectionModel; +import com.vaadin.ui.LegacyGrid.SelectionMode; +import com.vaadin.ui.LegacyGrid.SelectionModel; public class GridSelectionTest { @@ -64,7 +64,7 @@ public class GridSelectionTest { } } - private Grid grid; + private LegacyGrid grid; private MockSelectionChangeListener mockListener; private final Object itemId1Present = "itemId1Present"; @@ -90,7 +90,7 @@ public class GridSelectionTest { assertFalse("itemId2NotPresent", container.containsId(itemId2NotPresent)); - grid = new Grid(container); + grid = new LegacyGrid(container); mockListener = new MockSelectionChangeListener(); grid.addSelectionListener(mockListener); diff --git a/server/src/test/java/com/vaadin/tests/server/component/grid/GridStateTest.java b/server/src/test/java/com/vaadin/tests/server/component/grid/GridStateTest.java index 96b159ed87..9f5f67d8be 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/grid/GridStateTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/grid/GridStateTest.java @@ -19,7 +19,7 @@ import org.junit.Assert; import org.junit.Test; import com.vaadin.shared.ui.grid.GridState; -import com.vaadin.ui.Grid; +import com.vaadin.ui.LegacyGrid; /** * Tests for Grid State. @@ -29,7 +29,7 @@ public class GridStateTest { @Test public void getPrimaryStyleName_gridHasCustomPrimaryStyleName() { - Grid grid = new Grid(); + LegacyGrid grid = new LegacyGrid(); GridState state = new GridState(); Assert.assertEquals("Unexpected primary style name", state.primaryStyleName, grid.getPrimaryStyleName()); diff --git a/server/src/test/java/com/vaadin/tests/server/component/grid/GridStaticSectionTest.java b/server/src/test/java/com/vaadin/tests/server/component/grid/GridStaticSectionTest.java index 5a76553228..7a8209d50b 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/grid/GridStaticSectionTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/grid/GridStaticSectionTest.java @@ -21,14 +21,14 @@ import static org.junit.Assert.assertNull; import java.lang.reflect.Method; +import com.vaadin.ui.LegacyGrid; import org.junit.Before; import org.junit.Test; import com.vaadin.data.Container.Indexed; import com.vaadin.data.util.IndexedContainer; -import com.vaadin.ui.Grid; -public class GridStaticSectionTest extends Grid { +public class GridStaticSectionTest extends LegacyGrid { private Indexed dataSource = new IndexedContainer(); @@ -117,10 +117,10 @@ public class GridStaticSectionTest extends Grid { private void sanityCheck() throws Throwable { Method sanityCheckHeader; try { - sanityCheckHeader = Grid.Header.class + sanityCheckHeader = LegacyGrid.Header.class .getDeclaredMethod("sanityCheck"); sanityCheckHeader.setAccessible(true); - Method sanityCheckFooter = Grid.Footer.class + Method sanityCheckFooter = LegacyGrid.Footer.class .getDeclaredMethod("sanityCheck"); sanityCheckFooter.setAccessible(true); sanityCheckHeader.invoke(getHeader()); diff --git a/server/src/test/java/com/vaadin/tests/server/component/grid/MultiSelectionModelTest.java b/server/src/test/java/com/vaadin/tests/server/component/grid/MultiSelectionModelTest.java index c904c07d22..1199486742 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/grid/MultiSelectionModelTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/grid/MultiSelectionModelTest.java @@ -19,6 +19,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import com.vaadin.ui.LegacyGrid; import org.junit.After; import org.junit.Assert; import org.junit.Before; @@ -28,9 +29,8 @@ import com.vaadin.data.Container; import com.vaadin.data.util.IndexedContainer; import com.vaadin.event.SelectionEvent; import com.vaadin.event.SelectionEvent.SelectionListener; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.MultiSelectionModel; -import com.vaadin.ui.Grid.SelectionMode; +import com.vaadin.ui.LegacyGrid.MultiSelectionModel; +import com.vaadin.ui.LegacyGrid.SelectionMode; public class MultiSelectionModelTest { @@ -41,7 +41,7 @@ public class MultiSelectionModelTest { private Object itemIdNotPresent = "itemIdNotPresent"; private Container.Indexed dataSource; private MultiSelectionModel model; - private Grid grid; + private LegacyGrid grid; private boolean expectingEvent = false; private boolean expectingDeselectEvent; @@ -51,7 +51,7 @@ public class MultiSelectionModelTest { @Before public void setUp() { dataSource = createDataSource(); - grid = new Grid(dataSource); + grid = new LegacyGrid(dataSource); grid.setSelectionMode(SelectionMode.MULTI); model = (MultiSelectionModel) grid.getSelectionModel(); } diff --git a/server/src/test/java/com/vaadin/tests/server/component/grid/SingleSelectionModelTest.java b/server/src/test/java/com/vaadin/tests/server/component/grid/SingleSelectionModelTest.java index 49ed2e9472..3183ad9021 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/grid/SingleSelectionModelTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/grid/SingleSelectionModelTest.java @@ -24,9 +24,9 @@ import com.vaadin.data.Container; import com.vaadin.data.util.IndexedContainer; import com.vaadin.event.SelectionEvent; import com.vaadin.event.SelectionEvent.SelectionListener; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.SelectionMode; -import com.vaadin.ui.Grid.SingleSelectionModel; +import com.vaadin.ui.LegacyGrid; +import com.vaadin.ui.LegacyGrid.SelectionMode; +import com.vaadin.ui.LegacyGrid.SingleSelectionModel; public class SingleSelectionModelTest { @@ -36,14 +36,14 @@ public class SingleSelectionModelTest { private Object itemIdNotPresent = "itemIdNotPresent"; private Container.Indexed dataSource; private SingleSelectionModel model; - private Grid grid; + private LegacyGrid grid; private boolean expectingEvent = false; @Before public void setUp() { dataSource = createDataSource(); - grid = new Grid(dataSource); + grid = new LegacyGrid(dataSource); grid.setSelectionMode(SelectionMode.SINGLE); model = (SingleSelectionModel) grid.getSelectionModel(); } diff --git a/server/src/test/java/com/vaadin/tests/server/component/grid/TestGrid.java b/server/src/test/java/com/vaadin/tests/server/component/grid/TestGrid.java index 372b42bcfb..9b2dde4d24 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/grid/TestGrid.java +++ b/server/src/test/java/com/vaadin/tests/server/component/grid/TestGrid.java @@ -22,7 +22,7 @@ import org.easymock.EasyMock; import com.vaadin.data.util.IndexedContainer; import com.vaadin.server.communication.data.RpcDataProviderExtension; import com.vaadin.ui.ConnectorTracker; -import com.vaadin.ui.Grid; +import com.vaadin.ui.LegacyGrid; import com.vaadin.ui.UI; /** @@ -31,7 +31,7 @@ import com.vaadin.ui.UI; * @since 7.4 * @author Vaadin Ltd */ -public class TestGrid extends Grid { +public class TestGrid extends LegacyGrid { public TestGrid() { super(); @@ -44,7 +44,7 @@ public class TestGrid extends Grid { } public RpcDataProviderExtension getDataProvider() throws Exception { - Field dseField = Grid.class.getDeclaredField("datasourceExtension"); + Field dseField = LegacyGrid.class.getDeclaredField("datasourceExtension"); dseField.setAccessible(true); return (RpcDataProviderExtension) dseField.get(this); } diff --git a/server/src/test/java/com/vaadin/tests/server/component/grid/declarative/GridColumnDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/grid/declarative/GridColumnDeclarativeTest.java index 0ea4a87523..71d24a2d8e 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/grid/declarative/GridColumnDeclarativeTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/grid/declarative/GridColumnDeclarativeTest.java @@ -15,15 +15,14 @@ */ package com.vaadin.tests.server.component.grid.declarative; +import com.vaadin.ui.LegacyGrid; import org.junit.Test; -import com.vaadin.ui.Grid; - public class GridColumnDeclarativeTest extends GridDeclarativeTestBase { @Test public void testSimpleGridColumns() { - String design = "<vaadin-grid><table>"// + String design = "<vaadin-legacy-grid><table>"// + "<colgroup>" + " <col sortable width='100' property-id='Column1'>" + " <col sortable=false max-width='200' expand='2' property-id='Column2'>" @@ -32,8 +31,8 @@ public class GridColumnDeclarativeTest extends GridDeclarativeTestBase { + " <col sortable hidden property-id='Column5'>" + "</colgroup>" // + "<thead />" // - + "</table></vaadin-grid>"; - Grid grid = new Grid(); + + "</table></vaadin-legacy-grid>"; + LegacyGrid grid = new LegacyGrid(); grid.addColumn("Column1", String.class).setWidth(100); grid.addColumn("Column2", String.class).setMaximumWidth(200) .setExpandRatio(2).setSortable(false); @@ -53,15 +52,15 @@ public class GridColumnDeclarativeTest extends GridDeclarativeTestBase { @Test public void testReadColumnsWithoutPropertyId() { - String design = "<vaadin-grid><table>"// + String design = "<vaadin-legacy-grid><table>"// + "<colgroup>" + " <col sortable=true width='100' property-id='Column1'>" + " <col sortable=true max-width='200' expand='2'>" // property-id="property-1" + " <col sortable=true min-width='15' expand='1' property-id='Column3'>" + " <col sortable=true hidden=true hidable=true hiding-toggle-caption='col 4'>" // property-id="property-3" + "</colgroup>" // - + "</table></vaadin-grid>"; - Grid grid = new Grid(); + + "</table></vaadin-legacy-grid>"; + LegacyGrid grid = new LegacyGrid(); grid.addColumn("Column1", String.class).setWidth(100); grid.addColumn("property-1", String.class).setMaximumWidth(200) .setExpandRatio(2); @@ -75,12 +74,12 @@ public class GridColumnDeclarativeTest extends GridDeclarativeTestBase { @Test public void testReadEmptyExpand() { - String design = "<vaadin-grid><table>"// + String design = "<vaadin-legacy-grid><table>"// + "<colgroup>" + " <col sortable=true expand />" + "</colgroup>" // - + "</table></vaadin-grid>"; + + "</table></vaadin-legacy-grid>"; - Grid grid = new Grid(); + LegacyGrid grid = new LegacyGrid(); grid.addColumn("property-0", String.class).setExpandRatio(1); testRead(design, grid); @@ -88,13 +87,13 @@ public class GridColumnDeclarativeTest extends GridDeclarativeTestBase { @Test public void testReadColumnWithNoAttributes() { - String design = "<vaadin-grid><table>"// + String design = "<vaadin-legacy-grid><table>"// + "<colgroup>" // + " <col />" // + "</colgroup>" // - + "</table></vaadin-grid>"; + + "</table></vaadin-legacy-grid>"; - Grid grid = new Grid(); + LegacyGrid grid = new LegacyGrid(); grid.addColumn("property-0", String.class); testRead(design, grid); diff --git a/server/src/test/java/com/vaadin/tests/server/component/grid/declarative/GridDeclarativeAttributeTest.java b/server/src/test/java/com/vaadin/tests/server/component/grid/declarative/GridDeclarativeAttributeTest.java index 78be89e4c1..8ca99327dc 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/grid/declarative/GridDeclarativeAttributeTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/grid/declarative/GridDeclarativeAttributeTest.java @@ -17,14 +17,14 @@ package com.vaadin.tests.server.component.grid.declarative; import static org.junit.Assert.assertSame; +import com.vaadin.ui.LegacyGrid; import org.junit.Test; import com.vaadin.shared.ui.grid.HeightMode; import com.vaadin.tests.design.DeclarativeTestBase; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.MultiSelectionModel; -import com.vaadin.ui.Grid.NoSelectionModel; -import com.vaadin.ui.Grid.SingleSelectionModel; +import com.vaadin.ui.LegacyGrid.MultiSelectionModel; +import com.vaadin.ui.LegacyGrid.NoSelectionModel; +import com.vaadin.ui.LegacyGrid.SingleSelectionModel; /** * Tests declarative support for {@link Grid} properties. @@ -32,15 +32,15 @@ import com.vaadin.ui.Grid.SingleSelectionModel; * @since * @author Vaadin Ltd */ -public class GridDeclarativeAttributeTest extends DeclarativeTestBase<Grid> { +public class GridDeclarativeAttributeTest extends DeclarativeTestBase<LegacyGrid> { @Test public void testBasicAttributes() { - String design = "<vaadin-grid editable rows=20 frozen-columns=-1 " + String design = "<vaadin-legacy-grid editable rows=20 frozen-columns=-1 " + "editor-save-caption='Tallenna' editor-cancel-caption='Peruuta' column-reordering-allowed>"; - Grid grid = new Grid(); + LegacyGrid grid = new LegacyGrid(); grid.setEditorEnabled(true); grid.setHeightMode(HeightMode.ROW); grid.setHeightByRows(20); @@ -55,10 +55,10 @@ public class GridDeclarativeAttributeTest extends DeclarativeTestBase<Grid> { @Test public void testFrozenColumnsAttributes() { - String design = "<vaadin-grid frozen-columns='2'><table>" // - + "<colgroup><col><col><col></colgroup></table></vaadin-grid>"; + String design = "<vaadin-legacy-grid frozen-columns='2'><table>" // + + "<colgroup><col><col><col></colgroup></table></vaadin-legacy-grid>"; - Grid grid = new Grid(); + LegacyGrid grid = new LegacyGrid(); grid.addColumn("property-0", String.class); grid.addColumn("property-1", String.class); grid.addColumn("property-2", String.class); @@ -69,15 +69,15 @@ public class GridDeclarativeAttributeTest extends DeclarativeTestBase<Grid> { @Test public void testSelectionMode() { - String design = "<vaadin-grid selection-mode='none'>"; + String design = "<vaadin-legacy-grid selection-mode='none'>"; assertSame(NoSelectionModel.class, read(design).getSelectionModel().getClass()); - design = "<vaadin-grid selection-mode='single'>"; + design = "<vaadin-legacy-grid selection-mode='single'>"; assertSame(SingleSelectionModel.class, read(design).getSelectionModel().getClass()); - design = "<vaadin-grid selection-mode='multi'>"; + design = "<vaadin-legacy-grid selection-mode='multi'>"; assertSame(MultiSelectionModel.class, read(design).getSelectionModel().getClass()); } diff --git a/server/src/test/java/com/vaadin/tests/server/component/grid/declarative/GridDeclarativeTestBase.java b/server/src/test/java/com/vaadin/tests/server/component/grid/declarative/GridDeclarativeTestBase.java index 4ba2757b33..3e97910be7 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/grid/declarative/GridDeclarativeTestBase.java +++ b/server/src/test/java/com/vaadin/tests/server/component/grid/declarative/GridDeclarativeTestBase.java @@ -17,30 +17,30 @@ package com.vaadin.tests.server.component.grid.declarative; import java.util.List; +import com.vaadin.ui.LegacyGrid; import org.junit.Assert; import com.vaadin.tests.design.DeclarativeTestBase; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.Column; -import com.vaadin.ui.Grid.FooterCell; -import com.vaadin.ui.Grid.FooterRow; -import com.vaadin.ui.Grid.HeaderCell; -import com.vaadin.ui.Grid.HeaderRow; +import com.vaadin.ui.LegacyGrid.Column; +import com.vaadin.ui.LegacyGrid.FooterCell; +import com.vaadin.ui.LegacyGrid.FooterRow; +import com.vaadin.ui.LegacyGrid.HeaderCell; +import com.vaadin.ui.LegacyGrid.HeaderRow; -public class GridDeclarativeTestBase extends DeclarativeTestBase<Grid> { +public class GridDeclarativeTestBase extends DeclarativeTestBase<LegacyGrid> { @Override - public Grid testRead(String design, Grid expected) { + public LegacyGrid testRead(String design, LegacyGrid expected) { return testRead(design, expected, false); } - public Grid testRead(String design, Grid expected, boolean retestWrite) { + public LegacyGrid testRead(String design, LegacyGrid expected, boolean retestWrite) { return testRead(design, expected, retestWrite, false); } - public Grid testRead(String design, Grid expected, boolean retestWrite, + public LegacyGrid testRead(String design, LegacyGrid expected, boolean retestWrite, boolean writeData) { - Grid actual = super.testRead(design, expected); + LegacyGrid actual = super.testRead(design, expected); compareGridColumns(expected, actual); compareHeaders(expected, actual); @@ -53,7 +53,7 @@ public class GridDeclarativeTestBase extends DeclarativeTestBase<Grid> { return actual; } - private void compareHeaders(Grid expected, Grid actual) { + private void compareHeaders(LegacyGrid expected, LegacyGrid actual) { Assert.assertEquals("Different header row count", expected.getHeaderRowCount(), actual.getHeaderRowCount()); for (int i = 0; i < expected.getHeaderRowCount(); ++i) { @@ -91,7 +91,7 @@ public class GridDeclarativeTestBase extends DeclarativeTestBase<Grid> { } } - private void compareFooters(Grid expected, Grid actual) { + private void compareFooters(LegacyGrid expected, LegacyGrid actual) { Assert.assertEquals("Different footer row count", expected.getFooterRowCount(), actual.getFooterRowCount()); for (int i = 0; i < expected.getFooterRowCount(); ++i) { @@ -124,7 +124,7 @@ public class GridDeclarativeTestBase extends DeclarativeTestBase<Grid> { } } - private void compareGridColumns(Grid expected, Grid actual) { + private void compareGridColumns(LegacyGrid expected, LegacyGrid actual) { List<Column> columns = expected.getColumns(); List<Column> actualColumns = actual.getColumns(); Assert.assertEquals("Different amount of columns", columns.size(), diff --git a/server/src/test/java/com/vaadin/tests/server/component/grid/declarative/GridHeaderFooterDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/grid/declarative/GridHeaderFooterDeclarativeTest.java index 8e33c122d4..1207063c16 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/grid/declarative/GridHeaderFooterDeclarativeTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/grid/declarative/GridHeaderFooterDeclarativeTest.java @@ -15,16 +15,16 @@ */ package com.vaadin.tests.server.component.grid.declarative; +import com.vaadin.ui.LegacyGrid; import org.jsoup.nodes.Element; import org.jsoup.parser.Tag; import org.junit.Assert; import org.junit.Test; import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.Column; -import com.vaadin.ui.Grid.FooterRow; -import com.vaadin.ui.Grid.HeaderRow; +import com.vaadin.ui.LegacyGrid.Column; +import com.vaadin.ui.LegacyGrid.FooterRow; +import com.vaadin.ui.LegacyGrid.HeaderRow; import com.vaadin.ui.Label; import com.vaadin.ui.declarative.DesignContext; @@ -33,7 +33,7 @@ public class GridHeaderFooterDeclarativeTest extends GridDeclarativeTestBase { @Test public void testSingleDefaultHeader() { //@formatter:off - String design = "<vaadin-grid><table>" + String design = "<vaadin-legacy-grid><table>" + "<colgroup>" + " <col sortable property-id='Column1'>" + " <col sortable property-id='Column2'>" @@ -42,9 +42,9 @@ public class GridHeaderFooterDeclarativeTest extends GridDeclarativeTestBase { + "<thead>" + " <tr default><th plain-text>Column1<th plain-text>Column2<th plain-text>Column3</tr>" + "</thead>" - + "</table></vaadin-grid>"; + + "</table></vaadin-legacy-grid>"; //@formatter:on - Grid grid = new Grid(); + LegacyGrid grid = new LegacyGrid(); grid.addColumn("Column1", String.class); grid.addColumn("Column2", String.class); grid.addColumn("Column3", String.class); @@ -56,7 +56,7 @@ public class GridHeaderFooterDeclarativeTest extends GridDeclarativeTestBase { @Test public void testSingleDefaultHTMLHeader() { //@formatter:off - String design = "<vaadin-grid><table>" + String design = "<vaadin-legacy-grid><table>" + "<colgroup>" + " <col sortable property-id='Column1'>" + " <col sortable property-id='Column2'>" @@ -64,9 +64,9 @@ public class GridHeaderFooterDeclarativeTest extends GridDeclarativeTestBase { + "<thead>" + " <tr default><th>Column1<th>Column2<th>Column3</tr>" + "</thead>" - + "</table></vaadin-grid>"; + + "</table></vaadin-legacy-grid>"; //@formatter:on - Grid grid = new Grid(); + LegacyGrid grid = new LegacyGrid(); grid.addColumn("Column1", String.class); grid.addColumn("Column2", String.class); grid.addColumn("Column3", String.class); @@ -83,14 +83,14 @@ public class GridHeaderFooterDeclarativeTest extends GridDeclarativeTestBase { @Test public void testNoHeaderRows() { //@formatter:off - String design = "<vaadin-grid><table>" + String design = "<vaadin-legacy-grid><table>" + "<colgroup>" + " <col sortable property-id='Column1'>" + "</colgroup>" + "<thead />" - + "</table></vaadin-grid>"; + + "</table></vaadin-legacy-grid>"; //@formatter:on - Grid grid = new Grid(); + LegacyGrid grid = new LegacyGrid(); grid.addColumn("Column1", String.class); grid.removeHeaderRow(grid.getDefaultHeaderRow()); @@ -101,7 +101,7 @@ public class GridHeaderFooterDeclarativeTest extends GridDeclarativeTestBase { @Test public void testMultipleHeadersWithColSpans() { //@formatter:off - String design = "<vaadin-grid><table>" + String design = "<vaadin-legacy-grid><table>" + "<colgroup>" + " <col sortable property-id='Column1'>" + " <col sortable property-id='Column2'>" @@ -112,9 +112,9 @@ public class GridHeaderFooterDeclarativeTest extends GridDeclarativeTestBase { + " <tr default><th>Column1<th>Column2<th>Column3</tr>" + " <tr><th>Foo<th colspan=2>Bar</tr>" + "</thead>" - + "</table></vaadin-grid>"; + + "</table></vaadin-legacy-grid>"; //@formatter:on - Grid grid = new Grid(); + LegacyGrid grid = new LegacyGrid(); grid.addColumn("Column1", String.class); grid.addColumn("Column2", String.class); grid.addColumn("Column3", String.class); @@ -137,7 +137,7 @@ public class GridHeaderFooterDeclarativeTest extends GridDeclarativeTestBase { @Test public void testSingleDefaultFooter() { //@formatter:off - String design = "<vaadin-grid><table>" + String design = "<vaadin-legacy-grid><table>" + "<colgroup>" + " <col sortable property-id='Column1'>" + " <col sortable property-id='Column2'>" @@ -147,9 +147,9 @@ public class GridHeaderFooterDeclarativeTest extends GridDeclarativeTestBase { + "<tfoot>" + " <tr><td plain-text>Column1<td plain-text>Column2<td plain-text>Column3</tr>" + "</tfoot>" - + "</table></vaadin-grid>"; + + "</table></vaadin-legacy-grid>"; //@formatter:on - Grid grid = new Grid(); + LegacyGrid grid = new LegacyGrid(); grid.addColumn("Column1", String.class); grid.addColumn("Column2", String.class); grid.addColumn("Column3", String.class); @@ -168,7 +168,7 @@ public class GridHeaderFooterDeclarativeTest extends GridDeclarativeTestBase { @Test public void testSingleDefaultHTMLFooter() { //@formatter:off - String design = "<vaadin-grid><table>" + String design = "<vaadin-legacy-grid><table>" + "<colgroup>" + " <col sortable property-id='Column1'>" + " <col sortable property-id='Column2'>" @@ -177,10 +177,10 @@ public class GridHeaderFooterDeclarativeTest extends GridDeclarativeTestBase { + "<tfoot>" + " <tr><td>Column1<td>Column2<td>Column3</tr>" + "</tfoot>" - + "</table></vaadin-grid>"; + + "</table></vaadin-legacy-grid>"; //@formatter:on - Grid grid = new Grid(); + LegacyGrid grid = new LegacyGrid(); grid.addColumn("Column1", String.class); grid.addColumn("Column2", String.class); grid.addColumn("Column3", String.class); @@ -199,7 +199,7 @@ public class GridHeaderFooterDeclarativeTest extends GridDeclarativeTestBase { @Test public void testMultipleFootersWithColSpans() { //@formatter:off - String design = "<vaadin-grid><table>" + String design = "<vaadin-legacy-grid><table>" + "<colgroup>" + " <col sortable property-id='Column1'>" + " <col sortable property-id='Column2'>" @@ -211,10 +211,10 @@ public class GridHeaderFooterDeclarativeTest extends GridDeclarativeTestBase { + " <tr><td>Column1<td>Column2<td>Column3</tr>" + " <tr><td>Foo<td colspan=2>Bar</tr>" + "</tfoot>" - + "</table></vaadin-grid>"; + + "</table></vaadin-legacy-grid>"; //@formatter:on - Grid grid = new Grid(); + LegacyGrid grid = new LegacyGrid(); grid.addColumn("Column1", String.class); grid.addColumn("Column2", String.class); grid.addColumn("Column3", String.class); @@ -239,19 +239,19 @@ public class GridHeaderFooterDeclarativeTest extends GridDeclarativeTestBase { @Test public void testComponentInGridHeader() { //@formatter:off - String design = "<vaadin-grid><table>" + String design = "<vaadin-legacy-grid><table>" + "<colgroup>" + " <col sortable property-id='Column1'>" + "</colgroup>" + "<thead>" + "<tr default><th><vaadin-label><b>Foo</b></vaadin-label></tr>" + "</thead>" - + "</table></vaadin-grid>"; + + "</table></vaadin-legacy-grid>"; //@formatter:on Label component = new Label("<b>Foo</b>"); component.setContentMode(ContentMode.HTML); - Grid grid = new Grid(); + LegacyGrid grid = new LegacyGrid(); grid.addColumn("Column1", String.class); grid.getDefaultHeaderRow().getCell("Column1").setComponent(component); @@ -262,7 +262,7 @@ public class GridHeaderFooterDeclarativeTest extends GridDeclarativeTestBase { @Test public void testComponentInGridFooter() { //@formatter:off - String design = "<vaadin-grid><table>" + String design = "<vaadin-legacy-grid><table>" + "<colgroup>" + " <col sortable property-id='Column1'>" + "</colgroup>" @@ -270,13 +270,13 @@ public class GridHeaderFooterDeclarativeTest extends GridDeclarativeTestBase { + "<tfoot>" + "<tr><td><vaadin-label><b>Foo</b></vaadin-label></tr>" + "</tfoot>" - + "</table></vaadin-grid>"; + + "</table></vaadin-legacy-grid>"; //@formatter:on Label component = new Label("<b>Foo</b>"); component.setContentMode(ContentMode.HTML); - Grid grid = new Grid(); + LegacyGrid grid = new LegacyGrid(); grid.addColumn("Column1", String.class); grid.prependFooterRow().getCell("Column1").setComponent(component); grid.removeHeaderRow(grid.getDefaultHeaderRow()); @@ -288,7 +288,7 @@ public class GridHeaderFooterDeclarativeTest extends GridDeclarativeTestBase { @Test public void testHtmlEntitiesinGridHeaderFooter() { //@formatter:off - String design = "<vaadin-grid><table>" + String design = "<vaadin-legacy-grid><table>" + "<colgroup>" + " <col sortable=\"true\" property-id=\"> test\">" + "</colgroup>" @@ -299,10 +299,10 @@ public class GridHeaderFooterDeclarativeTest extends GridDeclarativeTestBase { + " <tr><td plain-text=\"true\">> Test</td></tr>" + "</tfoot>" + "<tbody />" - + "</table></vaadin-grid>"; + + "</table></vaadin-legacy-grid>"; //@formatter:on - Grid grid = read(design); + LegacyGrid grid = read(design); String actualHeader = grid.getHeaderRow(0).getCell("> test").getText(); String actualFooter = grid.getFooterRow(0).getCell("> test").getText(); String expected = "> Test"; @@ -319,7 +319,7 @@ public class GridHeaderFooterDeclarativeTest extends GridDeclarativeTestBase { Assert.assertEquals(expected, actualHeader); Assert.assertEquals(expected, actualFooter); - grid = new Grid(); + grid = new LegacyGrid(); grid.setColumns("test"); HeaderRow header = grid.addHeaderRowAt(0); FooterRow footer = grid.addFooterRowAt(0); @@ -329,7 +329,7 @@ public class GridHeaderFooterDeclarativeTest extends GridDeclarativeTestBase { header.getCell("test").setText("& Test"); footer.getCell("test").setText("& Test"); - Element root = new Element(Tag.valueOf("vaadin-grid"), ""); + Element root = new Element(Tag.valueOf("vaadin-legacy-grid"), ""); grid.writeDesign(root, new DesignContext()); Assert.assertEquals("&amp; Test", @@ -344,7 +344,7 @@ public class GridHeaderFooterDeclarativeTest extends GridDeclarativeTestBase { header.getCell("test").setHtml("& Test"); footer.getCell("test").setHtml("& Test"); - root = new Element(Tag.valueOf("vaadin-grid"), ""); + root = new Element(Tag.valueOf("vaadin-legacy-grid"), ""); grid.writeDesign(root, new DesignContext()); Assert.assertEquals("& Test", diff --git a/server/src/test/java/com/vaadin/tests/server/component/grid/declarative/GridInlineDataDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/grid/declarative/GridInlineDataDeclarativeTest.java index fcc46169d3..f5b98824cd 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/grid/declarative/GridInlineDataDeclarativeTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/grid/declarative/GridInlineDataDeclarativeTest.java @@ -15,17 +15,17 @@ */ package com.vaadin.tests.server.component.grid.declarative; +import com.vaadin.ui.LegacyGrid; import org.junit.Assert; import org.junit.Test; import com.vaadin.data.Container; -import com.vaadin.ui.Grid; public class GridInlineDataDeclarativeTest extends GridDeclarativeTestBase { @Test public void testSimpleInlineData() { - String design = "<vaadin-grid><table>"// + String design = "<vaadin-legacy-grid><table>"// + "<colgroup>" + " <col sortable property-id='Col1' />" + "</colgroup>" // + "<thead />" // No headers read or written @@ -34,9 +34,9 @@ public class GridInlineDataDeclarativeTest extends GridDeclarativeTestBase { + "<tr><td>Bar</tr>" // + "<tr><td>Baz</tr>" // + "</tbody>" // - + "</table></vaadin-grid>"; + + "</table></vaadin-legacy-grid>"; - Grid grid = new Grid(); + LegacyGrid grid = new LegacyGrid(); grid.addColumn("Col1", String.class); grid.addRow("Foo"); grid.addRow("Bar"); @@ -51,7 +51,7 @@ public class GridInlineDataDeclarativeTest extends GridDeclarativeTestBase { @Test public void testMultipleColumnsInlineData() { - String design = "<vaadin-grid><table>"// + String design = "<vaadin-legacy-grid><table>"// + "<colgroup>" + " <col sortable property-id='Col1' />" + " <col sortable property-id='Col2' />" + " <col sortable property-id='Col3' />" // @@ -61,9 +61,9 @@ public class GridInlineDataDeclarativeTest extends GridDeclarativeTestBase { + "<tr><td>Foo<td>Bar<td>Baz</tr>" // + "<tr><td>My<td>Summer<td>Car</tr>" // + "</tbody>" // - + "</table></vaadin-grid>"; + + "</table></vaadin-legacy-grid>"; - Grid grid = new Grid(); + LegacyGrid grid = new LegacyGrid(); grid.addColumn("Col1", String.class); grid.addColumn("Col2", String.class); grid.addColumn("Col3", String.class); @@ -79,7 +79,7 @@ public class GridInlineDataDeclarativeTest extends GridDeclarativeTestBase { @Test public void testMultipleColumnsInlineDataReordered() { - String design = "<vaadin-grid><table>"// + String design = "<vaadin-legacy-grid><table>"// + "<colgroup>" + " <col sortable property-id='Col2' />" + " <col sortable property-id='Col3' />" + " <col sortable property-id='Col1' />" // @@ -89,9 +89,9 @@ public class GridInlineDataDeclarativeTest extends GridDeclarativeTestBase { + "<tr><td>Bar<td>Baz<td>Foo</tr>" // + "<tr><td>Summer<td>Car<td>My</tr>" // + "</tbody>" // - + "</table></vaadin-grid>"; + + "</table></vaadin-legacy-grid>"; - Grid grid = new Grid(); + LegacyGrid grid = new LegacyGrid(); grid.addColumn("Col1", String.class); grid.addColumn("Col2", String.class); grid.addColumn("Col3", String.class); @@ -108,14 +108,14 @@ public class GridInlineDataDeclarativeTest extends GridDeclarativeTestBase { @Test public void testHtmlEntities() { - String design = "<vaadin-grid><table>"// + String design = "<vaadin-legacy-grid><table>"// + "<colgroup>" + " <col property-id='test' />" + "</colgroup>" // + "<thead />" // No headers read or written + "<tbody>" // + " <tr><td>&Test</tr></td>" + "</tbody>" - + "</table></vaadin-grid>"; + + "</table></vaadin-legacy-grid>"; - Grid read = read(design); + LegacyGrid read = read(design); Container cds = read.getContainerDataSource(); Assert.assertEquals("&Test", cds.getItem(cds.getItemIds().iterator().next()) diff --git a/server/src/test/java/com/vaadin/tests/server/component/grid/declarative/GridStructureDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/grid/declarative/GridStructureDeclarativeTest.java index 6df57a8e16..b55b0815f8 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/grid/declarative/GridStructureDeclarativeTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/grid/declarative/GridStructureDeclarativeTest.java @@ -15,36 +15,36 @@ */ package com.vaadin.tests.server.component.grid.declarative; +import com.vaadin.ui.LegacyGrid; import org.junit.Test; -import com.vaadin.ui.Grid; import com.vaadin.ui.declarative.DesignException; public class GridStructureDeclarativeTest extends GridDeclarativeTestBase { @Test public void testReadEmptyGrid() { - String design = "<vaadin-grid />"; - testRead(design, new Grid(), false); + String design = "<vaadin-legacy-grid />"; + testRead(design, new LegacyGrid(), false); } @Test public void testEmptyGrid() { - String design = "<vaadin-grid></vaadin-grid>"; - Grid expected = new Grid(); + String design = "<vaadin-legacy-grid></vaadin-legacy-grid>"; + LegacyGrid expected = new LegacyGrid(); testWrite(design, expected); testRead(design, expected, true); } @Test(expected = DesignException.class) public void testMalformedGrid() { - String design = "<vaadin-grid><vaadin-label /></vaadin-grid>"; - testRead(design, new Grid()); + String design = "<vaadin-legacy-grid><vaadin-label /></vaadin-legacy-grid>"; + testRead(design, new LegacyGrid()); } @Test(expected = DesignException.class) public void testGridWithNoColGroup() { - String design = "<vaadin-grid><table><thead><tr><th>Foo</tr></thead></table></vaadin-grid>"; - testRead(design, new Grid()); + String design = "<vaadin-legacy-grid><table><thead><tr><th>Foo</tr></thead></table></vaadin-legacy-grid>"; + testRead(design, new LegacyGrid()); } } diff --git a/server/src/test/java/com/vaadin/tests/server/component/grid/sort/SortTest.java b/server/src/test/java/com/vaadin/tests/server/component/grid/sort/SortTest.java index 2143b5773b..beb774528f 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/grid/sort/SortTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/grid/sort/SortTest.java @@ -29,7 +29,7 @@ import com.vaadin.data.util.IndexedContainer; import com.vaadin.event.SortEvent; import com.vaadin.event.SortEvent.SortListener; import com.vaadin.shared.data.sort.SortDirection; -import com.vaadin.ui.Grid; +import com.vaadin.ui.LegacyGrid; public class SortTest { @@ -93,7 +93,7 @@ public class SortTest { private DummySortingIndexedContainer container; private RegisteringSortChangeListener listener; - private Grid grid; + private LegacyGrid grid; @Before public void setUp() { @@ -102,7 +102,7 @@ public class SortTest { listener = new RegisteringSortChangeListener(); - grid = new Grid(container); + grid = new LegacyGrid(container); grid.addSortListener(listener); } diff --git a/server/src/test/java/com/vaadin/tests/server/renderer/ImageRendererTest.java b/server/src/test/java/com/vaadin/tests/server/renderer/ImageRendererTest.java index 32d39ad2e5..822a2353ac 100644 --- a/server/src/test/java/com/vaadin/tests/server/renderer/ImageRendererTest.java +++ b/server/src/test/java/com/vaadin/tests/server/renderer/ImageRendererTest.java @@ -28,7 +28,7 @@ import com.vaadin.server.ExternalResource; import com.vaadin.server.FileResource; import com.vaadin.server.FontAwesome; import com.vaadin.server.ThemeResource; -import com.vaadin.ui.Grid; +import com.vaadin.ui.LegacyGrid; import com.vaadin.ui.UI; import com.vaadin.ui.renderers.ImageRenderer; @@ -44,7 +44,7 @@ public class ImageRendererTest { UI mockUI = EasyMock.createNiceMock(UI.class); EasyMock.replay(mockUI); - Grid grid = new Grid(); + LegacyGrid grid = new LegacyGrid(); grid.setParent(mockUI); renderer = new ImageRenderer(); diff --git a/server/src/test/java/com/vaadin/tests/server/renderer/RendererTest.java b/server/src/test/java/com/vaadin/tests/server/renderer/RendererTest.java index bcceb8b2ff..eb0e3b641c 100644 --- a/server/src/test/java/com/vaadin/tests/server/renderer/RendererTest.java +++ b/server/src/test/java/com/vaadin/tests/server/renderer/RendererTest.java @@ -32,9 +32,9 @@ import com.vaadin.legacy.data.util.converter.LegacyStringToIntegerConverter; import com.vaadin.server.VaadinSession; import com.vaadin.tests.server.component.grid.TestGrid; import com.vaadin.tests.util.AlwaysLockedVaadinSession; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.AbstractRenderer; -import com.vaadin.ui.Grid.Column; +import com.vaadin.ui.LegacyGrid; +import com.vaadin.ui.LegacyGrid.AbstractRenderer; +import com.vaadin.ui.LegacyGrid.Column; import com.vaadin.ui.renderers.ButtonRenderer; import com.vaadin.ui.renderers.DateRenderer; import com.vaadin.ui.renderers.HtmlRenderer; @@ -98,7 +98,7 @@ public class RendererTest { } } - private Grid grid; + private LegacyGrid grid; private Column intColumn; private Column textColumn; diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/BeanRenderer.java b/uitest/src/main/java/com/vaadin/tests/components/grid/BeanRenderer.java index 6a6acdca26..cbddab968c 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/BeanRenderer.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/BeanRenderer.java @@ -16,7 +16,7 @@ package com.vaadin.tests.components.grid; import com.vaadin.tests.widgetset.client.SimpleTestBean; -import com.vaadin.ui.Grid.AbstractRenderer; +import com.vaadin.ui.LegacyGrid.AbstractRenderer; public class BeanRenderer extends AbstractRenderer<SimpleTestBean> { public BeanRenderer() { diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/CustomRenderer.java b/uitest/src/main/java/com/vaadin/tests/components/grid/CustomRenderer.java index 5b47731abc..c3f97ada3b 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/CustomRenderer.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/CustomRenderer.java @@ -23,8 +23,8 @@ import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.tests.widgetset.TestingWidgetSet; import com.vaadin.tests.widgetset.client.SimpleTestBean; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.SelectionMode; +import com.vaadin.ui.LegacyGrid; +import com.vaadin.ui.LegacyGrid.SelectionMode; import com.vaadin.ui.Label; @Widgetset(TestingWidgetSet.NAME) @@ -64,7 +64,7 @@ public class CustomRenderer extends AbstractTestUI { Label debugLabel = new Label(INIT_DEBUG_LABEL_CAPTION); debugLabel.setId(DEBUG_LABEL_ID); - Grid grid = new Grid(container); + LegacyGrid grid = new LegacyGrid(container); grid.getColumn(INT_ARRAY_PROPERTY).setRenderer(new IntArrayRenderer()); grid.getColumn(VOID_PROPERTY) diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridAddAndRemoveDataOnInit.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridAddAndRemoveDataOnInit.java index 16617e6526..aa03a9f705 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridAddAndRemoveDataOnInit.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridAddAndRemoveDataOnInit.java @@ -19,13 +19,13 @@ import com.vaadin.data.Container.Indexed; import com.vaadin.data.util.IndexedContainer; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; -import com.vaadin.ui.Grid; +import com.vaadin.ui.LegacyGrid; public class GridAddAndRemoveDataOnInit extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { - Grid gridAdd = new Grid(); + LegacyGrid gridAdd = new LegacyGrid(); gridAdd.setHeight("240px"); gridAdd.setWidth("140px"); addComponent(gridAdd); @@ -41,7 +41,7 @@ public class GridAddAndRemoveDataOnInit extends AbstractTestUI { Object id = dataSource.addItem(); dataSource.getItem(id).getItemProperty("bar").setValue(i); } - Grid gridRemove = new Grid(dataSource); + LegacyGrid gridRemove = new LegacyGrid(dataSource); gridRemove.setHeight("150px"); gridRemove.setWidth("140px"); addComponent(gridRemove); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridAddRow.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridAddRow.java index a1564bc0e0..28aa71d048 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridAddRow.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridAddRow.java @@ -19,15 +19,15 @@ import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.SelectionMode; +import com.vaadin.ui.LegacyGrid; +import com.vaadin.ui.LegacyGrid.SelectionMode; public class GridAddRow extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { - final Grid grid = new Grid(); + final LegacyGrid grid = new LegacyGrid(); grid.setSelectionMode(SelectionMode.MULTI); grid.addColumn("firstName"); grid.addColumn("age", Integer.class); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridCheckBoxDisplay.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridCheckBoxDisplay.java index 9b236e6d9a..6a92e37375 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridCheckBoxDisplay.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridCheckBoxDisplay.java @@ -20,7 +20,7 @@ import java.io.Serializable; import com.vaadin.data.util.BeanItemContainer; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; -import com.vaadin.ui.Grid; +import com.vaadin.ui.LegacyGrid; public class GridCheckBoxDisplay extends AbstractTestUI { @@ -33,14 +33,14 @@ public class GridCheckBoxDisplay extends AbstractTestUI { todoContainer.addBean(new Todo("Done task", true)); todoContainer.addBean(new Todo("Not done", false)); - Grid grid = new Grid(todoContainer); + LegacyGrid grid = new LegacyGrid(todoContainer); grid.setSizeFull(); grid.setColumnOrder("done", "task"); grid.getColumn("done").setWidth(75); grid.getColumn("task").setExpandRatio(1); - grid.setSelectionMode(Grid.SelectionMode.SINGLE); + grid.setSelectionMode(LegacyGrid.SelectionMode.SINGLE); grid.setEditorEnabled(true); grid.setImmediate(true); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridColspans.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridColspans.java index 7db8966a69..59b42cb9dc 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridColspans.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridColspans.java @@ -22,10 +22,10 @@ import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.FooterRow; -import com.vaadin.ui.Grid.HeaderRow; -import com.vaadin.ui.Grid.SelectionMode; +import com.vaadin.ui.LegacyGrid; +import com.vaadin.ui.LegacyGrid.FooterRow; +import com.vaadin.ui.LegacyGrid.HeaderRow; +import com.vaadin.ui.LegacyGrid.SelectionMode; import com.vaadin.ui.renderers.NumberRenderer; public class GridColspans extends AbstractTestUI { @@ -33,7 +33,7 @@ public class GridColspans extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { Indexed dataSource = new IndexedContainer(); - final Grid grid; + final LegacyGrid grid; dataSource.addContainerProperty("firstName", String.class, ""); dataSource.addContainerProperty("lastName", String.class, ""); @@ -46,7 +46,7 @@ public class GridColspans extends AbstractTestUI { i.getItemProperty("streetAddress").setValue("Ruukinkatu 2-4"); i.getItemProperty("zipCode").setValue(20540); i.getItemProperty("city").setValue("Turku"); - grid = new Grid(dataSource); + grid = new LegacyGrid(dataSource); grid.setWidth("600px"); grid.getColumn("zipCode").setRenderer(new NumberRenderer()); grid.setSelectionMode(SelectionMode.MULTI); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridColumnAutoExpand.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridColumnAutoExpand.java index 27927feb79..f7c2a37fd9 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridColumnAutoExpand.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridColumnAutoExpand.java @@ -17,8 +17,8 @@ package com.vaadin.tests.components.grid; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.Column; +import com.vaadin.ui.LegacyGrid; +import com.vaadin.ui.LegacyGrid.Column; import com.vaadin.ui.VerticalLayout; public class GridColumnAutoExpand extends AbstractTestUI { @@ -30,7 +30,7 @@ public class GridColumnAutoExpand extends AbstractTestUI { layout.setMargin(true); addComponent(layout); - Grid grid = new Grid("Broken Grid with Caption"); + LegacyGrid grid = new LegacyGrid("Broken Grid with Caption"); grid.setWidth("100%"); grid.setHeight("100px"); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridColumnAutoWidth.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridColumnAutoWidth.java index cdac858140..45cce42c40 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridColumnAutoWidth.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridColumnAutoWidth.java @@ -19,15 +19,15 @@ import com.vaadin.data.Container; import com.vaadin.data.util.IndexedContainer; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.Column; -import com.vaadin.ui.Grid.SelectionMode; +import com.vaadin.ui.LegacyGrid; +import com.vaadin.ui.LegacyGrid.Column; +import com.vaadin.ui.LegacyGrid.SelectionMode; import com.vaadin.ui.renderers.HtmlRenderer; public class GridColumnAutoWidth extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { - Grid grid = new Grid(createContainer()); + LegacyGrid grid = new LegacyGrid(createContainer()); grid.getColumn("fixed width narrow").setWidth(50); grid.getColumn("fixed width wide").setWidth(200); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridColumnExpand.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridColumnExpand.java index 484e7e89ac..b9390a3127 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridColumnExpand.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridColumnExpand.java @@ -23,15 +23,15 @@ import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Component; import com.vaadin.ui.CssLayout; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.Column; +import com.vaadin.ui.LegacyGrid; +import com.vaadin.ui.LegacyGrid.Column; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Label; import com.vaadin.ui.themes.Reindeer; @Theme(Reindeer.THEME_NAME) public class GridColumnExpand extends AbstractTestUI { - private Grid grid; + private LegacyGrid grid; private Label firstInfo = new Label(); private Label secondInfo = new Label(); private Column firstColumn; @@ -39,7 +39,7 @@ public class GridColumnExpand extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { - grid = new Grid(PersonContainer.createWithTestData()); + grid = new LegacyGrid(PersonContainer.createWithTestData()); grid.removeAllColumns(); grid.addColumn("address.streetAddress"); grid.addColumn("lastName"); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridColumnWidthRecalculation.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridColumnWidthRecalculation.java index 64e3f72f3d..d03ac48d16 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridColumnWidthRecalculation.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridColumnWidthRecalculation.java @@ -25,14 +25,14 @@ import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Grid; +import com.vaadin.ui.LegacyGrid; @Theme("valo") public class GridColumnWidthRecalculation extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { - final Grid grid = new Grid(); + final LegacyGrid grid = new LegacyGrid(); grid.addColumn("Column 1"); grid.addColumn("Column 2"); @@ -64,7 +64,7 @@ public class GridColumnWidthRecalculation extends AbstractTestUI { } @SuppressWarnings("unchecked") - protected void swapData(Grid grid) { + protected void swapData(LegacyGrid grid) { Indexed dataSource = grid.getContainerDataSource(); Object itemId = dataSource.getItemIds().iterator().next(); Item item = dataSource.getItem(itemId); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridColumnWidthsWithoutData.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridColumnWidthsWithoutData.java index 93094868b7..8c7c142d5a 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridColumnWidthsWithoutData.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridColumnWidthsWithoutData.java @@ -23,15 +23,15 @@ import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.SelectionMode; +import com.vaadin.ui.LegacyGrid; +import com.vaadin.ui.LegacyGrid.SelectionMode; import com.vaadin.ui.NativeSelect; import com.vaadin.ui.VerticalLayout; public class GridColumnWidthsWithoutData extends AbstractTestUI { private SelectionMode selectionMode = SelectionMode.NONE; - private Grid grid = createGrid(true); + private LegacyGrid grid = createGrid(true); @Override protected void setup(VaadinRequest request) { @@ -82,13 +82,13 @@ public class GridColumnWidthsWithoutData extends AbstractTestUI { } - private void replaceGrid(Grid newGrid) { + private void replaceGrid(LegacyGrid newGrid) { ((VerticalLayout) grid.getParent()).replaceComponent(grid, newGrid); grid = newGrid; } - private Grid createGrid(boolean withData) { - Grid grid = new Grid(); + private LegacyGrid createGrid(boolean withData) { + LegacyGrid grid = new LegacyGrid(); grid.addColumn("foo"); grid.addColumn("bar"); grid.setWidth("300px"); @@ -101,7 +101,7 @@ public class GridColumnWidthsWithoutData extends AbstractTestUI { return grid; } - private void addDataToGrid(Grid grid) { + private void addDataToGrid(LegacyGrid grid) { grid.addRow("Some", "Data with more data in one col"); } diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridCustomSelectionModel.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridCustomSelectionModel.java index 6e8435ae75..c602111754 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridCustomSelectionModel.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridCustomSelectionModel.java @@ -19,7 +19,7 @@ import com.vaadin.annotations.Widgetset; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.tests.widgetset.TestingWidgetSet; -import com.vaadin.ui.Grid.MultiSelectionModel; +import com.vaadin.ui.LegacyGrid.MultiSelectionModel; @Widgetset(TestingWidgetSet.NAME) public class GridCustomSelectionModel extends AbstractTestUI { diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridDataSourceReset.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridDataSourceReset.java index d6f768d93e..095a105c9c 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridDataSourceReset.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridDataSourceReset.java @@ -26,13 +26,13 @@ import com.vaadin.tests.fieldgroup.ComplexPerson; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.Grid; +import com.vaadin.ui.LegacyGrid; public class GridDataSourceReset extends AbstractTestUI { BeanItemContainer<ComplexPerson> container; List<ComplexPerson> persons; - Grid grid; + LegacyGrid grid; @Override protected void setup(VaadinRequest request) { @@ -40,7 +40,7 @@ public class GridDataSourceReset extends AbstractTestUI { container = new BeanItemContainer<ComplexPerson>(ComplexPerson.class, persons); - grid = new Grid(container); + grid = new LegacyGrid(container); grid.select(container.firstItemId()); addComponent(new Button("Remove first", new ClickListener() { diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridDefaultSelectionMode.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridDefaultSelectionMode.java index 099aacd285..dc88bb3b78 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridDefaultSelectionMode.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridDefaultSelectionMode.java @@ -23,7 +23,7 @@ import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.Grid; +import com.vaadin.ui.LegacyGrid; import com.vaadin.ui.VerticalLayout; public class GridDefaultSelectionMode extends AbstractTestUI { @@ -45,7 +45,7 @@ public class GridDefaultSelectionMode extends AbstractTestUI { final BeanItemContainer<Person> container = new BeanItemContainer<Person>( Person.class, items); - final Grid grid = new Grid(); + final LegacyGrid grid = new LegacyGrid(); grid.setContainerDataSource(container); VerticalLayout v = new VerticalLayout(); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridDetailsDetach.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridDetailsDetach.java index 72b839de21..911335d5d1 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridDetailsDetach.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridDetailsDetach.java @@ -23,16 +23,16 @@ import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Component; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.DetailsGenerator; -import com.vaadin.ui.Grid.RowReference; -import com.vaadin.ui.Grid.SelectionMode; +import com.vaadin.ui.LegacyGrid; +import com.vaadin.ui.LegacyGrid.DetailsGenerator; +import com.vaadin.ui.LegacyGrid.RowReference; +import com.vaadin.ui.LegacyGrid.SelectionMode; import com.vaadin.ui.Label; import com.vaadin.ui.VerticalLayout; public class GridDetailsDetach extends AbstractTestUI { - private Grid currentGrid; + private LegacyGrid currentGrid; @Override protected void setup(VaadinRequest request) { @@ -70,14 +70,14 @@ public class GridDetailsDetach extends AbstractTestUI { addComponent(layout); } - private Grid generateGrid() { + private LegacyGrid generateGrid() { BeanItemContainer<GridExampleBean> container = new BeanItemContainer<GridExampleBean>( GridExampleBean.class); for (int i = 0; i < 1000; i++) { container.addItem(new GridExampleBean("Bean " + i, i * i, i / 10d)); } - final Grid grid = new Grid(container); + final LegacyGrid grid = new LegacyGrid(container); grid.setColumnOrder("name", "amount", "count"); grid.setSizeFull(); grid.setSelectionMode(SelectionMode.NONE); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridDetailsLayoutExpand.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridDetailsLayoutExpand.java index 9a4caccd6f..64f6d0d406 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridDetailsLayoutExpand.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridDetailsLayoutExpand.java @@ -20,9 +20,9 @@ import com.vaadin.event.ItemClickEvent.ItemClickListener; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Component; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.DetailsGenerator; -import com.vaadin.ui.Grid.RowReference; +import com.vaadin.ui.LegacyGrid; +import com.vaadin.ui.LegacyGrid.DetailsGenerator; +import com.vaadin.ui.LegacyGrid.RowReference; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Label; @@ -37,7 +37,7 @@ public class GridDetailsLayoutExpand extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { - final Grid grid = new Grid(); + final LegacyGrid grid = new LegacyGrid(); grid.setSizeFull(); grid.addColumn("name", String.class); grid.addColumn("born", Integer.class); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridDetailsLocation.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridDetailsLocation.java index 6ac869f382..bf471dde7e 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridDetailsLocation.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridDetailsLocation.java @@ -23,10 +23,10 @@ import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.CheckBox; import com.vaadin.ui.Component; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.DetailsGenerator; -import com.vaadin.ui.Grid.RowReference; -import com.vaadin.ui.Grid.SelectionMode; +import com.vaadin.ui.LegacyGrid; +import com.vaadin.ui.LegacyGrid.DetailsGenerator; +import com.vaadin.ui.LegacyGrid.RowReference; +import com.vaadin.ui.LegacyGrid.SelectionMode; import com.vaadin.ui.Label; import com.vaadin.ui.Layout; import com.vaadin.ui.TextField; @@ -51,14 +51,14 @@ public class GridDetailsLocation extends UI { }; private TextField numberTextField; - private Grid grid; + private LegacyGrid grid; @Override protected void init(VaadinRequest request) { Layout layout = new VerticalLayout(); - grid = new Grid(PersonContainer.createWithTestData(1000)); + grid = new LegacyGrid(PersonContainer.createWithTestData(1000)); grid.setSelectionMode(SelectionMode.NONE); layout.addComponent(grid); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridDetailsWidth.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridDetailsWidth.java index a509fdbbfb..ade6d66c6f 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridDetailsWidth.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridDetailsWidth.java @@ -20,10 +20,10 @@ import com.vaadin.event.ItemClickEvent.ItemClickListener; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Component; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.Column; -import com.vaadin.ui.Grid.DetailsGenerator; -import com.vaadin.ui.Grid.RowReference; +import com.vaadin.ui.LegacyGrid; +import com.vaadin.ui.LegacyGrid.Column; +import com.vaadin.ui.LegacyGrid.DetailsGenerator; +import com.vaadin.ui.LegacyGrid.RowReference; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.TextArea; import com.vaadin.ui.VerticalLayout; @@ -35,7 +35,7 @@ public class GridDetailsWidth extends AbstractTestUI { final VerticalLayout layout = new VerticalLayout(); layout.setMargin(true); - final Grid grid = new Grid(); + final LegacyGrid grid = new LegacyGrid(); Column column = grid.addColumn("Hello", String.class); for (int i = 0; i < 3; i++) { diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridDisabledMultiselect.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridDisabledMultiselect.java index 4846a41672..d910b715a8 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridDisabledMultiselect.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridDisabledMultiselect.java @@ -3,22 +3,22 @@ package com.vaadin.tests.components.grid; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Button; -import com.vaadin.ui.Grid; +import com.vaadin.ui.LegacyGrid; public class GridDisabledMultiselect extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { - final Grid grid = new Grid(); + final LegacyGrid grid = new LegacyGrid(); grid.addColumn("foo", String.class); grid.addRow("bar"); - grid.setSelectionMode(Grid.SelectionMode.SINGLE); + grid.setSelectionMode(LegacyGrid.SelectionMode.SINGLE); addComponent(grid); addButton("Multi", new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { - grid.setSelectionMode(Grid.SelectionMode.MULTI); + grid.setSelectionMode(LegacyGrid.SelectionMode.MULTI); } }); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridDragAndDrop.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridDragAndDrop.java index d55f5eb634..4bf35d465d 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridDragAndDrop.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridDragAndDrop.java @@ -20,7 +20,7 @@ import java.util.List; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; -import com.vaadin.ui.Grid; +import com.vaadin.ui.LegacyGrid; @SuppressWarnings("serial") public class GridDragAndDrop extends AbstractTestUI { @@ -32,7 +32,7 @@ public class GridDragAndDrop extends AbstractTestUI { "multiple", "columns", "plus", "these", "resemble", "a", "group", "here", "no", "more"); - Grid grid = new Grid(); + LegacyGrid grid = new LegacyGrid(); for (String columnId : columnIds) { grid.addColumn(columnId); @@ -45,7 +45,7 @@ public class GridDragAndDrop extends AbstractTestUI { grid.setColumnReorderingAllowed(true); grid.setFrozenColumnCount(1); - grid.setSelectionMode(Grid.SelectionMode.MULTI); + grid.setSelectionMode(LegacyGrid.SelectionMode.MULTI); addComponent(grid); } diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridDragSelectionWhileScrolled.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridDragSelectionWhileScrolled.java index 1a53b90929..cb22e6046f 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridDragSelectionWhileScrolled.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridDragSelectionWhileScrolled.java @@ -17,7 +17,7 @@ package com.vaadin.tests.components.grid; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; -import com.vaadin.ui.Grid.SelectionMode; +import com.vaadin.ui.LegacyGrid.SelectionMode; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Layout; import com.vaadin.ui.VerticalLayout; diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridEditingWithNoScrollBars.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridEditingWithNoScrollBars.java index 81a2f374c2..32f3760059 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridEditingWithNoScrollBars.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridEditingWithNoScrollBars.java @@ -18,15 +18,15 @@ package com.vaadin.tests.components.grid; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.ComboBox; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.Column; -import com.vaadin.ui.Grid.SelectionMode; +import com.vaadin.ui.LegacyGrid; +import com.vaadin.ui.LegacyGrid.Column; +import com.vaadin.ui.LegacyGrid.SelectionMode; public class GridEditingWithNoScrollBars extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { - Grid grid = new Grid(); + LegacyGrid grid = new LegacyGrid(); grid.addColumn("foo", String.class); grid.addColumn("bar", String.class); for (int i = 0; i < 10; ++i) { diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridEditorConverterNotFound.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridEditorConverterNotFound.java index fafdafc23c..000d7917fa 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridEditorConverterNotFound.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridEditorConverterNotFound.java @@ -18,7 +18,7 @@ package com.vaadin.tests.components.grid; import com.vaadin.server.ErrorHandler; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUIWithLog; -import com.vaadin.ui.Grid; +import com.vaadin.ui.LegacyGrid; public class GridEditorConverterNotFound extends AbstractTestUIWithLog { @@ -28,7 +28,7 @@ public class GridEditorConverterNotFound extends AbstractTestUIWithLog { @Override protected void setup(VaadinRequest request) { - Grid grid = new Grid(); + LegacyGrid grid = new LegacyGrid(); grid.addColumn("foo", Foo.class); grid.addRow(new Foo()); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridEditorCustomField.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridEditorCustomField.java index 8e4dd45965..7483e4e11c 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridEditorCustomField.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridEditorCustomField.java @@ -26,7 +26,7 @@ import com.vaadin.ui.Button; import com.vaadin.ui.ComboBox; import com.vaadin.ui.Component; import com.vaadin.ui.CustomField; -import com.vaadin.ui.Grid; +import com.vaadin.ui.LegacyGrid; import com.vaadin.ui.HorizontalLayout; @Theme("valo") @@ -34,7 +34,7 @@ public class GridEditorCustomField extends AbstractTestUIWithLog { @Override protected void setup(VaadinRequest request) { - Grid grid = new PersonTestGrid(100); + LegacyGrid grid = new PersonTestGrid(100); grid.setWidth("800px"); grid.setColumns("firstName", "lastName", "address.city"); grid.setEditorEnabled(true); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridEditorFrozenColumnsUI.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridEditorFrozenColumnsUI.java index eac6eee5b2..070b461a84 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridEditorFrozenColumnsUI.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridEditorFrozenColumnsUI.java @@ -16,13 +16,13 @@ package com.vaadin.tests.components.grid; import com.vaadin.tests.util.PersonContainer; -import com.vaadin.ui.Grid; +import com.vaadin.ui.LegacyGrid; public class GridEditorFrozenColumnsUI extends GridEditorUI { @Override - protected Grid createGrid(PersonContainer container) { - Grid grid = super.createGrid(container); + protected LegacyGrid createGrid(PersonContainer container) { + LegacyGrid grid = super.createGrid(container); grid.setFrozenColumnCount(2); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridEditorMultiselect.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridEditorMultiselect.java index b80a9d1153..4a282ed6be 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridEditorMultiselect.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridEditorMultiselect.java @@ -2,13 +2,13 @@ package com.vaadin.tests.components.grid; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; -import com.vaadin.ui.Grid; +import com.vaadin.ui.LegacyGrid; public class GridEditorMultiselect extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { - Grid grid = new Grid(); + LegacyGrid grid = new LegacyGrid(); grid.addColumn("name"); grid.addColumn("age", Integer.class); @@ -18,7 +18,7 @@ public class GridEditorMultiselect extends AbstractTestUI { } grid.setEditorEnabled(true); - grid.setSelectionMode(Grid.SelectionMode.MULTI); + grid.setSelectionMode(LegacyGrid.SelectionMode.MULTI); addComponent(grid); } diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridEditorUI.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridEditorUI.java index 44f7ea5b16..746aef1962 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridEditorUI.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridEditorUI.java @@ -19,7 +19,7 @@ import com.vaadin.legacy.ui.LegacyTextField; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.tests.util.PersonContainer; -import com.vaadin.ui.Grid; +import com.vaadin.ui.LegacyGrid; import com.vaadin.ui.PasswordField; public class GridEditorUI extends AbstractTestUI { @@ -31,8 +31,8 @@ public class GridEditorUI extends AbstractTestUI { addComponent(createGrid(container)); } - protected Grid createGrid(PersonContainer container) { - Grid grid = new Grid(container); + protected LegacyGrid createGrid(PersonContainer container) { + LegacyGrid grid = new LegacyGrid(container); // Don't use address since there's no converter grid.removeColumn("address"); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridExtensionCommunication.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridExtensionCommunication.java index f1f23a2fda..41dba2f5bd 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridExtensionCommunication.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridExtensionCommunication.java @@ -22,17 +22,17 @@ import com.vaadin.shared.MouseEventDetails; import com.vaadin.tests.components.AbstractTestUIWithLog; import com.vaadin.tests.widgetset.TestingWidgetSet; import com.vaadin.tests.widgetset.client.grid.GridClickExtensionConnector.GridClickServerRpc; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.AbstractGridExtension; -import com.vaadin.ui.Grid.Column; -import com.vaadin.ui.Grid.SelectionMode; +import com.vaadin.ui.LegacyGrid; +import com.vaadin.ui.LegacyGrid.AbstractGridExtension; +import com.vaadin.ui.LegacyGrid.Column; +import com.vaadin.ui.LegacyGrid.SelectionMode; @Widgetset(TestingWidgetSet.NAME) public class GridExtensionCommunication extends AbstractTestUIWithLog { public class GridClickExtension extends AbstractGridExtension { - public GridClickExtension(Grid grid) { + public GridClickExtension(LegacyGrid grid) { super(grid); registerRpc(new GridClickServerRpc() { @@ -60,7 +60,7 @@ public class GridExtensionCommunication extends AbstractTestUIWithLog { @Override protected void setup(VaadinRequest request) { - Grid grid = new PersonTestGrid(50); + LegacyGrid grid = new PersonTestGrid(50); grid.setSelectionMode(SelectionMode.NONE); new GridClickExtension(grid); addComponent(grid); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridFastAsyncUpdate.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridFastAsyncUpdate.java index ef8b80c965..c2d114657f 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridFastAsyncUpdate.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridFastAsyncUpdate.java @@ -16,8 +16,8 @@ import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.SelectionMode; +import com.vaadin.ui.LegacyGrid; +import com.vaadin.ui.LegacyGrid.SelectionMode; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.VerticalLayout; @@ -65,7 +65,7 @@ public class GridFastAsyncUpdate extends AbstractTestUI { private int counter; - private Grid grid; + private LegacyGrid grid; private IndexedContainer container; private long loggingStart; private volatile boolean scrollLock = false; @@ -126,7 +126,7 @@ public class GridFastAsyncUpdate extends AbstractTestUI { container.addContainerProperty("level", String.class, null); container.addContainerProperty("message", String.class, null); - grid = new Grid(container); + grid = new LegacyGrid(container); grid.setWidth("100%"); grid.setImmediate(true); grid.setSelectionMode(SelectionMode.SINGLE); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridGeneratedProperties.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridGeneratedProperties.java index ff485362ae..a552cf2c71 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridGeneratedProperties.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridGeneratedProperties.java @@ -32,7 +32,7 @@ import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.Grid; +import com.vaadin.ui.LegacyGrid; public class GridGeneratedProperties extends AbstractTestUI { @@ -43,7 +43,7 @@ public class GridGeneratedProperties extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { container = new GeneratedPropertyContainer(createContainer()); - Grid grid = new Grid(container); + LegacyGrid grid = new LegacyGrid(container); addComponent(grid); container.addGeneratedProperty("miles", diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridHeaderFooterComponents.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridHeaderFooterComponents.java index 4ffc056b51..773f46679f 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridHeaderFooterComponents.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridHeaderFooterComponents.java @@ -23,9 +23,9 @@ import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.Component; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.FooterRow; -import com.vaadin.ui.Grid.HeaderRow; +import com.vaadin.ui.LegacyGrid; +import com.vaadin.ui.LegacyGrid.FooterRow; +import com.vaadin.ui.LegacyGrid.HeaderRow; import com.vaadin.ui.TextField; @Theme("valo") @@ -33,13 +33,13 @@ public class GridHeaderFooterComponents extends AbstractTestUIWithLog { @Override protected void setup(VaadinRequest request) { - final Grid grid = new Grid(); + final LegacyGrid grid = new LegacyGrid(); grid.setWidth("800px"); grid.setContainerDataSource(createContainer()); grid.setFooterVisible(true); final HeaderRow defaultRow = grid.getDefaultHeaderRow(); final HeaderRow toggleVisibilityRow = grid.appendHeaderRow(); - final Grid.HeaderRow filterRow = grid.appendHeaderRow(); + final LegacyGrid.HeaderRow filterRow = grid.appendHeaderRow(); final FooterRow footerRow = grid.addFooterRowAt(0); final FooterRow toggleVisibilityFooterRow = grid.addFooterRowAt(0); @@ -48,8 +48,8 @@ public class GridHeaderFooterComponents extends AbstractTestUIWithLog { // Set up a filter for all columns for (final Object pid : grid.getContainerDataSource() .getContainerPropertyIds()) { - final Grid.HeaderCell headerCell = filterRow.getCell(pid); - final Grid.FooterCell footerCell = filterFooterRow.getCell(pid); + final LegacyGrid.HeaderCell headerCell = filterRow.getCell(pid); + final LegacyGrid.FooterCell footerCell = filterFooterRow.getCell(pid); headerCell.setComponent(createTextField(pid)); footerCell.setComponent(createTextField(pid)); @@ -86,7 +86,7 @@ public class GridHeaderFooterComponents extends AbstractTestUIWithLog { filterFooterRow.getCell("string").getComponent().setVisible(false); } - private void addRemoveHeaderRow(final Grid grid, final HeaderRow row) { + private void addRemoveHeaderRow(final LegacyGrid grid, final HeaderRow row) { row.getCell("action") .setComponent(new Button("Remove row", new ClickListener() { @Override @@ -97,7 +97,7 @@ public class GridHeaderFooterComponents extends AbstractTestUIWithLog { } - private void addRemoveFooterRow(final Grid grid, final FooterRow row) { + private void addRemoveFooterRow(final LegacyGrid grid, final FooterRow row) { row.getCell("action") .setComponent(new Button("Remove row", new ClickListener() { @Override diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridHeaderFormatChange.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridHeaderFormatChange.java index 238b9c03c3..885e8ae9f9 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridHeaderFormatChange.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridHeaderFormatChange.java @@ -22,10 +22,10 @@ import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.HeaderRow; -import com.vaadin.ui.Grid.SelectionMode; -import com.vaadin.ui.Grid.SelectionModel; +import com.vaadin.ui.LegacyGrid; +import com.vaadin.ui.LegacyGrid.HeaderRow; +import com.vaadin.ui.LegacyGrid.SelectionMode; +import com.vaadin.ui.LegacyGrid.SelectionModel; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.renderers.NumberRenderer; @@ -99,12 +99,12 @@ public class GridHeaderFormatChange extends AbstractTestUI { protected void setup(VaadinRequest request) { BeanItemContainer<Person> datasource = new BeanItemContainer<Person>( Person.class); - final Grid grid; + final LegacyGrid grid; datasource.addItem(new Person("Rudolph", "Reindeer", "Ruukinkatu 2-4", 20540, "Turku")); - grid = new Grid(datasource); + grid = new LegacyGrid(datasource); grid.setWidth("600px"); grid.getColumn("zipCode").setRenderer(new NumberRenderer()); grid.setColumnOrder("firstName", "lastName", "streetAddress", "zipCode", diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridHeaderStyleNames.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridHeaderStyleNames.java index 446a90311a..d8be65449c 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridHeaderStyleNames.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridHeaderStyleNames.java @@ -22,12 +22,12 @@ import com.vaadin.tests.components.beanitemcontainer.BeanItemContainerGenerator; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.FooterCell; -import com.vaadin.ui.Grid.FooterRow; -import com.vaadin.ui.Grid.HeaderCell; -import com.vaadin.ui.Grid.HeaderRow; -import com.vaadin.ui.Grid.SelectionMode; +import com.vaadin.ui.LegacyGrid; +import com.vaadin.ui.LegacyGrid.FooterCell; +import com.vaadin.ui.LegacyGrid.FooterRow; +import com.vaadin.ui.LegacyGrid.HeaderCell; +import com.vaadin.ui.LegacyGrid.HeaderRow; +import com.vaadin.ui.LegacyGrid.SelectionMode; @Theme("valo") public class GridHeaderStyleNames extends AbstractTestUIWithLog { @@ -40,7 +40,7 @@ public class GridHeaderStyleNames extends AbstractTestUIWithLog { @Override protected void setup(VaadinRequest request) { - Grid grid = new Grid(); + LegacyGrid grid = new LegacyGrid(); grid.setSelectionMode(SelectionMode.MULTI); grid.setContainerDataSource( BeanItemContainerGenerator.createContainer(100)); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridHeight.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridHeight.java index c22bc56103..986d4a3d77 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridHeight.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridHeight.java @@ -28,9 +28,9 @@ import com.vaadin.shared.ui.grid.HeightMode; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Alignment; import com.vaadin.ui.Component; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.DetailsGenerator; -import com.vaadin.ui.Grid.RowReference; +import com.vaadin.ui.LegacyGrid; +import com.vaadin.ui.LegacyGrid.DetailsGenerator; +import com.vaadin.ui.LegacyGrid.RowReference; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Label; import com.vaadin.ui.OptionGroup; @@ -53,14 +53,14 @@ public class GridHeight extends AbstractTestUI { static final String[] gridWidths = { FULL, UNDEFINED }; static final String[] detailsRowHeights = { FULL, UNDEFINED, PX100 }; - private Grid grid; + private LegacyGrid grid; private Map<Object, VerticalLayout> detailsLayouts = new HashMap<Object, VerticalLayout>(); private OptionGroup detailsHeightSelector; @Override protected void setup(VaadinRequest request) { - grid = new Grid(); + grid = new LegacyGrid(); grid.addColumn("name", String.class); grid.addColumn("born", Integer.class); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridInGridLayout.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridInGridLayout.java index fe08cede02..8f26f91820 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridInGridLayout.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridInGridLayout.java @@ -18,7 +18,7 @@ package com.vaadin.tests.components.grid; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.CssLayout; -import com.vaadin.ui.Grid; +import com.vaadin.ui.LegacyGrid; import com.vaadin.ui.VerticalLayout; public class GridInGridLayout extends AbstractTestUI { @@ -33,10 +33,10 @@ public class GridInGridLayout extends AbstractTestUI { addComponent(cssLayout); cssLayout.addComponent(layout); - final Grid grid = new Grid(); + final LegacyGrid grid = new LegacyGrid(); grid.setSizeFull(); for (int i = 0; i < 20; i++) { - Grid.Column column = grid.addColumn("" + i); + LegacyGrid.Column column = grid.addColumn("" + i); column.setHidable(true); column.setEditable(true); } diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridInTabSheet.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridInTabSheet.java index 0f715c9d6a..f9df174cb4 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridInTabSheet.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridInTabSheet.java @@ -19,10 +19,10 @@ import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.CellReference; -import com.vaadin.ui.Grid.CellStyleGenerator; -import com.vaadin.ui.Grid.SelectionMode; +import com.vaadin.ui.LegacyGrid; +import com.vaadin.ui.LegacyGrid.CellReference; +import com.vaadin.ui.LegacyGrid.CellStyleGenerator; +import com.vaadin.ui.LegacyGrid.SelectionMode; import com.vaadin.ui.Label; import com.vaadin.ui.TabSheet; @@ -31,7 +31,7 @@ public class GridInTabSheet extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { TabSheet sheet = new TabSheet(); - final Grid grid = new Grid(); + final LegacyGrid grid = new LegacyGrid(); grid.setSelectionMode(SelectionMode.MULTI); grid.addColumn("count", Integer.class); for (Integer i = 0; i < 3; ++i) { diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridInWindowResize.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridInWindowResize.java index c0422bb5a3..d1c5bb623a 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridInWindowResize.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridInWindowResize.java @@ -23,7 +23,7 @@ import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.Grid; +import com.vaadin.ui.LegacyGrid; import com.vaadin.ui.VerticalLayout; import com.vaadin.ui.Window; @@ -32,7 +32,7 @@ public class GridInWindowResize extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { - Grid g = new Grid(); + LegacyGrid g = new LegacyGrid(); IndexedContainer cont = new IndexedContainer(); for (int j = 0; j < 3; j++) { cont.addContainerProperty("" + j, String.class, ""); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridInitiallyHiddenColumns.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridInitiallyHiddenColumns.java index 931110a698..32bd184ded 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridInitiallyHiddenColumns.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridInitiallyHiddenColumns.java @@ -18,13 +18,13 @@ package com.vaadin.tests.components.grid; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUIWithLog; import com.vaadin.tests.fieldgroup.ComplexPerson; -import com.vaadin.ui.Grid; +import com.vaadin.ui.LegacyGrid; public class GridInitiallyHiddenColumns extends AbstractTestUIWithLog { @Override protected void setup(VaadinRequest request) { - Grid grid = new Grid(); + LegacyGrid grid = new LegacyGrid(); grid.setContainerDataSource(ComplexPerson.createContainer(100)); grid.setColumns("firstName", "lastName", "age"); grid.getColumn("firstName").setHidden(true).setHidable(true); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridItemSetChange.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridItemSetChange.java index 3ab7b6ff3d..51477a0634 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridItemSetChange.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridItemSetChange.java @@ -22,7 +22,7 @@ import com.vaadin.tests.util.Person; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.Grid; +import com.vaadin.ui.LegacyGrid; public class GridItemSetChange extends AbstractTestUI { @@ -46,7 +46,7 @@ public class GridItemSetChange extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { final SneakyBeanContainer c = new SneakyBeanContainer(); - Grid g = new Grid(c); + LegacyGrid g = new LegacyGrid(c); g.setColumns("firstName", "lastName"); addComponent(g); addComponent(new Button("Reset", new ClickListener() { diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridLayoutDetailsRow.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridLayoutDetailsRow.java index a24632cb20..68c41e60cb 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridLayoutDetailsRow.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridLayoutDetailsRow.java @@ -20,9 +20,9 @@ import com.vaadin.event.ItemClickEvent.ItemClickListener; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Component; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.DetailsGenerator; -import com.vaadin.ui.Grid.RowReference; +import com.vaadin.ui.LegacyGrid; +import com.vaadin.ui.LegacyGrid.DetailsGenerator; +import com.vaadin.ui.LegacyGrid.RowReference; import com.vaadin.ui.GridLayout; import com.vaadin.ui.Label; @@ -35,7 +35,7 @@ public class GridLayoutDetailsRow extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { - final Grid grid = new Grid(); + final LegacyGrid grid = new LegacyGrid(); grid.setSizeFull(); grid.addColumn("name", String.class); grid.addColumn("born", Integer.class); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridMultiSelectionOnInit.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridMultiSelectionOnInit.java index fe73546f04..802acd31ca 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridMultiSelectionOnInit.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridMultiSelectionOnInit.java @@ -19,15 +19,15 @@ import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.MultiSelectionModel; -import com.vaadin.ui.Grid.SelectionMode; +import com.vaadin.ui.LegacyGrid; +import com.vaadin.ui.LegacyGrid.MultiSelectionModel; +import com.vaadin.ui.LegacyGrid.SelectionMode; public class GridMultiSelectionOnInit extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { - final Grid grid = new Grid(); + final LegacyGrid grid = new LegacyGrid(); grid.addColumn("foo", String.class); grid.addRow("Foo 1"); grid.addRow("Foo 2"); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridMultiSelectionScrollBar.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridMultiSelectionScrollBar.java index 71491a2350..08b44b040b 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridMultiSelectionScrollBar.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridMultiSelectionScrollBar.java @@ -17,13 +17,13 @@ package com.vaadin.tests.components.grid; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; -import com.vaadin.ui.Grid; +import com.vaadin.ui.LegacyGrid; public class GridMultiSelectionScrollBar extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { - Grid grid = new Grid(); + LegacyGrid grid = new LegacyGrid(); grid.addColumn("X").setWidth(39.25d); grid.addColumn("Hello"); grid.addColumn("World"); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridRendererChange.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridRendererChange.java index bce2037366..c8a473bc01 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridRendererChange.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridRendererChange.java @@ -19,7 +19,7 @@ import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Grid; +import com.vaadin.ui.LegacyGrid; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.renderers.ButtonRenderer; import com.vaadin.ui.renderers.HtmlRenderer; @@ -30,7 +30,7 @@ public class GridRendererChange extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { - final Grid grid = new Grid(); + final LegacyGrid grid = new LegacyGrid(); grid.setColumns("num", "foo"); grid.getColumn("num").setRenderer(new ButtonRenderer()); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridReplaceContainer.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridReplaceContainer.java index 3756f72799..3d1a8a2c7e 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridReplaceContainer.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridReplaceContainer.java @@ -23,14 +23,14 @@ import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUIWithLog; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.SelectionMode; +import com.vaadin.ui.LegacyGrid; +import com.vaadin.ui.LegacyGrid.SelectionMode; public class GridReplaceContainer extends AbstractTestUIWithLog { @Override protected void setup(VaadinRequest request) { - final Grid grid = new Grid(); + final LegacyGrid grid = new LegacyGrid(); grid.setSelectionMode(SelectionMode.SINGLE); grid.setContainerDataSource(createContainer()); grid.addSelectionListener(new SelectionListener() { diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridResizeAndScroll.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridResizeAndScroll.java index 6025134ac9..d35450e889 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridResizeAndScroll.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridResizeAndScroll.java @@ -21,8 +21,8 @@ import com.vaadin.event.SelectionEvent; import com.vaadin.event.SelectionEvent.SelectionListener; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.SelectionMode; +import com.vaadin.ui.LegacyGrid; +import com.vaadin.ui.LegacyGrid.SelectionMode; import com.vaadin.ui.VerticalLayout; public class GridResizeAndScroll extends AbstractTestUI { @@ -32,7 +32,7 @@ public class GridResizeAndScroll extends AbstractTestUI { VerticalLayout content = new VerticalLayout(); addComponent(content); - final Grid g = new Grid(); + final LegacyGrid g = new LegacyGrid(); content.setHeight("500px"); content.addComponent(g); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridResizeHiddenColumn.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridResizeHiddenColumn.java index ae7dd716ef..7a7d01400e 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridResizeHiddenColumn.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridResizeHiddenColumn.java @@ -18,16 +18,16 @@ package com.vaadin.tests.components.grid; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUIWithLog; import com.vaadin.tests.fieldgroup.ComplexPerson; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.ColumnResizeEvent; -import com.vaadin.ui.Grid.ColumnResizeListener; +import com.vaadin.ui.LegacyGrid; +import com.vaadin.ui.LegacyGrid.ColumnResizeEvent; +import com.vaadin.ui.LegacyGrid.ColumnResizeListener; @SuppressWarnings("serial") public class GridResizeHiddenColumn extends AbstractTestUIWithLog { @Override protected void setup(VaadinRequest request) { - Grid grid = new Grid(); + LegacyGrid grid = new LegacyGrid(); grid.setContainerDataSource(ComplexPerson.createContainer(100)); grid.setColumns("firstName", "lastName", "gender", "birthDate"); grid.getColumn("firstName").setHidable(true); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridResizeTerror.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridResizeTerror.java index 09b8dc5e33..b97ce60a07 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridResizeTerror.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridResizeTerror.java @@ -19,14 +19,14 @@ import com.vaadin.annotations.Widgetset; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.util.ResizeTerrorizer; import com.vaadin.tests.widgetset.TestingWidgetSet; -import com.vaadin.ui.Grid; +import com.vaadin.ui.LegacyGrid; import com.vaadin.ui.UI; @Widgetset(TestingWidgetSet.NAME) public class GridResizeTerror extends UI { @Override protected void init(VaadinRequest request) { - Grid grid = new Grid(); + LegacyGrid grid = new LegacyGrid(); int cols = 10; Object[] data = new Object[cols]; diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridRowHeightChange.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridRowHeightChange.java index 377d0e74e2..25fe0c7570 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridRowHeightChange.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridRowHeightChange.java @@ -4,7 +4,7 @@ import com.vaadin.data.Property; import com.vaadin.server.VaadinRequest; import com.vaadin.shared.ui.grid.HeightMode; import com.vaadin.tests.components.AbstractTestUI; -import com.vaadin.ui.Grid; +import com.vaadin.ui.LegacyGrid; import com.vaadin.ui.NativeSelect; import com.vaadin.ui.TabSheet; import com.vaadin.ui.VerticalLayout; @@ -19,7 +19,7 @@ public class GridRowHeightChange extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { - Grid grid = new Grid(); + LegacyGrid grid = new LegacyGrid(); // create column and fill rows grid.addColumn("Header"); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridScrollToLineWhileResizing.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridScrollToLineWhileResizing.java index 72f0535f37..6843ce8376 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridScrollToLineWhileResizing.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridScrollToLineWhileResizing.java @@ -21,8 +21,8 @@ import com.vaadin.event.SelectionEvent; import com.vaadin.event.SelectionEvent.SelectionListener; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.SelectionMode; +import com.vaadin.ui.LegacyGrid; +import com.vaadin.ui.LegacyGrid.SelectionMode; import com.vaadin.ui.VerticalSplitPanel; public class GridScrollToLineWhileResizing extends AbstractTestUI { @@ -44,7 +44,7 @@ public class GridScrollToLineWhileResizing extends AbstractTestUI { addItem.getItemProperty("column1").setValue("cell" + i); } - final Grid grid = new Grid(indexedContainer); + final LegacyGrid grid = new LegacyGrid(indexedContainer); grid.setSizeFull(); grid.setSelectionMode(SelectionMode.SINGLE); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridScrolling.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridScrolling.java index cc1cd587ca..1698acc917 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridScrolling.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridScrolling.java @@ -23,14 +23,14 @@ import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.Grid; +import com.vaadin.ui.LegacyGrid; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.VerticalLayout; @SuppressWarnings("serial") public class GridScrolling extends AbstractTestUI { - private Grid grid; + private LegacyGrid grid; private IndexedContainer ds; @@ -52,7 +52,7 @@ public class GridScrolling extends AbstractTestUI { } } - grid = new Grid(ds); + grid = new LegacyGrid(ds); HorizontalLayout hl = new HorizontalLayout(); hl.addComponent(grid); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridSelectAllCell.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridSelectAllCell.java index 1b31c38994..7b49fde9b0 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridSelectAllCell.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridSelectAllCell.java @@ -3,18 +3,18 @@ package com.vaadin.tests.components.grid; import com.vaadin.annotations.Theme; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; -import com.vaadin.ui.Grid; +import com.vaadin.ui.LegacyGrid; @Theme("valo") public class GridSelectAllCell extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { - Grid grid = new Grid(); + LegacyGrid grid = new LegacyGrid(); grid.addColumn("foo", String.class); grid.addRow("bar"); - grid.setSelectionMode(Grid.SelectionMode.MULTI); + grid.setSelectionMode(LegacyGrid.SelectionMode.MULTI); addComponent(grid); } diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridSidebarPosition.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridSidebarPosition.java index dcae1236f5..2b442981ae 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridSidebarPosition.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridSidebarPosition.java @@ -19,7 +19,7 @@ import com.vaadin.annotations.Theme; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Alignment; -import com.vaadin.ui.Grid; +import com.vaadin.ui.LegacyGrid; import com.vaadin.ui.HorizontalLayout; @Theme("valo") @@ -35,7 +35,7 @@ public class GridSidebarPosition extends AbstractTestUI { hl.setSpacing(true); hl.setHeight("100%"); setContent(hl); - Grid grid = new Grid("Popup window height"); + LegacyGrid grid = new LegacyGrid("Popup window height"); grid.setId(POPUP_WINDOW_HEIGHT); grid.setWidth("100px"); for (int i = 0; i < 30; i++) { @@ -46,7 +46,7 @@ public class GridSidebarPosition extends AbstractTestUI { } hl.addComponent(grid); - grid = new Grid("Popup moved up"); + grid = new LegacyGrid("Popup moved up"); grid.setId(POPUP_WINDOW_MOVED_UP); grid.setWidth("100px"); grid.setHeight("400px"); @@ -56,7 +56,7 @@ public class GridSidebarPosition extends AbstractTestUI { hl.addComponent(grid); hl.setComponentAlignment(grid, Alignment.BOTTOM_LEFT); - grid = new Grid("Popup above"); + grid = new LegacyGrid("Popup above"); grid.setId(POPUP_ABOVE); grid.setWidth("100px"); grid.setHeight("200px"); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridSingleColumn.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridSingleColumn.java index d8ed5aec4e..d7de9e2ad6 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridSingleColumn.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridSingleColumn.java @@ -19,9 +19,9 @@ import com.vaadin.data.Item; import com.vaadin.data.util.IndexedContainer; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.Column; -import com.vaadin.ui.Grid.SelectionMode; +import com.vaadin.ui.LegacyGrid; +import com.vaadin.ui.LegacyGrid.Column; +import com.vaadin.ui.LegacyGrid.SelectionMode; public class GridSingleColumn extends AbstractTestUI { @@ -36,7 +36,7 @@ public class GridSingleColumn extends AbstractTestUI { addItem.getItemProperty("column1").setValue("cell"); } - Grid grid = new Grid(indexedContainer); + LegacyGrid grid = new LegacyGrid(indexedContainer); grid.setSelectionMode(SelectionMode.NONE); Column column = grid.getColumn("column1"); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridSortIndicator.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridSortIndicator.java index 96361152b8..2964109edc 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridSortIndicator.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridSortIndicator.java @@ -24,7 +24,7 @@ import com.vaadin.event.SortEvent.SortListener; import com.vaadin.server.VaadinRequest; import com.vaadin.shared.data.sort.SortDirection; import com.vaadin.tests.components.AbstractTestUI; -import com.vaadin.ui.Grid; +import com.vaadin.ui.LegacyGrid; /* * Test UI for checking that sort indicators of a Grid are updated when the sort order is changed by a @@ -34,7 +34,7 @@ public class GridSortIndicator extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { - final Grid g = getGrid(); + final LegacyGrid g = getGrid(); addComponent(g); g.addSortListener(new SortListener() { private SortDirection oldSortDirection = null; @@ -68,8 +68,8 @@ public class GridSortIndicator extends AbstractTestUI { }); } - private final Grid getGrid() { - Grid g = new Grid(); + private final LegacyGrid getGrid() { + LegacyGrid g = new LegacyGrid(); g.addColumn("Name"); g.addColumn("Value", Integer.class); g.addRow(new Object[] { "a", 4 }); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridSubPixelProblemWrapping.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridSubPixelProblemWrapping.java index 856a56db9e..a675ed6854 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridSubPixelProblemWrapping.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridSubPixelProblemWrapping.java @@ -24,8 +24,8 @@ import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.SelectionMode; +import com.vaadin.ui.LegacyGrid; +import com.vaadin.ui.LegacyGrid.SelectionMode; @Theme("valo") public class GridSubPixelProblemWrapping extends AbstractTestUI { @@ -79,7 +79,7 @@ public class GridSubPixelProblemWrapping extends AbstractTestUI { addComponent(button); container = new BeanItemContainer<DataObject>(DataObject.class); container.addBean(new DataObject("Foo", "Bar")); - Grid grid = new Grid(container); + LegacyGrid grid = new LegacyGrid(container); grid.getColumn("foo").setWidth(248.525); grid.setSelectionMode(SelectionMode.SINGLE); grid.setEditorEnabled(true); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridSwitchRenderers.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridSwitchRenderers.java index 9c4ce0fb45..d98796dd43 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridSwitchRenderers.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridSwitchRenderers.java @@ -9,9 +9,9 @@ import com.vaadin.data.util.IndexedContainer; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUIWithLog; import com.vaadin.ui.CheckBox; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.Column; -import com.vaadin.ui.Grid.SelectionMode; +import com.vaadin.ui.LegacyGrid; +import com.vaadin.ui.LegacyGrid.Column; +import com.vaadin.ui.LegacyGrid.SelectionMode; import com.vaadin.ui.renderers.HtmlRenderer; import com.vaadin.ui.renderers.TextRenderer; @@ -54,7 +54,7 @@ public class GridSwitchRenderers extends AbstractTestUIWithLog { item.getItemProperty(getColumnProperty(1)).setReadOnly(true); } - final Grid grid = new Grid(ds); + final LegacyGrid grid = new LegacyGrid(ds); grid.setWidth("100%"); grid.getColumn(EXPANSION_COLUMN_ID).setWidth(50); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridThemeChange.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridThemeChange.java index 10117afffd..bb1172991f 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridThemeChange.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridThemeChange.java @@ -22,8 +22,8 @@ import com.vaadin.event.SelectionEvent; import com.vaadin.event.SelectionEvent.SelectionListener; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.SelectionMode; +import com.vaadin.ui.LegacyGrid; +import com.vaadin.ui.LegacyGrid.SelectionMode; public class GridThemeChange extends AbstractTestUI { private final List<String> themes = Arrays.asList("valo", "reindeer", @@ -31,7 +31,7 @@ public class GridThemeChange extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { - final Grid grid = new Grid(); + final LegacyGrid grid = new LegacyGrid(); grid.setSelectionMode(SelectionMode.SINGLE); grid.addColumn("Theme"); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridThemeUI.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridThemeUI.java index 31fdc0ac3f..953b531a0d 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridThemeUI.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridThemeUI.java @@ -33,14 +33,14 @@ import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.ComboBox; import com.vaadin.ui.Component; -import com.vaadin.ui.Grid; +import com.vaadin.ui.LegacyGrid; import com.vaadin.ui.NativeSelect; import com.vaadin.ui.renderers.DateRenderer; @Theme("valo") public class GridThemeUI extends AbstractTestUIWithLog { - private Grid grid; + private LegacyGrid grid; protected static String[] columns = new String[] { "firstName", "lastName", "gender", "birthDate", "age", "alive", "address.streetAddress", @@ -82,7 +82,7 @@ public class GridThemeUI extends AbstractTestUIWithLog { } - public class Editor extends Grid { + public class Editor extends LegacyGrid { @Override public String toString() { return "Editor"; @@ -103,7 +103,7 @@ public class GridThemeUI extends AbstractTestUIWithLog { } } - public class HeaderFooter extends Grid { + public class HeaderFooter extends LegacyGrid { @Override public String toString() { return getClass().getSimpleName(); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridWidthIncrease.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridWidthIncrease.java index a1891b9103..fed8214049 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridWidthIncrease.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridWidthIncrease.java @@ -19,7 +19,7 @@ import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Grid; +import com.vaadin.ui.LegacyGrid; public class GridWidthIncrease extends AbstractTestUI { @@ -27,7 +27,7 @@ public class GridWidthIncrease extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { - final Grid grid = new Grid(); + final LegacyGrid grid = new LegacyGrid(); Object[] rowData = new String[COLUMN_COUNT]; for (int i = 0; i < COLUMN_COUNT; ++i) { grid.addColumn("Column " + i, String.class); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridWithBrokenRenderer.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridWithBrokenRenderer.java index cdfd2e0047..a3e6f1a0e0 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridWithBrokenRenderer.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridWithBrokenRenderer.java @@ -20,14 +20,14 @@ import com.vaadin.server.Resource; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUIWithLog; import com.vaadin.tests.integration.FlagSeResource; -import com.vaadin.ui.Grid; +import com.vaadin.ui.LegacyGrid; import com.vaadin.ui.renderers.ImageRenderer; public class GridWithBrokenRenderer extends AbstractTestUIWithLog { @Override protected void setup(VaadinRequest request) { - final Grid grid = new Grid(); + final LegacyGrid grid = new LegacyGrid(); grid.addColumn("short", String.class); grid.addColumn("icon", Resource.class); grid.addColumn("country", String.class); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridWithLabelEditor.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridWithLabelEditor.java index 0d720b1f79..b3d556e08f 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridWithLabelEditor.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridWithLabelEditor.java @@ -22,7 +22,7 @@ import com.vaadin.legacy.data.Validator.InvalidValueException; import com.vaadin.legacy.ui.LegacyField; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; -import com.vaadin.ui.Grid; +import com.vaadin.ui.LegacyGrid; import com.vaadin.ui.Label; public class GridWithLabelEditor extends AbstractTestUI { @@ -141,7 +141,7 @@ public class GridWithLabelEditor extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { - Grid grid = new Grid(); + LegacyGrid grid = new LegacyGrid(); addComponent(grid); grid.setEditorEnabled(true); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridWithoutRenderer.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridWithoutRenderer.java index 70c065d128..3f7249d00f 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridWithoutRenderer.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridWithoutRenderer.java @@ -19,14 +19,14 @@ import com.vaadin.annotations.Theme; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.tests.util.PersonContainer; -import com.vaadin.ui.Grid; +import com.vaadin.ui.LegacyGrid; @Theme("valo") public class GridWithoutRenderer extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { - Grid grid = new Grid(); + LegacyGrid grid = new LegacyGrid(); grid.setContainerDataSource(PersonContainer.createWithTestData()); addComponent(grid); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/InitialFrozenColumns.java b/uitest/src/main/java/com/vaadin/tests/components/grid/InitialFrozenColumns.java index 1c43d2b6bb..37302d73c1 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/InitialFrozenColumns.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/InitialFrozenColumns.java @@ -17,14 +17,14 @@ package com.vaadin.tests.components.grid; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.SelectionMode; +import com.vaadin.ui.LegacyGrid; +import com.vaadin.ui.LegacyGrid.SelectionMode; public class InitialFrozenColumns extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { - Grid grid = new Grid(); + LegacyGrid grid = new LegacyGrid(); grid.setSelectionMode(SelectionMode.NONE); grid.addColumn("foo").setWidth(200); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/IntArrayRenderer.java b/uitest/src/main/java/com/vaadin/tests/components/grid/IntArrayRenderer.java index 9933cf4642..65c9894df1 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/IntArrayRenderer.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/IntArrayRenderer.java @@ -15,7 +15,7 @@ */ package com.vaadin.tests.components.grid; -import com.vaadin.ui.Grid.AbstractRenderer; +import com.vaadin.ui.LegacyGrid.AbstractRenderer; public class IntArrayRenderer extends AbstractRenderer<int[]> { public IntArrayRenderer() { diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/JavaScriptRenderers.java b/uitest/src/main/java/com/vaadin/tests/components/grid/JavaScriptRenderers.java index b359668998..4a92b3d572 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/JavaScriptRenderers.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/JavaScriptRenderers.java @@ -19,7 +19,7 @@ import com.vaadin.data.Item; import com.vaadin.data.util.IndexedContainer; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; -import com.vaadin.ui.Grid; +import com.vaadin.ui.LegacyGrid; public class JavaScriptRenderers extends AbstractTestUI { @@ -66,7 +66,7 @@ public class JavaScriptRenderers extends AbstractTestUI { item.getItemProperty("string").setValue("string" + i); } - Grid grid = new Grid(container); + LegacyGrid grid = new LegacyGrid(container); grid.getColumn("bean").setRenderer(new MyBeanJSRenderer()); grid.getColumn("bean").setWidth(250); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/NullHeaders.java b/uitest/src/main/java/com/vaadin/tests/components/grid/NullHeaders.java index 2ef4ef8a5f..6f0ac07182 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/NullHeaders.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/NullHeaders.java @@ -17,13 +17,13 @@ package com.vaadin.tests.components.grid; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUIWithLog; -import com.vaadin.ui.Grid; +import com.vaadin.ui.LegacyGrid; public class NullHeaders extends AbstractTestUIWithLog { @Override protected void setup(VaadinRequest request) { - final Grid grid = new Grid(); + final LegacyGrid grid = new LegacyGrid(); grid.addColumn("country", String.class); grid.addColumn("foo", String.class); grid.addColumn("bar", Integer.class); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/NullRenderers.java b/uitest/src/main/java/com/vaadin/tests/components/grid/NullRenderers.java index 1cdf94020e..32934114d2 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/NullRenderers.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/NullRenderers.java @@ -22,8 +22,8 @@ import com.vaadin.data.util.IndexedContainer; import com.vaadin.server.Resource; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.SelectionMode; +import com.vaadin.ui.LegacyGrid; +import com.vaadin.ui.LegacyGrid.SelectionMode; import com.vaadin.ui.renderers.ButtonRenderer; import com.vaadin.ui.renderers.ClickableRenderer.RendererClickEvent; import com.vaadin.ui.renderers.ClickableRenderer.RendererClickListener; @@ -56,7 +56,7 @@ public class NullRenderers extends AbstractTestUI { container.addItem(); - final Grid gridDefaults = new Grid(container); + final LegacyGrid gridDefaults = new LegacyGrid(container); gridDefaults.setId("test-grid-defaults"); gridDefaults.setSelectionMode(SelectionMode.NONE); @@ -91,7 +91,7 @@ public class NullRenderers extends AbstractTestUI { addComponent(gridDefaults); - final Grid gridNoDefaults = new Grid(container); + final LegacyGrid gridNoDefaults = new LegacyGrid(container); gridNoDefaults.setId("test-grid"); gridNoDefaults.setSelectionMode(SelectionMode.NONE); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/PersonTestGrid.java b/uitest/src/main/java/com/vaadin/tests/components/grid/PersonTestGrid.java index 629d72d039..b5b92d5d9e 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/PersonTestGrid.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/PersonTestGrid.java @@ -17,9 +17,9 @@ package com.vaadin.tests.components.grid; import com.vaadin.data.util.BeanItemContainer; import com.vaadin.tests.fieldgroup.ComplexPerson; -import com.vaadin.ui.Grid; +import com.vaadin.ui.LegacyGrid; -public class PersonTestGrid extends Grid { +public class PersonTestGrid extends LegacyGrid { public PersonTestGrid(int size) { BeanItemContainer<ComplexPerson> container = ComplexPerson diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/ProgrammaticEditorControl.java b/uitest/src/main/java/com/vaadin/tests/components/grid/ProgrammaticEditorControl.java index a9075a77d1..394b66471d 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/ProgrammaticEditorControl.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/ProgrammaticEditorControl.java @@ -6,20 +6,20 @@ import com.vaadin.tests.components.AbstractTestUIWithLog; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.Grid; +import com.vaadin.ui.LegacyGrid; @SuppressWarnings("serial") // @Push public class ProgrammaticEditorControl extends AbstractTestUIWithLog { - private Grid grid; + private LegacyGrid grid; private IndexedContainer container = new IndexedContainer(); @Override protected void setup(VaadinRequest request) { container.addContainerProperty("name", String.class, null); container.addItem("test").getItemProperty("name").setValue("test"); - grid = new Grid(); + grid = new LegacyGrid(); grid.setContainerDataSource(container); grid.setEditorEnabled(true); addComponent(grid); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/RowAwareRenderer.java b/uitest/src/main/java/com/vaadin/tests/components/grid/RowAwareRenderer.java index 25bd6ae2ea..5c4d2497af 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/RowAwareRenderer.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/RowAwareRenderer.java @@ -16,7 +16,7 @@ package com.vaadin.tests.components.grid; import com.vaadin.tests.widgetset.client.grid.RowAwareRendererConnector.RowAwareRendererRpc; -import com.vaadin.ui.Grid.AbstractRenderer; +import com.vaadin.ui.LegacyGrid.AbstractRenderer; import com.vaadin.ui.Label; public class RowAwareRenderer extends AbstractRenderer<Void> { diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/SelectDuringInit.java b/uitest/src/main/java/com/vaadin/tests/components/grid/SelectDuringInit.java index 797c7622ad..306907f4c1 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/SelectDuringInit.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/SelectDuringInit.java @@ -17,14 +17,14 @@ package com.vaadin.tests.components.grid; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.SelectionMode; +import com.vaadin.ui.LegacyGrid; +import com.vaadin.ui.LegacyGrid.SelectionMode; public class SelectDuringInit extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { - Grid grid = new Grid(); + LegacyGrid grid = new LegacyGrid(); grid.setSelectionMode(SelectionMode.MULTI); grid.addColumn("value"); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/SortableHeaderStyles.java b/uitest/src/main/java/com/vaadin/tests/components/grid/SortableHeaderStyles.java index 9af68e97f3..b7eb564bac 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/SortableHeaderStyles.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/SortableHeaderStyles.java @@ -23,8 +23,8 @@ import com.vaadin.data.Property.ValueChangeListener; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.tests.util.PersonContainer; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.Column; +import com.vaadin.ui.LegacyGrid; +import com.vaadin.ui.LegacyGrid.Column; import com.vaadin.ui.OptionGroup; @Theme("valo") @@ -45,7 +45,7 @@ public class SortableHeaderStyles extends AbstractTestUI { sortableSelector.setMultiSelect(true); sortableSelector.setValue(sortableContainerPropertyIds); - final Grid grid = new Grid(container); + final LegacyGrid grid = new LegacyGrid(container); sortableSelector.addValueChangeListener(new ValueChangeListener() { @Override diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/WidgetRenderers.java b/uitest/src/main/java/com/vaadin/tests/components/grid/WidgetRenderers.java index f23a48e826..807c46e110 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/WidgetRenderers.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/WidgetRenderers.java @@ -23,8 +23,8 @@ import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.SelectionMode; +import com.vaadin.ui.LegacyGrid; +import com.vaadin.ui.LegacyGrid.SelectionMode; import com.vaadin.ui.NativeButton; import com.vaadin.ui.renderers.ButtonRenderer; import com.vaadin.ui.renderers.ImageRenderer; @@ -57,7 +57,7 @@ public class WidgetRenderers extends AbstractTestUI { .setValue(new ThemeResource("window/img/close.png")); item.getItemProperty(PROPERTY_ID).setValue("Click"); - final Grid grid = new Grid(container); + final LegacyGrid grid = new LegacyGrid(container); grid.setId("test-grid"); grid.setSelectionMode(SelectionMode.NONE); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java b/uitest/src/main/java/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java index 9dfa5ed763..9f22dbc46e 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java @@ -53,27 +53,27 @@ import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.Component; import com.vaadin.ui.CssLayout; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.CellDescriptionGenerator; -import com.vaadin.ui.Grid.CellReference; -import com.vaadin.ui.Grid.CellStyleGenerator; -import com.vaadin.ui.Grid.Column; -import com.vaadin.ui.Grid.ColumnReorderEvent; -import com.vaadin.ui.Grid.ColumnReorderListener; -import com.vaadin.ui.Grid.ColumnResizeEvent; -import com.vaadin.ui.Grid.ColumnResizeListener; -import com.vaadin.ui.Grid.ColumnVisibilityChangeEvent; -import com.vaadin.ui.Grid.ColumnVisibilityChangeListener; -import com.vaadin.ui.Grid.DetailsGenerator; -import com.vaadin.ui.Grid.FooterCell; -import com.vaadin.ui.Grid.HeaderCell; -import com.vaadin.ui.Grid.HeaderRow; -import com.vaadin.ui.Grid.MultiSelectionModel; -import com.vaadin.ui.Grid.RowDescriptionGenerator; -import com.vaadin.ui.Grid.RowReference; -import com.vaadin.ui.Grid.RowStyleGenerator; -import com.vaadin.ui.Grid.SelectionMode; -import com.vaadin.ui.Grid.SelectionModel; +import com.vaadin.ui.LegacyGrid; +import com.vaadin.ui.LegacyGrid.CellDescriptionGenerator; +import com.vaadin.ui.LegacyGrid.CellReference; +import com.vaadin.ui.LegacyGrid.CellStyleGenerator; +import com.vaadin.ui.LegacyGrid.Column; +import com.vaadin.ui.LegacyGrid.ColumnReorderEvent; +import com.vaadin.ui.LegacyGrid.ColumnReorderListener; +import com.vaadin.ui.LegacyGrid.ColumnResizeEvent; +import com.vaadin.ui.LegacyGrid.ColumnResizeListener; +import com.vaadin.ui.LegacyGrid.ColumnVisibilityChangeEvent; +import com.vaadin.ui.LegacyGrid.ColumnVisibilityChangeListener; +import com.vaadin.ui.LegacyGrid.DetailsGenerator; +import com.vaadin.ui.LegacyGrid.FooterCell; +import com.vaadin.ui.LegacyGrid.HeaderCell; +import com.vaadin.ui.LegacyGrid.HeaderRow; +import com.vaadin.ui.LegacyGrid.MultiSelectionModel; +import com.vaadin.ui.LegacyGrid.RowDescriptionGenerator; +import com.vaadin.ui.LegacyGrid.RowReference; +import com.vaadin.ui.LegacyGrid.RowStyleGenerator; +import com.vaadin.ui.LegacyGrid.SelectionMode; +import com.vaadin.ui.LegacyGrid.SelectionModel; import com.vaadin.ui.Label; import com.vaadin.ui.Notification; import com.vaadin.ui.Panel; @@ -87,7 +87,7 @@ import com.vaadin.ui.renderers.NumberRenderer; * @since * @author Vaadin Ltd */ -public class GridBasicFeatures extends AbstractComponentTest<Grid> { +public class GridBasicFeatures extends AbstractComponentTest<LegacyGrid> { public static final String ROW_STYLE_GENERATOR_ROW_NUMBERS_FOR_3_OF_4 = "Row numbers for 3/4"; public static final String ROW_STYLE_GENERATOR_NONE = "None"; @@ -109,7 +109,7 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { private boolean singleSelectAllowDeselect = true; private IndexedContainer ds; - private Grid grid; + private LegacyGrid grid; private SelectionListener selectionListener = new SelectionListener() { @Override @@ -247,7 +247,7 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { @Override @SuppressWarnings("unchecked") - protected Grid constructComponent() { + protected LegacyGrid constructComponent() { // Build data source ds = new IndexedContainer() { @@ -317,7 +317,7 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { } // Create grid - Grid grid = new Grid(ds); + LegacyGrid grid = new LegacyGrid(ds); { int col = grid.getContainerDataSource().getContainerPropertyIds() @@ -410,9 +410,9 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { private void addInternalActions() { createClickAction("Update column order without updating client", - "Internals", new Command<Grid, Void>() { + "Internals", new Command<LegacyGrid, Void>() { @Override - public void execute(Grid grid, Void value, Object data) { + public void execute(LegacyGrid grid, Void value, Object data) { List<Column> columns = grid.getColumns(); grid.setColumnOrder(columns.get(1).getPropertyId(), columns.get(0).getPropertyId()); @@ -423,7 +423,7 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { private void addFilterActions() { createBooleanAction("Column 1 starts with \"(23\"", "Filter", false, - new Command<Grid, Boolean>() { + new Command<LegacyGrid, Boolean>() { Filter filter = new Filter() { @Override public boolean passesFilter(Object itemId, Item item) { @@ -438,7 +438,7 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { }; @Override - public void execute(Grid grid, Boolean value, Object data) { + public void execute(LegacyGrid grid, Boolean value, Object data) { if (value) { ds.addContainerFilter(filter); } else { @@ -448,7 +448,7 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { }); createBooleanAction("Impassable filter", "Filter", false, - new Command<Grid, Boolean>() { + new Command<LegacyGrid, Boolean>() { Filter filter = new Filter() { @Override public boolean passesFilter(Object itemId, Item item) { @@ -462,7 +462,7 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { }; @Override - public void execute(Grid c, Boolean value, Object data) { + public void execute(LegacyGrid c, Boolean value, Object data) { if (value) { ds.addContainerFilter(filter); } else { @@ -480,23 +480,23 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { primaryStyleNames.put("my-grid", "my-grid"); createMultiClickAction("Primary style name", "State", primaryStyleNames, - new Command<Grid, String>() { + new Command<LegacyGrid, String>() { @Override - public void execute(Grid grid, String value, Object data) { + public void execute(LegacyGrid grid, String value, Object data) { grid.setPrimaryStyleName(value); } }, primaryStyleNames.get("v-grid")); - LinkedHashMap<String, SelectionMode> selectionModes = new LinkedHashMap<String, Grid.SelectionMode>(); + LinkedHashMap<String, SelectionMode> selectionModes = new LinkedHashMap<String, LegacyGrid.SelectionMode>(); selectionModes.put("single", SelectionMode.SINGLE); selectionModes.put("multi", SelectionMode.MULTI); selectionModes.put("none", SelectionMode.NONE); createSelectAction("Selection mode", "State", selectionModes, "none", - new Command<Grid, Grid.SelectionMode>() { + new Command<LegacyGrid, LegacyGrid.SelectionMode>() { @Override - public void execute(Grid grid, SelectionMode selectionMode, + public void execute(LegacyGrid grid, SelectionMode selectionMode, Object data) { grid.setSelectionMode(selectionMode); if (selectionMode == SelectionMode.SINGLE) { @@ -517,9 +517,9 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { selectionLimits.put("Integer.MAX_VALUE", Integer.valueOf(Integer.MAX_VALUE)); createSelectAction("Selection limit", "State", selectionLimits, "1000", - new Command<Grid, Integer>() { + new Command<LegacyGrid, Integer>() { @Override - public void execute(Grid grid, Integer limit, Object data) { + public void execute(LegacyGrid grid, Integer limit, Object data) { if (!(grid .getSelectionModel() instanceof MultiSelectionModel)) { grid.setSelectionMode(SelectionMode.MULTI); @@ -538,19 +538,19 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { Sort.by(propertyId, SortDirection.DESCENDING).build()); } createSelectAction("Sort by column", "State", sortableProperties, - "Column 9, ascending", new Command<Grid, List<SortOrder>>() { + "Column 9, ascending", new Command<LegacyGrid, List<SortOrder>>() { @Override - public void execute(Grid grid, List<SortOrder> sortOrder, + public void execute(LegacyGrid grid, List<SortOrder> sortOrder, Object data) { grid.setSortOrder(sortOrder); } }); createBooleanAction("Reverse Grid Columns", "State", false, - new Command<Grid, Boolean>() { + new Command<LegacyGrid, Boolean>() { @Override - public void execute(Grid c, Boolean value, Object data) { + public void execute(LegacyGrid c, Boolean value, Object data) { List<Object> ids = new ArrayList<Object>(); ids.addAll(ds.getContainerPropertyIds()); if (!value) { @@ -647,9 +647,9 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { createSelectAction("Row style generator", "State", rowStyleGenerators, CELL_STYLE_GENERATOR_NONE, - new Command<Grid, RowStyleGenerator>() { + new Command<LegacyGrid, RowStyleGenerator>() { @Override - public void execute(Grid grid, RowStyleGenerator generator, + public void execute(LegacyGrid grid, RowStyleGenerator generator, Object data) { grid.setRowStyleGenerator(generator); } @@ -657,28 +657,28 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { createSelectAction("Cell style generator", "State", cellStyleGenerators, CELL_STYLE_GENERATOR_NONE, - new Command<Grid, CellStyleGenerator>() { + new Command<LegacyGrid, CellStyleGenerator>() { @Override - public void execute(Grid grid, CellStyleGenerator generator, + public void execute(LegacyGrid grid, CellStyleGenerator generator, Object data) { grid.setCellStyleGenerator(generator); } }); createBooleanAction("Row description generator", "State", false, - new Command<Grid, Boolean>() { + new Command<LegacyGrid, Boolean>() { @Override - public void execute(Grid c, Boolean value, Object data) { + public void execute(LegacyGrid c, Boolean value, Object data) { c.setRowDescriptionGenerator( value ? rowDescriptionGenerator : null); } }); createBooleanAction("Cell description generator", "State", false, - new Command<Grid, Boolean>() { + new Command<LegacyGrid, Boolean>() { @Override - public void execute(Grid c, Boolean value, Object data) { + public void execute(LegacyGrid c, Boolean value, Object data) { c.setCellDescriptionGenerator( value ? cellDescriptionGenerator : null); } @@ -694,9 +694,9 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { */ frozenOptions.put("-1 for unfreezing selection column", -1); createSelectAction("Frozen column count", "State", frozenOptions, "0", - new Command<Grid, Integer>() { + new Command<LegacyGrid, Integer>() { @Override - public void execute(Grid c, Integer value, Object data) { + public void execute(LegacyGrid c, Integer value, Object data) { c.setFrozenColumnCount(value.intValue()); } }); @@ -708,18 +708,18 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { } createSelectAction("Container delay", "State", containerDelayValues, - "0", new Command<Grid, Integer>() { + "0", new Command<LegacyGrid, Integer>() { @Override - public void execute(Grid grid, Integer delay, Object data) { + public void execute(LegacyGrid grid, Integer delay, Object data) { containerDelay = delay.intValue(); } }); createBooleanAction("ItemClickListener", "State", false, - new Command<Grid, Boolean>() { + new Command<LegacyGrid, Boolean>() { @Override - public void execute(Grid c, Boolean value, Object data) { + public void execute(LegacyGrid c, Boolean value, Object data) { if (!value) { c.removeItemClickListener(itemClickListener); } else { @@ -730,10 +730,10 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { }); createBooleanAction("EditorOpeningItemClickListener", "State", false, - new Command<Grid, Boolean>() { + new Command<LegacyGrid, Boolean>() { @Override - public void execute(Grid c, Boolean value, Object data) { + public void execute(LegacyGrid c, Boolean value, Object data) { if (!value) { c.removeItemClickListener( editorOpeningItemClickListener); @@ -745,10 +745,10 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { }); createBooleanAction("ReactiveValueChanger", "State", false, - new Command<Grid, Boolean>() { + new Command<LegacyGrid, Boolean>() { @Override - public void execute(Grid c, Boolean value, Object data) { + public void execute(LegacyGrid c, Boolean value, Object data) { LegacyField<?> targetField = grid.getEditorFieldGroup() .getField("Column 0"); if (targetField != null) { @@ -764,10 +764,10 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { }); createBooleanAction("ColumnReorderListener", "State", false, - new Command<Grid, Boolean>() { + new Command<LegacyGrid, Boolean>() { @Override - public void execute(Grid grid, Boolean value, Object data) { + public void execute(LegacyGrid grid, Boolean value, Object data) { if (value) { grid.addColumnReorderListener( columnReorderListener); @@ -778,9 +778,9 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { } }); createBooleanAction("ColumnVisibilityChangeListener", "State", false, - new Command<Grid, Boolean>() { + new Command<LegacyGrid, Boolean>() { @Override - public void execute(Grid grid, Boolean value, Object data) { + public void execute(LegacyGrid grid, Boolean value, Object data) { if (value) { grid.addColumnVisibilityChangeListener( columnVisibilityListener); @@ -791,9 +791,9 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { } }); createBooleanAction("Single select allow deselect", "State", - singleSelectAllowDeselect, new Command<Grid, Boolean>() { + singleSelectAllowDeselect, new Command<LegacyGrid, Boolean>() { @Override - public void execute(Grid c, Boolean value, Object data) { + public void execute(LegacyGrid c, Boolean value, Object data) { singleSelectAllowDeselect = value.booleanValue(); SelectionModel model = c.getSelectionModel(); @@ -804,17 +804,17 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { } }); createBooleanAction("Column Reordering Allowed", "State", false, - new Command<Grid, Boolean>() { + new Command<LegacyGrid, Boolean>() { @Override - public void execute(Grid c, Boolean value, Object data) { + public void execute(LegacyGrid c, Boolean value, Object data) { c.setColumnReorderingAllowed(value); } }); - createClickAction("Select all", "State", new Command<Grid, String>() { + createClickAction("Select all", "State", new Command<LegacyGrid, String>() { @Override - public void execute(Grid c, String value, Object data) { + public void execute(LegacyGrid c, String value, Object data) { SelectionModel selectionModel = c.getSelectionModel(); if (selectionModel instanceof SelectionModel.Multi) { ((SelectionModel.Multi) selectionModel).selectAll(); @@ -822,9 +822,9 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { } }, null); - createClickAction("Select none", "State", new Command<Grid, String>() { + createClickAction("Select none", "State", new Command<LegacyGrid, String>() { @Override - public void execute(Grid c, String value, Object data) { + public void execute(LegacyGrid c, String value, Object data) { SelectionModel selectionModel = c.getSelectionModel(); if (selectionModel instanceof SelectionModel.Multi) { ((SelectionModel.Multi) selectionModel).deselectAll(); @@ -837,10 +837,10 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { createCategory("Header", null); createBooleanAction("Visible", "Header", true, - new Command<Grid, Boolean>() { + new Command<LegacyGrid, Boolean>() { @Override - public void execute(Grid grid, Boolean value, Object data) { + public void execute(LegacyGrid grid, Boolean value, Object data) { grid.setHeaderVisible(value); } }); @@ -851,10 +851,10 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { defaultRows.put("Unset", "Unset"); createMultiClickAction("Default row", "Header", defaultRows, - new Command<Grid, String>() { + new Command<LegacyGrid, String>() { @Override - public void execute(Grid grid, String value, Object data) { + public void execute(LegacyGrid grid, String value, Object data) { HeaderRow defaultRow = null; if (value.equals("Top")) { defaultRow = grid.getHeaderRow(0); @@ -867,37 +867,37 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { }, defaultRows.get("Top")); - createClickAction("Prepend row", "Header", new Command<Grid, Object>() { + createClickAction("Prepend row", "Header", new Command<LegacyGrid, Object>() { @Override - public void execute(Grid grid, Object value, Object data) { + public void execute(LegacyGrid grid, Object value, Object data) { grid.prependHeaderRow(); } }, null); - createClickAction("Append row", "Header", new Command<Grid, Object>() { + createClickAction("Append row", "Header", new Command<LegacyGrid, Object>() { @Override - public void execute(Grid grid, Object value, Object data) { + public void execute(LegacyGrid grid, Object value, Object data) { grid.appendHeaderRow(); } }, null); createClickAction("Remove top row", "Header", - new Command<Grid, Object>() { + new Command<LegacyGrid, Object>() { @Override - public void execute(Grid grid, Object value, Object data) { + public void execute(LegacyGrid grid, Object value, Object data) { grid.removeHeaderRow(0); } }, null); createClickAction("Remove bottom row", "Header", - new Command<Grid, Object>() { + new Command<LegacyGrid, Object>() { @Override - public void execute(Grid grid, Object value, Object data) { + public void execute(LegacyGrid grid, Object value, Object data) { grid.removeHeaderRow(grid.getHeaderRowCount() - 1); } @@ -908,45 +908,45 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { createCategory("Footer", null); createBooleanAction("Visible", "Footer", false, - new Command<Grid, Boolean>() { + new Command<LegacyGrid, Boolean>() { @Override - public void execute(Grid grid, Boolean value, Object data) { + public void execute(LegacyGrid grid, Boolean value, Object data) { grid.setFooterVisible(value); } }); - createClickAction("Prepend row", "Footer", new Command<Grid, Object>() { + createClickAction("Prepend row", "Footer", new Command<LegacyGrid, Object>() { @Override - public void execute(Grid grid, Object value, Object data) { + public void execute(LegacyGrid grid, Object value, Object data) { grid.prependFooterRow(); } }, null); - createClickAction("Append row", "Footer", new Command<Grid, Object>() { + createClickAction("Append row", "Footer", new Command<LegacyGrid, Object>() { @Override - public void execute(Grid grid, Object value, Object data) { + public void execute(LegacyGrid grid, Object value, Object data) { grid.appendFooterRow(); } }, null); createClickAction("Remove top row", "Footer", - new Command<Grid, Object>() { + new Command<LegacyGrid, Object>() { @Override - public void execute(Grid grid, Object value, Object data) { + public void execute(LegacyGrid grid, Object value, Object data) { grid.removeFooterRow(0); } }, null); createClickAction("Remove bottom row", "Footer", - new Command<Grid, Object>() { + new Command<LegacyGrid, Object>() { @Override - public void execute(Grid grid, Object value, Object data) { + public void execute(LegacyGrid grid, Object value, Object data) { grid.removeFooterRow(grid.getFooterRowCount() - 1); } @@ -961,14 +961,14 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { createCategory(getColumnProperty(c), "Columns"); createClickAction("Add / Remove", getColumnProperty(c), - new Command<Grid, String>() { + new Command<LegacyGrid, String>() { boolean wasHidable; boolean wasHidden; String wasColumnHidingToggleCaption; @Override - public void execute(Grid grid, String value, + public void execute(LegacyGrid grid, String value, Object data) { String columnProperty = getColumnProperty( (Integer) data); @@ -989,10 +989,10 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { } }, null, c); createClickAction("Move left", getColumnProperty(c), - new Command<Grid, String>() { + new Command<LegacyGrid, String>() { @Override - public void execute(Grid grid, String value, + public void execute(LegacyGrid grid, String value, Object data) { final String columnProperty = getColumnProperty( (Integer) data); @@ -1020,10 +1020,10 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { }, null, c); createBooleanAction("Sortable", getColumnProperty(c), true, - new Command<Grid, Boolean>() { + new Command<LegacyGrid, Boolean>() { @Override - public void execute(Grid grid, Boolean value, + public void execute(LegacyGrid grid, Boolean value, Object columnIndex) { Object propertyId = getColumnProperty( (Integer) columnIndex); @@ -1033,10 +1033,10 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { }, c); createBooleanAction("Resizable", getColumnProperty(c), true, - new Command<Grid, Boolean>() { + new Command<LegacyGrid, Boolean>() { @Override - public void execute(Grid grid, Boolean value, + public void execute(LegacyGrid grid, Boolean value, Object columnIndex) { Object propertyId = getColumnProperty( (Integer) columnIndex); @@ -1046,28 +1046,28 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { }, c); createBooleanAction("Hidable", getColumnProperty(c), - isColumnHidableByDefault(c), new Command<Grid, Boolean>() { + isColumnHidableByDefault(c), new Command<LegacyGrid, Boolean>() { @Override - public void execute(Grid c, Boolean hidable, + public void execute(LegacyGrid c, Boolean hidable, Object propertyId) { grid.getColumn(propertyId).setHidable(hidable); } }, getColumnProperty(c)); createBooleanAction("Hidden", getColumnProperty(c), - isColumnHiddenByDefault(c), new Command<Grid, Boolean>() { + isColumnHiddenByDefault(c), new Command<LegacyGrid, Boolean>() { @Override - public void execute(Grid c, Boolean hidden, + public void execute(LegacyGrid c, Boolean hidden, Object propertyId) { grid.getColumn(propertyId).setHidden(hidden); } }, getColumnProperty(c)); createClickAction("Change hiding toggle caption", - getColumnProperty(c), new Command<Grid, String>() { + getColumnProperty(c), new Command<LegacyGrid, String>() { int count = 0; @Override - public void execute(Grid grid, String value, + public void execute(LegacyGrid grid, String value, Object data) { final String columnProperty = getColumnProperty( (Integer) data); @@ -1078,11 +1078,11 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { }, null, c); createClickAction("Change header caption", getColumnProperty(c), - new Command<Grid, String>() { + new Command<LegacyGrid, String>() { int count = 0; @Override - public void execute(Grid grid, String value, + public void execute(LegacyGrid grid, String value, Object data) { final String columnProperty = getColumnProperty( (Integer) data); @@ -1094,10 +1094,10 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { createCategory("Column " + c + " Width", getColumnProperty(c)); createClickAction("Auto", "Column " + c + " Width", - new Command<Grid, Integer>() { + new Command<LegacyGrid, Integer>() { @Override - public void execute(Grid grid, Integer value, + public void execute(LegacyGrid grid, Integer value, Object columnIndex) { Object propertyId = getColumnProperty( (Integer) columnIndex); @@ -1107,9 +1107,9 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { }, -1, c); createClickAction("25.5px", "Column " + c + " Width", - new Command<Grid, Void>() { + new Command<LegacyGrid, Void>() { @Override - public void execute(Grid grid, Void value, + public void execute(LegacyGrid grid, Void value, Object columnIndex) { grid.getColumns().get((Integer) columnIndex) .setWidth(25.5); @@ -1118,10 +1118,10 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { for (int w = 50; w < 300; w += 50) { createClickAction(w + "px", "Column " + c + " Width", - new Command<Grid, Integer>() { + new Command<LegacyGrid, Integer>() { @Override - public void execute(Grid grid, Integer value, + public void execute(LegacyGrid grid, Integer value, Object columnIndex) { Object propertyId = getColumnProperty( (Integer) columnIndex); @@ -1137,10 +1137,10 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { defaultRows.put("Widget Header", GridStaticCellType.WIDGET); createMultiClickAction("Header Type", getColumnProperty(c), - defaultRows, new Command<Grid, GridStaticCellType>() { + defaultRows, new Command<LegacyGrid, GridStaticCellType>() { @Override - public void execute(Grid grid, GridStaticCellType value, + public void execute(LegacyGrid grid, GridStaticCellType value, Object columnIndex) { final Object propertyId = getColumnProperty( (Integer) columnIndex); @@ -1176,10 +1176,10 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { defaultRows.put("Widget Footer", GridStaticCellType.WIDGET); createMultiClickAction("Footer Type", getColumnProperty(c), - defaultRows, new Command<Grid, GridStaticCellType>() { + defaultRows, new Command<LegacyGrid, GridStaticCellType>() { @Override - public void execute(Grid grid, GridStaticCellType value, + public void execute(LegacyGrid grid, GridStaticCellType value, Object columnIndex) { final Object propertyId = getColumnProperty( (Integer) columnIndex); @@ -1211,10 +1211,10 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { } createClickAction("All columns auto width", "Columns", - new Command<Grid, Boolean>() { + new Command<LegacyGrid, Boolean>() { @Override - public void execute(Grid c, Boolean value, Object data) { + public void execute(LegacyGrid c, Boolean value, Object data) { for (Column col : grid.getColumns()) { col.setWidthUndefined(); } @@ -1223,10 +1223,10 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { }, null); createBooleanAction("All columns hidable", "Columns", false, - new Command<Grid, Boolean>() { + new Command<LegacyGrid, Boolean>() { @Override - public void execute(Grid c, Boolean value, Object data) { + public void execute(LegacyGrid c, Boolean value, Object data) { for (Column col : grid.getColumns()) { col.setHidable(value); } @@ -1234,10 +1234,10 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { } }); createBooleanAction("All columns resizable", "Columns", false, - new Command<Grid, Boolean>() { + new Command<LegacyGrid, Boolean>() { @Override - public void execute(Grid c, Boolean value, Object data) { + public void execute(LegacyGrid c, Boolean value, Object data) { for (Column col : grid.getColumns()) { col.setResizable(value); } @@ -1246,10 +1246,10 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { }); createClickAction("All columns expanding, Col 0 has max width of 30px", - "Columns", new Command<Grid, Boolean>() { + "Columns", new Command<LegacyGrid, Boolean>() { @Override - public void execute(Grid c, Boolean value, Object data) { + public void execute(LegacyGrid c, Boolean value, Object data) { for (Column col : grid.getColumns()) { col.setWidthUndefined(); } @@ -1266,11 +1266,11 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { createCategory("Properties", null); createBooleanAction("Prepend property", "Properties", false, - new Command<Grid, Boolean>() { + new Command<LegacyGrid, Boolean>() { private final Object propertyId = new Object(); @Override - public void execute(Grid c, Boolean enable, Object data) { + public void execute(LegacyGrid c, Boolean enable, Object data) { if (enable.booleanValue()) { ds.addContainerProperty(propertyId, String.class, "property value"); @@ -1287,7 +1287,7 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { protected void createRowActions() { createCategory("Body rows", null); - class NewRowCommand implements Command<Grid, String> { + class NewRowCommand implements Command<LegacyGrid, String> { private final int index; public NewRowCommand() { @@ -1299,7 +1299,7 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { } @Override - public void execute(Grid c, String value, Object data) { + public void execute(LegacyGrid c, String value, Object data) { Item item = ds.addItemAt(index, new Object()); for (int i = 0; i < COLUMNS; i++) { Class<?> type = ds.getType(getColumnProperty(i)); @@ -1326,9 +1326,9 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { final NewRowCommand newRowCommand = new NewRowCommand(); createClickAction("Add 18 rows", "Body rows", - new Command<Grid, String>() { + new Command<LegacyGrid, String>() { @Override - public void execute(Grid c, String value, Object data) { + public void execute(LegacyGrid c, String value, Object data) { for (int i = 0; i < 18; i++) { newRowCommand.execute(c, value, data); } @@ -1341,18 +1341,18 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { null); createClickAction("Remove first row", "Body rows", - new Command<Grid, String>() { + new Command<LegacyGrid, String>() { @Override - public void execute(Grid c, String value, Object data) { + public void execute(LegacyGrid c, String value, Object data) { Object firstItemId = ds.getIdByIndex(0); ds.removeItem(firstItemId); } }, null); createClickAction("Remove 18 first rows", "Body rows", - new Command<Grid, String>() { + new Command<LegacyGrid, String>() { @Override - public void execute(Grid c, String value, Object data) { + public void execute(LegacyGrid c, String value, Object data) { for (int i = 0; i < 18; i++) { Object firstItemId = ds.getIdByIndex(0); ds.removeItem(firstItemId); @@ -1361,10 +1361,10 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { }, null); createClickAction("Modify first row (getItemProperty)", "Body rows", - new Command<Grid, String>() { + new Command<LegacyGrid, String>() { @SuppressWarnings("unchecked") @Override - public void execute(Grid c, String value, Object data) { + public void execute(LegacyGrid c, String value, Object data) { Object firstItemId = ds.getIdByIndex(0); Item item = ds.getItem(firstItemId); for (int i = 0; i < COLUMNS; i++) { @@ -1379,10 +1379,10 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { }, null); createClickAction("Modify first row (getContainerProperty)", - "Body rows", new Command<Grid, String>() { + "Body rows", new Command<LegacyGrid, String>() { @SuppressWarnings("unchecked") @Override - public void execute(Grid c, String value, Object data) { + public void execute(LegacyGrid c, String value, Object data) { Object firstItemId = ds.getIdByIndex(0); for (Object containerPropertyId : ds .getContainerPropertyIds()) { @@ -1397,9 +1397,9 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { }, null); createBooleanAction("Select first row", "Body rows", false, - new Command<Grid, Boolean>() { + new Command<LegacyGrid, Boolean>() { @Override - public void execute(Grid grid, Boolean select, + public void execute(LegacyGrid grid, Boolean select, Object data) { final Object firstItemId = grid.getContainerDataSource() .firstItemId(); @@ -1412,18 +1412,18 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { }); createClickAction("Remove all rows", "Body rows", - new Command<Grid, String>() { + new Command<LegacyGrid, String>() { @SuppressWarnings("unchecked") @Override - public void execute(Grid c, String value, Object data) { + public void execute(LegacyGrid c, String value, Object data) { ds.removeAllItems(); } }, null); createClickAction("Remove selected rows", "Body rows", - new Command<Grid, String>() { + new Command<LegacyGrid, String>() { @Override - public void execute(Grid c, String value, Object data) { + public void execute(LegacyGrid c, String value, Object data) { // Usually you'd deselect all the rows before removing // them. It is done this way to test for #19152 for (Object itemId : c.getSelectedRows()) { @@ -1436,38 +1436,38 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { protected void createEditorActions() { createBooleanAction("Enabled", "Editor", false, - new Command<Grid, Boolean>() { + new Command<LegacyGrid, Boolean>() { @Override - public void execute(Grid c, Boolean value, Object data) { + public void execute(LegacyGrid c, Boolean value, Object data) { c.setEditorEnabled(value); } }); createBooleanAction("Buffered mode", "Editor", true, - new Command<Grid, Boolean>() { + new Command<LegacyGrid, Boolean>() { @Override - public void execute(Grid c, Boolean value, Object data) { + public void execute(LegacyGrid c, Boolean value, Object data) { c.setEditorBuffered(value); } }); - createClickAction("Edit item 5", "Editor", new Command<Grid, String>() { + createClickAction("Edit item 5", "Editor", new Command<LegacyGrid, String>() { @Override - public void execute(Grid c, String value, Object data) { + public void execute(LegacyGrid c, String value, Object data) { c.editItem(5); } }, null); createClickAction("Edit item 100", "Editor", - new Command<Grid, String>() { + new Command<LegacyGrid, String>() { @Override - public void execute(Grid c, String value, Object data) { + public void execute(LegacyGrid c, String value, Object data) { c.editItem(100); } }, null); - createClickAction("Save", "Editor", new Command<Grid, String>() { + createClickAction("Save", "Editor", new Command<LegacyGrid, String>() { @Override - public void execute(Grid c, String value, Object data) { + public void execute(LegacyGrid c, String value, Object data) { try { c.saveEditor(); } catch (CommitException e) { @@ -1476,25 +1476,25 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { } } }, null); - createClickAction("Cancel edit", "Editor", new Command<Grid, String>() { + createClickAction("Cancel edit", "Editor", new Command<LegacyGrid, String>() { @Override - public void execute(Grid c, String value, Object data) { + public void execute(LegacyGrid c, String value, Object data) { c.cancelEditor(); } }, null); createClickAction("Change save caption", "Editor", - new Command<Grid, String>() { + new Command<LegacyGrid, String>() { @Override - public void execute(Grid c, String value, Object data) { + public void execute(LegacyGrid c, String value, Object data) { c.setEditorSaveCaption("ǝʌɐS"); } }, null); createClickAction("Change cancel caption", "Editor", - new Command<Grid, String>() { + new Command<LegacyGrid, String>() { @Override - public void execute(Grid c, String value, Object data) { + public void execute(LegacyGrid c, String value, Object data) { c.setEditorCancelCaption("ʃǝɔuɐↃ"); } }, null); @@ -1506,9 +1506,9 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { createCategory("Height by Rows", "Size"); createBooleanAction("HeightMode Row", "Size", false, - new Command<Grid, Boolean>() { + new Command<LegacyGrid, Boolean>() { @Override - public void execute(Grid c, Boolean heightModeByRows, + public void execute(LegacyGrid c, Boolean heightModeByRows, Object data) { c.setHeightMode(heightModeByRows ? HeightMode.ROW : HeightMode.CSS); @@ -1524,9 +1524,9 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { addActionForHeightByRows(i + 2d / 3d); } - Command<Grid, String> sizeCommand = new Command<Grid, String>() { + Command<LegacyGrid, String> sizeCommand = new Command<LegacyGrid, String>() { @Override - public void execute(Grid grid, String height, Object data) { + public void execute(LegacyGrid grid, String height, Object data) { grid.setHeight(height); } }; @@ -1544,27 +1544,27 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { private void addActionForHeightByRows(final Double i) { DecimalFormat df = new DecimalFormat("0.00"); createClickAction(df.format(i) + " rows", "Height by Rows", - new Command<Grid, String>() { + new Command<LegacyGrid, String>() { @Override - public void execute(Grid c, String value, Object data) { + public void execute(LegacyGrid c, String value, Object data) { c.setHeightByRows(i); } }, null); } private void createDetailsActions() { - Command<Grid, DetailsGenerator> swapDetailsGenerator = new Command<Grid, DetailsGenerator>() { + Command<LegacyGrid, DetailsGenerator> swapDetailsGenerator = new Command<LegacyGrid, DetailsGenerator>() { @Override - public void execute(Grid c, DetailsGenerator generator, + public void execute(LegacyGrid c, DetailsGenerator generator, Object data) { grid.setDetailsGenerator(generator); } }; - Command<Grid, Boolean> openOrCloseItemId = new Command<Grid, Boolean>() { + Command<LegacyGrid, Boolean> openOrCloseItemId = new Command<LegacyGrid, Boolean>() { @Override @SuppressWarnings("boxing") - public void execute(Grid g, Boolean visible, Object itemId) { + public void execute(LegacyGrid g, Boolean visible, Object itemId) { g.setDetailsVisible(itemId, visible); } }; @@ -1580,9 +1580,9 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { persistingDetailsGenerator); createClickAction("- Change Component", "Generators", - new Command<Grid, Void>() { + new Command<LegacyGrid, Void>() { @Override - public void execute(Grid c, Void value, Object data) { + public void execute(LegacyGrid c, Void value, Object data) { for (Object id : detailsMap.keySet()) { Panel panel = detailsMap.get(id); Label label = (Label) panel.getContent(); @@ -1596,9 +1596,9 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { }, null); createClickAction("Toggle firstItemId", "Details", - new Command<Grid, Void>() { + new Command<LegacyGrid, Void>() { @Override - public void execute(Grid g, Void value, Object data) { + public void execute(LegacyGrid g, Void value, Object data) { Object firstItemId = g.getContainerDataSource() .firstItemId(); boolean toggle = g.isDetailsVisible(firstItemId); @@ -1623,8 +1623,8 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { } @Override - protected Class<Grid> getTestClass() { - return Grid.class; + protected Class<LegacyGrid> getTestClass() { + return LegacyGrid.class; } } diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/basicfeatures/GridHeightByRowOnInit.java b/uitest/src/main/java/com/vaadin/tests/components/grid/basicfeatures/GridHeightByRowOnInit.java index a1a68dd136..ef9ed23c31 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/basicfeatures/GridHeightByRowOnInit.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/basicfeatures/GridHeightByRowOnInit.java @@ -20,7 +20,7 @@ import com.vaadin.annotations.Title; import com.vaadin.data.Container; import com.vaadin.server.VaadinRequest; import com.vaadin.shared.ui.grid.HeightMode; -import com.vaadin.ui.Grid; +import com.vaadin.ui.LegacyGrid; import com.vaadin.ui.UI; import com.vaadin.ui.themes.ValoTheme; @@ -32,7 +32,7 @@ public class GridHeightByRowOnInit extends UI { @Override protected void init(VaadinRequest request) { - final Grid grid = new Grid(); + final LegacyGrid grid = new LegacyGrid(); Container.Indexed container = grid.getContainerDataSource(); container.addContainerProperty(PROPERTY, String.class, ""); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/basicfeatures/GridSortingIndicators.java b/uitest/src/main/java/com/vaadin/tests/components/grid/basicfeatures/GridSortingIndicators.java index 82807ed4c1..f3bcea6c51 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/basicfeatures/GridSortingIndicators.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/basicfeatures/GridSortingIndicators.java @@ -24,7 +24,7 @@ import com.vaadin.shared.data.sort.SortDirection; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Grid; +import com.vaadin.ui.LegacyGrid; public class GridSortingIndicators extends AbstractTestUI { @@ -34,7 +34,7 @@ public class GridSortingIndicators extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { - final Grid grid = new Grid(createContainer()); + final LegacyGrid grid = new LegacyGrid(createContainer()); addComponent(grid); grid.sort(Sort.by("foo").then("bar", SortDirection.DESCENDING) .then("baz")); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/basicfeatures/server/GridClearContainer.java b/uitest/src/main/java/com/vaadin/tests/components/grid/basicfeatures/server/GridClearContainer.java index 8d52a8f3fa..ecb57f92db 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/basicfeatures/server/GridClearContainer.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/basicfeatures/server/GridClearContainer.java @@ -22,7 +22,7 @@ import com.vaadin.tests.components.AbstractTestUIWithLog; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.Grid; +import com.vaadin.ui.LegacyGrid; /** * Tests that removing and adding rows doesn't cause an infinite loop in the @@ -37,7 +37,7 @@ public class GridClearContainer extends AbstractTestUIWithLog { @Override protected void setup(VaadinRequest request) { - final Grid grid = new Grid(); + final LegacyGrid grid = new LegacyGrid(); ic = new IndexedContainer(); ic.addContainerProperty("Col 1", String.class, "default"); ic.addItem("Row 1"); diff --git a/uitest/src/main/java/com/vaadin/tests/components/window/GridInWindow.java b/uitest/src/main/java/com/vaadin/tests/components/window/GridInWindow.java index 6eaf36af8d..924f42632e 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/window/GridInWindow.java +++ b/uitest/src/main/java/com/vaadin/tests/components/window/GridInWindow.java @@ -18,14 +18,14 @@ package com.vaadin.tests.components.window; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUIWithLog; import com.vaadin.ui.Button; -import com.vaadin.ui.Grid; +import com.vaadin.ui.LegacyGrid; import com.vaadin.ui.Window; public class GridInWindow extends AbstractTestUIWithLog { @Override protected void setup(VaadinRequest request) { - final Grid grid = new Grid(); + final LegacyGrid grid = new LegacyGrid(); grid.addColumn("Hidable column").setHidable(true); grid.addRow("Close and reopen and it vanishes"); diff --git a/uitest/src/main/java/com/vaadin/tests/contextclick/GridContextClick.java b/uitest/src/main/java/com/vaadin/tests/contextclick/GridContextClick.java index 837a930bf1..0fc6839a70 100644 --- a/uitest/src/main/java/com/vaadin/tests/contextclick/GridContextClick.java +++ b/uitest/src/main/java/com/vaadin/tests/contextclick/GridContextClick.java @@ -20,16 +20,16 @@ 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.Grid; -import com.vaadin.ui.Grid.GridContextClickEvent; +import com.vaadin.ui.LegacyGrid; +import com.vaadin.ui.LegacyGrid.GridContextClickEvent; import com.vaadin.ui.HorizontalLayout; public class GridContextClick - extends AbstractContextClickUI<Grid, GridContextClickEvent> { + extends AbstractContextClickUI<LegacyGrid, GridContextClickEvent> { @Override - protected Grid createTestComponent() { - Grid grid = new Grid(PersonContainer.createWithTestData()); + protected LegacyGrid createTestComponent() { + LegacyGrid grid = new LegacyGrid(PersonContainer.createWithTestData()); grid.setFooterVisible(true); grid.appendFooterRow(); diff --git a/uitest/src/main/java/com/vaadin/tests/fieldgroup/BasicCrudGrid.java b/uitest/src/main/java/com/vaadin/tests/fieldgroup/BasicCrudGrid.java index 1849e07a40..b892075cc6 100644 --- a/uitest/src/main/java/com/vaadin/tests/fieldgroup/BasicCrudGrid.java +++ b/uitest/src/main/java/com/vaadin/tests/fieldgroup/BasicCrudGrid.java @@ -20,16 +20,16 @@ import com.vaadin.data.util.BeanItem; import com.vaadin.event.SelectionEvent; import com.vaadin.event.SelectionEvent.SelectionListener; import com.vaadin.server.VaadinRequest; -import com.vaadin.ui.Grid; +import com.vaadin.ui.LegacyGrid; public class BasicCrudGrid extends AbstractBasicCrud { - private Grid grid; + private LegacyGrid grid; @Override protected void setup(VaadinRequest request) { super.setup(request); - grid = new Grid(); + grid = new LegacyGrid(); grid.setContainerDataSource(container); diff --git a/uitest/src/main/java/com/vaadin/tests/fieldgroup/BasicCrudGridEditorRow.java b/uitest/src/main/java/com/vaadin/tests/fieldgroup/BasicCrudGridEditorRow.java index 07a42b11f4..6a02cf6f0f 100644 --- a/uitest/src/main/java/com/vaadin/tests/fieldgroup/BasicCrudGridEditorRow.java +++ b/uitest/src/main/java/com/vaadin/tests/fieldgroup/BasicCrudGridEditorRow.java @@ -24,18 +24,18 @@ import com.vaadin.event.SelectionEvent; import com.vaadin.event.SelectionEvent.SelectionListener; import com.vaadin.legacy.data.validator.LegacyIntegerRangeValidator; import com.vaadin.server.VaadinRequest; -import com.vaadin.ui.Grid; +import com.vaadin.ui.LegacyGrid; import com.vaadin.ui.renderers.DateRenderer; public class BasicCrudGridEditorRow extends AbstractBasicCrud { - private Grid grid; + private LegacyGrid grid; @Override protected void setup(VaadinRequest request) { super.setup(request); formType.setVisible(false); - grid = new Grid(); + grid = new LegacyGrid(); grid.setContainerDataSource(container); diff --git a/uitest/src/main/java/com/vaadin/tests/minitutorials/v7_4/ConfiguringColumnWidths.java b/uitest/src/main/java/com/vaadin/tests/minitutorials/v7_4/ConfiguringColumnWidths.java index e3d8b44a99..c9d6162631 100644 --- a/uitest/src/main/java/com/vaadin/tests/minitutorials/v7_4/ConfiguringColumnWidths.java +++ b/uitest/src/main/java/com/vaadin/tests/minitutorials/v7_4/ConfiguringColumnWidths.java @@ -17,8 +17,8 @@ package com.vaadin.tests.minitutorials.v7_4; import com.vaadin.annotations.Theme; import com.vaadin.server.VaadinRequest; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.SelectionMode; +import com.vaadin.ui.LegacyGrid; +import com.vaadin.ui.LegacyGrid.SelectionMode; import com.vaadin.ui.UI; @Theme("valo") @@ -26,7 +26,7 @@ public class ConfiguringColumnWidths extends UI { @Override protected void init(VaadinRequest request) { - Grid grid = new Grid(GridExampleHelper.createContainer()); + LegacyGrid grid = new LegacyGrid(GridExampleHelper.createContainer()); grid.setSelectionMode(SelectionMode.NONE); grid.setColumnOrder("name", "amount", "count"); @@ -35,31 +35,31 @@ public class ConfiguringColumnWidths extends UI { setContent(grid); } - private void setupCase1(Grid grid) { + private void setupCase1(LegacyGrid grid) { grid.getColumn("name").setExpandRatio(1); } - private void setupCase2(Grid grid) { + private void setupCase2(LegacyGrid grid) { grid.getColumn("name").setExpandRatio(1); grid.getColumn("amount").setWidth(100); grid.getColumn("count").setWidth(100); } - private void setupCase3(Grid grid) { + private void setupCase3(LegacyGrid grid) { grid.setWidth("400px"); grid.getColumn("name").setExpandRatio(1); grid.getColumn("amount").setWidth(100); grid.getColumn("count").setWidth(100); } - private void setupCase4(Grid grid) { + private void setupCase4(LegacyGrid grid) { grid.setWidth("400px"); grid.getColumn("name").setMinimumWidth(250); grid.getColumn("amount").setWidth(100); grid.getColumn("count").setWidth(100); } - private void setupCase5(Grid grid) { + private void setupCase5(LegacyGrid grid) { grid.setWidth("400px"); grid.setFrozenColumnCount(1); grid.getColumn("name").setMinimumWidth(250); @@ -67,7 +67,7 @@ public class ConfiguringColumnWidths extends UI { grid.getColumn("count").setWidth(100); } - private void setupCase6(Grid grid) { + private void setupCase6(LegacyGrid grid) { grid.setWidth("700px"); grid.setFrozenColumnCount(1); grid.getColumn("name").setMinimumWidth(250); @@ -75,12 +75,12 @@ public class ConfiguringColumnWidths extends UI { grid.getColumn("count").setWidth(100); } - private void setupCase(Grid grid, int number) { + private void setupCase(LegacyGrid grid, int number) { if (number == 0) { return; } try { - getClass().getDeclaredMethod("setupCase" + number, Grid.class) + getClass().getDeclaredMethod("setupCase" + number, LegacyGrid.class) .invoke(this, grid); } catch (Exception e) { throw new RuntimeException(e); diff --git a/uitest/src/main/java/com/vaadin/tests/minitutorials/v7_4/ConfiguringGridHeadersAndFooters.java b/uitest/src/main/java/com/vaadin/tests/minitutorials/v7_4/ConfiguringGridHeadersAndFooters.java index 2a4c67855c..b509bce922 100644 --- a/uitest/src/main/java/com/vaadin/tests/minitutorials/v7_4/ConfiguringGridHeadersAndFooters.java +++ b/uitest/src/main/java/com/vaadin/tests/minitutorials/v7_4/ConfiguringGridHeadersAndFooters.java @@ -18,17 +18,17 @@ package com.vaadin.tests.minitutorials.v7_4; import com.vaadin.annotations.Theme; import com.vaadin.server.VaadinRequest; import com.vaadin.ui.Button; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.FooterCell; -import com.vaadin.ui.Grid.HeaderCell; -import com.vaadin.ui.Grid.HeaderRow; +import com.vaadin.ui.LegacyGrid; +import com.vaadin.ui.LegacyGrid.FooterCell; +import com.vaadin.ui.LegacyGrid.HeaderCell; +import com.vaadin.ui.LegacyGrid.HeaderRow; import com.vaadin.ui.UI; @Theme("valo") public class ConfiguringGridHeadersAndFooters extends UI { @Override protected void init(VaadinRequest request) { - Grid grid = new Grid(GridExampleHelper.createContainer()); + LegacyGrid grid = new LegacyGrid(GridExampleHelper.createContainer()); grid.setColumnOrder("name", "amount", "count"); grid.getDefaultHeaderRow().getCell("amount") diff --git a/uitest/src/main/java/com/vaadin/tests/minitutorials/v7_4/FormattingDataInGrid.java b/uitest/src/main/java/com/vaadin/tests/minitutorials/v7_4/FormattingDataInGrid.java index b2a6525e1c..4ab78d9374 100644 --- a/uitest/src/main/java/com/vaadin/tests/minitutorials/v7_4/FormattingDataInGrid.java +++ b/uitest/src/main/java/com/vaadin/tests/minitutorials/v7_4/FormattingDataInGrid.java @@ -22,9 +22,9 @@ import com.vaadin.annotations.Theme; import com.vaadin.legacy.data.util.converter.LegacyConverter; import com.vaadin.legacy.data.util.converter.LegacyStringToIntegerConverter; import com.vaadin.server.VaadinRequest; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.CellReference; -import com.vaadin.ui.Grid.CellStyleGenerator; +import com.vaadin.ui.LegacyGrid; +import com.vaadin.ui.LegacyGrid.CellReference; +import com.vaadin.ui.LegacyGrid.CellStyleGenerator; import com.vaadin.ui.UI; import com.vaadin.ui.renderers.HtmlRenderer; import com.vaadin.ui.renderers.NumberRenderer; @@ -34,7 +34,7 @@ public class FormattingDataInGrid extends UI { @Override protected void init(VaadinRequest request) { - Grid grid = new Grid(GridExampleHelper.createContainer()); + LegacyGrid grid = new LegacyGrid(GridExampleHelper.createContainer()); setContent(grid); diff --git a/uitest/src/main/java/com/vaadin/tests/minitutorials/v7_4/ShowingInlineDataInGrid.java b/uitest/src/main/java/com/vaadin/tests/minitutorials/v7_4/ShowingInlineDataInGrid.java index 7f47de6869..4c3b93e390 100644 --- a/uitest/src/main/java/com/vaadin/tests/minitutorials/v7_4/ShowingInlineDataInGrid.java +++ b/uitest/src/main/java/com/vaadin/tests/minitutorials/v7_4/ShowingInlineDataInGrid.java @@ -18,7 +18,7 @@ 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.Grid; +import com.vaadin.ui.LegacyGrid; import com.vaadin.ui.UI; @Theme("valo") @@ -26,7 +26,7 @@ public class ShowingInlineDataInGrid extends UI { @Override protected void init(VaadinRequest request) { - final Grid grid = new Grid(); + final LegacyGrid grid = new LegacyGrid(); grid.addColumn("Name").setSortable(true); grid.addColumn("Score", Integer.class); diff --git a/uitest/src/main/java/com/vaadin/tests/minitutorials/v7_4/UsingGridWithAContainer.java b/uitest/src/main/java/com/vaadin/tests/minitutorials/v7_4/UsingGridWithAContainer.java index a6c64eead3..72ec28c209 100644 --- a/uitest/src/main/java/com/vaadin/tests/minitutorials/v7_4/UsingGridWithAContainer.java +++ b/uitest/src/main/java/com/vaadin/tests/minitutorials/v7_4/UsingGridWithAContainer.java @@ -16,13 +16,13 @@ package com.vaadin.tests.minitutorials.v7_4; import com.vaadin.server.VaadinRequest; -import com.vaadin.ui.Grid; +import com.vaadin.ui.LegacyGrid; import com.vaadin.ui.UI; public class UsingGridWithAContainer extends UI { @Override protected void init(VaadinRequest request) { - Grid grid = new Grid(); + LegacyGrid grid = new LegacyGrid(); grid.setContainerDataSource(GridExampleHelper.createContainer()); grid.getColumn("name").setHeaderCaption("Bean name"); diff --git a/uitest/src/main/java/com/vaadin/tests/minitutorials/v7_5/ShowingExtraDataForRows.java b/uitest/src/main/java/com/vaadin/tests/minitutorials/v7_5/ShowingExtraDataForRows.java index e658bba492..25181ef6f6 100644 --- a/uitest/src/main/java/com/vaadin/tests/minitutorials/v7_5/ShowingExtraDataForRows.java +++ b/uitest/src/main/java/com/vaadin/tests/minitutorials/v7_5/ShowingExtraDataForRows.java @@ -24,9 +24,9 @@ import com.vaadin.tests.minitutorials.v7_4.GridExampleHelper; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Component; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Grid.DetailsGenerator; -import com.vaadin.ui.Grid.RowReference; +import com.vaadin.ui.LegacyGrid; +import com.vaadin.ui.LegacyGrid.DetailsGenerator; +import com.vaadin.ui.LegacyGrid.RowReference; import com.vaadin.ui.Image; import com.vaadin.ui.Label; import com.vaadin.ui.Notification; @@ -36,7 +36,7 @@ import com.vaadin.ui.VerticalLayout; public class ShowingExtraDataForRows extends UI { @Override protected void init(VaadinRequest request) { - final Grid grid = new Grid(); + final LegacyGrid grid = new LegacyGrid(); grid.setContainerDataSource(GridExampleHelper.createContainer()); grid.setDetailsGenerator(new DetailsGenerator() { diff --git a/uitest/src/main/java/com/vaadin/tests/themes/valo/GridDisabled.java b/uitest/src/main/java/com/vaadin/tests/themes/valo/GridDisabled.java index 9bb0c0c0e3..0c445ceed0 100644 --- a/uitest/src/main/java/com/vaadin/tests/themes/valo/GridDisabled.java +++ b/uitest/src/main/java/com/vaadin/tests/themes/valo/GridDisabled.java @@ -4,14 +4,14 @@ import com.vaadin.annotations.Theme; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Button; -import com.vaadin.ui.Grid; +import com.vaadin.ui.LegacyGrid; @Theme("valo") public class GridDisabled extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { - final Grid grid = new Grid(); + final LegacyGrid grid = new LegacyGrid(); grid.addColumn("foo", String.class); grid.addRow("Foo"); diff --git a/uitest/src/main/resources/com/vaadin/tests/components/grid/declarative/GridBasicFeatures.html b/uitest/src/main/resources/com/vaadin/tests/components/grid/declarative/GridBasicFeatures.html index e99025abfb..f91829e002 100644 --- a/uitest/src/main/resources/com/vaadin/tests/components/grid/declarative/GridBasicFeatures.html +++ b/uitest/src/main/resources/com/vaadin/tests/components/grid/declarative/GridBasicFeatures.html @@ -1,499 +1,499 @@ -<vaadin-grid - editor-save-caption='Save' - editor-cancel-caption='Cancel' - frozen-columns=1 - style-name='grid-basics' - width='750px' height='100%'> -<table> - <colgroup> - <col min-width='150'/> - <col width='115'/> - <col width='115'/> - <col width='115'/> - <col width='115'/> - <col width='115'/> - <col width='115'/> - <col width='115'/> - <col width='115'/> - </colgroup> - <thead> - <tr> - <th /> - <th colspan=2><b>2012</b></th> - <th colspan=2><b>2013</b></th> - <th colspan=2><b>2014</b></th> - <th colspan=2><b>2015</b></th> - </tr> - <tr default=true> - <th>Company</th> - <th>H1</th> - <th>H2</th> - <th>H1</th> - <th>H2</th> - <th>H1</th> - <th>H2</th> - <th>H1</th> - <th>H2</th> - </tr> - <tr> - <th> - <vaadin-text-field width='100%' input-prompt='Filter'></vaadin-textfield> - <!-- - --> - </th> - <th /> - <th /> - <th /> - <th /> - <th /> - <th /> - <th /> - <th /> - </tr> - </thead> - <tbody> - <tr> - <td>Deomic</td> - <td>$6,063.67</td> - <td>$7,116.66</td> - <td>$5,879.24</td> - <td>$5,270.28</td> - <td>$393.65</td> - <td>$4,922.45</td> - <td>$5,443.97</td> - <td>$203.05</td> - </tr> - <tr> - <td>Deomic</td> - <td>$4,802.82</td> - <td>$7,083.74</td> - <td>$6,418.09</td> - <td>$9,964.82</td> - <td>$6,508.00</td> - <td>$8,904.53</td> - <td>$3,938.05</td> - <td>$2,283.44</td> - </tr> - <tr> - <td>Deomic</td> - <td>$4,802.82</td> - <td>$7,083.74</td> - <td>$6,418.09</td> - <td>$9,964.82</td> - <td>$4,543.26</td> - <td>$2,004.65</td> - <td>$5,961.86</td> - <td>$5,753.23</td> - </tr> - <tr> - <td>Deomic</td> - <td>$6,063.67</td> - <td>$7,116.66</td> - <td>$5,879.24</td> - <td>$5,270.28</td> - <td>$393.65</td> - <td>$4,922.45</td> - <td>$5,443.97</td> - <td>$203.05</td> - </tr> - <tr> - <td>Deomic</td> - <td>$4,802.82</td> - <td>$7,083.74</td> - <td>$6,418.09</td> - <td>$9,964.82</td> - <td>$6,508.00</td> - <td>$8,904.53</td> - <td>$3,938.05</td> - <td>$2,283.44</td> - </tr> - <tr> - <td>Deomic</td> - <td>$4,802.82</td> - <td>$7,083.74</td> - <td>$6,418.09</td> - <td>$9,964.82</td> - <td>$4,543.26</td> - <td>$2,004.65</td> - <td>$5,961.86</td> - <td>$5,753.23</td> - </tr> - <tr> - <td>Deomic</td> - <td>$6,063.67</td> - <td>$7,116.66</td> - <td>$5,879.24</td> - <td>$5,270.28</td> - <td>$393.65</td> - <td>$4,922.45</td> - <td>$5,443.97</td> - <td>$203.05</td> - </tr> - <tr> - <td>Deomic</td> - <td>$4,802.82</td> - <td>$7,083.74</td> - <td>$6,418.09</td> - <td>$9,964.82</td> - <td>$6,508.00</td> - <td>$8,904.53</td> - <td>$3,938.05</td> - <td>$2,283.44</td> - </tr> - <tr> - <td>Deomic</td> - <td>$4,802.82</td> - <td>$7,083.74</td> - <td>$6,418.09</td> - <td>$9,964.82</td> - <td>$4,543.26</td> - <td>$2,004.65</td> - <td>$5,961.86</td> - <td>$5,753.23</td> - </tr> - <tr> - <td>Deomic</td> - <td>$6,063.67</td> - <td>$7,116.66</td> - <td>$5,879.24</td> - <td>$5,270.28</td> - <td>$393.65</td> - <td>$4,922.45</td> - <td>$5,443.97</td> - <td>$203.05</td> - </tr> - <tr> - <td>Deomic</td> - <td>$4,802.82</td> - <td>$7,083.74</td> - <td>$6,418.09</td> - <td>$9,964.82</td> - <td>$6,508.00</td> - <td>$8,904.53</td> - <td>$3,938.05</td> - <td>$2,283.44</td> - </tr> - <tr> - <td>Deomic</td> - <td>$4,802.82</td> - <td>$7,083.74</td> - <td>$6,418.09</td> - <td>$9,964.82</td> - <td>$4,543.26</td> - <td>$2,004.65</td> - <td>$5,961.86</td> - <td>$5,753.23</td> - </tr> - <tr> - <td>Deomic</td> - <td>$6,063.67</td> - <td>$7,116.66</td> - <td>$5,879.24</td> - <td>$5,270.28</td> - <td>$393.65</td> - <td>$4,922.45</td> - <td>$5,443.97</td> - <td>$203.05</td> - </tr> - <tr> - <td>Deomic</td> - <td>$4,802.82</td> - <td>$7,083.74</td> - <td>$6,418.09</td> - <td>$9,964.82</td> - <td>$6,508.00</td> - <td>$8,904.53</td> - <td>$3,938.05</td> - <td>$2,283.44</td> - </tr> - <tr> - <td>Deomic</td> - <td>$4,802.82</td> - <td>$7,083.74</td> - <td>$6,418.09</td> - <td>$9,964.82</td> - <td>$4,543.26</td> - <td>$2,004.65</td> - <td>$5,961.86</td> - <td>$5,753.23</td> - </tr> - <tr> - <td>Deomic</td> - <td>$6,063.67</td> - <td>$7,116.66</td> - <td>$5,879.24</td> - <td>$5,270.28</td> - <td>$393.65</td> - <td>$4,922.45</td> - <td>$5,443.97</td> - <td>$203.05</td> - </tr> - <tr> - <td>Deomic</td> - <td>$4,802.82</td> - <td>$7,083.74</td> - <td>$6,418.09</td> - <td>$9,964.82</td> - <td>$6,508.00</td> - <td>$8,904.53</td> - <td>$3,938.05</td> - <td>$2,283.44</td> - </tr> - <tr> - <td>Deomic</td> - <td>$4,802.82</td> - <td>$7,083.74</td> - <td>$6,418.09</td> - <td>$9,964.82</td> - <td>$4,543.26</td> - <td>$2,004.65</td> - <td>$5,961.86</td> - <td>$5,753.23</td> - </tr> - <tr> - <td>Deomic</td> - <td>$6,063.67</td> - <td>$7,116.66</td> - <td>$5,879.24</td> - <td>$5,270.28</td> - <td>$393.65</td> - <td>$4,922.45</td> - <td>$5,443.97</td> - <td>$203.05</td> - </tr> - <tr> - <td>Deomic</td> - <td>$4,802.82</td> - <td>$7,083.74</td> - <td>$6,418.09</td> - <td>$9,964.82</td> - <td>$6,508.00</td> - <td>$8,904.53</td> - <td>$3,938.05</td> - <td>$2,283.44</td> - </tr> - <tr> - <td>Deomic</td> - <td>$4,802.82</td> - <td>$7,083.74</td> - <td>$6,418.09</td> - <td>$9,964.82</td> - <td>$4,543.26</td> - <td>$2,004.65</td> - <td>$5,961.86</td> - <td>$5,753.23</td> - </tr> - <tr> - <td>Deomic</td> - <td>$6,063.67</td> - <td>$7,116.66</td> - <td>$5,879.24</td> - <td>$5,270.28</td> - <td>$393.65</td> - <td>$4,922.45</td> - <td>$5,443.97</td> - <td>$203.05</td> - </tr> - <tr> - <td>Deomic</td> - <td>$4,802.82</td> - <td>$7,083.74</td> - <td>$6,418.09</td> - <td>$9,964.82</td> - <td>$6,508.00</td> - <td>$8,904.53</td> - <td>$3,938.05</td> - <td>$2,283.44</td> - </tr> - <tr> - <td>Deomic</td> - <td>$4,802.82</td> - <td>$7,083.74</td> - <td>$6,418.09</td> - <td>$9,964.82</td> - <td>$4,543.26</td> - <td>$2,004.65</td> - <td>$5,961.86</td> - <td>$5,753.23</td> - </tr> - <tr> - <td>Deomic</td> - <td>$6,063.67</td> - <td>$7,116.66</td> - <td>$5,879.24</td> - <td>$5,270.28</td> - <td>$393.65</td> - <td>$4,922.45</td> - <td>$5,443.97</td> - <td>$203.05</td> - </tr> - <tr> - <td>Deomic</td> - <td>$4,802.82</td> - <td>$7,083.74</td> - <td>$6,418.09</td> - <td>$9,964.82</td> - <td>$6,508.00</td> - <td>$8,904.53</td> - <td>$3,938.05</td> - <td>$2,283.44</td> - </tr> - <tr> - <td>Deomic</td> - <td>$4,802.82</td> - <td>$7,083.74</td> - <td>$6,418.09</td> - <td>$9,964.82</td> - <td>$4,543.26</td> - <td>$2,004.65</td> - <td>$5,961.86</td> - <td>$5,753.23</td> - </tr> - <tr> - <td>Deomic</td> - <td>$6,063.67</td> - <td>$7,116.66</td> - <td>$5,879.24</td> - <td>$5,270.28</td> - <td>$393.65</td> - <td>$4,922.45</td> - <td>$5,443.97</td> - <td>$203.05</td> - </tr> - <tr> - <td>Deomic</td> - <td>$4,802.82</td> - <td>$7,083.74</td> - <td>$6,418.09</td> - <td>$9,964.82</td> - <td>$6,508.00</td> - <td>$8,904.53</td> - <td>$3,938.05</td> - <td>$2,283.44</td> - </tr> - <tr> - <td>Deomic</td> - <td>$4,802.82</td> - <td>$7,083.74</td> - <td>$6,418.09</td> - <td>$9,964.82</td> - <td>$4,543.26</td> - <td>$2,004.65</td> - <td>$5,961.86</td> - <td>$5,753.23</td> - </tr> - <tr> - <td>Deomic</td> - <td>$6,063.67</td> - <td>$7,116.66</td> - <td>$5,879.24</td> - <td>$5,270.28</td> - <td>$393.65</td> - <td>$4,922.45</td> - <td>$5,443.97</td> - <td>$203.05</td> - </tr> - <tr> - <td>Deomic</td> - <td>$4,802.82</td> - <td>$7,083.74</td> - <td>$6,418.09</td> - <td>$9,964.82</td> - <td>$6,508.00</td> - <td>$8,904.53</td> - <td>$3,938.05</td> - <td>$2,283.44</td> - </tr> - <tr> - <td>Deomic</td> - <td>$4,802.82</td> - <td>$7,083.74</td> - <td>$6,418.09</td> - <td>$9,964.82</td> - <td>$4,543.26</td> - <td>$2,004.65</td> - <td>$5,961.86</td> - <td>$5,753.23</td> - </tr> - <tr> - <td>Deomic</td> - <td>$6,063.67</td> - <td>$7,116.66</td> - <td>$5,879.24</td> - <td>$5,270.28</td> - <td>$393.65</td> - <td>$4,922.45</td> - <td>$5,443.97</td> - <td>$203.05</td> - </tr> - <tr> - <td>Deomic</td> - <td>$4,802.82</td> - <td>$7,083.74</td> - <td>$6,418.09</td> - <td>$9,964.82</td> - <td>$6,508.00</td> - <td>$8,904.53</td> - <td>$3,938.05</td> - <td>$2,283.44</td> - </tr> - <tr> - <td>Deomic</td> - <td>$4,802.82</td> - <td>$7,083.74</td> - <td>$6,418.09</td> - <td>$9,964.82</td> - <td>$4,543.26</td> - <td>$2,004.65</td> - <td>$5,961.86</td> - <td>$5,753.23</td> - </tr> - <tr> - <td>Deomic</td> - <td>$6,063.67</td> - <td>$7,116.66</td> - <td>$5,879.24</td> - <td>$5,270.28</td> - <td>$393.65</td> - <td>$4,922.45</td> - <td>$5,443.97</td> - <td>$203.05</td> - </tr> - <tr> - <td>Deomic</td> - <td>$4,802.82</td> - <td>$7,083.74</td> - <td>$6,418.09</td> - <td>$9,964.82</td> - <td>$6,508.00</td> - <td>$8,904.53</td> - <td>$3,938.05</td> - <td>$2,283.44</td> - </tr> - <tr> - <td>Deomic</td> - <td>$4,802.82</td> - <td>$7,083.74</td> - <td>$6,418.09</td> - <td>$9,964.82</td> - <td>$4,543.26</td> - <td>$2,004.65</td> - <td>$5,961.86</td> - <td>$5,753.23</td> - </tr> - </tbody> - <tfoot> - <tr> - <td /> - <td>$$$</td> - <td>$$$</td> - <td>$$$</td> - <td>$$$</td> - <td>$$$</td> - <td>$$$</td> - <td>$$$</td> - <td>$$$</td> - </tr> - </tfoot> -</table> -</vaadin-grid>
\ No newline at end of file +<vaadin-legacy-grid
+ editor-save-caption='Save'
+ editor-cancel-caption='Cancel'
+ frozen-columns=1
+ style-name='grid-basics'
+ width='750px' height='100%'>
+<table>
+ <colgroup>
+ <col min-width='150'/>
+ <col width='115'/>
+ <col width='115'/>
+ <col width='115'/>
+ <col width='115'/>
+ <col width='115'/>
+ <col width='115'/>
+ <col width='115'/>
+ <col width='115'/>
+ </colgroup>
+ <thead>
+ <tr>
+ <th />
+ <th colspan=2><b>2012</b></th>
+ <th colspan=2><b>2013</b></th>
+ <th colspan=2><b>2014</b></th>
+ <th colspan=2><b>2015</b></th>
+ </tr>
+ <tr default=true>
+ <th>Company</th>
+ <th>H1</th>
+ <th>H2</th>
+ <th>H1</th>
+ <th>H2</th>
+ <th>H1</th>
+ <th>H2</th>
+ <th>H1</th>
+ <th>H2</th>
+ </tr>
+ <tr>
+ <th>
+ <vaadin-text-field width='100%' input-prompt='Filter'></vaadin-textfield>
+ <!--
+ -->
+ </th>
+ <th />
+ <th />
+ <th />
+ <th />
+ <th />
+ <th />
+ <th />
+ <th />
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>Deomic</td>
+ <td>$6,063.67</td>
+ <td>$7,116.66</td>
+ <td>$5,879.24</td>
+ <td>$5,270.28</td>
+ <td>$393.65</td>
+ <td>$4,922.45</td>
+ <td>$5,443.97</td>
+ <td>$203.05</td>
+ </tr>
+ <tr>
+ <td>Deomic</td>
+ <td>$4,802.82</td>
+ <td>$7,083.74</td>
+ <td>$6,418.09</td>
+ <td>$9,964.82</td>
+ <td>$6,508.00</td>
+ <td>$8,904.53</td>
+ <td>$3,938.05</td>
+ <td>$2,283.44</td>
+ </tr>
+ <tr>
+ <td>Deomic</td>
+ <td>$4,802.82</td>
+ <td>$7,083.74</td>
+ <td>$6,418.09</td>
+ <td>$9,964.82</td>
+ <td>$4,543.26</td>
+ <td>$2,004.65</td>
+ <td>$5,961.86</td>
+ <td>$5,753.23</td>
+ </tr>
+ <tr>
+ <td>Deomic</td>
+ <td>$6,063.67</td>
+ <td>$7,116.66</td>
+ <td>$5,879.24</td>
+ <td>$5,270.28</td>
+ <td>$393.65</td>
+ <td>$4,922.45</td>
+ <td>$5,443.97</td>
+ <td>$203.05</td>
+ </tr>
+ <tr>
+ <td>Deomic</td>
+ <td>$4,802.82</td>
+ <td>$7,083.74</td>
+ <td>$6,418.09</td>
+ <td>$9,964.82</td>
+ <td>$6,508.00</td>
+ <td>$8,904.53</td>
+ <td>$3,938.05</td>
+ <td>$2,283.44</td>
+ </tr>
+ <tr>
+ <td>Deomic</td>
+ <td>$4,802.82</td>
+ <td>$7,083.74</td>
+ <td>$6,418.09</td>
+ <td>$9,964.82</td>
+ <td>$4,543.26</td>
+ <td>$2,004.65</td>
+ <td>$5,961.86</td>
+ <td>$5,753.23</td>
+ </tr>
+ <tr>
+ <td>Deomic</td>
+ <td>$6,063.67</td>
+ <td>$7,116.66</td>
+ <td>$5,879.24</td>
+ <td>$5,270.28</td>
+ <td>$393.65</td>
+ <td>$4,922.45</td>
+ <td>$5,443.97</td>
+ <td>$203.05</td>
+ </tr>
+ <tr>
+ <td>Deomic</td>
+ <td>$4,802.82</td>
+ <td>$7,083.74</td>
+ <td>$6,418.09</td>
+ <td>$9,964.82</td>
+ <td>$6,508.00</td>
+ <td>$8,904.53</td>
+ <td>$3,938.05</td>
+ <td>$2,283.44</td>
+ </tr>
+ <tr>
+ <td>Deomic</td>
+ <td>$4,802.82</td>
+ <td>$7,083.74</td>
+ <td>$6,418.09</td>
+ <td>$9,964.82</td>
+ <td>$4,543.26</td>
+ <td>$2,004.65</td>
+ <td>$5,961.86</td>
+ <td>$5,753.23</td>
+ </tr>
+ <tr>
+ <td>Deomic</td>
+ <td>$6,063.67</td>
+ <td>$7,116.66</td>
+ <td>$5,879.24</td>
+ <td>$5,270.28</td>
+ <td>$393.65</td>
+ <td>$4,922.45</td>
+ <td>$5,443.97</td>
+ <td>$203.05</td>
+ </tr>
+ <tr>
+ <td>Deomic</td>
+ <td>$4,802.82</td>
+ <td>$7,083.74</td>
+ <td>$6,418.09</td>
+ <td>$9,964.82</td>
+ <td>$6,508.00</td>
+ <td>$8,904.53</td>
+ <td>$3,938.05</td>
+ <td>$2,283.44</td>
+ </tr>
+ <tr>
+ <td>Deomic</td>
+ <td>$4,802.82</td>
+ <td>$7,083.74</td>
+ <td>$6,418.09</td>
+ <td>$9,964.82</td>
+ <td>$4,543.26</td>
+ <td>$2,004.65</td>
+ <td>$5,961.86</td>
+ <td>$5,753.23</td>
+ </tr>
+ <tr>
+ <td>Deomic</td>
+ <td>$6,063.67</td>
+ <td>$7,116.66</td>
+ <td>$5,879.24</td>
+ <td>$5,270.28</td>
+ <td>$393.65</td>
+ <td>$4,922.45</td>
+ <td>$5,443.97</td>
+ <td>$203.05</td>
+ </tr>
+ <tr>
+ <td>Deomic</td>
+ <td>$4,802.82</td>
+ <td>$7,083.74</td>
+ <td>$6,418.09</td>
+ <td>$9,964.82</td>
+ <td>$6,508.00</td>
+ <td>$8,904.53</td>
+ <td>$3,938.05</td>
+ <td>$2,283.44</td>
+ </tr>
+ <tr>
+ <td>Deomic</td>
+ <td>$4,802.82</td>
+ <td>$7,083.74</td>
+ <td>$6,418.09</td>
+ <td>$9,964.82</td>
+ <td>$4,543.26</td>
+ <td>$2,004.65</td>
+ <td>$5,961.86</td>
+ <td>$5,753.23</td>
+ </tr>
+ <tr>
+ <td>Deomic</td>
+ <td>$6,063.67</td>
+ <td>$7,116.66</td>
+ <td>$5,879.24</td>
+ <td>$5,270.28</td>
+ <td>$393.65</td>
+ <td>$4,922.45</td>
+ <td>$5,443.97</td>
+ <td>$203.05</td>
+ </tr>
+ <tr>
+ <td>Deomic</td>
+ <td>$4,802.82</td>
+ <td>$7,083.74</td>
+ <td>$6,418.09</td>
+ <td>$9,964.82</td>
+ <td>$6,508.00</td>
+ <td>$8,904.53</td>
+ <td>$3,938.05</td>
+ <td>$2,283.44</td>
+ </tr>
+ <tr>
+ <td>Deomic</td>
+ <td>$4,802.82</td>
+ <td>$7,083.74</td>
+ <td>$6,418.09</td>
+ <td>$9,964.82</td>
+ <td>$4,543.26</td>
+ <td>$2,004.65</td>
+ <td>$5,961.86</td>
+ <td>$5,753.23</td>
+ </tr>
+ <tr>
+ <td>Deomic</td>
+ <td>$6,063.67</td>
+ <td>$7,116.66</td>
+ <td>$5,879.24</td>
+ <td>$5,270.28</td>
+ <td>$393.65</td>
+ <td>$4,922.45</td>
+ <td>$5,443.97</td>
+ <td>$203.05</td>
+ </tr>
+ <tr>
+ <td>Deomic</td>
+ <td>$4,802.82</td>
+ <td>$7,083.74</td>
+ <td>$6,418.09</td>
+ <td>$9,964.82</td>
+ <td>$6,508.00</td>
+ <td>$8,904.53</td>
+ <td>$3,938.05</td>
+ <td>$2,283.44</td>
+ </tr>
+ <tr>
+ <td>Deomic</td>
+ <td>$4,802.82</td>
+ <td>$7,083.74</td>
+ <td>$6,418.09</td>
+ <td>$9,964.82</td>
+ <td>$4,543.26</td>
+ <td>$2,004.65</td>
+ <td>$5,961.86</td>
+ <td>$5,753.23</td>
+ </tr>
+ <tr>
+ <td>Deomic</td>
+ <td>$6,063.67</td>
+ <td>$7,116.66</td>
+ <td>$5,879.24</td>
+ <td>$5,270.28</td>
+ <td>$393.65</td>
+ <td>$4,922.45</td>
+ <td>$5,443.97</td>
+ <td>$203.05</td>
+ </tr>
+ <tr>
+ <td>Deomic</td>
+ <td>$4,802.82</td>
+ <td>$7,083.74</td>
+ <td>$6,418.09</td>
+ <td>$9,964.82</td>
+ <td>$6,508.00</td>
+ <td>$8,904.53</td>
+ <td>$3,938.05</td>
+ <td>$2,283.44</td>
+ </tr>
+ <tr>
+ <td>Deomic</td>
+ <td>$4,802.82</td>
+ <td>$7,083.74</td>
+ <td>$6,418.09</td>
+ <td>$9,964.82</td>
+ <td>$4,543.26</td>
+ <td>$2,004.65</td>
+ <td>$5,961.86</td>
+ <td>$5,753.23</td>
+ </tr>
+ <tr>
+ <td>Deomic</td>
+ <td>$6,063.67</td>
+ <td>$7,116.66</td>
+ <td>$5,879.24</td>
+ <td>$5,270.28</td>
+ <td>$393.65</td>
+ <td>$4,922.45</td>
+ <td>$5,443.97</td>
+ <td>$203.05</td>
+ </tr>
+ <tr>
+ <td>Deomic</td>
+ <td>$4,802.82</td>
+ <td>$7,083.74</td>
+ <td>$6,418.09</td>
+ <td>$9,964.82</td>
+ <td>$6,508.00</td>
+ <td>$8,904.53</td>
+ <td>$3,938.05</td>
+ <td>$2,283.44</td>
+ </tr>
+ <tr>
+ <td>Deomic</td>
+ <td>$4,802.82</td>
+ <td>$7,083.74</td>
+ <td>$6,418.09</td>
+ <td>$9,964.82</td>
+ <td>$4,543.26</td>
+ <td>$2,004.65</td>
+ <td>$5,961.86</td>
+ <td>$5,753.23</td>
+ </tr>
+ <tr>
+ <td>Deomic</td>
+ <td>$6,063.67</td>
+ <td>$7,116.66</td>
+ <td>$5,879.24</td>
+ <td>$5,270.28</td>
+ <td>$393.65</td>
+ <td>$4,922.45</td>
+ <td>$5,443.97</td>
+ <td>$203.05</td>
+ </tr>
+ <tr>
+ <td>Deomic</td>
+ <td>$4,802.82</td>
+ <td>$7,083.74</td>
+ <td>$6,418.09</td>
+ <td>$9,964.82</td>
+ <td>$6,508.00</td>
+ <td>$8,904.53</td>
+ <td>$3,938.05</td>
+ <td>$2,283.44</td>
+ </tr>
+ <tr>
+ <td>Deomic</td>
+ <td>$4,802.82</td>
+ <td>$7,083.74</td>
+ <td>$6,418.09</td>
+ <td>$9,964.82</td>
+ <td>$4,543.26</td>
+ <td>$2,004.65</td>
+ <td>$5,961.86</td>
+ <td>$5,753.23</td>
+ </tr>
+ <tr>
+ <td>Deomic</td>
+ <td>$6,063.67</td>
+ <td>$7,116.66</td>
+ <td>$5,879.24</td>
+ <td>$5,270.28</td>
+ <td>$393.65</td>
+ <td>$4,922.45</td>
+ <td>$5,443.97</td>
+ <td>$203.05</td>
+ </tr>
+ <tr>
+ <td>Deomic</td>
+ <td>$4,802.82</td>
+ <td>$7,083.74</td>
+ <td>$6,418.09</td>
+ <td>$9,964.82</td>
+ <td>$6,508.00</td>
+ <td>$8,904.53</td>
+ <td>$3,938.05</td>
+ <td>$2,283.44</td>
+ </tr>
+ <tr>
+ <td>Deomic</td>
+ <td>$4,802.82</td>
+ <td>$7,083.74</td>
+ <td>$6,418.09</td>
+ <td>$9,964.82</td>
+ <td>$4,543.26</td>
+ <td>$2,004.65</td>
+ <td>$5,961.86</td>
+ <td>$5,753.23</td>
+ </tr>
+ <tr>
+ <td>Deomic</td>
+ <td>$6,063.67</td>
+ <td>$7,116.66</td>
+ <td>$5,879.24</td>
+ <td>$5,270.28</td>
+ <td>$393.65</td>
+ <td>$4,922.45</td>
+ <td>$5,443.97</td>
+ <td>$203.05</td>
+ </tr>
+ <tr>
+ <td>Deomic</td>
+ <td>$4,802.82</td>
+ <td>$7,083.74</td>
+ <td>$6,418.09</td>
+ <td>$9,964.82</td>
+ <td>$6,508.00</td>
+ <td>$8,904.53</td>
+ <td>$3,938.05</td>
+ <td>$2,283.44</td>
+ </tr>
+ <tr>
+ <td>Deomic</td>
+ <td>$4,802.82</td>
+ <td>$7,083.74</td>
+ <td>$6,418.09</td>
+ <td>$9,964.82</td>
+ <td>$4,543.26</td>
+ <td>$2,004.65</td>
+ <td>$5,961.86</td>
+ <td>$5,753.23</td>
+ </tr>
+ <tr>
+ <td>Deomic</td>
+ <td>$6,063.67</td>
+ <td>$7,116.66</td>
+ <td>$5,879.24</td>
+ <td>$5,270.28</td>
+ <td>$393.65</td>
+ <td>$4,922.45</td>
+ <td>$5,443.97</td>
+ <td>$203.05</td>
+ </tr>
+ <tr>
+ <td>Deomic</td>
+ <td>$4,802.82</td>
+ <td>$7,083.74</td>
+ <td>$6,418.09</td>
+ <td>$9,964.82</td>
+ <td>$6,508.00</td>
+ <td>$8,904.53</td>
+ <td>$3,938.05</td>
+ <td>$2,283.44</td>
+ </tr>
+ <tr>
+ <td>Deomic</td>
+ <td>$4,802.82</td>
+ <td>$7,083.74</td>
+ <td>$6,418.09</td>
+ <td>$9,964.82</td>
+ <td>$4,543.26</td>
+ <td>$2,004.65</td>
+ <td>$5,961.86</td>
+ <td>$5,753.23</td>
+ </tr>
+ </tbody>
+ <tfoot>
+ <tr>
+ <td />
+ <td>$$$</td>
+ <td>$$$</td>
+ <td>$$$</td>
+ <td>$$$</td>
+ <td>$$$</td>
+ <td>$$$</td>
+ <td>$$$</td>
+ <td>$$$</td>
+ </tr>
+ </tfoot>
+</table>
+</vaadin-legacy-grid>
\ No newline at end of file diff --git a/uitest/src/main/resources/com/vaadin/tests/components/grid/declarative/GridItemEditor.html b/uitest/src/main/resources/com/vaadin/tests/components/grid/declarative/GridItemEditor.html index 0f9bb49da2..7290f92c2c 100644 --- a/uitest/src/main/resources/com/vaadin/tests/components/grid/declarative/GridItemEditor.html +++ b/uitest/src/main/resources/com/vaadin/tests/components/grid/declarative/GridItemEditor.html @@ -1,81 +1,81 @@ -<vaadin-grid caption="Double click to edit" width="100%" height="100%" - editable selection-mode="none"> -<table> - <colgroup> - <col property-id="index" editable=false width="50" expand=0> - <col property-id="name" expand=2> - <col property-id="progress" expand=2> - <col property-id="weight" editable=false expand=4> - </colgroup> - <thead> - <tr> - <th>## - <th>Name - <th>Progress - <th>Weight - </tr> - </thead> - <tbody> - <tr> - <td>00 - <td>Marc Addams - <td>0.42 - <td>[SparkLine] - </tr> - <tr> - <td>01 - <td>Kenny Black - <td>0.72 - <td>[SparkLine] - </tr> - <tr> - <td>02 - <td>Sarah McGoff - <td>0.12 - <td>[SparkLine] - </tr> - <tr> - <td>03 - <td>Jos Jones - <td>0.62 - <td>[SparkLine] - </tr> - <tr> - <td>04 - <td>Jane Fielding - <td>0.92 - <td>[SparkLine] - </tr> - <tr> - <td>05 - <td>Marc Einstein - <td>0.05 - <td>[SparkLine] - </tr> - <tr> - <td>06 - <td>Lenny McGoff - <td>0.40 - <td>[SparkLine] - </tr> - <tr> - <td>07 - <td>Peter Adams - <td>0.85 - <td>[SparkLine] - </tr> - <tr> - <td>08 - <td>Tony Stark - <td>0.22 - <td>[SparkLine] - </tr> - <tr> - <td>09 - <td>Nathan Fillion - <td>0.15 - <td>[SparkLine] - </tr> - </tbody> -</table> -</vaadin-grid>
\ No newline at end of file +<vaadin-legacy-grid caption="Double click to edit" width="100%" height="100%"
+ editable selection-mode="none">
+<table>
+ <colgroup>
+ <col property-id="index" editable=false width="50" expand=0>
+ <col property-id="name" expand=2>
+ <col property-id="progress" expand=2>
+ <col property-id="weight" editable=false expand=4>
+ </colgroup>
+ <thead>
+ <tr>
+ <th>##
+ <th>Name
+ <th>Progress
+ <th>Weight
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>00
+ <td>Marc Addams
+ <td>0.42
+ <td>[SparkLine]
+ </tr>
+ <tr>
+ <td>01
+ <td>Kenny Black
+ <td>0.72
+ <td>[SparkLine]
+ </tr>
+ <tr>
+ <td>02
+ <td>Sarah McGoff
+ <td>0.12
+ <td>[SparkLine]
+ </tr>
+ <tr>
+ <td>03
+ <td>Jos Jones
+ <td>0.62
+ <td>[SparkLine]
+ </tr>
+ <tr>
+ <td>04
+ <td>Jane Fielding
+ <td>0.92
+ <td>[SparkLine]
+ </tr>
+ <tr>
+ <td>05
+ <td>Marc Einstein
+ <td>0.05
+ <td>[SparkLine]
+ </tr>
+ <tr>
+ <td>06
+ <td>Lenny McGoff
+ <td>0.40
+ <td>[SparkLine]
+ </tr>
+ <tr>
+ <td>07
+ <td>Peter Adams
+ <td>0.85
+ <td>[SparkLine]
+ </tr>
+ <tr>
+ <td>08
+ <td>Tony Stark
+ <td>0.22
+ <td>[SparkLine]
+ </tr>
+ <tr>
+ <td>09
+ <td>Nathan Fillion
+ <td>0.15
+ <td>[SparkLine]
+ </tr>
+ </tbody>
+</table>
+</vaadin-legacy-grid>
\ No newline at end of file diff --git a/uitest/src/main/resources/com/vaadin/tests/components/grid/declarative/GridMultiSelect.html b/uitest/src/main/resources/com/vaadin/tests/components/grid/declarative/GridMultiSelect.html index a27ff84e72..1909cc6d4f 100644 --- a/uitest/src/main/resources/com/vaadin/tests/components/grid/declarative/GridMultiSelect.html +++ b/uitest/src/main/resources/com/vaadin/tests/components/grid/declarative/GridMultiSelect.html @@ -1,118 +1,118 @@ -<vaadin-grid width='100%' height='100%' selection-mode='multi' editable='false'> -<table> - <colgroup> - <col /> - <col /> - <col /> - </colgroup> - <thead> - <tr> - <th>Description</th> - <th>Milestone</th> - <th>Status</th> - </tr> - </thead> - <tbody> - <tr> - <td>Issue #0</td> - <td>1.0</td> - <td>New</td> - </tr> - <tr> - <td>Issue #1</td> - <td>1.0</td> - <td>New</td> - </tr> - <tr> - <td>Issue #2</td> - <td>1.0</td> - <td>New</td> - </tr> - <tr> - <td>Issue #3</td> - <td>1.0</td> - <td>New</td> - </tr> - <tr> - <td>Issue #4</td> - <td>1.0</td> - <td>New</td> - </tr> - <tr> - <td>Issue #5</td> - <td>1.0</td> - <td>New</td> - </tr> - <tr> - <td>Issue #6</td> - <td>1.0</td> - <td>New</td> - </tr> - <tr> - <td>Issue #7</td> - <td>1.0</td> - <td>New</td> - </tr> - <tr> - <td>Issue #8</td> - <td>1.0</td> - <td>New</td> - </tr> - <tr> - <td>Issue #9</td> - <td>1.0</td> - <td>New</td> - </tr> - <tr> - <td>Issue #10</td> - <td>1.0</td> - <td>New</td> - </tr> - <tr> - <td>Issue #11</td> - <td>1.0</td> - <td>New</td> - </tr> - <tr> - <td>Issue #12</td> - <td>1.0</td> - <td>New</td> - </tr> - <tr> - <td>Issue #13</td> - <td>1.0</td> - <td>New</td> - </tr> - <tr> - <td>Issue #14</td> - <td>1.0</td> - <td>New</td> - </tr> - <tr> - <td>Issue #15</td> - <td>1.0</td> - <td>New</td> - </tr> - <tr> - <td>Issue #16</td> - <td>1.0</td> - <td>New</td> - </tr> - <tr> - <td>Issue #17</td> - <td>1.0</td> - <td>New</td> - </tr> - <tr> - <td>Issue #18</td> - <td>1.0</td> - <td>New</td> - </tr> - <tr> - <td>Issue #19</td> - <td>1.0</td> - <td>New</td> - </tr> - </tbody> -</table> -</vaadin-grid> +<vaadin-legacy-grid width='100%' height='100%' selection-mode='multi' editable='false'>
+<table>
+ <colgroup>
+ <col />
+ <col />
+ <col />
+ </colgroup>
+ <thead>
+ <tr>
+ <th>Description</th>
+ <th>Milestone</th>
+ <th>Status</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>Issue #0</td>
+ <td>1.0</td>
+ <td>New</td>
+ </tr>
+ <tr>
+ <td>Issue #1</td>
+ <td>1.0</td>
+ <td>New</td>
+ </tr>
+ <tr>
+ <td>Issue #2</td>
+ <td>1.0</td>
+ <td>New</td>
+ </tr>
+ <tr>
+ <td>Issue #3</td>
+ <td>1.0</td>
+ <td>New</td>
+ </tr>
+ <tr>
+ <td>Issue #4</td>
+ <td>1.0</td>
+ <td>New</td>
+ </tr>
+ <tr>
+ <td>Issue #5</td>
+ <td>1.0</td>
+ <td>New</td>
+ </tr>
+ <tr>
+ <td>Issue #6</td>
+ <td>1.0</td>
+ <td>New</td>
+ </tr>
+ <tr>
+ <td>Issue #7</td>
+ <td>1.0</td>
+ <td>New</td>
+ </tr>
+ <tr>
+ <td>Issue #8</td>
+ <td>1.0</td>
+ <td>New</td>
+ </tr>
+ <tr>
+ <td>Issue #9</td>
+ <td>1.0</td>
+ <td>New</td>
+ </tr>
+ <tr>
+ <td>Issue #10</td>
+ <td>1.0</td>
+ <td>New</td>
+ </tr>
+ <tr>
+ <td>Issue #11</td>
+ <td>1.0</td>
+ <td>New</td>
+ </tr>
+ <tr>
+ <td>Issue #12</td>
+ <td>1.0</td>
+ <td>New</td>
+ </tr>
+ <tr>
+ <td>Issue #13</td>
+ <td>1.0</td>
+ <td>New</td>
+ </tr>
+ <tr>
+ <td>Issue #14</td>
+ <td>1.0</td>
+ <td>New</td>
+ </tr>
+ <tr>
+ <td>Issue #15</td>
+ <td>1.0</td>
+ <td>New</td>
+ </tr>
+ <tr>
+ <td>Issue #16</td>
+ <td>1.0</td>
+ <td>New</td>
+ </tr>
+ <tr>
+ <td>Issue #17</td>
+ <td>1.0</td>
+ <td>New</td>
+ </tr>
+ <tr>
+ <td>Issue #18</td>
+ <td>1.0</td>
+ <td>New</td>
+ </tr>
+ <tr>
+ <td>Issue #19</td>
+ <td>1.0</td>
+ <td>New</td>
+ </tr>
+ </tbody>
+</table>
+</vaadin-legacy-grid>
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/CustomRendererTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/CustomRendererTest.java index 7edd1f5d49..81dbb05393 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/CustomRendererTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/CustomRendererTest.java @@ -1,70 +1,70 @@ -/* - * 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.tests.components.grid; - -import static org.junit.Assert.assertEquals; - -import java.util.List; - -import org.junit.Test; - -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.testbench.elements.LabelElement; -import com.vaadin.testbench.parallel.TestCategory; -import com.vaadin.tests.tb3.MultiBrowserTest; - -@TestCategory("grid") -public class CustomRendererTest extends MultiBrowserTest { - @Test - public void testIntArrayIsRendered() throws Exception { - openTestURL(); - - GridElement grid = findGrid(); - assertEquals("1 :: 1 :: 2 :: 3 :: 5 :: 8 :: 13", - grid.getCell(0, 0).getText()); - } - - @Test - public void testRowAwareRenderer() throws Exception { - openTestURL(); - - GridElement grid = findGrid(); - assertEquals("Click me!", grid.getCell(0, 1).getText()); - assertEquals(CustomRenderer.INIT_DEBUG_LABEL_CAPTION, - findDebugLabel().getText()); - - grid.getCell(0, 1).click(); - assertEquals("row: 0, key: 1", grid.getCell(0, 1).getText()); - assertEquals("key: 1, itemId: " + CustomRenderer.ITEM_ID, - findDebugLabel().getText()); - } - - @Test - public void testBeanRenderer() throws Exception { - openTestURL(); - - assertEquals("SimpleTestBean(42)", findGrid().getCell(0, 2).getText()); - } - - private GridElement findGrid() { - List<GridElement> elements = $(GridElement.class).all(); - return elements.get(0); - } - - private LabelElement findDebugLabel() { - return $(LabelElement.class).id(CustomRenderer.DEBUG_LABEL_ID); - } -} +/*
+ * 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.tests.components.grid;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.List;
+
+import org.junit.Test;
+
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.elements.LabelElement;
+import com.vaadin.testbench.parallel.TestCategory;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+@TestCategory("grid")
+public class CustomRendererTest extends MultiBrowserTest {
+ @Test
+ public void testIntArrayIsRendered() throws Exception {
+ openTestURL();
+
+ GridElement grid = findGrid();
+ assertEquals("1 :: 1 :: 2 :: 3 :: 5 :: 8 :: 13",
+ grid.getCell(0, 0).getText());
+ }
+
+ @Test
+ public void testRowAwareRenderer() throws Exception {
+ openTestURL();
+
+ GridElement grid = findGrid();
+ assertEquals("Click me!", grid.getCell(0, 1).getText());
+ assertEquals(CustomRenderer.INIT_DEBUG_LABEL_CAPTION,
+ findDebugLabel().getText());
+
+ grid.getCell(0, 1).click();
+ assertEquals("row: 0, key: 1", grid.getCell(0, 1).getText());
+ assertEquals("key: 1, itemId: " + CustomRenderer.ITEM_ID,
+ findDebugLabel().getText());
+ }
+
+ @Test
+ public void testBeanRenderer() throws Exception {
+ openTestURL();
+
+ assertEquals("SimpleTestBean(42)", findGrid().getCell(0, 2).getText());
+ }
+
+ private GridElement findGrid() {
+ List<LegacyGridElement> elements = $(LegacyGridElement.class).all();
+ return elements.get(0);
+ }
+
+ private LabelElement findDebugLabel() {
+ return $(LabelElement.class).id(CustomRenderer.DEBUG_LABEL_ID);
+ }
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridAddAndRemoveDataOnInitTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridAddAndRemoveDataOnInitTest.java index 4cc63a85ce..b0c5d6234a 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridAddAndRemoveDataOnInitTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridAddAndRemoveDataOnInitTest.java @@ -30,13 +30,13 @@ public class GridAddAndRemoveDataOnInitTest extends MultiBrowserTest { public void verifyGridSizes() { openTestURL(); - GridElement gridAdd = $(GridElement.class).first(); + GridElement gridAdd = $(LegacyGridElement.class).first(); if (!gridAdd.isElementPresent(By.vaadin("#cell[9][0]")) || gridAdd.isElementPresent(By.vaadin("#cell[10][0]"))) { Assert.fail("Grid with added data contained incorrect rows"); } - GridElement gridRemove = $(GridElement.class).get(1); + GridElement gridRemove = $(LegacyGridElement.class).get(1); if (!gridRemove.isElementPresent(By.vaadin("#cell[4][0]")) || gridRemove.isElementPresent(By.vaadin("#cell[5][0]"))) { Assert.fail("Grid with removed data contained incorrect rows"); diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridAddRowTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridAddRowTest.java index 188a50773e..c01eebe79c 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridAddRowTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridAddRowTest.java @@ -1,50 +1,50 @@ -/* - * 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.tests.components.grid; - -import org.junit.Assert; -import org.junit.Test; - -import com.vaadin.testbench.elements.ButtonElement; -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.testbench.parallel.TestCategory; -import com.vaadin.tests.tb3.MultiBrowserTest; - -@TestCategory("grid") -public class GridAddRowTest extends MultiBrowserTest { - @Test - public void testAddRow() { - openTestURL(); - - GridElement grid = $(GridElement.class).first(); - - Assert.assertEquals("Lorem", grid.getCell(0, 1).getText()); - Assert.assertEquals("2", grid.getCell(1, 2).getText()); - - addRow(); - - Assert.assertEquals("Dolor", grid.getCell(2, 1).getText()); - - addRow(); - - Assert.assertEquals("Dolor", grid.getCell(3, 1).getText()); - } - - private void addRow() { - $(ButtonElement.class).caption("Add new row").first().click(); - } - -} +/*
+ * 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.tests.components.grid;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import com.vaadin.testbench.elements.ButtonElement;
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.parallel.TestCategory;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+@TestCategory("grid")
+public class GridAddRowTest extends MultiBrowserTest {
+ @Test
+ public void testAddRow() {
+ openTestURL();
+
+ GridElement grid = $(LegacyGridElement.class).first();
+
+ Assert.assertEquals("Lorem", grid.getCell(0, 1).getText());
+ Assert.assertEquals("2", grid.getCell(1, 2).getText());
+
+ addRow();
+
+ Assert.assertEquals("Dolor", grid.getCell(2, 1).getText());
+
+ addRow();
+
+ Assert.assertEquals("Dolor", grid.getCell(3, 1).getText());
+ }
+
+ private void addRow() {
+ $(ButtonElement.class).caption("Add new row").first().click();
+ }
+
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridCheckBoxDisplayTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridCheckBoxDisplayTest.java index 0f7d488f49..ab33f84ce1 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridCheckBoxDisplayTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridCheckBoxDisplayTest.java @@ -1,73 +1,73 @@ -/* - * 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.tests.components.grid; - -import org.junit.Assert; -import org.junit.Test; -import org.openqa.selenium.By; - -import com.vaadin.testbench.elements.CheckBoxElement; -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.testbench.parallel.TestCategory; -import com.vaadin.tests.legacyelements.LegacyCheckBoxElement; -import com.vaadin.tests.tb3.SingleBrowserTest; - -@TestCategory("grid") -public class GridCheckBoxDisplayTest extends SingleBrowserTest { - @Test - public void testAddRow() { - openTestURL(); - - GridElement grid = $(GridElement.class).first(); - - Assert.assertEquals("First item had wrong value", "true", - grid.getCell(0, 0).getText()); - Assert.assertEquals("Second item had wrong value", "false", - grid.getCell(1, 0).getText()); - - // First edit false item and see that the CheckBox is unchecked - grid.getCell(1, 0).doubleClick(); - - CheckBoxElement checkbox = $(LegacyCheckBoxElement.class).first(); - Assert.assertEquals("CheckBox was checked", "unchecked", - checkbox.getValue()); - - closeEditor(); - - // Edit true item and see that the CheckBox is checked - grid.getCell(0, 0).doubleClick(); - - checkbox = $(LegacyCheckBoxElement.class).first(); - Assert.assertEquals("CheckBox was not checked.", "checked", - checkbox.getValue()); - - closeEditor(); - - // Edit false item and confirm that the CheckBox is unchecked again - grid.getCell(1, 0).doubleClick(); - - checkbox = $(LegacyCheckBoxElement.class).first(); - Assert.assertEquals("CheckBox was checked", "unchecked", - checkbox.getValue()); - } - - /** - * Closes the grids editor using the cancel button - */ - private void closeEditor() { - findElement(By.className("v-grid-editor-cancel")).click(); - } -} +/*
+ * 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.tests.components.grid;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.openqa.selenium.By;
+
+import com.vaadin.testbench.elements.CheckBoxElement;
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.parallel.TestCategory;
+import com.vaadin.tests.legacyelements.LegacyCheckBoxElement;
+import com.vaadin.tests.tb3.SingleBrowserTest;
+
+@TestCategory("grid")
+public class GridCheckBoxDisplayTest extends SingleBrowserTest {
+ @Test
+ public void testAddRow() {
+ openTestURL();
+
+ GridElement grid = $(LegacyGridElement.class).first();
+
+ Assert.assertEquals("First item had wrong value", "true",
+ grid.getCell(0, 0).getText());
+ Assert.assertEquals("Second item had wrong value", "false",
+ grid.getCell(1, 0).getText());
+
+ // First edit false item and see that the CheckBox is unchecked
+ grid.getCell(1, 0).doubleClick();
+
+ CheckBoxElement checkbox = $(LegacyCheckBoxElement.class).first();
+ Assert.assertEquals("CheckBox was checked", "unchecked",
+ checkbox.getValue());
+
+ closeEditor();
+
+ // Edit true item and see that the CheckBox is checked
+ grid.getCell(0, 0).doubleClick();
+
+ checkbox = $(LegacyCheckBoxElement.class).first();
+ Assert.assertEquals("CheckBox was not checked.", "checked",
+ checkbox.getValue());
+
+ closeEditor();
+
+ // Edit false item and confirm that the CheckBox is unchecked again
+ grid.getCell(1, 0).doubleClick();
+
+ checkbox = $(LegacyCheckBoxElement.class).first();
+ Assert.assertEquals("CheckBox was checked", "unchecked",
+ checkbox.getValue());
+ }
+
+ /**
+ * Closes the grids editor using the cancel button
+ */
+ private void closeEditor() {
+ findElement(By.className("v-grid-editor-cancel")).click();
+ }
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridColspansTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridColspansTest.java index 9e1f41da75..cacf198dc7 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridColspansTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridColspansTest.java @@ -1,101 +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.tests.components.grid; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import org.junit.Before; -import org.junit.Test; -import org.openqa.selenium.By; - -import com.vaadin.testbench.elements.ButtonElement; -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.testbench.elements.GridElement.GridCellElement; -import com.vaadin.testbench.parallel.TestCategory; -import com.vaadin.tests.tb3.MultiBrowserTest; - -@TestCategory("grid") -public class GridColspansTest extends MultiBrowserTest { - - @Before - public void setUp() { - setDebug(true); - } - - @Test - public void testHeaderColSpans() { - openTestURL(); - - GridElement grid = $(GridElement.class).first(); - assertEquals("5", grid.getHeaderCell(0, 1).getAttribute("colspan")); - assertEquals("2", grid.getHeaderCell(1, 1).getAttribute("colspan")); - assertEquals("3", grid.getHeaderCell(1, 3).getAttribute("colspan")); - } - - @Test - public void testFooterColSpans() { - openTestURL(); - - GridElement grid = $(GridElement.class).first(); - assertEquals("5", grid.getFooterCell(1, 1).getAttribute("colspan")); - assertEquals("2", grid.getFooterCell(0, 1).getAttribute("colspan")); - assertEquals("3", grid.getFooterCell(0, 3).getAttribute("colspan")); - } - - @Test - public void testHideFirstColumnOfColspan() { - openTestURL(); - - GridElement grid = $(GridElement.class).first(); - assertEquals("Failed initial condition.", "all the stuff", - grid.getHeaderCell(0, 1).getText().toLowerCase()); - assertEquals("Failed initial condition.", "first name", - grid.getHeaderCell(2, 1).getText().toLowerCase()); - $(ButtonElement.class).caption("Show/Hide firstName").first().click(); - assertEquals("Header text changed on column hide.", "all the stuff", - grid.getHeaderCell(0, 1).getText().toLowerCase()); - assertEquals("Failed initial condition.", "last name", - grid.getHeaderCell(2, 1).getText().toLowerCase()); - } - - @Test - public void testSplittingMergedHeaders() { - openTestURL(); - - GridElement grid = $(GridElement.class).first(); - GridCellElement headerCell = grid.getHeaderCell(1, 1); - assertEquals("Failed initial condition.", "full name", - headerCell.getText().toLowerCase()); - assertEquals("Failed initial condition.", "first name", - grid.getHeaderCell(2, 1).getText().toLowerCase()); - $(ButtonElement.class).get(1).click(); - headerCell = grid.getHeaderCell(1, 1); - assertEquals("Header text not changed on column reorder.", "address", - headerCell.getText().toLowerCase()); - assertEquals("Unexpected colspan", "1", - headerCell.getAttribute("colspan")); - headerCell = grid.getHeaderCell(1, 2); - assertEquals("Header text not changed on column reorder", "full name", - headerCell.getText().toLowerCase()); - assertEquals("Unexpected colspan", "2", - headerCell.getAttribute("colspan")); - - assertTrue("Error indicator not present", - isElementPresent(By.className("v-errorindicator"))); - - } -} +/*
+ * 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.tests.components.grid;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.openqa.selenium.By;
+
+import com.vaadin.testbench.elements.ButtonElement;
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.elements.GridElement.GridCellElement;
+import com.vaadin.testbench.parallel.TestCategory;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+@TestCategory("grid")
+public class GridColspansTest extends MultiBrowserTest {
+
+ @Before
+ public void setUp() {
+ setDebug(true);
+ }
+
+ @Test
+ public void testHeaderColSpans() {
+ openTestURL();
+
+ GridElement grid = $(LegacyGridElement.class).first();
+ assertEquals("5", grid.getHeaderCell(0, 1).getAttribute("colspan"));
+ assertEquals("2", grid.getHeaderCell(1, 1).getAttribute("colspan"));
+ assertEquals("3", grid.getHeaderCell(1, 3).getAttribute("colspan"));
+ }
+
+ @Test
+ public void testFooterColSpans() {
+ openTestURL();
+
+ GridElement grid = $(LegacyGridElement.class).first();
+ assertEquals("5", grid.getFooterCell(1, 1).getAttribute("colspan"));
+ assertEquals("2", grid.getFooterCell(0, 1).getAttribute("colspan"));
+ assertEquals("3", grid.getFooterCell(0, 3).getAttribute("colspan"));
+ }
+
+ @Test
+ public void testHideFirstColumnOfColspan() {
+ openTestURL();
+
+ GridElement grid = $(LegacyGridElement.class).first();
+ assertEquals("Failed initial condition.", "all the stuff",
+ grid.getHeaderCell(0, 1).getText().toLowerCase());
+ assertEquals("Failed initial condition.", "first name",
+ grid.getHeaderCell(2, 1).getText().toLowerCase());
+ $(ButtonElement.class).caption("Show/Hide firstName").first().click();
+ assertEquals("Header text changed on column hide.", "all the stuff",
+ grid.getHeaderCell(0, 1).getText().toLowerCase());
+ assertEquals("Failed initial condition.", "last name",
+ grid.getHeaderCell(2, 1).getText().toLowerCase());
+ }
+
+ @Test
+ public void testSplittingMergedHeaders() {
+ openTestURL();
+
+ GridElement grid = $(LegacyGridElement.class).first();
+ GridCellElement headerCell = grid.getHeaderCell(1, 1);
+ assertEquals("Failed initial condition.", "full name",
+ headerCell.getText().toLowerCase());
+ assertEquals("Failed initial condition.", "first name",
+ grid.getHeaderCell(2, 1).getText().toLowerCase());
+ $(ButtonElement.class).get(1).click();
+ headerCell = grid.getHeaderCell(1, 1);
+ assertEquals("Header text not changed on column reorder.", "address",
+ headerCell.getText().toLowerCase());
+ assertEquals("Unexpected colspan", "1",
+ headerCell.getAttribute("colspan"));
+ headerCell = grid.getHeaderCell(1, 2);
+ assertEquals("Header text not changed on column reorder", "full name",
+ headerCell.getText().toLowerCase());
+ assertEquals("Unexpected colspan", "2",
+ headerCell.getAttribute("colspan"));
+
+ assertTrue("Error indicator not present",
+ isElementPresent(By.className("v-errorindicator")));
+
+ }
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridColumnAutoExpandTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridColumnAutoExpandTest.java index b6e7e6f2ce..27bb664f0e 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridColumnAutoExpandTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridColumnAutoExpandTest.java @@ -1,39 +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.tests.components.grid; - -import static org.junit.Assert.assertTrue; - -import org.junit.Test; - -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.testbench.elements.GridElement.GridCellElement; -import com.vaadin.tests.tb3.MultiBrowserTest; - -public class GridColumnAutoExpandTest extends MultiBrowserTest { - - @Test - public void testSecondColumnHasExpanded() { - openTestURL(); - - GridCellElement headerCell = $(GridElement.class).first() - .getHeaderCell(0, 1); - - assertTrue("Column did not expand as expected", - headerCell.getSize().getWidth() > 400); - } - -} +/*
+ * 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.tests.components.grid;
+
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.elements.GridElement.GridCellElement;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+public class GridColumnAutoExpandTest extends MultiBrowserTest {
+
+ @Test
+ public void testSecondColumnHasExpanded() {
+ openTestURL();
+
+ GridCellElement headerCell = $(LegacyGridElement.class).first()
+ .getHeaderCell(0, 1);
+
+ assertTrue("Column did not expand as expected",
+ headerCell.getSize().getWidth() > 400);
+ }
+
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridColumnWidthRecalculationTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridColumnWidthRecalculationTest.java index aaa5dd54f9..0eb587e6b9 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridColumnWidthRecalculationTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridColumnWidthRecalculationTest.java @@ -1,82 +1,82 @@ -/* - * 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.tests.components.grid; - -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.openqa.selenium.Dimension; - -import com.vaadin.testbench.elements.ButtonElement; -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.testbench.elements.GridElement.GridCellElement; -import com.vaadin.testbench.parallel.TestCategory; -import com.vaadin.tests.tb3.SingleBrowserTest; - -@TestCategory("grid") -public class GridColumnWidthRecalculationTest extends SingleBrowserTest { - - private GridElement grid; - - @Before - public void open() { - openTestURL(); - grid = $(GridElement.class).first(); - } - - @Test - public void columnWidthAfterSwap() { - int column0Width = getColumnWidth(0); - int column1Width = getColumnWidth(1); - Assert.assertTrue("Column 0 should be narrower than column 1 initially", - column0Width < column1Width); - - $(ButtonElement.class).caption("Swap content").first().click(); - - Assert.assertEquals( - "Column 0 width should not change when swapping contents only", - column0Width, getColumnWidth(0)); - Assert.assertEquals( - "Column 1 width should not change when swapping contents only", - column1Width, getColumnWidth(1)); - } - - @Test - public void columnWidthAfterSwapAndRecalculate() { - int column0Width = getColumnWidth(0); - int column1Width = getColumnWidth(1); - Assert.assertTrue("Column 0 should be narrower than column 1 initially", - column0Width < column1Width); - - $(ButtonElement.class).caption("Swap content and recalculate columns") - .first().click(); - - column0Width = getColumnWidth(0); - column1Width = getColumnWidth(1); - - Assert.assertTrue( - "Column 1 should be narrower than column 0 after resize", - column1Width < column0Width); - } - - private int getColumnWidth(int columnIndex) { - GridCellElement headerColumn = grid.getHeaderCells(0).get(columnIndex); - Dimension column1Size = headerColumn.getSize(); - int columnWidth = column1Size.getWidth(); - return columnWidth; - } - -} +/*
+ * 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.tests.components.grid;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.openqa.selenium.Dimension;
+
+import com.vaadin.testbench.elements.ButtonElement;
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.elements.GridElement.GridCellElement;
+import com.vaadin.testbench.parallel.TestCategory;
+import com.vaadin.tests.tb3.SingleBrowserTest;
+
+@TestCategory("grid")
+public class GridColumnWidthRecalculationTest extends SingleBrowserTest {
+
+ private GridElement grid;
+
+ @Before
+ public void open() {
+ openTestURL();
+ grid = $(LegacyGridElement.class).first();
+ }
+
+ @Test
+ public void columnWidthAfterSwap() {
+ int column0Width = getColumnWidth(0);
+ int column1Width = getColumnWidth(1);
+ Assert.assertTrue("Column 0 should be narrower than column 1 initially",
+ column0Width < column1Width);
+
+ $(ButtonElement.class).caption("Swap content").first().click();
+
+ Assert.assertEquals(
+ "Column 0 width should not change when swapping contents only",
+ column0Width, getColumnWidth(0));
+ Assert.assertEquals(
+ "Column 1 width should not change when swapping contents only",
+ column1Width, getColumnWidth(1));
+ }
+
+ @Test
+ public void columnWidthAfterSwapAndRecalculate() {
+ int column0Width = getColumnWidth(0);
+ int column1Width = getColumnWidth(1);
+ Assert.assertTrue("Column 0 should be narrower than column 1 initially",
+ column0Width < column1Width);
+
+ $(ButtonElement.class).caption("Swap content and recalculate columns")
+ .first().click();
+
+ column0Width = getColumnWidth(0);
+ column1Width = getColumnWidth(1);
+
+ Assert.assertTrue(
+ "Column 1 should be narrower than column 0 after resize",
+ column1Width < column0Width);
+ }
+
+ private int getColumnWidth(int columnIndex) {
+ GridCellElement headerColumn = grid.getHeaderCells(0).get(columnIndex);
+ Dimension column1Size = headerColumn.getSize();
+ int columnWidth = column1Size.getWidth();
+ return columnWidth;
+ }
+
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridColumnWidthsWithoutDataTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridColumnWidthsWithoutDataTest.java index 160e3b3a2b..8335e0b032 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridColumnWidthsWithoutDataTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridColumnWidthsWithoutDataTest.java @@ -1,139 +1,139 @@ -/* - * 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.tests.components.grid; - -import java.util.List; - -import org.junit.Assert; -import org.junit.Test; - -import com.vaadin.testbench.elements.ButtonElement; -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.testbench.elements.GridElement.GridCellElement; -import com.vaadin.testbench.elements.NativeSelectElement; -import com.vaadin.testbench.elements.NotificationElement; -import com.vaadin.testbench.parallel.TestCategory; -import com.vaadin.tests.tb3.SingleBrowserTest; - -@TestCategory("grid") -public class GridColumnWidthsWithoutDataTest extends SingleBrowserTest { - - @Test - public void testWidthsWhenAddingDataBack() { - openTestURL(); - GridElement grid = $(GridElement.class).first(); - - int[] baseWidths = getColWidths(grid); - Assert.assertEquals("Sanity check", 2, baseWidths.length); - - Assert.assertTrue("Columns should not have equal width", - Math.abs(baseWidths[0] - baseWidths[1]) > 2); - - removeData(); - - assertSameWidths(baseWidths, getColWidths(grid)); - - addData(); - - assertSameWidths(baseWidths, getColWidths(grid)); - } - - @Test - public void testWidthsWhenInitiallyEmpty() { - setDebug(true); - openTestURL(); - $(ButtonElement.class).caption("Recreate without data").first().click(); - - GridElement grid = $(GridElement.class).first(); - - int[] baseWidths = getColWidths(grid); - Assert.assertEquals("Sanity check", 2, baseWidths.length); - - Assert.assertTrue("Columns should have roughly equal width", - Math.abs(baseWidths[0] - baseWidths[1]) < 10); - Assert.assertTrue("Columns should not have default widths", - baseWidths[0] > 140); - Assert.assertTrue("Columns should not have default widths", - baseWidths[1] > 140); - - addData(); - - assertSameWidths(baseWidths, getColWidths(grid)); - - Assert.assertFalse("Notification was present", - isElementPresent(NotificationElement.class)); - } - - @Test - public void testMultiSelectWidths() { - setDebug(true); - openTestURL(); - $(NativeSelectElement.class).caption("Selection mode").first() - .selectByText("Multi"); - - GridElement grid = $(GridElement.class).first(); - - int sum = sumUsedWidths(grid); - - // 295 instead of 300 to avoid rounding issues - Assert.assertTrue("Only " + sum + " out of 300px was used", sum > 295); - - $(ButtonElement.class).caption("Recreate without data").first().click(); - - grid = $(GridElement.class).first(); - sum = sumUsedWidths(grid); - - // 295 instead of 300 to avoid rounding issues - Assert.assertTrue("Only " + sum + " out of 300px was used", sum > 295); - } - - private int sumUsedWidths(GridElement grid) { - int sum = 0; - for (int i : getColWidths(grid)) { - sum += i; - } - return sum; - } - - private static void assertSameWidths(int[] expected, int[] actual) { - Assert.assertEquals("Arrays have differing lengths", expected.length, - actual.length); - - for (int i = 0; i < expected.length; i++) { - if (Math.abs(expected[i] - actual[i]) > 1) { - Assert.fail("Differing sizes at index " + i + ". Expected " - + expected[i] + " but got " + actual[i]); - } - } - } - - private void removeData() { - $(ButtonElement.class).caption("Remove data").first().click(); - } - - private void addData() { - $(ButtonElement.class).caption("Add data").first().click(); - } - - private int[] getColWidths(GridElement grid) { - List<GridCellElement> headerCells = grid.getHeaderCells(0); - int[] widths = new int[headerCells.size()]; - for (int i = 0; i < widths.length; i++) { - widths[i] = headerCells.get(i).getSize().getWidth(); - } - return widths; - } -} +/*
+ * 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.tests.components.grid;
+
+import java.util.List;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import com.vaadin.testbench.elements.ButtonElement;
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.elements.GridElement.GridCellElement;
+import com.vaadin.testbench.elements.NativeSelectElement;
+import com.vaadin.testbench.elements.NotificationElement;
+import com.vaadin.testbench.parallel.TestCategory;
+import com.vaadin.tests.tb3.SingleBrowserTest;
+
+@TestCategory("grid")
+public class GridColumnWidthsWithoutDataTest extends SingleBrowserTest {
+
+ @Test
+ public void testWidthsWhenAddingDataBack() {
+ openTestURL();
+ GridElement grid = $(LegacyGridElement.class).first();
+
+ int[] baseWidths = getColWidths(grid);
+ Assert.assertEquals("Sanity check", 2, baseWidths.length);
+
+ Assert.assertTrue("Columns should not have equal width",
+ Math.abs(baseWidths[0] - baseWidths[1]) > 2);
+
+ removeData();
+
+ assertSameWidths(baseWidths, getColWidths(grid));
+
+ addData();
+
+ assertSameWidths(baseWidths, getColWidths(grid));
+ }
+
+ @Test
+ public void testWidthsWhenInitiallyEmpty() {
+ setDebug(true);
+ openTestURL();
+ $(ButtonElement.class).caption("Recreate without data").first().click();
+
+ GridElement grid = $(LegacyGridElement.class).first();
+
+ int[] baseWidths = getColWidths(grid);
+ Assert.assertEquals("Sanity check", 2, baseWidths.length);
+
+ Assert.assertTrue("Columns should have roughly equal width",
+ Math.abs(baseWidths[0] - baseWidths[1]) < 10);
+ Assert.assertTrue("Columns should not have default widths",
+ baseWidths[0] > 140);
+ Assert.assertTrue("Columns should not have default widths",
+ baseWidths[1] > 140);
+
+ addData();
+
+ assertSameWidths(baseWidths, getColWidths(grid));
+
+ Assert.assertFalse("Notification was present",
+ isElementPresent(NotificationElement.class));
+ }
+
+ @Test
+ public void testMultiSelectWidths() {
+ setDebug(true);
+ openTestURL();
+ $(NativeSelectElement.class).caption("Selection mode").first()
+ .selectByText("Multi");
+
+ GridElement grid = $(LegacyGridElement.class).first();
+
+ int sum = sumUsedWidths(grid);
+
+ // 295 instead of 300 to avoid rounding issues
+ Assert.assertTrue("Only " + sum + " out of 300px was used", sum > 295);
+
+ $(ButtonElement.class).caption("Recreate without data").first().click();
+
+ grid = $(LegacyGridElement.class).first();
+ sum = sumUsedWidths(grid);
+
+ // 295 instead of 300 to avoid rounding issues
+ Assert.assertTrue("Only " + sum + " out of 300px was used", sum > 295);
+ }
+
+ private int sumUsedWidths(GridElement grid) {
+ int sum = 0;
+ for (int i : getColWidths(grid)) {
+ sum += i;
+ }
+ return sum;
+ }
+
+ private static void assertSameWidths(int[] expected, int[] actual) {
+ Assert.assertEquals("Arrays have differing lengths", expected.length,
+ actual.length);
+
+ for (int i = 0; i < expected.length; i++) {
+ if (Math.abs(expected[i] - actual[i]) > 1) {
+ Assert.fail("Differing sizes at index " + i + ". Expected "
+ + expected[i] + " but got " + actual[i]);
+ }
+ }
+ }
+
+ private void removeData() {
+ $(ButtonElement.class).caption("Remove data").first().click();
+ }
+
+ private void addData() {
+ $(ButtonElement.class).caption("Add data").first().click();
+ }
+
+ private int[] getColWidths(GridElement grid) {
+ List<GridCellElement> headerCells = grid.getHeaderCells(0);
+ int[] widths = new int[headerCells.size()];
+ for (int i = 0; i < widths.length; i++) {
+ widths[i] = headerCells.get(i).getSize().getWidth();
+ }
+ return widths;
+ }
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridCustomSelectionModelTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridCustomSelectionModelTest.java index 7884a27aab..08d1c7202d 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridCustomSelectionModelTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridCustomSelectionModelTest.java @@ -35,7 +35,7 @@ public class GridCustomSelectionModelTest extends MultiBrowserTest { setDebug(true); openTestURL(); - GridElement grid = $(GridElement.class).first(); + GridElement grid = $(LegacyGridElement.class).first(); GridCellElement cell = grid.getCell(0, 0); assertTrue("First column of Grid should not have an input element", cell.findElements(By.className("input")).isEmpty()); diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridDataSourceResetTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridDataSourceResetTest.java index ca996f52f2..7b4213feec 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridDataSourceResetTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridDataSourceResetTest.java @@ -1,50 +1,50 @@ -/* - * 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.tests.components.grid; - -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - -import org.junit.Test; - -import com.vaadin.testbench.elements.ButtonElement; -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.tests.tb3.SingleBrowserTest; - -public class GridDataSourceResetTest extends SingleBrowserTest { - - @Test - public void testRemoveWithSelectUpdatesRowsCorrectly() { - openTestURL(); - - GridElement grid = $(GridElement.class).first(); - - assertTrue("First row was not selected", grid.getRow(0).isSelected()); - for (int i = 1; i < 10; ++i) { - assertFalse("Only first row should be selected", - grid.getRow(i).isSelected()); - } - - $(ButtonElement.class).first().click(); - - assertTrue("First row was not selected after remove", - grid.getRow(0).isSelected()); - for (int i = 1; i < 9; ++i) { - assertFalse("Only first row should be selected after remove", - grid.getRow(i).isSelected()); - } - } -} +/*
+ * 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.tests.components.grid;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
+import com.vaadin.testbench.elements.ButtonElement;
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.tests.tb3.SingleBrowserTest;
+
+public class GridDataSourceResetTest extends SingleBrowserTest {
+
+ @Test
+ public void testRemoveWithSelectUpdatesRowsCorrectly() {
+ openTestURL();
+
+ GridElement grid = $(LegacyGridElement.class).first();
+
+ assertTrue("First row was not selected", grid.getRow(0).isSelected());
+ for (int i = 1; i < 10; ++i) {
+ assertFalse("Only first row should be selected",
+ grid.getRow(i).isSelected());
+ }
+
+ $(ButtonElement.class).first().click();
+
+ assertTrue("First row was not selected after remove",
+ grid.getRow(0).isSelected());
+ for (int i = 1; i < 9; ++i) {
+ assertFalse("Only first row should be selected after remove",
+ grid.getRow(i).isSelected());
+ }
+ }
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridDefaultSelectionModeTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridDefaultSelectionModeTest.java index c5b651b90f..9f3ef7889d 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridDefaultSelectionModeTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridDefaultSelectionModeTest.java @@ -1,84 +1,84 @@ -/* - * 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.tests.components.grid; - -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - -import org.junit.Test; - -import com.vaadin.testbench.elements.ButtonElement; -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.testbench.elements.GridElement.GridCellElement; -import com.vaadin.tests.tb3.MultiBrowserTest; - -public class GridDefaultSelectionModeTest extends MultiBrowserTest { - - @Test - public void testSelectionFromServer() { - setDebug(true); - openTestURL(); - - $(ButtonElement.class).caption("Select on server").first().click(); - - assertTrue("Row should be selected.", - $(GridElement.class).first().getRow(0).isSelected()); - - $(ButtonElement.class).caption("Deselect on server").first().click(); - - assertFalse("Row should not be selected.", - $(GridElement.class).first().getRow(0).isSelected()); - - assertNoErrorNotifications(); - } - - @Test - public void testSelectionWithSort() { - setDebug(true); - openTestURL(); - - GridElement grid = $(GridElement.class).first(); - grid.getCell(0, 0).click(); - - GridCellElement header = grid.getHeaderCell(0, 1); - header.click(); - header.click(); - - assertTrue("Row should be selected.", grid.getRow(1).isSelected()); - - assertNoErrorNotifications(); - } - - @Test - public void testReselectDeselectedRow() { - setDebug(true); - openTestURL(); - - $(ButtonElement.class).caption("Select on server").first().click(); - - GridElement grid = $(GridElement.class).first(); - assertTrue("Row should be selected.", grid.getRow(0).isSelected()); - - $(ButtonElement.class).caption("Deselect on server").first().click(); - - assertFalse("Row should not be selected.", grid.getRow(0).isSelected()); - - grid.getCell(0, 0).click(); - assertTrue("Row should be selected.", grid.getRow(0).isSelected()); - - assertNoErrorNotifications(); - } -} +/*
+ * 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.tests.components.grid;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
+import com.vaadin.testbench.elements.ButtonElement;
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.elements.GridElement.GridCellElement;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+public class GridDefaultSelectionModeTest extends MultiBrowserTest {
+
+ @Test
+ public void testSelectionFromServer() {
+ setDebug(true);
+ openTestURL();
+
+ $(ButtonElement.class).caption("Select on server").first().click();
+
+ assertTrue("Row should be selected.",
+ $(LegacyGridElement.class).first().getRow(0).isSelected());
+
+ $(ButtonElement.class).caption("Deselect on server").first().click();
+
+ assertFalse("Row should not be selected.",
+ $(LegacyGridElement.class).first().getRow(0).isSelected());
+
+ assertNoErrorNotifications();
+ }
+
+ @Test
+ public void testSelectionWithSort() {
+ setDebug(true);
+ openTestURL();
+
+ GridElement grid = $(LegacyGridElement.class).first();
+ grid.getCell(0, 0).click();
+
+ GridCellElement header = grid.getHeaderCell(0, 1);
+ header.click();
+ header.click();
+
+ assertTrue("Row should be selected.", grid.getRow(1).isSelected());
+
+ assertNoErrorNotifications();
+ }
+
+ @Test
+ public void testReselectDeselectedRow() {
+ setDebug(true);
+ openTestURL();
+
+ $(ButtonElement.class).caption("Select on server").first().click();
+
+ GridElement grid = $(LegacyGridElement.class).first();
+ assertTrue("Row should be selected.", grid.getRow(0).isSelected());
+
+ $(ButtonElement.class).caption("Deselect on server").first().click();
+
+ assertFalse("Row should not be selected.", grid.getRow(0).isSelected());
+
+ grid.getCell(0, 0).click();
+ assertTrue("Row should be selected.", grid.getRow(0).isSelected());
+
+ assertNoErrorNotifications();
+ }
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridDetailsDetachTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridDetailsDetachTest.java index 52b1c009b3..d63180a9f5 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridDetailsDetachTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridDetailsDetachTest.java @@ -35,8 +35,8 @@ public class GridDetailsDetachTest extends MultiBrowserTest { setDebug(true); openTestURL(); - $(GridElement.class).first().getCell(3, 0).click(); - $(GridElement.class).first().getCell(5, 0).click(); + $(LegacyGridElement.class).first().getCell(3, 0).click(); + $(LegacyGridElement.class).first().getCell(5, 0).click(); assertNoErrorNotifications(); @@ -50,8 +50,8 @@ public class GridDetailsDetachTest extends MultiBrowserTest { setDebug(true); openTestURL(); - $(GridElement.class).first().getCell(3, 0).click(); - $(GridElement.class).first().getCell(5, 0).click(); + $(LegacyGridElement.class).first().getCell(3, 0).click(); + $(LegacyGridElement.class).first().getCell(5, 0).click(); assertNoErrorNotifications(); @@ -76,8 +76,8 @@ public class GridDetailsDetachTest extends MultiBrowserTest { setDebug(true); openTestURL(); - $(GridElement.class).first().getCell(3, 0).click(); - $(GridElement.class).first().getCell(5, 0).click(); + $(LegacyGridElement.class).first().getCell(3, 0).click(); + $(LegacyGridElement.class).first().getCell(5, 0).click(); assertNoErrorNotifications(); diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridDetailsLayoutExpandTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridDetailsLayoutExpandTest.java index 611a2fc78e..3288be1aa3 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridDetailsLayoutExpandTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridDetailsLayoutExpandTest.java @@ -56,7 +56,7 @@ public class GridDetailsLayoutExpandTest extends MultiBrowserTest { openTestURL(); waitForElementPresent(By.className("v-grid")); - GridElement grid = $(GridElement.class).first(); + GridElement grid = $(LegacyGridElement.class).first(); int gridWidth = grid.getSize().width; grid.getRow(2).click(); diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridDetailsWidthTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridDetailsWidthTest.java index bd6045656f..c2dde9114a 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridDetailsWidthTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridDetailsWidthTest.java @@ -33,7 +33,7 @@ public class GridDetailsWidthTest extends SingleBrowserTest { @Test public void testSpacerTDsHaveNoWidth() { openTestURL(); - GridElement grid = $(GridElement.class).first(); + GridElement grid = $(LegacyGridElement.class).first(); // Open all details rows grid.getCell(0, 0).click(); @@ -70,7 +70,7 @@ public class GridDetailsWidthTest extends SingleBrowserTest { @Test public void testDetailsOnSort() { openTestURL(); - GridElement grid = $(GridElement.class).first(); + GridElement grid = $(LegacyGridElement.class).first(); // Open a details rows grid.getCell(0, 0).click(); diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridDragSelectionWhileScrolledTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridDragSelectionWhileScrolledTest.java index 31d97fcb3c..7460917d00 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridDragSelectionWhileScrolledTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridDragSelectionWhileScrolledTest.java @@ -1,61 +1,61 @@ -/* - * 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.tests.components.grid; - -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - -import java.io.IOException; - -import org.junit.Test; -import org.openqa.selenium.JavascriptExecutor; -import org.openqa.selenium.interactions.Actions; - -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.testbench.parallel.TestCategory; -import com.vaadin.tests.tb3.MultiBrowserTest; - -@TestCategory("grid") -public class GridDragSelectionWhileScrolledTest extends MultiBrowserTest { - - @Override - protected boolean requireWindowFocusForIE() { - return true; - } - - @Test - public void testDragSelect() throws IOException { - openTestURL(); - - // Scroll grid to view - GridElement grid = $(GridElement.class).first(); - ((JavascriptExecutor) getDriver()) - .executeScript("arguments[0].scrollIntoView(true);", grid); - - // Drag select 2 rows - new Actions(getDriver()).moveToElement(grid.getCell(3, 0), 5, 5) - .clickAndHold().moveToElement(grid.getCell(2, 0), 5, 5) - .release().perform(); - - // Assert only those are selected. - assertTrue("Row 3 should be selected", grid.getRow(3).isSelected()); - assertTrue("Row 2 should be selected", grid.getRow(2).isSelected()); - assertFalse("Row 4 should not be selected", - grid.getRow(4).isSelected()); - assertFalse("Row 1 should not be selected", - grid.getRow(1).isSelected()); - } -} +/*
+ * 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.tests.components.grid;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+
+import org.junit.Test;
+import org.openqa.selenium.JavascriptExecutor;
+import org.openqa.selenium.interactions.Actions;
+
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.parallel.TestCategory;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+@TestCategory("grid")
+public class GridDragSelectionWhileScrolledTest extends MultiBrowserTest {
+
+ @Override
+ protected boolean requireWindowFocusForIE() {
+ return true;
+ }
+
+ @Test
+ public void testDragSelect() throws IOException {
+ openTestURL();
+
+ // Scroll grid to view
+ GridElement grid = $(LegacyGridElement.class).first();
+ ((JavascriptExecutor) getDriver())
+ .executeScript("arguments[0].scrollIntoView(true);", grid);
+
+ // Drag select 2 rows
+ new Actions(getDriver()).moveToElement(grid.getCell(3, 0), 5, 5)
+ .clickAndHold().moveToElement(grid.getCell(2, 0), 5, 5)
+ .release().perform();
+
+ // Assert only those are selected.
+ assertTrue("Row 3 should be selected", grid.getRow(3).isSelected());
+ assertTrue("Row 2 should be selected", grid.getRow(2).isSelected());
+ assertFalse("Row 4 should not be selected",
+ grid.getRow(4).isSelected());
+ assertFalse("Row 1 should not be selected",
+ grid.getRow(1).isSelected());
+ }
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridEditingWithNoScrollBarsTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridEditingWithNoScrollBarsTest.java index 833dd72588..21291dc26c 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridEditingWithNoScrollBarsTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridEditingWithNoScrollBarsTest.java @@ -1,38 +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.tests.components.grid; - -import static org.junit.Assert.assertEquals; - -import org.junit.Test; - -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.testbench.parallel.TestCategory; -import com.vaadin.tests.tb3.MultiBrowserTest; - -@TestCategory("grid") -public class GridEditingWithNoScrollBarsTest extends MultiBrowserTest { - - @Test - public void testEditorWideEnough() { - openTestURL(); - - GridElement grid = $(GridElement.class).first(); - grid.getCell(1, 1).doubleClick(); - assertEquals(grid.getEditor().getSize().width, - grid.getTableWrapper().getSize().width); - } -} +/*
+ * 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.tests.components.grid;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.parallel.TestCategory;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+@TestCategory("grid")
+public class GridEditingWithNoScrollBarsTest extends MultiBrowserTest {
+
+ @Test
+ public void testEditorWideEnough() {
+ openTestURL();
+
+ GridElement grid = $(LegacyGridElement.class).first();
+ grid.getCell(1, 1).doubleClick();
+ assertEquals(grid.getEditor().getSize().width,
+ grid.getTableWrapper().getSize().width);
+ }
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridEditorConverterNotFoundTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridEditorConverterNotFoundTest.java index 9021430576..c39ef2e18f 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridEditorConverterNotFoundTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridEditorConverterNotFoundTest.java @@ -1,42 +1,42 @@ -/* - * 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.tests.components.grid; - -import static org.junit.Assert.assertEquals; - -import org.junit.Test; - -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.tests.components.grid.basicfeatures.GridBasicFeaturesTest; - -public class GridEditorConverterNotFoundTest extends GridBasicFeaturesTest { - - @Override - protected Class<?> getUIClass() { - // Use the correct UI with helpers from GridBasicFeatures - return GridEditorConverterNotFound.class; - } - - @Test - public void testConverterNotFound() { - openTestURL(); - - $(GridElement.class).first().getCell(0, 0).doubleClick(); - - assertEquals("1. com.vaadin.data.Buffered$SourceException", - getLogRow(0)); - } -} +/*
+ * 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.tests.components.grid;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.tests.components.grid.basicfeatures.GridBasicFeaturesTest;
+
+public class GridEditorConverterNotFoundTest extends GridBasicFeaturesTest {
+
+ @Override
+ protected Class<?> getUIClass() {
+ // Use the correct UI with helpers from GridBasicFeatures
+ return GridEditorConverterNotFound.class;
+ }
+
+ @Test
+ public void testConverterNotFound() {
+ openTestURL();
+
+ $(LegacyGridElement.class).first().getCell(0, 0).doubleClick();
+
+ assertEquals("1. com.vaadin.data.Buffered$SourceException",
+ getLogRow(0));
+ }
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridEditorCustomFieldTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridEditorCustomFieldTest.java index 375e4f5c48..2e51de0fe6 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridEditorCustomFieldTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridEditorCustomFieldTest.java @@ -1,46 +1,46 @@ -/* - * 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.tests.components.grid; - -import org.junit.Assert; -import org.junit.Test; - -import com.vaadin.testbench.TestBenchElement; -import com.vaadin.testbench.elements.ComboBoxElement; -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.testbench.elements.GridElement.GridEditorElement; -import com.vaadin.testbench.parallel.TestCategory; -import com.vaadin.tests.tb3.MultiBrowserTest; - -@TestCategory("grid") -public class GridEditorCustomFieldTest extends MultiBrowserTest { - - @Test - public void testCustomFieldWorksInEditorRow() { - openTestURL(); - GridElement grid = $(GridElement.class).first(); - Assert.assertEquals("Stockholm", grid.getCell(0, 2).getText()); - grid.getCell(0, 1).doubleClick(); - GridEditorElement editor = grid.getEditor(); - TestBenchElement customField = editor.getField(2); - - ComboBoxElement comboBox = customField.$(ComboBoxElement.class).first(); - comboBox.selectByText("Oslo"); - editor.save(); - Assert.assertEquals("Oslo", grid.getCell(0, 2).getText()); - - } -} +/*
+ * 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.tests.components.grid;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import com.vaadin.testbench.TestBenchElement;
+import com.vaadin.testbench.elements.ComboBoxElement;
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.elements.GridElement.GridEditorElement;
+import com.vaadin.testbench.parallel.TestCategory;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+@TestCategory("grid")
+public class GridEditorCustomFieldTest extends MultiBrowserTest {
+
+ @Test
+ public void testCustomFieldWorksInEditorRow() {
+ openTestURL();
+ GridElement grid = $(LegacyGridElement.class).first();
+ Assert.assertEquals("Stockholm", grid.getCell(0, 2).getText());
+ grid.getCell(0, 1).doubleClick();
+ GridEditorElement editor = grid.getEditor();
+ TestBenchElement customField = editor.getField(2);
+
+ ComboBoxElement comboBox = customField.$(ComboBoxElement.class).first();
+ comboBox.selectByText("Oslo");
+ editor.save();
+ Assert.assertEquals("Oslo", grid.getCell(0, 2).getText());
+
+ }
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridEditorFrozenColumnsUITest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridEditorFrozenColumnsUITest.java index 9d5d283722..153dad12de 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridEditorFrozenColumnsUITest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridEditorFrozenColumnsUITest.java @@ -1,77 +1,77 @@ -/* - * 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.tests.components.grid; - -import java.io.IOException; - -import org.junit.Test; -import org.openqa.selenium.By; -import org.openqa.selenium.JavascriptExecutor; -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.interactions.Actions; - -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.testbench.elements.GridElement.GridCellElement; -import com.vaadin.testbench.parallel.TestCategory; -import com.vaadin.tests.tb3.MultiBrowserTest; - -@TestCategory("grid") -public class GridEditorFrozenColumnsUITest extends MultiBrowserTest { - - @Test - public void testEditorWithFrozenColumns() throws IOException { - openTestURL(); - - openEditor(10); - - compareScreen("noscroll"); - - scrollGridHorizontallyTo(100); - - compareScreen("scrolled"); - } - - private void openEditor(int rowIndex) { - GridElement grid = $(GridElement.class).first(); - - GridCellElement cell = grid.getCell(rowIndex, 1); - - new Actions(driver).moveToElement(cell).doubleClick().build().perform(); - } - - private void scrollGridHorizontallyTo(double px) { - executeScript("arguments[0].scrollLeft = " + px, - getGridHorizontalScrollbar()); - } - - private Object executeScript(String script, WebElement element) { - final WebDriver driver = getDriver(); - if (driver instanceof JavascriptExecutor) { - final JavascriptExecutor je = (JavascriptExecutor) driver; - return je.executeScript(script, element); - } else { - throw new IllegalStateException("current driver " - + getDriver().getClass().getName() + " is not a " - + JavascriptExecutor.class.getSimpleName()); - } - } - - private WebElement getGridHorizontalScrollbar() { - return getDriver().findElement(By.xpath( - "//div[contains(@class, \"v-grid-scroller-horizontal\")]")); - } -} +/*
+ * 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.tests.components.grid;
+
+import java.io.IOException;
+
+import org.junit.Test;
+import org.openqa.selenium.By;
+import org.openqa.selenium.JavascriptExecutor;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.interactions.Actions;
+
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.elements.GridElement.GridCellElement;
+import com.vaadin.testbench.parallel.TestCategory;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+@TestCategory("grid")
+public class GridEditorFrozenColumnsUITest extends MultiBrowserTest {
+
+ @Test
+ public void testEditorWithFrozenColumns() throws IOException {
+ openTestURL();
+
+ openEditor(10);
+
+ compareScreen("noscroll");
+
+ scrollGridHorizontallyTo(100);
+
+ compareScreen("scrolled");
+ }
+
+ private void openEditor(int rowIndex) {
+ GridElement grid = $(LegacyGridElement.class).first();
+
+ GridCellElement cell = grid.getCell(rowIndex, 1);
+
+ new Actions(driver).moveToElement(cell).doubleClick().build().perform();
+ }
+
+ private void scrollGridHorizontallyTo(double px) {
+ executeScript("arguments[0].scrollLeft = " + px,
+ getGridHorizontalScrollbar());
+ }
+
+ private Object executeScript(String script, WebElement element) {
+ final WebDriver driver = getDriver();
+ if (driver instanceof JavascriptExecutor) {
+ final JavascriptExecutor je = (JavascriptExecutor) driver;
+ return je.executeScript(script, element);
+ } else {
+ throw new IllegalStateException("current driver "
+ + getDriver().getClass().getName() + " is not a "
+ + JavascriptExecutor.class.getSimpleName());
+ }
+ }
+
+ private WebElement getGridHorizontalScrollbar() {
+ return getDriver().findElement(By.xpath(
+ "//div[contains(@class, \"v-grid-scroller-horizontal\")]"));
+ }
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridEditorMultiselectTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridEditorMultiselectTest.java index a2175ca37f..a4483770e2 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridEditorMultiselectTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridEditorMultiselectTest.java @@ -38,7 +38,7 @@ public class GridEditorMultiselectTest extends MultiBrowserTest { } private GridElement openEditor() { - GridElement grid = $(GridElement.class).first(); + GridElement grid = $(LegacyGridElement.class).first(); grid.getRow(0).doubleClick(); Assert.assertTrue("Grid editor should be displayed.", grid.getEditor().isDisplayed()); diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridEditorUITest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridEditorUITest.java index 0b213ec972..3bd92a3626 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridEditorUITest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridEditorUITest.java @@ -1,96 +1,96 @@ -/* - * 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.tests.components.grid; - -import static org.hamcrest.CoreMatchers.containsString; -import static org.hamcrest.CoreMatchers.not; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - -import org.junit.Test; -import org.openqa.selenium.Keys; -import org.openqa.selenium.interactions.Actions; - -import com.vaadin.testbench.By; -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.testbench.elements.GridElement.GridCellElement; -import com.vaadin.testbench.elements.NotificationElement; -import com.vaadin.testbench.elements.PasswordFieldElement; -import com.vaadin.testbench.parallel.TestCategory; -import com.vaadin.tests.tb3.MultiBrowserTest; - -@TestCategory("grid") -public class GridEditorUITest extends MultiBrowserTest { - - @Override - public void setup() throws Exception { - super.setup(); - - setDebug(true); - openTestURL(); - } - - private void openEditor(int rowIndex) { - GridElement grid = $(GridElement.class).first(); - - GridCellElement cell = grid.getCell(rowIndex, 1); - - new Actions(driver).moveToElement(cell).doubleClick().build().perform(); - } - - private void saveEditor() { - findElement(By.cssSelector(".v-grid-editor-save")).click(); - } - - private GridCellElement getHeaderCell(int rowIndex, int colIndex) { - GridElement grid = $(GridElement.class).first(); - - GridCellElement headerCell = grid.getHeaderCell(rowIndex, colIndex); - - return headerCell; - } - - @Test - public void testEditor() { - assertFalse("Sanity check", - isElementPresent(PasswordFieldElement.class)); - - openEditor(5); - new Actions(getDriver()).sendKeys(Keys.ESCAPE).perform(); - - openEditor(10); - - assertTrue("Editor should be opened with a password field", - isElementPresent(PasswordFieldElement.class)); - - assertFalse("Notification was present", - isElementPresent(NotificationElement.class)); - } - - @Test - public void savingResetsSortingIndicator() { - GridCellElement headerCell = getHeaderCell(0, 0); - headerCell.click(); - - openEditor(1); - - saveEditor(); - - assertThat(headerCell.getAttribute("class"), - not(containsString("sort-"))); - } -} +/*
+ * 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.tests.components.grid;
+
+import static org.hamcrest.CoreMatchers.containsString;
+import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+import org.openqa.selenium.Keys;
+import org.openqa.selenium.interactions.Actions;
+
+import com.vaadin.testbench.By;
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.elements.GridElement.GridCellElement;
+import com.vaadin.testbench.elements.NotificationElement;
+import com.vaadin.testbench.elements.PasswordFieldElement;
+import com.vaadin.testbench.parallel.TestCategory;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+@TestCategory("grid")
+public class GridEditorUITest extends MultiBrowserTest {
+
+ @Override
+ public void setup() throws Exception {
+ super.setup();
+
+ setDebug(true);
+ openTestURL();
+ }
+
+ private void openEditor(int rowIndex) {
+ GridElement grid = $(LegacyGridElement.class).first();
+
+ GridCellElement cell = grid.getCell(rowIndex, 1);
+
+ new Actions(driver).moveToElement(cell).doubleClick().build().perform();
+ }
+
+ private void saveEditor() {
+ findElement(By.cssSelector(".v-grid-editor-save")).click();
+ }
+
+ private GridCellElement getHeaderCell(int rowIndex, int colIndex) {
+ GridElement grid = $(LegacyGridElement.class).first();
+
+ GridCellElement headerCell = grid.getHeaderCell(rowIndex, colIndex);
+
+ return headerCell;
+ }
+
+ @Test
+ public void testEditor() {
+ assertFalse("Sanity check",
+ isElementPresent(PasswordFieldElement.class));
+
+ openEditor(5);
+ new Actions(getDriver()).sendKeys(Keys.ESCAPE).perform();
+
+ openEditor(10);
+
+ assertTrue("Editor should be opened with a password field",
+ isElementPresent(PasswordFieldElement.class));
+
+ assertFalse("Notification was present",
+ isElementPresent(NotificationElement.class));
+ }
+
+ @Test
+ public void savingResetsSortingIndicator() {
+ GridCellElement headerCell = getHeaderCell(0, 0);
+ headerCell.click();
+
+ openEditor(1);
+
+ saveEditor();
+
+ assertThat(headerCell.getAttribute("class"),
+ not(containsString("sort-")));
+ }
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridExtensionCommunicationTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridExtensionCommunicationTest.java index cbbdd0a3b7..27216543ee 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridExtensionCommunicationTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridExtensionCommunicationTest.java @@ -1,47 +1,47 @@ -/* - * 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.tests.components.grid; - -import static org.junit.Assert.assertEquals; - -import org.junit.Test; - -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.testbench.elements.GridElement.GridCellElement; -import com.vaadin.testbench.parallel.TestCategory; -import com.vaadin.tests.tb3.SingleBrowserTest; - -@TestCategory("grid") -public class GridExtensionCommunicationTest extends SingleBrowserTest { - - @Test - public void testMouseClickIsSentToExtension() { - openTestURL(); - - GridCellElement cell = $(GridElement.class).first().getCell(0, 4); - cell.click(5, 5); - - int expectedX = cell.getLocation().getX() + 5; - int expectedY = cell.getLocation().getY() + 5; - - assertEquals( - "1. Click on Person Nina Brown on column Column[propertyId:gender]", - getLogRow(1)); - assertEquals("2. MouseEventDetails: left (" + expectedX + ", " - + expectedY + ")", getLogRow(0)); - - } -} +/*
+ * 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.tests.components.grid;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.elements.GridElement.GridCellElement;
+import com.vaadin.testbench.parallel.TestCategory;
+import com.vaadin.tests.tb3.SingleBrowserTest;
+
+@TestCategory("grid")
+public class GridExtensionCommunicationTest extends SingleBrowserTest {
+
+ @Test
+ public void testMouseClickIsSentToExtension() {
+ openTestURL();
+
+ GridCellElement cell = $(LegacyGridElement.class).first().getCell(0, 4);
+ cell.click(5, 5);
+
+ int expectedX = cell.getLocation().getX() + 5;
+ int expectedY = cell.getLocation().getY() + 5;
+
+ assertEquals(
+ "1. Click on Person Nina Brown on column Column[propertyId:gender]",
+ getLogRow(1));
+ assertEquals("2. MouseEventDetails: left (" + expectedX + ", "
+ + expectedY + ")", getLogRow(0));
+
+ }
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridGeneratedPropertiesTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridGeneratedPropertiesTest.java index df89f217f3..2c93a4e280 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridGeneratedPropertiesTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridGeneratedPropertiesTest.java @@ -33,7 +33,7 @@ public class GridGeneratedPropertiesTest extends MultiBrowserTest { @Test public void testMilesColumnExists() { openTestURL(); - GridElement grid = $(GridElement.class).first(); + GridElement grid = $(LegacyGridElement.class).first(); assertEquals("Miles header wasn't present.", "miles", grid.getHeaderCell(0, 2).getText().toLowerCase()); } @@ -41,7 +41,7 @@ public class GridGeneratedPropertiesTest extends MultiBrowserTest { @Test public void testUnsortableGeneratedProperty() { openTestURL(); - GridElement grid = $(GridElement.class).first(); + GridElement grid = $(LegacyGridElement.class).first(); // Overwritten foo property should not be sortable GridCellElement fooHeader = grid.getHeaderCell(0, 0); @@ -59,7 +59,7 @@ public class GridGeneratedPropertiesTest extends MultiBrowserTest { @Test public void testSortableGeneratedProperty() { openTestURL(); - GridElement grid = $(GridElement.class).first(); + GridElement grid = $(LegacyGridElement.class).first(); // Generated property baz is sortable GridCellElement bazHeader = grid.getHeaderCell(0, 3); @@ -78,7 +78,7 @@ public class GridGeneratedPropertiesTest extends MultiBrowserTest { setDebug(true); openTestURL(); - GridElement grid = $(GridElement.class).first(); + GridElement grid = $(LegacyGridElement.class).first(); GridCellElement kmHeader = grid.getHeaderCell(0, 1); assertFalse("Column km was unexpectedly sorted", diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridHeaderFooterComponentsTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridHeaderFooterComponentsTest.java index 8ca97c6703..3a51fdedb3 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridHeaderFooterComponentsTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridHeaderFooterComponentsTest.java @@ -1,140 +1,140 @@ -/* - * 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.tests.components.grid; - -import static org.junit.Assert.assertFalse; - -import java.util.List; - -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - -import com.vaadin.testbench.By; -import com.vaadin.testbench.elements.ButtonElement; -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.testbench.elements.GridElement.GridCellElement; -import com.vaadin.testbench.elements.TextFieldElement; -import com.vaadin.tests.tb3.SingleBrowserTest; - -public class GridHeaderFooterComponentsTest extends SingleBrowserTest { - - @Before - public void setUp() { - setDebug(true); - - openTestURL(); - } - - @Test - public void hideAndShowComponentsInHeader() { - GridElement grid = $(GridElement.class).first(); - - int filterRow = 2; - Assert.assertNull(getHeaderElement(grid, filterRow, 1)); - Assert.assertNotNull(getHeaderElement(grid, filterRow, 2)); - Assert.assertNotNull(getHeaderElement(grid, filterRow, 3)); - - // Show (1,2) - grid.getHeaderCell(1, 1).$(ButtonElement.class).first().click(); - - TextFieldElement textfield = getHeaderElement(grid, filterRow, 1); - Assert.assertNotNull(textfield); - Assert.assertEquals("Filter: string", textfield.getValue()); - - textfield.setValue("foo"); - Assert.assertEquals("1. value change for field in string to foo", - getLogRow(0)); - - assertNoErrorNotifications(); - } - - private TextFieldElement getHeaderElement(GridElement grid, int row, - int col) { - GridCellElement cell = grid.getHeaderCell(row, col); - List<TextFieldElement> all = cell.$(TextFieldElement.class).all(); - if (all.size() == 0) { - return null; - } else if (all.size() == 1) { - return all.get(0); - } else { - throw new RuntimeException( - "Multiple elements found in the header cell at " + row + "," - + col); - } - } - - @Test - public void hideAndShowComponentsInFooter() { - GridElement grid = $(GridElement.class).first(); - - int filterRow = 0; - Assert.assertNull(getFooterElement(grid, filterRow, 1)); - Assert.assertNotNull(getFooterElement(grid, filterRow, 2)); - Assert.assertNotNull(getFooterElement(grid, filterRow, 3)); - - // Show (1,2) - grid.getFooterCell(1, 1).$(ButtonElement.class).first().click(); - - TextFieldElement textfield = getFooterElement(grid, filterRow, 1); - Assert.assertNotNull(textfield); - Assert.assertEquals("Filter: string", textfield.getValue()); - - textfield.setValue("foo"); - Assert.assertEquals("1. value change for field in string to foo", - getLogRow(0)); - - assertNoErrorNotifications(); - } - - private TextFieldElement getFooterElement(GridElement grid, int row, - int col) { - GridCellElement cell = grid.getFooterCell(row, col); - List<TextFieldElement> all = cell.$(TextFieldElement.class).all(); - if (all.size() == 0) { - return null; - } else if (all.size() == 1) { - return all.get(0); - } else { - throw new RuntimeException( - "Multiple elements found in the footer cell at " + row + "," - + col); - } - } - - @Test - public void testRemoveAllHeadersAndFooters() { - openTestURL(); - - for (int i = 2; i >= 0; --i) { - // Remove Header - $(GridElement.class).first().getHeaderCell(i, 0) - .$(ButtonElement.class).first().click(); - assertFalse("Header " + i + " should not be present.", - $(GridElement.class).first() - .isElementPresent(By.vaadin("#header[" + i + "]"))); - - // Remove Footer - $(GridElement.class).first().getFooterCell(i, 0) - .$(ButtonElement.class).first().click(); - assertFalse("Footer " + i + " should not be present.", - $(GridElement.class).first() - .isElementPresent(By.vaadin("#footer[" + i + "]"))); - } - - assertNoErrorNotifications(); - } -} +/*
+ * 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.tests.components.grid;
+
+import static org.junit.Assert.assertFalse;
+
+import java.util.List;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import com.vaadin.testbench.By;
+import com.vaadin.testbench.elements.ButtonElement;
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.elements.GridElement.GridCellElement;
+import com.vaadin.testbench.elements.TextFieldElement;
+import com.vaadin.tests.tb3.SingleBrowserTest;
+
+public class GridHeaderFooterComponentsTest extends SingleBrowserTest {
+
+ @Before
+ public void setUp() {
+ setDebug(true);
+
+ openTestURL();
+ }
+
+ @Test
+ public void hideAndShowComponentsInHeader() {
+ GridElement grid = $(LegacyGridElement.class).first();
+
+ int filterRow = 2;
+ Assert.assertNull(getHeaderElement(grid, filterRow, 1));
+ Assert.assertNotNull(getHeaderElement(grid, filterRow, 2));
+ Assert.assertNotNull(getHeaderElement(grid, filterRow, 3));
+
+ // Show (1,2)
+ grid.getHeaderCell(1, 1).$(ButtonElement.class).first().click();
+
+ TextFieldElement textfield = getHeaderElement(grid, filterRow, 1);
+ Assert.assertNotNull(textfield);
+ Assert.assertEquals("Filter: string", textfield.getValue());
+
+ textfield.setValue("foo");
+ Assert.assertEquals("1. value change for field in string to foo",
+ getLogRow(0));
+
+ assertNoErrorNotifications();
+ }
+
+ private TextFieldElement getHeaderElement(GridElement grid, int row,
+ int col) {
+ GridCellElement cell = grid.getHeaderCell(row, col);
+ List<TextFieldElement> all = cell.$(TextFieldElement.class).all();
+ if (all.size() == 0) {
+ return null;
+ } else if (all.size() == 1) {
+ return all.get(0);
+ } else {
+ throw new RuntimeException(
+ "Multiple elements found in the header cell at " + row + ","
+ + col);
+ }
+ }
+
+ @Test
+ public void hideAndShowComponentsInFooter() {
+ GridElement grid = $(LegacyGridElement.class).first();
+
+ int filterRow = 0;
+ Assert.assertNull(getFooterElement(grid, filterRow, 1));
+ Assert.assertNotNull(getFooterElement(grid, filterRow, 2));
+ Assert.assertNotNull(getFooterElement(grid, filterRow, 3));
+
+ // Show (1,2)
+ grid.getFooterCell(1, 1).$(ButtonElement.class).first().click();
+
+ TextFieldElement textfield = getFooterElement(grid, filterRow, 1);
+ Assert.assertNotNull(textfield);
+ Assert.assertEquals("Filter: string", textfield.getValue());
+
+ textfield.setValue("foo");
+ Assert.assertEquals("1. value change for field in string to foo",
+ getLogRow(0));
+
+ assertNoErrorNotifications();
+ }
+
+ private TextFieldElement getFooterElement(GridElement grid, int row,
+ int col) {
+ GridCellElement cell = grid.getFooterCell(row, col);
+ List<TextFieldElement> all = cell.$(TextFieldElement.class).all();
+ if (all.size() == 0) {
+ return null;
+ } else if (all.size() == 1) {
+ return all.get(0);
+ } else {
+ throw new RuntimeException(
+ "Multiple elements found in the footer cell at " + row + ","
+ + col);
+ }
+ }
+
+ @Test
+ public void testRemoveAllHeadersAndFooters() {
+ openTestURL();
+
+ for (int i = 2; i >= 0; --i) {
+ // Remove Header
+ $(LegacyGridElement.class).first().getHeaderCell(i, 0)
+ .$(ButtonElement.class).first().click();
+ assertFalse("Header " + i + " should not be present.",
+ $(LegacyGridElement.class).first()
+ .isElementPresent(By.vaadin("#header[" + i + "]")));
+
+ // Remove Footer
+ $(LegacyGridElement.class).first().getFooterCell(i, 0)
+ .$(ButtonElement.class).first().click();
+ assertFalse("Footer " + i + " should not be present.",
+ $(LegacyGridElement.class).first()
+ .isElementPresent(By.vaadin("#footer[" + i + "]")));
+ }
+
+ assertNoErrorNotifications();
+ }
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridHeaderFormatChangeTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridHeaderFormatChangeTest.java index ef69679d98..7754b14e04 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridHeaderFormatChangeTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridHeaderFormatChangeTest.java @@ -1,151 +1,151 @@ -/* - * 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.tests.components.grid; - -import org.junit.Assert; -import org.junit.Test; -import org.openqa.selenium.By; - -import com.vaadin.testbench.elements.ButtonElement; -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.testbench.parallel.TestCategory; -import com.vaadin.tests.tb3.MultiBrowserTest; - -@TestCategory("grid") -public class GridHeaderFormatChangeTest extends MultiBrowserTest { - - @Test - public void testHeaderRetainsSelectAllForColumnRemoval() { - openTestURL(); - GridElement grid = $(GridElement.class).first(); - - // Assert that we do not have the select all checkbox - Assert.assertTrue( - "Found input in header even though none should exist.", - grid.getHeader().findElements(By.tagName("input")).isEmpty()); - - // Set grid into multiselection mode - toggleSelectionMode(); - - // Assert that we now have a select all checkbox in the header - Assert.assertFalse("Expected one input field in header", - grid.getHeader().findElements(By.tagName("input")).isEmpty()); - - // Hide the firstName column from the grid. - toggleFirstName(); - - // Assert that we still have the select all checkbox in the header. - Assert.assertFalse("Header was missing checkbox after hiding column", - grid.getHeader().findElements(By.tagName("input")).isEmpty()); - - // Show the firstName column. - toggleFirstName(); - - // Assert that we still have the select all checkbox in the header. - Assert.assertFalse( - "Header was missing checkbox after bringing back column", - grid.getHeader().findElements(By.tagName("input")).isEmpty()); - } - - @Test - public void testHeaderRetainsSelectAllForJoinColumnAdd() { - openTestURL(); - GridElement grid = $(GridElement.class).first(); - - // Assert that we do not have the select all checkbox - Assert.assertTrue( - "Found input in header even though none should exist.", - grid.getHeader().findElements(By.tagName("input")).isEmpty()); - - // Set grid into multiselection mode - toggleSelectionMode(); - - // Assert that we now have a select all checkbox in the header - Assert.assertFalse("Expected one input field in header", - grid.getHeader().findElements(By.tagName("input")).isEmpty()); - - // Add Join columns header - toggleJoin(); - - // Assert that we still have the select all checkbox in the header. - Assert.assertFalse("Header was missing checkbox after hiding column", - grid.getHeader().findElements(By.tagName("input")).isEmpty()); - - // remove Join Columns header - toggleJoin(); - - // Assert that we still have the select all checkbox in the header. - Assert.assertFalse( - "Header was missing checkbox after bringing back column", - grid.getHeader().findElements(By.tagName("input")).isEmpty()); - } - - @Test - public void selectAllShouldKeepState() { - openTestURL(); - GridElement grid = $(GridElement.class).first(); - - // Assert that we do not have the select all checkbox - Assert.assertTrue( - "Found input in header even though none should exist.", - grid.getHeader().findElements(By.tagName("input")).isEmpty()); - - // Set grid into multiselection mode - toggleSelectionMode(); - - // Assert that we now have a select all checkbox in the header - Assert.assertFalse("Should not be selected after adding", - grid.getHeader().findElement(By.tagName("input")).isSelected()); - - grid.getHeader().findElement(By.tagName("input")).click(); - - // Assert that checkbox is checked - assertSelectAllChecked( - "Not selected even though we just clicked selection", grid); - - // Hide the firstName column from the grid. - toggleFirstName(); - - // Assert that checkbox is still checked - assertSelectAllChecked("Selection disappeared after removing column", - grid); - - // Show the firstName column. - toggleFirstName(); - - // Assert that checkbox is still checked - assertSelectAllChecked("Selection disappeared after adding column", - grid); - - } - - private void assertSelectAllChecked(String message, GridElement grid) { - Assert.assertTrue(message, - grid.getHeader().findElement(By.tagName("input")).isSelected()); - } - - private void toggleSelectionMode() { - $(ButtonElement.class).id("selection_mode").click(); - } - - private void toggleFirstName() { - $(ButtonElement.class).id("show_hide").click(); - } - - private void toggleJoin() { - $(ButtonElement.class).id("join").click(); - } -} +/*
+ * 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.tests.components.grid;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.openqa.selenium.By;
+
+import com.vaadin.testbench.elements.ButtonElement;
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.parallel.TestCategory;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+@TestCategory("grid")
+public class GridHeaderFormatChangeTest extends MultiBrowserTest {
+
+ @Test
+ public void testHeaderRetainsSelectAllForColumnRemoval() {
+ openTestURL();
+ GridElement grid = $(LegacyGridElement.class).first();
+
+ // Assert that we do not have the select all checkbox
+ Assert.assertTrue(
+ "Found input in header even though none should exist.",
+ grid.getHeader().findElements(By.tagName("input")).isEmpty());
+
+ // Set grid into multiselection mode
+ toggleSelectionMode();
+
+ // Assert that we now have a select all checkbox in the header
+ Assert.assertFalse("Expected one input field in header",
+ grid.getHeader().findElements(By.tagName("input")).isEmpty());
+
+ // Hide the firstName column from the grid.
+ toggleFirstName();
+
+ // Assert that we still have the select all checkbox in the header.
+ Assert.assertFalse("Header was missing checkbox after hiding column",
+ grid.getHeader().findElements(By.tagName("input")).isEmpty());
+
+ // Show the firstName column.
+ toggleFirstName();
+
+ // Assert that we still have the select all checkbox in the header.
+ Assert.assertFalse(
+ "Header was missing checkbox after bringing back column",
+ grid.getHeader().findElements(By.tagName("input")).isEmpty());
+ }
+
+ @Test
+ public void testHeaderRetainsSelectAllForJoinColumnAdd() {
+ openTestURL();
+ GridElement grid = $(LegacyGridElement.class).first();
+
+ // Assert that we do not have the select all checkbox
+ Assert.assertTrue(
+ "Found input in header even though none should exist.",
+ grid.getHeader().findElements(By.tagName("input")).isEmpty());
+
+ // Set grid into multiselection mode
+ toggleSelectionMode();
+
+ // Assert that we now have a select all checkbox in the header
+ Assert.assertFalse("Expected one input field in header",
+ grid.getHeader().findElements(By.tagName("input")).isEmpty());
+
+ // Add Join columns header
+ toggleJoin();
+
+ // Assert that we still have the select all checkbox in the header.
+ Assert.assertFalse("Header was missing checkbox after hiding column",
+ grid.getHeader().findElements(By.tagName("input")).isEmpty());
+
+ // remove Join Columns header
+ toggleJoin();
+
+ // Assert that we still have the select all checkbox in the header.
+ Assert.assertFalse(
+ "Header was missing checkbox after bringing back column",
+ grid.getHeader().findElements(By.tagName("input")).isEmpty());
+ }
+
+ @Test
+ public void selectAllShouldKeepState() {
+ openTestURL();
+ GridElement grid = $(LegacyGridElement.class).first();
+
+ // Assert that we do not have the select all checkbox
+ Assert.assertTrue(
+ "Found input in header even though none should exist.",
+ grid.getHeader().findElements(By.tagName("input")).isEmpty());
+
+ // Set grid into multiselection mode
+ toggleSelectionMode();
+
+ // Assert that we now have a select all checkbox in the header
+ Assert.assertFalse("Should not be selected after adding",
+ grid.getHeader().findElement(By.tagName("input")).isSelected());
+
+ grid.getHeader().findElement(By.tagName("input")).click();
+
+ // Assert that checkbox is checked
+ assertSelectAllChecked(
+ "Not selected even though we just clicked selection", grid);
+
+ // Hide the firstName column from the grid.
+ toggleFirstName();
+
+ // Assert that checkbox is still checked
+ assertSelectAllChecked("Selection disappeared after removing column",
+ grid);
+
+ // Show the firstName column.
+ toggleFirstName();
+
+ // Assert that checkbox is still checked
+ assertSelectAllChecked("Selection disappeared after adding column",
+ grid);
+
+ }
+
+ private void assertSelectAllChecked(String message, GridElement grid) {
+ Assert.assertTrue(message,
+ grid.getHeader().findElement(By.tagName("input")).isSelected());
+ }
+
+ private void toggleSelectionMode() {
+ $(ButtonElement.class).id("selection_mode").click();
+ }
+
+ private void toggleFirstName() {
+ $(ButtonElement.class).id("show_hide").click();
+ }
+
+ private void toggleJoin() {
+ $(ButtonElement.class).id("join").click();
+ }
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridHeaderStyleNamesTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridHeaderStyleNamesTest.java index 12f855d7a2..c5369311df 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridHeaderStyleNamesTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridHeaderStyleNamesTest.java @@ -1,174 +1,174 @@ -/* - * 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.tests.components.grid; - -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.openqa.selenium.By; -import org.openqa.selenium.WebElement; - -import com.vaadin.testbench.elements.ButtonElement; -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.testbench.elements.GridElement.GridCellElement; -import com.vaadin.testbench.parallel.TestCategory; -import com.vaadin.tests.tb3.SingleBrowserTest; - -@TestCategory("grid") -public class GridHeaderStyleNamesTest extends SingleBrowserTest { - - private GridElement grid; - - @Before - public void findGridCells() { - openTestURL(); - grid = $(GridElement.class).first(); - } - - private GridCellElement getMergedHeaderCell() { - return grid.getHeaderCell(0, 3); - } - - private WebElement getMergedHeaderCellContent() { - return getMergedHeaderCell().findElement( - By.cssSelector("div.v-grid-column-header-content")); - } - - private GridCellElement getAgeFooterCell() { - return grid.getFooterCell(0, 2); - } - - private WebElement getAgeFooterCellContent() { - return getAgeFooterCell().findElement( - By.cssSelector("div.v-grid-column-footer-content")); - } - - @Test - public void cellStyleNamesCanBeAddedAndRemoved() { - ButtonElement toggleStyles = $(ButtonElement.class) - .caption("Toggle styles").first(); - - assertStylesSet(true); - toggleStyles.click(); - assertStylesSet(false); - toggleStyles.click(); - assertStylesSet(true); - } - - @Test - public void rowStyleNamesCanBeAddedAndRemoved() { - ButtonElement toggleStyles = $(ButtonElement.class) - .caption("Toggle styles").first(); - - assertRowStylesSet(true); - toggleStyles.click(); - assertRowStylesSet(false); - toggleStyles.click(); - assertRowStylesSet(true); - - } - - private void assertStylesSet(boolean set) { - if (set) { - assertHasStyleName( - "Footer cell should have the assigned 'age-footer' class name", - getAgeFooterCell(), "age-footer"); - assertHasStyleName( - "Header cell should have the assigned 'age' class name", - getAgeHeaderCell(), "age"); - assertHasStyleName( - "The merged header cell should have the assigned 'city-country' class name", - getMergedHeaderCell(), "city-country"); - } else { - assertHasNotStyleName( - "Footer cell should not have the removed 'age-footer' class name", - getAgeFooterCell(), "age-footer"); - assertHasNotStyleName( - "Header cell should not have the removed 'age' class name", - getAgeHeaderCell(), "age"); - assertHasNotStyleName( - "Ther merged header cell should not have the removed 'city-country' class name", - getMergedHeaderCell(), "city-country"); - } - assertHasStyleName( - "The default v-grid-cell style name should not be removed from the header cell", - getAgeHeaderCell(), "v-grid-cell"); - assertHasStyleName( - "The default v-grid-cell style name should not be removed from the footer cell", - getAgeFooterCell(), "v-grid-cell"); - assertHasStyleName( - "The default v-grid-cell style name should not be removed from the merged header cell", - getMergedHeaderCell(), "v-grid-cell"); - - } - - private void assertRowStylesSet(boolean set) { - if (set) { - assertHasStyleName( - "Footer row should have the assigned 'custom-row' class name", - getFooterRow(), "custom-row"); - assertHasStyleName( - "Header row should have the assigned 'custom-row' class name", - getHeaderRow(), "custom-row"); - } else { - assertHasNotStyleName( - "Footer row should not have the removed 'custom-row' class name", - getFooterRow(), "custom-row"); - assertHasNotStyleName( - "Header row should not have the removed 'custom-row' class name", - getHeaderRow(), "custom-row"); - } - assertHasStyleName( - "The default v-grid-row style name should not be removed from the header row", - getHeaderRow(), "v-grid-row"); - assertHasStyleName( - "The default v-grid-row style name should not be removed from the footer row", - getFooterRow(), "v-grid-row"); - - } - - private WebElement getAgeHeaderCell() { - return grid.getHeaderCell(1, 2); - } - - private WebElement getAgeHeaderCellContent() { - return getAgeHeaderCell().findElement( - By.cssSelector("div.v-grid-column-header-content")); - } - - private WebElement getFooterRow() { - return grid.getFooterRow(0); - } - - private WebElement getHeaderRow() { - return grid.getHeaderRow(0); - } - - private void assertHasStyleName(String message, WebElement element, - String stylename) { - if (!hasCssClass(element, stylename)) { - Assert.fail(message); - } - } - - private void assertHasNotStyleName(String message, WebElement element, - String stylename) { - if (hasCssClass(element, stylename)) { - Assert.fail(message); - } - } - -} +/*
+ * 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.tests.components.grid;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebElement;
+
+import com.vaadin.testbench.elements.ButtonElement;
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.elements.GridElement.GridCellElement;
+import com.vaadin.testbench.parallel.TestCategory;
+import com.vaadin.tests.tb3.SingleBrowserTest;
+
+@TestCategory("grid")
+public class GridHeaderStyleNamesTest extends SingleBrowserTest {
+
+ private GridElement grid;
+
+ @Before
+ public void findGridCells() {
+ openTestURL();
+ grid = $(LegacyGridElement.class).first();
+ }
+
+ private GridCellElement getMergedHeaderCell() {
+ return grid.getHeaderCell(0, 3);
+ }
+
+ private WebElement getMergedHeaderCellContent() {
+ return getMergedHeaderCell().findElement(
+ By.cssSelector("div.v-grid-column-header-content"));
+ }
+
+ private GridCellElement getAgeFooterCell() {
+ return grid.getFooterCell(0, 2);
+ }
+
+ private WebElement getAgeFooterCellContent() {
+ return getAgeFooterCell().findElement(
+ By.cssSelector("div.v-grid-column-footer-content"));
+ }
+
+ @Test
+ public void cellStyleNamesCanBeAddedAndRemoved() {
+ ButtonElement toggleStyles = $(ButtonElement.class)
+ .caption("Toggle styles").first();
+
+ assertStylesSet(true);
+ toggleStyles.click();
+ assertStylesSet(false);
+ toggleStyles.click();
+ assertStylesSet(true);
+ }
+
+ @Test
+ public void rowStyleNamesCanBeAddedAndRemoved() {
+ ButtonElement toggleStyles = $(ButtonElement.class)
+ .caption("Toggle styles").first();
+
+ assertRowStylesSet(true);
+ toggleStyles.click();
+ assertRowStylesSet(false);
+ toggleStyles.click();
+ assertRowStylesSet(true);
+
+ }
+
+ private void assertStylesSet(boolean set) {
+ if (set) {
+ assertHasStyleName(
+ "Footer cell should have the assigned 'age-footer' class name",
+ getAgeFooterCell(), "age-footer");
+ assertHasStyleName(
+ "Header cell should have the assigned 'age' class name",
+ getAgeHeaderCell(), "age");
+ assertHasStyleName(
+ "The merged header cell should have the assigned 'city-country' class name",
+ getMergedHeaderCell(), "city-country");
+ } else {
+ assertHasNotStyleName(
+ "Footer cell should not have the removed 'age-footer' class name",
+ getAgeFooterCell(), "age-footer");
+ assertHasNotStyleName(
+ "Header cell should not have the removed 'age' class name",
+ getAgeHeaderCell(), "age");
+ assertHasNotStyleName(
+ "Ther merged header cell should not have the removed 'city-country' class name",
+ getMergedHeaderCell(), "city-country");
+ }
+ assertHasStyleName(
+ "The default v-grid-cell style name should not be removed from the header cell",
+ getAgeHeaderCell(), "v-grid-cell");
+ assertHasStyleName(
+ "The default v-grid-cell style name should not be removed from the footer cell",
+ getAgeFooterCell(), "v-grid-cell");
+ assertHasStyleName(
+ "The default v-grid-cell style name should not be removed from the merged header cell",
+ getMergedHeaderCell(), "v-grid-cell");
+
+ }
+
+ private void assertRowStylesSet(boolean set) {
+ if (set) {
+ assertHasStyleName(
+ "Footer row should have the assigned 'custom-row' class name",
+ getFooterRow(), "custom-row");
+ assertHasStyleName(
+ "Header row should have the assigned 'custom-row' class name",
+ getHeaderRow(), "custom-row");
+ } else {
+ assertHasNotStyleName(
+ "Footer row should not have the removed 'custom-row' class name",
+ getFooterRow(), "custom-row");
+ assertHasNotStyleName(
+ "Header row should not have the removed 'custom-row' class name",
+ getHeaderRow(), "custom-row");
+ }
+ assertHasStyleName(
+ "The default v-grid-row style name should not be removed from the header row",
+ getHeaderRow(), "v-grid-row");
+ assertHasStyleName(
+ "The default v-grid-row style name should not be removed from the footer row",
+ getFooterRow(), "v-grid-row");
+
+ }
+
+ private WebElement getAgeHeaderCell() {
+ return grid.getHeaderCell(1, 2);
+ }
+
+ private WebElement getAgeHeaderCellContent() {
+ return getAgeHeaderCell().findElement(
+ By.cssSelector("div.v-grid-column-header-content"));
+ }
+
+ private WebElement getFooterRow() {
+ return grid.getFooterRow(0);
+ }
+
+ private WebElement getHeaderRow() {
+ return grid.getHeaderRow(0);
+ }
+
+ private void assertHasStyleName(String message, WebElement element,
+ String stylename) {
+ if (!hasCssClass(element, stylename)) {
+ Assert.fail(message);
+ }
+ }
+
+ private void assertHasNotStyleName(String message, WebElement element,
+ String stylename) {
+ if (hasCssClass(element, stylename)) {
+ Assert.fail(message);
+ }
+ }
+
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridHeightTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridHeightTest.java index b332d2dbfc..fd039b51f0 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridHeightTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridHeightTest.java @@ -93,7 +93,7 @@ public class GridHeightTest extends MultiBrowserTest { .selectByText(detailsRowHeight); sleep(500); - GridElement grid = $(GridElement.class).first(); + GridElement grid = $(LegacyGridElement.class).first(); int initialHeight = grid.getSize().getHeight(); try { // check default height diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridInTabSheetTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridInTabSheetTest.java index 56437a9a70..52483d9a43 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridInTabSheetTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridInTabSheetTest.java @@ -97,6 +97,6 @@ public class GridInTabSheetTest extends MultiBrowserTest { } private GridElement getGridElement() { - return $(GridElement.class).first(); + return $(LegacyGridElement.class).first(); } } diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridInWindowResizeTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridInWindowResizeTest.java index f371d949e3..33de6d5e7d 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridInWindowResizeTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridInWindowResizeTest.java @@ -1,48 +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.tests.components.grid; - -import java.util.Collections; -import java.util.List; - -import org.junit.Assert; -import org.junit.Test; -import org.openqa.selenium.remote.DesiredCapabilities; - -import com.vaadin.testbench.elements.ButtonElement; -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.testbench.parallel.Browser; -import com.vaadin.tests.tb3.MultiBrowserTest; - -public class GridInWindowResizeTest extends MultiBrowserTest { - @Override - public List<DesiredCapabilities> getBrowsersToTest() { - // Must test on a browser with animations - return Collections - .singletonList(Browser.CHROME.getDesiredCapabilities()); - } - - @Test - public void resizeWindow() { - openTestURL(); - GridElement grid = $(GridElement.class).first(); - int col1WidthBefore = grid.getCell(0, 0).getSize().getWidth(); - $(ButtonElement.class).caption("resize").first().click(); - int col1WidthAfter = grid.getCell(0, 0).getSize().getWidth(); - - Assert.assertTrue(col1WidthAfter < col1WidthBefore); - } -} +/*
+ * 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.tests.components.grid;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.openqa.selenium.remote.DesiredCapabilities;
+
+import com.vaadin.testbench.elements.ButtonElement;
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.parallel.Browser;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+public class GridInWindowResizeTest extends MultiBrowserTest {
+ @Override
+ public List<DesiredCapabilities> getBrowsersToTest() {
+ // Must test on a browser with animations
+ return Collections
+ .singletonList(Browser.CHROME.getDesiredCapabilities());
+ }
+
+ @Test
+ public void resizeWindow() {
+ openTestURL();
+ GridElement grid = $(LegacyGridElement.class).first();
+ int col1WidthBefore = grid.getCell(0, 0).getSize().getWidth();
+ $(ButtonElement.class).caption("resize").first().click();
+ int col1WidthAfter = grid.getCell(0, 0).getSize().getWidth();
+
+ Assert.assertTrue(col1WidthAfter < col1WidthBefore);
+ }
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridInitiallyHiddenColumnsTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridInitiallyHiddenColumnsTest.java index 8ba9d64fa6..746a9f9963 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridInitiallyHiddenColumnsTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridInitiallyHiddenColumnsTest.java @@ -1,84 +1,84 @@ -/* - * 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.tests.components.grid; - -import java.util.List; - -import org.junit.Assert; -import org.junit.Test; -import org.openqa.selenium.By; -import org.openqa.selenium.WebElement; - -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.testbench.parallel.TestCategory; -import com.vaadin.tests.tb3.SingleBrowserTest; - -@TestCategory("grid") -public class GridInitiallyHiddenColumnsTest extends SingleBrowserTest { - - @Test - public void ensureCorrectlyRendered() { - openTestURL("debug"); - GridElement grid = $(GridElement.class).first(); - Assert.assertEquals("Rowling", grid.getCell(0, 0).getText()); - Assert.assertEquals("Scott", grid.getCell(1, 0).getText()); - - getSidebarOpenButton(grid).click(); - getColumnHidingToggle(grid, "First Name").click(); - getColumnHidingToggle(grid, "Age").click(); - getSidebarOpenButton(grid).click(); - - Assert.assertEquals("Umberto", grid.getCell(0, 0).getText()); - Assert.assertEquals("Rowling", grid.getCell(0, 1).getText()); - Assert.assertEquals("25", grid.getCell(0, 2).getText()); - Assert.assertEquals("Dan", grid.getCell(1, 0).getText()); - Assert.assertEquals("Scott", grid.getCell(1, 1).getText()); - Assert.assertEquals("54", grid.getCell(1, 2).getText()); - - } - - // TODO: as to the getX methods reuse ones from GridBasicFeaturesTest? - - protected WebElement getSidebarOpenButton(GridElement grid) { - List<WebElement> elements = grid - .findElements(By.className("v-grid-sidebar-button")); - return elements.isEmpty() ? null : elements.get(0); - } - - /** - * Returns the toggle inside the sidebar for hiding the column at the given - * index, or null if not found. - */ - protected WebElement getColumnHidingToggle(GridElement grid, - String caption) { - WebElement sidebar = getSidebar(grid); - List<WebElement> elements = sidebar - .findElements(By.className("column-hiding-toggle")); - for (WebElement e : elements) { - if (caption.equalsIgnoreCase(e.getText())) { - return e; - } - } - return null; - } - - protected WebElement getSidebar(GridElement grid) { - List<WebElement> elements = findElements( - By.className("v-grid-sidebar-popup")); - return elements.isEmpty() ? null : elements.get(0); - } - -} +/*
+ * 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.tests.components.grid;
+
+import java.util.List;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebElement;
+
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.parallel.TestCategory;
+import com.vaadin.tests.tb3.SingleBrowserTest;
+
+@TestCategory("grid")
+public class GridInitiallyHiddenColumnsTest extends SingleBrowserTest {
+
+ @Test
+ public void ensureCorrectlyRendered() {
+ openTestURL("debug");
+ GridElement grid = $(LegacyGridElement.class).first();
+ Assert.assertEquals("Rowling", grid.getCell(0, 0).getText());
+ Assert.assertEquals("Scott", grid.getCell(1, 0).getText());
+
+ getSidebarOpenButton(grid).click();
+ getColumnHidingToggle(grid, "First Name").click();
+ getColumnHidingToggle(grid, "Age").click();
+ getSidebarOpenButton(grid).click();
+
+ Assert.assertEquals("Umberto", grid.getCell(0, 0).getText());
+ Assert.assertEquals("Rowling", grid.getCell(0, 1).getText());
+ Assert.assertEquals("25", grid.getCell(0, 2).getText());
+ Assert.assertEquals("Dan", grid.getCell(1, 0).getText());
+ Assert.assertEquals("Scott", grid.getCell(1, 1).getText());
+ Assert.assertEquals("54", grid.getCell(1, 2).getText());
+
+ }
+
+ // TODO: as to the getX methods reuse ones from GridBasicFeaturesTest?
+
+ protected WebElement getSidebarOpenButton(GridElement grid) {
+ List<WebElement> elements = grid
+ .findElements(By.className("v-grid-sidebar-button"));
+ return elements.isEmpty() ? null : elements.get(0);
+ }
+
+ /**
+ * Returns the toggle inside the sidebar for hiding the column at the given
+ * index, or null if not found.
+ */
+ protected WebElement getColumnHidingToggle(GridElement grid,
+ String caption) {
+ WebElement sidebar = getSidebar(grid);
+ List<WebElement> elements = sidebar
+ .findElements(By.className("column-hiding-toggle"));
+ for (WebElement e : elements) {
+ if (caption.equalsIgnoreCase(e.getText())) {
+ return e;
+ }
+ }
+ return null;
+ }
+
+ protected WebElement getSidebar(GridElement grid) {
+ List<WebElement> elements = findElements(
+ By.className("v-grid-sidebar-popup"));
+ return elements.isEmpty() ? null : elements.get(0);
+ }
+
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridItemSetChangeTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridItemSetChangeTest.java index 20bfdd52ab..1d89caa5f4 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridItemSetChangeTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridItemSetChangeTest.java @@ -1,48 +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.tests.components.grid; - -import static org.junit.Assert.assertEquals; - -import org.junit.Test; - -import com.vaadin.testbench.elements.ButtonElement; -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.tests.tb3.SingleBrowserTest; - -public class GridItemSetChangeTest extends SingleBrowserTest { - - @Test - public void testValueChangeListenersWorkAfterItemSetChange() { - openTestURL(); - - GridElement grid = $(GridElement.class).first(); - assertEquals("Last name initially wrong", "Bar", - grid.getCell(0, 1).getText()); - - $(ButtonElement.class).caption("Modify").first().click(); - assertEquals("Last name was not updated", "Spam", - grid.getCell(0, 1).getText()); - - $(ButtonElement.class).caption("Reset").first().click(); - assertEquals("Last name was not updated on reset", "Baz", - grid.getCell(0, 1).getText()); - - $(ButtonElement.class).caption("Modify").first().click(); - assertEquals("Last name was not updated after reset modification", - "Spam", grid.getCell(0, 1).getText()); - } -} +/*
+ * 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.tests.components.grid;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+import com.vaadin.testbench.elements.ButtonElement;
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.tests.tb3.SingleBrowserTest;
+
+public class GridItemSetChangeTest extends SingleBrowserTest {
+
+ @Test
+ public void testValueChangeListenersWorkAfterItemSetChange() {
+ openTestURL();
+
+ GridElement grid = $(LegacyGridElement.class).first();
+ assertEquals("Last name initially wrong", "Bar",
+ grid.getCell(0, 1).getText());
+
+ $(ButtonElement.class).caption("Modify").first().click();
+ assertEquals("Last name was not updated", "Spam",
+ grid.getCell(0, 1).getText());
+
+ $(ButtonElement.class).caption("Reset").first().click();
+ assertEquals("Last name was not updated on reset", "Baz",
+ grid.getCell(0, 1).getText());
+
+ $(ButtonElement.class).caption("Modify").first().click();
+ assertEquals("Last name was not updated after reset modification",
+ "Spam", grid.getCell(0, 1).getText());
+ }
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridLayoutDetailsRowTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridLayoutDetailsRowTest.java index 0754f2b8ad..5d6c353e4a 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridLayoutDetailsRowTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridLayoutDetailsRowTest.java @@ -1,65 +1,65 @@ -/* - * 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.tests.components.grid; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.number.IsCloseTo.closeTo; - -import org.junit.Test; -import org.openqa.selenium.By; - -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.testbench.elements.GridLayoutElement; -import com.vaadin.testbench.elements.LabelElement; -import com.vaadin.testbench.parallel.TestCategory; -import com.vaadin.tests.tb3.MultiBrowserTest; - -/** - * Tests that details row displays GridLayout contents properly. - * - * @author Vaadin Ltd - */ -@TestCategory("grid") -public class GridLayoutDetailsRowTest extends MultiBrowserTest { - - @Test - public void testLabelHeights() { - openTestURL(); - waitForElementPresent(By.className("v-grid")); - - GridElement grid = $(GridElement.class).first(); - - grid.getRow(2).click(5, 5); - waitForElementPresent(By.id("lbl2")); - - GridLayoutElement gridLayout = $(GridLayoutElement.class).first(); - int gridLayoutHeight = gridLayout.getSize().height; - - // height should be divided equally - double expectedHeight = gridLayoutHeight / 4; - assertLabelHeight("lbl1", expectedHeight); - assertLabelHeight("lbl2", expectedHeight); - assertLabelHeight("lbl3", expectedHeight); - assertLabelHeight("lbl4", expectedHeight); - } - - private void assertLabelHeight(String id, double expectedHeight) { - // 1px leeway for calculations - assertThat("Unexpected label height.", - (double) $(LabelElement.class).id(id).getSize().height, - closeTo(expectedHeight, 1d)); - } -} +/*
+ * 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.tests.components.grid;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.number.IsCloseTo.closeTo;
+
+import org.junit.Test;
+import org.openqa.selenium.By;
+
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.elements.GridLayoutElement;
+import com.vaadin.testbench.elements.LabelElement;
+import com.vaadin.testbench.parallel.TestCategory;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+/**
+ * Tests that details row displays GridLayout contents properly.
+ *
+ * @author Vaadin Ltd
+ */
+@TestCategory("grid")
+public class GridLayoutDetailsRowTest extends MultiBrowserTest {
+
+ @Test
+ public void testLabelHeights() {
+ openTestURL();
+ waitForElementPresent(By.className("v-grid"));
+
+ GridElement grid = $(LegacyGridElement.class).first();
+
+ grid.getRow(2).click(5, 5);
+ waitForElementPresent(By.id("lbl2"));
+
+ GridLayoutElement gridLayout = $(GridLayoutElement.class).first();
+ int gridLayoutHeight = gridLayout.getSize().height;
+
+ // height should be divided equally
+ double expectedHeight = gridLayoutHeight / 4;
+ assertLabelHeight("lbl1", expectedHeight);
+ assertLabelHeight("lbl2", expectedHeight);
+ assertLabelHeight("lbl3", expectedHeight);
+ assertLabelHeight("lbl4", expectedHeight);
+ }
+
+ private void assertLabelHeight(String id, double expectedHeight) {
+ // 1px leeway for calculations
+ assertThat("Unexpected label height.",
+ (double) $(LabelElement.class).id(id).getSize().height,
+ closeTo(expectedHeight, 1d));
+ }
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridMultiSelectionOnInitTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridMultiSelectionOnInitTest.java index b5a96de67f..72d1bd42eb 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridMultiSelectionOnInitTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridMultiSelectionOnInitTest.java @@ -1,49 +1,49 @@ -/* - * 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.tests.components.grid; - -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - -import org.junit.Test; -import org.openqa.selenium.By; - -import com.vaadin.testbench.elements.ButtonElement; -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.testbench.parallel.TestCategory; -import com.vaadin.tests.tb3.MultiBrowserTest; - -@TestCategory("grid") -public class GridMultiSelectionOnInitTest extends MultiBrowserTest { - - @Test - public void testSelectAllCheckBoxExists() { - openTestURL(); - assertTrue("The select all checkbox was missing.", - $(GridElement.class).first().getHeaderCell(0, 0) - .isElementPresent(By.tagName("input"))); - } - - @Test - public void testSetSelectedUpdatesClient() { - openTestURL(); - assertFalse("Rows should not be selected initially.", - $(GridElement.class).first().getRow(0).isSelected()); - $(ButtonElement.class).first().click(); - assertTrue("Rows should be selected after button click.", - $(GridElement.class).first().getRow(0).isSelected()); - } -} +/*
+ * 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.tests.components.grid;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+import org.openqa.selenium.By;
+
+import com.vaadin.testbench.elements.ButtonElement;
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.parallel.TestCategory;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+@TestCategory("grid")
+public class GridMultiSelectionOnInitTest extends MultiBrowserTest {
+
+ @Test
+ public void testSelectAllCheckBoxExists() {
+ openTestURL();
+ assertTrue("The select all checkbox was missing.",
+ $(LegacyGridElement.class).first().getHeaderCell(0, 0)
+ .isElementPresent(By.tagName("input")));
+ }
+
+ @Test
+ public void testSetSelectedUpdatesClient() {
+ openTestURL();
+ assertFalse("Rows should not be selected initially.",
+ $(LegacyGridElement.class).first().getRow(0).isSelected());
+ $(ButtonElement.class).first().click();
+ assertTrue("Rows should be selected after button click.",
+ $(LegacyGridElement.class).first().getRow(0).isSelected());
+ }
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridMultiSelectionScrollBarTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridMultiSelectionScrollBarTest.java index 93935f7524..a1f0f80bc3 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridMultiSelectionScrollBarTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridMultiSelectionScrollBarTest.java @@ -1,43 +1,43 @@ -/* - * 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.tests.components.grid; - -import static org.junit.Assert.assertTrue; - -import java.io.IOException; - -import org.junit.Test; - -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.tests.tb3.MultiBrowserTest; - -public class GridMultiSelectionScrollBarTest extends MultiBrowserTest { - - @Test - public void testNoVisibleScrollBar() throws IOException { - setDebug(true); - openTestURL(); - - assertTrue("Horizontal scrollbar should not be visible.", - $(GridElement.class).first().getHorizontalScroller() - .getAttribute("style").toLowerCase() - .contains("display: none;")); - - // Just to make sure nothing odd happened. - assertNoErrorNotifications(); - } - -} +/*
+ * 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.tests.components.grid;
+
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+
+import org.junit.Test;
+
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+public class GridMultiSelectionScrollBarTest extends MultiBrowserTest {
+
+ @Test
+ public void testNoVisibleScrollBar() throws IOException {
+ setDebug(true);
+ openTestURL();
+
+ assertTrue("Horizontal scrollbar should not be visible.",
+ $(LegacyGridElement.class).first().getHorizontalScroller()
+ .getAttribute("style").toLowerCase()
+ .contains("display: none;"));
+
+ // Just to make sure nothing odd happened.
+ assertNoErrorNotifications();
+ }
+
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridRendererChangeTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridRendererChangeTest.java index 2c6e887a07..66b8352070 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridRendererChangeTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridRendererChangeTest.java @@ -1,59 +1,59 @@ -/* - * 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.tests.components.grid; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import java.util.Collections; -import java.util.List; - -import org.junit.Test; -import org.openqa.selenium.By; - -import com.vaadin.testbench.elements.ButtonElement; -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.testbench.elements.GridElement.GridCellElement; -import com.vaadin.tests.tb3.MultiBrowserTest; - -public class GridRendererChangeTest extends MultiBrowserTest { - - @Test - public void testChangeRenderer() { - setDebug(true); - openTestURL(); - - GridCellElement cell = $(GridElement.class).first().getCell(0, 0); - assertTrue("No button in the first cell.", - cell.isElementPresent(By.tagName("button"))); - int width = cell.getSize().getWidth(); - - List<ButtonElement> buttons = $(ButtonElement.class).all(); - Collections.reverse(buttons); - - // Order: TextRenderer, HTMLRenderer, ButtonRenderer - for (ButtonElement button : buttons) { - button.click(); - assertNoErrorNotifications(); - cell = $(GridElement.class).first().getCell(0, 0); - assertEquals("Cell size changed", width, cell.getSize().getWidth()); - } - - assertTrue("No button in the first cell.", - cell.isElementPresent(By.tagName("button"))); - } - +/*
+ * 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.tests.components.grid;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.junit.Test;
+import org.openqa.selenium.By;
+
+import com.vaadin.testbench.elements.ButtonElement;
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.elements.GridElement.GridCellElement;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+public class GridRendererChangeTest extends MultiBrowserTest {
+
+ @Test
+ public void testChangeRenderer() {
+ setDebug(true);
+ openTestURL();
+
+ GridCellElement cell = $(LegacyGridElement.class).first().getCell(0, 0);
+ assertTrue("No button in the first cell.",
+ cell.isElementPresent(By.tagName("button")));
+ int width = cell.getSize().getWidth();
+
+ List<ButtonElement> buttons = $(ButtonElement.class).all();
+ Collections.reverse(buttons);
+
+ // Order: TextRenderer, HTMLRenderer, ButtonRenderer
+ for (ButtonElement button : buttons) {
+ button.click();
+ assertNoErrorNotifications();
+ cell = $(LegacyGridElement.class).first().getCell(0, 0);
+ assertEquals("Cell size changed", width, cell.getSize().getWidth());
+ }
+
+ assertTrue("No button in the first cell.",
+ cell.isElementPresent(By.tagName("button")));
+ }
+
}
\ No newline at end of file diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridReplaceContainerTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridReplaceContainerTest.java index 6e1536c6a2..60c988ee3c 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridReplaceContainerTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridReplaceContainerTest.java @@ -1,39 +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.tests.components.grid; - -import org.junit.Assert; -import org.junit.Test; - -import com.vaadin.testbench.elements.ButtonElement; -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.tests.tb3.SingleBrowserTest; - -public class GridReplaceContainerTest extends SingleBrowserTest { - - @Test - public void selectAfterContainerChange() { - openTestURL(); - GridElement grid = $(GridElement.class).first(); - grid.getCell(0, 0).click(); - Assert.assertTrue(grid.getRow(0).isSelected()); - - $(ButtonElement.class).first().click(); - Assert.assertFalse(grid.getRow(0).isSelected()); - grid.getCell(0, 0).click(); - Assert.assertTrue(grid.getRow(0).isSelected()); - } -} +/*
+ * 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.tests.components.grid;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import com.vaadin.testbench.elements.ButtonElement;
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.tests.tb3.SingleBrowserTest;
+
+public class GridReplaceContainerTest extends SingleBrowserTest {
+
+ @Test
+ public void selectAfterContainerChange() {
+ openTestURL();
+ GridElement grid = $(LegacyGridElement.class).first();
+ grid.getCell(0, 0).click();
+ Assert.assertTrue(grid.getRow(0).isSelected());
+
+ $(ButtonElement.class).first().click();
+ Assert.assertFalse(grid.getRow(0).isSelected());
+ grid.getCell(0, 0).click();
+ Assert.assertTrue(grid.getRow(0).isSelected());
+ }
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridResizeAndScrollTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridResizeAndScrollTest.java index f226710313..581b6163b1 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridResizeAndScrollTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridResizeAndScrollTest.java @@ -1,45 +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.tests.components.grid; - -import org.junit.Assert; -import org.junit.Test; - -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.testbench.elements.GridElement.GridCellElement; -import com.vaadin.tests.tb3.MultiBrowserTest; - -public class GridResizeAndScrollTest extends MultiBrowserTest { - - @Test - public void scrollAndClick() { - openTestURL(); - GridElement grid = $(GridElement.class).first(); - grid.scrollToRow(49); - // select a row (click on checkbox) - grid.getCell(49, 0).click(); - - // verify rows are what they should be - GridCellElement cell = grid.getCell(33, 1); - String textBefore = cell.getText(); - cell.click(); - - Assert.assertEquals("String contents changed on click", textBefore, - cell.getText()); - - } - -} +/*
+ * 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.tests.components.grid;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.elements.GridElement.GridCellElement;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+public class GridResizeAndScrollTest extends MultiBrowserTest {
+
+ @Test
+ public void scrollAndClick() {
+ openTestURL();
+ GridElement grid = $(LegacyGridElement.class).first();
+ grid.scrollToRow(49);
+ // select a row (click on checkbox)
+ grid.getCell(49, 0).click();
+
+ // verify rows are what they should be
+ GridCellElement cell = grid.getCell(33, 1);
+ String textBefore = cell.getText();
+ cell.click();
+
+ Assert.assertEquals("String contents changed on click", textBefore,
+ cell.getText());
+
+ }
+
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridResizeHiddenColumnTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridResizeHiddenColumnTest.java index 4295200abe..ce4eab5899 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridResizeHiddenColumnTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridResizeHiddenColumnTest.java @@ -1,116 +1,116 @@ -/* - * 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.tests.components.grid; - -import java.util.List; - -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.openqa.selenium.By; -import org.openqa.selenium.Dimension; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.interactions.Actions; - -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.testbench.elements.GridElement.GridCellElement; -import com.vaadin.testbench.parallel.BrowserUtil; -import com.vaadin.tests.tb3.MultiBrowserTest; - -public class GridResizeHiddenColumnTest extends MultiBrowserTest { - - @Before - public void before() { - openTestURL(); - } - - @Test - public void testDragResizeHiddenColumnSize() { - GridElement grid = $(GridElement.class).first(); - Actions action = new Actions(getDriver()); - - // Check if column 'Gender' hidden - List<GridCellElement> headerCells = grid.getHeaderCells(0); - Assert.assertEquals("There should be two visible columns", 2, - headerCells.size()); - Assert.assertFalse("Gender column should be hidden", - containsText("Gender", headerCells)); - - // Resize first column - int dragOffset = -100; - int headerCellWidth = headerCells.get(0).getSize().getWidth(); - dragResizeColumn(headerCells.get(0), 1, dragOffset); - - // When dragging the resizer on IE8, the final offset will be smaller - // (might be an issue with the feature that doesn't start resizing until - // the cursor moved a few pixels) - double delta = BrowserUtil.isIE8(getDesiredCapabilities()) ? 5d : 0; - Assert.assertEquals( - "Column width should've changed by " + dragOffset + "px", - headerCellWidth + dragOffset, - headerCells.get(0).getSize().getWidth(), delta); - - // Make column 'Gender' visible - WebElement menuButton = grid.findElement(By.className("v-contextmenu")) - .findElement(By.tagName("button")); - action.click(menuButton).perform(); // Click on menu button - - WebElement sidebarPopup = findElement( - By.className("v-grid-sidebar-popup")); - WebElement visibilityToggle = findElementByText("Gender", - sidebarPopup.findElements(By.className("gwt-MenuItem"))); - action.click(visibilityToggle).perform(); // Click on 'Gender' menu item - - // Check if column 'Gender' is visible - headerCells = grid.getHeaderCells(0); - Assert.assertEquals("There should be three visible columns", 3, - headerCells.size()); - Assert.assertTrue("Gender column should be visible", - containsText("Gender", headerCells)); - - // Check if column 'Gender' has expanded width - int widthSum = 0; - for (GridCellElement e : headerCells) { - widthSum += e.getSize().getWidth(); - } - Assert.assertEquals("Gender column should take up the remaining space", - grid.getHeader().getSize().getWidth(), widthSum, 1d); - } - - private WebElement findElementByText(String text, - List<? extends WebElement> elements) { - for (WebElement e : elements) { - if (text.equalsIgnoreCase(e.getText())) { - return e; - } - } - return null; - } - - private boolean containsText(String text, - List<? extends WebElement> elements) { - return !(findElementByText(text, elements) == null); - } - - private void dragResizeColumn(GridCellElement headerCell, int posX, - int offset) { - Dimension size = headerCell.getSize(); - new Actions(getDriver()) - .moveToElement(headerCell, size.getWidth() + posX, - size.getHeight() / 2) - .clickAndHold().moveByOffset(offset, 0).release().perform(); - } -} +/*
+ * 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.tests.components.grid;
+
+import java.util.List;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.openqa.selenium.By;
+import org.openqa.selenium.Dimension;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.interactions.Actions;
+
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.elements.GridElement.GridCellElement;
+import com.vaadin.testbench.parallel.BrowserUtil;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+public class GridResizeHiddenColumnTest extends MultiBrowserTest {
+
+ @Before
+ public void before() {
+ openTestURL();
+ }
+
+ @Test
+ public void testDragResizeHiddenColumnSize() {
+ GridElement grid = $(LegacyGridElement.class).first();
+ Actions action = new Actions(getDriver());
+
+ // Check if column 'Gender' hidden
+ List<GridCellElement> headerCells = grid.getHeaderCells(0);
+ Assert.assertEquals("There should be two visible columns", 2,
+ headerCells.size());
+ Assert.assertFalse("Gender column should be hidden",
+ containsText("Gender", headerCells));
+
+ // Resize first column
+ int dragOffset = -100;
+ int headerCellWidth = headerCells.get(0).getSize().getWidth();
+ dragResizeColumn(headerCells.get(0), 1, dragOffset);
+
+ // When dragging the resizer on IE8, the final offset will be smaller
+ // (might be an issue with the feature that doesn't start resizing until
+ // the cursor moved a few pixels)
+ double delta = BrowserUtil.isIE8(getDesiredCapabilities()) ? 5d : 0;
+ Assert.assertEquals(
+ "Column width should've changed by " + dragOffset + "px",
+ headerCellWidth + dragOffset,
+ headerCells.get(0).getSize().getWidth(), delta);
+
+ // Make column 'Gender' visible
+ WebElement menuButton = grid.findElement(By.className("v-contextmenu"))
+ .findElement(By.tagName("button"));
+ action.click(menuButton).perform(); // Click on menu button
+
+ WebElement sidebarPopup = findElement(
+ By.className("v-grid-sidebar-popup"));
+ WebElement visibilityToggle = findElementByText("Gender",
+ sidebarPopup.findElements(By.className("gwt-MenuItem")));
+ action.click(visibilityToggle).perform(); // Click on 'Gender' menu item
+
+ // Check if column 'Gender' is visible
+ headerCells = grid.getHeaderCells(0);
+ Assert.assertEquals("There should be three visible columns", 3,
+ headerCells.size());
+ Assert.assertTrue("Gender column should be visible",
+ containsText("Gender", headerCells));
+
+ // Check if column 'Gender' has expanded width
+ int widthSum = 0;
+ for (GridCellElement e : headerCells) {
+ widthSum += e.getSize().getWidth();
+ }
+ Assert.assertEquals("Gender column should take up the remaining space",
+ grid.getHeader().getSize().getWidth(), widthSum, 1d);
+ }
+
+ private WebElement findElementByText(String text,
+ List<? extends WebElement> elements) {
+ for (WebElement e : elements) {
+ if (text.equalsIgnoreCase(e.getText())) {
+ return e;
+ }
+ }
+ return null;
+ }
+
+ private boolean containsText(String text,
+ List<? extends WebElement> elements) {
+ return !(findElementByText(text, elements) == null);
+ }
+
+ private void dragResizeColumn(GridCellElement headerCell, int posX,
+ int offset) {
+ Dimension size = headerCell.getSize();
+ new Actions(getDriver())
+ .moveToElement(headerCell, size.getWidth() + posX,
+ size.getHeight() / 2)
+ .clickAndHold().moveByOffset(offset, 0).release().perform();
+ }
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridRowHeightChangeTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridRowHeightChangeTest.java index faba380fab..97d94605f1 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridRowHeightChangeTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridRowHeightChangeTest.java @@ -28,7 +28,7 @@ public class GridRowHeightChangeTest extends MultiBrowserTest { // select theme $(NativeSelectElement.class).first().selectByText(theme); - GridElement grid = $(GridElement.class).first(); + GridElement grid = $(LegacyGridElement.class).first(); int gridHeight = grid.getSize().getHeight(); int tabsheetHeight = findElements( diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridScrollToLineWhileResizingTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridScrollToLineWhileResizingTest.java index e70ec2cfa1..359571120e 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridScrollToLineWhileResizingTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridScrollToLineWhileResizingTest.java @@ -1,49 +1,49 @@ -/* - * 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.tests.components.grid; - -import static org.junit.Assert.assertTrue; - -import java.util.List; - -import org.junit.Test; -import org.openqa.selenium.By; -import org.openqa.selenium.WebElement; - -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.testbench.parallel.TestCategory; -import com.vaadin.tests.tb3.MultiBrowserTest; - -@TestCategory("grid") -public class GridScrollToLineWhileResizingTest extends MultiBrowserTest { - - @Test - public void testScrollToLineWorksWhileMovingSplitProgrammatically() { - openTestURL(); - - $(GridElement.class).first().getCell(21, 0).click(); - - List<WebElement> cells = findElements(By.className("v-grid-cell")); - boolean foundCell21 = false; - for (WebElement cell : cells) { - if ("cell21".equals(cell.getText())) { - foundCell21 = true; - } - } - - assertTrue(foundCell21); - } +/*
+ * 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.tests.components.grid;
+
+import static org.junit.Assert.assertTrue;
+
+import java.util.List;
+
+import org.junit.Test;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebElement;
+
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.parallel.TestCategory;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+@TestCategory("grid")
+public class GridScrollToLineWhileResizingTest extends MultiBrowserTest {
+
+ @Test
+ public void testScrollToLineWorksWhileMovingSplitProgrammatically() {
+ openTestURL();
+
+ $(LegacyGridElement.class).first().getCell(21, 0).click();
+
+ List<WebElement> cells = findElements(By.className("v-grid-cell"));
+ boolean foundCell21 = false;
+ for (WebElement cell : cells) {
+ if ("cell21".equals(cell.getText())) {
+ foundCell21 = true;
+ }
+ }
+
+ assertTrue(foundCell21);
+ }
}
\ No newline at end of file diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridSelectAllCellTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridSelectAllCellTest.java index 7b0e33cc6c..92247d7a9b 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridSelectAllCellTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridSelectAllCellTest.java @@ -1,37 +1,37 @@ -package com.vaadin.tests.components.grid; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.core.Is.is; - -import java.io.IOException; - -import org.junit.Test; -import org.openqa.selenium.By; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.interactions.Actions; - -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.tests.tb3.MultiBrowserTest; - -public class GridSelectAllCellTest extends MultiBrowserTest { - - @Override - public void setup() throws Exception { - super.setup(); - - openTestURL(); - } - - @Test - public void selectAllCellCanBeClicked() throws IOException { - GridElement.GridCellElement selectAllCell = $(GridElement.class).first() - .getHeaderCell(0, 0); - - new Actions(getDriver()).moveToElement(selectAllCell, 2, 2).click() - .perform(); - - WebElement selectAllCheckbox = selectAllCell - .findElement(By.cssSelector("input")); - assertThat(selectAllCheckbox.isSelected(), is(true)); - } +package com.vaadin.tests.components.grid;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+
+import java.io.IOException;
+
+import org.junit.Test;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.interactions.Actions;
+
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+public class GridSelectAllCellTest extends MultiBrowserTest {
+
+ @Override
+ public void setup() throws Exception {
+ super.setup();
+
+ openTestURL();
+ }
+
+ @Test
+ public void selectAllCellCanBeClicked() throws IOException {
+ GridElement.GridCellElement selectAllCell = $(LegacyGridElement.class).first()
+ .getHeaderCell(0, 0);
+
+ new Actions(getDriver()).moveToElement(selectAllCell, 2, 2).click()
+ .perform();
+
+ WebElement selectAllCheckbox = selectAllCell
+ .findElement(By.cssSelector("input"));
+ assertThat(selectAllCheckbox.isSelected(), is(true));
+ }
}
\ No newline at end of file diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridSidebarPositionTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridSidebarPositionTest.java index 01230fca10..7b7cb5c3f6 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridSidebarPositionTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridSidebarPositionTest.java @@ -1,95 +1,95 @@ -/* - * 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.tests.components.grid; - -import java.util.List; - -import org.junit.Assert; -import org.junit.Test; -import org.openqa.selenium.By; -import org.openqa.selenium.Dimension; -import org.openqa.selenium.Point; -import org.openqa.selenium.WebElement; - -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.testbench.parallel.BrowserUtil; -import com.vaadin.tests.tb3.MultiBrowserTest; - -public class GridSidebarPositionTest extends MultiBrowserTest { - - @Test - public void heightRestrictedToBrowserWindow() { - openTestURL(); - GridElement gridWithVeryManyColumns = $(GridElement.class) - .id(GridSidebarPosition.POPUP_WINDOW_HEIGHT); - getSidebarOpenButton(gridWithVeryManyColumns).click(); - Dimension popupSize = getSidebarPopup().getSize(); - Dimension browserWindowSize = getDriver().manage().window().getSize(); - - Assert.assertTrue( - popupSize.getHeight() <= browserWindowSize.getHeight()); - } - - @Test - public void popupNotBelowBrowserWindow() { - openTestURL(); - GridElement gridAtBottom = $(GridElement.class) - .id(GridSidebarPosition.POPUP_WINDOW_MOVED_UP); - getSidebarOpenButton(gridAtBottom).click(); - WebElement sidebarPopup = getSidebarPopup(); - Dimension popupSize = sidebarPopup.getSize(); - Point popupLocation = sidebarPopup.getLocation(); - int popupBottom = popupLocation.getY() + popupSize.getHeight(); - Dimension browserWindowSize = getDriver().manage().window().getSize(); - - Assert.assertTrue(popupBottom <= browserWindowSize.getHeight()); - } - - @Test - public void popupAbove() { - openTestURL(); - GridElement gridPopupAbove = $(GridElement.class) - .id(GridSidebarPosition.POPUP_ABOVE); - WebElement sidebarOpenButton = getSidebarOpenButton(gridPopupAbove); - sidebarOpenButton.click(); - WebElement sidebarPopup = getSidebarPopup(); - Dimension popupSize = sidebarPopup.getSize(); - Point popupLocation = sidebarPopup.getLocation(); - int popupBottom = popupLocation.getY() + popupSize.getHeight(); - int sideBarButtonTop; - if (BrowserUtil.isIE8(getDesiredCapabilities())) { - // IE8 gets the top coordinate for the button completely wrong for - // some reason - sideBarButtonTop = 660; - } else { - sideBarButtonTop = sidebarOpenButton.getLocation().getY(); - } - Assert.assertTrue(popupBottom <= sideBarButtonTop); - } - - protected WebElement getSidebarOpenButton(GridElement grid) { - List<WebElement> elements = grid - .findElements(By.className("v-grid-sidebar-button")); - return elements.isEmpty() ? null : elements.get(0); - } - - protected WebElement getSidebarPopup() { - List<WebElement> elements = findElements( - By.className("v-grid-sidebar-popup")); - return elements.isEmpty() ? null : elements.get(0); - } - -} +/*
+ * 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.tests.components.grid;
+
+import java.util.List;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.openqa.selenium.By;
+import org.openqa.selenium.Dimension;
+import org.openqa.selenium.Point;
+import org.openqa.selenium.WebElement;
+
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.parallel.BrowserUtil;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+public class GridSidebarPositionTest extends MultiBrowserTest {
+
+ @Test
+ public void heightRestrictedToBrowserWindow() {
+ openTestURL();
+ GridElement gridWithVeryManyColumns = $(LegacyGridElement.class)
+ .id(GridSidebarPosition.POPUP_WINDOW_HEIGHT);
+ getSidebarOpenButton(gridWithVeryManyColumns).click();
+ Dimension popupSize = getSidebarPopup().getSize();
+ Dimension browserWindowSize = getDriver().manage().window().getSize();
+
+ Assert.assertTrue(
+ popupSize.getHeight() <= browserWindowSize.getHeight());
+ }
+
+ @Test
+ public void popupNotBelowBrowserWindow() {
+ openTestURL();
+ GridElement gridAtBottom = $(LegacyGridElement.class)
+ .id(GridSidebarPosition.POPUP_WINDOW_MOVED_UP);
+ getSidebarOpenButton(gridAtBottom).click();
+ WebElement sidebarPopup = getSidebarPopup();
+ Dimension popupSize = sidebarPopup.getSize();
+ Point popupLocation = sidebarPopup.getLocation();
+ int popupBottom = popupLocation.getY() + popupSize.getHeight();
+ Dimension browserWindowSize = getDriver().manage().window().getSize();
+
+ Assert.assertTrue(popupBottom <= browserWindowSize.getHeight());
+ }
+
+ @Test
+ public void popupAbove() {
+ openTestURL();
+ GridElement gridPopupAbove = $(LegacyGridElement.class)
+ .id(GridSidebarPosition.POPUP_ABOVE);
+ WebElement sidebarOpenButton = getSidebarOpenButton(gridPopupAbove);
+ sidebarOpenButton.click();
+ WebElement sidebarPopup = getSidebarPopup();
+ Dimension popupSize = sidebarPopup.getSize();
+ Point popupLocation = sidebarPopup.getLocation();
+ int popupBottom = popupLocation.getY() + popupSize.getHeight();
+ int sideBarButtonTop;
+ if (BrowserUtil.isIE8(getDesiredCapabilities())) {
+ // IE8 gets the top coordinate for the button completely wrong for
+ // some reason
+ sideBarButtonTop = 660;
+ } else {
+ sideBarButtonTop = sidebarOpenButton.getLocation().getY();
+ }
+ Assert.assertTrue(popupBottom <= sideBarButtonTop);
+ }
+
+ protected WebElement getSidebarOpenButton(GridElement grid) {
+ List<WebElement> elements = grid
+ .findElements(By.className("v-grid-sidebar-button"));
+ return elements.isEmpty() ? null : elements.get(0);
+ }
+
+ protected WebElement getSidebarPopup() {
+ List<WebElement> elements = findElements(
+ By.className("v-grid-sidebar-popup"));
+ return elements.isEmpty() ? null : elements.get(0);
+ }
+
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridSingleColumnTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridSingleColumnTest.java index 01355e8801..8f407baddf 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridSingleColumnTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridSingleColumnTest.java @@ -1,47 +1,47 @@ -/* - * 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.tests.components.grid; - -import org.junit.Assert; -import org.junit.Test; - -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.testbench.elements.GridElement.GridCellElement; -import com.vaadin.testbench.elements.NotificationElement; -import com.vaadin.testbench.parallel.TestCategory; -import com.vaadin.tests.tb3.MultiBrowserTest; - -@TestCategory("grid") -public class GridSingleColumnTest extends MultiBrowserTest { - - @Test - public void testHeaderIsVisible() { - openTestURL(); - - GridCellElement cell = $(GridElement.class).first().getHeaderCell(0, 0); - Assert.assertTrue("No header available", - cell.getText().equalsIgnoreCase("header")); - } - - @Test - public void testScrollDidNotThrow() { - setDebug(true); - openTestURL(); - - Assert.assertFalse("Exception when scrolling on init", - isElementPresent(NotificationElement.class)); - } -} +/*
+ * 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.tests.components.grid;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.elements.GridElement.GridCellElement;
+import com.vaadin.testbench.elements.NotificationElement;
+import com.vaadin.testbench.parallel.TestCategory;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+@TestCategory("grid")
+public class GridSingleColumnTest extends MultiBrowserTest {
+
+ @Test
+ public void testHeaderIsVisible() {
+ openTestURL();
+
+ GridCellElement cell = $(LegacyGridElement.class).first().getHeaderCell(0, 0);
+ Assert.assertTrue("No header available",
+ cell.getText().equalsIgnoreCase("header"));
+ }
+
+ @Test
+ public void testScrollDidNotThrow() {
+ setDebug(true);
+ openTestURL();
+
+ Assert.assertFalse("Exception when scrolling on init",
+ isElementPresent(NotificationElement.class));
+ }
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridSortIndicatorTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridSortIndicatorTest.java index e43f39af10..b9dc55318b 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridSortIndicatorTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridSortIndicatorTest.java @@ -1,53 +1,53 @@ -/* - * 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.tests.components.grid; - -import static org.junit.Assert.assertTrue; - -import org.junit.Test; - -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.testbench.parallel.TestCategory; -import com.vaadin.tests.tb3.MultiBrowserTest; - -@TestCategory("grid") -public class GridSortIndicatorTest extends MultiBrowserTest { - - @Test - public void testIndicators() throws InterruptedException { - openTestURL(); - GridElement grid = $(GridElement.class).first(); - // Clicking the left header cell should set ascending sort order for - // both columns. - grid.getHeaderCell(0, 0).click(); - assertTrue(grid.getHeaderCell(0, 0).getAttribute("class") - .contains("sort-asc")); - assertTrue(grid.getHeaderCell(0, 1).getAttribute("class") - .contains("sort-asc")); - // Click the left column to change the sort direction. - grid.getHeaderCell(0, 0).click(); - assertTrue(grid.getHeaderCell(0, 0).getAttribute("class") - .contains("sort-desc")); - assertTrue(grid.getHeaderCell(0, 1).getAttribute("class") - .contains("sort-desc")); - // Clicking on the right column should have no effect. - grid.getHeaderCell(0, 1).click(); - assertTrue(grid.getHeaderCell(0, 0).getAttribute("class") - .contains("sort-desc")); - assertTrue(grid.getHeaderCell(0, 1).getAttribute("class") - .contains("sort-desc")); - } +/*
+ * 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.tests.components.grid;
+
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.parallel.TestCategory;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+@TestCategory("grid")
+public class GridSortIndicatorTest extends MultiBrowserTest {
+
+ @Test
+ public void testIndicators() throws InterruptedException {
+ openTestURL();
+ GridElement grid = $(LegacyGridElement.class).first();
+ // Clicking the left header cell should set ascending sort order for
+ // both columns.
+ grid.getHeaderCell(0, 0).click();
+ assertTrue(grid.getHeaderCell(0, 0).getAttribute("class")
+ .contains("sort-asc"));
+ assertTrue(grid.getHeaderCell(0, 1).getAttribute("class")
+ .contains("sort-asc"));
+ // Click the left column to change the sort direction.
+ grid.getHeaderCell(0, 0).click();
+ assertTrue(grid.getHeaderCell(0, 0).getAttribute("class")
+ .contains("sort-desc"));
+ assertTrue(grid.getHeaderCell(0, 1).getAttribute("class")
+ .contains("sort-desc"));
+ // Clicking on the right column should have no effect.
+ grid.getHeaderCell(0, 1).click();
+ assertTrue(grid.getHeaderCell(0, 0).getAttribute("class")
+ .contains("sort-desc"));
+ assertTrue(grid.getHeaderCell(0, 1).getAttribute("class")
+ .contains("sort-desc"));
+ }
}
\ No newline at end of file diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridSpacerDecoClipTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridSpacerDecoClipTest.java index 82226de888..df32e3ff67 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridSpacerDecoClipTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridSpacerDecoClipTest.java @@ -45,7 +45,7 @@ public class GridSpacerDecoClipTest extends MultiBrowserTest { public void testNewSpacerClip() { openTestURL(); - GridElement gridElement = $(GridElement.class).first(); + GridElement gridElement = $(LegacyGridElement.class).first(); gridElement.scrollToRow(999); GridElement.GridRowElement nextToLastRow = gridElement.getRow(998); nextToLastRow.doubleClick(); @@ -65,7 +65,7 @@ public class GridSpacerDecoClipTest extends MultiBrowserTest { public void testRemovedSpacerClip() throws InterruptedException { openTestURL(); - GridElement gridElement = $(GridElement.class).first(); + GridElement gridElement = $(LegacyGridElement.class).first(); gridElement.scrollToRow(999); GridElement.GridRowElement lastRow = gridElement.getRow(999); lastRow.doubleClick(); // Open lowest Row Details diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridSubPixelProblemWrappingTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridSubPixelProblemWrappingTest.java index 26f7d97b59..f9d88b6d32 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridSubPixelProblemWrappingTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridSubPixelProblemWrappingTest.java @@ -1,57 +1,57 @@ -/* - * 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.tests.components.grid; - -import org.junit.Assert; -import org.junit.Test; - -import com.vaadin.testbench.elements.ButtonElement; -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.testbench.elements.GridElement.GridRowElement; -import com.vaadin.testbench.parallel.TestCategory; -import com.vaadin.tests.tb3.MultiBrowserTest; - -@TestCategory("grid") -public class GridSubPixelProblemWrappingTest extends MultiBrowserTest { - - @Test - public void addedRowShouldNotWrap() { - openTestURL(); - - GridElement grid = $(GridElement.class).first(); - - // Cells in first row should be at the same y coordinate as the row - assertRowAndCellTops(grid, 0); - - // Add a row - $(ButtonElement.class).first().click(); - - // Cells in the first row should be at the same y coordinate as the row - assertRowAndCellTops(grid, 0); - // Cells in the second row should be at the same y coordinate as the row - assertRowAndCellTops(grid, 1); - } - - private void assertRowAndCellTops(GridElement grid, int rowIndex) { - GridRowElement row = grid.getRow(rowIndex); - int rowTop = row.getLocation().y; - - int cell0Top = grid.getCell(rowIndex, 0).getLocation().y; - int cell1Top = grid.getCell(rowIndex, 1).getLocation().y; - Assert.assertEquals(rowTop, cell0Top); - Assert.assertEquals(rowTop, cell1Top); - } -} +/*
+ * 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.tests.components.grid;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import com.vaadin.testbench.elements.ButtonElement;
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.elements.GridElement.GridRowElement;
+import com.vaadin.testbench.parallel.TestCategory;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+@TestCategory("grid")
+public class GridSubPixelProblemWrappingTest extends MultiBrowserTest {
+
+ @Test
+ public void addedRowShouldNotWrap() {
+ openTestURL();
+
+ GridElement grid = $(LegacyGridElement.class).first();
+
+ // Cells in first row should be at the same y coordinate as the row
+ assertRowAndCellTops(grid, 0);
+
+ // Add a row
+ $(ButtonElement.class).first().click();
+
+ // Cells in the first row should be at the same y coordinate as the row
+ assertRowAndCellTops(grid, 0);
+ // Cells in the second row should be at the same y coordinate as the row
+ assertRowAndCellTops(grid, 1);
+ }
+
+ private void assertRowAndCellTops(GridElement grid, int rowIndex) {
+ GridRowElement row = grid.getRow(rowIndex);
+ int rowTop = row.getLocation().y;
+
+ int cell0Top = grid.getCell(rowIndex, 0).getLocation().y;
+ int cell1Top = grid.getCell(rowIndex, 1).getLocation().y;
+ Assert.assertEquals(rowTop, cell0Top);
+ Assert.assertEquals(rowTop, cell1Top);
+ }
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridSwitchRenderersTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridSwitchRenderersTest.java index 22c654bf17..8db4b6e50c 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridSwitchRenderersTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridSwitchRenderersTest.java @@ -1,86 +1,86 @@ -/* - * 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.tests.components.grid; - -import org.junit.Assert; -import org.junit.Test; - -import com.vaadin.testbench.elements.CheckBoxElement; -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.testbench.parallel.TestCategory; -import com.vaadin.tests.tb3.MultiBrowserTest; - -@TestCategory("grid") -public class GridSwitchRenderersTest extends MultiBrowserTest { - - @Test - public void testRendererSwitch() { - - // The UI should start with TEXT rendering in the second column - // Clicking the checkbox will toggle rendering to HTML mode - // Clicking it again should return TEXT rendering mode. - - openTestURL(); - - GridElement grid = $(GridElement.class).first(); - - Assert.assertTrue( - "Initial rendering of column 1 is not unformatted text", - cellTextIsUnformatted(grid.getCell(0, 1).getText())); - - // NOTE: must click at 5,5 because of Valo and rendering in Chrome - // This is a TestBench bug that may be fixed sometime in the future - CheckBoxElement cb = $(CheckBoxElement.class).first(); - cb.click(5, 5); - - Assert.assertTrue( - "Column 1 data has not been rendered with HTMLRenderer after renderer swap", - cellTextIsHTMLFormatted(grid.getCell(0, 1).getText())); - cb.click(5, 5); - - Assert.assertTrue( - "Column 1 data has not been re-rendered as text after renderer swap", - cellTextIsUnformatted(grid.getCell(0, 1).getText())); - } - - /** - * Attempts to match a string to a string like {@code <b>(4, 1)</b>}. - * - * @param cellText - * input string - * @return true if input string is formatted like a raw HTML string - */ - private boolean cellTextIsUnformatted(String cellText) { - String regex = "<b>\\(\\d+, \\d+\\)</b>"; - return cellText.matches(regex); - } - - /** - * Attempts to match a string to a string like {@code (4, 1)}, i.e. the HTML - * formatted version of the above (the bold tags should be consumed by the - * renderer). - * - * @param cellText - * input string - * @return true if input string is formatted like plain text (i.e. HTML bits - * have been consumed by renderer) - */ - private boolean cellTextIsHTMLFormatted(String cellText) { - String regex = "\\(\\d+, \\d+\\)"; - return cellText.matches(regex); - } - -} +/*
+ * 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.tests.components.grid;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import com.vaadin.testbench.elements.CheckBoxElement;
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.parallel.TestCategory;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+@TestCategory("grid")
+public class GridSwitchRenderersTest extends MultiBrowserTest {
+
+ @Test
+ public void testRendererSwitch() {
+
+ // The UI should start with TEXT rendering in the second column
+ // Clicking the checkbox will toggle rendering to HTML mode
+ // Clicking it again should return TEXT rendering mode.
+
+ openTestURL();
+
+ GridElement grid = $(LegacyGridElement.class).first();
+
+ Assert.assertTrue(
+ "Initial rendering of column 1 is not unformatted text",
+ cellTextIsUnformatted(grid.getCell(0, 1).getText()));
+
+ // NOTE: must click at 5,5 because of Valo and rendering in Chrome
+ // This is a TestBench bug that may be fixed sometime in the future
+ CheckBoxElement cb = $(CheckBoxElement.class).first();
+ cb.click(5, 5);
+
+ Assert.assertTrue(
+ "Column 1 data has not been rendered with HTMLRenderer after renderer swap",
+ cellTextIsHTMLFormatted(grid.getCell(0, 1).getText()));
+ cb.click(5, 5);
+
+ Assert.assertTrue(
+ "Column 1 data has not been re-rendered as text after renderer swap",
+ cellTextIsUnformatted(grid.getCell(0, 1).getText()));
+ }
+
+ /**
+ * Attempts to match a string to a string like {@code <b>(4, 1)</b>}.
+ *
+ * @param cellText
+ * input string
+ * @return true if input string is formatted like a raw HTML string
+ */
+ private boolean cellTextIsUnformatted(String cellText) {
+ String regex = "<b>\\(\\d+, \\d+\\)</b>";
+ return cellText.matches(regex);
+ }
+
+ /**
+ * Attempts to match a string to a string like {@code (4, 1)}, i.e. the HTML
+ * formatted version of the above (the bold tags should be consumed by the
+ * renderer).
+ *
+ * @param cellText
+ * input string
+ * @return true if input string is formatted like plain text (i.e. HTML bits
+ * have been consumed by renderer)
+ */
+ private boolean cellTextIsHTMLFormatted(String cellText) {
+ String regex = "\\(\\d+, \\d+\\)";
+ return cellText.matches(regex);
+ }
+
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridThemeChangeTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridThemeChangeTest.java index 146ba038fc..2f2c0258a9 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridThemeChangeTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridThemeChangeTest.java @@ -1,54 +1,54 @@ -/* - * 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.tests.components.grid; - -import java.util.List; - -import org.junit.Assert; -import org.junit.Test; -import org.openqa.selenium.remote.DesiredCapabilities; - -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.testbench.parallel.TestCategory; -import com.vaadin.tests.tb3.MultiBrowserTest; - -@TestCategory("grid") -public class GridThemeChangeTest extends MultiBrowserTest { - @Override - public List<DesiredCapabilities> getBrowsersToTest() { - // Seems like stylesheet onload is not fired on PhantomJS - // https://github.com/ariya/phantomjs/issues/12332 - return super.getBrowsersExcludingPhantomJS(); - } - - @Test - public void testThemeChange() { - openTestURL("debug"); - - GridElement grid = $(GridElement.class).first(); - - int reindeerHeight = grid.getRow(0).getSize().getHeight(); - - grid.getCell(0, 0).click(); - - grid = $(GridElement.class).first(); - int valoHeight = grid.getRow(0).getSize().getHeight(); - - Assert.assertTrue( - "Row height should increase when changing from Reindeer to Valo", - valoHeight > reindeerHeight); - } -} +/*
+ * 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.tests.components.grid;
+
+import java.util.List;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.openqa.selenium.remote.DesiredCapabilities;
+
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.parallel.TestCategory;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+@TestCategory("grid")
+public class GridThemeChangeTest extends MultiBrowserTest {
+ @Override
+ public List<DesiredCapabilities> getBrowsersToTest() {
+ // Seems like stylesheet onload is not fired on PhantomJS
+ // https://github.com/ariya/phantomjs/issues/12332
+ return super.getBrowsersExcludingPhantomJS();
+ }
+
+ @Test
+ public void testThemeChange() {
+ openTestURL("debug");
+
+ GridElement grid = $(LegacyGridElement.class).first();
+
+ int reindeerHeight = grid.getRow(0).getSize().getHeight();
+
+ grid.getCell(0, 0).click();
+
+ grid = $(LegacyGridElement.class).first();
+ int valoHeight = grid.getRow(0).getSize().getHeight();
+
+ Assert.assertTrue(
+ "Row height should increase when changing from Reindeer to Valo",
+ valoHeight > reindeerHeight);
+ }
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridThemeUITest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridThemeUITest.java index f1d76b0e32..c264d9ab3d 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridThemeUITest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridThemeUITest.java @@ -1,114 +1,114 @@ -/* - * 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.tests.components.grid; - -import org.junit.Test; -import org.openqa.selenium.By; -import org.openqa.selenium.Keys; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.interactions.Actions; - -import com.vaadin.testbench.elements.ButtonElement; -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.testbench.elements.GridElement.GridCellElement; -import com.vaadin.testbench.elements.GridElement.GridEditorElement; -import com.vaadin.testbench.elements.NativeSelectElement; -import com.vaadin.testbench.elements.TextFieldElement; -import com.vaadin.testbench.parallel.TestCategory; -import com.vaadin.tests.legacyelements.LegacyDateFieldElement; -import com.vaadin.tests.tb3.MultiBrowserThemeTest; - -@TestCategory("grid") -public class GridThemeUITest extends MultiBrowserThemeTest { - - private GridElement grid; - - @Test - public void grid() throws Exception { - openTestURL(); - selectPage("Editor"); - compareScreen("basic"); - } - - @Test - public void headerAndFooter() throws Exception { - openTestURL(); - selectPage("HeaderFooter"); - compareScreen("basic"); - grid.getHeaderCell(0, 6).$(ButtonElement.class).first().click(); - compareScreen("additional-header"); - grid.getHeaderCell(2, 1).click(); - compareScreen("sorted-last-name"); - grid.getHeaderCell(2, 4).click(); - compareScreen("sorted-age"); - } - - @Test - public void editor() throws Exception { - openTestURL(); - selectPage("Editor"); - GridCellElement ritaBirthdate = grid.getCell(2, 3); - // Open editor row - openEditor(ritaBirthdate); - - compareScreen("initial"); - - GridEditorElement editor = grid.getEditor(); - - LegacyDateFieldElement dateField = editor - .$(LegacyDateFieldElement.class).first(); - WebElement input = dateField.findElement(By.xpath("input")); - input.sendKeys("Invalid", Keys.TAB); - editor.save(); - compareScreen("one-invalid"); - - TextFieldElement age = editor.$(TextFieldElement.class).caption("Age") - .first(); - age.sendKeys("abc", Keys.TAB); - if (age.getValue().equals("21")) { - // Yes IE8, really type into the field - age.sendKeys("abc", Keys.TAB); - } - editor.save(); - - compareScreen("two-invalid"); - } - - private void openEditor(GridCellElement targetCell) { - new Actions(getDriver()).doubleClick(targetCell).perform(); - try { - if (grid.getEditor().isDisplayed()) { - return; - } - } catch (Exception e) { - - } - - // Try again if IE happen to fail.. - new Actions(getDriver()).doubleClick(targetCell).perform(); - } - - /** - * @since - * @param string - */ - private void selectPage(String string) { - $(NativeSelectElement.class).id("page").selectByText(string); - grid = $(GridElement.class).first(); - - } - -} +/*
+ * 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.tests.components.grid;
+
+import org.junit.Test;
+import org.openqa.selenium.By;
+import org.openqa.selenium.Keys;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.interactions.Actions;
+
+import com.vaadin.testbench.elements.ButtonElement;
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.elements.GridElement.GridCellElement;
+import com.vaadin.testbench.elements.GridElement.GridEditorElement;
+import com.vaadin.testbench.elements.NativeSelectElement;
+import com.vaadin.testbench.elements.TextFieldElement;
+import com.vaadin.testbench.parallel.TestCategory;
+import com.vaadin.tests.legacyelements.LegacyDateFieldElement;
+import com.vaadin.tests.tb3.MultiBrowserThemeTest;
+
+@TestCategory("grid")
+public class GridThemeUITest extends MultiBrowserThemeTest {
+
+ private GridElement grid;
+
+ @Test
+ public void grid() throws Exception {
+ openTestURL();
+ selectPage("Editor");
+ compareScreen("basic");
+ }
+
+ @Test
+ public void headerAndFooter() throws Exception {
+ openTestURL();
+ selectPage("HeaderFooter");
+ compareScreen("basic");
+ grid.getHeaderCell(0, 6).$(ButtonElement.class).first().click();
+ compareScreen("additional-header");
+ grid.getHeaderCell(2, 1).click();
+ compareScreen("sorted-last-name");
+ grid.getHeaderCell(2, 4).click();
+ compareScreen("sorted-age");
+ }
+
+ @Test
+ public void editor() throws Exception {
+ openTestURL();
+ selectPage("Editor");
+ GridCellElement ritaBirthdate = grid.getCell(2, 3);
+ // Open editor row
+ openEditor(ritaBirthdate);
+
+ compareScreen("initial");
+
+ GridEditorElement editor = grid.getEditor();
+
+ LegacyDateFieldElement dateField = editor
+ .$(LegacyDateFieldElement.class).first();
+ WebElement input = dateField.findElement(By.xpath("input"));
+ input.sendKeys("Invalid", Keys.TAB);
+ editor.save();
+ compareScreen("one-invalid");
+
+ TextFieldElement age = editor.$(TextFieldElement.class).caption("Age")
+ .first();
+ age.sendKeys("abc", Keys.TAB);
+ if (age.getValue().equals("21")) {
+ // Yes IE8, really type into the field
+ age.sendKeys("abc", Keys.TAB);
+ }
+ editor.save();
+
+ compareScreen("two-invalid");
+ }
+
+ private void openEditor(GridCellElement targetCell) {
+ new Actions(getDriver()).doubleClick(targetCell).perform();
+ try {
+ if (grid.getEditor().isDisplayed()) {
+ return;
+ }
+ } catch (Exception e) {
+
+ }
+
+ // Try again if IE happen to fail..
+ new Actions(getDriver()).doubleClick(targetCell).perform();
+ }
+
+ /**
+ * @since
+ * @param string
+ */
+ private void selectPage(String string) {
+ $(NativeSelectElement.class).id("page").selectByText(string);
+ grid = $(LegacyGridElement.class).first();
+
+ }
+
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridWidthIncreaseTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridWidthIncreaseTest.java index d9ecae9a54..c36b8927aa 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridWidthIncreaseTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridWidthIncreaseTest.java @@ -1,70 +1,70 @@ -/* - * 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.tests.components.grid; - -import static org.junit.Assert.assertEquals; - -import java.io.IOException; - -import org.junit.Test; -import org.openqa.selenium.remote.DesiredCapabilities; - -import com.vaadin.testbench.elements.ButtonElement; -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.testbench.parallel.BrowserUtil; -import com.vaadin.testbench.parallel.TestCategory; -import com.vaadin.tests.tb3.MultiBrowserTest; - -@TestCategory("grid") -public class GridWidthIncreaseTest extends MultiBrowserTest { - - private static int INCREASE_COUNT = 3; - - @Test - public void testColumnsExpandWithGrid() throws IOException { - openTestURL(); - - GridElement grid = $(GridElement.class).first(); - - double accuracy = 1.0d; - DesiredCapabilities cap = getDesiredCapabilities(); - if (BrowserUtil.isIE(cap, 8) || BrowserUtil.isIE(cap, 9) - || BrowserUtil.isPhantomJS(cap)) { - accuracy = 2.0d; - } - - for (int i = 0; i < INCREASE_COUNT; ++i) { - $(ButtonElement.class).first().click(); - int prevWidth = 0; - for (int c = 0; c < GridWidthIncrease.COLUMN_COUNT; ++c) { - int width = grid.getCell(0, c).getSize().getWidth(); - if (c > 0) { - // check that columns are roughly the same width. - assertEquals("Difference in column widths", prevWidth, - width, accuracy); - } - prevWidth = width; - } - /* - * Column widths should be the same as table wrapper size. Since - * Selenium doesn't support subpixels correctly, we use a rough - * estimation. - */ - assertEquals(grid.getRow(0).getSize().getWidth(), - grid.getTableWrapper().getSize().getWidth(), accuracy); - } - } -} +/*
+ * 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.tests.components.grid;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+
+import org.junit.Test;
+import org.openqa.selenium.remote.DesiredCapabilities;
+
+import com.vaadin.testbench.elements.ButtonElement;
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.parallel.BrowserUtil;
+import com.vaadin.testbench.parallel.TestCategory;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+@TestCategory("grid")
+public class GridWidthIncreaseTest extends MultiBrowserTest {
+
+ private static int INCREASE_COUNT = 3;
+
+ @Test
+ public void testColumnsExpandWithGrid() throws IOException {
+ openTestURL();
+
+ GridElement grid = $(LegacyGridElement.class).first();
+
+ double accuracy = 1.0d;
+ DesiredCapabilities cap = getDesiredCapabilities();
+ if (BrowserUtil.isIE(cap, 8) || BrowserUtil.isIE(cap, 9)
+ || BrowserUtil.isPhantomJS(cap)) {
+ accuracy = 2.0d;
+ }
+
+ for (int i = 0; i < INCREASE_COUNT; ++i) {
+ $(ButtonElement.class).first().click();
+ int prevWidth = 0;
+ for (int c = 0; c < GridWidthIncrease.COLUMN_COUNT; ++c) {
+ int width = grid.getCell(0, c).getSize().getWidth();
+ if (c > 0) {
+ // check that columns are roughly the same width.
+ assertEquals("Difference in column widths", prevWidth,
+ width, accuracy);
+ }
+ prevWidth = width;
+ }
+ /*
+ * Column widths should be the same as table wrapper size. Since
+ * Selenium doesn't support subpixels correctly, we use a rough
+ * estimation.
+ */
+ assertEquals(grid.getRow(0).getSize().getWidth(),
+ grid.getTableWrapper().getSize().getWidth(), accuracy);
+ }
+ }
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridWithBrokenRendererTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridWithBrokenRendererTest.java index 952a8d2249..4e298047bf 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridWithBrokenRendererTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridWithBrokenRendererTest.java @@ -1,41 +1,41 @@ -/* - * 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.tests.components.grid; - -import org.junit.Assert; -import org.junit.Test; - -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.tests.tb3.SingleBrowserTest; - -public class GridWithBrokenRendererTest extends SingleBrowserTest { - - @Test - public void ensureRendered() { - openTestURL(); - GridElement grid = $(GridElement.class).first(); - assertRow(grid, 0, "FI", "", "Finland"); - assertRow(grid, 1, "SE", "", "Sweden"); - } - - private void assertRow(GridElement grid, int row, String... texts) { - for (int column = 0; column < texts.length; column++) { - Assert.assertEquals("Cell " + row + "," + column, texts[column], - grid.getCell(row, column).getText()); - } - - } -} +/*
+ * 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.tests.components.grid;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.tests.tb3.SingleBrowserTest;
+
+public class GridWithBrokenRendererTest extends SingleBrowserTest {
+
+ @Test
+ public void ensureRendered() {
+ openTestURL();
+ GridElement grid = $(LegacyGridElement.class).first();
+ assertRow(grid, 0, "FI", "", "Finland");
+ assertRow(grid, 1, "SE", "", "Sweden");
+ }
+
+ private void assertRow(GridElement grid, int row, String... texts) {
+ for (int column = 0; column < texts.length; column++) {
+ Assert.assertEquals("Cell " + row + "," + column, texts[column],
+ grid.getCell(row, column).getText());
+ }
+
+ }
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridWithLabelEditorTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridWithLabelEditorTest.java index 6d47c3f950..0202937739 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridWithLabelEditorTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridWithLabelEditorTest.java @@ -1,37 +1,37 @@ -/* - * 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.tests.components.grid; - -import static org.junit.Assert.assertEquals; - -import org.junit.Test; - -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.tests.tb3.SingleBrowserTest; - -public class GridWithLabelEditorTest extends SingleBrowserTest { - - @Test - public void testNoExceptionOnEdit() { - setDebug(true); - openTestURL(); - - assertNoErrorNotifications(); - - assertEquals("LabelEditor content not correct.", "FooFoo", - $(GridElement.class).first().getEditor().getField(0).getText()); - } -} +/*
+ * 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.tests.components.grid;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.tests.tb3.SingleBrowserTest;
+
+public class GridWithLabelEditorTest extends SingleBrowserTest {
+
+ @Test
+ public void testNoExceptionOnEdit() {
+ setDebug(true);
+ openTestURL();
+
+ assertNoErrorNotifications();
+
+ assertEquals("LabelEditor content not correct.", "FooFoo",
+ $(LegacyGridElement.class).first().getEditor().getField(0).getText());
+ }
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/InitialFrozenColumnsTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/InitialFrozenColumnsTest.java index 0e72597c12..ff44ddf41d 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/InitialFrozenColumnsTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/InitialFrozenColumnsTest.java @@ -1,42 +1,42 @@ -/* - * 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.tests.components.grid; - -import static org.junit.Assert.assertTrue; - -import org.junit.Assert; -import org.junit.Test; -import org.openqa.selenium.WebElement; - -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.testbench.elements.NotificationElement; -import com.vaadin.testbench.parallel.TestCategory; -import com.vaadin.tests.tb3.MultiBrowserTest; - -@TestCategory("grid") -public class InitialFrozenColumnsTest extends MultiBrowserTest { - @Test - public void testInitialFrozenColumns() { - setDebug(true); - openTestURL(); - - Assert.assertFalse("Notification was present", - isElementPresent(NotificationElement.class)); - - WebElement cell = $(GridElement.class).first().getCell(0, 0); - assertTrue(cell.getAttribute("class").contains("frozen")); - } -} +/*
+ * 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.tests.components.grid;
+
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.openqa.selenium.WebElement;
+
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.elements.NotificationElement;
+import com.vaadin.testbench.parallel.TestCategory;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+@TestCategory("grid")
+public class InitialFrozenColumnsTest extends MultiBrowserTest {
+ @Test
+ public void testInitialFrozenColumns() {
+ setDebug(true);
+ openTestURL();
+
+ Assert.assertFalse("Notification was present",
+ isElementPresent(NotificationElement.class));
+
+ WebElement cell = $(LegacyGridElement.class).first().getCell(0, 0);
+ assertTrue(cell.getAttribute("class").contains("frozen"));
+ }
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/JavaScriptRenderersTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/JavaScriptRenderersTest.java index 2cfb65d7ad..f2f5eb4e60 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/JavaScriptRenderersTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/JavaScriptRenderersTest.java @@ -1,52 +1,52 @@ -/* - * 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.tests.components.grid; - -import org.junit.Assert; -import org.junit.Test; - -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.testbench.elements.GridElement.GridCellElement; -import com.vaadin.testbench.parallel.TestCategory; -import com.vaadin.tests.tb3.MultiBrowserTest; - -@TestCategory("grid") -public class JavaScriptRenderersTest extends MultiBrowserTest { - - @Test - public void testJavaScriptRenderer() { - setDebug(true); - openTestURL(); - - GridElement grid = $(GridElement.class).first(); - GridCellElement cell_1_1 = grid.getCell(1, 1); - - GridCellElement cell_2_2 = grid.getCell(2, 2); - - // Verify render functionality - Assert.assertEquals("Bean(2, 0)", cell_1_1.getText()); - - Assert.assertEquals("string2", cell_2_2.getText()); - - // Verify init functionality - Assert.assertEquals("1", cell_1_1.getAttribute("column")); - - // Verify onbrowserevent - cell_1_1.click(); - Assert.assertTrue( - cell_1_1.getText().startsWith("Clicked 1 with key 2 at")); - } -} +/*
+ * 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.tests.components.grid;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.elements.GridElement.GridCellElement;
+import com.vaadin.testbench.parallel.TestCategory;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+@TestCategory("grid")
+public class JavaScriptRenderersTest extends MultiBrowserTest {
+
+ @Test
+ public void testJavaScriptRenderer() {
+ setDebug(true);
+ openTestURL();
+
+ GridElement grid = $(LegacyGridElement.class).first();
+ GridCellElement cell_1_1 = grid.getCell(1, 1);
+
+ GridCellElement cell_2_2 = grid.getCell(2, 2);
+
+ // Verify render functionality
+ Assert.assertEquals("Bean(2, 0)", cell_1_1.getText());
+
+ Assert.assertEquals("string2", cell_2_2.getText());
+
+ // Verify init functionality
+ Assert.assertEquals("1", cell_1_1.getAttribute("column"));
+
+ // Verify onbrowserevent
+ cell_1_1.click();
+ Assert.assertTrue(
+ cell_1_1.getText().startsWith("Clicked 1 with key 2 at"));
+ }
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/LegacyGridElement.java b/uitest/src/test/java/com/vaadin/tests/components/grid/LegacyGridElement.java new file mode 100644 index 0000000000..95b6a78635 --- /dev/null +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/LegacyGridElement.java @@ -0,0 +1,31 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * 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.tests.components.grid; + +import com.vaadin.testbench.elements.GridElement; +import com.vaadin.testbench.elementsbase.ServerClass; + +/** + * TestBench Element API for Grid + * + * @since + * + * @author Vaadin Ltd + * TODO move to TestBench + */ +@ServerClass("com.vaadin.ui.LegacyGrid") +public class LegacyGridElement extends GridElement{ +} diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/NullHeadersTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/NullHeadersTest.java index 5e8a8c60c8..13e726cda5 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/NullHeadersTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/NullHeadersTest.java @@ -1,49 +1,49 @@ -/* - * 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.tests.components.grid; - -import org.junit.Assert; -import org.junit.Test; - -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.tests.tb3.SingleBrowserTest; - -public class NullHeadersTest extends SingleBrowserTest { - - @Test - public void gridWithNullHeadersShouldBeRendered() { - openTestURL(); - - GridElement grid = $(GridElement.class).first(); - - Assert.assertEquals(1, grid.getHeaderCount()); - Assert.assertEquals(3, grid.getHeaderCells(0).size()); - for (int i = 0; i < 3; i++) { - Assert.assertEquals("", grid.getHeaderCell(0, 0).getText()); - } - assertRow(grid, 0, "Finland", "foo", "1"); - assertRow(grid, 1, "Swaziland", "bar", "2"); - assertRow(grid, 2, "Japan", "baz", "3"); - } - - private void assertRow(GridElement grid, int row, String... contents) { - for (int col = 0; col < contents.length; col++) { - Assert.assertEquals(contents[col], - grid.getCell(row, col).getText()); - } - - } -} +/*
+ * 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.tests.components.grid;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.tests.tb3.SingleBrowserTest;
+
+public class NullHeadersTest extends SingleBrowserTest {
+
+ @Test
+ public void gridWithNullHeadersShouldBeRendered() {
+ openTestURL();
+
+ GridElement grid = $(LegacyGridElement.class).first();
+
+ Assert.assertEquals(1, grid.getHeaderCount());
+ Assert.assertEquals(3, grid.getHeaderCells(0).size());
+ for (int i = 0; i < 3; i++) {
+ Assert.assertEquals("", grid.getHeaderCell(0, 0).getText());
+ }
+ assertRow(grid, 0, "Finland", "foo", "1");
+ assertRow(grid, 1, "Swaziland", "bar", "2");
+ assertRow(grid, 2, "Japan", "baz", "3");
+ }
+
+ private void assertRow(GridElement grid, int row, String... contents) {
+ for (int col = 0; col < contents.length; col++) {
+ Assert.assertEquals(contents[col],
+ grid.getCell(row, col).getText());
+ }
+
+ }
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/NullRenderersTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/NullRenderersTest.java index b6e4e96c3e..dcf2a95d36 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/NullRenderersTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/NullRenderersTest.java @@ -1,65 +1,65 @@ -/* - * 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.tests.components.grid; - -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.testbench.elements.LabelElement; -import com.vaadin.testbench.parallel.TestCategory; -import com.vaadin.tests.tb3.MultiBrowserTest; -import org.junit.Test; - -import java.util.List; - -import static org.junit.Assert.assertEquals; - -@TestCategory("grid") -public class NullRenderersTest extends MultiBrowserTest { - @Test - public void testDefaults() throws Exception { - openTestURL(); - - GridElement grid = findGridWithDefaults(); - assertEquals("-- No Text --", grid.getCell(0, 0).getText()); - assertEquals("-- No Jokes --", grid.getCell(0, 1).getText()); - assertEquals("-- Never --", grid.getCell(0, 2).getText()); - assertEquals("-- Nothing --", grid.getCell(0, 3).getText()); - assertEquals("-- No Control --", grid.getCell(0, 5).getText()); - } - - @Test - public void testNoDefaults() throws Exception { - openTestURL(); - - GridElement grid = findGridNoDefaults(); - assertEquals("", grid.getCell(0, 0).getText()); - assertEquals("", grid.getCell(0, 1).getText()); - assertEquals("", grid.getCell(0, 2).getText()); - assertEquals("", grid.getCell(0, 3).getText()); - assertEquals("", grid.getCell(0, 5).getText()); - } - - private GridElement findGridWithDefaults() { - return $(GridElement.class).id("test-grid-defaults"); - } - - private GridElement findGridNoDefaults() { - return $(GridElement.class).id("test-grid"); - } - - private LabelElement findDebugLabel() { - return $(LabelElement.class).id(CustomRenderer.DEBUG_LABEL_ID); - } -} +/*
+ * 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.tests.components.grid;
+
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.elements.LabelElement;
+import com.vaadin.testbench.parallel.TestCategory;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+import org.junit.Test;
+
+import java.util.List;
+
+import static org.junit.Assert.assertEquals;
+
+@TestCategory("grid")
+public class NullRenderersTest extends MultiBrowserTest {
+ @Test
+ public void testDefaults() throws Exception {
+ openTestURL();
+
+ GridElement grid = findGridWithDefaults();
+ assertEquals("-- No Text --", grid.getCell(0, 0).getText());
+ assertEquals("-- No Jokes --", grid.getCell(0, 1).getText());
+ assertEquals("-- Never --", grid.getCell(0, 2).getText());
+ assertEquals("-- Nothing --", grid.getCell(0, 3).getText());
+ assertEquals("-- No Control --", grid.getCell(0, 5).getText());
+ }
+
+ @Test
+ public void testNoDefaults() throws Exception {
+ openTestURL();
+
+ GridElement grid = findGridNoDefaults();
+ assertEquals("", grid.getCell(0, 0).getText());
+ assertEquals("", grid.getCell(0, 1).getText());
+ assertEquals("", grid.getCell(0, 2).getText());
+ assertEquals("", grid.getCell(0, 3).getText());
+ assertEquals("", grid.getCell(0, 5).getText());
+ }
+
+ private GridElement findGridWithDefaults() {
+ return $(LegacyGridElement.class).id("test-grid-defaults");
+ }
+
+ private GridElement findGridNoDefaults() {
+ return $(LegacyGridElement.class).id("test-grid");
+ }
+
+ private LabelElement findDebugLabel() {
+ return $(LabelElement.class).id(CustomRenderer.DEBUG_LABEL_ID);
+ }
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/ProgrammaticEditorControlTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/ProgrammaticEditorControlTest.java index 94583bc9d6..4716f20ce1 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/ProgrammaticEditorControlTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/ProgrammaticEditorControlTest.java @@ -1,64 +1,64 @@ -/* - * 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.tests.components.grid; - -import org.junit.Assert; -import org.junit.Test; - -import com.vaadin.testbench.elements.ButtonElement; -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.testbench.elements.TextFieldElement; -import com.vaadin.testbench.parallel.TestCategory; -import com.vaadin.tests.tb3.SingleBrowserTest; - -@TestCategory("grid") -public class ProgrammaticEditorControlTest extends SingleBrowserTest { - - @Test - public void multipleOpenFromServerSide() { - openTestURL(); - GridElement grid = $(GridElement.class).first(); - ButtonElement editButton = $(ButtonElement.class).caption("Edit") - .first(); - ButtonElement cancelButton = $(ButtonElement.class).caption("Cancel") - .first(); - - editButton.click(); - assertEditorFieldContents(grid, "test"); - cancelButton.click(); - - assertEditorNotPresent(grid); - - editButton.click(); - assertEditorFieldContents(grid, "test"); - } - - private void assertEditorFieldContents(GridElement grid, String text) { - TextFieldElement editorField = wrap(TextFieldElement.class, - grid.getEditor().getField(0)); - Assert.assertEquals(text, editorField.getValue()); - } - - private void assertEditorNotPresent(GridElement grid) { - try { - grid.getEditor(); - Assert.fail("Editor should not be present"); - } catch (Exception e) { - - } - } - +/*
+ * 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.tests.components.grid;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import com.vaadin.testbench.elements.ButtonElement;
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.elements.TextFieldElement;
+import com.vaadin.testbench.parallel.TestCategory;
+import com.vaadin.tests.tb3.SingleBrowserTest;
+
+@TestCategory("grid")
+public class ProgrammaticEditorControlTest extends SingleBrowserTest {
+
+ @Test
+ public void multipleOpenFromServerSide() {
+ openTestURL();
+ GridElement grid = $(LegacyGridElement.class).first();
+ ButtonElement editButton = $(ButtonElement.class).caption("Edit")
+ .first();
+ ButtonElement cancelButton = $(ButtonElement.class).caption("Cancel")
+ .first();
+
+ editButton.click();
+ assertEditorFieldContents(grid, "test");
+ cancelButton.click();
+
+ assertEditorNotPresent(grid);
+
+ editButton.click();
+ assertEditorFieldContents(grid, "test");
+ }
+
+ private void assertEditorFieldContents(GridElement grid, String text) {
+ TextFieldElement editorField = wrap(TextFieldElement.class,
+ grid.getEditor().getField(0));
+ Assert.assertEquals(text, editorField.getValue());
+ }
+
+ private void assertEditorNotPresent(GridElement grid) {
+ try {
+ grid.getEditor();
+ Assert.fail("Editor should not be present");
+ } catch (Exception e) {
+
+ }
+ }
+
}
\ No newline at end of file diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/SelectDuringInitTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/SelectDuringInitTest.java index 79cdb53894..ce5db1b3d7 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/SelectDuringInitTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/SelectDuringInitTest.java @@ -1,37 +1,37 @@ -/* - * 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.tests.components.grid; - -import org.junit.Assert; -import org.junit.Test; - -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.testbench.parallel.TestCategory; -import com.vaadin.tests.tb3.SingleBrowserTest; - -@TestCategory("grid") -public class SelectDuringInitTest extends SingleBrowserTest { - - @Test - public void testSelectDuringInit() { - openTestURL(); - - GridElement grid = $(GridElement.class).first(); - - Assert.assertTrue(grid.getRow(1).isSelected()); - } - -} +/*
+ * 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.tests.components.grid;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.parallel.TestCategory;
+import com.vaadin.tests.tb3.SingleBrowserTest;
+
+@TestCategory("grid")
+public class SelectDuringInitTest extends SingleBrowserTest {
+
+ @Test
+ public void testSelectDuringInit() {
+ openTestURL();
+
+ GridElement grid = $(LegacyGridElement.class).first();
+
+ Assert.assertTrue(grid.getRow(1).isSelected());
+ }
+
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/SortableHeaderStylesTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/SortableHeaderStylesTest.java index dd3a1feb26..0702eff943 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/SortableHeaderStylesTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/SortableHeaderStylesTest.java @@ -1,51 +1,51 @@ -/* - * 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.tests.components.grid; - -import org.junit.Assert; -import org.junit.Test; - -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.testbench.elements.OptionGroupElement; -import com.vaadin.tests.tb3.SingleBrowserTest; - -public class SortableHeaderStylesTest extends SingleBrowserTest { - @Test - public void testSortableHeaderStyles() { - openTestURL(); - - Assert.assertFalse(hasSortableStyle(0)); - for (int i = 1; i < 8; i++) { - Assert.assertTrue(hasSortableStyle(i)); - } - - OptionGroupElement sortableSelector = $(OptionGroupElement.class) - .first(); - - // Toggle sortability - sortableSelector.selectByText("lastName"); - Assert.assertFalse(hasSortableStyle(3)); - - // Toggle back - sortableSelector.selectByText("lastName"); - Assert.assertTrue(hasSortableStyle(3)); - } - - private boolean hasSortableStyle(int column) { - return $(GridElement.class).first().getHeaderCell(0, column) - .getAttribute("class").contains("sortable"); - } -} +/*
+ * 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.tests.components.grid;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.elements.OptionGroupElement;
+import com.vaadin.tests.tb3.SingleBrowserTest;
+
+public class SortableHeaderStylesTest extends SingleBrowserTest {
+ @Test
+ public void testSortableHeaderStyles() {
+ openTestURL();
+
+ Assert.assertFalse(hasSortableStyle(0));
+ for (int i = 1; i < 8; i++) {
+ Assert.assertTrue(hasSortableStyle(i));
+ }
+
+ OptionGroupElement sortableSelector = $(OptionGroupElement.class)
+ .first();
+
+ // Toggle sortability
+ sortableSelector.selectByText("lastName");
+ Assert.assertFalse(hasSortableStyle(3));
+
+ // Toggle back
+ sortableSelector.selectByText("lastName");
+ Assert.assertTrue(hasSortableStyle(3));
+ }
+
+ private boolean hasSortableStyle(int column) {
+ return $(LegacyGridElement.class).first().getHeaderCell(0, column)
+ .getAttribute("class").contains("sortable");
+ }
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/WidgetRenderersTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/WidgetRenderersTest.java index f44e4adbd5..79deff513d 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/WidgetRenderersTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/WidgetRenderersTest.java @@ -1,167 +1,167 @@ -/* - * 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.tests.components.grid; - -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertTrue; - -import org.junit.Test; -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.interactions.Actions; -import org.openqa.selenium.support.ui.ExpectedCondition; - -import com.vaadin.testbench.By; -import com.vaadin.testbench.elements.ButtonElement; -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.testbench.elements.GridElement.GridCellElement; -import com.vaadin.testbench.elements.NotificationElement; -import com.vaadin.testbench.parallel.TestCategory; -import com.vaadin.tests.tb3.MultiBrowserTest; - -/** - * TB tests for the various builtin widget-based renderers. - * - * @since - * @author Vaadin Ltd - */ -@TestCategory("grid") -public class WidgetRenderersTest extends MultiBrowserTest { - - @Override - public void setup() throws Exception { - super.setup(); - - openTestURL(); - } - - @Test - public void testProgressBarRenderer() { - assertTrue(getGridCell(0, 0) - .isElementPresent(By.className("v-progressbar"))); - } - - @Test - public void testButtonRenderer() { - WebElement button = getGridCell(0, 1) - .findElement(By.className("v-nativebutton")); - - button.click(); - - waitUntilTextUpdated(button, "Clicked!"); - } - - @Test - public void testButtonRendererAfterCellBeingFocused() { - GridCellElement buttonCell = getGridCell(0, 1); - assertFalse("cell should not be focused before focusing", - buttonCell.isFocused()); - - // avoid clicking on the button - buttonCell.click(buttonCell.getSize().getWidth() - 10, 5); - assertTrue("cell should be focused after focusing", - buttonCell.isFocused()); - - WebElement button = buttonCell - .findElement(By.className("v-nativebutton")); - assertNotEquals("Button should not be clicked before click", "Clicked!", - button.getText()); - - new Actions(getDriver()).moveToElement(button).click().perform(); - - waitUntilTextUpdated(button, "Clicked!"); - } - - @Test - public void testImageRenderer() { - final WebElement image = getGridCell(0, 2) - .findElement(By.className("gwt-Image")); - - waitUntilmageSrcEndsWith(image, "window/img/close.png"); - - image.click(); - - waitUntilmageSrcEndsWith(image, "window/img/maximize.png"); - } - - private void waitUntilmageSrcEndsWith(final WebElement image, - final String expectedText) { - waitUntil(new ExpectedCondition<Boolean>() { - - @Override - public Boolean apply(WebDriver input) { - return image.getAttribute("src").endsWith(expectedText); - } - - @Override - public String toString() { - // Timed out after 10 seconds waiting for ... - return String.format( - "image source to update. Supposed to end with '%s' (was: '%s').", - expectedText, image.getAttribute("src")); - } - }); - } - - @Test - public void testColumnReorder() { - $(ButtonElement.class).caption("Change column order").first().click(); - - assertFalse("Notification was present", - isElementPresent(NotificationElement.class)); - - assertTrue( - getGridCell(0, 0).isElementPresent(By.className("gwt-Image"))); - assertTrue(getGridCell(0, 1) - .isElementPresent(By.className("v-progressbar"))); - assertTrue(getGridCell(0, 2) - .isElementPresent(By.className("v-nativebutton"))); - } - - @Test - public void testPropertyIdInEvent() { - WebElement button = getGridCell(0, 3) - .findElement(By.className("v-nativebutton")); - - button.click(); - - waitUntilTextUpdated(button, WidgetRenderers.PROPERTY_ID); - } - - GridCellElement getGridCell(int row, int col) { - return $(GridElement.class).first().getCell(row, col); - } - - private void waitUntilTextUpdated(final WebElement button, - final String expectedText) { - waitUntil(new ExpectedCondition<Boolean>() { - - @Override - public Boolean apply(WebDriver input) { - return button.getText().equals(expectedText); - } - - @Override - public String toString() { - // Timed out after 10 seconds waiting for ... - return String.format("button's text to become '%s' (was: '').", - expectedText, button.getText()); - } - - }); - } -} +/*
+ * 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.tests.components.grid;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.interactions.Actions;
+import org.openqa.selenium.support.ui.ExpectedCondition;
+
+import com.vaadin.testbench.By;
+import com.vaadin.testbench.elements.ButtonElement;
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.elements.GridElement.GridCellElement;
+import com.vaadin.testbench.elements.NotificationElement;
+import com.vaadin.testbench.parallel.TestCategory;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+/**
+ * TB tests for the various builtin widget-based renderers.
+ *
+ * @since
+ * @author Vaadin Ltd
+ */
+@TestCategory("grid")
+public class WidgetRenderersTest extends MultiBrowserTest {
+
+ @Override
+ public void setup() throws Exception {
+ super.setup();
+
+ openTestURL();
+ }
+
+ @Test
+ public void testProgressBarRenderer() {
+ assertTrue(getGridCell(0, 0)
+ .isElementPresent(By.className("v-progressbar")));
+ }
+
+ @Test
+ public void testButtonRenderer() {
+ WebElement button = getGridCell(0, 1)
+ .findElement(By.className("v-nativebutton"));
+
+ button.click();
+
+ waitUntilTextUpdated(button, "Clicked!");
+ }
+
+ @Test
+ public void testButtonRendererAfterCellBeingFocused() {
+ GridCellElement buttonCell = getGridCell(0, 1);
+ assertFalse("cell should not be focused before focusing",
+ buttonCell.isFocused());
+
+ // avoid clicking on the button
+ buttonCell.click(buttonCell.getSize().getWidth() - 10, 5);
+ assertTrue("cell should be focused after focusing",
+ buttonCell.isFocused());
+
+ WebElement button = buttonCell
+ .findElement(By.className("v-nativebutton"));
+ assertNotEquals("Button should not be clicked before click", "Clicked!",
+ button.getText());
+
+ new Actions(getDriver()).moveToElement(button).click().perform();
+
+ waitUntilTextUpdated(button, "Clicked!");
+ }
+
+ @Test
+ public void testImageRenderer() {
+ final WebElement image = getGridCell(0, 2)
+ .findElement(By.className("gwt-Image"));
+
+ waitUntilmageSrcEndsWith(image, "window/img/close.png");
+
+ image.click();
+
+ waitUntilmageSrcEndsWith(image, "window/img/maximize.png");
+ }
+
+ private void waitUntilmageSrcEndsWith(final WebElement image,
+ final String expectedText) {
+ waitUntil(new ExpectedCondition<Boolean>() {
+
+ @Override
+ public Boolean apply(WebDriver input) {
+ return image.getAttribute("src").endsWith(expectedText);
+ }
+
+ @Override
+ public String toString() {
+ // Timed out after 10 seconds waiting for ...
+ return String.format(
+ "image source to update. Supposed to end with '%s' (was: '%s').",
+ expectedText, image.getAttribute("src"));
+ }
+ });
+ }
+
+ @Test
+ public void testColumnReorder() {
+ $(ButtonElement.class).caption("Change column order").first().click();
+
+ assertFalse("Notification was present",
+ isElementPresent(NotificationElement.class));
+
+ assertTrue(
+ getGridCell(0, 0).isElementPresent(By.className("gwt-Image")));
+ assertTrue(getGridCell(0, 1)
+ .isElementPresent(By.className("v-progressbar")));
+ assertTrue(getGridCell(0, 2)
+ .isElementPresent(By.className("v-nativebutton")));
+ }
+
+ @Test
+ public void testPropertyIdInEvent() {
+ WebElement button = getGridCell(0, 3)
+ .findElement(By.className("v-nativebutton"));
+
+ button.click();
+
+ waitUntilTextUpdated(button, WidgetRenderers.PROPERTY_ID);
+ }
+
+ GridCellElement getGridCell(int row, int col) {
+ return $(LegacyGridElement.class).first().getCell(row, col);
+ }
+
+ private void waitUntilTextUpdated(final WebElement button,
+ final String expectedText) {
+ waitUntil(new ExpectedCondition<Boolean>() {
+
+ @Override
+ public Boolean apply(WebDriver input) {
+ return button.getText().equals(expectedText);
+ }
+
+ @Override
+ public String toString() {
+ // Timed out after 10 seconds waiting for ...
+ return String.format("button's text to become '%s' (was: '').",
+ expectedText, button.getText());
+ }
+
+ });
+ }
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/basicfeatures/GridHeightByRowOnInitTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/basicfeatures/GridHeightByRowOnInitTest.java index 94e16f537c..491c878ed0 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/basicfeatures/GridHeightByRowOnInitTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/basicfeatures/GridHeightByRowOnInitTest.java @@ -1,5 +1,6 @@ package com.vaadin.tests.components.grid.basicfeatures; +import com.vaadin.tests.components.grid.LegacyGridElement; import org.junit.Test; import com.vaadin.testbench.elements.GridElement; @@ -13,7 +14,7 @@ public class GridHeightByRowOnInitTest extends MultiBrowserTest { @Test public void gridHeightIsMoreThanACoupleOfRows() { openTestURL(); - int height = $(GridElement.class).first().getSize().getHeight(); + int height = $(LegacyGridElement.class).first().getSize().getHeight(); assertGreater( "Grid should be much taller than 150px (was " + height + "px)", height, 150); diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/basicfeatures/element/CustomGridElement.java b/uitest/src/test/java/com/vaadin/tests/components/grid/basicfeatures/element/CustomGridElement.java index cebdd75b8e..cc3821c769 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/basicfeatures/element/CustomGridElement.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/basicfeatures/element/CustomGridElement.java @@ -22,7 +22,7 @@ import com.vaadin.testbench.TestBenchElement; import com.vaadin.testbench.elements.GridElement; import com.vaadin.testbench.elementsbase.ServerClass; -@ServerClass("com.vaadin.ui.Grid") +@ServerClass("com.vaadin.ui.LegacyGrid") public class CustomGridElement extends GridElement { /** * Gets the element that contains the details of a row. diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/basicfeatures/server/GridClearContainerTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/basicfeatures/server/GridClearContainerTest.java index c0a17cbd15..f7c579635e 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/basicfeatures/server/GridClearContainerTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/basicfeatures/server/GridClearContainerTest.java @@ -1,51 +1,52 @@ -/* - * 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.tests.components.grid.basicfeatures.server; - -import org.junit.Assert; -import org.junit.Test; - -import com.vaadin.testbench.elements.ButtonElement; -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.testbench.parallel.TestCategory; -import com.vaadin.tests.tb3.MultiBrowserTest; - -/** - * Tests that removing and adding rows doesn't cause an infinite loop in the - * browser. - * - * @author Vaadin Ltd - */ -@TestCategory("grid") -public class GridClearContainerTest extends MultiBrowserTest { - - private final String ERRORNOTE = "Unexpected cell contents."; - - @Test - public void clearAndReadd() { - openTestURL(); - ButtonElement button = $(ButtonElement.class) - .caption("Clear and re-add").first(); - GridElement grid = $(GridElement.class).first(); - Assert.assertEquals(ERRORNOTE, "default", grid.getCell(0, 0).getText()); - Assert.assertEquals(ERRORNOTE, "default", grid.getCell(1, 0).getText()); - button.click(); - Assert.assertEquals(ERRORNOTE, "Updated value 1", - grid.getCell(0, 0).getText()); - Assert.assertEquals(ERRORNOTE, "Updated value 2", - grid.getCell(1, 0).getText()); - } -} +/*
+ * 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.tests.components.grid.basicfeatures.server;
+
+import com.vaadin.tests.components.grid.LegacyGridElement;
+import org.junit.Assert;
+import org.junit.Test;
+
+import com.vaadin.testbench.elements.ButtonElement;
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.parallel.TestCategory;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+/**
+ * Tests that removing and adding rows doesn't cause an infinite loop in the
+ * browser.
+ *
+ * @author Vaadin Ltd
+ */
+@TestCategory("grid")
+public class GridClearContainerTest extends MultiBrowserTest {
+
+ private final String ERRORNOTE = "Unexpected cell contents.";
+
+ @Test
+ public void clearAndReadd() {
+ openTestURL();
+ ButtonElement button = $(ButtonElement.class)
+ .caption("Clear and re-add").first();
+ GridElement grid = $(LegacyGridElement.class).first();
+ Assert.assertEquals(ERRORNOTE, "default", grid.getCell(0, 0).getText());
+ Assert.assertEquals(ERRORNOTE, "default", grid.getCell(1, 0).getText());
+ button.click();
+ Assert.assertEquals(ERRORNOTE, "Updated value 1",
+ grid.getCell(0, 0).getText());
+ Assert.assertEquals(ERRORNOTE, "Updated value 2",
+ grid.getCell(1, 0).getText());
+ }
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/basicfeatures/server/GridScrollTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/basicfeatures/server/GridScrollTest.java index 49566aeb2c..48c94d4b5a 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/basicfeatures/server/GridScrollTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/basicfeatures/server/GridScrollTest.java @@ -1,57 +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.tests.components.grid.basicfeatures.server; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import org.junit.Test; - -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.tests.components.grid.basicfeatures.GridBasicFeaturesTest; - -public class GridScrollTest extends GridBasicFeaturesTest { - - @Test - public void testCorrectItemRequestsOnScroll() { - openTestURL(); - - assertTrue("Initial push from server not found", - getLogRow(1).equals("0. Requested items 0 - 40")); - // Client response varies a bit between browsers as different amount of - // rows is cached. - assertTrue("First row request from client not found", - getLogRow(0).startsWith("1. Requested items 0 - ")); - - selectMenuPath("Component", "Size", "HeightMode Row"); - - selectMenuPath("Settings", "Clear log"); - $(GridElement.class).first().scrollToRow(40); - assertEquals("Log row did not contain expected item request", - "0. Requested items 0 - 86", getLogRow(0)); - assertEquals("There should be only one log row", " ", getLogRow(1)); - selectMenuPath("Settings", "Clear log"); - $(GridElement.class).first().scrollToRow(100); - assertEquals("Log row did not contain expected item request", - "0. Requested items 47 - 146", getLogRow(0)); - assertEquals("There should be only one log row", " ", getLogRow(1)); - selectMenuPath("Settings", "Clear log"); - $(GridElement.class).first().scrollToRow(300); - assertEquals("Log row did not contain expected item request", - "0. Requested items 247 - 346", getLogRow(0)); - assertEquals("There should be only one log row", " ", getLogRow(1)); - } -} +/*
+ * 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.tests.components.grid.basicfeatures.server;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import com.vaadin.tests.components.grid.LegacyGridElement;
+import org.junit.Test;
+
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.tests.components.grid.basicfeatures.GridBasicFeaturesTest;
+
+public class GridScrollTest extends GridBasicFeaturesTest {
+
+ @Test
+ public void testCorrectItemRequestsOnScroll() {
+ openTestURL();
+
+ assertTrue("Initial push from server not found",
+ getLogRow(1).equals("0. Requested items 0 - 40"));
+ // Client response varies a bit between browsers as different amount of
+ // rows is cached.
+ assertTrue("First row request from client not found",
+ getLogRow(0).startsWith("1. Requested items 0 - "));
+
+ selectMenuPath("Component", "Size", "HeightMode Row");
+
+ selectMenuPath("Settings", "Clear log");
+ $(LegacyGridElement.class).first().scrollToRow(40);
+ assertEquals("Log row did not contain expected item request",
+ "0. Requested items 0 - 86", getLogRow(0));
+ assertEquals("There should be only one log row", " ", getLogRow(1));
+ selectMenuPath("Settings", "Clear log");
+ $(LegacyGridElement.class).first().scrollToRow(100);
+ assertEquals("Log row did not contain expected item request",
+ "0. Requested items 47 - 146", getLogRow(0));
+ assertEquals("There should be only one log row", " ", getLogRow(1));
+ selectMenuPath("Settings", "Clear log");
+ $(LegacyGridElement.class).first().scrollToRow(300);
+ assertEquals("Log row did not contain expected item request",
+ "0. Requested items 247 - 346", getLogRow(0));
+ assertEquals("There should be only one log row", " ", getLogRow(1));
+ }
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/basicfeatures/server/GridStructureTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/basicfeatures/server/GridStructureTest.java index e0bfda32d4..7a540abd4b 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/basicfeatures/server/GridStructureTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/basicfeatures/server/GridStructureTest.java @@ -25,6 +25,7 @@ import static org.junit.Assert.fail; import java.util.List; +import com.vaadin.tests.components.grid.LegacyGridElement; import org.junit.Test; import org.openqa.selenium.NoSuchElementException; import org.openqa.selenium.WebElement; @@ -493,7 +494,7 @@ public class GridStructureTest extends GridBasicFeaturesTest { // Wait until page is loaded completely. int count = 0; - while (!$(GridElement.class).exists()) { + while (!$(LegacyGridElement.class).exists()) { if (count == 100) { fail("Reloading page failed"); } diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/basicfeatures/server/LoadingIndicatorTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/basicfeatures/server/LoadingIndicatorTest.java index 64cd0ad561..83b4b4a70d 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/basicfeatures/server/LoadingIndicatorTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/basicfeatures/server/LoadingIndicatorTest.java @@ -1,85 +1,86 @@ -/* - * 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.tests.components.grid.basicfeatures.server; - -import org.junit.Assert; -import org.junit.Test; -import org.openqa.selenium.By; -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.support.ui.ExpectedCondition; -import org.openqa.selenium.support.ui.ExpectedConditions; - -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.tests.components.grid.basicfeatures.GridBasicFeaturesTest; - -public class LoadingIndicatorTest extends GridBasicFeaturesTest { - @Test - public void testLoadingIndicator() throws InterruptedException { - setDebug(true); - openTestURL(); - - selectMenuPath("Component", "State", "Container delay", "2000"); - - GridElement gridElement = $(GridElement.class).first(); - - Assert.assertFalse( - "Loading indicator should not be visible before disabling waitForVaadin", - isLoadingIndicatorVisible()); - - testBench().disableWaitForVaadin(); - - // Scroll to a completely new location - gridElement.getCell(200, 1); - - // Wait for loading indicator delay - waitUntil(ExpectedConditions.visibilityOfElementLocated( - By.className("v-loading-indicator"))); - - waitUntilNot(ExpectedConditions.visibilityOfElementLocated( - By.className("v-loading-indicator"))); - - // Scroll so much that more data gets fetched, but not so much that - // missing rows are shown - gridElement.getCell(230, 1); - - // Wait for potentially triggered loading indicator to become visible - Thread.sleep(500); - - Assert.assertFalse( - "Loading indicator should not be visible when fetching rows that are not visible", - isLoadingIndicatorVisible()); - - // Finally verify that there was actually a request going on - waitUntilLogContains("Requested items"); - } - - private void waitUntilLogContains(final String value) { - waitUntil(new ExpectedCondition<Boolean>() { - @Override - public Boolean apply(WebDriver input) { - return getLogRow(0).contains(value); - } - - @Override - public String toString() { - // Timed out after 10 seconds waiting for ... - return "first log row to contain '" + value + "' (was: '" - + getLogRow(0) + "')"; - } - }); - } - -} +/*
+ * 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.tests.components.grid.basicfeatures.server;
+
+import com.vaadin.tests.components.grid.LegacyGridElement;
+import org.junit.Assert;
+import org.junit.Test;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.support.ui.ExpectedCondition;
+import org.openqa.selenium.support.ui.ExpectedConditions;
+
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.tests.components.grid.basicfeatures.GridBasicFeaturesTest;
+
+public class LoadingIndicatorTest extends GridBasicFeaturesTest {
+ @Test
+ public void testLoadingIndicator() throws InterruptedException {
+ setDebug(true);
+ openTestURL();
+
+ selectMenuPath("Component", "State", "Container delay", "2000");
+
+ GridElement gridElement = $(LegacyGridElement.class).first();
+
+ Assert.assertFalse(
+ "Loading indicator should not be visible before disabling waitForVaadin",
+ isLoadingIndicatorVisible());
+
+ testBench().disableWaitForVaadin();
+
+ // Scroll to a completely new location
+ gridElement.getCell(200, 1);
+
+ // Wait for loading indicator delay
+ waitUntil(ExpectedConditions.visibilityOfElementLocated(
+ By.className("v-loading-indicator")));
+
+ waitUntilNot(ExpectedConditions.visibilityOfElementLocated(
+ By.className("v-loading-indicator")));
+
+ // Scroll so much that more data gets fetched, but not so much that
+ // missing rows are shown
+ gridElement.getCell(230, 1);
+
+ // Wait for potentially triggered loading indicator to become visible
+ Thread.sleep(500);
+
+ Assert.assertFalse(
+ "Loading indicator should not be visible when fetching rows that are not visible",
+ isLoadingIndicatorVisible());
+
+ // Finally verify that there was actually a request going on
+ waitUntilLogContains("Requested items");
+ }
+
+ private void waitUntilLogContains(final String value) {
+ waitUntil(new ExpectedCondition<Boolean>() {
+ @Override
+ public Boolean apply(WebDriver input) {
+ return getLogRow(0).contains(value);
+ }
+
+ @Override
+ public String toString() {
+ // Timed out after 10 seconds waiting for ...
+ return "first log row to contain '" + value + "' (was: '"
+ + getLogRow(0) + "')";
+ }
+ });
+ }
+
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/contextclick/GridContextClickTest.java b/uitest/src/test/java/com/vaadin/tests/contextclick/GridContextClickTest.java index 1ad77f6016..096d79f780 100644 --- a/uitest/src/test/java/com/vaadin/tests/contextclick/GridContextClickTest.java +++ b/uitest/src/test/java/com/vaadin/tests/contextclick/GridContextClickTest.java @@ -1,109 +1,110 @@ -/* - * 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.tests.contextclick; - -import static org.junit.Assert.assertEquals; - -import org.junit.Test; -import org.openqa.selenium.WebElement; - -import com.vaadin.testbench.elements.ButtonElement; -import com.vaadin.testbench.elements.GridElement; - -public class GridContextClickTest extends AbstractContextClickTest { - - @Test - public void testBodyContextClickWithTypedListener() { - addOrRemoveTypedListener(); - - contextClick($(GridElement.class).first().getCell(0, 0)); - - assertEquals( - "1. ContextClickEvent value: Lisa Schneider, propertyId: address, section: BODY", - getLogRow(0)); - - contextClick($(GridElement.class).first().getCell(0, 3)); - - assertEquals( - "2. ContextClickEvent value: Lisa Schneider, propertyId: lastName, section: BODY", - getLogRow(0)); - } - - @Test - public void testHeaderContextClickWithTypedListener() { - addOrRemoveTypedListener(); - - contextClick($(GridElement.class).first().getHeaderCell(0, 0)); - - assertEquals( - "1. ContextClickEvent value: Address, propertyId: address, section: HEADER", - getLogRow(0)); - - contextClick($(GridElement.class).first().getHeaderCell(0, 3)); - - assertEquals( - "2. ContextClickEvent value: Last Name, propertyId: lastName, section: HEADER", - getLogRow(0)); - } - - @Test - public void testFooterContextClickWithTypedListener() { - addOrRemoveTypedListener(); - - contextClick($(GridElement.class).first().getFooterCell(0, 0)); - - assertEquals( - "1. ContextClickEvent value: , propertyId: address, section: FOOTER", - getLogRow(0)); - - contextClick($(GridElement.class).first().getFooterCell(0, 3)); - - assertEquals( - "2. ContextClickEvent value: , propertyId: lastName, section: FOOTER", - getLogRow(0)); - } - - @Test - public void testContextClickInEmptyGrid() { - addOrRemoveTypedListener(); - - $(ButtonElement.class).caption("Remove all content").first().click(); - - contextClick($(GridElement.class).first(), 100, 100); - - assertEquals( - "1. ContextClickEvent value: , propertyId: null, section: BODY", - getLogRow(0)); - - } - - /** - * Performs a context click on given element at coordinates 20, 10 followed - * by a regular click. This prevents browser context menu from blocking - * future operations. - * - * A smaller X offset might hit the resize handle of the previous cell that - * overlaps with the next header cell. - * - * @param e - * web element - */ - @Override - protected void contextClick(WebElement e) { - contextClick(e, 20, 10); - } - -} +/*
+ * 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.tests.contextclick;
+
+import static org.junit.Assert.assertEquals;
+
+import com.vaadin.tests.components.grid.LegacyGridElement;
+import org.junit.Test;
+import org.openqa.selenium.WebElement;
+
+import com.vaadin.testbench.elements.ButtonElement;
+import com.vaadin.testbench.elements.GridElement;
+
+public class GridContextClickTest extends AbstractContextClickTest {
+
+ @Test
+ public void testBodyContextClickWithTypedListener() {
+ addOrRemoveTypedListener();
+
+ contextClick($(LegacyGridElement.class).first().getCell(0, 0));
+
+ assertEquals(
+ "1. ContextClickEvent value: Lisa Schneider, propertyId: address, section: BODY",
+ getLogRow(0));
+
+ contextClick($(LegacyGridElement.class).first().getCell(0, 3));
+
+ assertEquals(
+ "2. ContextClickEvent value: Lisa Schneider, propertyId: lastName, section: BODY",
+ getLogRow(0));
+ }
+
+ @Test
+ public void testHeaderContextClickWithTypedListener() {
+ addOrRemoveTypedListener();
+
+ contextClick($(LegacyGridElement.class).first().getHeaderCell(0, 0));
+
+ assertEquals(
+ "1. ContextClickEvent value: Address, propertyId: address, section: HEADER",
+ getLogRow(0));
+
+ contextClick($(LegacyGridElement.class).first().getHeaderCell(0, 3));
+
+ assertEquals(
+ "2. ContextClickEvent value: Last Name, propertyId: lastName, section: HEADER",
+ getLogRow(0));
+ }
+
+ @Test
+ public void testFooterContextClickWithTypedListener() {
+ addOrRemoveTypedListener();
+
+ contextClick($(LegacyGridElement.class).first().getFooterCell(0, 0));
+
+ assertEquals(
+ "1. ContextClickEvent value: , propertyId: address, section: FOOTER",
+ getLogRow(0));
+
+ contextClick($(LegacyGridElement.class).first().getFooterCell(0, 3));
+
+ assertEquals(
+ "2. ContextClickEvent value: , propertyId: lastName, section: FOOTER",
+ getLogRow(0));
+ }
+
+ @Test
+ public void testContextClickInEmptyGrid() {
+ addOrRemoveTypedListener();
+
+ $(ButtonElement.class).caption("Remove all content").first().click();
+
+ contextClick($(LegacyGridElement.class).first(), 100, 100);
+
+ assertEquals(
+ "1. ContextClickEvent value: , propertyId: null, section: BODY",
+ getLogRow(0));
+
+ }
+
+ /**
+ * Performs a context click on given element at coordinates 20, 10 followed
+ * by a regular click. This prevents browser context menu from blocking
+ * future operations.
+ *
+ * A smaller X offset might hit the resize handle of the previous cell that
+ * overlaps with the next header cell.
+ *
+ * @param e
+ * web element
+ */
+ @Override
+ protected void contextClick(WebElement e) {
+ contextClick(e, 20, 10);
+ }
+
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/fieldgroup/BasicCrudGridEditorRowTest.java b/uitest/src/test/java/com/vaadin/tests/fieldgroup/BasicCrudGridEditorRowTest.java index 2869fe2c51..dcefa03966 100644 --- a/uitest/src/test/java/com/vaadin/tests/fieldgroup/BasicCrudGridEditorRowTest.java +++ b/uitest/src/test/java/com/vaadin/tests/fieldgroup/BasicCrudGridEditorRowTest.java @@ -1,115 +1,116 @@ -/* - * 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.tests.fieldgroup; - -import static org.junit.Assert.assertFalse; - -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.openqa.selenium.By; -import org.openqa.selenium.Keys; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.interactions.Actions; - -import com.vaadin.testbench.elements.CheckBoxElement; -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.testbench.elements.GridElement.GridCellElement; -import com.vaadin.testbench.elements.GridElement.GridEditorElement; -import com.vaadin.testbench.parallel.TestCategory; -import com.vaadin.tests.legacyelements.LegacyDateFieldElement; -import com.vaadin.tests.tb3.MultiBrowserTest; - -@TestCategory("grid") -public class BasicCrudGridEditorRowTest extends MultiBrowserTest { - private GridElement grid; - - @Before - public void openTest() { - openTestURL(); - grid = $(GridElement.class).first(); - - } - - @Test - public void lookAndFeel() throws Exception { - GridCellElement ritaBirthdate = grid.getCell(2, 3); - compareScreen("grid"); - - // Open editor row - new Actions(getDriver()).doubleClick(ritaBirthdate).perform(); - compareScreen("editorrow"); - } - - @Test - public void editorRowOneInvalidValue() throws Exception { - GridCellElement ritaBirthdate = grid.getCell(2, 3); - // Open editor row - new Actions(getDriver()).doubleClick(ritaBirthdate).perform(); - - GridEditorElement editor = grid.getEditor(); - LegacyDateFieldElement dateField = editor - .$(LegacyDateFieldElement.class).first(); - WebElement input = dateField.findElement(By.xpath("input")); - // input.click(); - input.sendKeys("Invalid", Keys.TAB); - editor.save(); - - Assert.assertTrue("Editor wasn't displayed.", editor.isDisplayed()); - Assert.assertTrue("DateField wasn't displayed.", - dateField.isDisplayed()); - - Assert.assertTrue("DateField didn't have 'v-invalid' css class.", - hasCssClass(dateField, "v-datefield-error")); - } - - @Test - public void testCheckboxInEditorWorks() { - GridCellElement ritaBirthdate = grid.getCell(2, 3); - // Open editor row - new Actions(getDriver()).doubleClick(ritaBirthdate).perform(); - - // Get CheckBox - GridEditorElement editor = grid.getEditor(); - CheckBoxElement cb = editor.getField(5).wrap(CheckBoxElement.class); - - // Check values - String value = cb.getValue(); - cb.click(5, 5); - Assert.assertNotEquals("Checkbox value did not change", value, - cb.getValue()); - } - - @Test - public void testNoTopStyleSetOnEditorOpenWithFooterOnTop() { - GridCellElement cell = grid.getCell(2, 3); - // Open editor row - new Actions(getDriver()).doubleClick(cell).perform(); - - // Close editor - new Actions(getDriver()).sendKeys(Keys.ESCAPE).perform(); - - cell = grid.getCell(14, 3); - - // Open editor row - new Actions(getDriver()).doubleClick(cell).perform(); - - String attribute = grid.getEditor().getAttribute("style").toLowerCase(); - assertFalse("Style should not contain top.", - attribute.contains("top:")); - } - -} +/*
+ * 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.tests.fieldgroup;
+
+import static org.junit.Assert.assertFalse;
+
+import com.vaadin.tests.components.grid.LegacyGridElement;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.openqa.selenium.By;
+import org.openqa.selenium.Keys;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.interactions.Actions;
+
+import com.vaadin.testbench.elements.CheckBoxElement;
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.elements.GridElement.GridCellElement;
+import com.vaadin.testbench.elements.GridElement.GridEditorElement;
+import com.vaadin.testbench.parallel.TestCategory;
+import com.vaadin.tests.legacyelements.LegacyDateFieldElement;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+@TestCategory("grid")
+public class BasicCrudGridEditorRowTest extends MultiBrowserTest {
+ private GridElement grid;
+
+ @Before
+ public void openTest() {
+ openTestURL();
+ grid = $(LegacyGridElement.class).first();
+
+ }
+
+ @Test
+ public void lookAndFeel() throws Exception {
+ GridCellElement ritaBirthdate = grid.getCell(2, 3);
+ compareScreen("grid");
+
+ // Open editor row
+ new Actions(getDriver()).doubleClick(ritaBirthdate).perform();
+ compareScreen("editorrow");
+ }
+
+ @Test
+ public void editorRowOneInvalidValue() throws Exception {
+ GridCellElement ritaBirthdate = grid.getCell(2, 3);
+ // Open editor row
+ new Actions(getDriver()).doubleClick(ritaBirthdate).perform();
+
+ GridEditorElement editor = grid.getEditor();
+ LegacyDateFieldElement dateField = editor
+ .$(LegacyDateFieldElement.class).first();
+ WebElement input = dateField.findElement(By.xpath("input"));
+ // input.click();
+ input.sendKeys("Invalid", Keys.TAB);
+ editor.save();
+
+ Assert.assertTrue("Editor wasn't displayed.", editor.isDisplayed());
+ Assert.assertTrue("DateField wasn't displayed.",
+ dateField.isDisplayed());
+
+ Assert.assertTrue("DateField didn't have 'v-invalid' css class.",
+ hasCssClass(dateField, "v-datefield-error"));
+ }
+
+ @Test
+ public void testCheckboxInEditorWorks() {
+ GridCellElement ritaBirthdate = grid.getCell(2, 3);
+ // Open editor row
+ new Actions(getDriver()).doubleClick(ritaBirthdate).perform();
+
+ // Get CheckBox
+ GridEditorElement editor = grid.getEditor();
+ CheckBoxElement cb = editor.getField(5).wrap(CheckBoxElement.class);
+
+ // Check values
+ String value = cb.getValue();
+ cb.click(5, 5);
+ Assert.assertNotEquals("Checkbox value did not change", value,
+ cb.getValue());
+ }
+
+ @Test
+ public void testNoTopStyleSetOnEditorOpenWithFooterOnTop() {
+ GridCellElement cell = grid.getCell(2, 3);
+ // Open editor row
+ new Actions(getDriver()).doubleClick(cell).perform();
+
+ // Close editor
+ new Actions(getDriver()).sendKeys(Keys.ESCAPE).perform();
+
+ cell = grid.getCell(14, 3);
+
+ // Open editor row
+ new Actions(getDriver()).doubleClick(cell).perform();
+
+ String attribute = grid.getEditor().getAttribute("style").toLowerCase();
+ assertFalse("Style should not contain top.",
+ attribute.contains("top:"));
+ }
+
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/fieldgroup/BasicCrudGridTest.java b/uitest/src/test/java/com/vaadin/tests/fieldgroup/BasicCrudGridTest.java index d6784d2160..57bc553783 100644 --- a/uitest/src/test/java/com/vaadin/tests/fieldgroup/BasicCrudGridTest.java +++ b/uitest/src/test/java/com/vaadin/tests/fieldgroup/BasicCrudGridTest.java @@ -1,69 +1,70 @@ -/* - * 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.tests.fieldgroup; - -import java.util.List; - -import org.junit.Assert; -import org.junit.Test; - -import com.vaadin.testbench.AbstractHasTestBenchCommandExecutor; -import com.vaadin.testbench.elements.AbstractComponentElement; -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.testbench.elements.TextFieldElement; -import com.vaadin.tests.tb3.SingleBrowserTestPhantomJS2; - -public class BasicCrudGridTest extends SingleBrowserTestPhantomJS2 { - - @Test - public void fieldsInitiallyEmpty() { - openTestURL(); - List<TextFieldElement> textFields = getFieldsLayout() - .$(TextFieldElement.class).all(); - - for (TextFieldElement e : textFields) { - Assert.assertEquals("TextField should be empty", "", e.getValue()); - } - } - - private AbstractHasTestBenchCommandExecutor getFieldsLayout() { - return $(AbstractComponentElement.class).id("form"); - } - - @Test - public void fieldsClearedOnDeselect() { - openTestURL(); - - // Select row - $(GridElement.class).first().getCell(2, 2).click(); - - List<TextFieldElement> textFields = getFieldsLayout() - .$(TextFieldElement.class).all(); - - for (TextFieldElement e : textFields) { - Assert.assertNotEquals("TextField should not be empty", "", - e.getValue()); - } - - // Deselect row - $(GridElement.class).first().getCell(2, 2).click(); - - for (TextFieldElement e : textFields) { - Assert.assertEquals("TextField should be empty", "", e.getValue()); - } - - } -} +/*
+ * 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.tests.fieldgroup;
+
+import java.util.List;
+
+import com.vaadin.tests.components.grid.LegacyGridElement;
+import org.junit.Assert;
+import org.junit.Test;
+
+import com.vaadin.testbench.AbstractHasTestBenchCommandExecutor;
+import com.vaadin.testbench.elements.AbstractComponentElement;
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.elements.TextFieldElement;
+import com.vaadin.tests.tb3.SingleBrowserTestPhantomJS2;
+
+public class BasicCrudGridTest extends SingleBrowserTestPhantomJS2 {
+
+ @Test
+ public void fieldsInitiallyEmpty() {
+ openTestURL();
+ List<TextFieldElement> textFields = getFieldsLayout()
+ .$(TextFieldElement.class).all();
+
+ for (TextFieldElement e : textFields) {
+ Assert.assertEquals("TextField should be empty", "", e.getValue());
+ }
+ }
+
+ private AbstractHasTestBenchCommandExecutor getFieldsLayout() {
+ return $(AbstractComponentElement.class).id("form");
+ }
+
+ @Test
+ public void fieldsClearedOnDeselect() {
+ openTestURL();
+
+ // Select row
+ $(LegacyGridElement.class).first().getCell(2, 2).click();
+
+ List<TextFieldElement> textFields = getFieldsLayout()
+ .$(TextFieldElement.class).all();
+
+ for (TextFieldElement e : textFields) {
+ Assert.assertNotEquals("TextField should not be empty", "",
+ e.getValue());
+ }
+
+ // Deselect row
+ $(LegacyGridElement.class).first().getCell(2, 2).click();
+
+ for (TextFieldElement e : textFields) {
+ Assert.assertEquals("TextField should be empty", "", e.getValue());
+ }
+
+ }
+}
|