Class ActionComponentUtils

  • Direct Known Subclasses:
    NavigationUtils

    public class ActionComponentUtils
    extends java.lang.Object
    Utilities methods to help rendering actions representations
    • Constructor Detail

      • ActionComponentUtils

        protected ActionComponentUtils()
    • Method Detail

      • getLabel

        public static java.lang.String getLabel​(ActionbarContext context,
                                                java.lang.String locKey,
                                                java.lang.String fallback)
        Returns label for provided localized key
        Parameters:
        context - bar context
        locKey - key to be found
        fallback - fallback label to be returned if no label for key found
        Returns:
        label
      • formatNodeElement

        public static void formatNodeElement​(ActionComponent nodeElement,
                                             ActionbarContext context,
                                             ActionDefinition definition)
        Initialises component representation of action - sets its labels, images, etc.
        Parameters:
        nodeElement - component representation
        context - bar context
        definition - action definition
      • initComponent

        public static void initComponent​(ActionComponent nodeElement,
                                         ActionbarContext context,
                                         ActionDefinition definition)
        Initialises component representation of action - stores all needed meta data, sets test ids, etc.
        Parameters:
        nodeElement - component representation
        context - bar context
        definition - action definition
      • getDefinition

        public static <D extends ActionDefinition> D getDefinition​(org.zkoss.zk.ui.HtmlBasedComponent nodeComponent)
        Gets a definition bound to provided component representation
        Type Parameters:
        D - type of definition expected
        Parameters:
        nodeComponent - component representation
        Returns:
        definition bound to component or null if a component does not represent any action