Class CmsCssIcon

  • All Implemented Interfaces:
    com.vaadin.server.FontIcon, com.vaadin.server.Resource, java.io.Serializable

    public class CmsCssIcon
    extends java.lang.Object
    implements com.vaadin.server.FontIcon
    An icon resource. Will be rendered as <span class="v-icon styleName">&bnsp;</span>.

    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      CmsCssIcon​(com.vaadin.server.FontIcon icon)
      Cloning constructor.
      CmsCssIcon​(java.lang.String styleName)
      Constructor.
      CmsCssIcon​(java.lang.String styleName, java.lang.String additionalStyle)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getAdditionalButtonStyle()
      Returns the additional style name to use with OpenCms app buttons.
      int getCodepoint()  
      java.lang.String getFontFamily()  
      java.lang.String getHtml()  
      java.lang.String getHtml​(java.lang.String title)
      Returns the icon HTML with the title attribute set.
      java.lang.String getHtmlWithOverlay()
      Gets the html for the icon.
      java.lang.String getMIMEType()  
      java.lang.String getStyleName()
      Returns the style name of this icon.
      boolean hasAdditionalButtonStyle()
      Returns whether this icon has the additional button style set.
      void setAdditionalButtonStyle​(java.lang.String additionalStyle)
      Sets the additional style to apply to buttons generated with this icon.
      void setOverlay​(java.lang.String overlayStyle)
      Adds an overlay to icon.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CmsCssIcon

        public CmsCssIcon​(com.vaadin.server.FontIcon icon)
        Cloning constructor.

        Parameters:
        icon - the icon to clone
      • CmsCssIcon

        public CmsCssIcon​(java.lang.String styleName)
        Constructor.

        Parameters:
        styleName - the style name to assign to the icon.

      • CmsCssIcon

        public CmsCssIcon​(java.lang.String styleName,
                          java.lang.String additionalStyle)
        Constructor.

        Parameters:
        styleName - the style name to assign to the icon.

        additionalStyle - the additional style to apply to buttons generated with this icon
    • Method Detail

      • getAdditionalButtonStyle

        public java.lang.String getAdditionalButtonStyle()
        Returns the additional style name to use with OpenCms app buttons.

        Returns:
        the additional style name
      • getCodepoint

        public int getCodepoint()
        Specified by:
        getCodepoint in interface com.vaadin.server.FontIcon
        See Also:
        FontIcon.getCodepoint()
      • getFontFamily

        public java.lang.String getFontFamily()
        Specified by:
        getFontFamily in interface com.vaadin.server.FontIcon
        See Also:
        FontIcon.getFontFamily()
      • getHtml

        public java.lang.String getHtml()
        Specified by:
        getHtml in interface com.vaadin.server.FontIcon
        See Also:
        FontIcon.getHtml()
      • getHtml

        public java.lang.String getHtml​(java.lang.String title)
        Returns the icon HTML with the title attribute set.

        Parameters:
        title - the title to set
        Returns:
        the icon HTML
      • getHtmlWithOverlay

        public java.lang.String getHtmlWithOverlay()
        Gets the html for the icon.

        If overlay is set, it will be shown.

        Returns:
        html
      • getMIMEType

        public java.lang.String getMIMEType()
        Specified by:
        getMIMEType in interface com.vaadin.server.Resource
        See Also:
        Resource.getMIMEType()
      • getStyleName

        public java.lang.String getStyleName()
        Returns the style name of this icon.

        Returns:
        the style name
      • hasAdditionalButtonStyle

        public boolean hasAdditionalButtonStyle()
        Returns whether this icon has the additional button style set.

        Returns:
        true in case the additional style is set
      • setAdditionalButtonStyle

        public void setAdditionalButtonStyle​(java.lang.String additionalStyle)
        Sets the additional style to apply to buttons generated with this icon.

        Parameters:
        additionalStyle - the additional style to apply to buttons generated with this icon
      • setOverlay

        public void setOverlay​(java.lang.String overlayStyle)
        Adds an overlay to icon. Overlay is only returned by getHtmlWithOverlay().

        Parameters:
        overlayStyle - style to be added