aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/main/java/com
diff options
context:
space:
mode:
authorTarek Oraby <42799254+tarekoraby@users.noreply.github.com>2020-08-26 17:31:58 +0300
committerGitHub <noreply@github.com>2020-08-26 17:31:58 +0300
commit7babdf719ca5641b8ad7ea1421c342d6cfcc427a (patch)
tree0c45986aa6d076f893312cfaec983d936e383992 /uitest/src/main/java/com
parent49f0317b72efe65fa5d585a51750172ea3dca8c7 (diff)
downloadvaadin-framework-7babdf719ca5641b8ad7ea1421c342d6cfcc427a.tar.gz
vaadin-framework-7babdf719ca5641b8ad7ea1421c342d6cfcc427a.zip
Add API to detect if GridMultiSelect select-all checkbox is checked (#12086)
Diffstat (limited to 'uitest/src/main/java/com')
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/grid/GridSelectAllStatus.java42
1 files changed, 42 insertions, 0 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridSelectAllStatus.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridSelectAllStatus.java
new file mode 100644
index 0000000000..1f9c555408
--- /dev/null
+++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridSelectAllStatus.java
@@ -0,0 +1,42 @@
+package com.vaadin.tests.components.grid;
+
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.ui.Grid;
+import com.vaadin.ui.Grid.SelectionMode;
+import com.vaadin.ui.Label;
+
+public class GridSelectAllStatus extends AbstractTestUI {
+
+ public Grid<String> grid;
+
+ @Override
+ protected void setup(VaadinRequest request) {
+ grid = new Grid<>();
+ grid.setSelectionMode(SelectionMode.MULTI);
+ grid.setItems("Item 1", "Item 2");
+ grid.addColumn(item -> item);
+
+ Label label = new Label("Select-all checkbox is checked?");
+ Label selectAllStatus = new Label(
+ String.valueOf(grid.asMultiSelect().isAllSelected()));
+ selectAllStatus.setId("status");
+
+ grid.asMultiSelect()
+ .addMultiSelectionListener(e -> selectAllStatus.setValue(
+ String.valueOf(grid.asMultiSelect().isAllSelected())));
+
+ addComponents(grid, label, selectAllStatus);
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 12081;
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "The status of the Grid's select-all checkbox should be "
+ + "accessible through the Java API.";
+ }
+}