A ToolBar is a control which displays items horizontally
or vertically. The most common items to place within a ToolBar
are Buttons, ToggleButtons and
Separators, but you are not restricted to just these, and
can insert any Node into them.
If there are too many items to fit in the ToolBar an overflow button will appear. The overflow button allows you to select items that are not currently visible in the toolbar.
ToolBar sets focusTraversable to false.
Example of a horizontal ToolBar with eight buttons separated with two vertical separators.
ToolBar toolBar = new ToolBar(
new Button("New"),
new Button("Open"),
new Button("Save"),
new Separator(),
new Button("Clean"),
new Button("Compile"),
new Button("Run"),
new Separator(),
new Button("Debug"),
new Button("Profile")
);
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final String | |
| private static final PseudoClass | |
| private final ObservableList | |
| private ObjectProperty | orientation
The orientation of the |
| private static final PseudoClass |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected Skin | createDefaultSkin()
Overrides javafx. Create a new instance of the default skin for this control. |
| public static List | Returns: theCssMetaDataHides javafx. Gets the |
| public List | getControlCssMetaData()
Overrides javafx. Gets the unmodifiable list of the control's CSS-styleable properties. |
| protected Boolean | getInitialFocusTraversable()
Overrides javafx. 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 | |
| public final Orientation | |
| private void | |
| public final ObjectProperty | |
| public final void |
| DEFAULT_STYLE_CLASS | back to summary |
|---|---|
| private static final String DEFAULT_STYLE_CLASS | |
| HORIZONTAL_PSEUDOCLASS_STATE | back to summary |
|---|---|
| private static final PseudoClass HORIZONTAL_PSEUDOCLASS_STATE | |
| items | back to summary |
|---|---|
| private final ObservableList<Node> items | |
| orientation | back to summary |
|---|---|
| private ObjectProperty<Orientation> orientation The orientation of the | |
| VERTICAL_PSEUDOCLASS_STATE | back to summary |
|---|---|
| private static final PseudoClass VERTICAL_PSEUDOCLASS_STATE | |
| ToolBar | back to summary |
|---|---|
| public ToolBar() Creates an empty tool bar. | |
| ToolBar | back to summary |
|---|---|
| public ToolBar(Node... items) Creates a tool bar populated with the specified nodes. None of the items can be null.
| |
| createDefaultSkin | back to summary |
|---|---|
| protected Skin Overrides javafx. Doc from javafx. 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 | |
| getClassCssMetaData | back to summary |
|---|---|
| public static List Hides javafx. Gets the
| |
| getControlCssMetaData | back to summary |
|---|---|
| public List Overrides javafx. Doc from javafx. Gets the unmodifiable list of the control's CSS-styleable properties.
| |
| getInitialFocusTraversable | back to summary |
|---|---|
| protected Boolean getInitialFocusTraversable() Overrides javafx. 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.
| |
| getItems | back to summary |
|---|---|
| public final ObservableList The items contained in the
| |
| getOrientation | back to summary |
|---|---|
| public final Orientation getOrientation() | |
| initialize | back to summary |
|---|---|
| private void initialize() | |
| orientationProperty | back to summary |
|---|---|
| public final ObjectProperty | |
| setOrientation | back to summary |
|---|---|
| public final void setOrientation(Orientation value) | |
| Modifier and Type | Field and Description |
|---|---|
| private static final CssMetaData | |
| private static final List |
| Access | Constructor and Description |
|---|---|
| private |
| ORIENTATION | back to summary |
|---|---|
| private static final CssMetaData<ToolBar, Orientation> ORIENTATION | |
| STYLEABLES | back to summary |
|---|---|
| private static final List<CssMetaData<? extends Styleable, ?>> STYLEABLES | |
| StyleableProperties | back to summary |
|---|---|
| private StyleableProperties() | |