本文整理汇总了Java中com.google.gwt.event.dom.client.HasMouseOverHandlers类的典型用法代码示例。如果您正苦于以下问题:Java HasMouseOverHandlers类的具体用法?Java HasMouseOverHandlers怎么用?Java HasMouseOverHandlers使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HasMouseOverHandlers类属于com.google.gwt.event.dom.client包,在下文中一共展示了HasMouseOverHandlers类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: add
import com.google.gwt.event.dom.client.HasMouseOverHandlers; //导入依赖的package包/类
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);
}
示例2: setMouseEntered
import com.google.gwt.event.dom.client.HasMouseOverHandlers; //导入依赖的package包/类
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);
}
}
}
}