Class CockpitComponentsUtils


  • public class CockpitComponentsUtils
    extends java.lang.Object
    Cockpit components utility class.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T extends org.zkoss.zk.ui.Component>
      java.util.Optional<T>
      findClosestComponent​(org.zkoss.zk.ui.Component component, java.lang.Class<T> parentComponentType, java.lang.String parentSclass)
      Finds closes component of given type and sclass.
      static java.lang.String getLabel​(EditorContext<?> editorContext, WidgetInstanceManager wim, java.lang.String key, java.lang.Object... args)  
      static java.lang.String getLabel​(WidgetInstanceManager wim, java.lang.String key, java.lang.Object... args)  
      protected static java.lang.String getLabel​(java.lang.String key, java.lang.Object[] args, java.util.function.BiFunction<java.lang.String,​java.lang.Object[],​java.lang.String>... providers)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CockpitComponentsUtils

        public CockpitComponentsUtils()
    • Method Detail

      • getLabel

        public static java.lang.String getLabel​(WidgetInstanceManager wim,
                                                java.lang.String key,
                                                java.lang.Object... args)
      • getLabel

        protected static java.lang.String getLabel​(java.lang.String key,
                                                   java.lang.Object[] args,
                                                   java.util.function.BiFunction<java.lang.String,​java.lang.Object[],​java.lang.String>... providers)
      • findClosestComponent

        public static <T extends org.zkoss.zk.ui.Component> java.util.Optional<T> findClosestComponent​(org.zkoss.zk.ui.Component component,
                                                                                                       java.lang.Class<T> parentComponentType,
                                                                                                       java.lang.String parentSclass)
        Finds closes component of given type and sclass.
        Parameters:
        component - given component and all its ancestors will be scanned.
        parentComponentType - type of parent component to be found.
        parentSclass - searched parentSclass without ., if empty then first window will be returned no matter parentSclass.
        Returns:
        component if found.