|Re: CheckboxTreeViewer - correct CellEditor and Checkbox only at root elements? [message #23994 is a reply to message #23875]
||Fri, 24 July 2009 14:44
| Patrick Konemann
Registered: July 2009
A follow-up question about checkboxes - I am not sure how to handle them:
If I use a cell editor to modify some data and call viewer.refresh(), all the checkbox states are gone, i.e. all items are unchecked again.
The workaround I see here is to manually iterate over all items again and set the checkbox state for each item.
Furthermore, after a refresh the entire tree is collapsed again.
Is there a trick how I can easily restore the state (collapsed/expanded items and the checkbox state) after a refresh?
On 24-07-2009 12:50, Patrick Könemann wrote:
> Hi everyone,
> I am confused about the API of a CheckboxTreeViewer (Galileo Release).
> The Javadoc for setCellEditors says:
> "Since 3.3, an alternative API is available, see
> ViewerColumn.setEditingSupport(EditingSupport) for a more flexible way
> of editing values in a column viewer."
> But the class TreeColumn doesn't seem to have the API mentioned.
> Also the snippet in  refers to a TableViewer, not to a TreeViewer.
> So what is the correct way of using cell editors here?
> Still using setCellEditors, setColumnProperties, and setCellModifier?
> And I am wondering if it is possible to have checkboxes only for root
> Right now, all elements in the tree have a checkbox attached.
> Best regards
>  http://wiki.eclipse.org/JFaceSnippets#Snippet034CellEditorPe rRowNewAPI
Powered by FUDForum
. Page generated in 0.11725 seconds