Class HtmlElement

    • Field Detail

      • LF

        public static final String LF
        System line separator string
    • Constructor Detail

      • HtmlElement

        public HtmlElement()
    • Method Detail

      • toString

        public String toString()
        Generate a string representation of the Html element including all it's child elements
        Overrides:
        toString in class Object
        Returns:
        html string
      • toString

        public String toString​(boolean lineBreak)
        Generate a string representation of the Html element including all it's child elements
        Parameters:
        lineBreak - include line breaks in the html data for increased readability
        Returns:
        html string
      • setText

        public HtmlElement setText​(String text)
        Sets text content within the html element
        Parameters:
        text -
      • addHtmlElement

        public HtmlElement addHtmlElement​(HtmlElement element)
        Add a child html element to this html element
        Parameters:
        element -
        Returns:
        This element
      • addNewHtmlElement

        public HtmlElement addNewHtmlElement​(HtmlElement element)
        Add a child html element to this html element
        Parameters:
        element -
        Returns:
        The added html element
      • addStyle

        public HtmlElement addStyle​(String type,
                                    String value)
        Add style to html element
        Parameters:
        type - style type
        value - style value
        Returns:
        This object
      • addAttribute

        public HtmlElement addAttribute​(String type,
                                        String value)
        Add attribute to html element
        Parameters:
        type - attribute name
        value - attribute value
        Returns:
        This object
      • addAction

        public HtmlElement addAction​(String event,
                                     String function,
                                     String[] args)
        Add javascript action to html element
        Parameters:
        event - toggle event (e.g. onclick)
        function - name of javscript function (not including parameter brackets "()"
        args - Arguments for the javascript function
        Returns:
        This object
      • addAction

        public HtmlElement addAction​(String event,
                                     String function,
                                     String arg)
        Add javascript action to html element
        Parameters:
        event - toggle event (e.g. onclick)
        function - name of javscript function (not including parameter brackets "()"
        arg - Argument for the javascript function
        Returns:
        This object
      • addAction

        public HtmlElement addAction​(String event,
                                     String function)
        Add javascript action to html element
        Parameters:
        event - toggle event (e.g. onclick)
        function - name of javscript function (not including parameter brackets "()"
        Returns:
        This objecxt
      • setAction

        public void setAction​(List<se.idsec.utils.printcert.display.html.HtmlElement.Action> action)
      • setAttributes

        public void setAttributes​(List<se.idsec.utils.printcert.display.html.HtmlElement.Attribute> attributes)
      • setStyles

        public void setStyles​(List<se.idsec.utils.printcert.display.html.HtmlElement.Style> styles)