blob: 4ccc8644741b54b6ba3f27f055104cafb4211da6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
package com.vaadin.tests.components.tabsheet;
import com.vaadin.server.VaadinRequest;
import com.vaadin.shared.ui.ContentMode;
import com.vaadin.tests.components.AbstractTestUI;
import com.vaadin.ui.Button;
import com.vaadin.ui.Label;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.TabSheet.Tab;
public class TabDescriptionContentMode extends AbstractTestUI {
@Override
protected void setup(VaadinRequest request) {
TabSheet tabSheet = new TabSheet();
Tab firstTab = tabSheet.addTab(new Label());
firstTab.setCaption("First tab");
firstTab.setDescription("First tab description", ContentMode.TEXT);
Tab secondTab = tabSheet.addTab(new Label());
secondTab.setCaption("Second tab");
secondTab.setDescription("Second tab\ndescription",
ContentMode.PREFORMATTED);
Tab thirdTab = tabSheet.addTab(new Label());
thirdTab.setCaption("Third tab");
thirdTab.setDescription("<b>Third tab description</b>",
ContentMode.HTML);
Tab fourthTab = tabSheet.addTab(new Label());
fourthTab.setCaption("Fourth tab");
fourthTab.setDescription("Fourth tab description");
Button changeFourthTabDescription = new Button(
"Change fourth tab description");
changeFourthTabDescription
.addClickListener(event -> fourthTab.setDescription(
"Fourth tab description, changed", ContentMode.TEXT));
addComponents(tabSheet, changeFourthTabDescription);
}
}
|