Class CssFontHelper

java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.core.ui.glyph.CssFontHelper
All Implemented Interfaces:
LogEnabled, Component, Serviceable

public class CssFontHelper extends AbstractLogEnabled implements Component, Serviceable
Helper for parsing of CSS file and extract glyphs
  • Field Details

    • ROLE

      public static final String ROLE
      The Avalon role
  • Constructor Details

  • Method Details

    • service

      public void service(ServiceManager manager) throws ServiceException
      Specified by:
      service in interface Serviceable
      Throws:
      ServiceException
    • getGlyphClassNames

      public Set<String> getGlyphClassNames(String cssURI, String prefix)
      Get the CSS class names for glyphes
      Parameters:
      cssURI - The URI of CSS file
      prefix - The glyph prefix. Can be null.
      Returns:
      The CSS class names for glyphes
    • hasFontFaceRule

      public boolean hasFontFaceRule(String cssURI)
      Determines if the CSS file has a 'font-face' rule
      Parameters:
      cssURI - The URI of CSS file
      Returns:
      cssURI The URI of CSS file
    • getFontClassNames

      public Set<String> getFontClassNames(CSSStyleSheet styleSheet)
      Get CSS class name to use for all icons. Can be empty if the icons contains the font-family to use.
      Parameters:
      styleSheet - The CSS stylesheet to parse
      Returns:
      The name of the common CSS class name for icons (ex: 'fa' for FontAwesome). Can be empty if the icons contains the font-family to use.