Package com.jalios.jcms.font
Class FontManager
java.lang.Object
com.jalios.jcms.font.FontManager
- All Implemented Interfaces:
JPropertiesListener
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionprotected JPropertiesdeleteFontFamily(String familyId) Deletes a font family configuration and associated local files when needed.static StringgetFontNameHelp(Member mbr, String userLang) Returns a help text for managing fonts if the user has permission to access themgetFontSettings(String value, boolean isAjaxRefresh) Gets the settings for font selection.getFontSettings(String value, boolean isAjaxRefresh, boolean useFontFamilyAsId) Gets the settings for font selection.static FontManagerReturns all local font CSS resources.booleanisDefaultFont(FontFamily font) voidpropertiesChange(JProperties properties) Invoked after properties have been modified in JCMS and save on disk.
-
Field Details
-
PROP_FONT_PREFIX
- See Also:
-
-
Method Details
-
getInstance
-
propertiesChange
Description copied from interface:JPropertiesListenerInvoked 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.getPropertiesorchannel.getProperty.- Specified by:
propertiesChangein interfaceJPropertiesListener- Parameters:
properties- the properties which have been submitted to change
-
getFontList
-
isDefaultFont
-
getFontSettings
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 changeuseFontFamilyAsId- If true, use the fontFamily instead if font id- Returns:
- An EnumerateSettings object with all available fonts.
-
getFontNameHelp
Returns a help text for managing fonts if the user has permission to access them- Parameters:
mbr- Access Control MemberuserLang- language for the localized help text- Returns:
- Localized help text, if allowed; otherwise, an empty 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
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
-