int row,
boolean hasFocus) {
if (treeNode == null) return null;
this.setFont(StructureTree.DEFAULT_FONT);
SwingTreeViewNode viewNode = (SwingTreeViewNode)treeNode;
IProgramElement node = viewNode.getStructureNode();
if (viewNode.getKind() == IStructureViewNode.Kind.LINK) {
ISourceLocation sourceLoc = node.getSourceLocation();
if ((null != sourceLoc)
&& (null != sourceLoc.getSourceFile().getAbsolutePath())) {
setTextNonSelectionColor(AjdeWidgetStyles.LINK_NODE_COLOR);
} else {
setTextNonSelectionColor(AjdeWidgetStyles.LINK_NODE_NO_SOURCE_COLOR);
}
} else if (viewNode.getKind() == IStructureViewNode.Kind.RELATIONSHIP) {
this.setFont(new Font(this.getFont().getName(), Font.ITALIC, this.getFont().getSize()));
setTextNonSelectionColor(new Color(0, 0, 0));
} else if (viewNode.getKind() == IStructureViewNode.Kind.DECLARATION) {
setTextNonSelectionColor(new Color(0, 0, 0));
}
super.getTreeCellRendererComponent(tree, treeNode, sel, expanded, leaf, row, hasFocus);
if (viewNode.getIcon() != null && viewNode.getIcon().getIconResource() != null) {
setIcon((Icon)viewNode.getIcon().getIconResource());
} else {
setIcon(null);
}
if (node != null) {
if (node.isRunnable()) {
setIcon(Ajde.getDefault().getIconRegistry().getExecuteIcon());
}
if (node.getMessage() != null) {
if (node.getMessage().getKind().equals(IMessage.WARNING)) {
setIcon(Ajde.getDefault().getIconRegistry().getWarningIcon());
} else if (node.getMessage().getKind().equals(IMessage.ERROR)) {
setIcon(Ajde.getDefault().getIconRegistry().getErrorIcon());
} else {
setIcon(Ajde.getDefault().getIconRegistry().getInfoIcon());
}
}