jTracer  1.03
Stack trace visualization tool
void org.libcsdbg.jtracer.StatusBar.setMessage ( final String  msg,
final boolean  normal 
)

Set the status message.

Parameters
[in]msgthe new status
[in]normalfalse if the new status reports a fault, true otherwise
Note
Assuming that only one dispatching thread does all component rendering, there is no need for synchronized method access

Definition at line 103 of file StatusBar.java.

104  {
105  /* If the rendering is done by the event dispatching thread */
106  if (EventQueue.isDispatchThread()) {
107  JLabel field = fields.get("status");
108  field.setText(msg);
109 
110  Registry conf = Registry.getCurrent();
111  if (!normal) {
112  field.setForeground((Color) conf.get("statusbar", "fgcolor-error"));
113  field.setIcon(conf.loadIcon("stat_err.png"));
114  }
115  else {
116  field.setForeground((Color) conf.get("statusbar", "fgcolor"));
117  field.setIcon(conf.loadIcon("stat_ok.png"));
118  }
119 
120  return;
121  }
122 
123  /*
124  * If the rendering is done from any other thread, create a Worker task and
125  * register it to be called by the event dispatching thread
126  */
127  class Worker implements Runnable {
128  public void run()
129  {
130  /* The task is to recursively call the same method */
131  setMessage(msg, normal);
132  }
133  }
134 
135  try {
136  SwingUtilities.invokeLater(new Worker());
137  }
138 
139  catch (Throwable t) {
140  Registry.debug(t);
141  }
142  }
void setMessage(final String msg, final boolean normal)
Set the status message.
Definition: StatusBar.java:103