public class DefaultWidgetInstanceFacade extends Object implements WidgetInstanceFacade
| Modifier and Type | Field and Description |
|---|---|
static String |
CHILD_INDEX |
| Constructor and Description |
|---|
DefaultWidgetInstanceFacade() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canCreateInstance(Widget widget,
WidgetInstance parentInstance)
Checks if a new instance of the given widget can be created.
|
boolean |
canRemoveInstance(WidgetInstance instance)
Checks if the given instance can be removed.
|
WidgetInstance |
createWidgetInstance(Widget widget,
WidgetInstance parentInstance)
Creates new widget instance as a child of the given parent.
|
WidgetInstance |
createWidgetInstance(Widget widget,
WidgetInstance parentInstance,
Object creator)
Creates new widget instance as a child of the given parent with assigned creator.
|
List<Widget> |
getPossibleWidgets(WidgetInstance parentInstance,
String slotId)
Returns a list of all possible widgets that instances can be created of.
|
WidgetInstance |
getRootWidgetInstance(Widget rootWidget)
Returns a widget instance for the given root widget.
|
Comparator<Widget> |
getWidgetIndexComparator() |
List<WidgetInstance> |
getWidgetInstances(WidgetInstance parentInstance)
Returns a list of all child widget instances of the given parent.
|
List<WidgetInstance> |
getWidgetInstances(WidgetInstance parentInstance,
String slotId,
boolean isSingleSlot)
Returns a list of all instances of the given widget belonging to the given parent and assigned to the given
slotId.
|
List<WidgetInstance> |
getWidgetInstances(Widget widget,
WidgetInstance parentInstance)
Returns a list of all instances of the given widget belonging to the given parent.
|
WidgetInstanceService |
getWidgetInstanceService() |
void |
removeWidgetInstance(WidgetInstance instance)
Removes given widget instance from the widget tree.
|
void |
setWidgetIndexComparator(Comparator<Widget> widgetIndexComparator) |
void |
setWidgetInstanceService(WidgetInstanceService widgetInstanceService) |
public static final String CHILD_INDEX
public WidgetInstance getRootWidgetInstance(Widget rootWidget)
WidgetInstanceFacadegetRootWidgetInstance in interface WidgetInstanceFacaderootWidget - the widget from which root is returnedpublic List<WidgetInstance> getWidgetInstances(WidgetInstance parentInstance, String slotId, boolean isSingleSlot)
WidgetInstanceFacadegetWidgetInstances in interface WidgetInstanceFacadeparentInstance - the WidgetInstance from which Widget Instances will be returnedslotId - assigned slotId from which slot instances will be returnedisSingleSlot - whether slot is single or notpublic List<WidgetInstance> getWidgetInstances(WidgetInstance parentInstance)
WidgetInstanceFacadegetWidgetInstances in interface WidgetInstanceFacadeparentInstance - WidgetInstance based on which child instances are returnedpublic List<WidgetInstance> getWidgetInstances(Widget widget, WidgetInstance parentInstance)
WidgetInstanceFacadegetWidgetInstances in interface WidgetInstanceFacadewidget - the parent from which instances will be returnedparentInstance - the WidgetInstance from which Widget Instances will be returnedpublic WidgetInstance createWidgetInstance(Widget widget, WidgetInstance parentInstance, Object creator)
WidgetInstanceFacadecreateWidgetInstance in interface WidgetInstanceFacadewidget - a widget to create widget instanceparentInstance - Widget Instance in which new widget instance will be createdcreator - assigned creatorpublic WidgetInstance createWidgetInstance(Widget widget, WidgetInstance parentInstance)
WidgetInstanceFacadecreateWidgetInstance in interface WidgetInstanceFacadewidget - a widget to create widget instanceparentInstance - Widget Instance in which new widget instance will be createdpublic void removeWidgetInstance(WidgetInstance instance)
WidgetInstanceFacaderemoveWidgetInstance in interface WidgetInstanceFacadeinstance - Widget Instance to be removed form the widget treepublic boolean canCreateInstance(Widget widget, WidgetInstance parentInstance)
WidgetInstanceFacadecanCreateInstance in interface WidgetInstanceFacadewidget - check will be done if this widget can be createdparentInstance - Widget Instance in which creation possibility will be testedpublic boolean canRemoveInstance(WidgetInstance instance)
WidgetInstanceFacadecanRemoveInstance in interface WidgetInstanceFacadeinstance - test if this instance can be removedpublic List<Widget> getPossibleWidgets(WidgetInstance parentInstance, String slotId)
WidgetInstanceFacadegetPossibleWidgets in interface WidgetInstanceFacadeparentInstance - Widget Instance in which Widgets could be possibly createdslotId - slotId name in which Widgets could be possibly createdpublic WidgetInstanceService getWidgetInstanceService()
public void setWidgetInstanceService(WidgetInstanceService widgetInstanceService)
public Comparator<Widget> getWidgetIndexComparator()
public void setWidgetIndexComparator(Comparator<Widget> widgetIndexComparator)
Copyright © 2018. All rights reserved.