Class FontManager

java.lang.Object
com.jalios.jcms.font.FontManager
All Implemented Interfaces:
JPropertiesListener

public class FontManager extends Object implements JPropertiesListener
  • Field Details

  • Method Details

    • getInstance

      public static FontManager getInstance()
    • propertiesChange

      public void propertiesChange(JProperties properties)
      Description copied from interface: JPropertiesListener
      Invoked after properties have been modified in JCMS and save on disk.

      You cannot alter the value received in parameters.

      Note that properties parameter may be null, a limited set of site properties, or all site properties.

      To check that a property has been modified, reload the "current" property instead using channel.getProperties or channel.getProperty.

      Specified by:
      propertiesChange in interface JPropertiesListener
      Parameters:
      properties - the properties which have been submitted to change
    • getFontList

      public List<FontFamily> getFontList()
    • isDefaultFont

      public boolean isDefaultFont(FontFamily font)
    • getFontSettings

      public EnumerateSettings getFontSettings(String value, boolean isAjaxRefresh)
      Gets the settings for font selection. It populates these values and labels from a set of properties based on FONT_FAMILY_SET. If the properties do not exist or are empty, they are skipped.
      Parameters:
      value - The current font id.
      isAjaxRefresh - If true, refresh page on change
      Returns:
      An EnumerateSettings object with all available fonts.
    • getFontSettings

      public EnumerateSettings getFontSettings(String value, boolean isAjaxRefresh, boolean useFontFamilyAsId)
      Gets the settings for font selection. It populates these values and labels from a set of properties based on FONT_FAMILY_SET. If the properties do not exist or are empty, they are skipped.
      Parameters:
      value - The current font id.
      isAjaxRefresh - If true, refresh page on change
      useFontFamilyAsId - If true, use the fontFamily instead if font id
      Returns:
      An EnumerateSettings object with all available fonts.
    • getFontNameHelp

      public static String getFontNameHelp(Member mbr, String userLang)
      Returns a help text for managing fonts if the user has permission to access them
      Parameters:
      mbr - Access Control Member
      userLang - language for the localized help text
      Returns:
      Localized help text, if allowed; otherwise, an empty string
    • getLocalFontCssResources

      public Map<? extends String,? extends String> getLocalFontCssResources()
      Returns all local font CSS resources.
      Returns:
      a map where the key is the CSS URL and the value is the media type ("all")
    • deleteFontFamily

      protected JProperties deleteFontFamily(String familyId) throws FontImportException
      Deletes a font family configuration and associated local files when needed.
      Parameters:
      familyId - the technical font family id
      Returns:
      New properties value
      Throws:
      FontImportException - if the font family cannot be deleted safely