pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lello <rborre...@gmail.com>
Subject Re: TreeNodeEditor issue
Date Wed, 13 Apr 2011 19:54:38 GMT
After a quick look at the TreeBranch class, 
I think that this exception shouldn't thrown by the update() method, but
only by the insert.
I commented this part of the code in the update() method and everything
works as it should.
It this a bug or am I doing something wrong?


Greg Brown-2 wrote:
> 
> I haven't looked into this yet, but that exception is thrown when you try
> to add a tree node to more than one parent. In other words, you can't add
> a tree node to a new tree without first removing it from the old tree.
> 
> 
> On Apr 13, 2011, at 2:29 PM, lello wrote:
> 
>> Thanks, hopefully now someone else can give a look at the code.
>> The problem comes from the code:
>> 
>>    if (treeNode.getParent() != null) {
>>            throw new IllegalArgumentException("treeNode already has a
>> parent.");
>>        }
>> 
>> in TreeBranch.java. I can't understand why treeNode must have null parent
>> to
>> be updated.
>> 
>> 
>> 
>> Duto wrote:
>>> 
>>>> View this message in context:
>>>> http://apache-pivot-users.399431.n3.nabble.com/TreeNodeEditor-issue-tp2815778p2816403.html
>>>> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
>>> 
>>> If I can help :)
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>> 
>> 
>> --
>> View this message in context:
>> http://apache-pivot-users.399431.n3.nabble.com/TreeNodeEditor-issue-tp2815778p2817244.html
>> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
> 

Greg Brown-2 wrote:
> 
> I haven't looked into this yet, but that exception is thrown when you try
> to add a tree node to more than one parent. In other words, you can't add
> a tree node to a new tree without first removing it from the old tree.
> 
> 
> On Apr 13, 2011, at 2:29 PM, lello wrote:
> 
>> Thanks, hopefully now someone else can give a look at the code.
>> The problem comes from the code:
>> 
>>    if (treeNode.getParent() != null) {
>>            throw new IllegalArgumentException("treeNode already has a
>> parent.");
>>        }
>> 
>> in TreeBranch.java. I can't understand why treeNode must have null parent
>> to
>> be updated.
>> 
>> 
>> 
>> Duto wrote:
>>> 
>>>> View this message in context:
>>>> http://apache-pivot-users.399431.n3.nabble.com/TreeNodeEditor-issue-tp2815778p2816403.html
>>>> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
>>> 
>>> If I can help :)
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>> 
>> 
>> --
>> View this message in context:
>> http://apache-pivot-users.399431.n3.nabble.com/TreeNodeEditor-issue-tp2815778p2817244.html
>> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
> 


--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/TreeNodeEditor-issue-tp2815778p2817541.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Mime
View raw message