Class StyleDeclarations

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.util.Map<StyleAttribute,​java.lang.String>

    public class StyleDeclarations
    extends java.util.EnumMap<StyleAttribute,​java.lang.String>
    A "style declaration" is a map of style attribute to value. Basically, the contents of a block of CSS attributes.
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.util.AbstractMap

        java.util.AbstractMap.SimpleEntry<K extends java.lang.Object,​V extends java.lang.Object>, java.util.AbstractMap.SimpleImmutableEntry<K extends java.lang.Object,​V extends java.lang.Object>
      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void appendAttributes​(java.lang.StringBuilder cssBuilder, int indentLevel)
      Append the CSS style block represented by this object to the given appender.
      com.inductiveautomation.ignition.common.gson.JsonObject asJsonObject​(KeyStyle mode)  
      com.inductiveautomation.ignition.common.gson.JsonObject asJsonObject​(KeyStyle mode, boolean inline)
      Returns mapping as a json object.
      • Methods inherited from class java.util.EnumMap

        clear, clone, containsKey, containsValue, entrySet, equals, get, hashCode, keySet, put, putAll, remove, size, values
      • Methods inherited from class java.util.AbstractMap

        isEmpty, toString
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Map

        compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
    • Constructor Detail

      • StyleDeclarations

        public StyleDeclarations()
      • StyleDeclarations

        public StyleDeclarations​(com.inductiveautomation.ignition.common.gson.JsonObject obj,
                                 KeyStyle mode)
    • Method Detail

      • appendAttributes

        public void appendAttributes​(java.lang.StringBuilder cssBuilder,
                                     int indentLevel)
        Append the CSS style block represented by this object to the given appender. Does not include braces, just includes multiple lines of indent key: value\n
      • asJsonObject

        public com.inductiveautomation.ignition.common.gson.JsonObject asJsonObject​(KeyStyle mode)
      • asJsonObject

        public com.inductiveautomation.ignition.common.gson.JsonObject asJsonObject​(KeyStyle mode,
                                                                                    boolean inline)
        Returns mapping as a json object. Allows the option to coerce certain attribute values to numbers This allows React to properly append 'px' to inline styles for attributes that use length values
        Parameters:
        mode - - style of key (CSS or React)
        inline - - if inline coerce the string to a number so React can append 'px' otherwise do it ourselves
        Returns:
        JSON object