java.lang.Object
javafx.scene.control.skin.ContextMenuSkin
- All Implemented Interfaces:
Skin<ContextMenu>
Default Skin implementation for ContextMenu. Several controls use ContextMenu in
order to display items in a drop down. This class mostly deals mostly with
show / hide logic - the actual content of the context menu is contained within
the
root node
.- Since:
- 9
- See Also:
-
Constructor Summary
ConstructorDescriptionContextMenuSkin
(ContextMenu control) Creates a new ContextMenuSkin instance. -
Method Summary
-
Constructor Details
-
ContextMenuSkin
Creates a new ContextMenuSkin instance.- Parameters:
control
- The control that this skin should be installed onto.
-
-
Method Details
-
getSkinnable
Gets the Skinnable to which this Skin is assigned. A Skin must be created for one and only one Skinnable. This value will only ever go from a non-null to null value when the Skin is removed from the Skinnable, and only as a consequence of a call toSkin.dispose()
.The caller who constructs a Skinnable must also construct a Skin and properly establish the relationship between the Control and its Skin.
- Specified by:
getSkinnable
in interfaceSkin<ContextMenu>
- Returns:
- A non-null Skinnable, or null value if disposed.
-
getNode
Gets the Node which represents this Skin. This must never be null, except after a call toSkin.dispose()
, and must never change except when changing to null.- Specified by:
getNode
in interfaceSkin<ContextMenu>
- Returns:
- A non-null Node, except when the Skin has been disposed.
-
dispose
public void dispose()Called when a previously installed skin is about to be removed from its associated control. This allows the skin to do clean up, like removing listeners and bindings, and undo any changes to the control's properties. After this method completes,Skin.getSkinnable()
andSkin.getNode()
should returnnull
.Calling
Skin.dispose()
more than once has no effect.- Specified by:
dispose
in interfaceSkin<ContextMenu>
-