Top Description Fields Constructors Methods
javafx.scene.control

public Class Accordion

extends Control
Class Inheritance
Imports
javafx.beans.property.ObjectProperty, .ObjectPropertyBase, javafx.collections.ListChangeListener, .ObservableList, com.sun.javafx.collections.TrackableObservableList, javafx.geometry.Orientation, javafx.scene.Node, javafx.scene.control.skin.AccordionSkin, javafx.css.StyleableProperty, java.util.List

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);
Image of the Accordion control
Since
JavaFX 2.0

Field Summary

Modifier and TypeField and Description
private Orientation
private boolean
private static final String
private ObjectProperty<TitledPane>
private final ObservableList<TitledPane>

Constructor Summary

AccessConstructor and Description
public
Accordion()

Creates a new Accordion with no TitledPanes.

public
Accordion(TitledPane...
The TitledPanes to show inside the Accordion.
titledPanes
)

Creates a new Accordion with the given TitledPanes showing within it.

Method Summary

Modifier and TypeMethod and Description
protected Skin<?>
createDefaultSkin()

Overrides javafx.scene.control.Control.createDefaultSkin.

Create a new instance of the default skin for this control.

public final ObjectProperty<TitledPane>

Returns:

The expanded TitledPane in the Accordion.
expandedPaneProperty
()

The expanded TitledPane in the Accordion.

public Orientation
getContentBias()

Overrides javafx.scene.Node.getContentBias.

Returns the orientation of a node's resizing bias for layout purposes.

public final TitledPane

Returns:

The expanded TitledPane in the Accordion.
getExpandedPane
()

Gets the expanded TitledPane in the Accordion.

protected Boolean
getInitialFocusTraversable()

Overrides javafx.scene.control.Control.getInitialFocusTraversable.

Returns the initial focus traversable state of this control, for use by the JavaFX CSS engine to correctly set its initial value.

public final ObservableList<TitledPane>

Returns:

The list of TitledPane in this Accordion.
getPanes
()

Gets the list of TitledPane in this Accordion.

public void
requestLayout()

Overrides javafx.scene.Parent.requestLayout.

Requests a layout pass to be performed before the next scene is rendered.

public final void
setExpandedPane(TitledPane
the expanded TitledPane
value
)

The expanded TitledPane that is currently visible.

Inherited from javafx.scene.control.Control:
computeMaxHeightcomputeMaxWidthcomputeMinHeightcomputeMinWidthcomputePrefHeightcomputePrefWidthcontextMenuPropertyexecuteAccessibleActiongetBaselineOffsetgetClassCssMetaDatagetContextMenugetControlChildrengetControlCssMetaDatagetCssMetaDatagetSkingetTooltipisResizablelayoutChildrenloadSkinClassqueryAccessibleAttributesetContextMenusetSkinsetTooltipskinClassNamePropertyskinPropertytooltipProperty

Field Detail

biasback to summary
private Orientation bias
biasDirtyback to summary
private boolean biasDirty
DEFAULT_STYLE_CLASSback to summary
private static final String DEFAULT_STYLE_CLASS
expandedPaneback to summary
private ObjectProperty<TitledPane> expandedPane
panesback to summary
private final ObservableList<TitledPane> panes

Constructor Detail

Accordionback to summary
public Accordion()

Creates a new Accordion with no TitledPanes.

Accordionback to summary
public Accordion(TitledPane... titledPanes)

Creates a new Accordion with the given TitledPanes showing within it.

Parameters
titledPanes:TitledPane[]

The TitledPanes to show inside the Accordion.

Since
JavaFX 8u40

Method Detail

createDefaultSkinback to summary
protected Skin<?> createDefaultSkin()

Overrides javafx.scene.control.Control.createDefaultSkin.

Doc from javafx.scene.control.Control.createDefaultSkin.

Create a new instance of the default skin for this control. This is called to create a skin for the control if no skin is provided via CSS -fx-skin or set explicitly in a sub-class with setSkin(...).

Annotations
@Override
expandedPanePropertyback to summary
public final ObjectProperty<TitledPane> expandedPaneProperty()

The expanded TitledPane in the Accordion.

Returns:ObjectProperty<TitledPane>

The expanded TitledPane in the Accordion.

getContentBiasback to summary
public Orientation getContentBias()

Overrides javafx.scene.Node.getContentBias.

Doc from javafx.scene.Node.getContentBias.

Returns the orientation of a node's resizing bias for layout purposes. If the node type has no bias, returns null. If the node is resizable and it's height depends on its width, returns HORIZONTAL, else if its width depends on its height, returns VERTICAL.

Resizable subclasses should override this method to return an appropriate value.

Annotations
@Override
getExpandedPaneback to summary
public final TitledPane getExpandedPane()

Gets the expanded TitledPane in the Accordion. If the expanded pane has been removed or there is no expanded TitledPane null is returned.

Returns:TitledPane

The expanded TitledPane in the Accordion.

getInitialFocusTraversableback to summary
protected Boolean getInitialFocusTraversable()

Overrides javafx.scene.control.Control.getInitialFocusTraversable.

Returns the initial focus traversable state of this control, for use by the JavaFX CSS engine to correctly set its initial value. This method is overridden as by default UI controls have focus traversable set to true, but that is not appropriate for this control.

Annotations
@Override
Since
9
getPanesback to summary
public final ObservableList<TitledPane> getPanes()

Gets the list of TitledPane in this Accordion. Changing this ObservableList will immediately result in the Accordion updating to display the new contents of this ObservableList.

Returns:ObservableList<TitledPane>

The list of TitledPane in this Accordion.

requestLayoutback to summary
public void requestLayout()

Overrides javafx.scene.Parent.requestLayout.

Doc from javafx.scene.Parent.requestLayout.

Requests a layout pass to be performed before the next scene is rendered. This is batched up asynchronously to happen once per "pulse", or frame of animation.

If this parent is either a layout root or unmanaged, then it will be added directly to the scene's dirty layout list, otherwise requestParentLayout will be invoked.

Annotations
@Override
setExpandedPaneback to summary
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).

Parameters
value:TitledPane

the expanded TitledPane