Class AddMapEntryControl
- java.lang.Object
-
- de.xima.fc.gui.model.value_descriptor_form.Control
-
- de.xima.fc.gui.model.value_descriptor_form.ValueReferencingControl
-
- de.xima.fc.gui.model.value_descriptor_form.AddMapEntryControl
-
- All Implemented Interfaces:
Serializable
public final class AddMapEntryControl extends ValueReferencingControl
AControlfor adding a new entry to a map value. Lets the user enter a key for the new entry, and provides a button to add the entry.- Since:
- 8.5.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AddMapEntryControl(IValueAccessor<?> root, String path, IValueDescriptor<?,? extends IValueBuilder<?>> valueDescriptor)Creates a new add map entry control.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddRow()Adds a new map entry to the referenced map value, if possible.StringgetKey()Gets the key for the new map entry to be added.voidsetKey(String key)Sets the key for the new map entry to be added.-
Methods inherited from class de.xima.fc.gui.model.value_descriptor_form.ValueReferencingControl
readValue, writeValue
-
-
-
-
Constructor Detail
-
AddMapEntryControl
public AddMapEntryControl(IValueAccessor<?> root, String path, IValueDescriptor<?,? extends IValueBuilder<?>> valueDescriptor)
Creates a new add map entry control.- Parameters:
root- The root object against which the path is evaluated.path- The JSON path expression that references the map.valueDescriptor- The value descriptor for the map value.
-
-
Method Detail
-
addRow
public void addRow()
Adds a new map entry to the referenced map value, if possible. Creates a new default value from the provided value descriptor and adds it at the user-configuredkey. Does nothing if the key is empty.
-
getKey
public String getKey()
Gets the key for the new map entry to be added.- Returns:
- The key for the new map entry.
-
setKey
public void setKey(String key)
Sets the key for the new map entry to be added.- Parameters:
key- The key for the new map entry.
-
-