Class SelectBuilder
java.lang.Object
io.openems.edge.core.appmanager.formly.builder.FormlyBuilder<SelectBuilder>
io.openems.edge.core.appmanager.formly.builder.SelectBuilder
- All Implemented Interfaces:
OnlyIf<SelectBuilder>
,Self<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
Modifier 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.formly.builder.FormlyBuilder
jsonObject, templateOptions
-
Constructor Summary
-
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) <T> SelectBuilder
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> SelectBuilder Methods inherited from class io.openems.edge.core.appmanager.formly.builder.FormlyBuilder
addWrapper, build, disabled, getDefaultValue, getExpressionProperties, getValidators, hide, hideKey, isRequired, onlyShowIf, readonly, self, setCustomValidation, setCustomValidation, setCustomValidation, 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
-
-
Constructor Details
-
SelectBuilder
-
-
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> 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 classFormlyBuilder<SelectBuilder>
-