| edu.rice.cs.util.text.EditDocumentInterface
All known Subclasses: edu.rice.cs.util.text.SwingDocument,
EditDocumentInterface | public interface EditDocumentInterface extends ReadersWritersLocking,Serializable(Code) | | 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.
version: $Id: EditDocumentInterface.java 4255 2007-08-28 19:17:37Z mgricken $ |
Method Summary | |
public void | _forceInsertText(int offs, String str, String style) Inserts a string into "this" exactly like forceInsertText except that it assumes the WriteLock is already held. | public void | _insertText(int offs, String str, String style) Inserts a string into "this" exactly like insertText except that it assumes the WriteLock is already held. | public void | _removeText(int offs, int len) Removes a portion of the document, if the edit condition allows it, as above. | public void | append(String str, String style) Appends a string to this in the given named style, if the edit condition allows it.
Parameters: str - String to be inserted Parameters: style - Name of the style to use. | public 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.
Parameters: offs - Offset into the document Parameters: str - String to be inserted Parameters: style - Name of the style to use. | public void | forceRemoveText(int offs, int len) Removes a portion of the document, regardless of the edit condition. | public String | getDefaultStyle() Gets the String identifying the default style for this document if one exists; null otherwise. | public String | getDocText(int offs, int len) Returns a portion of the document. | public DocumentEditCondition | getEditCondition() Gets the object which can determine whether an insert or remove edit should be applied, based on the inputs. | public int | getLength() Returns the length of the document. | public Pageable | getPageable() Returns the Pageable object for printing. | public 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.
Parameters: offs - Offset into the document Parameters: str - String to be inserted Parameters: style - Name of the style to use. | public void | print() | public void | removeText(int offs, int len) Removes a portion of the document, if the edit condition allows it. | public void | setEditCondition(DocumentEditCondition condition) Provides an object which can determine whether an insert or remove edit should be applied, based on the inputs. |
_forceInsertText | public void _forceInsertText(int offs, String str, String style)(Code) | | Inserts a string into "this" exactly like forceInsertText except that it assumes the WriteLock is already held.
|
_insertText | public void _insertText(int offs, String str, String style)(Code) | | Inserts a string into "this" exactly like insertText except that it assumes the WriteLock is already held.
|
_removeText | public void _removeText(int offs, int len)(Code) | | Removes a portion of the document, if the edit condition allows it, as above. Assumes that WriteLock is held.
|
append | public void append(String str, String style)(Code) | | Appends a string to this in the given named style, if the edit condition allows it.
Parameters: str - String to be inserted Parameters: style - Name of the style to use. Must have been added using addStyle. throws: EditDocumentException - if the offset is illegal |
forceInsertText | public void forceInsertText(int offs, String str, String style)(Code) | | Inserts a string into the document at the given offset and style, regardless of the edit condition.
Parameters: offs - Offset into the document Parameters: str - String to be inserted Parameters: style - Name of the style to use. Must have beenadded using addStyle. throws: EditDocumentException - if the offset is illegal |
forceRemoveText | public void forceRemoveText(int offs, int len)(Code) | | Removes a portion of the document, regardless of the edit condition.
Parameters: offs - Offset to start deleting from Parameters: len - Number of characters to remove throws: EditDocumentException - if the offset or length are illegal |
getDefaultStyle | public String getDefaultStyle()(Code) | | Gets the String identifying the default style for this document if one exists; null otherwise.
|
getDocText | public String getDocText(int offs, int len)(Code) | | Returns a portion of the document. Differs from getText in AbstractDocumentInterface by throwing
EditDocumentException instead of BadLocationException. (Why bother? It avoids referencing a Swing class.)
Parameters: offs - First offset of the desired text Parameters: len - Number of characters to return throws: EditDocumentException - if the offset or length are illegal |
getEditCondition | public DocumentEditCondition getEditCondition()(Code) | | Gets the object which can determine whether an insert or remove edit should be applied, based on the inputs.
an Object to determine legality of inputs |
getLength | public int getLength()(Code) | | Returns the length of the document.
|
insertText | public void insertText(int offs, String str, String style)(Code) | | Inserts a string into the document at the given offset and the given named style, if the edit condition allows it.
Parameters: offs - Offset into the document Parameters: str - String to be inserted Parameters: style - Name of the style to use. Must have been added using addStyle. throws: EditDocumentException - if the offset is illegal |
removeText | public void removeText(int offs, int len)(Code) | | Removes a portion of the document, if the edit condition allows it.
Parameters: offs - Offset to start deleting from Parameters: len - Number of characters to remove throws: EditDocumentException - if the offset or length are illegal |
setEditCondition | public void setEditCondition(DocumentEditCondition condition)(Code) | | Provides an object which can determine whether an insert or remove edit should be applied, based on the inputs.
Parameters: condition - Object to determine legality of inputs |
|
|