Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: Tab

[18:7] extends: FxObj

The Tab class wraps the JavaFX Tab, which represents a single selectable tab within a TabPane. Each Tab holds a label, an optional graphic icon, and a content node that is displayed in the TabPane body when that tab is selected. Tabs can be individually disabled or made non-closable regardless of the TabPane closing policy. Note that Tab does not extend Node or Region in JavaFX -- it is not part of the scene graph on its own. Its visual appearance is controlled entirely through the skin of the owning TabPane and the CSS sub-structure of that skin. Because of this, the standard Node/Region/Control CSS property hierarchy does not apply directly to Tab.

Methods

  • Tab (string Text = "")

    Creates a new Tab with the specified label text.

    • @p Text is a string with the tab label.
  • setText (string Text)

    Sets the tab label text.

    • @p Text is a string with the label.
    • @r this object for chaining
  • getText ()

    Gets the tab label text.

    • @r A string with the label.
  • setContent (object ContentObj)

    Sets the content node displayed when this tab is selected.

    • @p ContentObj is a Node object to display.
    • @r this object for chaining
  • setClosable (bool Closable)

    Sets whether the tab can be closed by the user.

    • @p Closable is a bool with true to allow closing.
    • @r this object for chaining
  • setGraphic (object Graphic)

    Sets a graphic (icon) for the tab.

    • @p Graphic is a Node object to use as the graphic.
    • @r this object for chaining
  • setDisable (bool Disable)

    Sets whether the tab is disabled.

    • @p Disable is a bool with true to disable.
    • @r this object for chaining
  • getContent ()

    Returns the content node displayed when this tab is selected.

    • @r A Node with the current content, or null if none is set.
  • isClosable ()

    Returns whether the tab can be closed by the user.

    • @r A bool with true if the tab is closable.
  • setId (string Id)

    Sets the CSS id of this tab.

    • @p Id is a string with the CSS id.
    • @r this object for chaining
  • setStyle (string Style)

    Sets the inline CSS style string for this tab.

    • @p Style is a string with the CSS style rules.
    • @r this object for chaining
  • onClosed (callback OnClosed)

    Sets a callback for when the tab is closed.

    • @p OnClosed is a callback to call on close.
    • @r this object for chaining
  • setOnSelectionChanged (callback OnChanged)

    Sets a callback that fires when this tab's selected state changes.

    • @p OnChanged is a callback to call on selection change.
    • @r this object for chaining
  • getId ()

    Returns the CSS id of this tab.

    • @r A string with the id.
  • idProperty ()

    Returns the id StringProperty for binding.

    • @r An AJO around the StringProperty.
  • getStyle ()

    Returns the inline CSS style string.

    • @r A string with the style.
  • styleProperty ()

    Returns the style StringProperty for binding.

    • @r An AJO around the StringProperty.
  • isSelected ()

    Returns whether this tab is the currently selected tab in its owning TabPane.

    • @r A bool with true if selected.
  • selectedProperty ()

    Returns the selected ReadOnlyBooleanProperty for binding.

    • @r An AJO around the ReadOnlyBooleanProperty.
  • getTabPane ()

    Returns the owning TabPane, or null if this tab is not in a pane.

    • @r An AJO around the TabPane, or null.
  • tabPaneProperty ()

    Returns the tabPane ReadOnlyObjectProperty for binding.

    • @r An AJO around the ReadOnlyObjectProperty.
  • textProperty ()

    Returns the text StringProperty for binding.

    • @r An AJO around the StringProperty.
  • getGraphic ()

    Returns the graphic node displayed in the tab header.

    • @r An AJO around the Node, or null.
  • graphicProperty ()

    Returns the graphic ObjectProperty for binding.

    • @r An AJO around the ObjectProperty.
  • contentProperty ()

    Returns the content ObjectProperty for binding.

    • @r An AJO around the ObjectProperty.
  • setContextMenu (object Menu)

    Sets the context menu shown when the user right-clicks this tab.

    • @p Menu is a ContextMenu wrapper object.
    • @r this object for chaining
  • getContextMenu ()

    Returns the context menu for this tab.

    • @r An AJO around the ContextMenu, or null.
  • contextMenuProperty ()

    Returns the contextMenu ObjectProperty for binding.

    • @r An AJO around the ObjectProperty.
  • closableProperty ()

    Returns the closable BooleanProperty for binding.

    • @r An AJO around the BooleanProperty.
  • getOnSelectionChanged ()

    Returns the current selection-changed event handler.

    • @r An AJO around the EventHandler, or null.
  • onSelectionChangedProperty ()

    Returns the onSelectionChanged ObjectProperty for binding.

    • @r An AJO around the ObjectProperty.
  • setOnClosed (callback Cb)

    Sets a callback that fires after the tab has been closed.

    • @p Cb is a callback receiving an Event.
    • @r this object for chaining
  • getOnClosed ()

    Returns the current on-closed event handler.

    • @r An AJO around the EventHandler, or null.
  • onClosedProperty ()

    Returns the onClosed ObjectProperty for binding.

    • @r An AJO around the ObjectProperty.
  • setTooltip (object Tip)

    Sets the tooltip shown when the user hovers over this tab.

    • @p Tip is a Tooltip wrapper object.
    • @r this object for chaining
  • getTooltip ()

    Returns the tooltip for this tab.

    • @r An AJO around the Tooltip, or null.
  • tooltipProperty ()

    Returns the tooltip ObjectProperty for binding.

    • @r An AJO around the ObjectProperty.
  • isDisable ()

    Returns whether this tab has been explicitly disabled.

    • @r A bool with true if disabled.
  • disableProperty ()

    Returns the disable BooleanProperty for binding.

    • @r An AJO around the BooleanProperty.
  • isDisabled ()

    Returns whether this tab is in the disabled state (computed from the disable property and the tab's ancestors).

    • @r A bool with true if disabled.
  • disabledProperty ()

    Returns the disabled ReadOnlyBooleanProperty for binding.

    • @r An AJO around the ReadOnlyBooleanProperty.
  • onCloseRequestProperty ()

    Returns the onCloseRequest ObjectProperty for binding.

    • @r An AJO around the ObjectProperty.
  • getOnCloseRequest ()

    Returns the current on-close-request event handler.

    • @r An AJO around the EventHandler, or null.
  • setOnCloseRequest (callback Cb)

    Sets a callback that fires before this tab is closed, allowing the close to be vetoed by consuming the event.

    • @p Cb is a callback receiving an Event.
    • @r this object for chaining
  • getProperties ()

    Returns the general-purpose ObservableMap of properties on this tab.

    • @r An AJO around the ObservableMap<Object,Object>.
  • hasProperties ()

    Returns whether this tab has any entries in its properties map.

    • @r A bool with true if properties exist.
  • setUserData (Value)

    Sets the user-data slot on this tab.

    • @p Value is any value to store on the tab.
    • @r this object for chaining
  • getUserData ()

    Returns the user-data slot value stored on this tab.

    • @r An AJO around the stored value, or null.
  • getStyleClass ()

    Returns the CSS style-class ObservableList for this tab.

    • @r An AJO around the ObservableList.
  • buildEventDispatchChain (object Tail)

    Builds the event dispatch chain for this tab from the supplied tail.

    • @p Tail is an AJO around a javafx.event.EventDispatchChain.
    • @r An AJO around the resulting EventDispatchChain.
  • getTypeSelector ()

    Returns the CSS type selector for this Styleable.

    • @r A string with the type selector.
  • getStyleableParent ()

    Returns the styleable parent of this tab.

    • @r An AJO around the parent Styleable, or null.
  • getPseudoClassStates ()

    Returns the set of CSS pseudo-class states currently active.

    • @r An AJO around the ObservableSet.
  • getCssMetaData ()

    Returns the CSS metadata for this tab's styleable properties.

    • @r A list of CssMetaData entries.