org.odftoolkit.simple.common.field
Class Fields

java.lang.Object
  extended by org.odftoolkit.simple.common.field.Fields

public class Fields
extends Object

This is a tool class to help the user creating all kinds of fields as needed.

Since:
0.5
See Also:
FieldSelection

Method Summary
static AuthorField createAuthorInitialsField(OdfElement odfElement)
          Create an author field for the specific OdfElement, which displays the initials of the author of this document.
static AuthorField createAuthorNameField(OdfElement odfElement)
          Create an author field for the specific OdfElement, which displays author full name of this document.
static ChapterField createChapterField(OdfElement odfElement)
          Create a chapter field for the specific OdfElement.
static ConditionField createConditionField(OdfElement odfElement, String condition, String trueText, String falseText)
          Declare a condition field, which specifies a condition for display of one text string or another.
static PageNumberField createCurrentPageNumberField(OdfElement odfElement)
          Create a page number field for the specific OdfElement, which displays current page number.
static DateField createDateField(OdfElement odfElement)
          Create an automatically update date field for the specific OdfElement, which displays current date.
static DateField createFixedDateField(OdfElement odfElement)
          Create a fixed date field for the specific OdfElement, which displays the field created date.
static TimeField createFixedTimeField(OdfElement odfElement)
          Create a fixed time field for the specific OdfElement, which displays the field created time.
static ConditionField createHiddenTextField(OdfElement odfElement, String condition, String text)
          Declare a hidden text field, which hides the text it contains when a specified condition is true.
static PageNumberField createNextPageNumberField(OdfElement odfElement)
          Create a page number field for the specific OdfElement, which displays next page number.
static PageCountField createPageCountField(OdfElement odfElement)
          Create a page count field for the specific OdfElement, which displays page total count of this document.
static PageNumberField createPreviousPageNumberField(OdfElement odfElement)
          Create a page number field for the specific OdfElement, which displays previous page number.
static ReferenceField createReferenceField(OdfElement odfElement, String referenceName)
          Create a ReferenceField for the specific OdfElement.
static VariableField createSimpleVariableField(VariableContainer container, String name)
          Declare a simple variable field.
static SubjectField createSubjectField(OdfElement odfElement)
          Create a subject field for the specific OdfElement, which displays the subject data of this document.
static TimeField createTimeField(OdfElement odfElement)
          Create an automatically update time field for the specific OdfElement, which displays current time.
static TitleField createTitleField(OdfElement odfElement)
          Create a title field for the specific OdfElement, which displays title data of this document.
static VariableField createUserVariableField(VariableContainer container, String name, String value)
          Declare a user variable field.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createDateField

public static DateField createDateField(OdfElement odfElement)
Create an automatically update date field for the specific OdfElement, which displays current date.

Parameters:
odfElement - the OdfElement which owns this field.
Returns:
the created date field.

createFixedDateField

public static DateField createFixedDateField(OdfElement odfElement)
Create a fixed date field for the specific OdfElement, which displays the field created date.

Parameters:
odfElement - the OdfElement which owns this field.
Returns:
the created date field.

createTimeField

public static TimeField createTimeField(OdfElement odfElement)
Create an automatically update time field for the specific OdfElement, which displays current time.

Parameters:
odfElement - the OdfElement which owns this field.
Returns:
the created time field.

createFixedTimeField

public static TimeField createFixedTimeField(OdfElement odfElement)
Create a fixed time field for the specific OdfElement, which displays the field created time.

Parameters:
odfElement - the OdfElement which owns this field.
Returns:
the created time field.

createPreviousPageNumberField

public static PageNumberField createPreviousPageNumberField(OdfElement odfElement)
Create a page number field for the specific OdfElement, which displays previous page number.

Parameters:
odfElement - the OdfElement which owns this field.
Returns:
the created page number field.

createCurrentPageNumberField

