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 -
Method Summary
Modifier and TypeMethodDescriptiongetName()Gets field name 获取字段名float[]Gets field rectangle (position and size) 获取字段矩形(位置和大小)Gets field tooltip 获取字段工具提示getType()Gets field type 获取字段类型getValue()Gets field value 获取字段值booleanChecks if field is read-only 检查字段是否只读booleanChecks if field is required 检查字段是否必填voidSets field value 设置字段值
-
Method Details
-
getName
-
getType
-
getValue
-
setValue
-
getTooltip
-
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, 宽, 高]
-