Class TextField
While a text field may stand alone as a container of data in an application, it does not support layout and display on its own. Instead, a field must be embedded in another text stream, possibly another field.
Layout and rendering are operations on a displayable text stream (see class TextDispStr). For a field to participate in layout, its root ancestor in the text stream hierarchy must be a displayable stream.
The application may choose to use instances of this class directly, or it may further derive its own class. By inserting instances of its own class into the parent stream, the application can cache its own information with each field.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intFields inherited from class com.adobe.xfa.text.TextStream
DEFAULT_STREAMFields inherited from class com.adobe.xfa.text.TextLegacy
LEVEL_CORRECT_SPACING, LEVEL_NORMAL, LEVEL_V6 -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.Copy constructor.Constructor with source text string. -
Method Summary
Modifier and TypeMethodDescriptionOverridable method to create a new instance.voidAssign this field's content from the given field.booleanCompare text fields for content equality.intintinthashCode()booleanOverridable equality comparison.booleanCompare text fields for content inequality.position()Return the position of this field in the parent stream.voidsetEmbedMode(int eEmbedMode) voidsetEmbedType(int eEmbedType) voidsetExpression(String sExpression) Methods inherited from class com.adobe.xfa.text.TextStream
allowNewLines, allowNewLines, anyNewLines, append, append, append, append, append, append, cascadeLegacyLevel, coalesceMarker, contiguousText, copyFrom, currentSize, debug, display, enumEmbed, enumField, enumMarker, find, find, findRangeMarkerOver, fontService, fontService, getContext, gfxSource, gfxSource, isDescendentOf, isDescendentOf, legacyPositioning, markup, markup, markup, markup, markup, maxSize, maxSize, notEqual, posnCount, posnInsert, posnInsert, posnInsertPara, posnNext, posnNextAttr, posnNextChar, posnNextEmbed, posnNextField, posnNextType, posnNextType, posnPrev, posnPrevAttr, posnPrevChar, posnPrevEmbed, posnPrevField, posnPrevType, posnPrevType, posnUpdateStreamLoc, rangeEnumMarker, rangeMarker, rangeMarkerInternal, removeMarker, setText, spaceLeft, splitMarker, suppressFormat, text, text, updateNotificationMethods inherited from class com.adobe.xfa.text.TextLegacy
getLegacyLevel, hasCorrectPositioning, hasLegacyPositioning, hasNormalPositioning, setLegacyLevel
-
Field Details
-
EMBEDTYPE_SOM
public static final int EMBEDTYPE_SOM- See Also:
-
EMBEDTYPE_URI
public static final int EMBEDTYPE_URI- See Also:
-
EMBED_RAW
public static final int EMBED_RAW- See Also:
-
EMBED_FORMATTED
public static final int EMBED_FORMATTED- See Also:
-
-
Constructor Details
-
TextField
public TextField()Default constructor.The text field contains no content, has no pool/mapping assocotiation and is not embedded in any other stream.
-
TextField
Copy constructor.Copy all content from the source field. Also copies the graphic source of the given stream. The field is initially not embedded in any stream.
- Parameters:
oSource- Source text field to copy content from.
-
TextField
-
TextField
-
TextField
-
TextField
Constructor with source text string.Create a text field whose initial content is copied from the given string. The text stream initially has no attribute pool or font mapper association, and is not embedded in any stream.
- Parameters:
sFieldText- String whose contents are to be copied to the field.
-
-
Method Details
-
copyFrom
Assign this field's content from the given field.Replace this stream's content with a copy of the content of the given stream. The graphic source information is not copied. In other words, fonts will be re-mapped in this stream's font mapper and attributes will be re-pooled in any attribute pool associated with this stream.
- Parameters:
oSource- Field containing source content to copy.
-
equals
Compare text fields for content equality.Compare this field against the one passed on the parameter object for content equality. The graphics sources of the fields are not compared. To be equal, the fields' content must match in all aspects: raw text, attributes, embedded field content, and so on.
- Overrides:
equalsin classTextStream- Parameters:
object- Field to compare against- Returns:
- TRUE if the fields are equal; FALSE otherwise.
-
hashCode
public int hashCode()- Overrides:
hashCodein classTextStream
-
notEqual
Compare text fields for content inequality.Compare this field against the one passed on the parameter oCompare for content inequality. The graphics sources of the fields are not compared. This is the exact opposite of the equality comparison.
- Parameters:
oCompare- Field to compare against- Returns:
- TRUE if the fields are unequal; FALSE otherwise.
-
isEqual
Overridable equality comparison.Compare this field against the one passed on the parameter oCompare for equality. The default implementation simply defers to operator==(). If you derive a class from this, you can do your own comparisons.
- Parameters:
oCompare- Field to compare against- Returns:
- TRUE if the fields are equal; FALSE otherwise.
-
cloneField
Overridable method to create a new instance.When the caller works with a derived class, it must provide an implementation of Clone() that at least creates a new field of the correct (derived) type. This will be invoked by the parent stream when the caller adds one of its fields to the stream, in order to create the copy that the parent stream holds on to. The default implementation creates a copy of the field class through the copy constructor.
- Returns:
- Pointer to cloned copy. Note that this is a true clone that copies all attributes of this field, as opposed to creating an empty new instance.
-
position
Return the position of this field in the parent stream.This method is inherited from class TextStream. The implementation in Text Field returns a pointer to a position object that allows the caller to determine the parent stream and the position within that stream. Derived classes need not override this method.
- Overrides:
positionin classTextStream- Returns:
- Pointer to a const text position object that represents this field's position in its parent stream. If the field object is not embedded in any stream, the method returns NULL.
-
setEmbedMode
public void setEmbedMode(int eEmbedMode) -
getEmbedMode
public int getEmbedMode() -
setEmbedType
public void setEmbedType(int eEmbedType) -
getEmbedType
public int getEmbedType() -
setExpression
-
getExpression
-