public static PageNumberField createCurrentPageNumberField(OdfElement odfElement)
Create a page number field for the specific OdfElement, which displays current page number.

Parameters:
odfElement - the OdfElement which owns this field.
Returns:
the created page number field.

createNextPageNumberField

public static PageNumberField createNextPageNumberField(OdfElement odfElement)
Create a page number field for the specific OdfElement, which displays next page number.

Parameters:
odfElement - the OdfElement which owns this field.
Returns:
the created page number field.

createPageCountField

public static PageCountField createPageCountField(OdfElement odfElement)
Create a page count field for the specific OdfElement, which displays page total count of this document.

Parameters:
odfElement - the OdfElement which owns this field.
Returns:
the created page count field.

createTitleField

public static TitleField createTitleField(OdfElement odfElement)
Create a title field for the specific OdfElement, which displays title data of this document.

Parameters:
odfElement - the OdfElement which owns this field.
Returns:
the created title field.

createSubjectField

public static SubjectField createSubjectField(OdfElement odfElement)
Create a subject field for the specific OdfElement, which displays the subject data of this document.

Parameters:
odfElement - the OdfElement which owns this field.
Returns:
the created author field.

createAuthorNameField

public static AuthorField createAuthorNameField(OdfElement odfElement)
Create an author field for the specific OdfElement, which displays author full name of this document.

Parameters:
odfElement - the OdfElement which owns this field.
Returns:
the created author field.

createAuthorInitialsField

public static AuthorField createAuthorInitialsField(OdfElement odfElement)
Create an author field for the specific OdfElement, which displays the initials of the author of this document.

Parameters:
odfElement - the OdfElement which owns this field.
Returns:
the created author field.

createChapterField

public static ChapterField createChapterField(OdfElement odfElement)
Create a chapter field for the specific OdfElement.

Parameters:
odfElement - the OdfElement which owns this field.
Returns:
the created chapter field.

createReferenceField

public static ReferenceField createReferenceField(OdfElement odfElement,
                                                  String referenceName)
Create a ReferenceField for the specific OdfElement.

Parameters:
odfElement - the OdfElement which owns this field.
referenceName - the reference field name.
Returns:
the created reference field.

createSimpleVariableField

public static VariableField createSimpleVariableField(VariableContainer container,
                                                      String name)
Declare a simple variable field. Simple variables, can take different values at different positions throughout a document.

Simple variables can be used to display different text in recurring elements, such as headers or footers.

Parameters:
container - the container which this variable field is contained.
name - the name of this variable field.
Returns:
the created variable field.

createUserVariableField

public static VariableField createUserVariableField(VariableContainer container,
                                                    String name,
                                                    String value)
Declare a user variable field. User variables have the same value throughout a document. If a user variable is set anywhere within the document, all fields in the document that display the user variable have the same value.

Parameters:
container - the container which this variable field is contained.
name - the name of this variable field.
value - the initial value of this variable field.
Returns:
the created variable field.

createConditionField

public static ConditionField createConditionField(OdfElement odfElement,
                                                  String condition,
                                                  String trueText,
                                                  String falseText)
Declare a condition field, which specifies a condition for display of one text string or another. If the condition is true, one of the text strings is displayed. If the condition is false, the other text string is displayed.

Parameters:
odfElement - the OdfElement which owns this field.
condition - the condition that determines which of the two text strings is displayed.
trueText - the text string to display if a condition is true.
falseText - the text string to display if a condition is false.
Returns:
the created condition field.

createHiddenTextField

public static ConditionField createHiddenTextField(OdfElement odfElement,
                                                   String condition,
                                                   String text)
Declare a hidden text field, which hides the text it contains when a specified condition is true.

Parameters:
odfElement - the OdfElement which owns this field.
condition - the condition that determines whether the text string is displayed or not.
text - the text string to display.
Returns:
the created condition field.


Copyright © 2010-2017 The Apache Software Foundation. All Rights Reserved.