Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » swt tree: setSelection
swt tree: setSelection [message #444188] Fri, 08 October 2004 11:08 Go to next message
Eclipse UserFriend
Originally posted by: clemens.ramona.gmx.de

I dont't know how to use the setSelection(ISelection selection) method to
set a selection on an item in my tree. (i only know the name of the item)

With : getViewSite().getSelectionProvider().getSelection()
I get the actual selection, but how can I set the selection ?
Re: swt tree: setSelection [message #444302 is a reply to message #444188] Mon, 11 October 2004 16:17 Go to previous message
Christian Elsen is currently offline Christian ElsenFriend
Messages: 33
Registered: July 2009
Member
Hi,

> I dont't know how to use the setSelection(ISelection selection) method to
> set a selection on an item in my tree. (i only know the name of the item)

> With : getViewSite().getSelectionProvider().getSelection()
> I get the actual selection, but how can I set the selection ?

just call setSelection(new
org.eclipse.jface.viewers.StructuredSelection(...)) on the tree with the
corresponding item you added to the tree when constructing it (using a
ContentProvider).

Regards,
Christian Elsen
www.zeos.de
Previous Topic:Detecting system idle time
Next Topic:create a simple tree view
Goto Forum:
  


Current Time: Tue Oct 20 03:48:50 GMT 2020

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

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

Back to the top