Class Field
java.lang.Object
com.inet.taskplanner.server.api.field.Field
- Direct Known Subclasses:
BooleanField
,ColorField
,CurrencyField
,DateField
,FilenameField
,FloatField
,FolderField
,GroupField
,LabelField
,LinkField
,NumberField
,PasswordField
,RangeField
,SelectField
,SelectInputField
,SelectInputFieldMulti
,TableField
,TextAreaField
,TextField
,TimeField
A field represents a component in the settings of a e.g. trigger or job. Each property that should be configured by
the user in the WEB GUI must be provided as a field.
The
The
Field
is also responsible to replace the placeholder in it's value for a serial
task.- Since:
- taskplanner 3.0
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Creates the field instanceprotected
Creates the field instance with the possibility to define whether the setting will be stored in the definition or not.protected
Creates the field instanceprotected
Creates the field instance with the possibility to define whether the setting will be stored in the definition or not. -
Method Summary
Modifier and TypeMethodDescriptionReturns the fields for the condition.getKey()
Returns the key that is stored in the definitiongetLabel()
Returns the label to be should in front of the componentReturns the placeholder text that is displayed if the field is left emptygetType()
Returns the type of the field which defines how the field is displayedgetValue()
Returns the current value of the fieldboolean
Returns whether the whole values of the fields in the current dialog should be updated if the value of the current field changesprotected boolean
Returns whether the value should be storedpatchResultPlaceholderInValue
(@Nullable String value, @Nonnull List<JobResultContainer> results) Override to replace the placeholders with the values from the resultspatchSeriesPlaceholderInValue
(@Nullable String value, @Nonnull Map<String, String> seriesProperties) Override to replace the placeholders with the values from the seriesprotected final String
replaceSeriesPlaceholders
(String value, Map<String, String> properties) Replace placeholders in given string with values in given properties.void
setConditions
(List<FieldCondition> conditions) Sets the fields for the condition.void
Sets the key that is stored in the definitionvoid
Sets the label to be should in front of the componentvoid
setPlaceholder
(String placeholder) Sets the placeholder text that is displayed if the field is left emptyvoid
Sets the type of the field which defines how the field is displayedvoid
Sets the type of the field which defines how the field is displayedvoid
setUpdateValuesOnChange
(boolean updateValuesOnChange) Sets whether the whole values of the fields in the current dialog should be updated if the value of the current field changesvoid
Sets the current value of the fieldprotected void
setValueSavable
(boolean valueSavable) Sets whether the value should be stored
-
Constructor Details
-
Field
Creates the field instance- Parameters:
type
- the type of the fieldkey
- the key that is stored in the definitionlabel
- the label to be should in front of the component- Since:
- taskplanner 3.0
-
Field
Creates the field instance- Parameters:
type
- the type of the fieldkey
- the key that is stored in the definitionlabel
- the label to be should in front of the component- Since:
- taskplanner 3.0
-
Field
Creates the field instance with the possibility to define whether the setting will be stored in the definition or not.- Parameters:
type
- the type of the fieldkey
- the key that is stored in the definitionlabel
- the label to be should in front of the componentvalueSavable
- true if the value should be stored, false otherwise- Since:
- taskplanner 3.0
-
Field
Creates the field instance with the possibility to define whether the setting will be stored in the definition or not.- Parameters:
type
- the type of the fieldkey
- the key that is stored in the definitionlabel
- the label to be should in front of the componentvalueSavable
- true if the value should be stored, false otherwise- Since:
- taskplanner 3.0
-
-
Method Details
-
getConditions
Returns the fields for the condition. These conditions are evaluates as OR-associated.- Returns:
- the fields for the condition
- Since:
- taskplanner 3.0
-
setConditions
Sets the fields for the condition. These conditions are evaluates as OR-associated.- Parameters:
conditions
- the fields for the condition- Since:
- taskplanner 3.0
-
getType
Returns the type of the field which defines how the field is displayed- Returns:
- the type of the field
- Since:
- taskplanner 3.0
-
setType
Sets the type of the field which defines how the field is displayed- Parameters:
type
- the type of the field- Since:
- taskplanner 3.0
-
setType
Sets the type of the field which defines how the field is displayed- Parameters:
type
- the type of the field- Since:
- taskplanner 3.0
-
getKey
Returns the key that is stored in the definition- Returns:
- the key that is stored in the definition
- Since:
- taskplanner 3.0
-
setKey
Sets the key that is stored in the definition- Parameters:
key
- the key that is stored in the definition- Since:
- taskplanner 3.0
-
getLabel
Returns the label to be should in front of the component- Returns:
- the label to be should in front of the component
- Since:
- taskplanner 3.0
-
setLabel
Sets the label to be should in front of the component- Parameters:
label
- the label to be should in front of the component- Since:
- taskplanner 3.0
-
getPlaceholder
Returns the placeholder text that is displayed if the field is left empty- Returns:
- the placeholder text
- Since:
- taskplanner 3.0
-
setPlaceholder
Sets the placeholder text that is displayed if the field is left empty- Parameters:
placeholder
- the placeholder text- Since:
- taskplanner 3.0
-
getValue
Returns the current value of the field- Returns:
- the current value of the field
- Since:
- taskplanner 3.0
-
setValue
Sets the current value of the field- Parameters:
value
- the current value of the field- Since:
- taskplanner 3.0
-
isValueSavable
protected boolean isValueSavable()Returns whether the value should be stored- Returns:
- true if the value should be stored, false otherwise
- Since:
- taskplanner 3.0
-
setValueSavable
protected void setValueSavable(boolean valueSavable) Sets whether the value should be stored- Parameters:
valueSavable
- true if the value should be stored, false otherwise- Since:
- taskplanner 3.0
-
isUpdateValuesOnChange
public boolean isUpdateValuesOnChange()Returns whether the whole values of the fields in the current dialog should be updated if the value of the current field changes- Returns:
- true if the values should be updated, false otherwise
- Since:
- taskplanner 3.0
-
setUpdateValuesOnChange
public void setUpdateValuesOnChange(boolean updateValuesOnChange) Sets whether the whole values of the fields in the current dialog should be updated if the value of the current field changes- Parameters:
updateValuesOnChange
- true if the values should be updated, false otherwise- Since:
- taskplanner 3.0
-
patchSeriesPlaceholderInValue
public String patchSeriesPlaceholderInValue(@Nullable @Nullable String value, @Nonnull @Nonnull Map<String, String> seriesProperties) Override to replace the placeholders with the values from the series- Parameters:
value
- the value to be patchedseriesProperties
- properties from the current series set- Returns:
- the new value with replaced placeholders
- Since:
- taskplanner 3.0
-
patchResultPlaceholderInValue
public String patchResultPlaceholderInValue(@Nullable @Nullable String value, @Nonnull @Nonnull List<JobResultContainer> results) Override to replace the placeholders with the values from the results- Parameters:
value
- the value to be patchedresults
- the results that contain the meta properties that are replaced- Returns:
- the new value with replaced placeholders
- Since:
- taskplanner 3.0
-
replaceSeriesPlaceholders
Replace placeholders in given string with values in given properties. Placeholders of missing values will be removed.- Parameters:
value
- the value to replaceproperties
- the properties with what to replace- Returns:
- the replaced String.
- Since:
- taskplanner 3.0
-