Expeditor Toolkit,
Version 6.2
Operating systems: Linux on x86, Windows |
You can create cells that are editable by users by implementing the ICellModifier and CellEditor classes in the TableViewer.
_viewer.setCellModifier(new ICellModifier(){
public boolean canModify(Object arg0, String arg1) {
return true;
}
public Object getValue(Object arg0, String arg1) {
if(arg0 instanceof Mail){
if(arg1.equalsIgnoreCase("ID_SUBJECT")){
return ((Mail)arg0).getSubject();
}
}
return null;
}
public void modify(Object arg0, String arg1, Object arg2) {
System.out.println("Please modify it");
}
});
CellEditor[] editors=new CellEditor[tableColCount];
for(int k=0;k<editors.length;k++){
editors[k]=null;
}
//disable the cell editor
editors[1]=new TextCellEditor(_viewer.getTable().getBody());
if(isEnableEditor)
_viewer.setCellEditors(editors);
else
_viewer.setCellEditors(null);