summaryrefslogtreecommitdiffstats
path: root/uitest/src/main
diff options
context:
space:
mode:
authorKnoobie <Knoobie@gmx.de>2017-10-04 07:51:31 +0200
committerHenri Sara <henri.sara@gmail.com>2017-10-04 08:51:31 +0300
commit80336d30ed12d53f24c01de5c4b6274ccc094b3b (patch)
treedd3994504c85feade1810478faa372f5229ffefc /uitest/src/main
parentbf690d31eb986ef1803324ff2bd628104a7cb0fe (diff)
downloadvaadin-framework-80336d30ed12d53f24c01de5c4b6274ccc094b3b.tar.gz
vaadin-framework-80336d30ed12d53f24c01de5c4b6274ccc094b3b.zip
Add role="grid" and aria-multiselectable to grid (#10009)
Also adds aria-selected for grid rows.
Diffstat (limited to 'uitest/src/main')
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/grid/GridAriaMultiselectable.java50
1 files changed, 50 insertions, 0 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridAriaMultiselectable.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridAriaMultiselectable.java
new file mode 100644
index 0000000000..144e518c43
--- /dev/null
+++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridAriaMultiselectable.java
@@ -0,0 +1,50 @@
+/*
+ * 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.tests.components.grid;
+
+import com.vaadin.data.ValueProvider;
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Grid;
+import com.vaadin.ui.Grid.SelectionMode;
+
+/**
+ * @author Vaadin Ltd
+ *
+ */
+public class GridAriaMultiselectable extends AbstractTestUI {
+
+ @Override
+ protected void setup(VaadinRequest request) {
+ Grid<String> grid = new Grid<>();
+ grid.addColumn(ValueProvider.identity());
+ grid.setItems("a", "b");
+ grid.setSelectionMode(SelectionMode.NONE);
+
+ addComponent(grid);
+
+ Button singleSelectBtn = new Button("SingleSelect", event -> {
+ grid.setSelectionMode(SelectionMode.SINGLE);
+ });
+ addComponent(singleSelectBtn);
+
+ Button multiSelectBtn = new Button("MultiSelect", event -> {
+ grid.setSelectionMode(SelectionMode.MULTI);
+ });
+ addComponent(multiSelectBtn);
+ }
+}