开发者

GWT - CSS GUI Notify User - Browser Issues

开发者 https://www.devze.com 2023-01-19 07:45 出处:网络
wow I couldn\'t think of a decent title so I we开发者_StackOverflow中文版nt for the acronym approach :-)

wow I couldn't think of a decent title so I we开发者_StackOverflow中文版nt 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...


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

0

精彩评论

暂无评论...
验证码 换一张
取 消