aboutsummaryrefslogtreecommitdiffstats
path: root/shared
diff options
context:
space:
mode:
authorAleksi Hietanen <aleksi@vaadin.com>2017-04-06 13:09:31 +0300
committerIlia Motornyi <elmot@vaadin.com>2017-04-06 12:09:31 +0200
commit6ad53c7d6679cc60961d07ed0766b679795ac8a8 (patch)
tree0c5ff17c7662bb6c858571553f7e902e8ae3b432 /shared
parent6eed666314e1f9987bc6f52b4f2901ff7c0018b3 (diff)
downloadvaadin-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.java6
-rw-r--r--shared/src/main/java/com/vaadin/shared/ui/treegrid/TreeGridClientRpc.java45
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);
+}