java.lang.Object
javafx.stage.Window
javafx.stage.PopupWindow
javafx.scene.control.PopupControl
io.github.palexdev.materialfx.controls.MFXPopup
io.github.palexdev.materialfx.controls.MFXTooltip
- All Implemented Interfaces:
MFXStyleablePopup,Styleable,EventTarget,Skinnable
MFXTooltip is a special case of MFXPopup.
The content is determined by its skin, and also has a userAgentStylesheet to define
the default style for all MFXTooltips.
This tooltip also allows you to add an icon!
This popup adds an handler to the owner node to track the mouse location on the node and then uses those coordinated to show itself.
This is the default behavior but it can be easily changed by setting the showActionProperty().
MFXPopup.contentProperty()
will always be null. As a result methods involving Alignment, HPos or VPos will fail with a
NullPointerException.-
Property Summary
PropertiesTypePropertyDescriptionSpecifies the tooltip's icon.This consumer allows the user to decide how to show the tooltip.Specifies the tooltip's text.Properties inherited from class javafx.scene.control.PopupControl
id, maxHeight, maxWidth, minHeight, minWidth, prefHeight, prefWidth, skin, styleProperties inherited from class javafx.stage.PopupWindow
anchorLocation, anchorX, anchorY, autoFix, autoHide, consumeAutoHidingEvents, hideOnEscape, onAutoHide, ownerNode, ownerWindowProperties inherited from class javafx.stage.Window
eventDispatcher, focused, forceIntegerRenderScale, height, onCloseRequest, onHidden, onHiding, onShowing, onShown, opacity, outputScaleX, outputScaleY, renderScaleX, renderScaleY, scene, showing, width, x, y -
Nested Class Summary
Nested classes/interfaces inherited from class io.github.palexdev.materialfx.controls.MFXPopup
MFXPopup.MFXPopupEventNested classes/interfaces inherited from class javafx.scene.control.PopupControl
PopupControl.CSSBridgeNested classes/interfaces inherited from class javafx.stage.PopupWindow
PopupWindow.AnchorLocation -
Field Summary
Fields inherited from class javafx.scene.control.PopupControl
USE_COMPUTED_SIZE, USE_PREF_SIZE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Skin<?>voiddispose()Callsuninstall()but also sets all the handlers and the owner node to null, making this context menu not usable anymore.static voiddisposeFor(Node node) Convenience method to remove aMFXTooltipfrom the given node.getIcon()Gets the value of the property icon.getOwner()Gets the value of the property showAction.getText()Gets the value of the property text.This method works just likeRegion.getUserAgentStylesheet().Specifies the tooltip's icon.install()Adds the needed handlers on the owner node.static MFXTooltipStatic method to create a newMFXTooltipwith the given parameters.voidsetHideAfter(Duration hideAfter) Sets the amount of time after which the tooltip is automatically hidden.voidSets the value of the property icon.voidsetShowAction(Consumer<PositionBean> showAction) Sets the value of the property showAction.voidsetShowDelay(Duration showDelay) Sets the amount of time after which the tooltip is shownvoidSets the value of the property text.This consumer allows the user to decide how to show the tooltip.Specifies the tooltip's text.voidRemoves any added handler from the owner node.Methods inherited from class io.github.palexdev.materialfx.controls.MFXPopup
computePosition, contentProperty, fixPosition, getAnimationProvider, getContent, getPopupStyleableParent, getPosition, getStyleableParent, getStyleSheets, hide, hoverProperty, isAnimated, isFixPosition, isHover, reposition, setAnimated, setAnimationProvider, setContent, setHover, setPopupStyleableParent, show, show, show, showMethods inherited from class javafx.scene.control.PopupControl
getClassCssMetaData, getCssMetaData, getId, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getPrefHeight, getPrefWidth, getPseudoClassStates, getSkin, getStyle, getStyleableNode, getStyleClass, getTypeSelector, idProperty, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, pseudoClassStateChanged, setId, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setPrefHeight, setPrefSize, setPrefWidth, setSkin, setStyle, skinProperty, stylePropertyMethods inherited from class javafx.stage.PopupWindow
anchorLocationProperty, anchorXProperty, anchorYProperty, autoFixProperty, autoHideProperty, consumeAutoHidingEventsProperty, getAnchorLocation, getAnchorX, getAnchorY, getConsumeAutoHidingEvents, getOnAutoHide, getOwnerNode, getOwnerWindow, hideOnEscapeProperty, isAutoFix, isAutoHide, isHideOnEscape, onAutoHideProperty, ownerNodeProperty, ownerWindowProperty, setAnchorLocation, setAnchorX, setAnchorY, setAutoFix, setAutoHide, setConsumeAutoHidingEvents, setHideOnEscape, setOnAutoHide, setScene, show, showMethods inherited from class javafx.stage.Window
addEventFilter, addEventHandler, buildEventDispatchChain, centerOnScreen, eventDispatcherProperty, fireEvent, focusedProperty, forceIntegerRenderScaleProperty, getEventDispatcher, getHeight, getOnCloseRequest, getOnHidden, getOnHiding, getOnShowing, getOnShown, getOpacity, getOutputScaleX, getOutputScaleY, getProperties, getRenderScaleX, getRenderScaleY, getScene, getUserData, getWidth, getWindows, getX, getY, hasProperties, heightProperty, isFocused, isForceIntegerRenderScale, isShowing, onCloseRequestProperty, onHiddenProperty, onHidingProperty, onShowingProperty, onShownProperty, opacityProperty, outputScaleXProperty, outputScaleYProperty, removeEventFilter, removeEventHandler, renderScaleXProperty, renderScaleYProperty, requestFocus, sceneProperty, setEventDispatcher, setEventHandler, setForceIntegerRenderScale, setHeight, setOnCloseRequest, setOnHidden, setOnHiding, setOnShowing, setOnShown, setOpacity, setRenderScaleX, setRenderScaleY, setUserData, setWidth, setX, setY, show, showingProperty, sizeToScene, widthProperty, xProperty, yProperty
-
Property Details
-
showAction
This consumer allows the user to decide how to show the tooltip. The consumer carries the tracked mouse position, seegetMousePosition().By default, calls
MFXPopup.show(Node, double, double).- See Also:
-
icon
Specifies the tooltip's icon.- See Also:
-
text
Specifies the tooltip's text.- See Also:
-
-
Constructor Details
-
MFXTooltip
-
MFXTooltip
-
-
Method Details
-
of
Static method to create a newMFXTooltipwith the given parameters. -
disposeFor
Convenience method to remove aMFXTooltipfrom the given node. -
install
Adds the needed handlers on the owner node. -
uninstall
public void uninstall()Removes any added handler from the owner node. -
dispose
public void dispose()Callsuninstall()but also sets all the handlers and the owner node to null, making this context menu not usable anymore. -
createDefaultSkin
- Overrides:
createDefaultSkinin classMFXPopup
-
getUserAgentStylesheet
Description copied from interface:MFXStyleablePopupThis method works just likeRegion.getUserAgentStylesheet(). AnyMFXStyleablePopupshould offer the possibility of setting a base stylesheet. It's up to the skin on how to use it though (an example can be found hereMFXContextMenuSkin).- Specified by:
getUserAgentStylesheetin interfaceMFXStyleablePopup- Overrides:
getUserAgentStylesheetin classMFXPopup
-
getOwner
- Returns:
- this context menu's owner
-
getMousePosition
-
getShowAction
Gets the value of the property showAction.- Property description:
- This consumer allows the user to decide how to show the tooltip.
The consumer carries the tracked mouse position, see
getMousePosition().By default, calls
MFXPopup.show(Node, double, double).
-
showActionProperty
This consumer allows the user to decide how to show the tooltip. The consumer carries the tracked mouse position, seegetMousePosition().By default, calls
MFXPopup.show(Node, double, double).- See Also:
-
setShowAction
Sets the value of the property showAction.- Property description:
- This consumer allows the user to decide how to show the tooltip.
The consumer carries the tracked mouse position, see
getMousePosition().By default, calls
MFXPopup.show(Node, double, double).
-
getIcon
Gets the value of the property icon.- Property description:
- Specifies the tooltip's icon.
-
iconProperty
Specifies the tooltip's icon.- See Also:
-
setIcon
Sets the value of the property icon.- Property description:
- Specifies the tooltip's icon.
-
getText
Gets the value of the property text.- Property description:
- Specifies the tooltip's text.
-
textProperty
Specifies the tooltip's text.- See Also:
-
setText
Sets the value of the property text.- Property description:
- Specifies the tooltip's text.
-
getShowDelay
- Returns:
- the amount of time after which the tooltip is shown
-
setShowDelay
Sets the amount of time after which the tooltip is shown -
getHideAfter
- Returns:
- the amount of time after which the tooltip is automatically hidden
-
setHideAfter
Sets the amount of time after which the tooltip is automatically hidden.
-