com.google.gwt.user.client.ui.DeckPanel 可以触发哪些事件?
也许这是一个蹩脚的问题,但奇怪的是,经过 30 分钟的谷歌搜索,我找不到答案。
com.google.gwt.user.client.ui.DeckPanel 可以触发哪些事件? JavaDoc 说< /a> 它实现了 HasHandlers,但声明为 void fireEvent(GwtEvent event)
。
我如何知道它需要什么类型,以便我可以通过 DeckPanel.addHandler(H handler, GwtEvent.Type
具体来说,我想在调用 DeckPanel.showWidget() 时捕获事件。
谢谢你!
Perhaps it's lame question but strangely after 30 mins of googling I can't find the answer.
What events can com.google.gwt.user.client.ui.DeckPanel fire ? JavaDoc says it implements HasHandlers but it's declared as void fireEvent(GwtEvent<?> event)
.
How do I know what types it expects so I can catch events by subscribing to them via DeckPanel.addHandler(H handler, GwtEvent.Type<H> type)
?
Specifically I want to catch events when DeckPanel.showWidget() is being called.
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
DeckPanel
本身不会触发任何事件。Widget
类型实现addHandler
,主要用于通用 DOM 事件支持 - 当DeckPanel#showWidget()
时没有会触发的内置事件> 被调用。不过,您可以实现自己的:DeckPanel
doesn't fire any events itself. TheWidget
type implementsaddHandler
, primarily for generic DOM event support - there is no built-in event that will be fired whenDeckPanel#showWidget()
is called. You can implement your own though:DeckPanel
扩展了ComplexPanel
,因此它只实现了HasAttachHandlers
。因此,默认情况下,您只会收到AttachEvent
,因为它不会接收其他事件。但与任何 HTML 元素一样,您可以使用addDomHandler
和addBitlessDomHandler
使其接收任何本机事件。DeckPanel
extendsComplexPanel
, so it only implementsHasAttachHandlers
. So by default you will only receive theAttachEvent
as it sinks no other events. But as in with any HTML element, you can make it sink any of the native events by usingaddDomHandler
andaddBitlessDomHandler
.