Class Hover
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
hide()
Hide hoverCanvas shown viashow()
static void
Displays a standard Hover canvas containing the specified canvas as the content.
This method may also be called to modify the content of the hover if it is already showing.static void
Displays a standard Hover canvas containing the specified HTML content.
This method may also be called to modify the content of the hover if it is already showing.static void
showHoverComponent
(Canvas component) Similar toHover.show()
but uses the hover mechanism to display somecomponent
instead of showingHTML text
in the builtinhoverCanvas
.
-
Constructor Details
-
Hover
public Hover()
-
-
Method Details
-
hide
public static void hide()Hide hoverCanvas shown viashow()
-
showHoverComponent
Similar toHover.show()
but uses the hover mechanism to display somecomponent
instead of showingHTML text
in the builtinhoverCanvas
. Hover.showHoverComponent() is called automatically instead of Hover.show() whenCanvas.showHoverComponents
is true.As with
Hover.show()
, the component-position is based on the mouse pointer position, adjusted byleftOffset
andtopOffset
. If this position would render the component partially clipped or off-screen, it is moved to ensure the component is entirely visible.See
show()
for more information.- Parameters:
component
- component to show using the hover mechanism
-
show
Displays a standard Hover canvas containing the specified HTML content.
This method may also be called to modify the content of the hover if it is already showing. CallHover.hide
to hide the canvas again.
A common use case for calling this method is to asynchronously fetch detail data from the server about some component, and display it in the Hover canvas when the data is returned. Note that in this case you will typically need to verify that the user is still hovering over the component in question before calling Hover.show() - if the user has moved the mouse off the component, the information will not apply to whatever is now under the mouse. Suggested approaches for handling this are to either use aCanvas.mouseOut
handler to track when the user moves off the component, or checkingEventHandler.getTarget
as part of the asynchronous callbackThe default Hover canvas position will be based on the mouse pointer position, adjusted by
leftOffset
andtopOffset
. If this position would render the Hover canvas partially clipped, it will be automatically modified to ensure the Hover is entirely visible.- Parameters:
contents
- contents for the hover. SeeHTMLString
properties
- object containing attributes for managing the hover canvas' appearance. Valid properties include:- left, top, width, height
- baseStyle
- opacity
- wrap
- moveWithMouse
-
show
Displays a standard Hover canvas containing the specified canvas as the content.
This method may also be called to modify the content of the hover if it is already showing. CallHover.hide
to hide the canvas again.
A common use case for calling this method is to asynchronously fetch detail data from the server about some component, and display it in the Hover canvas when the data is returned. Note that in this case you will typically need to verify that the user is still hovering over the component in question before calling Hover.show() - if the user has moved the mouse off the component, the information will not apply to whatever is now under the mouse. Suggested approaches for handling this are to either use aCanvas.mouseOut
handler to track when the user moves off the component, or checkingEventHandler.getTarget
as part of the asynchronous callbackThe default Hover canvas position will be based on the mouse pointer position, adjusted by
leftOffset
andtopOffset
. If this position would render the Hover canvas partially clipped, it will be automatically modified to ensure the Hover is entirely visible.- Parameters:
contents
- contents for the hover. SeeHTMLString
properties
- object containing attributes for managing the hover canvas' appearance. Valid properties include:- left, top, width, height
- baseStyle
- opacity
- wrap
- moveWithMouse
-