Hi Kevin, > I'm trying to convince an ULCTableTree to draw the column content in a centered way. Hence, I > have written a render component. Unfortunately the setting is completely ignored
To center the contents of a ULCLabel (DefaultTableTreeCellRenderer is a ULCLabel) use setHorizontalAlignment(ULCLabel.CENTER); setHorizontalTextPosition() sets the text position relative to the icon. >I have set the text to a standard value and the background color to red. >The text is ignored as well You cannot set the text on the renderer on the server-side. The text on the renderer is taken from the model on the client side. Do you really want to set text on the renderer or you just did it for the sake of testing? Thanks and regards, Janak ----------------------------------------- Janak Mulani email: [EMAIL PROTECTED] url: http://www.canoo.com <http://www.canoo.com/> Beyond AJAX - Java Rich Internet Applications http://www.canoo.com/ulc ----------------------------------------- ________________________________ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kevin Hirschmann Sent: Monday, September 22, 2008 6:05 PM To: [email protected] Subject: [ULC-developer] ITableTreeCellRenderer: setHorizontalTextAlignment ignored Dear ULC-List, I'm trying to convince an ULCTabletree to draw the column content in a centered way. Hence, I have written a render component. Unfortunately the setting is completely ignored. For testing purposes I have set the text to a standard value and the background color to red. The text is ignored as well, while the red background color is displayed. In the archive I found the following article, which made me believe the code snippet below should work.. Could someone please tell me what I am doing wrong? http://lists.canoo.com/mailman/private/ulc-developer/2003/000495.html Kind regards Kevin Hirschmann package awino.gui.renderer; import com.ulcjava.base.application.IRendererComponent; import com.ulcjava.base.application.ULCLabel; import com.ulcjava.base.application.ULCTableTree; import com.ulcjava.base.application.tabletree.ITableTreeCellRenderer; import com.ulcjava.base.application.util.Color; public class HistoryRenderer extends ULCLabel implements ITableTreeCellRenderer{ public IRendererComponent getTableTreeCellRendererComponent(ULCTableTree tableTree, Object value, boolean selected, boolean hasFocus, boolean expanded, boolean leaf, Object node) { setOpaque(true); setBackground(Color.red); setHorizontalTextPosition(ULCLabel.CENTER); setText("test"); return this; } } And somewhere in my code I am setting: tabtrHistorie.getColumnModel().getColumn(1).setCellRenderer(tabletreeRende rer); _______________________________________________ ULC-developer mailing list [email protected] http://lists.canoo.com/mailman/listinfo/ulc-developer
