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

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

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

CheckBox.getState介绍

暂无

代码示例

代码示例来源:origin: com.vaadin/vaadin-server

@Override
protected void doSetValue(Boolean value) {
  getState().checked = value;
}

代码示例来源:origin: com.vaadin/vaadin-server

@Override
public Boolean getValue() {
  return getState(false).checked;
}

代码示例来源:origin: com.vaadin/vaadin-server

@Override
  // Implementation copied from AbstractComponent
  public void removeStyleName(String style) {
    if (ComponentStateUtil.hasStyles(checkBox.getState().inputStyles)) {
      StringTokenizer tokenizer = new StringTokenizer(style, " ");
      while (tokenizer.hasMoreTokens()) {
        checkBox.getState().inputStyles
            .remove(tokenizer.nextToken());
      }
    }
  }
}

代码示例来源:origin: com.vaadin/vaadin-server

@Override
  // Implementation copied from AbstractComponent
  public void removeStyleName(String style) {
    if (ComponentStateUtil.hasStyles(checkBox.getState().labelStyles)) {
      StringTokenizer tokenizer = new StringTokenizer(style, " ");
      while (tokenizer.hasMoreTokens()) {
        checkBox.getState().labelStyles
            .remove(tokenizer.nextToken());
      }
    }
  }
}

代码示例来源:origin: com.vaadin/vaadin-server

@Override
// Implementation copied from AbstractComponent
public void setStyleName(String style) {
  if (style == null || style.isEmpty()) {
    checkBox.getState().inputStyles = null;
    return;
  }
  if (checkBox.getState().inputStyles == null) {
    checkBox.getState().inputStyles = new ArrayList<>();
  }
  List<String> styles = checkBox.getState().inputStyles;
  styles.clear();
  StringTokenizer tokenizer = new StringTokenizer(style, " ");
  while (tokenizer.hasMoreTokens()) {
    styles.add(tokenizer.nextToken());
  }
}

代码示例来源:origin: com.vaadin/vaadin-server

@Override
// Implementation copied from AbstractComponent
public void setStyleName(String style) {
  if (style == null || style.isEmpty()) {
    checkBox.getState().labelStyles = null;
    return;
  }
  if (checkBox.getState().labelStyles == null) {
    checkBox.getState().labelStyles = new ArrayList<>();
  }
  List<String> styles = checkBox.getState().labelStyles;
  styles.clear();
  StringTokenizer tokenizer = new StringTokenizer(style, " ");
  while (tokenizer.hasMoreTokens()) {
    styles.add(tokenizer.nextToken());
  }
}

代码示例来源:origin: com.vaadin/vaadin-server

@Override
// Implementation copied from AbstractComponent
public void addStyleName(String style) {
  if (style == null || style.isEmpty()) {
    return;
  }
  if (checkBox.getState().inputStyles != null
      && checkBox.getState().inputStyles.contains(style)) {
    return;
  }
  if (style.contains(" ")) {
    // Split space separated style names and add them one by one.
    StringTokenizer tokenizer = new StringTokenizer(style, " ");
    while (tokenizer.hasMoreTokens()) {
      addStyleName(tokenizer.nextToken());
    }
    return;
  }
  if (checkBox.getState().inputStyles == null) {
    checkBox.getState().inputStyles = new ArrayList<>();
  }
  List<String> styles = checkBox.getState().inputStyles;
  styles.add(style);
}

代码示例来源:origin: com.vaadin/vaadin-server

@Override
// Implementation copied from AbstractComponent
public void addStyleName(String style) {
  if (style == null || style.isEmpty()) {
    return;
  }
  if (checkBox.getState().labelStyles != null
      && checkBox.getState().labelStyles.contains(style)) {
    return;
  }
  if (style.contains(" ")) {
    // Split space separated style names and add them one by one.
    StringTokenizer tokenizer = new StringTokenizer(style, " ");
    while (tokenizer.hasMoreTokens()) {
      addStyleName(tokenizer.nextToken());
    }
    return;
  }
  if (checkBox.getState().labelStyles == null) {
    checkBox.getState().labelStyles = new ArrayList<>();
  }
  List<String> styles = checkBox.getState().labelStyles;
  styles.add(style);
}

代码示例来源:origin: com.vaadin/vaadin-server

@Override
// Implementation copied from AbstractComponent
public String getStyleName() {
  // replaced String with StringBuilder
  StringBuilder s = new StringBuilder();
  if (ComponentStateUtil
      .hasStyles(checkBox.getState(false).inputStyles)) {
    for (final Iterator<String> it = checkBox
        .getState(false).inputStyles.iterator(); it
            .hasNext();) {
      s.append(it.next());
      if (it.hasNext()) {
        s.append(" ");
      }
    }
  }
  return s.toString();
}

代码示例来源:origin: com.vaadin/vaadin-server

@Override
// Implementation copied from AbstractComponent
public String getStyleName() {
  // replaced String with StringBuilder
  StringBuilder s = new StringBuilder();
  if (ComponentStateUtil
      .hasStyles(checkBox.getState(false).labelStyles)) {
    for (final Iterator<String> it = checkBox
        .getState(false).labelStyles.iterator(); it
            .hasNext();) {
      s.append(it.next());
      if (it.hasNext()) {
        s.append(" ");
      }
    }
  }
  return s.toString();
}

代码示例来源:origin: com.haulmont.cuba/cuba-web-widgets

@Override
protected CubaCheckBoxState getState(boolean markAsDirty) {
  return (CubaCheckBoxState) super.getState(markAsDirty);
}

代码示例来源:origin: com.haulmont.cuba/cuba-web-widgets

@Override
protected CubaCheckBoxState getState() {
  return (CubaCheckBoxState) super.getState();
}

相关文章