Package com.jalios.jcms.wysiwyg
Class WysiwygRenderingHints
- java.lang.Object
-
- com.jalios.jcms.wysiwyg.WysiwygRenderingHints
-
public class WysiwygRenderingHints extends java.lang.Object
Provides hints used during wysiwyg/JHTML rendering.- Since:
- jcms-10.0.0
-
-
Constructor Summary
Constructors Constructor Description WysiwygRenderingHints()
Creates a new WikiRenderingHints with the default values.WysiwygRenderingHints(java.lang.String css)
Creates a new WysiwygRenderingHints with the specified values
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
containsAttribute(WysiwygRenderingHints hints, java.lang.String attributeName)
Check if the specified WysiwygRenderingHints contains the specified attribute.java.lang.Object
getAttribute(java.lang.String name)
Get a rendering attribute.java.util.Map<java.lang.String,java.lang.Object>
getAttributeMap()
Returns the attributeMap used to store extra rendering options.java.lang.String
getCss()
Returns the css class(es) used during the rendering.Data
getData()
Retrieves theData
for which rendering is performed.java.lang.String
getField()
Retrieves the name of the data field for which rendering is performed.boolean
isEditable()
Returns whether the field is editable.boolean
isIndexing()
Returns whether the rendering happens during a publication indexing.void
setAttribute(java.lang.String name, java.lang.Object value)
Set a rendering attribute.void
setAttributeMap(java.util.Map<java.lang.String,java.lang.Object> attributeMap)
Set the attributeMap used to store extra rendering options.void
setCss(java.lang.String css)
Set the css to use in the surrounding html div/span generated by the rendering.void
setData(Data data)
Set theData
for which rendering is performed.void
setEditable(boolean editable)
Set whether the field is editable.void
setField(java.lang.String field)
Set the name of the data field for which rendering is performed.WysiwygRenderingHints
setIndexing(boolean indexing)
Set wether rendering is performed during publication indexing or not.java.lang.String
toString()
-
-
-
Constructor Detail
-
WysiwygRenderingHints
public WysiwygRenderingHints()
Creates a new WikiRenderingHints with the default values.
-
WysiwygRenderingHints
public WysiwygRenderingHints(java.lang.String css)
Creates a new WysiwygRenderingHints with the specified values- Parameters:
css
- the name of the CSS class to use
-
-
Method Detail
-
setCss
public void setCss(java.lang.String css)
Set the css to use in the surrounding html div/span generated by the rendering.
Default value is empty string "".- Parameters:
css
- one or more css class.
-
getCss
public java.lang.String getCss()
Returns the css class(es) used during the rendering.- Returns:
- the css class as one string,
-
setData
public void setData(Data data)
Set theData
for which rendering is performed.- Parameters:
data
- the data to set
-
getData
public Data getData()
Retrieves theData
for which rendering is performed.- Returns:
- the data, may return null
-
setField
public void setField(java.lang.String field)
Set the name of the data field for which rendering is performed.- Parameters:
field
- the name of the field being rendered
-
getField
public java.lang.String getField()
Retrieves the name of the data field for which rendering is performed.- Returns:
- the name of the field being rendered, may return null
-
setEditable
public void setEditable(boolean editable)
Set whether the field is editable.- Parameters:
editable
- whether the field is editable
-
isEditable
public boolean isEditable()
Returns whether the field is editable.- Returns:
- whether the field is editable
-
isIndexing
public boolean isIndexing()
Returns whether the rendering happens during a publication indexing.- Returns:
- true if rendering occurs for lucene indexing, false otherwise
- Since:
- 10.0.7 / JCMS-9501
-
setIndexing
public WysiwygRenderingHints setIndexing(boolean indexing)
Set wether rendering is performed during publication indexing or not.- Parameters:
indexing
- true if rendering occurs for lucene indexing, false otherwise- Returns:
- this instance for method chaining
- Since:
- 10.0.7 / JCMS-9501
-
getAttributeMap
public java.util.Map<java.lang.String,java.lang.Object> getAttributeMap()
Returns the attributeMap used to store extra rendering options.- Returns:
- the attributeMap.
-
setAttributeMap
public void setAttributeMap(java.util.Map<java.lang.String,java.lang.Object> attributeMap)
Set the attributeMap used to store extra rendering options.- Parameters:
attributeMap
- the attributeMap.
-
setAttribute
public void setAttribute(java.lang.String name, java.lang.Object value)
Set a rendering attribute.- Parameters:
name
- the attribute's key.value
- the attribute's value.
-
getAttribute
public java.lang.Object getAttribute(java.lang.String name)
Get a rendering attribute.- Parameters:
name
- the attribute's name.- Returns:
- the attribute's value.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
containsAttribute
public static boolean containsAttribute(WysiwygRenderingHints hints, java.lang.String attributeName)
Check if the specified WysiwygRenderingHints contains the specified attribute.- Parameters:
hints
- a WysiwygRenderingHints to check, null is authorizedattributeName
- the name of the attribute to look for- Returns:
- false if specified hints is null, of if specified attribute has not been declared
- Since:
- 10.0.8 / JCMS-10672
-
-