|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface EditDocumentInterface
A GUI toolkit agnostic interface for a console document. The anticipated implementations are wrappers around documents generated by Swing, SWT (Eclipse), or other toolkits. This interface also provides a mechanism for restricting edits based on a conditional object, unless a separate method is called to force the edit.
Method Summary | |
---|---|
void |
append(String str,
String style)
Appends a string to this in the given named style, if the edit condition allows it. |
void |
forceInsertText(int offs,
String str,
String style)
Inserts a string into the document at the given offset and style, regardless of the edit condition. |
void |
forceRemoveText(int offs,
int len)
Removes a portion of the document, regardless of the edit condition. |
String |
getDefaultStyle()
Gets the String identifying the default style for this document if one exists; null otherwise. |
String |
getDocText(int offs,
int len)
Returns a portion of the document. |
DocumentEditCondition |
getEditCondition()
Gets the object which can determine whether an insert or remove edit should be applied, based on the inputs. |
int |
getLength()
Returns the length of the document. |
Pageable |
getPageable()
Returns the Pageable object for printing. |
void |
insertText(int offs,
String str,
String style)
Inserts a string into the document at the given offset and the given named style, if the edit condition allows it. |
void |
print()
Prints the given console document |
void |
removeText(int offs,
int len)
Removes a portion of the document, if the edit condition allows it. |
void |
setEditCondition(DocumentEditCondition condition)
Provides an object which can determine whether an insert or remove edit should be applied, based on the inputs. |
Method Detail |
---|
DocumentEditCondition getEditCondition()
void setEditCondition(DocumentEditCondition condition)
condition
- Object to determine legality of inputsvoid insertText(int offs, String str, String style)
offs
- Offset into the documentstr
- String to be insertedstyle
- Name of the style to use. Must have been added using addStyle.
EditDocumentException
- if the offset is illegalvoid forceInsertText(int offs, String str, String style)
offs
- Offset into the documentstr
- String to be insertedstyle
- Name of the style to use. Must have been
added using addStyle.
EditDocumentException
- if the offset is illegalvoid removeText(int offs, int len)
offs
- Offset to start deleting fromlen
- Number of characters to remove
EditDocumentException
- if the offset or length are illegalvoid forceRemoveText(int offs, int len)
offs
- Offset to start deleting fromlen
- Number of characters to remove
EditDocumentException
- if the offset or length are illegalint getLength()
String getDocText(int offs, int len)
offs
- First offset of the desired textlen
- Number of characters to return
EditDocumentException
- if the offset or length are illegalvoid append(String str, String style)
str
- String to be insertedstyle
- Name of the style to use. Must have been added using addStyle.
EditDocumentException
- if the offset is illegalString getDefaultStyle()
Pageable getPageable() throws IllegalStateException
IllegalStateException
void print() throws PrinterException
PrinterException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |