dynamic cell editors in one cell in NatTable [message #1403867] |
Mon, 28 July 2014 10:41 |
Alex Dong Messages: 5 Registered: July 2014 |
Junior Member |
|
|
Hi,
i have read some documentions and tried some edit examples for natTable.
I registed the editors and painters for every column of my table,all work well after
i implements my columnPropertyAccessor.
but now i want to custom two cell editors in one cell.
for example,there are two columns in my table,one is "type" ,
and another is "value".by default the type is String and the value of the cell
is a TextCellEditor.but there has many types,if i select "File" ,i prefer the value
cell has a button appeared. after i click the button can open a
FileDialog.the code just like this:
if (type != null) {
if (isFile(type)) {
cellEditor = createFileCellEditor(table, defalutDataValue);
} else if (isDate(type)) {
cellEditor = createDateCellEditor(table, para);
((CustomCellEditor) cellEditor).getDefaultLabel().setEditable(false);
} else if (isDirectory(type)) {
cellEditor = createDirectoryCellEditor(table, defalutDataValue);
} else if (isList(type)) {
cellEditor = createListCellEditor(table, para);
defalutDataValue = para.getDisplayValue();
}
}
if (cellEditor == null) {
cellEditor = createDefaultTextCellEditor(table);
}
Is there any way to achive the target by NatTable?
Thanks a lot for the help.
|
|
|
|
|
|
Re: dynamic cell editors in one cell in NatTable [message #1404053 is a reply to message #1404005] |
Tue, 29 July 2014 11:02 |
Alex Dong Messages: 5 Registered: July 2014 |
Junior Member |
|
|
Hi,Dirk
Thanks for the informations.Yes,use the label mechanism and my data model,i can get the value column by the value of type column now after i add the UiBindingRegistry to caculate.
For the button here,maybe you are right,it is not necessary to add this.But after i checked the source code of NatTable, i found there is a NatCombo.class which also customized the cell
contains two controls.If later i still need the button,maybe i can do like this to custom a CellEditor which contains the text and button,right?
Regards,
Alex
|
|
|
|
Powered by
FUDForum. Page generated in 0.04603 seconds