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 /server | |
parent | 7f80616bec4874b70e6fc5245925d7ca0b0cfd98 (diff) | |
download | vaadin-framework-86cee1ad6bd8e8d9ab3e9128c9b3d0059266fde6.tar.gz vaadin-framework-86cee1ad6bd8e8d9ab3e9128c9b3d0059266fde6.zip |
Rename Grid into LegacyGrid
Change-Id: Ie99e3a5af908ada42a6d0eba421241ad65c0d6b4
Diffstat (limited to 'server')
34 files changed, 270 insertions, 276 deletions
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; |