org.odftoolkit.simple.common.field
Class ReferenceField

java.lang.Object
  extended by org.odftoolkit.simple.Component
      extended by org.odftoolkit.simple.common.field.Field
          extended by org.odftoolkit.simple.common.field.ReferenceField

public class ReferenceField
extends Field

A ReferenceField refers to a field that appears in another location in a document.

The advantage of entering a reference as a field is that you do not have to adjust the references manually every time you change the document. Just update the fields and the references in the document are updated too.

NOTE: Before the document is opened in any editor, the value of this field maybe invalid.

Since:
0.5

Nested Class Summary
static class ReferenceField.DisplayType
          A DisplayType specifies the information that a reference field should display.
 
Nested classes/interfaces inherited from class org.odftoolkit.simple.common.field.Field
Field.FieldType
 
Method Summary
 void appendReferenceTo(OdfElement odfEle, ReferenceField.DisplayType type)
          Append this reference field after the specifics OdfElement.
 Field.FieldType getFieldType()
          Return the type of this field.
 String getName()
          Get the name of this reference field.
 OdfElement getOdfElement()
          Return the instance of OdfElement which presents this structure.
 void setName(String referenceName)
          Set the name of this reference field.
 
Methods inherited from class org.odftoolkit.simple.Component
getComponentByElement, getOwnerDocument, registerComponent, unregisterComponent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setName

public void setName(String referenceName)
Set the name of this reference field.

Parameters:
referenceName - the name of this content.

getName

public String getName()
Get the name of this reference field.

Returns:
the name of this reference field.

appendReferenceTo

public void appendReferenceTo(OdfElement odfEle,
                              ReferenceField.DisplayType type)
Append this reference field after the specifics OdfElement.

Parameters:
odfEle - the reference of odf element.
type - the display type.

getOdfElement

public OdfElement getOdfElement()
Description copied from class: Component
Return the instance of OdfElement which presents this structure.

Specified by:
getOdfElement in class Component
Returns:
the instance of OdfElement

getFieldType

public Field.FieldType getFieldType()
Description copied from class: Field
Return the type of this field.

Specified by:
getFieldType in class Field
Returns:
the type of this field.


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