diff options
author | Knoobie <Knoobie@gmx.de> | 2017-10-11 12:15:26 +0200 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-10-11 13:15:26 +0300 |
commit | 0843f53881a3514a72370e51ab33f59df423aa0e (patch) | |
tree | b094e68eb28adf57a540c2624f9ad78f888fddf9 /uitest/src/main/java | |
parent | 69c6675572e05c6b9c193b402f8d980f6af40884 (diff) | |
download | vaadin-framework-0843f53881a3514a72370e51ab33f59df423aa0e.tar.gz vaadin-framework-0843f53881a3514a72370e51ab33f59df423aa0e.zip |
Add aria-rowcount to grid (#10167)
This is based on discussion from vaadin/vaadin-grid#1023 .
Diffstat (limited to 'uitest/src/main/java')
3 files changed, 108 insertions, 1 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 index 144e518c43..0841c5f3b1 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridAriaMultiselectable.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridAriaMultiselectable.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 Vaadin Ltd. + * Copyright 2000-2017 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 diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridAriaRowcount.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridAriaRowcount.java new file mode 100644 index 0000000000..2f67a63031 --- /dev/null +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridAriaRowcount.java @@ -0,0 +1,54 @@ +/* + * Copyright 2000-2017 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 GridAriaRowcount extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + Grid<String> grid = new Grid<>(); + grid.addColumn(ValueProvider.identity()); + grid.setItems("a", "b"); + addComponent(grid); + + addComponent(new Button("addFooter", event -> grid.addFooterRowAt(0))); + addComponent(new Button("removeFooter", event -> grid.removeFooterRow(0))); + + addComponent(new Button("addHeader", event -> grid.addHeaderRowAt(1))); + addComponent(new Button("removeHeader", event -> grid.removeHeaderRow(1))); + + addComponent(new Button("setItemsTo3", event -> grid.setItems("a", "b", "c"))); + addComponent(new Button("setItemsTo6", event -> grid.setItems("a", "b", "c", "d", "e", "f"))); + + addComponent(new Button("updateAll", event -> { + grid.addFooterRowAt(0); + grid.addHeaderRowAt(0); + grid.setItems("a", "b", "c", "d"); + })); + + } +} diff --git a/uitest/src/main/java/com/vaadin/tests/components/treegrid/TreeGridAriaRowcount.java b/uitest/src/main/java/com/vaadin/tests/components/treegrid/TreeGridAriaRowcount.java new file mode 100644 index 0000000000..ed0a89274a --- /dev/null +++ b/uitest/src/main/java/com/vaadin/tests/components/treegrid/TreeGridAriaRowcount.java @@ -0,0 +1,53 @@ +/* + * Copyright 2000-2017 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.treegrid; + +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.TreeGrid; + +/** + * @author Vaadin Ltd + * + */ +public class TreeGridAriaRowcount extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + TreeGrid<String> grid = new TreeGrid<>(); + grid.addColumn(ValueProvider.identity()); + grid.setItems("a", "b"); + addComponent(grid); + + addComponent(new Button("addFooter", event -> grid.addFooterRowAt(0))); + addComponent(new Button("removeFooter", event -> grid.removeFooterRow(0))); + + addComponent(new Button("addHeader", event -> grid.addHeaderRowAt(1))); + addComponent(new Button("removeHeader", event -> grid.removeHeaderRow(1))); + + addComponent(new Button("setItemsTo3", event -> grid.setItems("a", "b", "c"))); + addComponent(new Button("setItemsTo6", event -> grid.setItems("a", "b", "c", "d", "e", "f"))); + + addComponent(new Button("updateAll", event -> { + grid.addFooterRowAt(0); + grid.addHeaderRowAt(0); + grid.setItems("a", "b", "c", "d"); + })); + + } +} |