public class Accordion extends Control
An accordion is a group of TitlePanes
. Only one TitledPane can be opened at
a time.
The TitledPane
content in an accordion can be any javafx.scene.Node
such as UI controls or groups
of nodes added to a layout container.
It is not recommended to set the MinHeight, PrefHeight, or MaxHeight for this control. Unexpected behavior will occur because the Accordion's height changes when a TitledPane is opened or closed.
Accordion sets focusTraversable to false.
Example:
TitledPane t1 = new TitledPane("T1", new Button("B1"));
TitledPane t2 = new TitledPane("T2", new Button("B2"));
TitledPane t3 = new TitledPane("T3", new Button("B3"));
Accordion accordion = new Accordion();
accordion.getPanes().addAll(t1, t2, t3);
Type | Property and Description |
---|---|
<any> |
expandedPane
The expanded TitledPane in the Accordion.
|
contextMenuProperty, skinClassNameProperty, skinProperty, tooltipProperty
Modifier and Type | Field and Description |
---|---|
private Orientation |
bias |
private boolean |
biasDirty |
private static java.lang.String |
DEFAULT_STYLE_CLASS
*
Stylesheet Handling *
*
|
private <any> |
expandedPane
*
Properties *
*
|
private <any> |
panes
*
Instance Variables *
*
|
Constructor and Description |
---|
Accordion()
Creates a new Accordion with no TitledPanes.
|
Accordion(TitledPane... titledPanes)
Creates a new Accordion with the given TitledPanes showing within it.
|
Modifier and Type | Method and Description |
---|---|
protected Skin<?> |
createDefaultSkin()
Create a new instance of the default skin for this control.
|
<any> |
expandedPaneProperty()
The expanded TitledPane in the Accordion.
|
Orientation |
getContentBias() |
TitledPane |
getExpandedPane()
Gets the expanded TitledPane in the Accordion.
|
protected java.lang.Boolean |
getInitialFocusTraversable()
Returns the initial focus traversable state of this control, for use
by the JavaFX CSS engine to correctly set its initial value.
|
<any> |
getPanes()
Gets the list of
TitledPane in this Accordion. |
void |
requestLayout() |
void |
setExpandedPane(TitledPane value)
The expanded
TitledPane that is currently visible. |
computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, contextMenuProperty, executeAccessibleAction, getBaselineOffset, getClassCssMetaData, getContextMenu, getControlChildren, getControlCssMetaData, getCssMetaData, getSkin, getTooltip, isResizable, layoutChildren, loadSkinClass, queryAccessibleAttribute, setContextMenu, setSkin, setTooltip, skinClassNameProperty, skinProperty, tooltipProperty
public final <any> expandedPaneProperty
private boolean biasDirty
private Orientation bias
private final <any> panes
private <any> expandedPane
private static final java.lang.String DEFAULT_STYLE_CLASS
public Accordion()
public Accordion(TitledPane... titledPanes)
titledPanes
- The TitledPanes to show inside the Accordion.public final void setExpandedPane(TitledPane value)
The expanded TitledPane
that is currently visible. While it is technically
possible to set the expanded pane to a value that is not in getPanes()
,
doing so will be treated by the skin as if expandedPane is null. If a pane
is set as the expanded pane, and is subsequently removed from getPanes()
,
then expanded pane will be set to null, if possible. (This will not be possible
if you have manually bound the expanded pane to some value, for example).
value
- the expanded TitledPane
public final TitledPane getExpandedPane()
null
is returned.public final <any> expandedPaneProperty()
public final <any> getPanes()
TitledPane
in this Accordion. Changing this ObservableList
will immediately result in the Accordion updating to display
the new contents of this ObservableList.protected Skin<?> createDefaultSkin()
-fx-skin
or set explicitly in a sub-class with setSkin(...)
.createDefaultSkin
in class Control
public void requestLayout()
public Orientation getContentBias()
protected java.lang.Boolean getInitialFocusTraversable()
getInitialFocusTraversable
in class Control