Provide addTabs(...) method in TabSheet to add multiple tabs in one method call
Open
Nobody has claimed this yet.
enhancement
- Dominant language
- Java
- Stars
- 1.8k
- Forks
- 717
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 3
Description
-Vaadin 8
Similarly to VerticalLayout's addComponents(...) method, it would be handy to have an addTabs(...) method in TabSheet in order to add multiple tabs in just one call.
Old code would look like this:
TabSheet tabSheet = new TabSheet();
VerticalLayout tab1 = new VerticalLayout();
tab1.setCaption("Tab 1");
VerticalLayout tab2 = new VerticalLayout();
tab2.setCaption("Tab 2");
VerticalLayout tab3 = new VerticalLayout();
tab3.setCaption("Tab 3");
tabSheet.addTab(tab1);
tabSheet.addTab(tab2);
tabSheet.addTab(tab3);
New code would look like this (slightly reducing code lines):
TabSheet tabSheet = new TabSheet();
VerticalLayout tab1 = new VerticalLayout();
tab1.setCaption("Tab 1");
VerticalLayout tab2 = new VerticalLayout();
tab2.setCaption("Tab 2");
VerticalLayout tab3 = new VerticalLayout();
tab3.setCaption("Tab 3");
tabSheet.addTabs(tab1, tab2, tab3);
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with TabSheet's existing addTab method and related API behavior. Add an addTabs(...) method that accepts multiple tabs and preserves the behavior of individual additions, then verify that the example call works as intended.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- frontend, web-dev
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100