01: /*
02: * Copyright (c) 2005 Your Corporation. All Rights Reserved.
03: */
04: package jsp;
05:
06: import org.wings.tree.SDefaultTreeCellRenderer;
07: import org.wings.SComponent;
08: import org.wings.STree;
09: import org.wings.style.CSSProperty;
10:
11: /**
12: * @author hengels
13: */
14: public class NavigationTreeCellRenderer extends
15: SDefaultTreeCellRenderer {
16: public SComponent getTreeCellRendererComponent(STree tree,
17: Object value, boolean selected, boolean expanded,
18: boolean leaf, int row, boolean hasFocus) {
19: super .getTreeCellRendererComponent(tree, value, selected,
20: expanded, leaf, row, hasFocus);
21: setIcon(null);
22:
23: if (tree.getPathForRow(row).getPathCount() == 2) {
24: String text = getText();
25: if (text.startsWith("<html>"))
26: text = "<html><b>" + text.substring("<html>".length())
27: + "</b>";
28: else
29: text = "<html><b>" + text + "</b>";
30: setText(text);
31: }
32:
33: return this;
34: }
35: }
|