|
Is it possible to get hold of the underlying Swing table from ULCTable?: msg#00162java.ulc.devel
Hi All,
Code Snippet is as given
below:
protected String typeString()
{
// works only in development mode; to be replaced by a full-qualified package string return UIExtendedTable.class.getName(); } public static class UIExtendedTable extends UITable { public void restoreState(Anything args) { super.restoreState(args); JWordWrapTableHeader
headerRenderer = new JWordWrapTableHeader();
for (Enumeration enumeration =
getBasicTable().getColumnModel()
.getColumns(); enumeration.hasMoreElements();) { TableColumn column = (TableColumn) enumeration.nextElement(); column.setHeaderRenderer(headerRenderer); } } private static class JWordWrapTableHeader extends JTextArea implements TableCellRenderer { public JWordWrapTableHeader() { setLineWrap(true); setWrapStyleWord(true); setBackground(new Color(223, 235, 252)); setBorder(UIManager.getBorder("TableHeader.cellBorder")); } public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { setText((String) value); setSize(table.getColumnModel().getColumn(column).getWidth(), getPreferredSize().height); return this; } } } But my project has an additional requirement. My project has something called a field chooser utility. When a user clicks on the field chooser he gets a list of columns. The user can select any number of columns that he would like to view and the table is refreshed with the selected columns. While refreshing the table I am using fireTableStructureChanged() method. When I call fireTableStructureChanged() method it is removing the effect of word wrapping in the column header. I need to set the renderer again on the underlying Swing table. Is it possible to get hold of the underlying Swing table from ULCTable? If this is possible I can again set the renderer on the underlying Swing table after calling fireTableStructureChanged() method? If this is not possible is there a way to set the renderer again after calling fireTableStructureChanged() method? Thanks & Regards Prasanta
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Key Navigation in ULCTable, karthick Rajagopal |
|---|---|
| Next by Date: | RE: Is it possible to get hold of the underlying Swing table from ULCTable?, Pavkovic, Ilja |
| Previous by Thread: | Key Navigation in ULCTable, karthick Rajagopal |
| Next by Thread: | RE: Is it possible to get hold of the underlying Swing table from ULCTable?, Janak Mulani |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |