java.lang.Object
atlantafx.base.controls.Tab
- All Implemented Interfaces:
javafx.css.Styleable
,javafx.event.EventTarget
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Resizes the tabs to a fixed width when there is available space; otherwise, it proportionally shrinks the tab width.static class
static interface
Describes the closing policies for tabs.static class
Resizes the tabs to a computed width, requiring the user to scroll horizontally if the total width exceeds the visible width of the tab line.static enum
Describes the drag policies for tabs.static class
Resizes the tabs to a fixed width, requiring the user to scroll horizontally if the total width exceeds the visible width of the tab line.static class
static interface
TheTab.ResizePolicy
interface defines the strategy for calculating the width of tabs in theTabLine
control.static class
static class
Resizes the tabs to fill all available space proportionally. -
Property Summary
PropertiesTypePropertyDescriptionfinal javafx.beans.property.ObjectProperty
<@Nullable javafx.scene.control.ContextMenu> The context menu associated with the tab.final javafx.beans.property.ObjectProperty
<@Nullable javafx.scene.Node> The graphic to show in the tab to allow the user to differentiate between the function of each tab.final javafx.beans.property.StringProperty
The simple string identifier for finding a specific tab.final javafx.beans.property.ObjectProperty
<@Nullable javafx.event.EventHandler<javafx.event.Event>> The event handler that is associated with the tab when the tab is closed.final javafx.beans.property.ObjectProperty
<@Nullable javafx.event.EventHandler<javafx.event.Event>> The event handler that is called when there is an external request to close this tab.final javafx.beans.property.ObjectProperty
<@Nullable javafx.event.EventHandler<javafx.event.Event>> The event handler that is associated with a selection on the tab.final javafx.beans.property.BooleanProperty
The pinned state for this tab.final javafx.beans.property.ReadOnlyBooleanProperty
The currently selected tab.final javafx.beans.property.StringProperty
The CSS style string associated to this tab.final javafx.beans.property.ReadOnlyObjectProperty
<@Nullable TabLine> The TabLine that contains this tab.final javafx.beans.property.StringProperty
The text to show in the tab to allow the user to differentiate between the function of each tab.final javafx.beans.property.ObjectProperty
<@Nullable javafx.scene.control.Tooltip> The tooltip associated with this tab. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final javafx.event.EventType
<javafx.event.Event> Called when a user closes this tab.protected @Nullable javafx.beans.property.ObjectProperty
<@Nullable javafx.scene.control.ContextMenu> protected static final String
protected final EventHandlerManager
protected @Nullable javafx.beans.property.ObjectProperty
<@Nullable javafx.scene.Node> protected @Nullable javafx.beans.property.StringProperty
protected @Nullable javafx.beans.property.ObjectProperty
<@Nullable javafx.event.EventHandler<javafx.event.Event>> protected @Nullable javafx.beans.property.ObjectProperty
<@Nullable javafx.event.EventHandler<javafx.event.Event>> protected @Nullable javafx.beans.property.ObjectProperty
<@Nullable javafx.event.EventHandler<javafx.event.Event>> protected @Nullable javafx.beans.property.BooleanProperty
protected @Nullable javafx.beans.property.ReadOnlyBooleanWrapper
static final javafx.event.EventType
<javafx.event.Event> Called when the tab becomes selected or unselected.protected @Nullable javafx.beans.property.StringProperty
protected final javafx.collections.ObservableList
<String> static final javafx.event.EventType
<javafx.event.Event> Called when there is an external request to close thisTab
.protected @Nullable javafx.beans.property.StringProperty
protected @Nullable javafx.beans.property.ObjectProperty
<@Nullable javafx.scene.control.Tooltip> protected static final Object
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal <E extends javafx.event.Event>
voidaddEventFilter
(javafx.event.EventType<E> eventType, javafx.event.EventHandler<? super E> eventFilter) final <E extends javafx.event.Event>
voidaddEventHandler
(javafx.event.EventType<E> eventType, javafx.event.EventHandler<? super E> eventHandler) javafx.event.EventDispatchChain
buildEventDispatchChain
(javafx.event.EventDispatchChain chain) final javafx.beans.property.ObjectProperty
<@Nullable javafx.scene.control.ContextMenu> The context menu associated with the tab.static List
<javafx.css.CssMetaData<? extends javafx.css.Styleable, ?>> Gets theCssMetaData
associated with this class, which may include theCssMetaData
of its superclasses.@Nullable javafx.scene.control.ContextMenu
Gets the value of thecontextMenu
property.List
<javafx.css.CssMetaData<? extends javafx.css.Styleable, ?>> @Nullable javafx.scene.Node
Gets the value of thegraphic
property.@Nullable String
getId()
Gets the value of theid
property.@Nullable javafx.event.EventHandler
<javafx.event.Event> Gets the value of theonClosed
property.@Nullable javafx.event.EventHandler
<javafx.event.Event> Gets the value of theonCloseRequest
property.@Nullable javafx.event.EventHandler
<javafx.event.Event> Gets the value of theonSelectionChanged
property.Returns an observable map of properties on this Tab for use primarily by application developers.final javafx.collections.ObservableSet
<javafx.css.PseudoClass> @Nullable String
getStyle()
Gets the value of thestyle
property.@Nullable javafx.css.Styleable
javafx.collections.ObservableList
<String> @Nullable TabLine
Gets the value of thetabLine
property.@Nullable String
getText()
Gets the value of thetext
property.@Nullable javafx.scene.control.Tooltip
Gets the value of thetooltip
property.Returns a previously set Object property, or null if no such property has been set using thesetUserData(Object)
method.final javafx.beans.property.ObjectProperty
<@Nullable javafx.scene.Node> The graphic to show in the tab to allow the user to differentiate between the function of each tab.boolean
Tests if this Tab has properties.final javafx.beans.property.StringProperty
The simple string identifier for finding a specific tab.boolean
isPinned()
Gets the value of thepinned
property.boolean
Gets the value of theselected
property.final javafx.beans.property.ObjectProperty
<@Nullable javafx.event.EventHandler<javafx.event.Event>> The event handler that is associated with the tab when the tab is closed.final javafx.beans.property.ObjectProperty
<@Nullable javafx.event.EventHandler<javafx.event.Event>> The event handler that is called when there is an external request to close this tab.final javafx.beans.property.ObjectProperty
<@Nullable javafx.event.EventHandler<javafx.event.Event>> The event handler that is associated with a selection on the tab.final javafx.beans.property.BooleanProperty
The pinned state for this tab.final <E extends javafx.event.Event>
voidremoveEventFilter
(javafx.event.EventType<E> eventType, javafx.event.EventHandler<? super E> eventFilter) final <E extends javafx.event.Event>
voidremoveEventHandler
(javafx.event.EventType<E> eventType, javafx.event.EventHandler<? super E> eventHandler) final javafx.beans.property.ReadOnlyBooleanProperty
The currently selected tab.protected javafx.beans.property.ReadOnlyBooleanWrapper
void
setContextMenu
(@Nullable javafx.scene.control.ContextMenu value) Sets the value of thecontextMenu
property.protected <E extends javafx.event.Event>
voidsetEventHandler
(javafx.event.EventType<E> eventType, @Nullable javafx.event.EventHandler<E> eventHandler) void
setGraphic
(@Nullable javafx.scene.Node value) Sets the value of thegraphic
property.void
Sets the value of theid
property.void
setOnClosed
(@Nullable javafx.event.EventHandler<javafx.event.Event> value) Sets the value of theonClosed
property.void
setOnCloseRequest
(@Nullable javafx.event.EventHandler<javafx.event.Event> value) Sets the value of theonCloseRequest
property.void
setOnSelectionChanged
(@Nullable javafx.event.EventHandler<javafx.event.Event> value) Sets the value of theonSelectionChanged
property.void
setPinned
(boolean value) Sets the value of thepinned
property.void
Sets the value of thestyle
property.void
Sets the value of thetext
property.void
setTooltip
(@Nullable javafx.scene.control.Tooltip value) Sets the value of thetooltip
property.void
setUserData
(Object value) Convenience method for setting a single Object property that can be retrieved at a later date.final javafx.beans.property.StringProperty
The CSS style string associated to this tab.final javafx.beans.property.ReadOnlyObjectProperty
<@Nullable TabLine> The TabLine that contains this tab.final javafx.beans.property.StringProperty
The text to show in the tab to allow the user to differentiate between the function of each tab.final javafx.beans.property.ObjectProperty
<@Nullable javafx.scene.control.Tooltip> The tooltip associated with this tab.protected void
updateSelected
(boolean value) protected void
updateTabLine
(@Nullable TabLine value) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javafx.css.Styleable
getStyleableNode
-
Property Details
-
id
public final javafx.beans.property.StringProperty idPropertyThe simple string identifier for finding a specific tab. The default value isnull
.- See Also:
-
style
public final javafx.beans.property.StringProperty stylePropertyThe CSS style string associated to this tab.- See Also:
-
selected
public final javafx.beans.property.ReadOnlyBooleanProperty selectedPropertyThe currently selected tab.- See Also:
-
text
public final javafx.beans.property.StringProperty textPropertyThe text to show in the tab to allow the user to differentiate between the function of each tab. The text is always visible.- See Also:
-
graphic
public final javafx.beans.property.ObjectProperty<@Nullable javafx.scene.Node> graphicPropertyThe graphic to show in the tab to allow the user to differentiate between the function of each tab.- See Also:
-
contextMenu
public final javafx.beans.property.ObjectProperty<@Nullable javafx.scene.control.ContextMenu> contextMenuPropertyThe context menu associated with the tab.- See Also:
-
pinned
public final javafx.beans.property.BooleanProperty pinnedPropertyThe pinned state for this tab. The default isfalse
.- See Also:
-
onSelectionChanged
public final javafx.beans.property.ObjectProperty<@Nullable javafx.event.EventHandler<javafx.event.Event>> onSelectionChangedPropertyThe event handler that is associated with a selection on the tab.- See Also:
-
onClosed
public final javafx.beans.property.ObjectProperty<@Nullable javafx.event.EventHandler<javafx.event.Event>> onClosedPropertyThe event handler that is associated with the tab when the tab is closed.- See Also:
-
tooltip
public final javafx.beans.property.ObjectProperty<@Nullable javafx.scene.control.Tooltip> tooltipPropertyThe tooltip associated with this tab.- See Also:
-
onCloseRequest
public final javafx.beans.property.ObjectProperty<@Nullable javafx.event.EventHandler<javafx.event.Event>> onCloseRequestPropertyThe event handler that is called when there is an external request to close this tab. The installed event handler can prevent tab closing by consuming the received event.- See Also:
-
tabLine
The TabLine that contains this tab.- See Also:
-
-
Field Details
-
DEFAULT_STYLE_CLASS
- See Also:
-
SELECTION_CHANGED_EVENT
public static final javafx.event.EventType<javafx.event.Event> SELECTION_CHANGED_EVENTCalled when the tab becomes selected or unselected. -
CLOSED_EVENT
public static final javafx.event.EventType<javafx.event.Event> CLOSED_EVENTCalled when a user closes this tab. -
TAB_CLOSE_REQUEST_EVENT
public static final javafx.event.EventType<javafx.event.Event> TAB_CLOSE_REQUEST_EVENTCalled when there is an external request to close thisTab
. The installed event handler thus can prevent tab closing by consuming the received event. -
id
@Nullable protected @Nullable javafx.beans.property.StringProperty id -
style
@Nullable protected @Nullable javafx.beans.property.StringProperty style -
selected
@Nullable protected @Nullable javafx.beans.property.ReadOnlyBooleanWrapper selected -
text
@Nullable protected @Nullable javafx.beans.property.StringProperty text -
graphic
@Nullable protected @Nullable javafx.beans.property.ObjectProperty<@Nullable javafx.scene.Node> graphic -
contextMenu
@Nullable protected @Nullable javafx.beans.property.ObjectProperty<@Nullable javafx.scene.control.ContextMenu> contextMenu -
pinned
@Nullable protected @Nullable javafx.beans.property.BooleanProperty pinned -
onSelectionChanged
@Nullable protected @Nullable javafx.beans.property.ObjectProperty<@Nullable javafx.event.EventHandler<javafx.event.Event>> onSelectionChanged -
onClosed
@Nullable protected @Nullable javafx.beans.property.ObjectProperty<@Nullable javafx.event.EventHandler<javafx.event.Event>> onClosed -
tooltip
@Nullable protected @Nullable javafx.beans.property.ObjectProperty<@Nullable javafx.scene.control.Tooltip> tooltip -
onCloseRequest
@Nullable protected @Nullable javafx.beans.property.ObjectProperty<@Nullable javafx.event.EventHandler<javafx.event.Event>> onCloseRequest -
USER_DATA_KEY
-
properties
-
eventHandlerManager
-
styleClass
-
-
Constructor Details
-
Tab
public Tab()Creates an empty tab. -
Tab
-
Tab
-
Tab
-
-
Method Details
-
idProperty
public final javafx.beans.property.StringProperty idProperty()The simple string identifier for finding a specific tab. The default value isnull
.- Returns:
- the
id
property - See Also:
-
getId
Gets the value of theid
property.- Specified by:
getId
in interfacejavafx.css.Styleable
- Property description:
- The simple string identifier for finding a specific tab.
The default value is
null
. - Returns:
- the value of the
id
property - See Also:
-
setId
Sets the value of theid
property.- Property description:
- The simple string identifier for finding a specific tab.
The default value is
null
. - Parameters:
value
- the value for theid
property- See Also:
-
styleProperty
public final javafx.beans.property.StringProperty styleProperty()The CSS style string associated to this tab.- Returns:
- the
style
property - See Also:
-
getStyle
Gets the value of thestyle
property.- Specified by:
getStyle
in interfacejavafx.css.Styleable
- Property description:
- The CSS style string associated to this tab.
- Returns:
- the value of the
style
property - See Also:
-
setStyle
Sets the value of thestyle
property.- Property description:
- The CSS style string associated to this tab.
- Parameters:
value
- the value for thestyle
property- See Also:
-
selectedProperty
public final javafx.beans.property.ReadOnlyBooleanProperty selectedProperty()The currently selected tab.- Returns:
- the
selected
property - See Also:
-
selectedPropertyImpl
protected javafx.beans.property.ReadOnlyBooleanWrapper selectedPropertyImpl() -
isSelected
public boolean isSelected()Gets the value of theselected
property.- Property description:
- The currently selected tab.
- Returns:
- the value of the
selected
property - See Also:
-
updateSelected
protected void updateSelected(boolean value) -
textProperty
public final javafx.beans.property.StringProperty textProperty()The text to show in the tab to allow the user to differentiate between the function of each tab. The text is always visible.- Returns:
- the
text
property - See Also:
-
getText
Gets the value of thetext
property.- Property description:
- The text to show in the tab to allow the user to differentiate between the function of each tab. The text is always visible.
- Returns:
- the value of the
text
property - See Also:
-
setText
Sets the value of thetext
property.- Property description:
- The text to show in the tab to allow the user to differentiate between the function of each tab. The text is always visible.
- Parameters:
value
- the value for thetext
property- See Also:
-
graphicProperty
public final javafx.beans.property.ObjectProperty<@Nullable javafx.scene.Node> graphicProperty()The graphic to show in the tab to allow the user to differentiate between the function of each tab.- Returns:
- the
graphic
property - See Also:
-
getGraphic
@Nullable public @Nullable javafx.scene.Node getGraphic()Gets the value of thegraphic
property.- Property description:
- The graphic to show in the tab to allow the user to differentiate between the function of each tab.
- Returns:
- the value of the
graphic
property - See Also:
-
setGraphic
public void setGraphic(@Nullable @Nullable javafx.scene.Node value) Sets the value of thegraphic
property.- Property description:
- The graphic to show in the tab to allow the user to differentiate between the function of each tab.
- Parameters:
value
- the value for thegraphic
property- See Also:
-
contextMenuProperty
public final javafx.beans.property.ObjectProperty<@Nullable javafx.scene.control.ContextMenu> contextMenuProperty()The context menu associated with the tab.- Returns:
- the
contextMenu
property - See Also:
-
getContextMenu
@Nullable public @Nullable javafx.scene.control.ContextMenu getContextMenu()Gets the value of thecontextMenu
property.- Property description:
- The context menu associated with the tab.
- Returns:
- the value of the
contextMenu
property - See Also:
-
setContextMenu
public void setContextMenu(@Nullable @Nullable javafx.scene.control.ContextMenu value) Sets the value of thecontextMenu
property.- Property description:
- The context menu associated with the tab.
- Parameters:
value
- the value for thecontextMenu
property- See Also:
-
pinnedProperty
public final javafx.beans.property.BooleanProperty pinnedProperty()The pinned state for this tab. The default isfalse
.- Returns:
- the
pinned
property - See Also:
-
isPinned
public boolean isPinned()Gets the value of thepinned
property.- Property description:
- The pinned state for this tab.
The default is
false
. - Returns:
- the value of the
pinned
property - See Also:
-
setPinned
public void setPinned(boolean value) Sets the value of thepinned
property.- Property description:
- The pinned state for this tab.
The default is
false
. - Parameters:
value
- the value for thepinned
property- See Also:
-
onSelectionChangedProperty
public final javafx.beans.property.ObjectProperty<@Nullable javafx.event.EventHandler<javafx.event.Event>> onSelectionChangedProperty()The event handler that is associated with a selection on the tab.- Returns:
- the
onSelectionChanged
property - See Also:
-
getOnSelectionChanged
@Nullable public @Nullable javafx.event.EventHandler<javafx.event.Event> getOnSelectionChanged()Gets the value of theonSelectionChanged
property.- Property description:
- The event handler that is associated with a selection on the tab.
- Returns:
- the value of the
onSelectionChanged
property - See Also:
-
setOnSelectionChanged
public void setOnSelectionChanged(@Nullable @Nullable javafx.event.EventHandler<javafx.event.Event> value) Sets the value of theonSelectionChanged
property.- Property description:
- The event handler that is associated with a selection on the tab.
- Parameters:
value
- the value for theonSelectionChanged
property- See Also:
-
onClosedProperty
public final javafx.beans.property.ObjectProperty<@Nullable javafx.event.EventHandler<javafx.event.Event>> onClosedProperty()The event handler that is associated with the tab when the tab is closed.- Returns:
- the
onClosed
property - See Also:
-
getOnClosed
@Nullable public @Nullable javafx.event.EventHandler<javafx.event.Event> getOnClosed()Gets the value of theonClosed
property.- Property description:
- The event handler that is associated with the tab when the tab is closed.
- Returns:
- the value of the
onClosed
property - See Also:
-
setOnClosed
public void setOnClosed(@Nullable @Nullable javafx.event.EventHandler<javafx.event.Event> value) Sets the value of theonClosed
property.- Property description:
- The event handler that is associated with the tab when the tab is closed.
- Parameters:
value
- the value for theonClosed
property- See Also:
-
tooltipProperty
public final javafx.beans.property.ObjectProperty<@Nullable javafx.scene.control.Tooltip> tooltipProperty()The tooltip associated with this tab.- Returns:
- the
tooltip
property - See Also:
-
getTooltip
@Nullable public @Nullable javafx.scene.control.Tooltip getTooltip()Gets the value of thetooltip
property.- Property description:
- The tooltip associated with this tab.
- Returns:
- the value of the
tooltip
property - See Also:
-
setTooltip
public void setTooltip(@Nullable @Nullable javafx.scene.control.Tooltip value) Sets the value of thetooltip
property.- Property description:
- The tooltip associated with this tab.
- Parameters:
value
- the value for thetooltip
property- See Also:
-
onCloseRequestProperty
public final javafx.beans.property.ObjectProperty<@Nullable javafx.event.EventHandler<javafx.event.Event>> onCloseRequestProperty()The event handler that is called when there is an external request to close this tab. The installed event handler can prevent tab closing by consuming the received event.- Returns:
- the
onCloseRequest
property - See Also:
-
getOnCloseRequest
@Nullable public @Nullable javafx.event.EventHandler<javafx.event.Event> getOnCloseRequest()Gets the value of theonCloseRequest
property.- Property description:
- The event handler that is called when there is an external request to close this tab. The installed event handler can prevent tab closing by consuming the received event.
- Returns:
- the value of the
onCloseRequest
property - See Also:
-
setOnCloseRequest
public void setOnCloseRequest(@Nullable @Nullable javafx.event.EventHandler<javafx.event.Event> value) Sets the value of theonCloseRequest
property.- Property description:
- The event handler that is called when there is an external request to close this tab. The installed event handler can prevent tab closing by consuming the received event.
- Parameters:
value
- the value for theonCloseRequest
property- See Also:
-
tabLineProperty
The TabLine that contains this tab.- Returns:
- the
tabLine
property - See Also:
-
getTabLine
Gets the value of thetabLine
property.- Property description:
- The TabLine that contains this tab.
- Returns:
- the value of the
tabLine
property - See Also:
-
updateTabLine
-
getProperties
-
hasProperties
public boolean hasProperties()Tests if this Tab has properties. -
getUserData
Returns a previously set Object property, or null if no such property has been set using thesetUserData(Object)
method. -
setUserData
Convenience method for setting a single Object property that can be retrieved at a later date. This is functionally equivalent to calling the getProperties().put(Object key, Object value) method. This can later be retrieved by callinggetUserData()
. -
buildEventDispatchChain
public javafx.event.EventDispatchChain buildEventDispatchChain(javafx.event.EventDispatchChain chain) - Specified by:
buildEventDispatchChain
in interfacejavafx.event.EventTarget
-
addEventHandler
public final <E extends javafx.event.Event> void addEventHandler(javafx.event.EventType<E> eventType, javafx.event.EventHandler<? super E> eventHandler) - Specified by:
addEventHandler
in interfacejavafx.event.EventTarget
-
removeEventHandler
public final <E extends javafx.event.Event> void removeEventHandler(javafx.event.EventType<E> eventType, javafx.event.EventHandler<? super E> eventHandler) - Specified by:
removeEventHandler
in interfacejavafx.event.EventTarget
-
addEventFilter
public final <E extends javafx.event.Event> void addEventFilter(javafx.event.EventType<E> eventType, javafx.event.EventHandler<? super E> eventFilter) - Specified by:
addEventFilter
in interfacejavafx.event.EventTarget
-
removeEventFilter
public final <E extends javafx.event.Event> void removeEventFilter(javafx.event.EventType<E> eventType, javafx.event.EventHandler<? super E> eventFilter) - Specified by:
removeEventFilter
in interfacejavafx.event.EventTarget
-
setEventHandler
protected <E extends javafx.event.Event> void setEventHandler(javafx.event.EventType<E> eventType, @Nullable @Nullable javafx.event.EventHandler<E> eventHandler) -
getTypeSelector
- Specified by:
getTypeSelector
in interfacejavafx.css.Styleable
-
getStyleClass
- Specified by:
getStyleClass
in interfacejavafx.css.Styleable
-
getPseudoClassStates
public final javafx.collections.ObservableSet<javafx.css.PseudoClass> getPseudoClassStates()- Specified by:
getPseudoClassStates
in interfacejavafx.css.Styleable
-
getCssMetaData
- Specified by:
getCssMetaData
in interfacejavafx.css.Styleable
-
getStyleableParent
@Nullable public @Nullable javafx.css.Styleable getStyleableParent()- Specified by:
getStyleableParent
in interfacejavafx.css.Styleable
-
getClassCssMetaData
Gets theCssMetaData
associated with this class, which may include theCssMetaData
of its superclasses.
-