org.fosstrak.llrp.commander.util
Class MessageBoxRefresh

java.lang.Object
  extended by org.fosstrak.llrp.commander.util.MessageBoxRefresh
All Implemented Interfaces:
java.lang.Runnable

public class MessageBoxRefresh
extends java.lang.Object
implements java.lang.Runnable

helper thread that periodically refreshes the message box view if a new message has arrived. (refreshing whenever a message arrives kills eclipse ui.).

Author:
sawielan

Field Summary
static boolean DEFAULT_REFRESH_BEHAVIOR
          whether to refresh or not by default.
static long DEFAULT_REFRESH_INTERVAL_MS
          the default interval to refresh the messagebox view.
 long refreshTime
          the interval to refresh the messagebox view.
 
Constructor Summary
MessageBoxRefresh(MessageboxView messageboxView)
          constructor for the message box refresher thread.
 
Method Summary
 long getRefreshTime()
           
 boolean hasStopped()
          if the refresher has stopped true is returned.
 void run()
          execute the refresher thread.
 void setDirty()
          sets the messagebox to dirty, meaning a new message arrived and we need to refresh the message box.
 void setMessageBox(MessageboxView messageboxView)
          sets the messagebox to refresh.
 void setRefresh(boolean refresh)
          turn on/off the refresh behavior.
 void setRefreshTime(long refreshTime)
          set the refresh time to use. if never set, the default refresh time is used.
 void stop()
          stops the refresher from executing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_REFRESH_INTERVAL_MS

public static final long DEFAULT_REFRESH_INTERVAL_MS
the default interval to refresh the messagebox view.

See Also:
Constant Field Values

refreshTime

public long refreshTime
the interval to refresh the messagebox view.


DEFAULT_REFRESH_BEHAVIOR

public static final boolean DEFAULT_REFRESH_BEHAVIOR
whether to refresh or not by default.

See Also:
Constant Field Values
Constructor Detail

MessageBoxRefresh

public MessageBoxRefresh(MessageboxView messageboxView)
constructor for the message box refresher thread.

Parameters:
messageboxView - the message box to be refreshed.
Method Detail

setDirty

public void setDirty()
sets the messagebox to dirty, meaning a new message arrived and we need to refresh the message box.


setRefresh

public void setRefresh(boolean refresh)
turn on/off the refresh behavior.

Parameters:
refresh - if set to true refresh the messagebox, otherwise not.

setMessageBox

public void setMessageBox(MessageboxView messageboxView)
sets the messagebox to refresh.

Parameters:
messageboxView - the message box to be refreshed.

stop

public void stop()
stops the refresher from executing.


hasStopped

public boolean hasStopped()
if the refresher has stopped true is returned.

Returns:
true if stopped, false otherwise.

setRefreshTime

public void setRefreshTime(long refreshTime)
set the refresh time to use. if never set, the default refresh time is used.

Parameters:
refreshTime - the new refresh time.

getRefreshTime

public long getRefreshTime()
Returns:
the refresh time.

run

public void run()
execute the refresher thread.

Specified by:
run in interface java.lang.Runnable


Copyright © 2009. All Rights Reserved.