Class WysiwygRenderingHints

java.lang.Object
com.jalios.jcms.wysiwyg.WysiwygRenderingHints

public class WysiwygRenderingHints extends Object
Provides hints used during wysiwyg/JHTML rendering.
Since:
jcms-10.0.0
  • Constructor Details

    • WysiwygRenderingHints

      public WysiwygRenderingHints()
      Creates a new WikiRenderingHints with the default values.
    • WysiwygRenderingHints

      public WysiwygRenderingHints(String css)
      Creates a new WysiwygRenderingHints with the specified values
      Parameters:
      css - the name of the CSS class to use
  • Method Details

    • setCss

      public void setCss(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 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 the Data for which rendering is performed.
      Parameters:
      data - the data to set
    • getData

      public Data getData()
      Retrieves the Data for which rendering is performed.
      Returns:
      the data, may return null
    • setField

      public void setField(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 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 Map<String,Object> getAttributeMap()
      Returns the attributeMap used to store extra rendering options.
      Returns:
      the attributeMap.
    • setAttributeMap

      public void setAttributeMap(Map<String,Object> attributeMap)
      Set the attributeMap used to store extra rendering options.
      Parameters:
      attributeMap - the attributeMap.
    • setAttribute

      public void setAttribute(String name, Object value)
      Set a rendering attribute.
      Parameters:
      name - the attribute's key.
      value - the attribute's value.
    • getAttribute

      public Object getAttribute(String name)
      Get a rendering attribute.
      Parameters:
      name - the attribute's name.
      Returns:
      the attribute's value.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • containsAttribute

      public static boolean containsAttribute(WysiwygRenderingHints hints, String attributeName)
      Check if the specified WysiwygRenderingHints contains the specified attribute.
      Parameters:
      hints - a WysiwygRenderingHints to check, null is authorized
      attributeName - 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