Class TabSheetTester
-
- All Implemented Interfaces:
public class TabSheetTester<T extends TabSheet> extends ComponentTester<T>
Tester for TabSheet component.
-
-
Constructor Summary
Constructors Constructor Description TabSheetTester(T component)Wrap given component for testing.
-
Method Summary
Modifier and Type Method Description voidselect(String label)Selects the tab with the given label. voidselect(int index)Selects a visible tab based on its zero-based index. booleanisSelected(String label)Checks if the tab with the given label is currently selected. booleanisSelected(int index)Checks if the visible tab at the given index is currently selected. TabgetTab(String label)Gets the visible tab with the given label. TabgetTab(int index)Gets the visible tab at given index. <E extends Component> EgetTabContent(String label)Gets the content of the visible tab with the given label. <E extends Component> EgetTabContent(int index)Gets the content of the visible tab at given index. -
-
Constructor Detail
-
TabSheetTester
TabSheetTester(T component)
Wrap given component for testing.- Parameters:
component- target component
-
-
Method Detail
-
select
void select(String label)
Selects the tab with the given label.
- Parameters:
label- the tab label
-
select
void select(int index)
Selects a visible tab based on its zero-based index.
The
indexrefers to the zero-base position of the currently visible tabs. For example, if there are three tabs A (position 0), B (position 1) and C (position 2), but tab 'B' is hidden, then to select tab 'C' the call must beselect(1)and notselect(2).- Parameters:
index- the zero-based index of the selected tab, negative value to unselect
-
isSelected
boolean isSelected(String label)
Checks if the tab with the given label is currently selected.
- Parameters:
label- the tab label- Returns:
true if the tab is selected, false otherwise.
-
isSelected
boolean isSelected(int index)
Checks if the visible tab at the given index is currently selected.
The
indexrefers to the zero-base position of the currently visible tabs. For example, if there are three tabs A (position 0), B (position 1) and C (position 2), but tab 'B' is hidden, then to check if tab 'C' is selected the call must beisSelected(1)and notisSelected(2).- Parameters:
index- the zero-based index of the tab- Returns:
true if the tab is selected, false otherwise.
-
getTab
Tab getTab(String label)
Gets the visible tab with the given label.
- Parameters:
label- the tab label
-
getTab
Tab getTab(int index)
Gets the visible tab at given index.
The
indexrefers to the zero-base position of the currently visible tabs. For example, if there are three tabs A (position 0), B (position 1) and C (position 2), but tab 'B' is hidden, then to get tab 'C', the call must begetTab(1)and notgetTab(2).- Parameters:
index- the zero-based index of the selected tab, negative value to unselect- Returns:
the tab at the given index
-
getTabContent
<E extends Component> E getTabContent(String label)
Gets the content of the visible tab with the given label.
- Parameters:
label- the tab label- Returns:
the content of the tab with the given label
-
getTabContent
<E extends Component> E getTabContent(int index)
Gets the content of the visible tab at given index.
The
indexrefers to the zero-base position of the currently visible tabs. For example, if there are three tabs A (position 0), B (position 1) and C (position 2), but tab 'B' is hidden, then to get the content of tab 'C', the call must begetTabContent(1)and notgetTabContent(2).- Parameters:
index- the zero-based index of the selected tab, negative value to unselect- Returns:
the content of the tab at the given index
-
-
-
-