Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » editElement method of TreeViewer
editElement method of TreeViewer [message #467827] Fri, 11 May 2007 08:24 Go to next message
Swetha is currently offline SwethaFriend
Messages: 68
Registered: July 2009
Member
Hi,


I am facing a problem in editing a tree item.

I have written one action like when I click on edittree button the
selected item is in editable mode..

First I will explain the tree and then the problem, The tree structure
is Cust1 is the first level next one is list of studies for that Cust1(say
Study1, Study2)...and the third and last level is Experimens list under
each study...
one experiment can be more than one study...

Suppose data is Cust1 -- Study1 -- Exp1
-- Exp2

-- Study2 -- Exp1
-- Exp2

When I select Exp1 under Study2 and click on edittree button, the Exp1
under Study1 is getting selected..

I think the problem is with the editElement() method,

treeItem = treeViewer.getTree().getSelection()[0];

treeViewer.editElement(treeItem.getData(), 0);

I think editElement method is searching the tree and selecting the
treeItem which ever it encounters the same model....

I hope you got the problem...

Thanks,
Swetha
Re: editElement method of TreeViewer [message #467829 is a reply to message #467827] Fri, 11 May 2007 08:57 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hi,

Are the Exp1 and Exp2 the same object instances? If you you need to pass
a TreePath to editElement to uniquely identify the element you want to edit.

Tom

Swetha schrieb:
> Hi,
>
>
> I am facing a problem in editing a tree item.
>
> I have written one action like when I click on edittree button the
> selected item is in editable mode..
>
> First I will explain the tree and then the problem, The tree
> structure is Cust1 is the first level next one is list of studies for
> that Cust1(say Study1, Study2)...and the third and last level is
> Experimens list under each study...
> one experiment can be more than one study...
>
> Suppose data is Cust1 -- Study1 -- Exp1
> -- Exp2
>
> -- Study2 -- Exp1
> -- Exp2
>
> When I select Exp1 under Study2 and click on edittree button, the Exp1
> under Study1 is getting selected..
>
> I think the problem is with the editElement() method,
> treeItem = treeViewer.getTree().getSelection()[0];
>
> treeViewer.editElement(treeItem.getData(), 0);
>
> I think editElement method is searching the tree and selecting the
> treeItem which ever it encounters the same model....
>
> I hope you got the problem...
>
> Thanks,
> Swetha
>
>
>
>
>
>
>
>
>
>
>
>
>
Re: editElement method of TreeViewer [message #467830 is a reply to message #467829] Fri, 11 May 2007 09:02 Go to previous message
Swetha is currently offline SwethaFriend
Messages: 68
Registered: July 2009
Member
Hi,

Exp1,EXp2 are the instance of Experiment domain object.....

I thought the same to pass TreePath to the editElement() method,

how can I get the treePath for the selected tree Item.. I tried all the
methods to get access to the TreePath..

Thanks,
Swetha
Previous Topic:3.2.2 Update-Sites from feature.xml not listed as bookmark in update manager
Next Topic:Re: TableSorter without initial sorting
Goto Forum:
  


Current Time: Sat Apr 20 04:15:36 GMT 2024

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

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

Back to the top