public class SpenTextSpan extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
DATETIME_TYPE_ENGLISH_DATE
The English date type
|
static int |
DATETIME_TYPE_ENGLISH_DATE_TIME
The English date/time type
|
static int |
DATETIME_TYPE_ENGLISH_KEYWORD_DATE
The English keyword date type
|
static int |
DATETIME_TYPE_ENGLISH_KEYWORD_TIME
The English keyword time type
|
static int |
DATETIME_TYPE_ENGLISH_TIME
The English time type
|
static int |
DATETIME_TYPE_ENGLISH_TIME_DATE
The English time/date type
|
static int |
DATETIME_TYPE_KOREAN_DATE
The Korean date type
|
static int |
DATETIME_TYPE_KOREAN_DATE_TIME
The Korean date/time type
|
static int |
DATETIME_TYPE_KOREAN_KEYWORD_DATE
The Korean keyword date type
|
static int |
DATETIME_TYPE_KOREAN_KEYWORD_TIME
The Korean keyword time type
|
static int |
DATETIME_TYPE_KOREAN_TIME
The Korean time type
|
static int |
DATETIME_TYPE_KOREAN_TIME_DATE
The Korean time/date type
|
static int |
DATETIME_TYPE_NONE
The default type for date/time hyper text.
|
static int |
DATETIME_TYPE_STANDARD_DATE
The standard date type
|
static int |
DATETIME_TYPE_STANDARD_DATE_TIME
The standard date/time type
|
static int |
DATETIME_TYPE_STANDARD_TIME
The standard time type
|
static int |
DATETIME_TYPE_STANDARD_TIME_DATE
The standard time/date type
|
static int |
DATETIME_TYPE_WESTERN_DATE
The Western date type
|
static int |
DATETIME_TYPE_WESTERN_DATE_TIME
The Western date/time type
|
static int |
DATETIME_TYPE_WESTERN_KEYWORD_DATE
The Western keyword date type
|
static int |
DATETIME_TYPE_WESTERN_KEYWORD_TIME
The Western keyword time type
|
static int |
DATETIME_TYPE_WESTERN_TIME_DATE
The Western time/date type
|
static int |
HYPERTEXT_TYPE_ADDRESS
The Address type.
|
static int |
HYPERTEXT_TYPE_DATETIME
The date/time type.
|
static int |
HYPERTEXT_TYPE_EMAIL
The E-mail type.
|
static int |
HYPERTEXT_TYPE_NONE
The default type for hypertext.
|
static int |
HYPERTEXT_TYPE_PHONE
The Phone number type.
|
static int |
HYPERTEXT_TYPE_URL
The URL type.
|
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_BACKGROUND_COLOR
Background color
|
static int |
TYPE_BOLD
Bold Span
|
static int |
TYPE_COMPOSING
On Composing
|
static int |
TYPE_FOREGROUND_COLOR
Foreground Color span
|
static int |
TYPE_HYPERTEXT
HyperText Span
|
static int |
TYPE_ITALIC
Italic Span
|
static int |
TYPE_NONE
The default type for span.
|
static int |
TYPE_UNDERLINE
Underline Span
|
| Constructor and Description |
|---|
SpenTextSpan(int type)
Creates an SpenTextSpan instance with the span properties.
|
SpenTextSpan(int type,
int startPosition,
int endPosition,
int expansionType)
Creates an SpenTextSpan instance with the span properties.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getBackgroundColor()
Get the background color.
|
int |
getDateTimeType()
Return the date/time type.
|
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 |
getForegroundColor()
Get the text color.
|
int |
getHypertextType()
Return the hyper text 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 |
boolean |
isPropertyEnabled()
Return the property enabled.
|
void |
setBackgroundColor(int color)
Set the background color.
|
void |
setDateTimeType(int type)
Set the date/time type.
|
void |
setExpansion(int type)
Sets the expansion type of span.
|
void |
setForegroundColor(int color)
Set the text color.
|
void |
setHypertextType(int type)
Sets the hypertext type.
|
void |
setPosition(int startPosition,
int endPosition)
Sets the start character position and end character position of Span.
|
void |
setProrpertyEnabled(boolean enable)
Enable the span property.
|
public static final int TYPE_NONE
public static final int TYPE_BOLD
public static final int TYPE_ITALIC
public static final int TYPE_UNDERLINE
public static final int TYPE_FOREGROUND_COLOR
public static final int TYPE_HYPERTEXT
public static final int TYPE_BACKGROUND_COLOR
public static final int TYPE_COMPOSING
public 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 static final int HYPERTEXT_TYPE_NONE
public static final int HYPERTEXT_TYPE_URL
public static final int HYPERTEXT_TYPE_EMAIL
public static final int HYPERTEXT_TYPE_PHONE
public static final int HYPERTEXT_TYPE_ADDRESS
public static final int HYPERTEXT_TYPE_DATETIME
public static final int DATETIME_TYPE_NONE
public static final int DATETIME_TYPE_STANDARD_DATE
public static final int DATETIME_TYPE_STANDARD_TIME
public static final int DATETIME_TYPE_STANDARD_DATE_TIME
public static final int DATETIME_TYPE_STANDARD_TIME_DATE
public static final int DATETIME_TYPE_ENGLISH_DATE
public static final int DATETIME_TYPE_ENGLISH_TIME
public static final int DATETIME_TYPE_ENGLISH_DATE_TIME
public static final int DATETIME_TYPE_ENGLISH_TIME_DATE
public static final int DATETIME_TYPE_ENGLISH_KEYWORD_DATE
public static final int DATETIME_TYPE_ENGLISH_KEYWORD_TIME
public static final int DATETIME_TYPE_KOREAN_DATE
public static final int DATETIME_TYPE_KOREAN_TIME
public static final int DATETIME_TYPE_KOREAN_DATE_TIME
public static final int DATETIME_TYPE_KOREAN_TIME_DATE
public static final int DATETIME_TYPE_KOREAN_KEYWORD_DATE
public static final int DATETIME_TYPE_KOREAN_KEYWORD_TIME
public static final int DATETIME_TYPE_WESTERN_DATE
public static final int DATETIME_TYPE_WESTERN_DATE_TIME
public static final int DATETIME_TYPE_WESTERN_TIME_DATE
public static final int DATETIME_TYPE_WESTERN_KEYWORD_DATE
public static final int DATETIME_TYPE_WESTERN_KEYWORD_TIME
public SpenTextSpan(int type)
type - The span type. Can't create the NONE type span.IndexOutOfBoundsException - If the type is negative or lager than TYPE_HYPERTEXT.public SpenTextSpan(int type,
int startPosition,
int endPosition,
int expansionType)
type - The span type. Can't create the NONE type span.startPosition - The start position of span. The position should not be negative number. The negative number will be ignored.endPosition - The end position of span. The position should not be negative number. The negative number will be ignored.expansionType - The expansion type of span.IndexOutOfBoundsException - If the endPosition is smaller than the startPosition.
If the expansionType is negative or lager than the SpenTextSpan.SPAN_EXCLUSIVE_INCLUSIVE.
If the type is negative or lager than TYPE_HYPERTEXT.public int getType()
TYPE_NONETYPE_NONE,
TYPE_BOLD,
TYPE_FONT_SIZE,
TYPE_FOREGROUND_COLOR,
TYPE_HYPERTEXT,
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_INCLUSIVEpublic void setForegroundColor(int color)
color - The text color.getForegroundColor()public int getForegroundColor()
setForegroundColor(int)public void setHypertextType(int type)
type - The hyperText type.IndexOutOfBoundsException - If the type is negative or lager than the SpenTextSpan.HYPERTEXT_TYPE_DATETIME.getHypertextType()public int getHypertextType()
HYPERTEXT_TYPE_NONE,
HYPERTEXT_TYPE_ADDRESS,
HYPERTEXT_TYPE_DATETIME,
HYPERTEXT_TYPE_EMAIL,
HYPERTEXT_TYPE_PHONE,
HYPERTEXT_TYPE_URLpublic void setDateTimeType(int type)
type - The date/time type.IndexOutOfBoundsException - If the type is negative or lager than the SpenTextSpan.DATETIME_TYPE_WESTERN_KEYWORD_TIME.getDateTimeType()public int getDateTimeType()
DATETIME_TYPE_ENGLISH_DATEpublic void setProrpertyEnabled(boolean enable)
enable - Tenable.public boolean isPropertyEnabled()
public void setBackgroundColor(int color)
color - The background color.getBackgroundColor()public int getBackgroundColor()
setBackgroundColor(int)