|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcreamtec.core.FormattedStringBuffer
public class FormattedStringBuffer
Provides implementation for a buffer of characters, that are stored in a formatted way. Formatting includes new lines, indent and some HTML specific functionality
Constructor Summary | |
---|---|
FormattedStringBuffer()
Initializes the buffer with the default buffer size of 4000 characters |
|
FormattedStringBuffer(FormattedStringBuffer buffer)
Initializes the buffer with the default buffer size and sets indent to be the same as in the given buffer |
|
FormattedStringBuffer(int bufferSize)
Initializes the buffer with the given buffer size |
|
FormattedStringBuffer(java.lang.String value)
Initializes the buffer with the given string |
Method Summary | |
---|---|
void |
append(char ch)
Appends the given character to the buffer |
void |
append(FormattedStringBuffer buf)
|
void |
append(int ch)
|
void |
append(java.lang.String s)
Appends the given string to the buffer |
void |
append(java.lang.StringBuffer buf)
|
void |
appendHTMLText(java.lang.String htmlText,
boolean noBreak)
|
void |
appendHTMLText(java.lang.String htmlText,
boolean noBreak,
boolean ignoreAllTags)
Appends given HTML text to the buffer. |
void |
appendln(java.lang.String s)
Appends the given string to the buffer and terminates the line |
void |
appendText(java.lang.String text)
Appends the given text as non-breakable spaced text (for HTML inserts spaces as  ). |
void |
appendText(java.lang.String text,
boolean noBreak)
|
void |
appendText(java.lang.String text,
boolean noBreak,
boolean ignoreAllHTMLTags)
|
void |
appendText(java.lang.String text,
boolean noBreak,
boolean ignoreAllHTMLTags,
boolean javaScript)
Appends the given text as HTML-ready text. |
void |
clear()
Resets the buffer by deleting the entire contents and setting indent to 0 |
void |
decreaseIndent()
Decreases the indent in the buffer |
void |
delete(int start,
int end)
Deletes characters int the buffer between start and end |
java.lang.StringBuffer |
getBuffer()
|
int |
getIndent()
Returns the indent in the buffer |
int |
getNoBreakFlag()
|
void |
increaseIndent()
Increases the indent in the buffer |
void |
insert(int position,
java.lang.String string)
Inserts the given text at the absolute position |
void |
insertMarked(java.lang.String string)
Inserts the given text into the buffer at the marked position. |
int |
length()
Returns the current size of the buffer in characters |
void |
markPosition()
Stores the current position to be reused later by insertMarked |
void |
newLine()
Ensure that next text appended will be written on the new line Does not actually insert a new line character (use appendln("") instead |
void |
setIndent(int indent)
Sets the indent in the buffer to the absolute value |
void |
setNoBreak(boolean noBreak)
Marks beginning/end of unbreakable text using <nobr> tag |
void |
setNoBreakFlag(boolean noBreak)
Will not append tags, just manipulate the flag |
boolean |
shouldIgnoreTag(java.lang.String tag)
Returns true if the tag should be skipped |
java.lang.String |
toString()
Returns the buffer as a string |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FormattedStringBuffer()
public FormattedStringBuffer(FormattedStringBuffer buffer)
public FormattedStringBuffer(int bufferSize)
public FormattedStringBuffer(java.lang.String value)
Method Detail |
---|
public void appendln(java.lang.String s)
public void newLine()
public void append(java.lang.String s)
public void append(char ch)
public void append(java.lang.StringBuffer buf)
public void append(FormattedStringBuffer buf)
public void append(int ch)
public void appendText(java.lang.String text)
public void appendText(java.lang.String text, boolean noBreak)
public void appendText(java.lang.String text, boolean noBreak, boolean ignoreAllHTMLTags)
public void appendText(java.lang.String text, boolean noBreak, boolean ignoreAllHTMLTags, boolean javaScript)
noBreak
- if true, <nobr></nobr> is addedignoreAllHTMLTags
- if true, all HTML tags will be clipped out from the stringjavaScript
- if true, the text is prepared for JavaScript body (\ are replaced with \\ etc.)public void appendHTMLText(java.lang.String htmlText, boolean noBreak)
public void appendHTMLText(java.lang.String htmlText, boolean noBreak, boolean ignoreAllTags)
public boolean shouldIgnoreTag(java.lang.String tag)
public void increaseIndent()
public void decreaseIndent()
public int getIndent()
public void setIndent(int indent)
public void setNoBreak(boolean noBreak)
public void setNoBreakFlag(boolean noBreak)
public int getNoBreakFlag()
public void markPosition()
public void insertMarked(java.lang.String string)
public void insert(int position, java.lang.String string)
public int length()
public void delete(int start, int end)
public void clear()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.StringBuffer getBuffer()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |