Class DefaultWidgetContainer<T extends Widget>
- java.lang.Object
-
- de.hybris.platform.cockpit.widgets.impl.DefaultWidgetContainer<T>
-
- All Implemented Interfaces:
WidgetContainer<T>
- Direct Known Subclasses:
PortalWidgetContainer
public class DefaultWidgetContainer<T extends Widget> extends java.lang.Object implements WidgetContainer<T>
-
-
Constructor Summary
Constructors Constructor Description DefaultWidgetContainer(WidgetFactory factory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCockpitEventAcceptor(CockpitEventAcceptor acceptor)Registers theCockpitEventAcceptoracceptor with this widget container.voidcleanup()Performs widget cleanup i.e.protected TcreateWidget(WidgetConfig widgetConfig, java.lang.String widgetCode)voidfocusWidget(java.lang.String focusWidgetCode)Focuses the widget associated with the specified widget code.protected java.util.List<CockpitEventAcceptor>getCockpitEventAcceptors()java.lang.StringgetFocusedWidgetCode()Returns the widget code of the currently focused widget.TgetWidget(java.lang.String widgetCode)Returns the widget associated with the specified widget code.WidgetFactorygetWidgetFactory()Returns theWidgetFactoryused for creating widgets.protected java.util.Map<java.lang.String,T>getWidgetMap()java.util.Map<java.lang.String,T>initialize(java.util.Map<java.lang.String,WidgetConfig> widgetConfigs)Initializes this container i.e.protected voidnotifyListeners(CockpitEvent event)voidremoveCockpitEventAcceptor(CockpitEventAcceptor acceptor)Unregisters theCockpitEventAcceptoracceptor with this widget container.voidsetWidgetFactory(WidgetFactory widgetFactory)Sets theWidgetFactoryused for creating widgets.
-
-
-
Constructor Detail
-
DefaultWidgetContainer
public DefaultWidgetContainer(WidgetFactory factory)
-
-
Method Detail
-
getWidgetFactory
public WidgetFactory getWidgetFactory()
Description copied from interface:WidgetContainerReturns theWidgetFactoryused for creating widgets.- Specified by:
getWidgetFactoryin interfaceWidgetContainer<T extends Widget>- Returns:
- the widget factory
-
setWidgetFactory
public void setWidgetFactory(WidgetFactory widgetFactory)
Description copied from interface:WidgetContainerSets theWidgetFactoryused for creating widgets.- Specified by:
setWidgetFactoryin interfaceWidgetContainer<T extends Widget>- Parameters:
widgetFactory- the widget factory
-
cleanup
public void cleanup()
Description copied from interface:WidgetContainerPerforms widget cleanup i.e. unregisters any listeners etc. Note: It is very important that this method is called when the widgets are invalidated e.g. when the widgets' parent view component has been detached from the ZK desktop.- Specified by:
cleanupin interfaceWidgetContainer<T extends Widget>
-
getWidgetMap
protected java.util.Map<java.lang.String,T> getWidgetMap()
-
focusWidget
public void focusWidget(java.lang.String focusWidgetCode)
Description copied from interface:WidgetContainerFocuses the widget associated with the specified widget code.- Specified by:
focusWidgetin interfaceWidgetContainer<T extends Widget>- Parameters:
focusWidgetCode- widget code
-
notifyListeners
protected void notifyListeners(CockpitEvent event)
-
getFocusedWidgetCode
public java.lang.String getFocusedWidgetCode()
Description copied from interface:WidgetContainerReturns the widget code of the currently focused widget.- Specified by:
getFocusedWidgetCodein interfaceWidgetContainer<T extends Widget>- Returns:
- code of the focused widget or null if no widget has focus
-
getWidget
public T getWidget(java.lang.String widgetCode)
Description copied from interface:WidgetContainerReturns the widget associated with the specified widget code.- Specified by:
getWidgetin interfaceWidgetContainer<T extends Widget>- Parameters:
widgetCode- widget code- Returns:
- widget mapped to the code or null if no widget is mapped to the supplied key
-
initialize
public java.util.Map<java.lang.String,T> initialize(java.util.Map<java.lang.String,WidgetConfig> widgetConfigs)
Description copied from interface:WidgetContainerInitializes this container i.e. creates widgets based on the suppliedWidgetConfigmap.- Specified by:
initializein interfaceWidgetContainer<T extends Widget>- Parameters:
widgetConfigs- map containing widget codes and configurations used when creating the widgets- Returns:
- map containing the created widgets mapped to their widget code
-
createWidget
protected T createWidget(WidgetConfig widgetConfig, java.lang.String widgetCode)
-
addCockpitEventAcceptor
public void addCockpitEventAcceptor(CockpitEventAcceptor acceptor)
Description copied from interface:WidgetContainerRegisters theCockpitEventAcceptoracceptor with this widget container.- Specified by:
addCockpitEventAcceptorin interfaceWidgetContainer<T extends Widget>- Parameters:
acceptor- the event acceptor to register
-
removeCockpitEventAcceptor
public void removeCockpitEventAcceptor(CockpitEventAcceptor acceptor)
Description copied from interface:WidgetContainerUnregisters theCockpitEventAcceptoracceptor with this widget container.- Specified by:
removeCockpitEventAcceptorin interfaceWidgetContainer<T extends Widget>- Parameters:
acceptor- the event acceptor to unregister
-
getCockpitEventAcceptors
protected java.util.List<CockpitEventAcceptor> getCockpitEventAcceptors()
-
-