use of de.janrufmonitor.ui.jface.application.journal.JournalController in project janrufmonitor by tbrandt77.
the class HighlightAction method run.
public void run() {
long m_timestamp = -1;
try {
m_timestamp = Long.parseLong(this.m_app.getApplication().getConfiguration().getProperty(CFG_HIGHLIGHT_TIME, "0"));
} catch (Exception e) {
this.m_logger.warning("Cannot parse long value: " + e.getMessage());
}
// highlight is disabled
if (m_timestamp == -1)
return;
Viewer v = this.m_app.getApplication().getViewer();
if (v != null && v instanceof TableViewer) {
Table t = ((TableViewer) v).getTable();
ICallList cl = ((JournalController) this.m_app.getController()).getCallList();
ICall c = null;
Font itemFont = null;
for (int i = 0, n = cl.size(); i < n; i++) {
c = cl.get(i);
if (this.isHighlight(m_timestamp, c.getDate().getTime())) {
itemFont = t.getItem(i).getFont();
t.getItem(i).setFont(this.getBoldFont(itemFont));
}
}
this.m_app.getApplication().getConfiguration().setProperty(CFG_HIGHLIGHT_TIME, Long.toString(System.currentTimeMillis()));
this.m_app.getApplication().storeConfiguration();
}
}
use of de.janrufmonitor.ui.jface.application.journal.JournalController in project janrufmonitor by tbrandt77.
the class MsnColoringAction method run.
public void run() {
Viewer v = this.m_app.getApplication().getViewer();
if (v != null && v instanceof TableViewer) {
this.m_colors = null;
Table t = ((TableViewer) v).getTable();
ICallList cl = ((JournalController) this.m_app.getController()).getCallList();
ICall c = null;
Color color = null;
for (int i = 0, n = cl.size(); i < n; i++) {
c = cl.get(i);
color = this.getMsnColor(c.getMSN().getMSN());
if (color != null) {
t.getItem(i).setForeground(color);
}
}
}
}
Aggregations