Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [e4-dev] How should clients be expected to dispose of IEclipseContext instances?

Hi Folks,

On Wed, Oct 21, 2009 at 9:15 AM, Eric Moffatt <emoffatt@xxxxxxxxxx> wrote:
>
> Oleg, we just committed code yesterday that manages the life-cycle of any UIElement that has a context. The MContext will be created and set into the model element before it is rendered and removed /disposed when the element is taken down (i.e. in removeGui). Note that this ties the life-cycle of the MContext to that of the 'widget', if anybody knows of a scenario under which this would be an issue let us know.

One of the scenarios we had was supporting editors (that consume
IEditorInput).  The editor part simply lists IEditorInput in its
constructor and gets that information injected.

But that means the IEclipseContext has to be available when the model
part is created (or available in the model, etc), not when the UI is
rendered.

> As much as possible we'd like to keep the network of Context's out of mere mortals hands I think. Playing with this structure must be done with care, what happens if I have contexts C,D,E with parent B with parent A and dispose B ? Do C.D.E get re-injected with B's parent?

I don't think we've spelled out behaviour for this yet, but I would
expect if you dispose context B, context C, D, and E are also disposed
(maybe children first, then parent).  If someone actually wanted to
save C,D,E they would re-parent them before disposing their parent.

Later,
PW


--
Paul Webster
Hi floor.  Make me a sammich! - GIR


Back to the top