Package io.jmix.ui.settings
Interface ScreenSettings
- All Known Implementing Classes:
AbstractScreenSettings
,ScreenSettingsJson
public interface ScreenSettings
Base interface for screen settings container. It provides API for putting, getting, removing component settings.
-
Method Summary
Modifier and TypeMethodDescriptiongetBoolean
(String componentId, String property) getInteger
(String componentId, String property) <T extends ComponentSettings>
Optional<T>getSettings
(String componentId, Class<T> settingsClass) <T extends ComponentSettings>
TgetSettingsOrCreate
(String componentId, Class<T> settingsClass) boolean
put
(ComponentSettings settings) Puts component's settings, e.gTableSettings
.Puts a Boolean value.Puts a Double value.Puts an Integer value.Puts a Long value.Puts a String value.Removes component's settings if they exist.Removes property of component's settings if it exists.void
setModified
(boolean modified) Set to true if screen settings changed manually.
-
Method Details
-
setModified
void setModified(boolean modified) Set to true if screen settings changed manually. It will guarantee that settings will be persisted.- Parameters:
modified
- whether settings were modified
-
isModified
boolean isModified()- Returns:
- true if screen setting were modified
-
put
Puts a String value. Will replace value if property already exist.- Parameters:
componentId
- component idproperty
- component's propertyvalue
- String value- Returns:
- current instance of screen settings
-
put
Puts an Integer value. Will replace value if property already exist.- Parameters:
componentId
- component idproperty
- component's propertyvalue
- Integer value- Returns:
- current instance of screen settings
-
put
Puts a Long value. Will replace value if property already exist.- Parameters:
componentId
- component idproperty
- component's propertyvalue
- Long value- Returns:
- current instance of screen settings
-
put
Puts a Double value. Will replace value if property already exist.- Parameters:
componentId
- component idproperty
- component's propertyvalue
- Double value- Returns:
- current instance of screen settings
-
put
Puts a Boolean value. Will replace value if property already exist.- Parameters:
componentId
- component idproperty
- component's propertyvalue
- Boolean value- Returns:
- current instance of screen settings
-
put
Puts component's settings, e.gTableSettings
. If settings with provided id already exist they will be replaced.- Parameters:
settings
- component settings- Returns:
- current instance of screen settings
-
remove
Removes component's settings if they exist.- Parameters:
componentId
- component id to remove- Returns:
- current instance of screen settings
-
remove
Removes property of component's settings if it exists.- Parameters:
componentId
- component idproperty
- component's property to remove- Returns:
- current instance of screen settings
-
getString
- Parameters:
componentId
- component idproperty
- component's property- Returns:
- String value wrapped in
Optional
-
getInteger
- Parameters:
componentId
- component idproperty
- component's property- Returns:
- Integer value wrapped in
Optional
-
getLong
- Parameters:
componentId
- component idproperty
- component's property- Returns:
- Long value wrapped in
Optional
-
getDouble
- Parameters:
componentId
- component idproperty
- component's property- Returns:
- Double value wrapped in
Optional
-
getBoolean
- Parameters:
componentId
- component idproperty
- component's property- Returns:
- Boolean value wrapped in
Optional
-
getSettings
- Type Parameters:
T
- type of component settings class- Parameters:
componentId
- component idsettingsClass
- settings class- Returns:
- component settings wrapped in
Optional
-
getSettingsOrCreate
- Type Parameters:
T
- type of component settings class- Parameters:
componentId
- component idsettingsClass
- settings class- Returns:
- component settings if exist otherwise return created settings with corresponding id
-