Class CmsCssIcon

java.lang.Object
org.opencms.ui.CmsCssIcon
All Implemented Interfaces:
com.vaadin.server.FontIcon, com.vaadin.server.Resource, Serializable

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

See Also:
  • Constructor Details

    • CmsCssIcon

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

      Parameters:
      icon - the icon to clone
    • CmsCssIcon

      public CmsCssIcon(String styleName)
      Constructor.

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

    • CmsCssIcon

      public CmsCssIcon(String styleName, 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 Details

    • 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

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

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

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

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

      Gets the html for the icon.

      If overlay is set, it will be shown.

      Returns:
      html
    • getMIMEType

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

      public 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(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(String overlayStyle)
      Adds an overlay to icon. Overlay is only returned by getHtmlWithOverlay().

      Parameters:
      overlayStyle - style to be added