public class SpenTextSpanBase extends Object
SpenForegroundColorSpan, SpenFontSizeSpan, SpenFontNameSpan,
SpenBoldSpan, SpenItalicSpan, SpenUnderlineSpan, SpenHyperTextSpan| Modifier and Type | Field and Description |
|---|---|
static int |
SPAN_EXCLUSIVE_EXCLUSIVE
Spans of type SPAN_EXCLUSIVE_EXCLUSIVE do not expand to include text inserted at either their starting or ending point.
|
static int |
SPAN_EXCLUSIVE_INCLUSIVE
Non-0-length spans of type SPAN_EXCLUSIVE_INCLUSIVE expand to include text inserted at their ending point but not at their starting point.
|
static int |
SPAN_INCLUSIVE_EXCLUSIVE
Non-0-length spans of type SPAN_INCLUSIVE_EXCLUSIVE expand to include text inserted at their starting point but not at their ending point.
|
static int |
SPAN_INCLUSIVE_INCLUSIVE
Spans of type SPAN_INCLUSIVE_INCLUSIVE expand to include text inserted at either their starting or ending point.
|
static int |
TYPE_BOLD
BoldSpan
|
static int |
TYPE_FONT_NAME
FontNameSpan
|
static int |
TYPE_FONT_SIZE
FontSizeSpan
|
static int |
TYPE_FOREGROUND_COLOR
ForegroundColorSpan
|
static int |
TYPE_HYPER_TEXT
HyperTextSpan
|
static int |
TYPE_ITALIC
ItalicSpan
|
static int |
TYPE_NONE
The default type for span.
|
static int |
TYPE_UNDERLINE
UnderlineSpan
|
| Modifier and Type | Method and Description |
|---|---|
int |
getEnd()
Return the end of the range of text to which the specified markup object is attached.
|
int |
getExpansion()
Return the expansion type.
|
int |
getStart()
Return the beginning of the range of text to which the specified markup object is attached.
|
int |
getType()
Return the span type.
The default type is TYPE_NONE |
void |
setExpansion(int type)
Sets the expansion type of span.
|
void |
setPosition(int startPosition,
int endPosition)
Sets the start character position and end character position of Span.
|
public static final int TYPE_NONE
SpenTextSpanBase(int),
SpenTextSpanBase(int, int, int, int),
Constant Field Valuespublic static final int TYPE_FOREGROUND_COLOR
SpenForegroundColorSpan,
SpenTextSpanBase(int),
SpenTextSpanBase(int, int, int, int),
Constant Field Valuespublic static final int TYPE_FONT_SIZE
SpenFontSizeSpan,
SpenTextSpanBase(int),
SpenTextSpanBase(int, int, int, int),
Constant Field Valuespublic static final int TYPE_FONT_NAME
SpenFontNameSpan,
SpenTextSpanBase(int),
SpenTextSpanBase(int, int, int, int),
Constant Field Valuespublic static final int TYPE_BOLD
SpenBoldSpan,
SpenTextSpanBase(int),
SpenTextSpanBase(int, int, int, int),
Constant Field Valuespublic static final int TYPE_ITALIC
SpenItalicSpan,
SpenTextSpanBase(int),
SpenTextSpanBase(int, int, int, int),
Constant Field Valuespublic static final int TYPE_UNDERLINE
SpenUnderlineSpan,
SpenTextSpanBase(int),
SpenTextSpanBase(int, int, int, int),
Constant Field Valuespublic static final int TYPE_HYPER_TEXT
SpenHyperTextSpan,
SpenTextSpanBase(int),
SpenTextSpanBase(int, int, int, int),
Constant Field Valuespublic static final int SPAN_INCLUSIVE_EXCLUSIVE
setExpansion(int),
getExpansion(),
Constant Field Valuespublic static final int SPAN_INCLUSIVE_INCLUSIVE
setExpansion(int),
getExpansion(),
Constant Field Valuespublic static final int SPAN_EXCLUSIVE_EXCLUSIVE
setExpansion(int),
getExpansion(),
Constant Field Valuespublic static final int SPAN_EXCLUSIVE_INCLUSIVE
setExpansion(int),
getExpansion(),
Constant Field Valuespublic int getType()
TYPE_NONETYPE_NONE,
TYPE_BOLD,
TYPE_FONT_NAME,
TYPE_FONT_SIZE,
TYPE_FOREGROUND_COLOR,
TYPE_HYPER_TEXT,
TYPE_ITALIC,
TYPE_UNDERLINEpublic void setPosition(int startPosition,
int endPosition)
startPosition - start position. The position should not be negative number. The negative number will be ignored.endPosition - end position. The position should not be negative number. The negative number will be ignored.IndexOutOfBoundsException - If the startPosition is lager than endPosition.getStart(),
getEnd()public int getStart()
public int getEnd()
public void setExpansion(int type)
type - expansion type.IndexOutOfBoundsException - If the type is negative or lager than the 3.getExpansion(),
SPAN_EXCLUSIVE_EXCLUSIVE,
SPAN_EXCLUSIVE_INCLUSIVE,
SPAN_INCLUSIVE_EXCLUSIVE,
SPAN_INCLUSIVE_INCLUSIVEpublic int getExpansion()
SPAN_EXCLUSIVE_EXCLUSIVE,
SPAN_EXCLUSIVE_INCLUSIVE,
SPAN_INCLUSIVE_EXCLUSIVE,
SPAN_INCLUSIVE_INCLUSIVE