diff options
author | Adam Wagner <wbadam@users.noreply.github.com> | 2017-04-07 13:03:09 +0300 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-04-12 14:58:11 +0300 |
commit | c1ecea9aa4729b1c8c3d00ebefa1a2a08a352ebf (patch) | |
tree | aee8256add23044f63a40fa5891fe1eaec8f0eea | |
parent | a773c8c7b365e4041db87b5d9ddaad0bdc244a91 (diff) | |
download | vaadin-framework-c1ecea9aa4729b1c8c3d00ebefa1a2a08a352ebf.tar.gz vaadin-framework-c1ecea9aa4729b1c8c3d00ebefa1a2a08a352ebf.zip |
Remove Extension suffix from Grid DND classes (#9035)
15 files changed, 62 insertions, 59 deletions
diff --git a/client/src/main/java/com/vaadin/client/connectors/grid/GridDragSourceExtensionConnector.java b/client/src/main/java/com/vaadin/client/connectors/grid/GridDragSourceConnector.java index 40eb80621c..74f9f14d4f 100644 --- a/client/src/main/java/com/vaadin/client/connectors/grid/GridDragSourceExtensionConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/grid/GridDragSourceConnector.java @@ -29,10 +29,10 @@ import com.vaadin.client.widgets.Grid; import com.vaadin.shared.Range; import com.vaadin.shared.ui.Connect; import com.vaadin.shared.ui.dnd.DropEffect; -import com.vaadin.shared.ui.grid.GridDragSourceExtensionRpc; -import com.vaadin.shared.ui.grid.GridDragSourceExtensionState; +import com.vaadin.shared.ui.grid.GridDragSourceRpc; +import com.vaadin.shared.ui.grid.GridDragSourceState; import com.vaadin.shared.ui.grid.GridState; -import com.vaadin.ui.GridDragSourceExtension; +import com.vaadin.ui.GridDragSource; import elemental.events.Event; import elemental.json.Json; @@ -41,14 +41,13 @@ import elemental.json.JsonObject; /** * Adds HTML5 drag and drop functionality to a {@link com.vaadin.client.widgets.Grid - * Grid}'s rows. This is the client side counterpart of {@link - * GridDragSourceExtension}. + * Grid}'s rows. This is the client side counterpart of {@link GridDragSource}. * * @author Vaadin Ltd * @since */ -@Connect(GridDragSourceExtension.class) -public class GridDragSourceExtensionConnector extends +@Connect(GridDragSource.class) +public class GridDragSourceConnector extends DragSourceExtensionConnector { private GridConnector gridConnector; @@ -93,8 +92,7 @@ public class GridDragSourceExtensionConnector extends protected void sendDragStartEventToServer(Event dragStartEvent) { // Start server RPC with dragged item keys - getRpcProxy(GridDragSourceExtensionRpc.class) - .dragStart(draggedItemKeys); + getRpcProxy(GridDragSourceRpc.class).dragStart(draggedItemKeys); } private List<JsonObject> getDraggedRows(Event dragStartEvent) { @@ -130,7 +128,7 @@ public class GridDragSourceExtensionConnector extends DropEffect dropEffect) { // Send server RPC with dragged item keys - getRpcProxy(GridDragSourceExtensionRpc.class) + getRpcProxy(GridDragSourceRpc.class) .dragEnd(dropEffect, draggedItemKeys); } @@ -204,9 +202,8 @@ public class GridDragSourceExtensionConnector extends * @return Drag data if present or row data otherwise. */ private JsonObject getDragData(JsonObject row) { - return row.hasKey(GridDragSourceExtensionState.JSONKEY_DRAG_DATA) - ? row.getObject(GridDragSourceExtensionState.JSONKEY_DRAG_DATA) - : row; + return row.hasKey(GridDragSourceState.JSONKEY_DRAG_DATA) + ? row.getObject(GridDragSourceState.JSONKEY_DRAG_DATA) : row; } @Override @@ -239,7 +236,7 @@ public class GridDragSourceExtensionConnector extends } @Override - public GridDragSourceExtensionState getState() { - return (GridDragSourceExtensionState) super.getState(); + public GridDragSourceState getState() { + return (GridDragSourceState) super.getState(); } } diff --git a/client/src/main/java/com/vaadin/client/connectors/grid/GridDropTargetExtensionConnector.java b/client/src/main/java/com/vaadin/client/connectors/grid/GridDropTargetConnector.java index dacc8316ad..34a2c6750f 100644 --- a/client/src/main/java/com/vaadin/client/connectors/grid/GridDropTargetExtensionConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/grid/GridDropTargetConnector.java @@ -30,23 +30,23 @@ import com.vaadin.client.widgets.Escalator; import com.vaadin.shared.ui.Connect; import com.vaadin.shared.ui.grid.DropLocation; import com.vaadin.shared.ui.grid.DropMode; -import com.vaadin.shared.ui.grid.GridDropTargetExtensionRpc; -import com.vaadin.shared.ui.grid.GridDropTargetExtensionState; +import com.vaadin.shared.ui.grid.GridDropTargetRpc; +import com.vaadin.shared.ui.grid.GridDropTargetState; import com.vaadin.shared.ui.grid.GridState; -import com.vaadin.ui.GridDropTargetExtension; +import com.vaadin.ui.GridDropTarget; import elemental.events.Event; import elemental.json.JsonObject; /** * Makes Grid an HTML5 drop target. This is the client side counterpart of - * {@link GridDropTargetExtension}. + * {@link GridDropTarget}. * * @author Vaadin Ltd * @since */ -@Connect(GridDropTargetExtension.class) -public class GridDropTargetExtensionConnector extends +@Connect(GridDropTarget.class) +public class GridDropTargetConnector extends DropTargetExtensionConnector { // Drag over class name suffixes @@ -89,7 +89,7 @@ public class GridDropTargetExtensionConnector extends (NativeEvent) dropEvent); } - getRpcProxy(GridDropTargetExtensionRpc.class) + getRpcProxy(GridDropTargetRpc.class) .drop(dataTransferText, rowKey, dropLocation); } @@ -190,7 +190,7 @@ public class GridDropTargetExtensionConnector extends } @Override - public GridDropTargetExtensionState getState() { - return (GridDropTargetExtensionState) super.getState(); + public GridDropTargetState getState() { + return (GridDropTargetState) super.getState(); } } diff --git a/server/src/main/java/com/vaadin/event/dnd/grid/GridDragEndEvent.java b/server/src/main/java/com/vaadin/event/dnd/grid/GridDragEndEvent.java index 8b4ceb1d4f..e58196e6b7 100644 --- a/server/src/main/java/com/vaadin/event/dnd/grid/GridDragEndEvent.java +++ b/server/src/main/java/com/vaadin/event/dnd/grid/GridDragEndEvent.java @@ -20,6 +20,7 @@ import java.util.Set; import com.vaadin.event.dnd.DragEndEvent; import com.vaadin.shared.ui.dnd.DropEffect; import com.vaadin.ui.Grid; +import com.vaadin.ui.GridDragSource; /** * Drop event on an HTML5 drop target {@link Grid} row. @@ -27,7 +28,7 @@ import com.vaadin.ui.Grid; * @param <T> * The Grid bean type. * @author Vaadin Ltd. - * @see com.vaadin.ui.GridDragSourceExtension#addGridDragStartListener(GridDragStartListener) + * @see GridDragSource#addGridDragStartListener(GridDragStartListener) * @since */ public class GridDragEndEvent<T> extends DragEndEvent<Grid<T>> { diff --git a/server/src/main/java/com/vaadin/event/dnd/grid/GridDragEndListener.java b/server/src/main/java/com/vaadin/event/dnd/grid/GridDragEndListener.java index ad338e68db..c47a8f037f 100644 --- a/server/src/main/java/com/vaadin/event/dnd/grid/GridDragEndListener.java +++ b/server/src/main/java/com/vaadin/event/dnd/grid/GridDragEndListener.java @@ -18,6 +18,7 @@ package com.vaadin.event.dnd.grid; import java.lang.reflect.Method; import com.vaadin.event.ConnectorEventListener; +import com.vaadin.ui.GridDragSource; /** * Drop listener for HTML5 drop on a Grid row. @@ -25,7 +26,7 @@ import com.vaadin.event.ConnectorEventListener; * @param <T> * The Grid bean type. * @author Vaadin Ltd. - * @see com.vaadin.ui.GridDragSourceExtension#addGridDragEndListener(GridDragEndListener) + * @see GridDragSource#addGridDragEndListener(GridDragEndListener) * @since */ @FunctionalInterface diff --git a/server/src/main/java/com/vaadin/event/dnd/grid/GridDragStartEvent.java b/server/src/main/java/com/vaadin/event/dnd/grid/GridDragStartEvent.java index 50130043da..ac87c296cf 100644 --- a/server/src/main/java/com/vaadin/event/dnd/grid/GridDragStartEvent.java +++ b/server/src/main/java/com/vaadin/event/dnd/grid/GridDragStartEvent.java @@ -20,6 +20,7 @@ import java.util.Set; import com.vaadin.event.dnd.DragStartEvent; import com.vaadin.shared.ui.dnd.EffectAllowed; import com.vaadin.ui.Grid; +import com.vaadin.ui.GridDragSource; /** * Drag start event on an HTML5 drag source {@link Grid} row. @@ -27,7 +28,7 @@ import com.vaadin.ui.Grid; * @param <T> * The Grid bean type. * @author Vaadin Ltd. - * @see com.vaadin.ui.GridDragSourceExtension#addGridDragStartListener(GridDragStartListener) + * @see GridDragSource#addGridDragStartListener(GridDragStartListener) * @since */ public class GridDragStartEvent<T> extends DragStartEvent<Grid<T>> { diff --git a/server/src/main/java/com/vaadin/event/dnd/grid/GridDragStartListener.java b/server/src/main/java/com/vaadin/event/dnd/grid/GridDragStartListener.java index f7dc06b0fe..4ef1f7f205 100644 --- a/server/src/main/java/com/vaadin/event/dnd/grid/GridDragStartListener.java +++ b/server/src/main/java/com/vaadin/event/dnd/grid/GridDragStartListener.java @@ -18,6 +18,7 @@ package com.vaadin.event.dnd.grid; import java.lang.reflect.Method; import com.vaadin.event.ConnectorEventListener; +import com.vaadin.ui.GridDragSource; /** * Drag start listener for HTML5 drag start on a Grid row. @@ -25,7 +26,7 @@ import com.vaadin.event.ConnectorEventListener; * @param <T> * The Grid bean type. * @author Vaadin Ltd. - * @see com.vaadin.ui.GridDragSourceExtension#addGridDragStartListener(GridDragStartListener) + * @see GridDragSource#addGridDragStartListener(GridDragStartListener) * @since */ @FunctionalInterface diff --git a/server/src/main/java/com/vaadin/event/dnd/grid/GridDropEvent.java b/server/src/main/java/com/vaadin/event/dnd/grid/GridDropEvent.java index 98d1b3495b..41998354d1 100644 --- a/server/src/main/java/com/vaadin/event/dnd/grid/GridDropEvent.java +++ b/server/src/main/java/com/vaadin/event/dnd/grid/GridDropEvent.java @@ -20,6 +20,7 @@ import com.vaadin.event.dnd.DropEvent; import com.vaadin.shared.ui.grid.DropLocation; import com.vaadin.ui.AbstractComponent; import com.vaadin.ui.Grid; +import com.vaadin.ui.GridDropTarget; /** * Drop event on an HTML5 drop target {@link Grid} row. @@ -27,7 +28,7 @@ import com.vaadin.ui.Grid; * @param <T> * The Grid bean type. * @author Vaadin Ltd. - * @see com.vaadin.ui.GridDropTargetExtension#addGridDropListener(GridDropListener) + * @see GridDropTarget#addGridDropListener(GridDropListener) * @since */ public class GridDropEvent<T> extends DropEvent<Grid<T>> { diff --git a/server/src/main/java/com/vaadin/event/dnd/grid/GridDropListener.java b/server/src/main/java/com/vaadin/event/dnd/grid/GridDropListener.java index 1c148eb28d..bd4ed8e2fc 100644 --- a/server/src/main/java/com/vaadin/event/dnd/grid/GridDropListener.java +++ b/server/src/main/java/com/vaadin/event/dnd/grid/GridDropListener.java @@ -18,6 +18,7 @@ package com.vaadin.event.dnd.grid; import java.lang.reflect.Method; import com.vaadin.event.ConnectorEventListener; +import com.vaadin.ui.GridDropTarget; /** * Drop listener for HTML5 drop on a Grid row. @@ -25,7 +26,7 @@ import com.vaadin.event.ConnectorEventListener; * @param <T> * The Grid bean type. * @author Vaadin Ltd. - * @see com.vaadin.ui.GridDropTargetExtension#addGridDropListener(GridDropListener) + * @see GridDropTarget#addGridDropListener(GridDropListener) * @since */ @FunctionalInterface diff --git a/server/src/main/java/com/vaadin/ui/GridDragSourceExtension.java b/server/src/main/java/com/vaadin/ui/GridDragSource.java index ca6e1b05fd..0cfd9964e2 100644 --- a/server/src/main/java/com/vaadin/ui/GridDragSourceExtension.java +++ b/server/src/main/java/com/vaadin/ui/GridDragSource.java @@ -30,8 +30,8 @@ import com.vaadin.server.SerializableFunction; import com.vaadin.shared.Registration; import com.vaadin.shared.ui.dnd.DragSourceState; import com.vaadin.shared.ui.dnd.DropEffect; -import com.vaadin.shared.ui.grid.GridDragSourceExtensionRpc; -import com.vaadin.shared.ui.grid.GridDragSourceExtensionState; +import com.vaadin.shared.ui.grid.GridDragSourceRpc; +import com.vaadin.shared.ui.grid.GridDragSourceState; import elemental.json.JsonObject; @@ -46,7 +46,7 @@ import elemental.json.JsonObject; * @author Vaadin Ltd. * @since */ -public class GridDragSourceExtension<T> extends DragSourceExtension<Grid<T>> { +public class GridDragSource<T> extends DragSourceExtension<Grid<T>> { /** * Drag data generator that appends drag data to each row. @@ -64,7 +64,7 @@ public class GridDragSourceExtension<T> extends DragSourceExtension<Grid<T>> { * @param target * Grid to be extended. */ - public GridDragSourceExtension(Grid<T> target) { + public GridDragSource(Grid<T> target) { super(target); // Create drag data generator @@ -76,7 +76,7 @@ public class GridDragSourceExtension<T> extends DragSourceExtension<Grid<T>> { @Override protected void registerDragSourceRpc(Grid<T> target) { - registerRpc(new GridDragSourceExtensionRpc() { + registerRpc(new GridDragSourceRpc() { @Override public void dragStart(List<String> draggedItemKeys) { @@ -124,7 +124,7 @@ public class GridDragSourceExtension<T> extends DragSourceExtension<Grid<T>> { */ private void generateDragData(T item, JsonObject jsonObject) { Optional.ofNullable(generatorFunction).ifPresent(generator -> jsonObject - .put(GridDragSourceExtensionState.JSONKEY_DRAG_DATA, + .put(GridDragSourceState.JSONKEY_DRAG_DATA, generator.apply(item))); } @@ -204,12 +204,12 @@ public class GridDragSourceExtension<T> extends DragSourceExtension<Grid<T>> { } @Override - protected GridDragSourceExtensionState getState() { - return (GridDragSourceExtensionState) super.getState(); + protected GridDragSourceState getState() { + return (GridDragSourceState) super.getState(); } @Override - protected GridDragSourceExtensionState getState(boolean markAsDirty) { - return (GridDragSourceExtensionState) super.getState(markAsDirty); + protected GridDragSourceState getState(boolean markAsDirty) { + return (GridDragSourceState) super.getState(markAsDirty); } } diff --git a/server/src/main/java/com/vaadin/ui/GridDropTargetExtension.java b/server/src/main/java/com/vaadin/ui/GridDropTarget.java index 17633fa5ce..0cd51d8634 100644 --- a/server/src/main/java/com/vaadin/ui/GridDropTargetExtension.java +++ b/server/src/main/java/com/vaadin/ui/GridDropTarget.java @@ -20,8 +20,8 @@ import com.vaadin.event.dnd.grid.GridDropEvent; import com.vaadin.event.dnd.grid.GridDropListener; import com.vaadin.shared.Registration; import com.vaadin.shared.ui.grid.DropMode; -import com.vaadin.shared.ui.grid.GridDropTargetExtensionRpc; -import com.vaadin.shared.ui.grid.GridDropTargetExtensionState; +import com.vaadin.shared.ui.grid.GridDropTargetRpc; +import com.vaadin.shared.ui.grid.GridDropTargetState; /** * Makes the rows of a Grid HTML5 drop targets. This is the server side @@ -32,7 +32,7 @@ import com.vaadin.shared.ui.grid.GridDropTargetExtensionState; * @author Vaadin Ltd * @since */ -public class GridDropTargetExtension<T> extends DropTargetExtension<Grid<T>> { +public class GridDropTarget<T> extends DropTargetExtension<Grid<T>> { /** * Extends a Grid and makes it's rows drop targets for HTML5 drag and drop. @@ -44,7 +44,7 @@ public class GridDropTargetExtension<T> extends DropTargetExtension<Grid<T>> { * Grid's row. * @see GridDropEvent#getDropLocation() */ - public GridDropTargetExtension(Grid<T> target, DropMode dropMode) { + public GridDropTarget(Grid<T> target, DropMode dropMode) { super(target); setDropMode(dropMode); @@ -93,7 +93,7 @@ public class GridDropTargetExtension<T> extends DropTargetExtension<Grid<T>> { @Override protected void registerDropTargetRpc(Grid<T> target) { registerRpc( - (GridDropTargetExtensionRpc) (dataTransferText, rowKey, dropLocation) -> { + (GridDropTargetRpc) (dataTransferText, rowKey, dropLocation) -> { T dropTargetRow = target.getDataCommunicator() .getKeyMapper().get(rowKey); @@ -107,12 +107,12 @@ public class GridDropTargetExtension<T> extends DropTargetExtension<Grid<T>> { } @Override - protected GridDropTargetExtensionState getState() { - return (GridDropTargetExtensionState) super.getState(); + protected GridDropTargetState getState() { + return (GridDropTargetState) super.getState(); } @Override - protected GridDropTargetExtensionState getState(boolean markAsDirty) { - return (GridDropTargetExtensionState) super.getState(markAsDirty); + protected GridDropTargetState getState(boolean markAsDirty) { + return (GridDropTargetState) super.getState(markAsDirty); } } diff --git a/shared/src/main/java/com/vaadin/shared/ui/grid/GridDragSourceExtensionRpc.java b/shared/src/main/java/com/vaadin/shared/ui/grid/GridDragSourceRpc.java index c0e24fe847..066e193157 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/grid/GridDragSourceExtensionRpc.java +++ b/shared/src/main/java/com/vaadin/shared/ui/grid/GridDragSourceRpc.java @@ -27,7 +27,7 @@ import com.vaadin.shared.ui.dnd.DropEffect; * @author Vaadin Ltd. * @since */ -public interface GridDragSourceExtensionRpc extends ServerRpc { +public interface GridDragSourceRpc extends ServerRpc { /** * Called when dragstart event happens on client side. diff --git a/shared/src/main/java/com/vaadin/shared/ui/grid/GridDragSourceExtensionState.java b/shared/src/main/java/com/vaadin/shared/ui/grid/GridDragSourceState.java index 682863ab88..3d020043fe 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/grid/GridDragSourceExtensionState.java +++ b/shared/src/main/java/com/vaadin/shared/ui/grid/GridDragSourceState.java @@ -18,12 +18,12 @@ package com.vaadin.shared.ui.grid; import com.vaadin.shared.ui.dnd.DragSourceState; /** - * State class containing parameters for GridDragSourceExtension. + * State class containing parameters for GridDragSource. * * @author Vaadin Ltd * @since */ -public class GridDragSourceExtensionState extends DragSourceState { +public class GridDragSourceState extends DragSourceState { /** * Json key for storing data for a dragged row. diff --git a/shared/src/main/java/com/vaadin/shared/ui/grid/GridDropTargetExtensionRpc.java b/shared/src/main/java/com/vaadin/shared/ui/grid/GridDropTargetRpc.java index 212081d486..84bb6ed890 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/grid/GridDropTargetExtensionRpc.java +++ b/shared/src/main/java/com/vaadin/shared/ui/grid/GridDropTargetRpc.java @@ -24,7 +24,7 @@ import com.vaadin.shared.communication.ServerRpc; * @author Vaadin Ltd. * @since */ -public interface GridDropTargetExtensionRpc extends ServerRpc { +public interface GridDropTargetRpc extends ServerRpc { /** * Called when drop event happens on client side. diff --git a/shared/src/main/java/com/vaadin/shared/ui/grid/GridDropTargetExtensionState.java b/shared/src/main/java/com/vaadin/shared/ui/grid/GridDropTargetState.java index 50b50a5d24..aae051b299 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/grid/GridDropTargetExtensionState.java +++ b/shared/src/main/java/com/vaadin/shared/ui/grid/GridDropTargetState.java @@ -18,12 +18,12 @@ package com.vaadin.shared.ui.grid; import com.vaadin.shared.ui.dnd.DropTargetState; /** - * State class containing parameters for GridDropTargetExtension. + * State class containing parameters for GridDropTarget. * * @author Vaadin Ltd * @since */ -public class GridDropTargetExtensionState extends DropTargetState { +public class GridDropTargetState extends DropTargetState { /** * Stores the drop mode of the drop target Grid. 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 9c89177167..8fed8eabca 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 @@ -25,8 +25,8 @@ import com.vaadin.server.VaadinRequest; import com.vaadin.shared.ui.grid.DropMode; import com.vaadin.tests.components.AbstractTestUIWithLog; import com.vaadin.ui.Grid; -import com.vaadin.ui.GridDragSourceExtension; -import com.vaadin.ui.GridDropTargetExtension; +import com.vaadin.ui.GridDragSource; +import com.vaadin.ui.GridDropTarget; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Layout; import com.vaadin.ui.RadioButtonGroup; @@ -44,7 +44,7 @@ public class GridDragAndDrop extends AbstractTestUIWithLog { dragSourceComponent.addColumn(Bean::getId).setCaption("ID"); dragSourceComponent.addColumn(Bean::getValue).setCaption("Value"); - GridDragSourceExtension<Bean> dragSource = new GridDragSourceExtension<>( + GridDragSource<Bean> dragSource = new GridDragSource<>( dragSourceComponent); dragSource.setDragDataGenerator(bean -> { JsonObject ret = Json.createObject(); @@ -59,7 +59,7 @@ public class GridDragAndDrop extends AbstractTestUIWithLog { dropTargetComponent.addColumn(Bean::getId).setCaption("ID"); dropTargetComponent.addColumn(Bean::getValue).setCaption("Value"); - GridDropTargetExtension<Bean> dropTarget = new GridDropTargetExtension<>( + GridDropTarget<Bean> dropTarget = new GridDropTarget<>( dropTargetComponent, DropMode.ON_TOP); dropTarget.addGridDropListener(event -> { log(event.getDataTransferText() + ", targetId=" + event |