Class Templates


  • public class Templates
    extends java.lang.Object
    Utils for looking up template.
    Since:
    8.0.0
    Author:
    chunfu
    • Constructor Summary

      Constructors 
      Constructor Description
      Templates()  
    • Constructor Detail

      • Templates

        public Templates()
    • Method Detail

      • lookup

        public static Template lookup​(Component comp,
                                      java.lang.String name)
        A shortcut of lookup(comp, comp, name, null, false)
      • lookup

        public static Template lookup​(Component comp,
                                      Component base,
                                      java.lang.String name)
        A shortcut of lookup(comp, base, name, null, false)
      • lookup

        public static Template lookup​(Component comp,
                                      Component base,
                                      java.lang.String name,
                                      Component compBase)
        A shortcut of lookup(comp, base, name, compBase, false)
      • lookup

        public static Template lookup​(Component comp,
                                      Component base,
                                      java.lang.String name,
                                      Component compBase,
                                      boolean excludeBase)
        Lookup the template with some information. Note: if not sure the meaning of those arguments, please use lookup(Component, String) directly.
        Parameters:
        comp - It is the component to start looking for, and is necessary.
        base - To avoid redundant finding, usually it is the same with comp.
        name - The template's name, and is necessary.
        compBase - Special usage. Those templates defined inside a ShadowElement have higher priority when compBase is distributed child of the specific ShadowElement. Usually, it is null.
        excludeBase - It is a boolean to indicate whether to skip base component or not. Usually, it is false.
        Returns:
        Template