public class EMFFormsContextTracker extends Object
EMFFormsViewContext
s.
This supplements the EMFFormsContextListener
and RootDomainModelChangeListener
APIs
with specificity in the call-backs of which context in a hierarchy the call-back pertains to.Constructor and Description |
---|
EMFFormsContextTracker(EMFFormsViewContext context)
Initializes me with the root context to track.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Stop tracking contexts.
|
boolean |
isRoot(EMFFormsViewContext context)
Query whether a
context is the root of this tracker. |
EMFFormsContextTracker |
onChildContextAdded(TriConsumer<? super EMFFormsViewContext,? super VElement,? super EMFFormsViewContext> handler)
Add a call-back to handle the addition of a new child context to a parent context.
|
EMFFormsContextTracker |
onChildContextRemoved(TriConsumer<? super EMFFormsViewContext,? super VElement,? super EMFFormsViewContext> handler)
Add a call-back to handle the removal of a child context from a parent context.
|
EMFFormsContextTracker |
onContextDisposed(Consumer<? super EMFFormsViewContext> handler)
Add a call-back to handle the disposal of a context, including the root
context.
|
EMFFormsContextTracker |
onContextInitialized(Consumer<? super EMFFormsViewContext> handler)
Add a call-back to handle the initialization of a new context, including the
root context.
|
EMFFormsContextTracker |
onDomainModelChanged(Consumer<? super EMFFormsViewContext> handler)
Add a call-back to handle the replacement of a context's domain model, including the
root context.
|
void |
open()
Start tracking my root context.
|
public EMFFormsContextTracker(EMFFormsViewContext context)
context
- the root contextpublic boolean isRoot(EMFFormsViewContext context)
context
is the root of this tracker.context
- a contextpublic EMFFormsContextTracker onContextInitialized(Consumer<? super EMFFormsViewContext> handler)
handler
- the call-back. It is invoked with the context that was initializedpublic EMFFormsContextTracker onContextDisposed(Consumer<? super EMFFormsViewContext> handler)
handler
- the call-back. It is invoked with the context that was disposedpublic EMFFormsContextTracker onDomainModelChanged(Consumer<? super EMFFormsViewContext> handler)
handler
- the call-back. It is invoked with the context that had its domain-model
replacedpublic EMFFormsContextTracker onChildContextAdded(TriConsumer<? super EMFFormsViewContext,? super VElement,? super EMFFormsViewContext> handler)
handler
- the call-back. It is invoked with the parent context, the parent element,
and the child context that was addedpublic EMFFormsContextTracker onChildContextRemoved(TriConsumer<? super EMFFormsViewContext,? super VElement,? super EMFFormsViewContext> handler)
handler
- the call-back. It is invoked with the parent context, the parent element with
which the child context was associated, and the child context that was removedpublic void open()
public void close()
Copyright © 2020. All rights reserved.