Package io.jmix.ui.screen
Class ReadOnlyScreensSupport
java.lang.Object
io.jmix.ui.screen.ReadOnlyScreensSupport
Bean that encapsulates the default logic of changing screens read-only mode.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanisChangeComponentActionEnabled(Action action) protected booleanisChangeEditable(Component component) protected booleanisChangeOwnActionEnabled(Action action) protected booleanisEditableConsideringDataBinding(Component component, boolean editable) voidsecAccessManager(AccessManager accessManager) voidsetScreenReadOnly(Screen screen, boolean readOnly) Changes the read-only mode of the given screen.voidsetScreenReadOnly(Screen screen, boolean readOnly, boolean showEnableEditingBtn) Changes the read-only mode of the given screen.protected voidupdateActionsEnableState(Collection<Action> actions, boolean readOnly, Predicate<Action> shouldChangeEnabled) protected voidupdateComponentsEditableState(Screen screen, boolean readOnly) protected voidupdateOwnActionsEnableState(Screen screen, boolean readOnly)
-
Field Details
-
accessManager
-
-
Constructor Details
-
ReadOnlyScreensSupport
public ReadOnlyScreensSupport()
-
-
Method Details
-
secAccessManager
-
setScreenReadOnly
Changes the read-only mode of the given screen.The following components and actions change their state:
- All
Component.Editablecomponents that has a not nullValueSource - All
Action.AdjustWhenScreenReadOnlyactions obtained fromActionsHoldercomponents - All own screen actions except
EditorScreen.WINDOW_CLOSEandEditorScreen.ENABLE_EDITING
- Parameters:
screen- a screen to set the read-only modereadOnly- whether a screen in the read-only mode
- All
-
setScreenReadOnly
Changes the read-only mode of the given screen.The following components and actions change their state:
- All
Component.Editablecomponents that has a not nullValueSource - All
Action.AdjustWhenScreenReadOnlyactions obtained fromActionsHoldercomponents - All own screen actions except
EditorScreen.WINDOW_CLOSEandEditorScreen.ENABLE_EDITING
- Parameters:
screen- a screen to set the read-only modereadOnly- whether a screen in the read-only modeshowEnableEditingBtn- whether or not theEditorScreen.ENABLE_EDITINGshould be displayed in the read-only mode
- All
-
updateComponentsEditableState
-
isEditableConsideringDataBinding
-
isChangeComponentActionEnabled
-
isChangeOwnActionEnabled
-
isChangeEditable
-
updateOwnActionsEnableState
-
updateActionsEnableState
protected void updateActionsEnableState(Collection<Action> actions, boolean readOnly, Predicate<Action> shouldChangeEnabled)
-