/**
   * Binds the tool tip to the target widget. Allows a tool tip to switch the target widget.
   *
   * @param target the target widget
   */
  public void initTarget(final Widget target) {
    if (this.target != null) {
      handlerRegistration.removeHandler();
    }

    this.target = target;

    if (target != null) {
      Handler handler = new Handler();
      handlerRegistration = new GroupingHandlerRegistration();
      handlerRegistration.add(target.addDomHandler(handler, MouseOverEvent.getType()));
      handlerRegistration.add(target.addDomHandler(handler, MouseOutEvent.getType()));
      handlerRegistration.add(target.addDomHandler(handler, MouseMoveEvent.getType()));
      handlerRegistration.add(target.addHandler(handler, HideEvent.getType()));
      handlerRegistration.add(target.addHandler(handler, AttachEvent.getType()));
    }
  }
Esempio n. 2
0
 public void addHiddenHandler(final HiddenHandler hiddenHandler) {
   widget.addHandler(hiddenHandler, HiddenEvent.getType());
 }
Esempio n. 3
0
 /**
  * Adds a hidden handler to the Tooltip that will be fired when the Tooltip's hidden event is
  * fired
  *
  * @param hiddenHandler HiddenHandler to handle the hidden event
  * @return HandlerRegistration of the handler
  */
 public HandlerRegistration addHiddenHandler(final HiddenHandler hiddenHandler) {
   return widget.addHandler(hiddenHandler, HiddenEvent.getType());
 }
Esempio n. 4
0
 public void addShownHandler(final ShownHandler shownHandler) {
   widget.addHandler(shownHandler, ShownEvent.getType());
 }
Esempio n. 5
0
 /**
  * Adds a shown handler to the Tooltip that will be fired when the Tooltip's shown event is fired
  *
  * @param shownHandler ShownHandler to handle the shown event
  * @return HandlerRegistration of the handler
  */
 public HandlerRegistration addShownHandler(final ShownHandler shownHandler) {
   return widget.addHandler(shownHandler, ShownEvent.getType());
 }