Additionally, controls support explicit skinning to make it easy to leverage the functionality of a control while customizing its appearance.
See specific Control subclasses for information on how to use individual types of controls.
Most controls have their focusTraversable property set to true by default, however
read-only controls such as Label and ProgressIndicator, and some
controls that are containers ScrollPane and ToolBar do not.
Consult individual control documentation for details.
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private ObjectProperty | contextMenu
The ContextMenu to show for this control. |
| private static final EventHandler | contextMenuHandler
Handles context menu requests by popping up the menu. |
| private String | currentSkinClassName
Keeps a reference to the name of the class currently acting as the skin. |
| private ObjectProperty | |
| private SkinBase | skinBase
A private reference directly to the SkinBase instance that is used as the Skin for this Control. |
| private StringProperty | |
| private boolean | |
| private List | |
| private ObjectProperty |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| protected double | Returns: A double representing the maximum height of this control.The width of the Control, in case this value might dictate
the maximum height. width)Overrides javafx. Computes the maximum allowable height of the Control, based on the provided width. |
| protected double | Returns: A double representing the maximum width of this control.The height of the Control, in case this value might dictate
the maximum width. height)Overrides javafx. Computes the maximum allowable width of the Control, based on the provided height. |
| protected double | Returns: A double representing the minimum height of this control.The width of the Control, in case this value might dictate
the minimum height. width)Overrides javafx. Computes the minimum allowable height of the Control, based on the provided width. |
| protected double | Returns: A double representing the minimum width of this control.The height of the Control, in case this value might dictate
the minimum width. height)Overrides javafx. Computes the minimum allowable width of the Control, based on the provided height. |
| protected double | computePrefHeight(double width)
Overrides javafx. Computes the preferred height of this region for the given width; Region subclasses should override this method to return an appropriate value based on their content and layout strategy. |
| protected double | computePrefWidth(double height)
Overrides javafx. Computes the preferred width of this region for the given height. |
| public final ObjectProperty | |
| protected Skin | Returns: new instance of default skin for this control. If null then the control will have no skin unless one is provided by css.Create a new instance of the default skin for this control. |
| private void | |
| public void | executeAccessibleAction(AccessibleAction action, Object... parameters)
Overrides javafx. This method is called by the assistive technology to request the action indicated by the argument should be executed. |
| public double | getBaselineOffset()
Overrides javafx. Calculates the baseline offset based on the first managed child. |
| public static List | Returns: theCssMetaDataHides javafx. Gets the |
| public final ContextMenu | |
| pack-priv ObservableList | |
| protected List | Returns: the unmodifiable list of the control's CSS-styleable propertiesGets the unmodifiable list of the control's CSS-styleable properties. |
| public final List | getCssMetaData()
Overrides javafx. Implements javafx. This method returns a |
| protected Boolean | Returns: the initial focus traversable state of this controlOverrides 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 Skin | |
| private Node | Returns: The Skin's node, or null.Gets the Skin's node, or returns null if there is no Skin. |
| public final Tooltip | |
| public boolean | Returns: whether this node can be resized by its parent during layoutOverrides javafx. Returns |
| protected void | layoutChildren()
Overrides javafx. Invoked during the layout pass to layout the children in this
|
| private static Class | Returns: The class. Cannot return nullThe name of the class we want to load className, final Object An optional instance used to help find the class to load instance)Utility for loading a class in a manner that will work with multiple class loaders, as is typically found in OSGI modular applications. |
| pack-priv static void | |
| public Object | queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters)
Overrides javafx. This method is called by the assistive technology to request the value for an attribute. |
| public final void | |
| public final void | |
| public final void | |
| pack-priv StringProperty | |
| public final ObjectProperty | Returns: the skin property for this controlImplements javafx. Skin is responsible for rendering this |
| public final ObjectProperty |
| contextMenu | back to summary |
|---|---|
| private ObjectProperty<ContextMenu> contextMenu The ContextMenu to show for this control. | |
| contextMenuHandler | back to summary |
|---|---|
| private static final EventHandler<ContextMenuEvent> contextMenuHandler Handles context menu requests by popping up the menu. Note that we use this pattern to remove some of the anonymous inner classes which we'd otherwise have to create. When lambda expressions are supported, we could do it that way instead (or use MethodHandles). | |
| currentSkinClassName | back to summary |
|---|---|
| private String currentSkinClassName Keeps a reference to the name of the class currently acting as the skin. | |
| skin | back to summary |
|---|---|
| private ObjectProperty<Skin<?>> skin | |
| skinBase | back to summary |
|---|---|
| private SkinBase<?> skinBase A private reference directly to the SkinBase instance that is used as the Skin for this Control. A Control's Skin doesn't have to be of type SkinBase, although 98% of the time or greater it probably will be. Because instanceof checks and reading a value from a property are not cheap (on interpreters on slower hardware or mobile devices) it pays to have a direct reference here to the skinBase. We simply need to check this variable -- if it is not null then we know the Skin is a SkinBase and this is a direct reference to it. If it is null then we know the skin is not a SkinBase and we need to call getSkin(). | |
| skinClassName | back to summary |
|---|---|
| private StringProperty skinClassName | |
| skinCreationLocked | back to summary |
|---|---|
| private boolean skinCreationLocked | |
| styleableProperties | back to summary |
|---|---|
| private List<CssMetaData<? extends Styleable, ?>> styleableProperties | |
| tooltip | back to summary |
|---|---|
| private ObjectProperty<Tooltip> tooltip | |
| Control | back to summary |
|---|---|
| protected Control() Create a new Control. | |
| computeMaxHeight | back to summary |
|---|---|
| protected double computeMaxHeight(double width) Overrides javafx. Computes the maximum allowable height of the Control, based on the provided
width. The maximum height is not calculated within the Control, instead
the calculation is delegated to the
| |
| computeMaxWidth | back to summary |
|---|---|
| protected double computeMaxWidth(double height) Overrides javafx. Computes the maximum allowable width of the Control, based on the provided
height. The maximum width is not calculated within the Control, instead
the calculation is delegated to the
| |
| computeMinHeight | back to summary |
|---|---|
| protected double computeMinHeight(final double width) Overrides javafx. Computes the minimum allowable height of the Control, based on the provided
width. The minimum height is not calculated within the Control, instead
the calculation is delegated to the
| |
| computeMinWidth | back to summary |
|---|---|
| protected double computeMinWidth(final double height) Overrides javafx. Computes the minimum allowable width of the Control, based on the provided
height. The minimum width is not calculated within the Control, instead
the calculation is delegated to the
| |
| computePrefHeight | back to summary |
|---|---|
| protected double computePrefHeight(double width) Overrides javafx. Doc from javafx. Computes the preferred height of this region for the given width; Region subclasses should override this method to return an appropriate value based on their content and layout strategy. If the subclass doesn't have a HORIZONTAL content bias, then the width parameter can be ignored.
| |
| computePrefWidth | back to summary |
|---|---|
| protected double computePrefWidth(double height) Overrides javafx. Doc from javafx. Computes the preferred width of this region for the given height. Region subclasses should override this method to return an appropriate value based on their content and layout strategy. If the subclass doesn't have a VERTICAL content bias, then the height parameter can be ignored.
| |
| contextMenuProperty | back to summary |
|---|---|
| public final ObjectProperty | |
| createDefaultSkin | back to summary |
|---|---|
| protected Skin 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
| |
| doProcessCSS | back to summary |
|---|---|
| private void doProcessCSS() | |
| executeAccessibleAction | back to summary |
|---|---|
| public void executeAccessibleAction(AccessibleAction action, Object... parameters) Overrides javafx. Doc from javafx. This method is called by the assistive technology to request the action indicated by the argument should be executed.
This method is commonly overridden by subclasses to implement
action that are required for a specific role.
| |
| getBaselineOffset | back to summary |
|---|---|
| public double getBaselineOffset() Overrides javafx. Doc from javafx. Calculates the baseline offset based on the first managed child. If there
is no such child, returns
| |
| getClassCssMetaData | back to summary |
|---|---|
| public static List Hides javafx. Gets the
| |
| getContextMenu | back to summary |
|---|---|
| public final ContextMenu getContextMenu() | |
| getControlChildren | back to summary |
|---|---|
| pack-priv ObservableList | |
| getControlCssMetaData | back to summary |
|---|---|
| protected List Gets the unmodifiable list of the control's CSS-styleable properties.
| |
| getCssMetaData | back to summary |
|---|---|
| public final List Overrides javafx. Implements javafx. This method returns a Developers who wish to provide custom CssMetaData are therefore
encouraged to override
| |
| 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. By default all UI controls are focus traversable, so this method is overridden in Control to set the initial traversable state to true. | |
| getSkin | back to summary |
|---|---|
| public final Skin Implements javafx.
| |
| getSkinNode | back to summary |
|---|---|
| private Node getSkinNode() Gets the Skin's node, or returns null if there is no Skin. Convenience method for getting the node of the skin. This is null-safe, meaning if skin is null then it will return null instead of throwing a NullPointerException.
| |
| getTooltip | back to summary |
|---|---|
| public final Tooltip getTooltip() | |
| isResizable | back to summary |
|---|---|
| public boolean isResizable() Overrides javafx. Returns
| |
| layoutChildren | back to summary |
|---|---|
| protected void layoutChildren() Overrides javafx. Doc from javafx. Invoked during the layout pass to layout the children in this
Subclasses should override this function to layout content as needed.
| |
| loadClass | back to summary |
|---|---|
| private static Class Utility for loading a class in a manner that will work with multiple class loaders, as is typically found in OSGI modular applications. In particular, this method will attempt to just load the class identified by className. If that fails, it attempts to load the class using the current thread's context class loader. If that fails, it attempts to use the class loader of the supplied "instance", and if it still fails it walks up the class hierarchy of the instance and attempts to use the class loader of each class in the super-type hierarchy.
| |
| loadSkinClass | back to summary |
|---|---|
| pack-priv static void loadSkinClass(final Skinnable control, final String skinClassName) | |
| queryAccessibleAttribute | back to summary |
|---|---|
| public Object queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters) Overrides javafx. Doc from javafx. This method is called by the assistive technology to request the value for an attribute.
This method is commonly overridden by subclasses to implement
attributes that are required for a specific role.
| |
| setContextMenu | back to summary |
|---|---|
| public final void setContextMenu(ContextMenu value) | |
| setSkin | back to summary |
|---|---|
| public final void setSkin(Skin<?> value) Implements javafx.
| |
| setTooltip | back to summary |
|---|---|
| public final void setTooltip(Tooltip value) | |
| skinClassNameProperty | back to summary |
|---|---|
| pack-priv StringProperty skinClassNameProperty() | |
| skinProperty | back to summary |
|---|---|
| public final ObjectProperty Implements javafx. Skin is responsible for rendering this
There is a one-to-one relationship between a
To ensure a one-to-one relationship between a A skin may be null.
| |
| tooltipProperty | back to summary |
|---|---|
| public final ObjectProperty The ToolTip for this control.
| |
| Modifier and Type | Field and Description |
|---|---|
| private static final CssMetaData | |
| private static final List |
| Access | Constructor and Description |
|---|---|
| private |
| SKIN | back to summary |
|---|---|
| private static final CssMetaData<Control, String> SKIN | |
| STYLEABLES | back to summary |
|---|---|
| private static final List<CssMetaData<? extends Styleable, ?>> STYLEABLES | |
| StyleableProperties | back to summary |
|---|---|
| private StyleableProperties() | |