Search in sources :

Example 1 with EditorController

use of de.janrufmonitor.ui.jface.application.editor.EditorController in project janrufmonitor by tbrandt77.

the class CallerColoringAction method run.

public void run() {
    Viewer v = this.m_app.getApplication().getViewer();
    if (v != null && v instanceof TreeViewer) {
        Tree t = ((TreeViewer) v).getTree();
        ICallerList cl = ((EditorController) this.m_app.getController()).getCallerList();
        ICaller c = null;
        for (int i = 0, n = cl.size(); i < n; i++) {
            c = cl.get(i);
            Color color = this.getColor(c, t);
            if (color != null) {
                t.getItem(i).setForeground(color);
            }
            if (i % 2 == 0) {
                t.getItem(i).setBackground(getIterationColor(t));
            }
        }
    }
}
Also used : ICaller(de.janrufmonitor.framework.ICaller) EditorController(de.janrufmonitor.ui.jface.application.editor.EditorController) ICallerList(de.janrufmonitor.framework.ICallerList) TreeViewer(org.eclipse.jface.viewers.TreeViewer) Color(org.eclipse.swt.graphics.Color) Tree(org.eclipse.swt.widgets.Tree) Viewer(org.eclipse.jface.viewers.Viewer) TreeViewer(org.eclipse.jface.viewers.TreeViewer)

Aggregations

ICaller (de.janrufmonitor.framework.ICaller)1 ICallerList (de.janrufmonitor.framework.ICallerList)1 EditorController (de.janrufmonitor.ui.jface.application.editor.EditorController)1 TreeViewer (org.eclipse.jface.viewers.TreeViewer)1 Viewer (org.eclipse.jface.viewers.Viewer)1 Color (org.eclipse.swt.graphics.Color)1 Tree (org.eclipse.swt.widgets.Tree)1