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 11:51 Go to next message
Eclipse User
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 10:38 Go to previous message
Adam Pordzik is currently offline Adam Pordzik
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: Wed Aug 27 09:17:28 EDT 2014

Powered by FUDForum. Page generated in 0.02491 seconds