Class DefaultWidgetInstanceFacade

    • Constructor Detail

      • DefaultWidgetInstanceFacade

        public DefaultWidgetInstanceFacade()
    • Method Detail

      • getWidgetInstances

        public java.util.List<WidgetInstance> getWidgetInstances​(WidgetInstance parentInstance,
                                                                 java.lang.String slotId,
                                                                 boolean isSingleSlot)
        Description copied from interface: WidgetInstanceFacade
        Returns a list of all instances of the given widget belonging to the given parent and assigned to the given slotId.
        Specified by:
        getWidgetInstances in interface WidgetInstanceFacade
        Parameters:
        parentInstance - the WidgetInstance from which Widget Instances will be returned
        slotId - assigned slotId from which slot instances will be returned
        isSingleSlot - whether slot is single or not
        Returns:
        list of all instances of the given widget belonging to the given parent and assigned to the given slotId
      • getWidgetInstances

        public java.util.List<WidgetInstance> getWidgetInstances​(Widget widget,
                                                                 WidgetInstance parentInstance)
        Description copied from interface: WidgetInstanceFacade
        Returns a list of all instances of the given widget belonging to the given parent.
        Specified by:
        getWidgetInstances in interface WidgetInstanceFacade
        Parameters:
        widget - the parent from which instances will be returned
        parentInstance - the WidgetInstance from which Widget Instances will be returned
        Returns:
        child widget instances
      • createWidgetInstance

        public WidgetInstance createWidgetInstance​(Widget widget,
                                                   WidgetInstance parentInstance,
                                                   java.lang.Object creator)
        Description copied from interface: WidgetInstanceFacade
        Creates new widget instance as a child of the given parent with assigned creator.
        Specified by:
        createWidgetInstance in interface WidgetInstanceFacade
        Parameters:
        widget - a widget to create widget instance
        parentInstance - Widget Instance in which new widget instance will be created
        creator - assigned creator
        Returns:
        created Widget Instance
      • createWidgetInstance

        public WidgetInstance createWidgetInstance​(Widget widget,
                                                   WidgetInstance parentInstance)
        Description copied from interface: WidgetInstanceFacade
        Creates new widget instance as a child of the given parent.
        Specified by:
        createWidgetInstance in interface WidgetInstanceFacade
        Parameters:
        widget - a widget to create widget instance
        parentInstance - Widget Instance in which new widget instance will be created
        Returns:
        created Widget Instance
      • removeWidgetInstance

        public void removeWidgetInstance​(WidgetInstance instance)
        Description copied from interface: WidgetInstanceFacade
        Removes given widget instance from the widget tree. View model will be removed as well. All child instances will be removed as well.
        Specified by:
        removeWidgetInstance in interface WidgetInstanceFacade
        Parameters:
        instance - Widget Instance to be removed form the widget tree
      • canCreateInstance

        public boolean canCreateInstance​(Widget widget,
                                         WidgetInstance parentInstance)
        Description copied from interface: WidgetInstanceFacade
        Checks if a new instance of the given widget can be created. It might be disabled by user visibility rule.
        Specified by:
        canCreateInstance in interface WidgetInstanceFacade
        Parameters:
        widget - check will be done if this widget can be created
        parentInstance - Widget Instance in which creation possibility will be tested
        Returns:
        true if a given widget instance can be created
      • getPossibleWidgets

        public java.util.List<Widget> getPossibleWidgets​(WidgetInstance parentInstance,
                                                         java.lang.String slotId)
        Description copied from interface: WidgetInstanceFacade
        Returns a list of all possible widgets that instances can be created of.
        Specified by:
        getPossibleWidgets in interface WidgetInstanceFacade
        Parameters:
        parentInstance - Widget Instance in which Widgets could be possibly created
        slotId - slotId name in which Widgets could be possibly created
        Returns:
        a list of all possible widgets that instances can be created of
      • setWidgetInstanceService

        public void setWidgetInstanceService​(WidgetInstanceService widgetInstanceService)
      • getWidgetIndexComparator

        public java.util.Comparator<Widget> getWidgetIndexComparator()
      • setWidgetIndexComparator

        public void setWidgetIndexComparator​(java.util.Comparator<Widget> widgetIndexComparator)