diff options
author | Aleksi Hietanen <aleksi@vaadin.com> | 2017-04-06 13:09:31 +0300 |
---|---|---|
committer | Ilia Motornyi <elmot@vaadin.com> | 2017-04-06 12:09:31 +0200 |
commit | 6ad53c7d6679cc60961d07ed0766b679795ac8a8 (patch) | |
tree | 0c5ff17c7662bb6c858571553f7e902e8ae3b432 /shared | |
parent | 6eed666314e1f9987bc6f52b4f2901ff7c0018b3 (diff) | |
download | vaadin-framework-6ad53c7d6679cc60961d07ed0766b679795ac8a8.tar.gz vaadin-framework-6ad53c7d6679cc60961d07ed0766b679795ac8a8.zip |
Add server-side expand and collapse to TreeGrid (#9021)
* Add server-side expand and collapse to TreeGrid
* Add javadocs
* Fix variable naming in TreeGridHugeTreeTest
* Fix review comments
* Merge remote-tracking branch 'github/master' into 8759-server-expand
* Clear pending expands when all data is dropped
* Add documentation
Diffstat (limited to 'shared')
-rw-r--r-- | shared/src/main/java/com/vaadin/shared/ui/treegrid/NodeCollapseRpc.java | 6 | ||||
-rw-r--r-- | shared/src/main/java/com/vaadin/shared/ui/treegrid/TreeGridClientRpc.java | 45 |
2 files changed, 50 insertions, 1 deletions
diff --git a/shared/src/main/java/com/vaadin/shared/ui/treegrid/NodeCollapseRpc.java b/shared/src/main/java/com/vaadin/shared/ui/treegrid/NodeCollapseRpc.java index 1b16203648..f0748a9b88 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/treegrid/NodeCollapseRpc.java +++ b/shared/src/main/java/com/vaadin/shared/ui/treegrid/NodeCollapseRpc.java @@ -36,6 +36,10 @@ public interface NodeCollapseRpc extends ServerRpc { * index where the row is in grid (all rows) * @param collapse * {@code true} to collapse, {@code false} to expand + * @param userOriginated + * {@code true} if this RPC was triggered by a user interaction, + * {@code false} otherwise */ - void setNodeCollapsed(String rowKey, int rowIndex, boolean collapse); + void setNodeCollapsed(String rowKey, int rowIndex, boolean collapse, + boolean userOriginated); } diff --git a/shared/src/main/java/com/vaadin/shared/ui/treegrid/TreeGridClientRpc.java b/shared/src/main/java/com/vaadin/shared/ui/treegrid/TreeGridClientRpc.java new file mode 100644 index 0000000000..a07a2d4885 --- /dev/null +++ b/shared/src/main/java/com/vaadin/shared/ui/treegrid/TreeGridClientRpc.java @@ -0,0 +1,45 @@ +/* + * 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.communication.ClientRpc; + +/** + * Server-to-client RPC interface for the TreeGrid component. + * + * @since 8.1 + * @author Vaadin Ltd + */ +public interface TreeGridClientRpc extends ClientRpc { + + /** + * Inform the client that an item with the given key has been expanded by + * the server. + * + * @param key + * the communication key of the expanded item + */ + public void setExpanded(String key); + + /** + * Inform the client that an item with the given key has been collapsed by + * the server. + * + * @param key + * the communication key of the collapsed item + */ + public void setCollapsed(String key); +} |