Spec-Zone .ru
спецификации, руководства, описания, API
|
public class Tab extends java.lang.Object implements EventTarget
Type | Property and Description |
---|---|
BooleanProperty |
closable
The closable state for this tab.
|
ObjectProperty<Node> |
content
The content associated with the tab.
|
ObjectProperty<ContextMenu> |
contextMenu
The context menu associated with the tab.
|
ObjectProperty<Node> |
graphic
The graphic in the tab.
|
StringProperty |
id
The id of this tab.
|
ObjectProperty<EventHandler<Event>> |
onClosed
The event handler that is associated with the tab when the tab is closed.
|
ObjectProperty<EventHandler<Event>> |
onSelectionChanged
The event handler that is associated with a selection on the tab.
|
ReadOnlyBooleanProperty |
selected
The currently selected tab.
|
StringProperty |
style
The CSS style string associated to this tab.
|
ReadOnlyObjectProperty<TabPane> |
tabPane
The TabPane that contains this tab.
|
StringProperty |
text
The text shown in the tab.
|
ObjectProperty<Tooltip> |
tooltip
The tooltip associated with this tab.
|
Modifier and Type | Field and Description |
---|---|
static EventType<Event> |
CLOSED_EVENT
Called when a user closes this tab.
|
static EventType<Event> |
SELECTION_CHANGED_EVENT
Called when the tab becomes selected or unselected.
|
Constructor and Description |
---|
Tab()
Creates a tab with no title.
|
Tab(java.lang.String text)
Creates a tab with a text title.
|
Modifier and Type | Method and Description |
---|---|
BooleanProperty |
closableProperty()
The closable state for this tab.
|
ObjectProperty<Node> |
contentProperty()
The content associated with the tab.
|
ObjectProperty<ContextMenu> |
contextMenuProperty()
The context menu associated with the tab.
|
Node |
getContent()
The content associated with the tab.
|
ContextMenu |
getContextMenu()
The context menu associated with the tab.
|
Node |
getGraphic()
The graphic shown in the tab.
|
java.lang.String |
getId()
The id of this tab.
|
EventHandler<Event> |
getOnClosed()
The event handler that is associated with the tab when the tab is closed.
|
EventHandler<Event> |
getOnSelectionChanged()
The event handler that is associated with a selection on the tab.
|
java.lang.String |
getStyle()
The CSS style string associated to this tab.
|
ObservableList<java.lang.String> |
getStyleClass()
A list of String identifiers which can be used to logically group
Nodes, specifically for an external style engine.
|
TabPane |
getTabPane()
A reference to the TabPane that contains this tab instance.
|
java.lang.String |
getText()
The text shown in the tab.
|
Tooltip |
getTooltip()
The tooltip associated with this tab.
|
ObjectProperty<Node> |
graphicProperty()
The graphic in the tab.
|
StringProperty |
idProperty()
The id of this tab.
|
boolean |
isClosable()
Returns
true if this tab is closable. |
boolean |
isSelected()
Represents whether this tab is the currently selected tab,
To change the selected Tab use
tabPane.getSelectionModel().select() |
ObjectProperty<EventHandler<Event>> |
onClosedProperty()
The event handler that is associated with the tab when the tab is closed.
|
ObjectProperty<EventHandler<Event>> |
onSelectionChangedProperty()
The event handler that is associated with a selection on the tab.
|
ReadOnlyBooleanProperty |
selectedProperty()
The currently selected tab.
|
void |
setClosable(boolean value)
Sets
true if the tab is closable. |
void |
setContent(Node value)
The content to show within the main TabPane area.
|
void |
setContextMenu(ContextMenu value)
Specifies the context menu to show when the user right-clicks on the tab.
|
void |
setGraphic(Node value)
Sets the graphic to show in the tab to allow the user to differentiate
between the function of each tab.
|
void |
setId(java.lang.String value)
Sets the id of this tab.
|
void |
setOnClosed(EventHandler<Event> value)
Defines a function to be called when the tab is closed.
|
void |
setOnSelectionChanged(EventHandler<Event> value)
Defines a function to be called when a selection changed has occurred on the tab.
|
void |
setStyle(java.lang.String value)
A string representation of the CSS style associated with this
tab.
|
void |
setText(java.lang.String value)
Sets the text to show in the tab to allow the user to differentiate between
the function of each tab.
|
void |
setTooltip(Tooltip value)
Specifies the tooltip to show when the user hovers over the tab.
|
StringProperty |
styleProperty()
The CSS style string associated to this tab.
|
ReadOnlyObjectProperty<TabPane> |
tabPaneProperty()
The TabPane that contains this tab.
|
StringProperty |
textProperty()
The text shown in the tab.
|
ObjectProperty<Tooltip> |
tooltipProperty()
The tooltip associated with this tab.
|
getId()
,
setId(String)
getStyle()
,
setStyle(String)
isSelected()
getTabPane()
getText()
,
setText(String)
getGraphic()
,
setGraphic(Node)
The content associated with the tab.
getContent()
,
setContent(Node)
getContextMenu()
,
setContextMenu(ContextMenu)
isClosable()
,
setClosable(boolean)
getOnClosed()
,
setOnClosed(EventHandler)
getTooltip()
,
setTooltip(Tooltip)
public static final EventType<Event> SELECTION_CHANGED_EVENT
Called when the tab becomes selected or unselected.
public Tab()
public Tab(java.lang.String text)
text
- The title of the tab.public final void setId(java.lang.String value)
TabPane
. The default value is null
.public final java.lang.String getId()
public final StringProperty idProperty()
getId()
,
setId(String)
public final void setStyle(java.lang.String value)
Parsing this style might not be supported on some limited platforms. It is recommended to use a standalone CSS file instead.
public final java.lang.String getStyle()
public final StringProperty styleProperty()
getStyle()
,
setStyle(String)
public final boolean isSelected()
Represents whether this tab is the currently selected tab,
To change the selected Tab use tabPane.getSelectionModel().select()
public final ReadOnlyBooleanProperty selectedProperty()
isSelected()
public final TabPane getTabPane()
A reference to the TabPane that contains this tab instance.
public final ReadOnlyObjectProperty<TabPane> tabPaneProperty()
getTabPane()
public final void setText(java.lang.String value)
Sets the text to show in the tab to allow the user to differentiate between the function of each tab. The text is always visible
public final java.lang.String getText()
public final StringProperty textProperty()
getText()
,
setText(String)
public final void setGraphic(Node value)
Sets the graphic to show in the tab to allow the user to differentiate between the function of each tab. By default the graphic does not rotate based on the TabPane.tabPosition value, but it can be set to rotate by setting TabPane.rotateGraphic to true.
public final Node getGraphic()
public final ObjectProperty<Node> graphicProperty()
getGraphic()
,
setGraphic(Node)
public final void setContent(Node value)
The content to show within the main TabPane area. The content can be any Node such as UI controls or groups of nodes added to a layout container.
public final Node getContent()
The content associated with the tab.
public final ObjectProperty<Node> contentProperty()
The content associated with the tab.
getContent()
,
setContent(Node)
public final void setContextMenu(ContextMenu value)
Specifies the context menu to show when the user right-clicks on the tab.
public final ContextMenu getContextMenu()
public final ObjectProperty<ContextMenu> contextMenuProperty()
getContextMenu()
,
setContextMenu(ContextMenu)
public final void setClosable(boolean value)
Sets true
if the tab is closable. If this is set to false
,
then regardless of the TabClosingPolicy, it will not be
possible for the user to close this tab. Therefore, when this
property is false
, no 'close' button will be shown on the tab.
The default is true
.
public final boolean isClosable()
true
if this tab is closable.true
if the tab is closable.public final BooleanProperty closableProperty()
isClosable()
,
setClosable(boolean)
public final void setOnSelectionChanged(EventHandler<Event> value)
public final EventHandler<Event> getOnSelectionChanged()
public final ObjectProperty<EventHandler<Event>> onSelectionChangedProperty()
public final void setOnClosed(EventHandler<Event> value)
public final EventHandler<Event> getOnClosed()
public final ObjectProperty<EventHandler<Event>> onClosedProperty()
getOnClosed()
,
setOnClosed(EventHandler)
public final void setTooltip(Tooltip value)
Specifies the tooltip to show when the user hovers over the tab.
public final Tooltip getTooltip()
public final ObjectProperty<Tooltip> tooltipProperty()
getTooltip()
,
setTooltip(Tooltip)
public ObservableList<java.lang.String> getStyleClass()
Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. Use is subject to