Package org.fife.ui.rtextarea
Class RTextAreaEditorKit
- java.lang.Object
-
- javax.swing.text.EditorKit
-
- javax.swing.text.DefaultEditorKit
-
- org.fife.ui.rtextarea.RTextAreaEditorKit
-
- All Implemented Interfaces:
Serializable,Cloneable
- Direct Known Subclasses:
RSyntaxTextAreaEditorKit
public class RTextAreaEditorKit extends DefaultEditorKit
An extension ofDefaultEditorKitthat adds functionality found inRTextArea.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRTextAreaEditorKit.BeepActionCreates a beep.static classRTextAreaEditorKit.BeginActionMoves the caret to the beginning of the document.static classRTextAreaEditorKit.BeginLineActionToggles the position of the caret between the beginning of the line, and the first non-whitespace character on the line.static classRTextAreaEditorKit.BeginRecordingMacroActionAction that begins recording a macro.protected static classRTextAreaEditorKit.BeginWordActionPositions the caret at the beginning of the word.static classRTextAreaEditorKit.ClipboardHistoryActionAction for displaying a popup with a list of recently pasted text snippets.static classRTextAreaEditorKit.CopyActionAction for copying text.static classRTextAreaEditorKit.CutActionAction for cutting text.static classRTextAreaEditorKit.DecreaseFontSizeActionAction for decreasing the font size.static classRTextAreaEditorKit.DefaultKeyTypedActionThe action to use when no actions in the input/action map meet the key pressed.static classRTextAreaEditorKit.DeleteLineActionDeletes the current line(s).static classRTextAreaEditorKit.DeleteNextCharActionDeletes the character of content that follows the current caret position.static classRTextAreaEditorKit.DeletePrevCharActionDeletes the character of content that precedes the current caret position.static classRTextAreaEditorKit.DeletePrevWordActionAction that deletes the previous word in the text area.static classRTextAreaEditorKit.DeleteRestOfLineActionAction that deletes all text from the caret position to the end of the caret's line.static classRTextAreaEditorKit.DumbCompleteWordActionFinds the most recent word in the document that matches the "word" up to the current caret position, and auto-completes the rest.static classRTextAreaEditorKit.EndActionMoves the caret to the end of the document.static classRTextAreaEditorKit.EndLineActionPositions the caret at the end of the line.static classRTextAreaEditorKit.EndRecordingMacroActionAction that ends recording a macro.protected static classRTextAreaEditorKit.EndWordActionPositions the caret at the end of the word.static classRTextAreaEditorKit.IncreaseFontSizeActionAction for increasing the font size.static classRTextAreaEditorKit.InsertBreakActionAction for when the user presses the Enter key.static classRTextAreaEditorKit.InsertContentActionAction taken when content is to be inserted.static classRTextAreaEditorKit.InsertTabActionPlaces a tab character into the document.static classRTextAreaEditorKit.InvertSelectionCaseActionAction to invert the selection's case.static classRTextAreaEditorKit.JoinLinesActionAction to join the current line and the following line.static classRTextAreaEditorKit.LineMoveActionAction that moves a line up or down.static classRTextAreaEditorKit.LowerSelectionCaseActionAction to make the selection lower-case.static classRTextAreaEditorKit.NextBookmarkActionAction that moves the caret to the next (or previous) bookmark.static classRTextAreaEditorKit.NextOccurrenceActionSelects the next occurrence of the text last selected.static classRTextAreaEditorKit.NextVisualPositionActionAction to move the selection and/or caret.static classRTextAreaEditorKit.NextWordActionPositions the caret at the next word.static classRTextAreaEditorKit.PasteActionAction for pasting text.static classRTextAreaEditorKit.PlaybackLastMacroAction"Plays back" the last macro recorded.static classRTextAreaEditorKit.PreviousOccurrenceActionSelect the previous occurrence of the text last selected.static classRTextAreaEditorKit.PreviousWordActionPositions the caret at the beginning of the previous word.static classRTextAreaEditorKit.RedoActionRe-does the last action undone.static classRTextAreaEditorKit.ScrollActionScrolls the text area one line up or down, without changing the caret position.static classRTextAreaEditorKit.SelectAllActionSelects the entire document.static classRTextAreaEditorKit.SelectLineActionSelects the line around the caret.static classRTextAreaEditorKit.SelectWordActionSelects the word around the caret.static classRTextAreaEditorKit.SetReadOnlyActionPuts the text area into read-only mode.static classRTextAreaEditorKit.SetWritableActionPuts the text area into writable (from read-only) mode.static classRTextAreaEditorKit.TimeDateActionThe action for inserting a time/date stamp.static classRTextAreaEditorKit.ToggleBookmarkActionToggles whether the current line has a bookmark.static classRTextAreaEditorKit.ToggleTextModeActionThe action for the insert key toggling insert/overwrite modes.static classRTextAreaEditorKit.UndoActionUndoes the last action done.static classRTextAreaEditorKit.UnselectActionRemoves the selection, if any.static classRTextAreaEditorKit.UpperSelectionCaseActionAction to make the selection upper-case.static classRTextAreaEditorKit.VerticalPageActionScrolls up/down vertically.
-
Field Summary
Fields Modifier and Type Field Description static StringclipboardHistoryActionAction to display the paste history popup.static StringrtaBeginRecordingMacroActionThe name of the action that begins recording a macro.static StringrtaDecreaseFontSizeActionThe name of the action to decrease the font size.static StringrtaDeleteLineActionThe name of the action that deletes the current line.static StringrtaDeletePrevWordActionThe name of the action to delete the word before the caret.static StringrtaDeleteRestOfLineActionThe name of the action taken to delete the remainder of the line (from the caret position to the end of the line).static StringrtaDumbCompleteWordActionThe name of the action that completes the word at the caret position with the last word in the document that starts with the text up to the caret.static StringrtaEndRecordingMacroActionThe name of the action that ends recording a macro.static StringrtaIncreaseFontSizeActionThe name of the action to increase the font size.static StringrtaInvertSelectionCaseActionThe name of the action that inverts the case of the current selection.static StringrtaJoinLinesActionThe name of the action to join two lines.static StringrtaLineDownActionAction to move a line down.static StringrtaLineUpActionAction to move a line up.static StringrtaLowerSelectionCaseActionThe name of the action to make the current selection lower-case.static StringrtaNextBookmarkActionAction to jump to the next bookmark.static StringrtaNextOccurrenceActionAction to select the next occurrence of the selected text.static StringrtaPlaybackLastMacroActionThe name of the action that "plays back" the last macro.static StringrtaPrevBookmarkActionAction to jump to the previous bookmark.static StringrtaPrevOccurrenceActionAction to select the previous occurrence of the selected text.static StringrtaRedoActionThe name of the action for "redoing" the last action undone.static StringrtaScrollDownActionThe name of the action to scroll the text area down one line without changing the caret's position.static StringrtaScrollUpActionThe name of the action to scroll the text area up one line without changing the caret's position.static StringrtaSelectionPageDownActionThe name of the action for "paging down" with the selection.static StringrtaSelectionPageLeftActionThe name of the action for "paging left" with the selection.static StringrtaSelectionPageRightActionThe name of the action for "paging right" with the selection.static StringrtaSelectionPageUpActionThe name of the action for "paging up" with the selection.static StringrtaTimeDateActionThe name of the action for inserting a time/date stamp.static StringrtaToggleBookmarkActionToggles whether the current line has a bookmark, if this text area is in anRTextScrollPane.static StringrtaToggleTextModeActionThe name of the action taken when the user hits the Insert key (thus toggling between insert and overwrite modes).static StringrtaUndoActionThe name of the action for "undoing" the last action done.static StringrtaUnselectActionThe name of the action for unselecting any selected text in the text area.static StringrtaUpperSelectionCaseActionThe name of the action for making the current selection upper-case.-
Fields inherited from class javax.swing.text.DefaultEditorKit
backwardAction, beepAction, beginAction, beginLineAction, beginParagraphAction, beginWordAction, copyAction, cutAction, defaultKeyTypedAction, deleteNextCharAction, deleteNextWordAction, deletePrevCharAction, deletePrevWordAction, downAction, endAction, endLineAction, EndOfLineStringProperty, endParagraphAction, endWordAction, forwardAction, insertBreakAction, insertContentAction, insertTabAction, nextWordAction, pageDownAction, pageUpAction, pasteAction, previousWordAction, readOnlyAction, selectAllAction, selectionBackwardAction, selectionBeginAction, selectionBeginLineAction, selectionBeginParagraphAction, selectionBeginWordAction, selectionDownAction, selectionEndAction, selectionEndLineAction, selectionEndParagraphAction, selectionEndWordAction, selectionForwardAction, selectionNextWordAction, selectionPreviousWordAction, selectionUpAction, selectLineAction, selectParagraphAction, selectWordAction, upAction, writableAction
-
-
Constructor Summary
Constructors Constructor Description RTextAreaEditorKit()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IconRowHeadercreateIconRowHeader(RTextArea textArea)Creates an icon row header to use in the gutter for a text area.LineNumberListcreateLineNumberList(RTextArea textArea)Creates a line number list to use in the gutter for a text area.Action[]getActions()Fetches the set of commands that can be used on a text component that is using a model and view produced by this kit.voidread(Reader in, Document doc, int pos)Inserts content from the given stream, which will be treated as plain text.-
Methods inherited from class javax.swing.text.DefaultEditorKit
createCaret, createDefaultDocument, getContentType, getViewFactory, read, write, write
-
-
-
-
Field Detail
-
rtaBeginRecordingMacroAction
public static final String rtaBeginRecordingMacroAction
The name of the action that begins recording a macro.- See Also:
- Constant Field Values
-
rtaDecreaseFontSizeAction
public static final String rtaDecreaseFontSizeAction
The name of the action to decrease the font size.- See Also:
- Constant Field Values
-
rtaDeleteLineAction
public static final String rtaDeleteLineAction
The name of the action that deletes the current line.- See Also:
- Constant Field Values
-
rtaDeletePrevWordAction
public static final String rtaDeletePrevWordAction
The name of the action to delete the word before the caret.- See Also:
- Constant Field Values
-
rtaDeleteRestOfLineAction
public static final String rtaDeleteRestOfLineAction
The name of the action taken to delete the remainder of the line (from the caret position to the end of the line).- See Also:
- Constant Field Values
-
rtaDumbCompleteWordAction
public static final String rtaDumbCompleteWordAction
The name of the action that completes the word at the caret position with the last word in the document that starts with the text up to the caret.- See Also:
- Constant Field Values
-
rtaEndRecordingMacroAction
public static final String rtaEndRecordingMacroAction
The name of the action that ends recording a macro.- See Also:
- Constant Field Values
-
rtaIncreaseFontSizeAction
public static final String rtaIncreaseFontSizeAction
The name of the action to increase the font size.- See Also:
- Constant Field Values
-
rtaInvertSelectionCaseAction
public static final String rtaInvertSelectionCaseAction
The name of the action that inverts the case of the current selection.- See Also:
- Constant Field Values
-
rtaJoinLinesAction
public static final String rtaJoinLinesAction
The name of the action to join two lines.- See Also:
- Constant Field Values
-
rtaLineDownAction
public static final String rtaLineDownAction
Action to move a line down.- See Also:
- Constant Field Values
-
rtaLineUpAction
public static final String rtaLineUpAction
Action to move a line up.- See Also:
- Constant Field Values
-
rtaLowerSelectionCaseAction
public static final String rtaLowerSelectionCaseAction
The name of the action to make the current selection lower-case.- See Also:
- Constant Field Values
-
rtaNextOccurrenceAction
public static final String rtaNextOccurrenceAction
Action to select the next occurrence of the selected text.- See Also:
- Constant Field Values
-
rtaPrevOccurrenceAction
public static final String rtaPrevOccurrenceAction
Action to select the previous occurrence of the selected text.- See Also:
- Constant Field Values
-
rtaNextBookmarkAction
public static final String rtaNextBookmarkAction
Action to jump to the next bookmark.- See Also:
- Constant Field Values
-
clipboardHistoryAction
public static final String clipboardHistoryAction
Action to display the paste history popup.- See Also:
- Constant Field Values
-
rtaPrevBookmarkAction
public static final String rtaPrevBookmarkAction
Action to jump to the previous bookmark.- See Also:
- Constant Field Values
-
rtaPlaybackLastMacroAction
public static final String rtaPlaybackLastMacroAction
The name of the action that "plays back" the last macro.- See Also:
- Constant Field Values
-
rtaRedoAction
public static final String rtaRedoAction
The name of the action for "redoing" the last action undone.- See Also:
- Constant Field Values
-
rtaScrollDownAction
public static final String rtaScrollDownAction
The name of the action to scroll the text area down one line without changing the caret's position.- See Also:
- Constant Field Values
-
rtaScrollUpAction
public static final String rtaScrollUpAction
The name of the action to scroll the text area up one line without changing the caret's position.- See Also:
- Constant Field Values
-
rtaSelectionPageUpAction
public static final String rtaSelectionPageUpAction
The name of the action for "paging up" with the selection.- See Also:
- Constant Field Values
-
rtaSelectionPageDownAction
public static final String rtaSelectionPageDownAction
The name of the action for "paging down" with the selection.- See Also:
- Constant Field Values
-
rtaSelectionPageLeftAction
public static final String rtaSelectionPageLeftAction
The name of the action for "paging left" with the selection.- See Also:
- Constant Field Values
-
rtaSelectionPageRightAction
public static final String rtaSelectionPageRightAction
The name of the action for "paging right" with the selection.- See Also:
- Constant Field Values
-
rtaTimeDateAction
public static final String rtaTimeDateAction
The name of the action for inserting a time/date stamp.- See Also:
- Constant Field Values
-
rtaToggleBookmarkAction
public static final String rtaToggleBookmarkAction
Toggles whether the current line has a bookmark, if this text area is in anRTextScrollPane.- See Also:
- Constant Field Values
-
rtaToggleTextModeAction
public static final String rtaToggleTextModeAction
The name of the action taken when the user hits the Insert key (thus toggling between insert and overwrite modes).- See Also:
- Constant Field Values
-
rtaUndoAction
public static final String rtaUndoAction
The name of the action for "undoing" the last action done.- See Also:
- Constant Field Values
-
rtaUnselectAction
public static final String rtaUnselectAction
The name of the action for unselecting any selected text in the text area.- See Also:
- Constant Field Values
-
rtaUpperSelectionCaseAction
public static final String rtaUpperSelectionCaseAction
The name of the action for making the current selection upper-case.- See Also:
- Constant Field Values
-
-
Method Detail
-
createIconRowHeader
public IconRowHeader createIconRowHeader(RTextArea textArea)
Creates an icon row header to use in the gutter for a text area.- Parameters:
textArea- The text area.- Returns:
- The icon row header.
-
createLineNumberList
public LineNumberList createLineNumberList(RTextArea textArea)
Creates a line number list to use in the gutter for a text area.- Parameters:
textArea- The text area.- Returns:
- The line number list.
-
getActions
public Action[] getActions()
Fetches the set of commands that can be used on a text component that is using a model and view produced by this kit.- Overrides:
getActionsin classDefaultEditorKit- Returns:
- the command list
-
read
public void read(Reader in, Document doc, int pos) throws IOException, BadLocationException
Inserts content from the given stream, which will be treated as plain text. This method is overridden merely so we can increase the number of characters read at a time.- Overrides:
readin classDefaultEditorKit- Parameters:
in- The stream to read fromdoc- The destination for the insertion.pos- The location in the document to place the content >= 0.- Throws:
IOException- on any I/O errorBadLocationException- if pos represents an invalid location within the document.
-
-