Class WIcon

    • Method Detail

      • setName

        public void setName​(java.lang.String name)
        Set the icon name.

        This sets the name of the icon. The name should be a the name of a Font-Aweswome icon, without the fa- prefix.

        Usage example: The "play" icon: https://fontawesome.com/v4/icon/play can be included with:

        
         WApplication app = WApplication.getInstance();
         app.getRoot().addWidget(new WIcon("play"));
        
         

        Note: The name can be followed by sizing information separated by a space if the Font Aweswome version used allows it. E.g. "play fa-4"

      • setSize

        public void setSize​(double factor)
        Changes the icon's size.

        Note: This is done in CSS, not using the fa-{size} method.

      • loadIconFont

        public static void loadIconFont()
        Loads the Font-Aweswome css style sheet.

        This is a convenience function that adds Font-Aweswome's CSS style sheet to the list of used style sheets.

        By default this will load the stylesheet present at: resources/font-awesome/css/font-awesome.min.css The resources directory can be set with a command-line option, namely –resources-dir, see Wt's configuration options.

        Note: This is automatically called when needed by WIcon.