Interface FormField

All Known Subinterfaces:
CheckBox, ComboBox, ListBox, RadioButton, SignatureField, TextField

public sealed interface FormField permits TextField, CheckBox, RadioButton, ComboBox, ListBox, SignatureField
Form Field Base - Common interface for all form field types 表单字段基类 - 所有表单字段类型的公共接口

Sealed interface permitting known form field types.

密封接口,仅允许已知的表单字段类型。

Features | 主要功能:

  • Common field properties (name, type, value, tooltip) - 通用字段属性(名称、类型、值、提示)
  • Field state queries (required, read-only) - 字段状态查询(必填、只读)
  • Position and size via rectangle - 通过矩形获取位置和大小
  • Sealed hierarchy for type-safe processing - 密封层次结构用于类型安全处理

Usage Examples | 使用示例:

FormField field = form.getField("name");
String value = field.getValue();
field.setValue("New Value");
boolean required = field.isRequired();

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:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static enum 
    Field types 字段类型
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets field name 获取字段名
    float[]
    Gets field rectangle (position and size) 获取字段矩形(位置和大小)
    Gets field tooltip 获取字段工具提示
    Gets field type 获取字段类型
    Gets field value 获取字段值
    boolean
    Checks if field is read-only 检查字段是否只读
    boolean
    Checks if field is required 检查字段是否必填
    void
    Sets field value 设置字段值
  • Method Details

    • getName

      String getName()
      Gets field name 获取字段名
      Returns:
      field name | 字段名
    • getType

      Gets field type 获取字段类型
      Returns:
      field type | 字段类型
    • getValue

      String getValue()
      Gets field value 获取字段值
      Returns:
      field value | 字段值
    • setValue

      void setValue(String value)
      Sets field value 设置字段值
      Parameters:
      value - new value | 新值
    • getTooltip

      String getTooltip()
      Gets field tooltip 获取字段工具提示
      Returns:
      tooltip text | 工具提示文本
    • isRequired

      boolean isRequired()
      Checks if field is required 检查字段是否必填
      Returns:
      true if required | 如果必填返回 true
    • isReadOnly

      boolean isReadOnly()
      Checks if field is read-only 检查字段是否只读
      Returns:
      true if read-only | 如果只读返回 true
    • getRectangle

      float[] getRectangle()
      Gets field rectangle (position and size) 获取字段矩形(位置和大小)
      Returns:
      rectangle as [x, y, width, height] | 矩形 [x, y, 宽, 高]