Package io.jmix.flowui.facet.settings
Interface UiComponentSettings<S extends UiComponentSettings<S>>
- All Known Subinterfaces:
FragmentSettings,ViewSettings
- All Known Implementing Classes:
AbstractUiComponentSettings,AbstractUiComponentSettingsJson,AbstractViewSettings,FragmentSettingsJson,ViewSettingsJson
public interface UiComponentSettings<S extends UiComponentSettings<S>>
-
Method Summary
Modifier and TypeMethodDescriptionDeletes component's settings by identifier if they exist.Deletes a key of an object with a provided identifier if it exists.getBoolean(String id, String key) getInteger(String id, String key) getSettings(String id, Class<T> settingsClass) <T extends Settings>
TgetSettingsOrCreate(String id, Class<T> settingsClass) voidinitialize(String rawSettings) Initializes the current instance from serialized settings.booleanPuts 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.voidsetModified(boolean modified) Set totrueif screen settings changed manually.
-
Method Details
-
getOwnerId
String getOwnerId()- Returns:
- a
Componentid to which settings are corresponded
-
setModified
void setModified(boolean modified) Set totrueif screen settings changed manually. It guarantees that settings will be persisted.- Parameters:
modified- whether settings were modified
-
isModified
boolean isModified()- Returns:
trueif settings were modified
-
put
Puts a value withStringtype. Will replace value if the same key already exists.- 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
UiComponentSettings
-
put
Puts a value withIntegertype. Will replace value if the same key already exists.- 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
UiComponentSettings
-
put
Puts a value withLongtype. Will replace value if the same key already exists.- 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
UiComponentSettings
-
put
Puts a value withDoubletype. Will replace value if the same key already exists.- 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
UiComponentSettings
-
put
Puts a value withBoolean. Will replace value if the same key already exists.- 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
UiComponentSettings
-
put
Puts component's settings, e.gJmixDetailsSettings. If setting with provided id already exists it will be replaced.- Parameters:
settings- object of settings- Returns:
- current instance of
UiComponentSettings
-
delete
Deletes component's settings by identifier if they exist.- Parameters:
id- id to remove, e.g. component id- Returns:
- current instance of
UiComponentSettings
-
delete
Deletes a key of an object with a provided identifier if it exists.- Parameters:
id- e.g. component idkey- object's key to remove- Returns:
- current instance of
UiComponentSettings
-
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
Initializes the current instance from serialized settings.- Parameters:
rawSettings- serialized settings
-
serialize
String serialize()- Returns:
- serialized settings
-