Class WidgetTreeUIUtils


  • public final class WidgetTreeUIUtils
    extends java.lang.Object
    Useful utility method to work with component tree representing the widget tree structure.
    • Method Detail

      • 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 slot
        childSlotId - id of slot to be checked
        visibilityCheck - 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 to visibilityCheck method.
        Parameters:
        widgetslot - Widgetslot for which the visible widgets should be found
        Returns:
        List of Widget