GWT - CSS GUI 通知用户 - 浏览器问题

发布于 2024-09-26 19:56:03 字数 1062 浏览 2 评论 0原文

哇,我想不出一个像样的标题,所以我采用了缩写词方法:-)

基本上我在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

时光与爱终年不遇 2024-10-03 19:56:03

我将其视为可靠的编码,并且我相信我的 GWT 错误在其他地方

I've took this as a solid bit of coding and I believe my GWT error's where elsewhere

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文