Class DefaultWidgetInstanceService
- java.lang.Object
-
- com.hybris.cockpitng.core.ui.impl.DefaultWidgetInstanceService
-
- All Implemented Interfaces:
WidgetInstanceService
public class DefaultWidgetInstanceService extends java.lang.Object implements WidgetInstanceService
Default implementation of service for managing widget instances.- See Also:
WidgetInstance
-
-
Constructor Summary
Constructors Constructor Description DefaultWidgetInstanceService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WidgetInstancecreateRootWidgetInstance(Widget widget)Creates new widget instance for the given root widget.WidgetInstancecreateWidgetInstance(Widget widget, WidgetInstance parentInstance)Creates new widget instance as a child of the given parent.WidgetInstancecreateWidgetInstance(Widget widget, WidgetInstance parent, java.lang.Object creator)Creates new widget instance as a child of the given parent with assigned creator.java.util.List<WidgetInstance>getRootWidgetInstances(Widget widget)Returns a list of all widget instances of the given root widget.java.util.List<WidgetInstance>getWidgetInstances(WidgetInstance parent)Returns a list of all child widget instances of the given parent.java.util.List<WidgetInstance>getWidgetInstances(Widget widget, WidgetInstance parent)Returns a list of all instances of the given widget belonging to the given parent.voidremoveWidgetInstance(WidgetInstance instance)Removes given widget instance from the widget tree.voidsetComponentDefinitionService(CockpitComponentDefinitionService componentDefinitionService)
-
-
-
Method Detail
-
createRootWidgetInstance
public WidgetInstance createRootWidgetInstance(Widget widget)
Description copied from interface:WidgetInstanceServiceCreates new widget instance for the given root widget.- Specified by:
createRootWidgetInstancein interfaceWidgetInstanceService- Parameters:
widget- a widget to create widget instance- Returns:
- created widget instance
-
createWidgetInstance
public WidgetInstance createWidgetInstance(Widget widget, WidgetInstance parent, java.lang.Object creator)
Description copied from interface:WidgetInstanceServiceCreates new widget instance as a child of the given parent with assigned creator.- Specified by:
createWidgetInstancein interfaceWidgetInstanceService- Parameters:
widget- a widget to create widget instanceparent- parent widget instancecreator- assigned creator- Returns:
- created widget instance
-
createWidgetInstance
public WidgetInstance createWidgetInstance(Widget widget, WidgetInstance parentInstance)
Description copied from interface:WidgetInstanceServiceCreates new widget instance as a child of the given parent.- Specified by:
createWidgetInstancein interfaceWidgetInstanceService- Parameters:
widget- a widget to create widget instanceparentInstance- parent widget instance- Returns:
- created widget instance
-
getRootWidgetInstances
public java.util.List<WidgetInstance> getRootWidgetInstances(Widget widget)
Description copied from interface:WidgetInstanceServiceReturns a list of all widget instances of the given root widget.- Specified by:
getRootWidgetInstancesin interfaceWidgetInstanceService- Parameters:
widget- a widget for which a list of widget instances should be returned- Returns:
- a list of widget instances for the given widget
-
getWidgetInstances
public java.util.List<WidgetInstance> getWidgetInstances(WidgetInstance parent)
Description copied from interface:WidgetInstanceServiceReturns a list of all child widget instances of the given parent.- Specified by:
getWidgetInstancesin interfaceWidgetInstanceService- Parameters:
parent- widget instance for which a list of child widget instances should be returned- Returns:
- a list of child widget instances for the given parent widget instance
-
getWidgetInstances
public java.util.List<WidgetInstance> getWidgetInstances(Widget widget, WidgetInstance parent)
Description copied from interface:WidgetInstanceServiceReturns a list of all instances of the given widget belonging to the given parent.- Specified by:
getWidgetInstancesin interfaceWidgetInstanceService- Parameters:
widget- a root widget which instances should be returnedparent- a parent widget instance for returned list of widget instances- Returns:
- a list of all instances of the given widget belonging to the given parent
-
removeWidgetInstance
public void removeWidgetInstance(WidgetInstance instance)
Description copied from interface:WidgetInstanceServiceRemoves given widget instance from the widget tree. View model will be removed as well. All child instances will be removed as well.- Specified by:
removeWidgetInstancein interfaceWidgetInstanceService- Parameters:
instance- widget instance to remove
-
setComponentDefinitionService
public void setComponentDefinitionService(CockpitComponentDefinitionService componentDefinitionService)
-
-