Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Highlighting Tree Item Selection
Highlighting Tree Item Selection [message #454337] Wed, 20 April 2005 16:51 Go to next message
Lisa Jett is currently offline Lisa JettFriend
Messages: 1
Registered: July 2009
Junior Member
Is there anyway to control the display of the currently selected item in a
Tree? I have a Tree control that the user can move an item in the tree up
or down. When the item to be moved is first selected with the mouse, the
item is highlighted and is blue in color. After the item is moved, I
would like to have the moved item displayed in the same way (highlighted
and blue). Is there any way to do this? I tried setSelection, showItem,
but neither of these affect the appearance of the item.

Thanks for any help.
Re: Highlighting Tree Item Selection [message #454343 is a reply to message #454337] Wed, 20 April 2005 20:57 Go to previous message
Boris Munivrana is currently offline Boris MunivranaFriend
Messages: 23
Registered: July 2009
Junior Member
Hi,

I tried this too with DND in an SWT Tree and this code worked well for me:

TreeItem newItem = new TreeItem(parent, SWT.NONE, index);

// show selection
tree.showItem(newItem);
tree.setSelection(new TreeItem[]{newItem})

With kind regards

Boris Munivrana


Lisa Jett wrote:

> Is there anyway to control the display of the currently selected item in a
> Tree? I have a Tree control that the user can move an item in the tree up
> or down. When the item to be moved is first selected with the mouse, the
> item is highlighted and is blue in color. After the item is moved, I
> would like to have the moved item displayed in the same way (highlighted
> and blue). Is there any way to do this? I tried setSelection, showItem,
> but neither of these affect the appearance of the item.

> Thanks for any help.
Previous Topic:HTML Editor
Next Topic:Expanding a TreeItem in swt.Tree
Goto Forum:
  


Current Time: Sun Apr 11 08:20:30 GMT 2021

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

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

Back to the top