Hi Stefan This might help... http://www.jroller.com/page/ulc/?anchor=renderer_limitations
...as well as the mailinglist archive. Etienne > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:ulc-developer- > [EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] > Sent: Thursday, May 11, 2006 11:40 PM > To: [email protected] > Subject: [ULC-developer] ULCTree always uses toString() > > > 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 _______________________________________________ ULC-developer mailing list [email protected] http://lists.canoo.com/mailman/listinfo/ulc-developer
