Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Refreshing View (I want to make a real time digital clock using RCP )
Refreshing View [message #533694] Sat, 15 May 2010 12:48 Go to next message
No real name is currently offline No real name
Messages: 2
Registered: May 2010
Junior Member
I am very new to RCP .
I want to make a real time digital clock using RCP .
For that i have to refresh the view every second .
So , how to achieve that ?
Can anyone please help me on this issue .


Re: Refreshing View [message #533905 is a reply to message #533694] Mon, 17 May 2010 08:48 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

You need to call setTime(*) on your view either at regular intervals or
when it should actually change.

You can use org.eclipse.swt.widgets.Display.timerExec(int, Runnable).
that will run in the UI thread, but it won't keep accurate time.

Otherwise, use some Thread based or Job base pattern, and use
Display.asyncExec(*) to actually update the view time on the UI thread.

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


icon7.gif  Re: Refreshing View [message #533968 is a reply to message #533905] Mon, 17 May 2010 11:09 Go to previous message
No real name is currently offline No real name
Messages: 2
Registered: May 2010
Junior Member
Thank you very much Paul for reply .
I used Display.asyncExec(*) inside a thread which did the trick for me.
Previous Topic:Editor close event and clean up of messages
Next Topic:Associating an Action with a key binding
Goto Forum:
  


Current Time: Fri Aug 22 16:01:08 EDT 2014

Powered by FUDForum. Page generated in 0.01553 seconds