Package org.fife.ui.rsyntaxtextarea
Class RSyntaxTextAreaEditorKit
java.lang.Object
javax.swing.text.EditorKit
javax.swing.text.DefaultEditorKit
org.fife.ui.rtextarea.RTextAreaEditorKit
org.fife.ui.rsyntaxtextarea.RSyntaxTextAreaEditorKit
- All Implemented Interfaces:
Serializable
,Cloneable
An extension of
RTextAreaEditorKit
that adds functionality for
programming-specific stuff. There are currently subclasses to handle:
- Toggling code folds.
- Aligning "closing" curly braces with their matches, if the current programming language uses curly braces to identify code blocks.
- Copying the current selection as RTF.
- Block indentation (increasing the indent of one or multiple lines)
- Block un-indentation (decreasing the indent of one or multiple lines)
- Inserting a "code template" when a configurable key (e.g. a space) is pressed
- Decreasing the point size of all fonts in the text area
- Increasing the point size of all fonts in the text area
- Moving the caret to the "matching bracket" of the one at the current caret position
- Toggling whether the currently selected lines are commented out.
- Better selection of "words" on mouse double-clicks for programming languages.
- Better keyboard navigation via Ctrl+arrow keys for programming languages.
- Version:
- 0.5
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
Positions the caret at the beginning of the word.static class
Expands or collapses the nearest fold.static class
Action that (optionally) aligns a closing curly brace with the line containing its matching opening curly brace.static class
(Optionally) completes a closing markup tag.static class
Collapses all comment folds.static class
Collapses all folds.static class
Action for copying text as styled text.static class
Action for decreasing the font size of all fonts in the text area.static class
Action for when un-indenting lines (either the current line if there is selection, or all selected lines if there is one).static class
Deletes the previous word, but differentiates symbols from "words" to match the behavior of code editors.static class
Overridden to use the programming language RSTA is displaying when computing words to complete.protected static class
Positions the caret at the end of the word.static class
Expands all folds.(package private) static class
Base class for folding-related actions.static class
Action for moving the caret to the "matching bracket" of the bracket at the caret position (either before or after).static class
Action for increasing the font size of all fonts in the text area.static class
Action for when the user presses the Enter key.static class
If there is no selection, a character is inserted.static class
Inserts a quote character.static class
Action for inserting tabs.static class
Action to move the selection and/or caret.static class
Action for when the user tries to insert a template (that is, they've typed a template ID and pressed the trigger character (a space) in an attempt to do the substitution).static class
Action to move the selection and/or caret.static class
Selects the word around the caret.static class
Action that toggles whether the currently selected lines are commented.static class
Toggles the fold at the current caret position or line.Nested classes/interfaces inherited from class org.fife.ui.rtextarea.RTextAreaEditorKit
RTextAreaEditorKit.BeepAction, RTextAreaEditorKit.BeginAction, RTextAreaEditorKit.BeginLineAction, RTextAreaEditorKit.BeginRecordingMacroAction, RTextAreaEditorKit.ClipboardHistoryAction, RTextAreaEditorKit.CopyAction, RTextAreaEditorKit.CutAction, RTextAreaEditorKit.DefaultKeyTypedAction, RTextAreaEditorKit.DeleteLineAction, RTextAreaEditorKit.DeleteNextCharAction, RTextAreaEditorKit.DeletePrevCharAction, RTextAreaEditorKit.DeleteRestOfLineAction, RTextAreaEditorKit.EndAction, RTextAreaEditorKit.EndLineAction, RTextAreaEditorKit.EndRecordingMacroAction, RTextAreaEditorKit.InsertContentAction, RTextAreaEditorKit.InvertSelectionCaseAction, RTextAreaEditorKit.JoinLinesAction, RTextAreaEditorKit.LineMoveAction, RTextAreaEditorKit.LowerSelectionCaseAction, RTextAreaEditorKit.NextBookmarkAction, RTextAreaEditorKit.NextOccurrenceAction, RTextAreaEditorKit.NextVisualPositionAction, RTextAreaEditorKit.PasteAction, RTextAreaEditorKit.PlaybackLastMacroAction, RTextAreaEditorKit.PreviousOccurrenceAction, RTextAreaEditorKit.RedoAction, RTextAreaEditorKit.ScrollAction, RTextAreaEditorKit.SelectAllAction, RTextAreaEditorKit.SelectLineAction, RTextAreaEditorKit.SetReadOnlyAction, RTextAreaEditorKit.SetWritableAction, RTextAreaEditorKit.TimeDateAction, RTextAreaEditorKit.ToggleBookmarkAction, RTextAreaEditorKit.ToggleTextModeAction, RTextAreaEditorKit.UndoAction, RTextAreaEditorKit.UnselectAction, RTextAreaEditorKit.UpperSelectionCaseAction, RTextAreaEditorKit.VerticalPageAction
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Action[]
The actions thatRSyntaxTextAreaEditorKit
adds to those ofRTextAreaEditorKit
.private static final ResourceBundle
private static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
private static final long
Fields inherited from class org.fife.ui.rtextarea.RTextAreaEditorKit
clipboardHistoryAction, rtaBeginRecordingMacroAction, rtaDecreaseFontSizeAction, rtaDeleteLineAction, rtaDeletePrevWordAction, rtaDeleteRestOfLineAction, rtaDumbCompleteWordAction, rtaEndRecordingMacroAction, rtaIncreaseFontSizeAction, rtaInvertSelectionCaseAction, rtaJoinLinesAction, rtaLineDownAction, rtaLineUpAction, rtaLowerSelectionCaseAction, rtaNextBookmarkAction, rtaNextOccurrenceAction, rtaPlaybackLastMacroAction, rtaPrevBookmarkAction, rtaPrevOccurrenceAction, rtaRedoAction, rtaScrollDownAction, rtaScrollUpAction, rtaSelectionPageDownAction, rtaSelectionPageLeftAction, rtaSelectionPageRightAction, rtaSelectionPageUpAction, rtaTimeDateAction, rtaToggleBookmarkAction, rtaToggleTextModeAction, rtaUndoAction, rtaUnselectAction, rtaUpperSelectionCaseAction
Fields inherited from class javax.swing.text.DefaultEditorKit
backwardAction, beepAction, beginAction, beginLineAction, beginLineUpAction, beginParagraphAction, beginWordAction, copyAction, cutAction, defaultKeyTypedAction, deleteNextCharAction, deleteNextWordAction, deletePrevCharAction, deletePrevWordAction, downAction, endAction, endLineAction, endLineDownAction, 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 -
Method Summary
Modifier and TypeMethodDescriptionReturns the default document used byRSyntaxTextArea
s.createIconRowHeader
(RTextArea textArea) Overridden to return a row header that is aware of folding.Action[]
Fetches the set of commands that can be used on a text component that is using a model and view produced by this kit.static String
Returns localized text for an action.Methods inherited from class org.fife.ui.rtextarea.RTextAreaEditorKit
createLineNumberList, read
Methods inherited from class javax.swing.text.DefaultEditorKit
createCaret, getContentType, getViewFactory, read, write, write
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
rstaBacktickAction
- See Also:
-
rstaCloseCurlyBraceAction
- See Also:
-
rstaCloseMarkupTagAction
- See Also:
-
rstaCollapseAllFoldsAction
- See Also:
-
rstaCollapseAllCommentFoldsAction
- See Also:
-
rstaCollapseFoldAction
- See Also:
-
rstaCopyAsStyledTextAction
- See Also:
-
rstaCutAsStyledTextAction
- See Also:
-
rstaDecreaseIndentAction
- See Also:
-
rstaDoubleQuoteAction
- See Also:
-
rstaExpandAllFoldsAction
- See Also:
-
rstaExpandFoldAction
- See Also:
-
rstaGoToMatchingBracketAction
- See Also:
-
rstaOpenParenAction
- See Also:
-
rstaOpenSquareBracketAction
- See Also:
-
rstaOpenCurlyAction
- See Also:
-
rstaPossiblyInsertTemplateAction
- See Also:
-
rstaSingleQuoteAction
- See Also:
-
rstaToggleCommentAction
- See Also:
-
rstaToggleCurrentFoldAction
- See Also:
-
MSG
- See Also:
-
msg
-
defaultActions
The actions thatRSyntaxTextAreaEditorKit
adds to those ofRTextAreaEditorKit
.
-
-
Constructor Details
-
RSyntaxTextAreaEditorKit
public RSyntaxTextAreaEditorKit()Constructor.
-
-
Method Details
-
createDefaultDocument
Returns the default document used byRSyntaxTextArea
s.- Overrides:
createDefaultDocument
in classDefaultEditorKit
- Returns:
- The document.
-
createIconRowHeader
Overridden to return a row header that is aware of folding.- Overrides:
createIconRowHeader
in classRTextAreaEditorKit
- Parameters:
textArea
- The text area.- Returns:
- The icon row header.
-
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:
getActions
in classRTextAreaEditorKit
- Returns:
- the command list
-
getString
Returns localized text for an action. There's definitely a better place for this functionality.- Parameters:
key
- The key into the action resource bundle.- Returns:
- The localized text.
-