aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorAdam Wagner <wbadam@users.noreply.github.com>2017-04-10 16:28:22 +0300
committerPekka Hyvönen <pekka@vaadin.com>2017-04-10 16:28:22 +0300
commit125d2a926c1bc7213e732da053cc7ea5cb019c50 (patch)
treeb4f78aa32c5bd5e33e97f44fcd02f8ace254c1af /server
parent3cf3d1b564571f272e84dc152d8a606acf6ce808 (diff)
downloadvaadin-framework-125d2a926c1bc7213e732da053cc7ea5cb019c50.tar.gz
vaadin-framework-125d2a926c1bc7213e732da053cc7ea5cb019c50.zip
Make Button component draggable (#9038)
* Make Button component draggable (#9037) * Add own state to button drag source
Diffstat (limited to 'server')
-rw-r--r--server/src/main/java/com/vaadin/event/dnd/ButtonDragSource.java42
1 files changed, 42 insertions, 0 deletions
diff --git a/server/src/main/java/com/vaadin/event/dnd/ButtonDragSource.java b/server/src/main/java/com/vaadin/event/dnd/ButtonDragSource.java
new file mode 100644
index 0000000000..4c681f5331
--- /dev/null
+++ b/server/src/main/java/com/vaadin/event/dnd/ButtonDragSource.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2000-2016 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.event.dnd;
+
+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
+ */
+public class ButtonDragSource extends DragSourceExtension<Button> {
+
+ public ButtonDragSource(Button target) {
+ super(target);
+ }
+
+ @Override
+ protected ButtonDragSourceState getState() {
+ return (ButtonDragSourceState) super.getState();
+ }
+
+ @Override
+ protected ButtonDragSourceState getState(boolean markAsDirty) {
+ return (ButtonDragSourceState) super.getState(markAsDirty);
+ }
+}