Package io.jmix.flowui.facet.settings
Interface ViewSettings
- All Known Implementing Classes:
AbstractViewSettings
,ViewSettingsJson
public interface ViewSettings
Base interface for classes that collect component settings from
View
. It provides API for
putting, getting, removing settings.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionDeletes 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) getSettings
(String id, Class<T> settingsClass) <T extends Settings>
TgetSettingsOrCreate
(String id, Class<T> settingsClass) void
initialize
(String rawSettings) Initializes current instance from serialized settings.boolean
Puts component's settings, e.gJmixDetailsSettings
.Puts a value withBoolean
.Puts a value withDouble
type.Puts a value withInteger
type.Puts a value withLong
type.Puts a value withString
type.void
setModified
(boolean modified) Set totrue
if screen settings changed manually.
-
Method Details
-
getViewId
String getViewId()- Returns:
- a
View
id to which settings are corresponded
-
setModified
void setModified(boolean modified) Set totrue
if screen settings changed manually. It guarantees that settings will be persisted.- Parameters:
modified
- whether settings were modified
-
isModified
boolean isModified()- Returns:
true
if settings were modified
-
put
Puts a value withString
type. 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
-String
value- Returns:
- current instance of
ViewSettings
-
put
Puts a value withInteger
type. 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
-Integer
value- Returns:
- current instance of
ViewSettings
-
put
Puts a value withLong
type. 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
-Long
value- Returns:
- current instance of
ViewSettings
-
put
Puts a value withDouble
type. 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
-Double
value- Returns:
- current instance of
ViewSettings
-
put
Puts 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
-Boolean
value- Returns:
- current instance of
ViewSettings
-
put
Puts 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
-
delete
Deletes component's settings by identifier if they exist.- Parameters:
id
- id to remove, e.g. component id- Returns:
- current instance of
ViewSettings
-
delete
Deletes 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
-
getString
- Parameters:
id
- e.g. component idkey
- object's key- Returns:
String
value wrapped inOptional
-
getInteger
- Parameters:
id
- e.g. component idkey
- object's key- Returns:
Integer
value wrapped inOptional
-
getLong
- Parameters:
id
- e.g. component idkey
- object's key- Returns:
Long
value wrapped inOptional
-
getDouble
- Parameters:
id
- e.g. component idkey
- object's key- Returns:
Double
value wrapped inOptional
-
getBoolean
- Parameters:
id
- e.g. component idkey
- object's key- Returns:
Boolean
value 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 current instance from serialized settings.- Parameters:
rawSettings
- serialized settings
-
serialize
String serialize()- Returns:
- serialized settings
-