diff options
author | Anna Koskinen <Ansku@users.noreply.github.com> | 2021-08-13 17:05:50 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-13 17:05:50 +0300 |
commit | 54230dfa058c49bbe9e825c77cf82d9c0a170c4c (patch) | |
tree | 5cf04c471d838d521fc07b7832cd697f9b1b2a0e /uitest/src/main/java/com/vaadin/tests | |
parent | 5dd5cdca20b5ece095057c852b3a40f01bc95298 (diff) | |
download | vaadin-framework-54230dfa058c49bbe9e825c77cf82d9c0a170c4c.tar.gz vaadin-framework-54230dfa058c49bbe9e825c77cf82d9c0a170c4c.zip |
Reworked and cleaned up client-side TabSheet and Accordion. (#12357)
- Added and corrected JavaDocs.
- Deprecated unused public methods.
- Fixed first tab style logic in TabSheet.
- Fixed navigation focus logic in TabSheet.
- Fixed tab width bookkeeping for scrolling TabSheet tabs.
- Renamed private methods and variables for clarity.
- Removed unnecessary or duplicated private methods.
- Reworked some logic to clarify it and to better match my understanding
of what's supposed to happen within those methods.
- Updated some deprecated method calls to use currently recommended
solutions.
- Added and updated regression tests.
Diffstat (limited to 'uitest/src/main/java/com/vaadin/tests')
2 files changed, 29 insertions, 5 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/components/tabsheet/ScrolledTabSheetHiddenTabsResize.java b/uitest/src/main/java/com/vaadin/tests/components/tabsheet/ScrolledTabSheetHiddenTabsResize.java new file mode 100644 index 0000000000..6584cd69a5 --- /dev/null +++ b/uitest/src/main/java/com/vaadin/tests/components/tabsheet/ScrolledTabSheetHiddenTabsResize.java @@ -0,0 +1,20 @@ +package com.vaadin.tests.components.tabsheet; + +import com.vaadin.ui.Label; +import com.vaadin.ui.TabSheet; +import com.vaadin.ui.TabSheet.Tab; + +public class ScrolledTabSheetHiddenTabsResize extends ScrolledTabSheetResize { + + @Override + protected void populate(TabSheet tabSheet) { + for (int i = 0; i < 40; i++) { + String caption = "Tab " + i; + Label label = new Label(caption); + + Tab tab = tabSheet.addTab(label, caption); + tab.setClosable(true); + tab.setVisible(i % 2 != 0); + } + } +} diff --git a/uitest/src/main/java/com/vaadin/tests/components/tabsheet/ScrolledTabSheetResize.java b/uitest/src/main/java/com/vaadin/tests/components/tabsheet/ScrolledTabSheetResize.java index c84ba5e3ef..28b37ec4e4 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/tabsheet/ScrolledTabSheetResize.java +++ b/uitest/src/main/java/com/vaadin/tests/components/tabsheet/ScrolledTabSheetResize.java @@ -21,6 +21,15 @@ public class ScrolledTabSheetResize extends AbstractTestUI { TabSheet tabSheet = new TabSheet(); tabSheet.setSizeFull(); + populate(tabSheet); + + addComponent(tabSheet); + addComponent(new Button("use reindeer", e -> { + setTheme("reindeer"); + })); + } + + protected void populate(TabSheet tabSheet) { for (int i = 0; i < 20; i++) { String caption = "Tab " + i; Label label = new Label(caption); @@ -28,11 +37,6 @@ public class ScrolledTabSheetResize extends AbstractTestUI { Tab tab = tabSheet.addTab(label, caption); tab.setClosable(true); } - - addComponent(tabSheet); - addComponent(new Button("use reindeer", e -> { - setTheme("reindeer"); - })); } @Override |