com.google.gwt.user.client.ui.ListBox.isMultipleSelect()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(1.5k)|赞(0)|评价(0)|浏览(122)

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

ListBox.isMultipleSelect介绍

[英]Gets whether this list allows multiple selection.
[中]获取此列表是否允许多个选择。

代码示例

代码示例来源:origin: GwtMaterialDesign/gwt-material

/**
 * Gets whether this list allows multiple selection.
 *
 * @return <code>true</code> if multiple selection is allowed
 */
public boolean isMultipleSelect() {
  return listBox.isMultipleSelect();
}

代码示例来源:origin: com.github.gwtmaterialdesign/gwt-material

/**
 * Gets whether this list allows multiple selection.
 *
 * @return <code>true</code> if multiple selection is allowed
 */
public boolean isMultipleSelect() {
  return listBox.isMultipleSelect();
}

代码示例来源:origin: ltearno/hexa.tools

@Override
public Object getValue() {
  if(listBox.isMultipleSelect()) {
    List<String> selectedItems = new ArrayList<>();
    for (int i = 0; i < listBox.getItemCount(); i++) {
      if (listBox.isItemSelected(i)) {
        selectedItems.add(listBox.getValue(i));
      }
    }
    return selectedItems;
  }
  else {
    return listBox.getSelectedValue();
  }
}

代码示例来源:origin: fr.lteconsulting/hexa.binding.gwt

@Override
public Object getValue() {
  if(listBox.isMultipleSelect()) {
    List<String> selectedItems = new ArrayList<>();
    for (int i = 0; i < listBox.getItemCount(); i++) {
      if (listBox.isItemSelected(i)) {
        selectedItems.add(listBox.getValue(i));
      }
    }
    return selectedItems;
  }
  else {
    return listBox.getSelectedValue();
  }
}

相关文章