aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/main/java/com/vaadin/tests
diff options
context:
space:
mode:
authorAnna Koskinen <Ansku@users.noreply.github.com>2021-08-13 17:05:50 +0300
committerGitHub <noreply@github.com>2021-08-13 17:05:50 +0300
commit54230dfa058c49bbe9e825c77cf82d9c0a170c4c (patch)
tree5cf04c471d838d521fc07b7832cd697f9b1b2a0e /uitest/src/main/java/com/vaadin/tests
parent5dd5cdca20b5ece095057c852b3a40f01bc95298 (diff)
downloadvaadin-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')
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/tabsheet/ScrolledTabSheetHiddenTabsResize.java20
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/tabsheet/ScrolledTabSheetResize.java14
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