Interface WidgetInstanceService

    • Method Detail

      • createRootWidgetInstance

        WidgetInstance createRootWidgetInstance​(Widget widget)
        Creates new widget instance for the given root widget.
        Parameters:
        widget - a widget to create widget instance
        Returns:
        created widget instance
      • createWidgetInstance

        WidgetInstance createWidgetInstance​(Widget widget,
                                            WidgetInstance parent)
        Creates new widget instance as a child of the given parent.
        Parameters:
        widget - a widget to create widget instance
        parent - parent widget instance
        Returns:
        created widget instance
      • createWidgetInstance

        WidgetInstance createWidgetInstance​(Widget widget,
                                            WidgetInstance parent,
                                            java.lang.Object creator)
        Creates new widget instance as a child of the given parent with assigned creator.
        Parameters:
        widget - a widget to create widget instance
        parent - parent widget instance
        creator - assigned creator
        Returns:
        created widget instance
      • getRootWidgetInstances

        java.util.List<WidgetInstance> getRootWidgetInstances​(Widget widget)
        Returns a list of all widget instances of the given root widget.
        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

        java.util.List<WidgetInstance> getWidgetInstances​(WidgetInstance parent)
        Returns a list of all child widget instances of the given parent.
        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

        java.util.List<WidgetInstance> getWidgetInstances​(Widget widget,
                                                          WidgetInstance parent)
        Returns a list of all instances of the given widget belonging to the given parent.
        Parameters:
        widget - a root widget which instances should be returned
        parent - 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

        void removeWidgetInstance​(WidgetInstance instance)
        Removes given widget instance from the widget tree. View model will be removed as well. All child instances will be removed as well.
        Parameters:
        instance - widget instance to remove