TextFormFieldType

Inheritance: java.lang.Object

public class TextFormFieldType

Specifies the type of a text form field.

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");
 

Fields

FieldDescription
CALCULATEDThe text form field value is calculated from the expression specified in the FormField.getTextInputDefault() / FormField.setTextInputDefault(java.lang.String) property.
CURRENT_DATEThe text form field value is the current date when the field is updated.
CURRENT_TIMEThe text form field value is the current time when the field is updated.
DATEThe text form field can contain only a valid date value.
NUMBERThe text form field can contain only numbers.
REGULARThe text form field can contain any text.
length

Methods

MethodDescription
fromName(String textFormFieldTypeName)
getName(int textFormFieldType)
getValues()
toString(int textFormFieldType)

CALCULATED

public static int CALCULATED

The text form field value is calculated from the expression specified in the FormField.getTextInputDefault() / FormField.setTextInputDefault(java.lang.String) property.

CURRENT_DATE

public static int CURRENT_DATE

The text form field value is the current date when the field is updated.

CURRENT_TIME

public static int CURRENT_TIME

The text form field value is the current time when the field is updated.

DATE

public static int DATE

The text form field can contain only a valid date value.

NUMBER

public static int NUMBER

The text form field can contain only numbers.

REGULAR

public static int REGULAR

The text form field can contain any text.

length

public static int length

fromName(String textFormFieldTypeName)

public static int fromName(String textFormFieldTypeName)

Parameters:

ParameterTypeDescription
textFormFieldTypeNamejava.lang.String

Returns: int

getName(int textFormFieldType)

public static String getName(int textFormFieldType)

Parameters:

ParameterTypeDescription
textFormFieldTypeint

Returns: java.lang.String

getValues()

public static int[] getValues()

Returns: int[]

toString(int textFormFieldType)

public static String toString(int textFormFieldType)

Parameters:

ParameterTypeDescription
textFormFieldTypeint

Returns: java.lang.String