/** * {@inheritDoc} * <p> * The server ignores (potentially forged) value change requests from the * client to fields that are read-only. Programmatically changing the field * value via {@link #setValue(T)} is still possible. * <p> * The read-only mode is distinct from the * {@linkplain Component#setEnabled(boolean) disabled} state. When disabled, * a component cannot be interacted with at all, and its content should be * considered irrelevant or not applicable. In contrast, the user should * still be able to read the content and otherwise interact with a read-only * field even though changing the value is disallowed. * * @param readOnly * {@code true} to set read-only mode, {@code false} otherwise. */ @Override public void setReadOnly(boolean readOnly) { super.setReadOnly(readOnly); }
public void setPermissions(MaduraPropertyWrapper property, AbstractComponent field) { PermissionManager permissionmanager = getPermissionManager(); if (!permissionmanager.hasPermission( property.getWritePermission())) { field.setReadOnly(true); } if (!permissionmanager.hasPermission( property.getReadPermission())) { field.setVisible(false); } }
private void setPermissions(MaduraPropertyWrapper property, AbstractComponent field) { PermissionManager permissionmanager = getPermissionManager(); if (!permissionmanager.hasPermission( property.getWritePermission())) { field.setReadOnly(true); } if (!permissionmanager.hasPermission( property.getReadPermission())) { field.setVisible(false); } }