Class ConditionalFormat

java.lang.Object
org.labkey.remoteapi.domain.ConditionalFormat

public class ConditionalFormat extends Object
Bean class for defining a conditional format for a field.
Grids will conditionally apply the specified styling to the associated field.
See Also:
  • Constructor Details

    • ConditionalFormat

      public ConditionalFormat(List<ConditionalFormatFilter> filters, String textColor, String backgroundColor, Boolean bold, Boolean italic, Boolean strikethrough)
      Construct a conditional format with the specified styling. null values for all styles will leave default styling.
      Parameters:
      filters - define when the format should be applied
      textColor - RGB hex value for conditional text color (e.g. "ffffff" for black)
      backgroundColor - RGB hex value for conditional background color (e.g. "ffffff" for black)
      bold - true to conditionally bold text
      italic - true to conditionally italicize text
      strikethrough - true to conditionally strike through text
    • ConditionalFormat

      public ConditionalFormat(List<ConditionalFormatFilter> filters, String textColor, String backgroundColor)
      Construct a conditional format with color styling
      Parameters:
      filters - define when the format should be applied
      textColor - RGB hex value for conditional text color (e.g. "ffffff" for black)
      backgroundColor - RGB hex value for conditional background color (e.g. "ffffff" for black)
    • ConditionalFormat

      public ConditionalFormat(List<ConditionalFormatFilter> filters, Boolean bold, Boolean italic, Boolean strikethrough)
      Construct a conditional format with font styling
      Parameters:
      filters - define when the format should be applied
      bold - true to conditionally bold text
      italic - true to conditionally italicize text
      strikethrough - true to conditionally strike through text
  • Method Details

    • queryFilterToJSONString

      protected String queryFilterToJSONString()
    • toJSON

      public org.json.JSONObject toJSON()
      Convert bean to JSON for serialization
      Returns:
      JSONObject representation of this conditional format.
    • queryFilterFromJSONString

      protected static List<ConditionalFormatFilter> queryFilterFromJSONString(String filterStr)
    • fromJSON

      public static ConditionalFormat fromJSON(org.json.JSONObject json)
      Populate new ConditionalFormat bean with deserialized JSON
      Parameters:
      json - deserialized JSON representing a conditional format
      Returns:
      new ConditionalFormat bean
    • getQueryFilter

      public List<ConditionalFormatFilter> getQueryFilter()
      Get conditional format conditions
      Returns:
      list of filters
    • setQueryFilter

      public void setQueryFilter(List<ConditionalFormatFilter> filters)
      Set conditional format conditions
      Parameters:
      filters - list of filters
    • getTextColor

      public String getTextColor()
      Get conditional text color. Blank or null for no conditional color.
      Returns:
      RGB hex value for text color (e.g. "ffffff" for black)
    • setTextColor

      public void setTextColor(String textColor)
      Set the conditional text color. Blank or null for no conditional color.
      Parameters:
      textColor - RGB hex value for text color (e.g. "ffffff" for black)
    • getBackgroundColor

      public String getBackgroundColor()
      Get conditional background color. Blank or null for no conditional color.
      Returns:
      RGB hex value for background color (e.g. "ffffff" for black)
    • setBackgroundColor

      public void setBackgroundColor(String backgroundColor)
      Set the conditional background color. Blank or null for no conditional color.
      Parameters:
      backgroundColor - RGB hex value for background color (e.g. "ffffff" for black)
    • getBold

      public boolean getBold()
      Get boldness flag for conditional format
      Returns:
      flag
    • setBold

      public void setBold(boolean bold)
      Set boldness flag for conditional format
      Parameters:
      bold - true to conditionally bold field in grids
    • getItalic

      public boolean getItalic()
      Get italic flag for conditional format
      Returns:
      flag
    • setItalic

      public void setItalic(boolean italic)
      Set italic flag for conditional format
      Parameters:
      italic - true to conditionally italicize field in grids
    • getStrikethrough

      public boolean getStrikethrough()
      Returns:
      strikethrough flag for conditional format
    • setStrikethrough

      public void setStrikethrough(boolean strikethrough)
      Set strikethrough flag for conditional format
      Parameters:
      strikethrough - true to conditionally strikethrough field in grids