Hi,
I'm trying to implement a ITreeCellRenderer for my ULCTree, but i
cannot set the text for the items.
The displayed text near every node seems to be the result of
object.toString()...
Here is the code:
private ITreeCellRenderer createTreeCellRenderer() {
DefaultTreeCellRenderer treeCellRenderer =
new DefaultTreeCellRenderer() {
public IRendererComponent
getTreeCellRendererComponent(
ULCTree tree, Object value, boolean selected,
boolean expanded, boolean leaf, boolean
hasFocus){
if (value instanceof GeneralPackageBean){
setClosedIcon(closedPackage);
setLeafIcon(closedPackage);
setOpenIcon(openPackage);
setText("package");
}else{ if(value instanceof HeadRecordDK){
setClosedIcon(headRecordDK);
setLeafIcon(headRecordDK);
setOpenIcon(headRecordDK);
setText("head record");
}}
return super.getTreeCellRendererComponent(tree,
value, selected, expanded, leaf, hasFocus);
}
};
return treeCellRenderer;
}
However, in the mailing list archive I found a post from June
2005 concerning this issue.
http://lists.canoo.com/mailman/private/ulc-developer/2005/002383.html
But the posted workaround won't work with my TreeModel.
Is there any other solution since ULC 6.1?
Freundliche Grüße /Best Regards
Florian Mair
DACHSER GmbH & Co. KG
Hauptniederlassung / Head Office
IT, Finance, Administration and Personnel (IFAP)
Team EDI
Memminger Str. 140
87439 Kempten
mailto:[EMAIL PROTECTED]
http://www.dachser.com
_______________________________________________
ULC-developer mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/ulc-developer