Class AbstractWidgetController

  • All Implemented Interfaces:
    WidgetController

    public abstract class AbstractWidgetController
    extends java.lang.Object
    implements WidgetController
    Class intended to be used as a base class when implementing custom WidgetControllers.

    Provides common method implementations for handling CockpitEventAcceptors as well as for dispatching widget events.

    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void addCockpitEventAcceptor​(java.lang.String context, CockpitEventAcceptor acceptor)
      Registers the event acceptor acceptor so that it receives notifications when an event with the matching context context is dispatched.
      protected void dispatchEvent​(java.lang.String context, WidgetEvent event)
      Convenience method for notifying all event acceptors which are registered for events with the context code context.
      abstract void dispatchEvent​(java.lang.String context, java.lang.Object source, java.util.Map<java.lang.String,​java.lang.Object> data)
      Notifies all event acceptors which are registered for events with the context code context.
      protected java.util.Map<java.lang.String,​java.util.List<CockpitEventAcceptor>> getAcceptors()  
      void removeCockpitEventAcceptor​(java.lang.String context, CockpitEventAcceptor acceptor)
      Unregisters the event acceptor acceptor for events with the specified context code context .
      void setCockpitEventAcceptors​(java.util.Map<java.lang.String,​java.util.List<CockpitEventAcceptor>> accMap)
      Sets the event acceptors to register with this controller.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractWidgetController

        public AbstractWidgetController()
    • Method Detail

      • getAcceptors

        protected java.util.Map<java.lang.String,​java.util.List<CockpitEventAcceptor>> getAcceptors()
      • addCockpitEventAcceptor

        public void addCockpitEventAcceptor​(java.lang.String context,
                                            CockpitEventAcceptor acceptor)
        Description copied from interface: WidgetController
        Registers the event acceptor acceptor so that it receives notifications when an event with the matching context context is dispatched.
        Specified by:
        addCockpitEventAcceptor in interface WidgetController
        Parameters:
        context - event context
        acceptor - event acceptor
      • removeCockpitEventAcceptor

        public void removeCockpitEventAcceptor​(java.lang.String context,
                                               CockpitEventAcceptor acceptor)
        Description copied from interface: WidgetController
        Unregisters the event acceptor acceptor for events with the specified context code context .
        Specified by:
        removeCockpitEventAcceptor in interface WidgetController
        Parameters:
        context - event context
        acceptor - event acceptor
      • setCockpitEventAcceptors

        public void setCockpitEventAcceptors​(java.util.Map<java.lang.String,​java.util.List<CockpitEventAcceptor>> accMap)
        Description copied from interface: WidgetController
        Sets the event acceptors to register with this controller.
        Specified by:
        setCockpitEventAcceptors in interface WidgetController
        Parameters:
        accMap - acceptor map where the key is the controller context code and the value a list of acceptors
      • dispatchEvent

        public abstract void dispatchEvent​(java.lang.String context,
                                           java.lang.Object source,
                                           java.util.Map<java.lang.String,​java.lang.Object> data)
        Description copied from interface: WidgetController
        Notifies all event acceptors which are registered for events with the context code context.
        Specified by:
        dispatchEvent in interface WidgetController
        Parameters:
        context - event context
        source - event source
        data - parameters to be be passed to registered listeners
      • dispatchEvent

        protected void dispatchEvent​(java.lang.String context,
                                     WidgetEvent event)
        Convenience method for notifying all event acceptors which are registered for events with the context code context.
        Parameters:
        context - event context
        event - widget event
        See Also:
        dispatchEvent(String, Object, Map)