}
protected static void setFormFieldProperties(FieldRef fr, String ffName, String ffTextInputFormat) {
ObjectFactory wmlObjectFactory = Context.getWmlObjectFactory();
// Create object for ffData
CTFFData ffdata = wmlObjectFactory.createCTFFData();
fr.setFormFieldProperties(ffdata);
// Create object for name (wrapped in JAXBElement)
CTFFName ffname = wmlObjectFactory.createCTFFName();
JAXBElement<org.docx4j.wml.CTFFName> ffnameWrapped = wmlObjectFactory.createCTFFDataName(ffname);
ffdata.getNameOrEnabledOrCalcOnExit().add( ffnameWrapped);
ffname.setVal(ffName);
// Create object for enabled (wrapped in JAXBElement)
BooleanDefaultTrue booleandefaulttrue = wmlObjectFactory.createBooleanDefaultTrue();
JAXBElement<org.docx4j.wml.BooleanDefaultTrue> booleandefaulttrueWrapped = wmlObjectFactory.createCTFFDataEnabled(booleandefaulttrue);
ffdata.getNameOrEnabledOrCalcOnExit().add( booleandefaulttrueWrapped);
// Create object for calcOnExit (wrapped in JAXBElement)
BooleanDefaultTrue booleandefaulttrue2 = wmlObjectFactory.createBooleanDefaultTrue();
JAXBElement<org.docx4j.wml.BooleanDefaultTrue> booleandefaulttrueWrapped2 = wmlObjectFactory.createCTFFDataCalcOnExit(booleandefaulttrue2);
ffdata.getNameOrEnabledOrCalcOnExit().add( booleandefaulttrueWrapped2);
// Create object for textInput (wrapped in JAXBElement)
CTFFTextInput fftextinput = wmlObjectFactory.createCTFFTextInput();
JAXBElement<org.docx4j.wml.CTFFTextInput> fftextinputWrapped = wmlObjectFactory.createCTFFDataTextInput(fftextinput);
ffdata.getNameOrEnabledOrCalcOnExit().add( fftextinputWrapped);
//Set type to regular
CTFFTextType ffTextType = wmlObjectFactory.createCTFFTextType();
ffTextType.setVal(STFFTextType.REGULAR);
fftextinput.setType(ffTextType);
if (ffTextInputFormat!=null) {
// Create object for format
CTFFTextInput.Format fftextinputformat = wmlObjectFactory.createCTFFTextInputFormat();
fftextinput.setFormat(fftextinputformat);
fftextinputformat.setVal( ffTextInputFormat); // eg "UPPERCASE"
}
}