Method Summary |
|
protected void | _clearCurrentInputText() Removes the text from the current prompt to the end of the document. |
public void | _forceInsertText(int offs, String str, String style) Inserts a string into the document exactly like forceInsertText above except that it assumes the WriteLock
is already held. |
public void | _insertText(int offs, String str, String style) Inserts a string into the document at the given offset and named style, if the edit condition allows it., as
above. |
public void | _removeText(int offs, int len) Removes a portion of the document, if the edit condition allows it, as above. |
public void | acquireReadLock() Swing-style acquireReadLock(). |
public void | acquireWriteLock() Swing-style writeLock(). |
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 | cleanUpPrintJob() Clears the pageable object used to hold the print job. |
public void | clearCurrentInput() Clears the current input text. |
public void | disablePrompt() Disables the prompt in this document. |
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 | getCurrentInput() Returns the string that the user has entered at the current prompt. |
public String | getDefaultStyle() |
public String | getDocText(int offs, int len) Returns a portion of the document. |
public DocumentEditCondition | getEditCondition() Gets the object which determines whether an insert/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 String | getPrompt() Accessor for the string used for the prompt. |
public int | getPromptPos() Returns the first location in the document where editing is allowed. |
public String | getText() Returns the entire text of the document. |
public boolean | hasPrompt() true iff this document has a prompt and is ready to accept input. |
public void | insertBeforeLastPrompt(String text, String style) Inserts the given string with the given attributes just before the most recent prompt. |
public void | insertNewLine(int pos) Inserts a new line at the given position. |
public void | insertPrompt() Prints a prompt for a new input. |
public void | insertText(int offs, String str, String style) Inserts a string into the document at the given offset and 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 | preparePrintJob() This method tells the document to prepare all the DrJavaBook and PagePrinter objects. |
public void | print() Prints the given document by bringing up a "Print" window. |
public void | releaseReadLock() Swing-style releaseReadLock(). |
public void | releaseWriteLock() Swing-style writeUnlock(). |
public void | removeText(int offs, int len) Removes a portion of the document, if the edit condition (including promptPos) allows it. |
public void | reset(String banner) Resets the document to a clean state. |
public void | setBeep(Runnable beep) Sets a runnable action to use as a beep. |
public void | setEditCondition(DocumentEditCondition condition) Provides an object which can determine whether an insert or remove edit should be applied, based on
the inputs. |
public void | setHasPrompt(boolean val) |
public void | setPrompt(String prompt) Sets the string to use for the prompt. |
public void | setPromptPos(int newPos) Sets the prompt position. |