GWT - CSS GUI 通知用户 - 浏览器问题
哇,我想不出一个像样的标题,所以我采用了缩写词方法:-)
基本上我在 GWT 中工作,我想通知用户面板更改了它的文本。
我通过使用 Timer() 和 CSS 来完成此操作
public void flashObject() {
final Timer flashing = new Timer()
{
public void run()
{
flashNewException();
}
};
flashing.scheduleRepeating(rate);
new Timer()
{
public void run()
{
if(stay){
panel.addClass(CSS_HIGHLIGHT);
} else {
panel.removeClass(CSS_HIGHLIGHT);
}
flashing.cancel();
}
}.schedule(length);
}
private void flashNewException() {
if(on){
// GWT.log("flashin");
panel.addClass(CSS_HIGHLIGHT);
on = false;
} else {
// GWT.log("stop flashin");
panel.removeClass(CSS_HIGHLIGHT);
on = true;
}
}
因此,这基本上采用了面板添加并删除了允许面板“闪烁”的 CSS 类。
问题是,如果我在 FF 中与代码的其余部分一起运行它,FF 有时会崩溃(我在其他地方运行着另外两个计时器)。我也在运行 GWT-EXT。
我知道这可能不是我的问题的关键,但我想问,您认为这是在 GWT / GWT-Ext 中刷新面板的正确方法吗? GWT 将计时器转换为 JavaScript 的优化程度如何?FireFox 处理多个计时器的能力如何?
另外一点,如果我从任务列表中杀死“plugin-container.exe”,FireFox 将恢复...
wow I couldn't think of a decent title so I went for the acronym approach :-)
basically I'm working in GWT and I want to notify the user of a panel changing it's text.
I've done this by using a Timer() and CSS
public void flashObject() {
final Timer flashing = new Timer()
{
public void run()
{
flashNewException();
}
};
flashing.scheduleRepeating(rate);
new Timer()
{
public void run()
{
if(stay){
panel.addClass(CSS_HIGHLIGHT);
} else {
panel.removeClass(CSS_HIGHLIGHT);
}
flashing.cancel();
}
}.schedule(length);
}
private void flashNewException() {
if(on){
// GWT.log("flashin");
panel.addClass(CSS_HIGHLIGHT);
on = false;
} else {
// GWT.log("stop flashin");
panel.removeClass(CSS_HIGHLIGHT);
on = true;
}
}
So this basically take's a panel add's and removes the CSS class allowing the panel to 'flash'.
The trouble is if I run this in FF alongside the rest of my code FF will sometimes crash (I have another two timer's running elsewhere). I'm also running GWT-EXT.
I appreciate this may not be the crux of my problem but I'd like to ask, do you think this is the correct way to flash a panel in GWT / GWT-Ext? How optimised is GWT to convert Timer's into javascript and how capable is FireFox at dealing with multiple Timers?
As an extra point, if I kill 'plugin-container.exe' from my task list FireFox will recover...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我将其视为可靠的编码,并且我相信我的 GWT 错误在其他地方
I've took this as a solid bit of coding and I believe my GWT error's where elsewhere