Package io.openems.edge.core.appmanager
Class JsonFormlyUtil.SelectBuilder
java.lang.Object
io.openems.edge.core.appmanager.JsonFormlyUtil.FormlyBuilder<JsonFormlyUtil.SelectBuilder>
io.openems.edge.core.appmanager.JsonFormlyUtil.SelectBuilder
- All Implemented Interfaces:
OnlyIf<JsonFormlyUtil.SelectBuilder>
,Self<JsonFormlyUtil.SelectBuilder>
- Enclosing class:
- JsonFormlyUtil
public static final class JsonFormlyUtil.SelectBuilder
extends JsonFormlyUtil.FormlyBuilder<JsonFormlyUtil.SelectBuilder>
A Builder for a Formly Select.
{ "key": "key", "type": "select", "templateOptions": { "label": "label", "required": true, "multiple": true, "options": [ { "label": "label", "value": "value" }, ... ] }, "expressionProperties": { "templateOptions.required": "model.PROPERTY" }, "hideExpression": "!model.PROPERTY", "defaultValue": "defaultValue" }
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Function<OpenemsComponent,
com.google.gson.JsonElement> static final Function<OpenemsComponent,
com.google.gson.JsonElement> Fields inherited from class io.openems.edge.core.appmanager.JsonFormlyUtil.FormlyBuilder
jsonObject, templateOptions
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
getType()
isMulti
(boolean isMulti) Sets if more than one options can be selected.setOptions
(com.google.gson.JsonArray options) setOptions
(OptionsFactory factory, Language l) setOptions
(List<? extends T> items, Function<T, com.google.gson.JsonElement> item2Label, Function<T, com.google.gson.JsonElement> item2Value) setOptions
(List<String> items) setOptions
(Set<Map.Entry<String, String>> items) Note theMap.entry(Object, Object)
does not return aComparable
Object so theSet
can not be aTreeSet
.<T,
C> JsonFormlyUtil.SelectBuilder Methods inherited from class io.openems.edge.core.appmanager.JsonFormlyUtil.FormlyBuilder
addWrapper, build, getExpressionProperties, isRequired, onlyShowIf, onlyShowIfChecked, onlyShowIfNotChecked, onlyShowIfValueEquals, self, setDefaultValue, setDefaultValue, setDefaultValue, setDefaultValue, setDefaultValueCases, setDefaultValueWithBooleanSupplier, setDefaultValueWithStringSupplier, setDescription, setKey, setLabel, setLabelExpression
-
Field Details
-
DEFAULT_COMPONENT_2_LABEL
public static final Function<OpenemsComponent,com.google.gson.JsonElement> DEFAULT_COMPONENT_2_LABEL -
DEFAULT_COMPONENT_2_VALUE
public static final Function<OpenemsComponent,com.google.gson.JsonElement> DEFAULT_COMPONENT_2_VALUE
-
-
Method Details
-
setOptions
-
setOptions
Note theMap.entry(Object, Object)
does not return aComparable
Object so theSet
can not be aTreeSet
.- Parameters:
items
- the options- Returns:
- this
-
setOptions
-
setOptions
-
setOptions
public <T> JsonFormlyUtil.SelectBuilder setOptions(List<? extends T> items, Function<T, com.google.gson.JsonElement> item2Label, Function<T, com.google.gson.JsonElement> item2Value) -
setOptions
-
isMulti
Sets if more than one options can be selected.- Parameters:
isMulti
- if more options can be selected- Returns:
- this
-
getType
- Specified by:
getType
in classJsonFormlyUtil.FormlyBuilder<JsonFormlyUtil.SelectBuilder>
-