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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
isChangeComponentActionEnabled
(Action action) protected boolean
isChangeEditable
(Component component) protected boolean
isChangeOwnActionEnabled
(Action action) protected boolean
isEditableConsideringDataBinding
(Component component, boolean editable) void
secAccessManager
(AccessManager accessManager) void
setScreenReadOnly
(Screen screen, boolean readOnly) Changes the read-only mode of the given screen.void
setScreenReadOnly
(Screen screen, boolean readOnly, boolean showEnableEditingBtn) Changes the read-only mode of the given screen.protected void
updateActionsEnableState
(Collection<Action> actions, boolean readOnly, Predicate<Action> shouldChangeEnabled) protected void
updateComponentsEditableState
(Screen screen, boolean readOnly) protected void
updateOwnActionsEnableState
(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.Editable
components that has a not nullValueSource
- All
Action.AdjustWhenScreenReadOnly
actions obtained fromActionsHolder
components - All own screen actions except
EditorScreen.WINDOW_CLOSE
andEditorScreen.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.Editable
components that has a not nullValueSource
- All
Action.AdjustWhenScreenReadOnly
actions obtained fromActionsHolder
components - All own screen actions except
EditorScreen.WINDOW_CLOSE
andEditorScreen.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_EDITING
should 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)
-