public class TextFormFieldType
Example:
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");
Field Summary | ||
---|---|---|
static final int | REGULAR | |
The text form field can contain any text.
|
||
static final int | NUMBER | |
The text form field can contain only numbers.
|
||
static final int | DATE | |
The text form field can contain only a valid date value.
|
||
static final int | CURRENT_DATE | |
The text form field value is the current date when the field is updated.
|
||
static final int | CURRENT_TIME | |
The text form field value is the current time when the field is updated.
|
||
static final int | CALCULATED | |
The text form field value is calculated from the expression specified in
the |
public static final int REGULAR
public static final int NUMBER
public static final int DATE
public static final int CURRENT_DATE
public static final int CURRENT_TIME
public static final int CALCULATED