Hello

I'm using an ULCTree with a custom TreeCellRenderer.
In the TreeCellRenderer I like to set the text for each item, based on the
locale.
This does not work, because the method MyElement>>toString() is always used
to get the text for the tree.

Is there a possibilty that the ULCTree does not use toString(), but the
text which I set in the CellRenderer?
Or is something that I'm doing wrong?

Thanks for any help

Please find here MyTreeCellRenderer:
*******************************************************************************************
public class MyTreeCellRenderer extends DefaultTreeCellRenderer {

public Locale currentLocale;

public IRendererComponent getTreeCellRendererComponent(ULCTree tree, Object
value, boolean selected, boolean expanded, boolean leaf, boolean hasFocus)
{

      super.getTreeCellRendererComponent(tree, value, selected, expanded,
leaf, hasFocus);

      MyElement element = (MyElement) value;

      /* gets the text for the currentLocale, MyElement doesn't know the
currentLocale*/
      String text = element.getText(currentLocale);
      setText(text);

      return this;
}
}

***********************************
********************************************************

Stefan Marti
DV Bern AG

--
mailto:[EMAIL PROTECTED]  /  http://www.dvbern.ch
Nussbaumstrasse 21, Postfach 106, CH-3000 Bern 22
Telefon:  ++41 +31 378 24 24 / Telefax:  ++41 +31 378 24 74

_______________________________________________
ULC-developer mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/ulc-developer

Reply via email to