Package com.hybris.cockpitng.core
Interface WidgetService
-
- All Known Implementing Classes:
DefaultWidgetService
public interface WidgetServiceService for managing widget tree with socket connections.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCOMPOSED_ROOT_SLOT_ID
-
Method Summary
All Methods Instance Methods Abstract 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 composedWidgetRoot)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
-
-
-
Field Detail
-
COMPOSED_ROOT_SLOT_ID
static final java.lang.String COMPOSED_ROOT_SLOT_ID
- See Also:
- Constant Field Values
-
-
Method Detail
-
createWidget
Widget createWidget(Widget parent, java.lang.String id, java.lang.String slotId, java.lang.String definitionId)
Creates widget's instance- 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
Widget createComposedWidget(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.- 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
-
removeWidget
void removeWidget(Widget widget)
Removes widget- Parameters:
widget- to remove
-
moveWidget
void moveWidget(Widget widget, Widget newParent)
Moves widget to another one- Parameters:
widget- which should be movednewParent- new parent for the widget
-
getWidgetConnectionsForOutputWidgetAndSocketID
java.util.List<WidgetConnection> getWidgetConnectionsForOutputWidgetAndSocketID(Widget widget, java.lang.String outputId)
Gets all connections of widget's socket- Parameters:
widget- a widget's instanceoutputId- id of socket- Returns:
- list of all connections related to given socket id
-
createWidgetConnection
WidgetConnection createWidgetConnection(Widget sourceWidget, Widget targetWidget, java.lang.String inputId, java.lang.String outputId)
Creates a connection between widgets- 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
-
loadComposedChildren
void loadComposedChildren(Widget composedWidget, Widget templateNode)
Clones all the settings and properties from a template widget and creates composed root widget which is assigned to composed widget- Parameters:
composedWidget- a composed widgettemplateNode- a template widget from which all the settings and properties are cloned
-
-