@Component(value="cuba_ReadOnlyScreensSupport")
public class ReadOnlyScreensSupport
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAME |
protected Security |
security |
Constructor and Description |
---|
ReadOnlyScreensSupport() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
isChangeComponentActionEnabled(Action action) |
protected boolean |
isChangeEditable(Component component) |
protected boolean |
isChangeOwnActionEnabled(Action action) |
protected boolean |
isEditableConsideringDataBinding(Component component,
boolean editable) |
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.
|
void |
setSecurity(Security security) |
protected void |
updateActionsEnableState(java.util.Collection<Action> actions,
boolean readOnly,
java.util.function.Predicate<Action> shouldChangeEnabled) |
protected void |
updateComponentsEditableState(Screen screen,
boolean readOnly) |
protected void |
updateOwnActionsEnableState(Screen screen,
boolean readOnly) |
public static final java.lang.String NAME
protected Security security
@Inject public void setSecurity(Security security)
public void setScreenReadOnly(Screen screen, boolean readOnly)
The following components and actions change their state:
Component.Editable
components that has a not null ValueSource
Action.DisabledWhenScreenReadOnly
actions obtained from ActionsHolder
componentsEditorScreen.WINDOW_CLOSE
and EditorScreen.ENABLE_EDITING
screen
- a screen to set the read-only modereadOnly
- whether a screen in the read-only modepublic void setScreenReadOnly(Screen screen, boolean readOnly, boolean showEnableEditingBtn)
The following components and actions change their state:
Component.Editable
components that has a not null ValueSource
Action.DisabledWhenScreenReadOnly
actions obtained from ActionsHolder
componentsEditorScreen.WINDOW_CLOSE
and EditorScreen.ENABLE_EDITING
screen
- a screen to set the read-only modereadOnly
- whether a screen in the read-only modeshowEnableEditingBtn
- whether or not the EditorScreen.ENABLE_EDITING
should be displayed in the read-only modeprotected void updateComponentsEditableState(Screen screen, boolean readOnly)
protected boolean isEditableConsideringDataBinding(Component component, boolean editable)
protected boolean isChangeComponentActionEnabled(Action action)
protected boolean isChangeOwnActionEnabled(Action action)
protected boolean isChangeEditable(Component component)
protected void updateOwnActionsEnableState(Screen screen, boolean readOnly)