Class CmsTypografUtil

java.lang.Object
org.opencms.acacia.client.widgets.CmsTypografUtil

public final class CmsTypografUtil extends Object
Helpers / utilities related to the 'typograf' typography library.
  • Field Details

    • ENTITY_PATTERN

      public static final com.google.gwt.regexp.shared.RegExp ENTITY_PATTERN
      Pattern to match entities.
    • SAFE_TAG_PATTERN

      public static final com.google.gwt.regexp.shared.RegExp SAFE_TAG_PATTERN
      Pattern to match safe tags.
  • Method Details

    • createLiveInstance

      public static CmsTypografUtil.Typograf createLiveInstance(String typografLocale)
      Creates a 'live' typograf instance to be used for typography while typing in an editor widget.
      Parameters:
      typografLocale - the typograf locale (not the same format as OpenCms locales!)
      Returns:
      the typograf instance for the locale, or null if it couldn't be created
    • protectEntities

      public static String protectEntities(String input)
      Wraps entities in safe tags.
      Parameters:
      input - the input string
      Returns:
      the string with wrapped entities
    • restoreEntities

      public static String restoreEntities(String input)
      Removes the safe tags around entities.
      Parameters:
      input - the input string
      Returns:
      the transformed string
    • transform

      public static String transform(CmsTypografUtil.Typograf typograf, String value)
      Transforms things with typograf, preserving all entities.
      Parameters:
      typograf - the typograf instance
      value - the value to transform
      Returns:
      the transformed value