Skip to content

Instantly share code, notes, and snippets.

@hendrikebbers
Created December 5, 2016 14:02
Show Gist options
  • Save hendrikebbers/2c544b52ddbcc16836db6d040f16fbb0 to your computer and use it in GitHub Desktop.
Save hendrikebbers/2c544b52ddbcc16836db6d040f16fbb0 to your computer and use it in GitHub Desktop.
tree-renderer
tree.setCellRenderer(new DefaultTreeCellRenderer() {
@Override
public IRendererComponent getTreeCellRendererComponent(ULCTree tree, Object value, boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
IRendererComponent renderer = super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, hasFocus);
if (value != null && value instanceof ApplicationMetadata) {
setText(((ApplicationMetadata) value).getName());
}
return renderer;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment