Method Summary |
|
public void | addListener(TextPanelListener listener) Add the given TextPanelListener to the listeners which will
receive update notifications from this TextPanel. |
public void | append(MConstText newText) Append the given text to the end of the document. |
public boolean | canRedo() Return true if there is a change which can be redone. |
public boolean | canUndo() Return true if there is a change which can be undone. |
public void | clear() Remove selected text from the document, without altering the clipboard. |
public void | clearCommandLog() Remove all commands from the command log. |
public boolean | clipboardNotEmpty() Return true if the clipboard contains contents which could be
transfered into the text. |
public void | copy() Place the selected text on the clipboard. |
public void | cut() Remove the selected text from the document and place it
on the clipboard. |
public Object | getCharacterStyleOverSelection(Object key) This method inspects the character style runs in the selection
range (or the typing style at the insertion point) and returns:
- The value of key, if the value of key
is the same in all of the style runs in the selection, or
- null, if two or more style runs have different values for key.
If a style run does not contain key,
its value is considered to be defaultStyle. |
public int | getCommandLogSize() Return the number of commands the command log can hold. |
static TextPanelSettings | getDefaultSettings() |
public AttributeMap | getDefaultValues() Return an AttributeMap of keys with default values. |
public int | getFormatWidth() Return the total format width, in pixels. |
public KeyRemap | getKeyRemap() Return the KeyRemap used to process key events. |
public Object | getParagraphStyleOverSelection(Object key) This method inspects the paragraph style runs in the selection
range (or the typing style at the insertion point) and returns:
- The value of key, if the value of key
is the same in all of the style runs in the selection, or
- null, if two or more style runs have different values for key.
If a style run does not contain key,
its value is considered to be defaultStyle. |
public int | getSelectionEnd() Return the offset of the end of the selection. |
public int | getSelectionStart() Return the offset of the start of the selection. |
public MConstText | getText() Return the text document in the TextPanel. |
FakeComponent | getTextComponent() |
public int | getTextLength() Return the length of the text document in the TextPanel. |
void | handleKeyEvent(java.awt.event.KeyEvent keyEvent) |
public void | insert(MConstText newText, int position) Insert the given text into the document at the given position. |
public boolean | isModified() Return the modification flag of the current text change. |
public void | modifyCharacterStyleOnSelection(StyleModifier modifier) Modify the character styles on the selected characters. |
public void | modifyParagraphStyleOnSelection(StyleModifier modifier) Modify the paragraph styles in paragraphs containing selected characters, or
the paragraph containing the insertion point. |
public boolean | paragraphIsLeftToRight(int offset) Return true if the paragraph at the given offset is left-to-right. |
public void | paste() Replace the currently selected text with the text on the clipboard. |
public void | redo() Redo the most recent text change. |
public void | removeListener(TextPanelListener listener) Remove the given TextPanelListener from the listeners which will
receive update notifications from this TextPanel. |
public void | replaceRange(MConstText newText, int start, int end) Replace the given range with newText. |
public void | select(int selectionStart, int selectionEnd) Set the selection range to the given range. |
public void | selectAll() Select all of the text in the document. |
public void | setCaretPosition(int position) Set the selection range to an insertion point at the given
offset. |
public void | setCommandLogSize(int size) Set the number of commands the command log can hold. |
public void | setKeyRemap(KeyRemap remap) Use the given KeyRemap to map key events to characters.
Only key
events are affected by the remap; other text entering the
control (via the clipboard, for example) is not affected
by the KeyRemap.
Do not pass null to this method to leave key
events unmapped. |
public void | setModified(boolean modified) Set the modification flag of the current text change. |
public void | setSelectionEnd(int selectionEnd) Set the end of the selection range. |
public void | setSelectionStart(int selectionStart) Set the beginning of the selection range. |
public void | setText(MConstText newText) Set the document to newText. |
public void | undo() Undo the most recent text change. |