Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » [Wizard]: TableViewer selectionProvider inside a Wizard
[Wizard]: TableViewer selectionProvider inside a Wizard [message #656383] Fri, 25 February 2011 06:41 Go to next message
Gabriele  is currently offline Gabriele
Messages: 19
Registered: November 2010
Junior Member
Hi guys,
I have A JFace Wizard which has a page with a tableViewer.

I need to select elements from the table so I have to make the selection available in the table.
If I was in a ViewPart, I would do:

getSite().setSelectionProvider(viewer);


I saw that in the Wizard I can't access to a WorkbenchPart to call the setSelectionProvide method.
I can't use the getSelection from the SWT table gotten from the viewer, but I need the object of my model (i.e. the IStructuredSelection from the viewer). The TableItem selected from the SWT Table is insufficiet.

Thank you in advance for any help

Gabriele
Re: [Wizard]: TableViewer selectionProvider inside a Wizard [message #656391 is a reply to message #656383] Fri, 25 February 2011 07:19 Go to previous messageGo to next message
Devi Vara Prasad Bandaru is currently offline Devi Vara Prasad Bandaru
Messages: 98
Registered: March 2010
Location: Hyderabad
Member

You can try using this method from the viewer
org.eclipse.jface.viewers.StructuredViewer.getSelection(). It will return you a StructuredSelection containing the array of selected models from your table.




Re: [Wizard]: TableViewer selectionProvider inside a Wizard [message #656398 is a reply to message #656391] Fri, 25 February 2011 07:50 Go to previous message
Gabriele  is currently offline Gabriele
Messages: 19
Registered: November 2010
Junior Member
Hi Prasad,
thank you for your reply.
You're right! I don't need to pass the object selected outside the wizard (or at least I can use another way).

I added a SelectionChangedListener on the viewer and then I used the getSelection() from the viewer itself.

Thank you again!!
Gabriele
Previous Topic:how to sort alphanumeric values in org.eclipse.jface.viewers.ViewerSorter
Next Topic:ISelectionProvider and Proxy Objects
Goto Forum:
  


Current Time: Wed Apr 16 12:12:45 EDT 2014

Powered by FUDForum. Page generated in 0.01974 seconds