|
Re: [GEF5] AbstractVisualPart activate while addChild [message #1775359 is a reply to message #1775104] |
Sat, 28 October 2017 11:08 |
|
I am not exactly sure what you are referring to here. Let me try to clarify things a bit. Only when being active, VisualParts may register listeners (ContentParts most likely listen for changes of their model) and react to changes that have been notified. As such, the activation and deactivation hooks are the places to register/unregister any listeners that trigger active reactions within your VisualPart. Within ContentParts, the refreshVisual() method is the correct place to update the visuals from the content (or more accurately the doRefreshVisuals() hook method that is called from it). The child should already have a content when being added to its parent (this is done by the ContentBehavior, so its valid to all refreshVisuals() before activating the child. Having said so, activate() is not the place to perform a one-time initialization. You might do such kind of things within the context of setContent() or lazily within refreshVisuals() instead.
[Updated on: Sat, 28 October 2017 11:09] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03989 seconds