Package org.labkey.remoteapi.domain
Class ConditionalFormat
java.lang.Object
org.labkey.remoteapi.domain.ConditionalFormat
Bean class for defining a conditional format for a field.
Grids will conditionally apply the specified styling to the associated field.
Grids will conditionally apply the specified styling to the associated field.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConditionalFormat
(List<ConditionalFormatFilter> filters, Boolean bold, Boolean italic, Boolean strikethrough) Construct a conditional format with font stylingConditionalFormat
(List<ConditionalFormatFilter> filters, String textColor, String backgroundColor) Construct a conditional format with color stylingConditionalFormat
(List<ConditionalFormatFilter> filters, String textColor, String backgroundColor, Boolean bold, Boolean italic, Boolean strikethrough) Construct a conditional format with the specified styling. -
Method Summary
Modifier and TypeMethodDescriptionstatic ConditionalFormat
fromJSON
(org.json.JSONObject json) Populate new ConditionalFormat bean with deserialized JSONGet conditional background color.boolean
getBold()
Get boldness flag for conditional formatboolean
Get italic flag for conditional formatGet conditional format conditionsboolean
Get conditional text color.protected static List<ConditionalFormatFilter>
queryFilterFromJSONString
(String filterStr) protected String
void
setBackgroundColor
(String backgroundColor) Set the conditional background color.void
setBold
(boolean bold) Set boldness flag for conditional formatvoid
setItalic
(boolean italic) Set italic flag for conditional formatvoid
setQueryFilter
(List<ConditionalFormatFilter> filters) Set conditional format conditionsvoid
setStrikethrough
(boolean strikethrough) Set strikethrough flag for conditional formatvoid
setTextColor
(String textColor) Set the conditional text color.org.json.JSONObject
toJSON()
Convert bean to JSON for serialization
-
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 appliedtextColor
- 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 textitalic
-true
to conditionally italicize textstrikethrough
-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 appliedtextColor
- 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 appliedbold
-true
to conditionally bold textitalic
-true
to conditionally italicize textstrikethrough
-true
to conditionally strike through text
-
-
Method Details
-
queryFilterToJSONString
-
toJSON
public org.json.JSONObject toJSON()Convert bean to JSON for serialization- Returns:
- JSONObject representation of this conditional format.
-
queryFilterFromJSONString
-
fromJSON
Populate new ConditionalFormat bean with deserialized JSON- Parameters:
json
- deserialized JSON representing a conditional format- Returns:
- new ConditionalFormat bean
-
getQueryFilter
Get conditional format conditions- Returns:
- list of filters
-
setQueryFilter
Set conditional format conditions- Parameters:
filters
- list of filters
-
getTextColor
Get conditional text color. Blank ornull
for no conditional color.- Returns:
- RGB hex value for text color (e.g. "ffffff" for black)
-
setTextColor
Set the conditional text color. Blank ornull
for no conditional color.- Parameters:
textColor
- RGB hex value for text color (e.g. "ffffff" for black)
-
getBackgroundColor
Get conditional background color. Blank ornull
for no conditional color.- Returns:
- RGB hex value for background color (e.g. "ffffff" for black)
-
setBackgroundColor
Set the conditional background color. Blank ornull
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
-