private void setVisible(Field<?> field, boolean visible) { field.setEnabled(visible); field.setRequired(visible); field.setVisible(visible); }
/** * Toggles the visibility of user and password fields. The fields are shown * if "authenticate" checkbox is presssed. Otherwise they are not shown. */ private void updateAuthenticationFields(boolean visible) throws Property.ReadOnlyException, Converter.ConversionException { ((Field<Boolean>) configFieldGroup.getField(MetaConfigModel.AUTHENTICATE)).setValue(visible); configFieldGroup.getField(MetaConfigModel.USER).setVisible(visible); configFieldGroup.getField(MetaConfigModel.PASSWORD).setVisible(visible); if (!visible) { configFieldGroup.getField(MetaConfigModel.USER).setValue(null); configFieldGroup.getField(MetaConfigModel.PASSWORD).setValue(null); } }
/** * Toggles the visibility of user and password fields. The fields are shown * if "authenticate" checkbox is presssed. Otherwise they are not shown. */ private void updateAuthenticationFields(boolean visible) throws ReadOnlyException, ConversionException { getField(MetaConfigModel.AUTHENTICATE).setValue(visible); getField(MetaConfigModel.USER).setVisible(visible); getField(MetaConfigModel.PASSWORD).setVisible(visible); if (!visible) { getField(MetaConfigModel.USER).setValue(null); getField(MetaConfigModel.PASSWORD).setValue(null); } }