From 76892855a7c3f37a1fef5caee3c0debf6aa712e2 Mon Sep 17 00:00:00 2001 From: Pekka Hyvönen Date: Fri, 12 May 2017 11:33:55 +0300 Subject: Refactor Html5 DnD feature based on API review (#9306) * Refactor Html5 DnD client side based on API review - Moved classes to "correct" packages. - Removed method DragSourceExtension.clearDataTransferText() - Remove ButtonDragSource in favor of more generic API --- .../main/java/com/vaadin/event/Transferable.java | 4 +- .../java/com/vaadin/event/dd/DragAndDropEvent.java | 2 +- .../main/java/com/vaadin/event/dd/DragSource.java | 2 +- .../main/java/com/vaadin/event/dd/DropHandler.java | 2 +- .../main/java/com/vaadin/event/dd/DropTarget.java | 2 +- .../java/com/vaadin/event/dd/TargetDetails.java | 2 +- .../com/vaadin/event/dd/TargetDetailsImpl.java | 2 +- .../com/vaadin/event/dnd/ButtonDragSource.java | 44 ---- .../java/com/vaadin/event/dnd/DragEndEvent.java | 93 -------- .../java/com/vaadin/event/dnd/DragEndListener.java | 46 ---- .../com/vaadin/event/dnd/DragSourceExtension.java | 254 --------------------- .../java/com/vaadin/event/dnd/DragStartEvent.java | 68 ------ .../com/vaadin/event/dnd/DragStartListener.java | 46 ---- .../main/java/com/vaadin/event/dnd/DropEvent.java | 134 ----------- .../java/com/vaadin/event/dnd/DropListener.java | 46 ---- .../com/vaadin/event/dnd/DropTargetExtension.java | 182 --------------- .../java/com/vaadin/event/dnd/FileDropEvent.java | 63 ----- .../java/com/vaadin/event/dnd/FileDropHandler.java | 44 ---- .../vaadin/event/dnd/grid/GridDragEndEvent.java | 63 ----- .../vaadin/event/dnd/grid/GridDragEndListener.java | 46 ---- .../vaadin/event/dnd/grid/GridDragStartEvent.java | 63 ----- .../event/dnd/grid/GridDragStartListener.java | 45 ---- .../com/vaadin/event/dnd/grid/GridDropEvent.java | 85 ------- .../vaadin/event/dnd/grid/GridDropListener.java | 45 ---- 24 files changed, 8 insertions(+), 1375 deletions(-) delete mode 100644 server/src/main/java/com/vaadin/event/dnd/ButtonDragSource.java delete mode 100644 server/src/main/java/com/vaadin/event/dnd/DragEndEvent.java delete mode 100644 server/src/main/java/com/vaadin/event/dnd/DragEndListener.java delete mode 100644 server/src/main/java/com/vaadin/event/dnd/DragSourceExtension.java delete mode 100644 server/src/main/java/com/vaadin/event/dnd/DragStartEvent.java delete mode 100644 server/src/main/java/com/vaadin/event/dnd/DragStartListener.java delete mode 100644 server/src/main/java/com/vaadin/event/dnd/DropEvent.java delete mode 100644 server/src/main/java/com/vaadin/event/dnd/DropListener.java delete mode 100644 server/src/main/java/com/vaadin/event/dnd/DropTargetExtension.java delete mode 100644 server/src/main/java/com/vaadin/event/dnd/FileDropEvent.java delete mode 100644 server/src/main/java/com/vaadin/event/dnd/FileDropHandler.java delete mode 100644 server/src/main/java/com/vaadin/event/dnd/grid/GridDragEndEvent.java delete mode 100644 server/src/main/java/com/vaadin/event/dnd/grid/GridDragEndListener.java delete mode 100644 server/src/main/java/com/vaadin/event/dnd/grid/GridDragStartEvent.java delete mode 100644 server/src/main/java/com/vaadin/event/dnd/grid/GridDragStartListener.java delete mode 100644 server/src/main/java/com/vaadin/event/dnd/grid/GridDropEvent.java delete mode 100644 server/src/main/java/com/vaadin/event/dnd/grid/GridDropListener.java (limited to 'server/src/main/java/com/vaadin/event') diff --git a/server/src/main/java/com/vaadin/event/Transferable.java b/server/src/main/java/com/vaadin/event/Transferable.java index f75974a1cc..1f0ed866c1 100644 --- a/server/src/main/java/com/vaadin/event/Transferable.java +++ b/server/src/main/java/com/vaadin/event/Transferable.java @@ -18,9 +18,9 @@ package com.vaadin.event; import java.io.Serializable; import java.util.Collection; -import com.vaadin.event.dnd.DragSourceExtension; -import com.vaadin.event.dnd.DropEvent; import com.vaadin.ui.Component; +import com.vaadin.ui.dnd.DragSourceExtension; +import com.vaadin.ui.dnd.event.DropEvent; /** * Transferable wraps the data that is to be imported into another component. diff --git a/server/src/main/java/com/vaadin/event/dd/DragAndDropEvent.java b/server/src/main/java/com/vaadin/event/dd/DragAndDropEvent.java index 6f66036e5a..6bf8a7f319 100644 --- a/server/src/main/java/com/vaadin/event/dd/DragAndDropEvent.java +++ b/server/src/main/java/com/vaadin/event/dd/DragAndDropEvent.java @@ -19,7 +19,7 @@ import java.io.Serializable; import com.vaadin.event.Transferable; import com.vaadin.event.dd.acceptcriteria.AcceptCriterion; -import com.vaadin.event.dnd.DropEvent; +import com.vaadin.ui.dnd.event.DropEvent; /** * DragAndDropEvent wraps information related to drag and drop operation. It is diff --git a/server/src/main/java/com/vaadin/event/dd/DragSource.java b/server/src/main/java/com/vaadin/event/dd/DragSource.java index 8a3c8c32dc..6361925864 100644 --- a/server/src/main/java/com/vaadin/event/dd/DragSource.java +++ b/server/src/main/java/com/vaadin/event/dd/DragSource.java @@ -19,8 +19,8 @@ import java.util.Map; import com.vaadin.event.Transferable; import com.vaadin.event.dd.acceptcriteria.AcceptCriterion; -import com.vaadin.event.dnd.DragSourceExtension; import com.vaadin.ui.Component; +import com.vaadin.ui.dnd.DragSourceExtension; /** * DragSource is a {@link Component} that builds a {@link Transferable} for a diff --git a/server/src/main/java/com/vaadin/event/dd/DropHandler.java b/server/src/main/java/com/vaadin/event/dd/DropHandler.java index d6183940e9..a96b6206d5 100644 --- a/server/src/main/java/com/vaadin/event/dd/DropHandler.java +++ b/server/src/main/java/com/vaadin/event/dd/DropHandler.java @@ -21,7 +21,7 @@ import com.vaadin.event.Transferable; import com.vaadin.event.dd.acceptcriteria.AcceptAll; import com.vaadin.event.dd.acceptcriteria.AcceptCriterion; import com.vaadin.event.dd.acceptcriteria.ServerSideCriterion; -import com.vaadin.event.dnd.DropListener; +import com.vaadin.ui.dnd.event.DropListener; /** * DropHandlers contain the actual business logic for drag and drop operations. diff --git a/server/src/main/java/com/vaadin/event/dd/DropTarget.java b/server/src/main/java/com/vaadin/event/dd/DropTarget.java index 3d346418c0..5202718109 100644 --- a/server/src/main/java/com/vaadin/event/dd/DropTarget.java +++ b/server/src/main/java/com/vaadin/event/dd/DropTarget.java @@ -17,8 +17,8 @@ package com.vaadin.event.dd; import java.util.Map; -import com.vaadin.event.dnd.DropTargetExtension; import com.vaadin.ui.Component; +import com.vaadin.ui.dnd.DropTargetExtension; /** * DropTarget is an interface for components supporting drop operations. A diff --git a/server/src/main/java/com/vaadin/event/dd/TargetDetails.java b/server/src/main/java/com/vaadin/event/dd/TargetDetails.java index 4a22958952..710fc5792f 100644 --- a/server/src/main/java/com/vaadin/event/dd/TargetDetails.java +++ b/server/src/main/java/com/vaadin/event/dd/TargetDetails.java @@ -17,7 +17,7 @@ package com.vaadin.event.dd; import java.io.Serializable; -import com.vaadin.event.dnd.DropEvent; +import com.vaadin.ui.dnd.event.DropEvent; /** * TargetDetails wraps drop target related information about diff --git a/server/src/main/java/com/vaadin/event/dd/TargetDetailsImpl.java b/server/src/main/java/com/vaadin/event/dd/TargetDetailsImpl.java index fadc1877cf..3ede6a20e0 100644 --- a/server/src/main/java/com/vaadin/event/dd/TargetDetailsImpl.java +++ b/server/src/main/java/com/vaadin/event/dd/TargetDetailsImpl.java @@ -18,8 +18,8 @@ package com.vaadin.event.dd; import java.util.HashMap; import java.util.Map; -import com.vaadin.event.dnd.DropEvent; import com.vaadin.shared.MouseEventDetails; +import com.vaadin.ui.dnd.event.DropEvent; /** * A HashMap backed implementation of {@link TargetDetails} for terminal diff --git a/server/src/main/java/com/vaadin/event/dnd/ButtonDragSource.java b/server/src/main/java/com/vaadin/event/dnd/ButtonDragSource.java deleted file mode 100644 index 3d0d93dfa2..0000000000 --- a/server/src/main/java/com/vaadin/event/dnd/ButtonDragSource.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2000-2016 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.vaadin.event.dnd; - -import com.vaadin.annotations.Widgetset; -import com.vaadin.shared.ui.dnd.ButtonDragSourceState; -import com.vaadin.ui.Button; - -/** - * Extension to make Button a drag source for HTML5 drag and drop functionality. - * - * @author Vaadin Ltd. - * @since 8.1 - */ -@Widgetset("com.vaadin.DefaultWidgetSet") -public class ButtonDragSource extends DragSourceExtension