public class SpenSDocUtil extends Object
| Constructor and Description |
|---|
SpenSDocUtil()
Create instance of SpenSDocUtil
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close instance of SpenSDocUtil
|
boolean |
divideTextContentByEnter(int start,
int end)
Divide String by enter.
|
boolean |
insertContents(ArrayList<SpenContentBase> contentList)
Insert content list at current cursor position
|
boolean |
insertContentUnit(ArrayList<SpenContentBase> contentList)
Insert content list at current cursor position
If there are many contents in content list when use insertContents(ArrayList),
this may cause ANR. |
boolean |
insertContentUnitEnd()
Insert content list at current cursor position
If there are many contents in content list when use insertContents(ArrayList),
this may cause ANR. |
boolean |
insertContentUnitNext(ArrayList<SpenContentBase> contentList)
Insert content list at current cursor position
If there are many contents in content list when use insertContents(ArrayList),
this may cause ANR. |
boolean |
removeContents(int beginIndex,
int beginPos,
int endIndex,
int endPos)
Remove the specified contents
|
boolean |
setBold(boolean enabled,
int beginIndex,
int beginPos,
int endIndex,
int endPos)
Set the bold type.
|
void |
setDocument(SpenSDoc doc)
Set a SDoc document to use
This API must called before use SpenSDocUtil APIs. |
boolean |
setItalic(boolean enabled,
int beginIndex,
int beginPos,
int endIndex,
int endPos)
Set the italic type.
|
boolean |
setTaskStyle(int taskStyle)
Set the specified task style at current cursor.
|
boolean |
setTextColor(int color,
int beginIndex,
int beginPos,
int endIndex,
int endPos)
Set the specified text color.
|
boolean |
setUnderline(boolean enabled,
int beginIndex,
int beginPos,
int endIndex,
int endPos)
Set the underline type.
|
public void close()
public void setDocument(SpenSDoc doc)
doc - IllegalArgumentException - Thrown if doc is null.public boolean insertContents(ArrayList<SpenContentBase> contentList)
contentList - The SpenContentBase list.#insertContentUnitNext(ArrayList)},
#insertContentUnitEnd()}public boolean insertContentUnit(ArrayList<SpenContentBase> contentList)
insertContents(ArrayList),
this may cause ANR. To avoiding ANR, you can use insertContentUnit(ArrayList),
insertContentUnitNext(ArrayList), insertContentUnitEnd() APIs.
These three APIs are sub API of insertContents(ArrayList).
insertContentUnit(ArrayList) must execute first time once.insertContentUnitNext(ArrayList) can execute several times.@since 5.0.0
insertContentUnitEnd() must execute last time once.contentList - The SpenContentBase list.#insertContentUnitNext(ArrayList)},
#insertContentUnitEnd()}public boolean insertContentUnitNext(ArrayList<SpenContentBase> contentList)
insertContents(ArrayList),
this may cause ANR. To avoiding ANR, you can use insertContentUnit(ArrayList),
insertContentUnitNext(ArrayList), insertContentUnitEnd() APIs.
These three APIs are sub API of insertContents(ArrayList).
insertContentUnit(ArrayList) must execute first time once.insertContentUnitNext(ArrayList) can execute several times.@since 5.0.0
insertContentUnitEnd() must execute last time once.contentList - The SpenContentBase list.#insertContentUnit(ArrayList)},
#insertContentUnitEnd()}public boolean insertContentUnitEnd()
insertContents(ArrayList),
this may cause ANR. To avoiding ANR, you can use insertContentUnit(ArrayList),
insertContentUnitNext(ArrayList), insertContentUnitEnd() APIs.
These three APIs are sub API of insertContents(ArrayList).
insertContentUnit(ArrayList) must execute first time once.insertContentUnitNext(ArrayList) can execute several times.@since 5.0.0
insertContentUnitEnd() must execute last time once.#insertContentUnit(ArrayList)},
#insertContentUnitNext(ArrayList)}public boolean removeContents(int beginIndex,
int beginPos,
int endIndex,
int endPos)
beginIndex - The index of begin content.beginPos - The begin position within the content.endIndex - The index of end content.endPos - The end position within the content.public boolean setTaskStyle(int taskStyle)
taskStyle - Specified task.public boolean setBold(boolean enabled,
int beginIndex,
int beginPos,
int endIndex,
int endPos)
enabled - enbale bold or not.beginIndex - The index of the first content for setting bold style.beginPos - The pos SpenSDoc.CursorInfo of the first content for setting bold style.endIndex - The index of the last content for setting task information.endPos - The pos SpenSDoc.CursorInfo of the last content for setting bold style.public boolean setItalic(boolean enabled,
int beginIndex,
int beginPos,
int endIndex,
int endPos)
enabled - enbale italic or not.beginIndex - The index of the first content for setting bold style.beginPos - The pos SpenSDoc.CursorInfo of the first content for setting bold style.endIndex - The index of the last content for setting task information.endPos - The pos SpenSDoc.CursorInfo of the last content for setting bold style.public boolean setUnderline(boolean enabled,
int beginIndex,
int beginPos,
int endIndex,
int endPos)
enabled - enbale underline or not.beginIndex - The index of the first content for setting bold style.beginPos - The pos SpenSDoc.CursorInfo of the first content for setting bold style.endIndex - The index of the last content for setting task information.endPos - The pos SpenSDoc.CursorInfo of the last content for setting bold style.public boolean setTextColor(int color,
int beginIndex,
int beginPos,
int endIndex,
int endPos)
color - text color.beginIndex - The index of the first content for setting bold style.beginPos - The pos SpenSDoc.CursorInfo of the first content for setting bold style.endIndex - The index of the last content for setting task information.endPos - The pos SpenSDoc.CursorInfo of the last content for setting bold style.public boolean divideTextContentByEnter(int start,
int end)
start - The start index of text that want to divide.end - The end index of text that want to divide.