public class TextField extends TextStream
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.
| Modifier and Type | Field and Description |
|---|---|
static int |
EMBED_FORMATTED |
static int |
EMBED_RAW |
static int |
EMBEDTYPE_SOM |
static int |
EMBEDTYPE_URI |
DEFAULT_STREAMLEVEL_CORRECT_SPACING, LEVEL_NORMAL, LEVEL_V6| Constructor and Description |
|---|
TextField()
Default constructor.
|
TextField(int eEmbedMode,
int eEmbedType,
String sExpression) |
TextField(String sFieldText)
Constructor with source text string.
|
TextField(String sFieldText,
int eEmbedMode,
int eEmbedType) |
TextField(String sFieldText,
int eEmbedMode,
int eEmbedType,
String sExpression) |
TextField(TextField oSource)
Copy constructor.
|
| Modifier and Type | Method and Description |
|---|---|
TextField |
cloneField()
Overridable method to create a new instance.
|
void |
copyFrom(TextField oSource)
Assign this field's content from the given field.
|
boolean |
equals(Object object)
Compare text fields for content equality.
|
int |
getEmbedMode() |
int |
getEmbedType() |
String |
getExpression() |
int |
hashCode() |
boolean |
isEqual(TextField oCompare)
Overridable equality comparison.
|
boolean |
notEqual(TextField oCompare)
Compare text fields for content inequality.
|
TextPosn |
position()
Return the position of this field in the parent stream.
|
void |
setEmbedMode(int eEmbedMode) |
void |
setEmbedType(int eEmbedType) |
void |
setExpression(String sExpression) |
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, updateNotificationgetLegacyLevel, hasCorrectPositioning, hasLegacyPositioning, hasNormalPositioning, setLegacyLevelpublic static final int EMBEDTYPE_SOM
public static final int EMBEDTYPE_URI
public static final int EMBED_RAW
public static final int EMBED_FORMATTED
public TextField()
The text field contains no content, has no pool/mapping assocotiation and is not embedded in any other stream.
public TextField(TextField oSource)
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.
oSource - Source text field to copy content from.public TextField(String sFieldText, int eEmbedMode, int eEmbedType)
public TextField(int eEmbedMode,
int eEmbedType,
String sExpression)
public TextField(String sFieldText)
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.
sFieldText - String whose contents are to be copied to the field.public void copyFrom(TextField oSource)
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.
oSource - Field containing source content to copy.public boolean equals(Object object)
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.
equals in class TextStreamobject - Field to compare againstpublic int hashCode()
hashCode in class TextStreampublic boolean notEqual(TextField oCompare)
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.
oCompare - Field to compare againstpublic boolean isEqual(TextField oCompare)
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.
oCompare - Field to compare againstpublic TextField cloneField()
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.
public TextPosn position()
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.
position in class TextStreampublic void setEmbedMode(int eEmbedMode)
public int getEmbedMode()
public void setEmbedType(int eEmbedType)
public int getEmbedType()
public void setExpression(String sExpression)
public String getExpression()
Copyright © 2010 - 2020 Adobe. All Rights Reserved