Class zwt.ui.tab.TabBar
Extends
zwt.ui.Widget.
A tab bar widget. Tab items can be added to or removed from the tab bar.
CSS rules
.zwt_tabBar {}
.zwt_tabBar-vertical {}
.zwt_tabBar-horizontal {}
.zwt_tabBar-focus {}
.zwt_tabBar .zwt_tabBar-line {}
Defined in: TabBar.js.
Constructor Attributes | Constructor Name and Description |
---|---|
zwt.ui.tab.TabBar(int_tabOrientation)
Construct a tab bar.
|
Field Attributes | Field Name and Description |
---|---|
<static> |
zwt.ui.tab.TabBar.ALIGN_LEFT
Left align tab items
|
<static> |
zwt.ui.tab.TabBar.ALIGN_RIGHT
Right align tab items
|
<static> |
zwt.ui.tab.TabBar.HORIZONTAL
Indicate a horizontal tab bar
|
<static> |
zwt.ui.tab.TabBar.VERTICAL
Indicate a vertical tab bar
|
Method Attributes | Method Name and Description |
---|---|
addTab(zwt_ui_tab_TabItem_item)
Add a Tab item at the end of the tab bar.
|
|
deselect()
Deselect the current selected tab item.
|
|
Return the number of tab items in the tab bar.
|
|
Return the selected tab item.
|
|
Return the tab items alignment.
|
|
getTabAt(int_index)
Return the tab item at the specified index.
|
|
Return the tab event manager attached to the tab bar.
|
|
indexOf(zwt_ui_tab_TabItem_item)
Return the index of the specified tab item in the tabBar.
|
|
insertTab(zwt_ui_tab_TabItem_item, int_index)
Insert a tab item at the specified location in the tab bar.
|
|
processEvent(zwt_event_Event_event)
Process the specified event.
|
|
processFocusEvent(zwt_event_FocusEvent_event)
Process the specified focus event.
|
|
processTabEvent(zwt_ui_tab_TabEvent_event)
Process the specified tab event.
|
|
removeTab(zwt_ui_tab_TabItem_item, boolean_selectNeighbor)
Remove the specified tab item from the tab bar and optionally select the neighbor tab if the tab to remove is selected.
|
|
removeTabAt(int_index, boolean_selectNeighbor)
Remove the tab item at the specified index and optionally select the neighbor tab if the tab to remove is selected.
|
|
scrollTo(int_scroll, boolean_animate)
Scroll the tab bar to the specified value.
|
|
scrollToTab(int_index, boolean_animate)
Scroll the tab bar to the specified tab if it is not already in the "visible" portion of the bar.
|
|
select(zwt_ui_tab_TabItem_item, boolean_scroll, boolean_animate)
Select the specified tab item.
|
|
selectAt(int_index, boolean_scroll, boolean_animate)
Select the tab item at the specified index.
|
|
setTabAlignment(int_alignment)
Set the tab items alignment.
|
- Methods borrowed from class zwt.ui.Widget:
- addStyle, draw, getContextFill, getDimension, getElement, getElementDimension, getFill, getFocusEventManager, getId, getKeyboardEventManager, getParent, getRelativeLeft, getRelativeTop, getStyle, getWheelEventManager, hasFocus, hasStyle, isFocusable, isVisible, onEvent, processContentEvent, processKeyboardEvent, processWheelEvent, redraw, removeStyle, replaceStyle, setFill, setFocusable, setId, setStyle, setVisible
Class Detail
zwt.ui.tab.TabBar(int_tabOrientation)
Construct a tab bar.
Author: Jeremy KUHN.
Author: Jeremy KUHN.
- Parameters:
- {Integer} int_tabOrientation
- The orientation of the tab bar (one of zwt.ui.tab.TabBar.HORIZONTAL or zwt.ui.tab.TabBar.VERTICAL)
- See:
- zwt.ui.tab.TabItem
Field Detail
<static>
{Integer}
zwt.ui.tab.TabBar.ALIGN_LEFT
Left align tab items
<static>
{Integer}
zwt.ui.tab.TabBar.ALIGN_RIGHT
Right align tab items
<static>
{Integer}
zwt.ui.tab.TabBar.HORIZONTAL
Indicate a horizontal tab bar
<static>
{Integer}
zwt.ui.tab.TabBar.VERTICAL
Indicate a vertical tab bar
Method Detail
addTab(zwt_ui_tab_TabItem_item)
Add a Tab item at the end of the tab bar.
- Parameters:
- {zwt.ui.tab.TabItem} zwt_ui_tab_TabItem_item
- The tab item to add
deselect()
Deselect the current selected tab item.
{Integer}
getLength()
Return the number of tab items in the tab bar.
- Returns:
- The size of the tab bar
{zwt.ui.tab.TabItem}
getSelectedTab()
Return the selected tab item.
- Returns:
- The selected tab item
{Integer}
getTabAlignment()
Return the tab items alignment.
- Returns:
- The tab items alignment
{zwt.ui.tab.TabItem}
getTabAt(int_index)
Return the tab item at the specified index.
- Parameters:
- {Integer} int_index
- The index of the Tab item in the tab bar
- Returns:
- A Tab item or null if there's no item in the tab bar at the specified index
{zwt.ui.tab.TabEventManager}
getTabEventManager()
Return the tab event manager attached to the tab bar.
- Returns:
- The tab event manager
{Integer}
indexOf(zwt_ui_tab_TabItem_item)
Return the index of the specified tab item in the tabBar.
- Parameters:
- {zwt.ui.tab.TabItem} zwt_ui_tab_TabItem_item
- A Tab item
- Returns:
- The index of the tab item in the tabBar or -1
insertTab(zwt_ui_tab_TabItem_item, int_index)
Insert a tab item at the specified location in the tab bar.
- Parameters:
- {zwt.ui.tab.TabItem} zwt_ui_tab_TabItem_item
- The tab item to insert
- {Integer} int_index
- The index where to insert the tab item
processEvent(zwt_event_Event_event)
Process the specified event.
- Parameters:
- {zwt.event.Event} zwt_event_Event_event
- The event to process
processFocusEvent(zwt_event_FocusEvent_event)
Process the specified focus event.
- Parameters:
- {zwt.event.FocusEvent} zwt_event_FocusEvent_event
- The focus event to process
processTabEvent(zwt_ui_tab_TabEvent_event)
Process the specified tab event.
- Parameters:
- {zwt.ui.tab.TabEvent} zwt_ui_tab_TabEvent_event
- The tab event to process
removeTab(zwt_ui_tab_TabItem_item, boolean_selectNeighbor)
Remove the specified tab item from the tab bar and optionally select the neighbor tab if the tab to remove is selected.
- Parameters:
- {zwt.ui.tab.TabItem} zwt_ui_tab_TabItem_item
- The tab item to remove
- {Boolean} boolean_selectNeighbor
- true to select the neighbor tab, false otherwise
removeTabAt(int_index, boolean_selectNeighbor)
Remove the tab item at the specified index and optionally select the neighbor tab if the tab to remove is selected.
- Parameters:
- {Integer} int_index
- The index of the tab item to remove
- {Boolean} boolean_selectNeighbor
- true to select the neighbor tab, false otherwise
scrollTo(int_scroll, boolean_animate)
Scroll the tab bar to the specified value.
- Parameters:
- {Integer} int_scroll
- The scroll target in px
- {Boolean} boolean_animate
- true to use animation
scrollToTab(int_index, boolean_animate)
Scroll the tab bar to the specified tab if it is not already in the "visible" portion of the bar.
- Parameters:
- {Integer} int_index
- The index of the tab to scroll to
- {Boolean} boolean_animate
- true to use animation
select(zwt_ui_tab_TabItem_item, boolean_scroll, boolean_animate)
Select the specified tab item.
- Parameters:
- {zwt.ui.tab.TabItem} zwt_ui_tab_TabItem_item
- The tab item to select
- {Boolean} boolean_scroll
- true to scroll to the tab, true by default
- {Boolean} boolean_animate
- true to use scroll animation, false by default
selectAt(int_index, boolean_scroll, boolean_animate)
Select the tab item at the specified index.
- Parameters:
- {Integer} int_index
- The index of the tab item to select
- {Boolean} boolean_scroll
- true to scroll to the tab, true by default
- {Boolean} boolean_animate
- true to use scroll animation, false by default
setTabAlignment(int_alignment)
Set the tab items alignment.
- Parameters:
- {Integer} int_alignment
- One of zwt.ui.tab.TabBar.ALIGN_LEFT or zwt.ui.tab.TabBar.ALIGN_RIGHT