Fields { public static ConditionField createConditionField(OdfElement odfElement, String condition, String trueText, String falseText) { return new ConditionField(odfElement, condition, trueText, falseText, false); } private  Fields(); static DateField createDateField(OdfElement odfElement); static DateField createFixedDateField(OdfElement odfElement); static TimeField createTimeField(OdfElement odfElement); static TimeField createFixedTimeField(OdfElement odfElement); static PageNumberField createPreviousPageNumberField(OdfElement odfElement); static PageNumberField createCurrentPageNumberField(OdfElement odfElement); static PageNumberField createNextPageNumberField(OdfElement odfElement); static PageCountField createPageCountField(OdfElement odfElement); static TitleField createTitleField(OdfElement odfElement); static SubjectField createSubjectField(OdfElement odfElement); static AuthorField createAuthorNameField(OdfElement odfElement); static AuthorField createAuthorInitialsField(OdfElement odfElement); static ChapterField createChapterField(OdfElement odfElement); static ReferenceField createReferenceField(OdfElement odfElement, String referenceName); static VariableField createSimpleVariableField(VariableContainer container, String name); static VariableField createUserVariableField(VariableContainer container, String name, String value); static ConditionField createConditionField(OdfElement odfElement, String condition, String trueText,
			String falseText); static ConditionField createHiddenTextField(OdfElement odfElement, String condition, String text);  }
@Test public void testCreateConditionField() { try { TextDocument doc = TextDocument.loadDocument(ResourceUtilities.getTestResourceAsStream(TEST_DOCUMENT)); VariableField simpleVariableField = Fields.createSimpleVariableField(doc, "test_con_variable"); OdfTextParagraph varParagraph = doc.newParagraph("test_con_variable:"); simpleVariableField.updateField("true", varParagraph); OdfTextParagraph newParagraph = doc.newParagraph("Condition Field Test:"); ConditionField conditionField = Fields.createConditionField(newParagraph, "test_con_variable == \"true\"", "trueText", "falseText"); Assert.assertNotNull(conditionField); newParagraph = doc.newParagraph("Hide Text Field Test:"); conditionField = Fields.createHiddenTextField(newParagraph, "test_con_variable == \"true\"", "hiddenText"); Assert.assertNotNull(conditionField); } catch (Exception e) { Logger.getLogger(FieldsTest.class.getName()).log(Level.SEVERE, null, e); Assert.fail(e.getMessage()); } }