public class TabbedPane extends Object
Tab.getContentTable()
and
TabbedPaneListener
). All tabs must extend Tab
class.
Since 0.9.3, tabbed pane uses an internal DragPane
to make the tabs draggable. You can completely turn off this
functionality by setting TabbedPane.TabbedPaneStyle.draggable
to false. To turn off the drag listener at runtime, use
getTabsPane()
method to get a reference of DragPane
, and invoke DragPane.setDraggable(Draggable)
with
null argument - this will clear draggable listener from all tabs' buttons; naturally, setting this value to non-null
Draggable
listener will also add it to all buttons.
Modifier and Type | Class and Description |
---|---|
static class |
TabbedPane.TabbedPaneStyle |
Constructor and Description |
---|
TabbedPane() |
TabbedPane(String styleName) |
TabbedPane(TabbedPane.TabbedPaneStyle style) |
Modifier and Type | Method and Description |
---|---|
void |
add(Tab tab) |
void |
addListener(TabbedPaneListener listener) |
protected void |
addTab(Tab tab,
int index) |
void |
disableTab(Tab tab,
boolean disable)
Disables or enables given tab.
|
Tab |
getActiveTab() |
com.badlogic.gdx.scenes.scene2d.ui.Table |
getTable() |
com.badlogic.gdx.utils.Array<Tab> |
getTabs() |
DragPane |
getTabsPane() |
protected String |
getTabTitle(Tab tab) |
void |
insert(int index,
Tab tab) |
boolean |
isAllowTabDeselect() |
boolean |
isTabDisabled(Tab tab) |
boolean |
remove(Tab tab)
Removes tab from pane, if tab is dirty this won't cause to display "Unsaved changes" dialog!
|
boolean |
remove(Tab tab,
boolean ignoreTabDirty)
Removes tab from pane, if tab is dirty and 'ignoreTabDirty == false' this will cause to display "Unsaved changes" dialog!
|
void |
removeAll()
Removes all tabs, ignores if tab is dirty
|
boolean |
removeListener(TabbedPaneListener listener) |
void |
setAllowTabDeselect(boolean allowTabDeselect) |
void |
switchTab(int index) |
void |
switchTab(Tab tab) |
protected void |
throwNotBelongingTabException(Tab tab) |
void |
updateTabTitle(Tab tab)
Must be called when you want to update tab title.
|
public TabbedPane()
public TabbedPane(String styleName)
public TabbedPane(TabbedPane.TabbedPaneStyle style)
public DragPane getTabsPane()
public void setAllowTabDeselect(boolean allowTabDeselect)
allowTabDeselect
- if true user may deselect tab, meaning that there won't be any active tab. Allows to create similar
behaviour like in Intellij IDEA bottom quick access barpublic boolean isAllowTabDeselect()
public void add(Tab tab)
public void insert(int index, Tab tab)
protected void addTab(Tab tab, int index)
tab
- will be added in the selected index.index
- index of the tab, starting from zero.public void disableTab(Tab tab, boolean disable)
When disabling, if tab is currently selected, TabbedPane will switch to first available enabled Tab. If there is no any
other enabled Tab, listener TabbedPaneListener.switchedTab(Tab)
with null Tab will be called.
When enabling Tab and there isn't any others Tab enabled and setAllowTabDeselect(boolean)
was set to false, passed
Tab will be selected. If setAllowTabDeselect(boolean)
is set to true nothing will be selected, all tabs will remain
unselected.
tab
- tab to change its statedisable
- controls whether to disable or enable this tabIllegalArgumentException
- if tab does not belong to this TabbedPanepublic boolean isTabDisabled(Tab tab)
protected void throwNotBelongingTabException(Tab tab)
public boolean remove(Tab tab)
tab
- to be removedpublic boolean remove(Tab tab, boolean ignoreTabDirty)
public void removeAll()
public void switchTab(int index)
public void switchTab(Tab tab)
public void updateTabTitle(Tab tab)
Tab.setDirty(boolean)
tab
- that title will be updatedpublic com.badlogic.gdx.scenes.scene2d.ui.Table getTable()
public Tab getActiveTab()
public void addListener(TabbedPaneListener listener)
public boolean removeListener(TabbedPaneListener listener)
public com.badlogic.gdx.utils.Array<Tab> getTabs()
Copyright © 2015. All rights reserved.