Class CmsTypografUtil
java.lang.Object
org.opencms.acacia.client.widgets.CmsTypografUtil
Helpers / utilities related to the 'typograf' typography library.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classNative type for the Typograf class provided by the library of the same name. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.google.gwt.regexp.shared.RegExpPattern to match entities.static final com.google.gwt.regexp.shared.RegExpPattern to match safe tags. -
Method Summary
Modifier and TypeMethodDescriptionstatic CmsTypografUtil.TypografcreateLiveInstance(String typografLocale) Creates a 'live' typograf instance to be used for typography while typing in an editor widget.static StringprotectEntities(String input) Wraps entities in safe tags.static StringrestoreEntities(String input) Removes the safe tags around entities.static Stringtransform(CmsTypografUtil.Typograf typograf, String value) Transforms things with typograf, preserving all entities.
-
Field Details
-
ENTITY_PATTERN
Pattern to match entities. -
SAFE_TAG_PATTERN
Pattern to match safe tags.
-
-
Method Details
-
createLiveInstance
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
Wraps entities in safe tags.- Parameters:
input- the input string- Returns:
- the string with wrapped entities
-
restoreEntities
Removes the safe tags around entities.- Parameters:
input- the input string- Returns:
- the transformed string
-
transform
Transforms things with typograf, preserving all entities.- Parameters:
typograf- the typograf instancevalue- the value to transform- Returns:
- the transformed value
-