Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » swt tree: setSelection
swt tree: setSelection [message #444188] Fri, 08 October 2004 07: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 12:17 Go to previous message
Eclipse UserFriend
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: Wed Jul 02 02:35:57 EDT 2025

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

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

Back to the top