use of de.janrufmonitor.service.trayicon.TrayIcon in project janrufmonitor by tbrandt77.
the class DialogPropagator method propagate.
public void propagate(final Message m) {
final Throwable t = m.getThrowable();
Thread td = new Thread(new Runnable() {
public void run() {
DisplayManager.getDefaultDisplay().asyncExec(new Runnable() {
public void run() {
openDialog(m.getLevel(), m.getNamespace(), m.getMessage(), m.getVariables(), (t != null ? t.toString() : ""));
if (m.getLevel().equalsIgnoreCase(Message.ERROR)) {
m_logger.log(Level.SEVERE, m.getMessage(), t);
}
if (m.isSetErrorIcon()) {
IService tray = getRuntime().getServiceFactory().getService("TrayIcon");
if (tray != null && tray instanceof TrayIcon) {
((TrayIcon) tray).setIconStateError();
}
}
}
});
}
});
td.start();
try {
td.join();
} catch (InterruptedException e) {
this.m_logger.log(Level.SEVERE, e.getMessage(), e);
}
}