| [rap-dev] Question about RAP auto-refresh |
|
Hi, I want to implement a feature about auto-refresh a table, but the ie memory consumes a lot. My code is like this: public void startAutoFlush() { UICallBack.activate("AutoFlush"); Runnable deamon = new Runnable() { public void run() { while (running) { try { Thread.currentThread().sleep(1000); // auto-refresh every 1 second } catch (InterruptedException e) { e.printStackTrace(); } Runnable runnable = new Runnable() { public void run() { flush(); } }; tableViewer.getTable().getDisplay().asyncExec( runnable); } } }; threadDeamon = new Thread(deamon); threadDeamon.setDaemon(true); threadDeamon.start(); } public void flush() { tableViewer.refresh(); } } I use the RAP version 1.1.2-SR2-site-20090218. And test it in IE 7.0. Can you tell me why the memory increase so fast? If it is not a good way to implement the auto-refresh feature, how to do it? Thanks a lot! Drop me a line please. Claire 把MSN装进手机,更多聊天乐趣等你挖掘! 立刻下载! |