4
A
回答
8
AFAIK有核心GWT没有这样的小部件,但为什么不推出自己的:
public class DelayedPopup extends PopupPanel {
public DelayedPopup(String text, boolean autoHide, boolean modal) {
super(autoHide, modal);
setWidget(new Label(text));
}
void show(int delayMilliseconds) {
show();
Timer t = new Timer() {
@Override
public void run() {
DelayedPopup.this.hide();
}
};
// Schedule the timer to close the popup in 3 seconds.
t.schedule(3000);
}
}
这超出了我的头,因此它可能无法编译,但你的想法。
更新:
按评论,我添加通知,隐藏自身在移动鼠标:
public class Notification extends PopupPanel {
public Notification(String text) {
super(false, false);
setWidget(new Label(text));
}
@Override
public void show() {
installCloseHandler();
super.show();
}
public native void installCloseHandler() /*-{
var tmp = this;
$wnd.onmousemove = function() {
// edit the com.google.gwt.sample.contacts.client package
// to match your own package name
[email protected]::hide()();
$wnd.onmousemove = null;
}
}-*/;
}
相关问题
- 1. GWT拖放小部件
- 2. GWT分页小部件
- 3. 链接小部件GWT - uiBinder
- 4. GWT复合小部件
- 5. 聊天小部件的桌面通知
- 6. 如何删除magento通知小部件
- 7. 聊天窗口小部件的通知
- 8. 按钮点击外部小部件 - GWT
- 9. GWT UIBinder小部件的子元素数量未知
- 10. GWT - 许多小部件或包含其他小部件的小部件
- 11. GWT小部件的最佳套件
- 12. GWT部件不知道高度/尺寸
- 13. GWT removeHandler在第一事件通知
- 14. 如何通知小部件有关Qt中另一个小部件的更改?
- 15. GWT日期范围选择小部件
- 16. 连接GWT小部件和JIRA
- 17. GWT中的标签小部件
- 18. GWT小部件中的交互元素
- 19. 将GWT小部件插入div元素
- 20. 从GWT主持人小部件
- 21. GWT中有一个PickList小部件吗?
- 22. 如何强制GWT小部件更新?
- 23. 将样式应用到GWT小部件
- 24. 动态定位GWT小部件
- 25. GWT建议文本区域小部件
- 26. GWT Google Maps V3覆盖小部件
- 27. 在errai ui中使用gwt小部件
- 28. DynamicForm集成小部件(GWT)(Smartgwt) - com.google.gwt.user.client.ui.AttachDetachException
- 29. GWT使用DOM.clone克隆小部件
- 30. GWT小部件库和MVP模式
我同意这应该很容易滚你自己。值得注意的是,与上面链接的链接似乎不使用计时器来解除通知。相反,它似乎在监听onMouseMove并在鼠标移动时立即开始解散。 – pohl 2011-05-17 20:26:44
你说得对。通过鼠标移动隐藏通知的新版本更新后。 – 2011-05-17 21:04:05