问题描述
如何将MouseEvents,特别是MouseOutHandlers添加到AbsolutePanel而不创建Composite窗口小部件?或者这可能吗?从我可以告诉它涉及添加DomHandler和HandlerRegistration。
考虑到我是一个新的GWT和Java,一个详细的例子将不胜感激。
p>
Eric
您必须创建自定义的AbsolutePanel。按照代码。我认为这应该工作。现在你可以添加鼠标出处理程序到绝对面板。如果你想使用所有的鼠标事件实现HasAllMouseHandlers并实现所有的方法。
public class MyAbsolutePanel extends AbsolutePanel implements HasMouseOutHandlers {
$ b $ public HandlerRegistration addMouseOutHandler(MouseOutHandler handler){
return addDomHandler(handler,MouseOutEvent.getType()) ;
}
}
How do I add MouseEvents, specifically MouseOutHandlers to an AbsolutePanel without creating a Composite widget? Or is this possible? From what I can tell it involves adding a DomHandler, and a HandlerRegistration.
A detailed example would be greatly appreciated considering I am quite new GWT and Java.
Thanks,
Eric
You have to create custom AbsolutePanel. Follow the code.I think this should work.Now you can add mouse out handler to absolute panel.If you want to use all Mouse events implement HasAllMouseHandlers and implement all the methods.
public class MyAbsolutePanel extends AbsolutePanel implements HasMouseOutHandlers{
public HandlerRegistration addMouseOutHandler(MouseOutHandler handler) {
return addDomHandler(handler, MouseOutEvent.getType());
}
}
这篇关于我如何将MouseEvents添加到AbsolutePanel?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!