TreeItem move [message #463287] |
Wed, 02 November 2005 16:51 |
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 15:38 |
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
--
|
|
|
Powered by
FUDForum. Page generated in 0.03767 seconds