Hi
all,
i have implemented
a Tabletree and want some cells of a column to be editable to flush
later into database. For this issue i implement a CellEditor and
CellRenderer as listed below. But now i'm running into difficulties. The
ULCTextField implements the IEditorComponent indeed but not the
IRendererComponent and 'cause of that a ClassCastException is thrown by
execution (both components are added to the table). On the other hand, when
i try the same with an ULCLabel, the super constructor of DefaultCellEditor is
undefined for ULCLable ('cause not implementing the IEditorComponent
interface) but implements IRendererComponent instead!?!?! How can i solve
this or how can i edit cells in an other way?
My second question
is, how i can get then the edited values and flush them into db by clicking on a
button for example? Pls see the snippet below.
Thanks and kind
regards,
Carsten...
private static
class CellEditor extends DefaultCellEditor {
public
CellEditor(ULCTextField field)
{
super(field);
}
super(field);
}
public
IEditorComponent
getTableTreeCellEditorComponent(
ULCTableTree tableTree, Object value, boolean selected,
boolean expanded, boolean leaf, Object node) {
ULCTextField field = (ULCTextField) getEditorComponent();
// field.setText((String) node);
return field;
}
ULCTableTree tableTree, Object value, boolean selected,
boolean expanded, boolean leaf, Object node) {
ULCTextField field = (ULCTextField) getEditorComponent();
// field.setText((String) node);
return field;
}
}
private
static class CellRenderer extends ULCTextField
implements
ITableTreeCellRenderer {
public IRendererComponent getTableTreeCellRendererComponent(
ULCTableTree tableTree, Object value, boolean selected,
boolean hasFocus, boolean expanded, boolean leaf, Object node) {
// setText((String) node);
return (IRendererComponent) this;
}
ITableTreeCellRenderer {
public IRendererComponent getTableTreeCellRendererComponent(
ULCTableTree tableTree, Object value, boolean selected,
boolean hasFocus, boolean expanded, boolean leaf, Object node) {
// setText((String) node);
return (IRendererComponent) this;
}
}
