com.vaadin.ui.Field.setVisible()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(108)

本文整理了Java中com.vaadin.ui.Field.setVisible()方法的一些代码示例,展示了Field.setVisible()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Field.setVisible()方法的具体详情如下:
包路径:com.vaadin.ui.Field
类名称:Field
方法名:setVisible

Field.setVisible介绍

暂无

代码示例

代码示例来源:origin: org.opennms.features.bsm/vaadin-adminpage

private void setVisible(Field<?> field, boolean visible) {
  field.setEnabled(visible);
  field.setRequired(visible);
  field.setVisible(visible);
}

代码示例来源:origin: org.opennms.features/vaadin-jmxconfiggenerator

/**
 * 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);
  }
}

代码示例来源:origin: org.opennms.features/jmxconfiggenerator.webui

/**
 * 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);
  }
}

相关文章