Spec-Zone .ru
спецификации, руководства, описания, API
|
@DefaultProperty(value="tabs") public class TabPane extends Control
A control that allows switching between a group of Tabs
. Only one tab
is visible at a time. Tabs are added to the TabPane by using the getTabs()
.
Tabs in a TabPane can be positioned at any of the four sides by specifying the
Side
.
A TabPane has two modes floating or recessed. Applying the styleclass STYLE_CLASS_FLOATING will change the TabPane mode to floating.
The tabs width and height can be set to a specific size by setting the min and max for height and width. TabPane default width will be determined by the largest content width in the TabPane. This is the same for the height. If a different size is desired the width and height of the TabPane can be overridden by setting the min, pref and max size.
When the number of tabs do not fit the TabPane a menu button will appear on the right. The menu button is used to select the tabs that are currently not visible.
Example:
TabPane tabPane = new TabPane();
Tab tab = new Tab();
tab.setText("new tab");
tab.setContent(new Rectangle(200,200, Color.LIGHTSTEELBLUE));
tabPane.getTabs().add(tab);
Tab
Type | Property and Description |
---|---|
BooleanProperty |
rotateGraphic
The rotatedGraphic state of the tabs in the TabPane.
|
ObjectProperty<SingleSelectionModel<Tab>> |
selectionModel
The selection model used for selecting tabs.
|
ObjectProperty<Side> |
side
The position of the tabs in the TabPane.
|
ObjectProperty<TabPane.TabClosingPolicy> |
tabClosingPolicy
The closing policy for the tabs.
|
DoubleProperty |
tabMaxHeight
The maximum height of the tabs in the TabPane.
|
DoubleProperty |
tabMaxWidth
The maximum width of the tabs in the TabPane.
|
DoubleProperty |
tabMinHeight
The minimum height of the tab.
|
DoubleProperty |
tabMinWidth
The minimum width of the tabs in the TabPane.
|
contextMenu, height, maxHeight, maxWidth, minHeight, minWidth, prefHeight, prefWidth, skinClassName, skin, tooltip, width
needsLayout
blendMode, boundsInLocal, boundsInParent, cacheHint, cache, clip, cursor, depthTest, disabled, disable, effect, eventDispatcher, focused, focusTraversable, hover, id, inputMethodRequests, layoutBounds, layoutX, layoutY, localToParentTransform, localToSceneTransform, managed, mouseTransparent, onContextMenuRequested, onDragDetected, onDragDone, onDragDropped, onDragEntered, onDragExited, onDragOver, onInputMethodTextChanged, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragEntered, onMouseDragExited, onMouseDragged, onMouseDragOver, onMouseDragReleased, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onRotate, onRotationFinished, onRotationStarted, onScrollFinished, onScroll, onScrollStarted, onSwipeDown, onSwipeLeft, onSwipeRight, onSwipeUp, onTouchMoved, onTouchPressed, onTouchReleased, onTouchStationary, onZoomFinished, onZoom, onZoomStarted, opacity, parent, pickOnBounds, pressed, rotate, rotationAxis, scaleX, scaleY, scaleZ, scene, style, translateX, translateY, translateZ, visible
Modifier and Type | Class and Description |
---|---|
static class |
TabPane.TabClosingPolicy
This specifies how the TabPane handles tab closing from an end-users
perspective.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
STYLE_CLASS_FLOATING
TabPane mode will be changed to floating allowing the TabPane
to be placed alongside other control.
|
USE_COMPUTED_SIZE, USE_PREF_SIZE
Constructor and Description |
---|
TabPane()
Constructs a new TabPane.
|
Modifier and Type | Method and Description |
---|---|
SingleSelectionModel<Tab> |
getSelectionModel()
Gets the model used for tab selection.
|
Side |
getSide()
The current position of the tabs in the TabPane.
|
TabPane.TabClosingPolicy |
getTabClosingPolicy()
The closing policy for the tabs.
|
double |
getTabMaxHeight()
The maximum height of the tabs in the TabPane.
|
double |
getTabMaxWidth()
The maximum width of the tabs in the TabPane.
|
double |
getTabMinHeight()
The minimum height of the tabs in the TabPane.
|
double |
getTabMinWidth()
The minimum width of the tabs in the TabPane.
|
ObservableList<Tab> |
getTabs()
The tabs to display in this TabPane.
|
boolean |
isRotateGraphic()
Returns
true if the graphic inside a Tab is rotated. |
BooleanProperty |
rotateGraphicProperty()
The rotatedGraphic state of the tabs in the TabPane.
|
ObjectProperty<SingleSelectionModel<Tab>> |
selectionModelProperty()
The selection model used for selecting tabs.
|
void |
setRotateGraphic(boolean value)
Specifies whether the graphic inside a Tab is rotated or not, such
that it is always upright, or rotated in the same way as the Tab text is.
|
void |
setSelectionModel(SingleSelectionModel<Tab> value)
Sets the model used for tab selection.
|
void |
setSide(Side value)
The position to place the tabs in this TabPane.
|
void |
setTabClosingPolicy(TabPane.TabClosingPolicy value)
Specifies how the TabPane handles tab closing from an end-users
perspective.
|
void |
setTabMaxHeight(double value)
Sets the value of the property tabMaxHeight.
|
void |
setTabMaxWidth(double value)
Sets the value of the property tabMaxWidth.
|
void |
setTabMinHeight(double value)
The minimum height of the tabs in the TabPane.
|
void |
setTabMinWidth(double value)
The minimum width of the tabs in the TabPane.
|
ObjectProperty<Side> |
sideProperty()
The position of the tabs in the TabPane.
|
ObjectProperty<TabPane.TabClosingPolicy> |
tabClosingPolicyProperty()
The closing policy for the tabs.
|
DoubleProperty |
tabMaxHeightProperty()
The maximum height of the tabs in the TabPane.
|
DoubleProperty |
tabMaxWidthProperty()
The maximum width of the tabs in the TabPane.
|
DoubleProperty |
tabMinHeightProperty()
The minimum height of the tab.
|
DoubleProperty |
tabMinWidthProperty()
The minimum width of the tabs in the TabPane.
|
computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, contextMenuProperty, getBaselineOffset, getContextMenu, getHeight, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getPrefHeight, getPrefWidth, getSkin, getTooltip, getUserAgentStylesheet, getWidth, heightProperty, intersects, isResizable, layoutChildren, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, resize, setContextMenu, setHeight, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setPrefHeight, setPrefSize, setPrefWidth, setSkin, setSkinClassName, setTooltip, setWidth, skinClassNameProperty, skinProperty, tooltipProperty, widthProperty
getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, requestLayout, setNeedsLayout
addEventFilter, addEventHandler, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectProperty, eventDispatcherProperty, fireEvent, focusedProperty, focusTraversableProperty, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEventDispatcher, getId, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getUserData, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToSceneTransformProperty, lookupAll, managedProperty, mouseTransparentProperty, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, relocate, removeEventFilter, removeEventHandler, requestFocus, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, visibleProperty
public final ObjectProperty<SingleSelectionModel<Tab>> selectionModelProperty
public final ObjectProperty<Side> sideProperty
getSide()
,
setSide(Side)
public final ObjectProperty<TabPane.TabClosingPolicy> tabClosingPolicyProperty
public final BooleanProperty rotateGraphicProperty
isRotateGraphic()
,
setRotateGraphic(boolean)
public final DoubleProperty tabMinWidthProperty
getTabMinWidth()
,
setTabMinWidth(double)
public final DoubleProperty tabMaxWidthProperty
getTabMaxWidth()
,
setTabMaxWidth(double)
public final DoubleProperty tabMinHeightProperty
getTabMinHeight()
,
setTabMinHeight(double)
public final DoubleProperty tabMaxHeightProperty
The maximum height of the tabs in the TabPane.
getTabMaxHeight()
,
setTabMaxHeight(double)
public static final java.lang.String STYLE_CLASS_FLOATING
public final ObservableList<Tab> getTabs()
The tabs to display in this TabPane. Changing this ObservableList will immediately result in the TabPane updating to display the new contents of this ObservableList.
If the tabs ObservableList changes, the selected tab will remain the previously selected tab, if it remains within this ObservableList. If the previously selected tab is no longer in the tabs ObservableList, the selected tab will become the first tab in the ObservableList.
public final void setSelectionModel(SingleSelectionModel<Tab> value)
Sets the model used for tab selection. By changing the model you can alter how the tabs are selected and which tabs are first or last.
public final SingleSelectionModel<Tab> getSelectionModel()
Gets the model used for tab selection.
public final ObjectProperty<SingleSelectionModel<Tab>> selectionModelProperty()
public final void setSide(Side value)
The position to place the tabs in this TabPane. Whenever this changes the TabPane will immediately update the location of the tabs to reflect this.
public final Side getSide()
public final ObjectProperty<Side> sideProperty()
getSide()
,
setSide(Side)
public final void setTabClosingPolicy(TabPane.TabClosingPolicy value)
Specifies how the TabPane handles tab closing from an end-users perspective. The options are:
Refer to the TabPane.TabClosingPolicy
enumeration for further details.
public final TabPane.TabClosingPolicy getTabClosingPolicy()
public final ObjectProperty<TabPane.TabClosingPolicy> tabClosingPolicyProperty()
public final void setRotateGraphic(boolean value)
Specifies whether the graphic inside a Tab is rotated or not, such that it is always upright, or rotated in the same way as the Tab text is.
By default rotateGraphic is set to false, to represent the fact that
the graphic isn't rotated, resulting in it always appearing upright. If
rotateGraphic is set to true
, the graphic will rotate such that it
rotates with the tab text.
public final boolean isRotateGraphic()
true
if the graphic inside a Tab is rotated. The
default is false
public final BooleanProperty rotateGraphicProperty()
isRotateGraphic()
,
setRotateGraphic(boolean)
public final void setTabMinWidth(double value)
The minimum width of the tabs in the TabPane. This can be used to limit
the length of text in tabs to prevent truncation. Setting the min equal
to the max will fix the width of the tab. By default the min equals to the max.
This value can also be set via CSS using -fx-tab-min-width
public final double getTabMinWidth()
public final DoubleProperty tabMinWidthProperty()
getTabMinWidth()
,
setTabMinWidth(double)
public final void setTabMaxWidth(double value)
public final double getTabMaxWidth()
public final DoubleProperty tabMaxWidthProperty()
getTabMaxWidth()
,
setTabMaxWidth(double)
public final void setTabMinHeight(double value)
The minimum height of the tabs in the TabPane. This can be used to limit
the height in tabs. Setting the min equal to the max will fix the height
of the tab. By default the min equals to the max.
This value can also be set via CSS using -fx-tab-min-height
public final double getTabMinHeight()
public final DoubleProperty tabMinHeightProperty()
getTabMinHeight()
,
setTabMinHeight(double)
public final void setTabMaxHeight(double value)
The maximum height of the tabs in the TabPane.
public final double getTabMaxHeight()
public final DoubleProperty tabMaxHeightProperty()
The maximum height of the tabs in the TabPane.
getTabMaxHeight()
,
setTabMaxHeight(double)
Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. Use is subject to