Class StylableTag

    • Constructor Detail

      • StylableTag

        protected StylableTag​(String defaultClass)
        Create a new stylable tag.
        Parameters:
        defaultClass - The default class to use if the tag doesn't override with it's own value
    • Method Detail

      • setPageContext

        public void setPageContext​(PageContext pageContext)
        Reset the dynamic attributes to make sure old ones are not included in case the tag object is reused.
        Specified by:
        setPageContext in interface Tag
        Overrides:
        setPageContext in class TagSupport
        Since:
        3.3
      • initDefaultAttributes

        protected void initDefaultAttributes()
        Initialize default attributes. Can be called multiple times (once before each tag is used/re-used). This default implementation does nothing.
        Since:
        3.3.2
      • setClazz

        public void setClazz​(String clazz)
      • getClazz

        public String getClazz()
      • setSubclass

        public void setSubclass​(String subclass)
      • getSubclass

        public String getSubclass()
      • setStyle

        public void setStyle​(String style)
      • getStyle

        public String getStyle()
      • getFullClass

        public String getFullClass​(String... extraClasses)
        Get the full class (eg. main and subclass) as a single string.
        Parameters:
        extraClasses - Additional classes that should also be added
        Returns:
        The combined class or null if no class has been set
      • getDynamicAttribute

        protected DynamicActionAttribute getDynamicAttribute​(String name)
        Get the dynamic attribute for the given name
        Parameters:
        name - The name of the attribute
        Returns:
        A DynamicActionAttribute object or null if no attribute with that name has been set
      • addIdAndStyles

        protected void addIdAndStyles​(StringBuilder sb,
                                      String... extraClasses)
        Add id, class and style attributes the the stringbuilder.
      • addDynamicAttributes

        protected void addDynamicAttributes​(StringBuilder sb)