views:

29

answers:

0

Hi guys, 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...