public class TextFormFieldType
extends java.lang.Object
Examples:
Shows how to create form fields.
DocumentBuilder builder = new DocumentBuilder();
// Form fields are objects in the document that the user can interact with by being prompted to enter values.
// We can create them using a document builder, and below are two ways of doing so.
// 1 - Basic text input:
builder.insertTextInput("My text input", TextFormFieldType.REGULAR,
"", "Enter your name here", 30);
// 2 - Combo box with prompt text, and a range of possible values:
String[] items =
{
"-- Select your favorite footwear --", "Sneakers", "Oxfords", "Flip-flops", "Other"
};
builder.insertParagraph();
builder.insertComboBox("My combo box", items, 0);
builder.getDocument().save(getArtifactsDir() + "DocumentBuilder.CreateForm.docx");
| Modifier and Type | Field and Description |
|---|---|
static int |
CALCULATED
The text form field value is calculated from the expression specified in the
FormField.getTextInputDefault() / FormField.setTextInputDefault(java.lang.String) property. |
static int |
CURRENT_DATE
The text form field value is the current date when the field is updated.
|
static int |
CURRENT_TIME
The text form field value is the current time when the field is updated.
|
static int |
DATE
The text form field can contain only a valid date value.
|
static int |
length |
static int |
NUMBER
The text form field can contain only numbers.
|
static int |
REGULAR
The text form field can contain any text.
|
| Modifier and Type | Method and Description |
|---|---|
static int |
fromName(java.lang.String textFormFieldTypeName) |
static java.lang.String |
getName(int textFormFieldType) |
static int[] |
getValues() |
static java.lang.String |
toString(int textFormFieldType) |
public static int REGULAR
public static int NUMBER
public static int DATE
public static int CURRENT_DATE
public static int CURRENT_TIME
public static int CALCULATED
FormField.getTextInputDefault() / FormField.setTextInputDefault(java.lang.String) property.public static int length