Class JSyntaxKit
java.lang.Object
javax.swing.text.EditorKit
javax.swing.text.DefaultEditorKit
javax.swing.text.StyledEditorKit
net.thevpc.jeep.editor.JSyntaxKit
- All Implemented Interfaces:
Serializable, Cloneable, ViewFactory
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class StyledEditorKit
StyledEditorKit.AlignmentAction, StyledEditorKit.BoldAction, StyledEditorKit.FontFamilyAction, StyledEditorKit.FontSizeAction, StyledEditorKit.ForegroundAction, StyledEditorKit.ItalicAction, StyledEditorKit.StyledTextAction, StyledEditorKit.UnderlineActionNested classes/interfaces inherited from class DefaultEditorKit
DefaultEditorKit.BeepAction, DefaultEditorKit.CopyAction, DefaultEditorKit.CutAction, DefaultEditorKit.DefaultKeyTypedAction, DefaultEditorKit.InsertBreakAction, DefaultEditorKit.InsertContentAction, DefaultEditorKit.InsertTabAction, DefaultEditorKit.PasteAction -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected JSyntaxStyleprotected JSyntaxStyleprotected JSyntaxStyleprotected JSyntaxStyleprotected JSyntaxStyleprotected JSyntaxStyleprotected JSyntaxStyleprotected JSyntaxStyleprotected JSyntaxStyleprotected JSyntaxStyleprotected JSyntaxStyleprotected JSyntaxStyleprotected JSyntaxStyleprotected JSyntaxStyleprotected JSyntaxStyleprotected JSyntaxStyleprotected JSyntaxStyleprotected JSyntaxStyleprotected JSyntaxStyleprotected JSyntaxStyleprotected JSyntaxStyleprotected JSyntaxStyleprotected JSyntaxStyleprotected JSyntaxStyleprotected JSyntaxStyleprotected JSyntaxStyleprotected JSyntaxStyleprotected JSyntaxStyleprotected JSyntaxStyleprotected JSyntaxStyleprotected JSyntaxStyleprotected JSyntaxStyleprotected JSyntaxStyleprotected JSyntaxStyleprotected JSyntaxStyleprotected JSyntaxStyleprotected JSyntaxStyleprotected JSyntaxStyleprotected JSyntaxStyleprotected JSyntaxStyleprotected JSyntaxStyleprotected JSyntaxStyleprotected JSyntaxStylestatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class 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
ConstructorsConstructorDescriptionJSyntaxKit(JContext jcontext, JSyntaxStyleManager styles) Create a new Kit for the given language -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSyntaxActions(Keymap map, String prefix) Add keyboard actions to this control using the Configuration we haveThis is called by Swing to create a Document for the JEditorPane document This may be called before you actually get a reference to the control.voiddeinstall(JEditorPane editorPane) protected JSyntaxStylegetBackgroundStyle(int ii) static String[]Return all the content types supported by this library.protected JSyntaxStylegetForegroundStyle(int ii) protected JSyntaxStylegetTitleStyle(int ii) voidinstall(JEditorPane editorPane) Install the View on the given EditorPane.static voidregisterContentType(String type, String classname) Register the given content type to use the given class name as its kit When this is called, an entry is added into the private HashMap of the registered editors kits.setJcontext(JContext jcontext) static voidsetMenuSelectedIndex(JPopupMenu popupMenu, int index) setStyles(JSyntaxStyleManager styles) Methods inherited from class StyledEditorKit
clone, createInputAttributes, getActions, getCharacterAttributeRun, getInputAttributesMethods inherited from class DefaultEditorKit
createCaret, getContentType, read, read, write, write
-
Field Details
-
UI_KEY_DEFAULT
- See Also:
-
UI_KEY_RESERVED_WORD
- See Also:
-
UI_KEY_RESERVED_WORD2
- See Also:
-
UI_KEY_RESERVED_WORD3
- See Also:
-
UI_KEY_COMMENTS
- See Also:
-
UI_KEY_LITERAL_STRING
- See Also:
-
UI_KEY_LITERAL_STRING2
- See Also:
-
UI_KEY_DIRECTIVE
- See Also:
-
UI_KEY_LITERAL_NUMBER
- See Also:
-
UI_KEY_SUCCESS
- See Also:
-
UI_KEY_ERROR
- See Also:
-
UI_KEY_LITERAL_DATE
- See Also:
-
UI_KEY_WARNING
- See Also:
-
UI_KEY_INFO
- See Also:
-
UI_KEY_LITERAL_REGEXP
- See Also:
-
UI_KEY_LITERAL_BOOLEAN
- See Also:
-
UI_KEY_TYPE_PRIMITIVE
- See Also:
-
UI_KEY_SEPARATOR
- See Also:
-
UI_KEY_OPERATOR
- See Also:
-
UI_KEY_FORE1
- See Also:
-
UI_KEY_FORE2
- See Also:
-
UI_KEY_FORE3
- See Also:
-
UI_KEY_FORE4
- See Also:
-
UI_KEY_FORE5
- See Also:
-
UI_KEY_FORE6
- See Also:
-
UI_KEY_FORE7
- See Also:
-
UI_KEY_FORE8
- See Also:
-
UI_KEY_FORE9
- See Also:
-
UI_KEY_FORE10
- See Also:
-
STYLE_KEYWORDS
-
STYLE_COMMENTS
-
STYLE_STRING
-
STYLE_NUMBERS
-
STYLE_OPERATORS
-
STYLE_SEPARATORS
-
STYLE_REGEXPS
-
STYLE_TEMPORALS
-
STYLE_DIRECTIVES
-
STYLE_PRIMITIVE_TYPES
-
STYLE_BOOLEAN_LITERALS
-
STYLE_KEYWORDS2
-
STYLE_STRINGS
-
STYLE_STRINGS2
-
STYLE_TITLE1
-
STYLE_TITLE2
-
STYLE_TITLE3
-
STYLE_TITLE4
-
STYLE_TITLE5
-
STYLE_TITLE6
-
STYLE_TITLE7
-
STYLE_TITLE8
-
STYLE_TITLE9
-
STYLE_BG1
-
STYLE_BG2
-
STYLE_BG3
-
STYLE_BG4
-
STYLE_BG5
-
STYLE_BG6
-
STYLE_BG7
-
STYLE_BG8
-
STYLE_BG9
-
STYLE_BOLD
-
STYLE_ITALIC
-
STYLE_CROSS_OUT
-
STYLE_UNDERLINE
-
STYLE_BOLD_ITALIC
-
STYLE_PRE
-
STYLE_CODE
-
STYLE_SUCCESS
-
STYLE_ERROR
-
STYLE_WARN
-
STYLE_INFO
-
-
Constructor Details
-
JSyntaxKit
Create a new Kit for the given language- Parameters:
jcontext-
-
JSyntaxKit
public JSyntaxKit()
-
-
Method Details
-
getStyles
-
setJcontext
-
setStyles
-
getViewFactory
- Overrides:
getViewFactoryin classStyledEditorKit
-
create
- Specified by:
createin interfaceViewFactory
-
install
Install the View on the given EditorPane. This is called by Swing and can be used to do anything you need on the JEditorPane control. Here I set some default Actions.- Overrides:
installin classStyledEditorKit- Parameters:
editorPane-
-
deinstall
- Overrides:
deinstallin classStyledEditorKit
-
setMenuSelectedIndex
-
addSyntaxActions
-
createDefaultDocument
This is called by Swing to create a Document for the JEditorPane document This may be called before you actually get a reference to the control. We use it here to create a proper lexer and pass it to the SyntaxDcument we return.- Overrides:
createDefaultDocumentin classStyledEditorKit- Returns:
-
registerContentType
Register the given content type to use the given class name as its kit When this is called, an entry is added into the private HashMap of the registered editors kits. This is needed so that the SyntaxPane library has it's own registration of all the EditorKits- Parameters:
type-classname-
-
getContentTypes
Return all the content types supported by this library. This will be the content types in the file WEB-INF/services/resources/jsyntaxpane.kitsfortypes- Returns:
- sorted array of all registered content types
-
getTitleStyle
-
getForegroundStyle
-
getBackgroundStyle
-