Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Absent refreshing of treeview when deleting children node
Absent refreshing of treeview when deleting children node [message #419679] Mon, 02 June 2008 12:28 Go to next message
Victor Roldan Betancort is currently offline Victor Roldan BetancortFriend
Messages: 524
Registered: July 2009
Senior Member
Hi Ed,

first of all, I'm probably doing something wrong with the genmodel, but
the result is the following: I create a child of some node in the tree,
then delete it, and the node doesn't disappear from the tree. If I right
click on it, the "delete" option appears disabled. The editor knows the
children is deleted, but haven't refreshed the view. Once you manually
refresh it, the node disappears. Is this a correct behaviour?

The only thing I've changed (and that's why I suspect I've done
something wrong) is changing "children" and "create child" to true, so I
can see that model element as a children in the treeview.

I have the test .ecore, the .genmodel I used and an instance model to
test it. I'm using Eclipse 3.4 RC2 and EMF 2.4.0 RC2.

Cheers,
Víctor.
Re: Absent refreshing of treeview when deleting children node [message #419680 is a reply to message #419679] Mon, 02 June 2008 12:32 Go to previous messageGo to next message
Victor Roldan Betancort is currently offline Victor Roldan BetancortFriend
Messages: 524
Registered: July 2009
Senior Member
Oh, I just realized It also occurs not only with children deletion, but
also when adding nodes, the first added appears correctly, subsequent
additions are not refreshed properly and doesn't show up in the tree
until manually refreshed.

Víctor Roldán Betancort escribió:
> Hi Ed,
>
> first of all, I'm probably doing something wrong with the genmodel, but
> the result is the following: I create a child of some node in the tree,
> then delete it, and the node doesn't disappear from the tree. If I right
> click on it, the "delete" option appears disabled. The editor knows the
> children is deleted, but haven't refreshed the view. Once you manually
> refresh it, the node disappears. Is this a correct behaviour?
>
> The only thing I've changed (and that's why I suspect I've done
> something wrong) is changing "children" and "create child" to true, so I
> can see that model element as a children in the treeview.
>
> I have the test .ecore, the .genmodel I used and an instance model to
> test it. I'm using Eclipse 3.4 RC2 and EMF 2.4.0 RC2.
>
> Cheers,
> Víctor.
Re: Absent refreshing of treeview when deleting children node [message #419682 is a reply to message #419679] Mon, 02 June 2008 12:48 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Víctor,

Comments below.


Víctor Roldán Betancort wrote:
> Hi Ed,
>
> first of all, I'm probably doing something wrong with the genmodel,
> but the result is the following: I create a child of some node in the
> tree, then delete it, and the node doesn't disappear from the tree. If
> I right click on it, the "delete" option appears disabled.
Probably that means the getParent method isn't returning good results.
> The editor knows the children is deleted, but haven't refreshed the
> view. Once you manually refresh it, the node disappears. Is this a
> correct behaviour?
Does it sound correct to you? :-P
>
> The only thing I've changed (and that's why I suspect I've done
> something wrong) is changing "children" and "create child" to true, so
> I can see that model element as a children in the treeview.
Ah yes. Likely you to specialize ItemProviderAdapter.isWrappingNeeded
to return true so that wrappers will be created for your non-containment
children. Either that, or you need to specialize getParent so it
returns the parent as it occurs in the tree you've induced.
>
> I have the test .ecore, the .genmodel I used and an instance model to
> test it. I'm using Eclipse 3.4 RC2 and EMF 2.4.0 RC2.
>
> Cheers,
> Víctor.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Absent refreshing of treeview when deleting children node [message #419690 is a reply to message #419682] Mon, 02 June 2008 13:43 Go to previous message
Victor Roldan Betancort is currently offline Victor Roldan BetancortFriend
Messages: 524
Registered: July 2009
Senior Member
Ed,

ahm... I think "notify" was the problem. Once set to true, the tree
get's properly refreshed. Sorry for wasting your time!

Thanks for the feedback.

Víctor.

Ed Merks escribió:
> Víctor,
>
> Comments below.
>
>
> Víctor Roldán Betancort wrote:
>> Hi Ed,
>>
>> first of all, I'm probably doing something wrong with the genmodel,
>> but the result is the following: I create a child of some node in the
>> tree, then delete it, and the node doesn't disappear from the tree. If
>> I right click on it, the "delete" option appears disabled.
> Probably that means the getParent method isn't returning good results.
>> The editor knows the children is deleted, but haven't refreshed the
>> view. Once you manually refresh it, the node disappears. Is this a
>> correct behaviour?
> Does it sound correct to you? :-P
>>
>> The only thing I've changed (and that's why I suspect I've done
>> something wrong) is changing "children" and "create child" to true, so
>> I can see that model element as a children in the treeview.
> Ah yes. Likely you to specialize ItemProviderAdapter.isWrappingNeeded
> to return true so that wrappers will be created for your non-containment
> children. Either that, or you need to specialize getParent so it
> returns the parent as it occurs in the tree you've induced.
>>
>> I have the test .ecore, the .genmodel I used and an instance model to
>> test it. I'm using Eclipse 3.4 RC2 and EMF 2.4.0 RC2.
>>
>> Cheers,
>> Víctor.
Previous Topic:Order of undo in an EMFCommandOperation for a transaction with pre-commit
Next Topic:3.4 JFace Data Binding and 2.4 EMF
Goto Forum:
  


Current Time: Fri Apr 19 23:32:42 GMT 2024

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

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

Back to the top