Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » TreeItem move
TreeItem move [message #463287] Wed, 02 November 2005 16:51 Go to next message
Eclipse UserFriend
Originally posted by: OE_PROMOS.TERRA.ES

I am trying to sort a tree with multiple levels, but I have not idea about
way to do it.

Are there any way to change to change TreeItems (child) position ?

Are there any way to change a TreeItem parent?

Thanks
Re: TreeItem move [message #463327 is a reply to message #463287] Thu, 03 November 2005 15:38 Go to previous message
Adam Pordzik is currently offline Adam PordzikFriend
Messages: 19
Registered: July 2009
Junior Member
Oscar Escudero wrote:
> I am trying to sort a tree with multiple levels, but I have not idea about
> way to do it.
>
> Are there any way to change to change TreeItems (child) position ?
>
> Are there any way to change a TreeItem parent?

Apparently not. Use new TreeItem(Tree parent, int style, int index)
or TreeItem(TreeItem parentItem, int style, int index) and create a
copy of your Item. Finally dispose() the old one.

e.g.:

TreeItem newItem;
newItem = new TreeItem (oldItem.getParent(), oldItem.getStyle(), 0); // OR:
newItem = new TreeItem (oldItem.getParentItem(), oldItem.getStyle(), 0);
newItem.setData(oldItem.getData());
newItem.setImage(oldItem.getImage());
newItem.setText(oldItem.getText());
oldItem.dispose();


A

--
Previous Topic:I wrote a Visual Editor tutorial
Next Topic:group composite
Goto Forum:
  


Current Time: Fri Apr 26 04:50:55 GMT 2024

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

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

Back to the top