vaadin / vaadin/framework

Provide addTabs(...) method in TabSheet to add multiple tabs in one method call

Open
#8,729 1 comment 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.