com.smartgwt.client.widgets
Class Hover

java.lang.Object
  extended by com.smartgwt.client.widgets.Hover

public class Hover
extends Object

The Hover class handles showing a simple Smart GWT canvas containing arbitrary HTML, or triggering some other action in response to a user holding the mouse-pointer (or hovering) over a specific widget.


Constructor Summary
Hover()
           
 
Method Summary
static void hide()
          Hide hover hover Canvas shown via Hover.show
static void show(String contents, Label properties)
          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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Hover

public Hover()
Method Detail

hide

public static void hide()
Hide hover hover Canvas shown via Hover.show


show

public static void show(String contents,
                        Label properties)
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. Call Hover.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 a Canvas.mouseOut handler to track when the user moves off the component, or checking EventHandler.getTarget as part of the asynchronous callback

The default Hover canvas position will be based on the mouse pointer position, adjusted by leftOffset and topOffset. 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
properties - object containing attributes for managing the hover canvas' appearance. Valid properties include:
  • left, top, width, height
  • baseStyle
  • opacity
  • wrap
  • moveWithMouse [overrides moveWithMouse]