[go: up one dir, main page]

Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Nebula » how to make a xviewer editable
how to make a xviewer editable [message #1022912] Fri, 22 March 2013 19:30 Go to next message
Luiz E. is currently offline Luiz E.Friend
Messages: 100
Registered: September 2010
Senior Member
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

Re: how to make a xviewer editable [message #1039683 is a reply to message #1022912] Fri, 12 April 2013 12:57 Go to previous message
Jürgen  Reichl is currently offline Jürgen ReichlFriend
Messages: 6
Registered: March 2012
Junior Member
Hi Luiz,

The XViewerEditAdapter is integrated in the official example of the XViewer (https://git.eclipse.org/c/nebula/org.eclipse.nebula.git/tree/widgets/xviewer/org.eclipse.nebula.widgets.xviewer.example/src/org/eclipse/nebula/widgets/xviewer/example).

If you have some problems with this example feel free and contact me.

best regards
Jürgen
Previous Topic:Grid celleditor is not editable while it's content is too long
Next Topic:XViewer Columns
Goto Forum:
  


Current Time: Sat Dec 14 05:11:06 GMT 2024

Powered by FUDForum. Page generated in 0.03650 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top