Skip to main content


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 11:41 Go to next message
Gabriele  is currently offline Gabriele Friend
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 12:19 Go to previous messageGo to next message
Devi Vara Prasad Bandaru is currently offline Devi Vara Prasad BandaruFriend
Messages: 100
Registered: March 2010
Location: Hyderabad
Senior 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 12:50 Go to previous message
Gabriele  is currently offline Gabriele Friend
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: Thu Apr 25 12:35:38 GMT 2024

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

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

Back to the top