Class SunEditorRenderer
- java.lang.Object
-
- javax.faces.render.Renderer
-
- org.primefaces.renderkit.CoreRenderer
-
- org.primefaces.renderkit.InputRenderer
-
- org.primefaces.extensions.component.suneditor.SunEditorRenderer
-
public class SunEditorRenderer extends org.primefaces.renderkit.InputRendererSunEditorcomponent.- Since:
- 12.0.6
- Author:
- Matthieu Valente
-
-
Constructor Summary
Constructors Constructor Description SunEditorRenderer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.Stringcapitalize(java.lang.String name)Capitalizes the first character of the given string.voiddecode(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)voidencodeEnd(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)protected voidencodeMarkup(javax.faces.context.FacesContext context, SunEditor editor)protected voidencodeScript(javax.faces.context.FacesContext context, SunEditor editor)protected java.lang.StringfixFontFamily(java.lang.String valueToRender)DIRTY HACK: Fixes the font-family declaration in the given HTML/CSS string by replacing any font name enclosed in `'...'` with its properly capitalized version.java.lang.ObjectgetConvertedValue(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, java.lang.Object submittedValue)protected java.lang.StringsanitizeHtml(javax.faces.context.FacesContext context, SunEditor editor, java.lang.String value)If security is enabled sanitize the HTML string to prevent XSS.-
Methods inherited from class org.primefaces.renderkit.InputRenderer
createStyleClass, createStyleClass, isDisabled, isReadOnly, renderAccessibilityAttributes, renderAccessibilityAttributes, renderAccessibilityAttributesHidden, renderARIACombobox, renderARIAInvalid, renderARIARequired, renderRTLDirection, shouldDecode
-
Methods inherited from class org.primefaces.renderkit.CoreRenderer
buildAjaxRequest, buildAjaxRequest, buildAjaxRequest, buildDomEvent, buildNonAjaxRequest, buildNonAjaxRequest, decodeBehaviors, encodeClientBehaviors, encodeIndexedId, endsWithLenghtUnit, getEventBehaviors, getHighlighter, getIconOnlyButtonText, getResourceRequestPath, getResourceURL, getStyleBuilder, getStyleClassBuilder, getWidgetBuilder, isGrouped, isValueBlank, logDevelopmentWarning, preConfiguredAjaxRequestBuilder, preConfiguredAjaxRequestBuilder, renderAttribute, renderButtonValue, renderChild, renderChildren, renderDomEvent, renderDomEvents, renderDummyMarkup, renderDynamicPassThruAttributes, renderHiddenInput, renderOnchange, renderOnclick, renderPassThruAttributes, renderPassThruAttributes, renderPassThruAttributes, renderValidationMetadata, shouldRenderAttribute, shouldWriteId
-
-
-
-
Method Detail
-
decode
public void decode(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)- Overrides:
decodein classjavax.faces.render.Renderer
-
encodeEnd
public void encodeEnd(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component) throws java.io.IOException- Overrides:
encodeEndin classjavax.faces.render.Renderer- Throws:
java.io.IOException
-
encodeMarkup
protected void encodeMarkup(javax.faces.context.FacesContext context, SunEditor editor) throws java.io.IOException- Throws:
java.io.IOException
-
fixFontFamily
protected java.lang.String fixFontFamily(java.lang.String valueToRender)
DIRTY HACK: Fixes the font-family declaration in the given HTML/CSS string by replacing any font name enclosed in `'...'` with its properly capitalized version.Example:
Input: font-family:'courier new' Output: font-family: Courier New
- Parameters:
valueToRender- the input string containing font-family declarations- Returns:
- the modified string with font names properly capitalized and single quotes replaced
- See Also:
- OWASP Bug #232
-
encodeScript
protected void encodeScript(javax.faces.context.FacesContext context, SunEditor editor) throws java.io.IOException- Throws:
java.io.IOException
-
getConvertedValue
public java.lang.Object getConvertedValue(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, java.lang.Object submittedValue)- Overrides:
getConvertedValuein classorg.primefaces.renderkit.InputRenderer
-
sanitizeHtml
protected java.lang.String sanitizeHtml(javax.faces.context.FacesContext context, SunEditor editor, java.lang.String value)If security is enabled sanitize the HTML string to prevent XSS.- Parameters:
context- the FacesContexteditor- the TextEditor instancevalue- the value to sanitize- Returns:
- the sanitized value
-
capitalize
public static java.lang.String capitalize(java.lang.String name)
Capitalizes the first character of the given string.- Parameters:
name- The string to capitalize.- Returns:
- The capitalized string if the input is not blank; otherwise, returns the input string unchanged.
-
-