Class EMFFormsContextTracker

    • Constructor Detail

      • EMFFormsContextTracker

        public EMFFormsContextTracker​(EMFFormsViewContext context)
        Initializes me with the root context to track.
        Parameters:
        context - the root context
    • Method Detail

      • isRoot

        public boolean isRoot​(EMFFormsViewContext context)
        Query whether a context is the root of this tracker.
        Parameters:
        context - a context
        Returns:
        whether it is the root of the context tree being tracked
      • onContextInitialized

        public EMFFormsContextTracker onContextInitialized​(java.util.function.Consumer<? super EMFFormsViewContext> handler)
        Add a call-back to handle the initialization of a new context, including the root context.
        Parameters:
        handler - the call-back. It is invoked with the context that was initialized
        Returns:
        myself, for convenience of call chaining
      • onContextDisposed

        public EMFFormsContextTracker onContextDisposed​(java.util.function.Consumer<? super EMFFormsViewContext> handler)
        Add a call-back to handle the disposal of a context, including the root context.
        Parameters:
        handler - the call-back. It is invoked with the context that was disposed
        Returns:
        myself, for convenience of call chaining
      • onDomainModelChanged

        public EMFFormsContextTracker onDomainModelChanged​(java.util.function.Consumer<? super EMFFormsViewContext> handler)
        Add a call-back to handle the replacement of a context's domain model, including the root context.
        Parameters:
        handler - the call-back. It is invoked with the context that had its domain-model replaced
        Returns:
        myself, for convenience of call chaining
      • onChildContextAdded

        public 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.
        Parameters:
        handler - the call-back. It is invoked with the parent context, the parent element, and the child context that was added
        Returns:
        myself, for convenience of call chaining
      • onChildContextRemoved

        public 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.
        Parameters:
        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 removed
        Returns:
        myself, for convenience of call chaining
      • close

        public void close()
        Stop tracking contexts.