diff options
author | Adam Wagner <wbadam@users.noreply.github.com> | 2017-06-28 10:29:57 +0200 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-06-28 11:29:57 +0300 |
commit | 6ed5f2a0df068dba713d8e24dc9f78e2a0829a73 (patch) | |
tree | 0cc6c37ba43e5d1371b9283b18042289f2e14db0 /shared/src/main/java/com/vaadin | |
parent | e4e2328a3a78d652cd09ef8293f233d31d899415 (diff) | |
download | vaadin-framework-6ed5f2a0df068dba713d8e24dc9f78e2a0829a73.tar.gz vaadin-framework-6ed5f2a0df068dba713d8e24dc9f78e2a0829a73.zip |
Create drag source and drop target extensions for tree grid (#9463)
Resolves #9372
Diffstat (limited to 'shared/src/main/java/com/vaadin')
3 files changed, 115 insertions, 0 deletions
diff --git a/shared/src/main/java/com/vaadin/shared/ui/treegrid/TreeGridDragSourceState.java b/shared/src/main/java/com/vaadin/shared/ui/treegrid/TreeGridDragSourceState.java new file mode 100644 index 0000000000..f3ea4cf900 --- /dev/null +++ b/shared/src/main/java/com/vaadin/shared/ui/treegrid/TreeGridDragSourceState.java @@ -0,0 +1,28 @@ +/* + * 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.shared.ui.treegrid; + +import com.vaadin.shared.ui.grid.GridDragSourceState; + +/** + * State class containing parameters for TreeGridDragSource. + * + * @author Vaadin Ltd + * @since 8.1 + */ +public class TreeGridDragSourceState extends GridDragSourceState { + +} diff --git a/shared/src/main/java/com/vaadin/shared/ui/treegrid/TreeGridDropTargetRpc.java b/shared/src/main/java/com/vaadin/shared/ui/treegrid/TreeGridDropTargetRpc.java new file mode 100644 index 0000000000..0ce81c80dd --- /dev/null +++ b/shared/src/main/java/com/vaadin/shared/ui/treegrid/TreeGridDropTargetRpc.java @@ -0,0 +1,59 @@ +/* + * Copyright 2000-2016 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.shared.ui.treegrid; + +import java.util.List; +import java.util.Map; + +import com.vaadin.shared.MouseEventDetails; +import com.vaadin.shared.communication.ServerRpc; +import com.vaadin.shared.ui.grid.DropLocation; + +/** + * RPC for firing server side drop event when client side drop event happens on + * drop target TreeGrid. + * + * @author Vaadin Ltd. + * @since 8.1 + */ +public interface TreeGridDropTargetRpc extends ServerRpc { + + /** + * Called when drop event happens on client side. + * + * @param types + * list of data types from {@code DataTransfer.types} object + * @param data + * map containing all types and corresponding data from the {@code + * DataTransfer} object + * @param dropEffect + * the desired drop effect + * @param rowKey + * key of the row on which the drop event occurred + * @param depth + * depth of the row in the hierarchy + * @param collapsed + * whether the target row is collapsed + * @param dropLocation + * location of the drop within the row + * @param mouseEventDetails + * Mouse event details object containing information about the drop + * event + */ + public void drop(List<String> types, Map<String, String> data, + String dropEffect, String rowKey, Integer depth, Boolean collapsed, + DropLocation dropLocation, MouseEventDetails mouseEventDetails); +} diff --git a/shared/src/main/java/com/vaadin/shared/ui/treegrid/TreeGridDropTargetState.java b/shared/src/main/java/com/vaadin/shared/ui/treegrid/TreeGridDropTargetState.java new file mode 100644 index 0000000000..29fea79c98 --- /dev/null +++ b/shared/src/main/java/com/vaadin/shared/ui/treegrid/TreeGridDropTargetState.java @@ -0,0 +1,28 @@ +/* + * 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.shared.ui.treegrid; + +import com.vaadin.shared.ui.grid.GridDropTargetState; + +/** + * State class containing parameters for TreeGridDropTarget. + * + * @author Vaadin Ltd + * @since 8.1 + */ +public class TreeGridDropTargetState extends GridDropTargetState { + +} |