Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-15-2009, 09:30 PM
Member
 
Join Date: Apr 2009
Posts: 2
Rep Power: 0
amine2610 is on a distinguished road
Default table selection in SWT/Jface
Hi,
I'm using SWT/Jface, and I created a table viewer, and I set the input to an ArrayList where I have my object
How can I do to retrieve the selected object in the table.

thank you very much
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 04-15-2009, 09:38 PM
Member
 
Join Date: Apr 2009
Posts: 2
Rep Power: 0
amine2610 is on a distinguished road
Default
I found it

ISelection selection = view.getSite().getSelectionProvider()
.getSelection();
List<Person> personList = new ArrayList<Person>();
if (selection != null && selection instanceof IStructuredSelection) {
IStructuredSelection sel = (IStructuredSelection) selection;
for (Iterator<Person> iterator = sel.iterator(); iterator.hasNext() {
Person person = (Person) iterator.next();
personList.add(person);
}
}


thanks
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Jface Viewer help JohnTayler SWT / JFace 2 04-23-2009 12:28 AM
SWT JFace bug using context menu xcallmejudasx SWT / JFace 0 11-14-2008 05:04 PM
First JFace application Java Tip SWT 0 07-02-2008 09:13 PM
JFace Window Java Tip SWT 0 07-02-2008 09:12 PM
Jface + Gef Eric Advanced Java 1 07-05-2007 09:07 PM


All times are GMT +2. The time now is 02:59 AM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org