I'm trying to find an example on how to make a xviewer editable
Anyone out here have any piece of code that can help me?
We tried something like this, but of course didn't worked
viewer = new ControleContabilViewer(frmControleContbil.getBody(), SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION | SWT.FILL);
//não mostra o menu no clique do botão direito
viewer.getMenuManager().dispose();
Tree tree = viewer.getTree();
formToolkit.paintBordersFor(tree);
viewer.getTree().setLayoutData(new GridData(GridData.FILL_BOTH));
viewer.setContentProvider(new ControleContabilViewerContentProvider());
viewer.setLabelProvider(new ControleContabilViewerLabelProvider(viewer));
TreeViewerEditor.create(viewer, new ColumnViewerEditorActivationStrategy(viewer), ColumnViewerEditor.KEEP_EDITOR_ON_DOUBLE_CLICK);
also
viewer.getTree().setLayoutData(new GridData(GridData.FILL_BOTH));
viewer.setContentProvider(new ControleContabilViewerContentProvider());
viewer.setLabelProvider(new ControleContabilViewerLabelProvider(viewer));
XViewerControlFactory factory = new DefaultXViewerControlFactory();
XViewerConverter converter = new XViewerConverter() {
@Override
public void setInput(Control c, CellEditDescriptor ced, Object selObject) {
}
@Override
public void getInput(Control c, CellEditDescriptor ced, Object selObject) {
}
};
XViewerEditAdapter adapter = new XViewerEditAdapter(factory, converter);
viewer.setXViewerEditAdapter(adapter);
adapter.activate(viewer);
[Updated on: Fri, 22 March 2013 19:31]
Report message to a moderator