Java 类com.google.gwt.event.dom.client.HasMouseOverHandlers 实例源码

项目:firefly    文件:BasicPagingImageGrid.java   
public void add(Widget widget) {
    if (widget instanceof HasClickHandlers && clickHandler!=null) {
        ((HasClickHandlers) widget).addClickHandler(clickHandler);
    }
    if (widget instanceof HasDoubleClickHandlers && doubleClickHandler!=null) {
        ((HasDoubleClickHandlers) widget).addDoubleClickHandler(doubleClickHandler);
    }
    if (widget instanceof HasErrorHandlers && errorHandler!=null) {
        ((HasErrorHandlers) widget).addErrorHandler(errorHandler);
    }
    if (widget instanceof HasMouseOutHandlers && mouseOutHandler!=null) {
        ((HasMouseOutHandlers) widget).addMouseOutHandler(mouseOutHandler);
    }
    if (widget instanceof HasMouseOverHandlers && mouseOverHandler!=null) {
        ((HasMouseOverHandlers) widget).addMouseOverHandler(mouseOverHandler);
    }
    flowpanel.add(widget);
}
项目:platypus-js    文件:EventsExecutor.java   
public void setMouseEntered(JavaScriptObject aValue) {
    if (mouseEntered != aValue) {
        if (mouseOverReg != null) {
            mouseOverReg.removeHandler();
            mouseOverReg = null;
        }
        mouseEntered = aValue;
        if (mouseEntered != null) {
            MouseOverHandler handler = new MouseOverHandler() {
                @Override
                public void onMouseOver(MouseOverEvent event) {
                    if (mouseEntered != null) {
                        event.stopPropagation();
                        executeEvent(mouseEntered, EventsPublisher.publish(event));
                    }
                }
            };
            if (component instanceof Widget) {
                mouseOverReg = ((Widget) component).addDomHandler(handler, MouseOverEvent.getType());
            } else if (component instanceof HasMouseOverHandlers) {
                mouseOverReg = ((HasMouseOverHandlers) component).addMouseOverHandler(handler);
            }
        }
    }
}