Package com.hybris.cockpitng.core.impl
Class DefaultWidgetService
- java.lang.Object
-
- com.hybris.cockpitng.core.impl.DefaultWidgetService
-
- All Implemented Interfaces:
WidgetService
public class DefaultWidgetService extends java.lang.Object implements WidgetService
Default implementation ofWidgetService. Provides methods dealing with creating and removing widgets, creating composed widgets, creating connections.
-
-
Field Summary
-
Fields inherited from interface com.hybris.cockpitng.core.WidgetService
COMPOSED_ROOT_SLOT_ID
-
-
Constructor Summary
Constructors Constructor Description DefaultWidgetService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WidgetcreateComposedWidget(Widget parent, java.lang.String id, java.lang.String slotId, java.lang.String definitionId, Widget rootNode)Creates a widget that is composed of one or more widgets.WidgetcreateWidget(Widget parent, java.lang.String id, java.lang.String slotId, java.lang.String definitionId)Creates widget's instanceWidgetConnectioncreateWidgetConnection(Widget sourceWidget, Widget targetWidget, java.lang.String inputId, java.lang.String outputId)Creates a connection between widgetsjava.util.Set<Widget>getAllDescendants(Widget widget)Returns set of descendants for given composed widgetjava.util.List<WidgetConnection>getWidgetConnectionsForOutputWidgetAndSocketID(Widget widget, java.lang.String outputId)Gets all connections of widget's socketvoidloadComposedChildren(Widget composedWidget, Widget templateNode)Clones all the settings and properties from a template widget and creates composed root widget which is assigned to composed widgetvoidmoveWidget(Widget widget, Widget newParent)Moves widget to another onevoidremoveWidget(Widget widget)Removes widget
-
-
-
Method Detail
-
createWidget
public Widget createWidget(Widget parent, java.lang.String id, java.lang.String slotId, java.lang.String definitionId)
Description copied from interface:WidgetServiceCreates widget's instance- Specified by:
createWidgetin interfaceWidgetService- Parameters:
parent- of given widgetid- of newly created widgetslotId- in parent widget where newly created widget will be putdefinitionId- of widget- Returns:
- newly created widget
-
createComposedWidget
public Widget createComposedWidget(Widget parent, java.lang.String id, java.lang.String slotId, java.lang.String definitionId, Widget rootNode)
Description copied from interface:WidgetServiceCreates a widget that is composed of one or more widgets.- Specified by:
createComposedWidgetin interfaceWidgetService- Parameters:
parent- of given widgetid- of newly created widgetslotId- in parent widget where newly created widget will be putdefinitionId- of widgetrootNode- a template widget from which all the settings and properties are cloned- Returns:
- composed widget
-
loadComposedChildren
public void loadComposedChildren(Widget composedWidget, Widget templateNode)
Description copied from interface:WidgetServiceClones all the settings and properties from a template widget and creates composed root widget which is assigned to composed widget- Specified by:
loadComposedChildrenin interfaceWidgetService- Parameters:
composedWidget- a composed widgettemplateNode- a template widget from which all the settings and properties are cloned
-
getAllDescendants
public java.util.Set<Widget> getAllDescendants(Widget widget)
Description copied from interface:WidgetServiceReturns set of descendants for given composed widget- Specified by:
getAllDescendantsin interfaceWidgetService- Parameters:
widget- composed widget- Returns:
- set of descendants for given composed widget
-
removeWidget
public void removeWidget(Widget widget)
Description copied from interface:WidgetServiceRemoves widget- Specified by:
removeWidgetin interfaceWidgetService- Parameters:
widget- to remove
-
getWidgetConnectionsForOutputWidgetAndSocketID
public java.util.List<WidgetConnection> getWidgetConnectionsForOutputWidgetAndSocketID(Widget widget, java.lang.String outputId)
Description copied from interface:WidgetServiceGets all connections of widget's socket- Specified by:
getWidgetConnectionsForOutputWidgetAndSocketIDin interfaceWidgetService- Parameters:
widget- a widget's instanceoutputId- id of socket- Returns:
- list of all connections related to given socket id
-
createWidgetConnection
public WidgetConnection createWidgetConnection(Widget sourceWidget, Widget targetWidget, java.lang.String inputId, java.lang.String outputId)
Description copied from interface:WidgetServiceCreates a connection between widgets- Specified by:
createWidgetConnectionin interfaceWidgetService- Parameters:
sourceWidget- Widget from which the connection will be madetargetWidget- Widget to which the connection will be madeinputId- socket name of target widgetoutputId- socket name of source widget- Returns:
- connection between two widgets
-
moveWidget
public void moveWidget(Widget widget, Widget newParent)
Description copied from interface:WidgetServiceMoves widget to another one- Specified by:
moveWidgetin interfaceWidgetService- Parameters:
widget- which should be movednewParent- new parent for the widget
-
-