Editable columns of tree viewer [message #538631] |
Tue, 08 June 2010 09:14 |
vrush Mising name Messages: 51 Registered: July 2009 Location: Pune |
Member |
|
|
Hi,
I have tree viewer with two columns as property and value. I need to make 2nd column editable. Tried setting column editors and column properties as follows but not able to edit any column.
Code snippet :
viewer = new TreeViewer(parent, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION);
viewer.setColumnProperties(new String[] {"Property","Value"});
viewer.setCellEditors(new CellEditor[]{new TextCellEditor(viewer.getTree()), new TextCellEditor(viewer.getTree())});
viewer.setCellModifier(new ICellModifier() {
@Override
public void modify(Object element, String property, Object value) {
System.out.println("propertyName\t" + property);
}
@Override
public Object getValue(Object element, String property) {
return null;
}
@Override
public boolean canModify(Object element, String property) {
/*
return true;
}
});
viewer.setContentProvider(new ViewContentProvider());
viewer.setLabelProvider(new ViewLabelProvider());
viewer.setSorter(new NameSorter());
Please suggest if missing anything. Stuck.
Any help would be grateful.
Thanks,
Vrushali.
|
|
|
Re: Editable columns of tree viewer [message #538657 is a reply to message #538631] |
Tue, 08 June 2010 11:05 |
Vijay Raj Messages: 608 Registered: July 2009 |
Senior Member |
|
|
public Object getValue(Object element, String property) {
return null;
}
should not return a null value
---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04021 seconds