|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.swing.text.EditorKit | +--javax.swing.text.DefaultEditorKit | +--com.japisoft.sc.ScEditorKit
The SyntaxColor JAPISOFT editorKit. Usage sample :
ScEditorKit sc = new ScEditorKit(); sc.readSyntaxColorDescriptor( "sql.prop" ); JEditorPane myEditor = new JEditorPane(); myEditor.setEditorKit( sc );
Here a property file sample
Properties p = new Properties(); p.setProperty( "token_toto","print:goto" ); p.setProperty( "color_toto","red" ); p.setProperty( "token_titi","[\";\"]" ); p.setProperty( "color_titi","10:40:50" ); p.setProperty( "border_toto", "true" ); p.setProperty( "ignoreCase", "true" ); ScEditorKit sc = new ScEditorKit(); sc.setSyntaxColorDescriptor( p );
This is equals to the following property file myLanguage.prop
token_toto=print:goto color_toto=red token_titi=[";"] color_titi=10:40:50 border_toto=true ignoreCase=true
ScEditorKit sc = new ScEditorKit(); sc.readSyntaxColorDescriptor( "myLanguage.prop" );The property file is read both by searching on the current classpath and on the file system. For sample, "myLanguage.prop" is loaded searching on the current application classpath and finally search on the current path
Field Summary |
Fields inherited from class javax.swing.text.DefaultEditorKit |
backwardAction, beepAction, beginAction, beginLineAction, beginParagraphAction, beginWordAction, copyAction, cutAction, defaultKeyTypedAction, deleteNextCharAction, deletePrevCharAction, 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 | |
ScEditorKit()
|
|
ScEditorKit(java.util.Properties propertyFile)
Use this property file describing the syntax attributes |
|
ScEditorKit(java.lang.String propertyFile)
Read the property file describing the syntax attributes |
Method Summary | |
javax.swing.text.Document |
createDefaultDocument()
Build a default PlainDocument |
SyntaxFileMapper |
getSyntaxFileMapper()
|
javax.swing.text.ViewFactory |
getViewFactory()
|
void |
readSyntaxColorDescriptor(java.lang.String propertyFile)
Read a syntax color table. |
void |
setSyntaxColorDescriptor(java.util.Properties p)
Reset the syntax color descriptor |
Methods inherited from class javax.swing.text.DefaultEditorKit |
createCaret, getActions, getContentType, read, read, write, write |
Methods inherited from class javax.swing.text.EditorKit |
clone, deinstall, install |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ScEditorKit()
public ScEditorKit(java.lang.String propertyFile) throws java.io.FileNotFoundException
public ScEditorKit(java.util.Properties propertyFile)
Method Detail |
public javax.swing.text.Document createDefaultDocument()
PlainDocument
createDefaultDocument
in class javax.swing.text.DefaultEditorKit
public SyntaxFileMapper getSyntaxFileMapper()
public void readSyntaxColorDescriptor(java.lang.String propertyFile) throws java.io.FileNotFoundException
java.io.FileNotFoundException
- will be thrown for unknown file
java.lang.RuntimeException
- will be thrown for invalid formatpublic void setSyntaxColorDescriptor(java.util.Properties p)
public javax.swing.text.ViewFactory getViewFactory()
getViewFactory
in class javax.swing.text.DefaultEditorKit
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |