Class WIcon


public class WIcon extends WInteractWidget
A widget that represents a Font-Aweswome icon.

By default, JWt will load the default Font-Awesome included with it. This is version 4.3.0. For a list of all icons, visit: https://fontawesome.com/v4/icons/

See Also:
  • Constructor Details

  • Method Details

    • setName

      public void setName(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"

    • getName

      public String getName()
      Returns the icon name.

      See Also:
    • setSize

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

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

    • getSize

      public double getSize()
      Returns the icon size.

      See Also:
    • 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.