Class AbstractWidgetController
- java.lang.Object
-
- de.hybris.platform.cockpit.widgets.controllers.impl.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 customWidgetControllers. Provides common method implementations for handlingCockpitEventAcceptors as well as for dispatching widget events.
-
-
Constructor Summary
Constructors Constructor Description AbstractWidgetController()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddCockpitEventAcceptor(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 voiddispatchEvent(java.lang.String context, WidgetEvent event)Convenience method for notifying all event acceptors which are registered for events with the context codecontext.abstract voiddispatchEvent(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()voidremoveCockpitEventAcceptor(java.lang.String context, CockpitEventAcceptor acceptor)Unregisters the event acceptor acceptor for events with the specified context code context .voidsetCockpitEventAcceptors(java.util.Map<java.lang.String,java.util.List<CockpitEventAcceptor>> accMap)Sets the event acceptors to register with this controller.
-
-
-
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:WidgetControllerRegisters the event acceptor acceptor so that it receives notifications when an event with the matching context context is dispatched.- Specified by:
addCockpitEventAcceptorin interfaceWidgetController- Parameters:
context- event contextacceptor- event acceptor
-
removeCockpitEventAcceptor
public void removeCockpitEventAcceptor(java.lang.String context, CockpitEventAcceptor acceptor)Description copied from interface:WidgetControllerUnregisters the event acceptor acceptor for events with the specified context code context .- Specified by:
removeCockpitEventAcceptorin interfaceWidgetController- Parameters:
context- event contextacceptor- event acceptor
-
setCockpitEventAcceptors
public void setCockpitEventAcceptors(java.util.Map<java.lang.String,java.util.List<CockpitEventAcceptor>> accMap)
Description copied from interface:WidgetControllerSets the event acceptors to register with this controller.- Specified by:
setCockpitEventAcceptorsin interfaceWidgetController- 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:WidgetControllerNotifies all event acceptors which are registered for events with the context code context.- Specified by:
dispatchEventin interfaceWidgetController- Parameters:
context- event contextsource- event sourcedata- 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 codecontext.- Parameters:
context- event contextevent- widget event- See Also:
dispatchEvent(String, Object, Map)
-
-