Interface ListBox

All Superinterfaces:
FormField

public non-sealed interface ListBox extends FormField
List Box Form Field 列表框表单字段

Features | 主要功能:

  • Option list access - 选项列表访问
  • Single and multi-select support - 单选和多选支持
  • Selected options management - 选中选项管理

Usage Examples | 使用示例:

ListBox list = (ListBox) form.getField("items");
List<String> options = list.getOptions();
list.setSelectedOptions(List.of("Option1", "Option3"));

Security | 安全性:

  • Thread-safe: Depends on implementation - 线程安全: 取决于实现
  • Null-safe: Depends on implementation - 空值安全: 取决于实现
Since:
JDK 25, opencode-base-pdf V1.0.0
Author:
Leon Soo www.LeonSoo.com
See Also:
  • Method Details

    • getType

      default FormField.FieldType getType()
      Description copied from interface: FormField
      Gets field type 获取字段类型
      Specified by:
      getType in interface FormField
      Returns:
      field type | 字段类型
    • getOptions

      List<String> getOptions()
      Gets available options 获取可用选项
      Returns:
      list of options | 选项列表
    • getSelectedOptions

      List<String> getSelectedOptions()
      Gets selected options 获取选中的选项
      Returns:
      list of selected options | 选中的选项列表
    • isMultiSelect

      boolean isMultiSelect()
      Checks if multiple selection is allowed 检查是否允许多选
      Returns:
      true if multi-select | 如果允许多选返回 true
    • setSelectedOptions

      void setSelectedOptions(List<String> options)
      Sets selected options 设置选中的选项
      Parameters:
      options - options to select | 要选中的选项