Package com.hybris.cockpitng.util
Class WidgetTreeUIUtils
- java.lang.Object
-
- com.hybris.cockpitng.util.WidgetTreeUIUtils
-
public final class WidgetTreeUIUtils extends java.lang.ObjectUseful utility method to work with component tree representing the widget tree structure.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.zkoss.zk.ui.ComponentgetFirstWidgetChild(org.zkoss.zk.ui.Component component)static WidgetchildrengetParentWidgetchildren(org.zkoss.zk.ui.Component comp)static WidgetContainergetParentWidgetContainer(org.zkoss.zk.ui.Component comp)Returns the first parent component being an instance ofWidgetContainer, i.e.static WidgetslotgetParentWidgetslot(org.zkoss.zk.ui.Component comp)static WidgetgetVisibleWidget(Widgetslot parent, java.lang.String childSlotId, java.util.function.Predicate<Widget> visibilityCheck)Gets a visible widget on slot with provided id.static java.util.List<Widget>getVisibleWidgets(Widgetslot widgetslot, java.util.function.Predicate<Widget> visibilityCheck)Returns a list of widgets that are children of the given widget slot that are visible according tovisibilityCheckmethod.static voidupdateRootWidget(Widgetslot widgetComp, boolean resetWidget)
-
-
-
Method Detail
-
getParentWidgetContainer
public static WidgetContainer getParentWidgetContainer(org.zkoss.zk.ui.Component comp)
Returns the first parent component being an instance ofWidgetContainer, i.e. either aWidgetslotor aWidgetchildren, whatever comes first.
-
getParentWidgetslot
public static Widgetslot getParentWidgetslot(org.zkoss.zk.ui.Component comp)
-
getParentWidgetchildren
public static Widgetchildren getParentWidgetchildren(org.zkoss.zk.ui.Component comp)
-
getFirstWidgetChild
public static org.zkoss.zk.ui.Component getFirstWidgetChild(org.zkoss.zk.ui.Component component)
-
updateRootWidget
public static void updateRootWidget(Widgetslot widgetComp, boolean resetWidget)
-
getVisibleWidget
public static Widget getVisibleWidget(Widgetslot parent, java.lang.String childSlotId, java.util.function.Predicate<Widget> visibilityCheck)
Gets a visible widget on slot with provided id.- Parameters:
parent- parent slotchildSlotId- id of slot to be checkedvisibilityCheck- a predicate to check whether a widget is visible- Returns:
- widget on provided slot
-
getVisibleWidgets
public static java.util.List<Widget> getVisibleWidgets(Widgetslot widgetslot, java.util.function.Predicate<Widget> visibilityCheck)
Returns a list of widgets that are children of the given widget slot that are visible according tovisibilityCheckmethod.- Parameters:
widgetslot-Widgetslotfor which the visible widgets should be found- Returns:
ListofWidget
-
-