Package io.jmix.flowui.facet.settings
Class ViewSettingsJson
java.lang.Object
io.jmix.flowui.facet.settings.AbstractViewSettings
io.jmix.flowui.facet.settings.ViewSettingsJson
- All Implemented Interfaces:
ViewSettings
View settings that uses JSON structure.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.google.gson.Gsonprotected com.google.gson.JsonArrayFields inherited from class io.jmix.flowui.facet.settings.AbstractViewSettings
modified, viewId -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckNotNullGetConditions(String id, String property) protected voidcheckNotNullPutConditions(String id, String key) Deletes component's settings by identifier if they exist.Deletes a key of object with provided identifier if it exists.getBoolean(String id, String key) getInteger(String id, String key) Optional<com.google.gson.JsonObject>protected com.google.gson.JsonObjectprotected com.google.gson.JsonObjectgetSettings(String id, Class<T> settingsClass) <T extends Settings>
TgetSettingsOrCreate(String id, Class<T> settingsClass) protected voidinitGson()voidinitialize(String raw) Initializes current instance from serialized settings.protected voidinitRoot()protected booleanisValueNull(com.google.gson.JsonObject json, String key) protected voidput(com.google.gson.JsonObject json) Puts component's settings, e.gJmixDetailsSettings.Puts a value withBoolean.Puts a value withDoubletype.Puts a value withIntegertype.Puts a value withLongtype.Puts a value withStringtype.Methods inherited from class io.jmix.flowui.facet.settings.AbstractViewSettings
getViewId, isModified, setModified
-
Field Details
-
root
protected com.google.gson.JsonArray root -
gson
protected com.google.gson.Gson gson
-
-
Constructor Details
-
ViewSettingsJson
-
-
Method Details
-
initGson
protected void initGson() -
put
Description copied from interface:ViewSettingsPuts a value withStringtype. Will replace value if the same key already exist.- Parameters:
id- e.g. component idkey- key with which associated provided value, e.g. component's width or some statevalue-Stringvalue- Returns:
- current instance of
ViewSettings
-
put
Description copied from interface:ViewSettingsPuts a value withIntegertype. Will replace value if the same key already exist.- Parameters:
id- e.g. component idkey- key with which associated provided value, e.g. component's property or some statevalue-Integervalue- Returns:
- current instance of
ViewSettings
-
put
Description copied from interface:ViewSettingsPuts a value withLongtype. Will replace value if the same key already exist.- Parameters:
id- e.g. component idkey- key with which associated provided value, e.g. component's property or some statevalue-Longvalue- Returns:
- current instance of
ViewSettings
-
put
Description copied from interface:ViewSettingsPuts a value withDoubletype. Will replace value if the same key already exist.- Parameters:
id- e.g. component idkey- key with which associated provided value, e.g. component's property or some statevalue-Doublevalue- Returns:
- current instance of
ViewSettings
-
put
Description copied from interface:ViewSettingsPuts a value withBoolean. Will replace value if the same key already exist.- Parameters:
id- e.g. component idkey- key with which associated provided value, e.g. component's property or some statevalue-Booleanvalue- Returns:
- current instance of
ViewSettings
-
put
Description copied from interface:ViewSettingsPuts component's settings, e.gJmixDetailsSettings. If setting with provided id already exist it will be replaced.- Parameters:
settings- object of settings- Returns:
- current instance of
ViewSettings
-
put
- Parameters:
json- json object that represents settings- Returns:
- current instance of
ViewSettings
-
delete
Description copied from interface:ViewSettingsDeletes component's settings by identifier if they exist.- Parameters:
id- id to remove, e.g. component id- Returns:
- current instance of
ViewSettings
-
delete
Description copied from interface:ViewSettingsDeletes a key of object with provided identifier if it exists.- Parameters:
id- e.g. component idkey- object's key to remove- Returns:
- current instance of
ViewSettings
-
getJsonSettings
- Parameters:
id- e.g. component id- Returns:
- json object that represents settings
-
getString
- Parameters:
id- e.g. component idkey- object's key- Returns:
Stringvalue wrapped inOptional
-
getInteger
- Parameters:
id- e.g. component idkey- object's key- Returns:
Integervalue wrapped inOptional
-
getLong
- Parameters:
id- e.g. component idkey- object's key- Returns:
Longvalue wrapped inOptional
-
getDouble
- Parameters:
id- e.g. component idkey- object's key- Returns:
Doublevalue wrapped inOptional
-
getBoolean
- Parameters:
id- e.g. component idkey- object's key- Returns:
Booleanvalue wrapped inOptional
-
getSettings
- Type Parameters:
T- type of settings class- Parameters:
id- e.g. component idsettingsClass- settings class- Returns:
- component settings wrapped in
Optional
-
getSettingsOrCreate
- Type Parameters:
T- type of settings class- Parameters:
id- e.g. component idsettingsClass- settings class- Returns:
- object of settings if exists otherwise return created settings with corresponding id
-
initialize
Description copied from interface:ViewSettingsInitializes current instance from serialized settings.- Parameters:
raw- serialized settings
-
serialize
- Returns:
- serialized settings
-
put
-
getObjectOrCreate
-
getObject
-
checkNotNullPutConditions
-
checkNotNullGetConditions
-
initRoot
protected void initRoot() -
isValueNull
-