Class FontIcon

  • All Implemented Interfaces:
    com.google.gwt.user.client.ui.HasVisibility

    public class FontIcon
    extends Icon
    A font-based icon implementation.

    The icon represents a specific character (identified by codepoint, getCodepoint(), setCodepoint(int)) within a specific font (identified by font-family, getFontFamily(), setFontFamily(String)).

    Since:
    7.2
    Author:
    Vaadin Ltd
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject

        com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
    • Field Summary

      • Fields inherited from class com.google.gwt.user.client.ui.UIObject

        DEBUG_ID_PREFIX
    • Constructor Summary

      Constructors 
      Constructor Description
      FontIcon()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getCodepoint()
      Gets the codepoint indicating which particular icon (character) within the font-family this is.
      String getFontFamily()
      Gets the font-family from which this icon comes.
      protected String getFontStylename()
      Get the font-family based stylename used to apply the font-family.
      String getUri()
      Gets the current URI for this icon.
      static boolean isFontIconUri​(String uri)
      Checks whether or not the given uri is a font icon uri.
      void setAlternateText​(String alternateText)
      Not implemeted for FontIcon yet.
      protected void setCodepoint​(int codepoint)
      Sets the codepoint indicating which particular icon (character) within the font-family this is.
      protected void setFontFamily​(String fontFamily)
      Sets the font-family from which this icon comes.
      void setUri​(String uri)
      Sets the URI for the icon.
      • Methods inherited from class com.google.gwt.user.client.ui.UIObject

        addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, sinkEvents, toString, unsinkEvents
    • Constructor Detail

      • FontIcon

        public FontIcon()
    • Method Detail

      • setFontFamily

        protected void setFontFamily​(String fontFamily)
        Sets the font-family from which this icon comes. Use setCodepoint(int) to specify a particular icon (character) within the font.
        Parameters:
        fontFamily - font-family name
      • getFontFamily

        public String getFontFamily()
        Gets the font-family from which this icon comes. Use getCodepoint() to find out which particular icon (character) within the font this is.
        Returns:
        font-family name
      • setCodepoint

        protected void setCodepoint​(int codepoint)
        Sets the codepoint indicating which particular icon (character) within the font-family this is.
        Parameters:
        codepoint -
      • getCodepoint

        public int getCodepoint()
        Gets the codepoint indicating which particular icon (character) within the font-family this is.
        Returns:
      • getFontStylename

        protected String getFontStylename()
        Get the font-family based stylename used to apply the font-family.
        Returns:
        stylename used to apply font-family
        Since:
        7.2
      • isFontIconUri

        public static boolean isFontIconUri​(String uri)
        Checks whether or not the given uri is a font icon uri. Does not check whether or not the font icon is available and can be rendered.
        Parameters:
        uri -
        Returns:
        true if it's a fonticon uri
        Since:
        7.2
      • getUri

        public String getUri()
        Description copied from class: Icon
        Gets the current URI for this icon.
        Specified by:
        getUri in class Icon
        Returns:
        URI in use