java.lang.Object
javax.swing.text.AbstractDocument
javax.swing.text.DefaultStyledDocument
com.memoire.bu.BuAutoStyledDocument
- All Implemented Interfaces:
- javax.swing.text.Document, java.io.Serializable, javax.swing.text.StyledDocument
- public class BuAutoStyledDocument
- extends javax.swing.text.DefaultStyledDocument
A auto-colorized document (using regular expressions).
| Nested classes inherited from class javax.swing.text.DefaultStyledDocument |
javax.swing.text.DefaultStyledDocument.AttributeUndoableEdit, javax.swing.text.DefaultStyledDocument.ElementBuffer, javax.swing.text.DefaultStyledDocument.ElementSpec, javax.swing.text.DefaultStyledDocument.SectionElement |
| Nested classes inherited from class javax.swing.text.AbstractDocument |
javax.swing.text.AbstractDocument.AbstractElement, javax.swing.text.AbstractDocument.AttributeContext, javax.swing.text.AbstractDocument.BranchElement, javax.swing.text.AbstractDocument.Content, javax.swing.text.AbstractDocument.DefaultDocumentEvent, javax.swing.text.AbstractDocument.ElementEdit, javax.swing.text.AbstractDocument.LeafElement |
|
Method Summary |
private void |
__colorize(int _start,
int _len)
|
void |
colorize()
|
void |
colorize(BuCommonInterface _app)
|
void |
colorize(int _start,
int _len)
|
BuAutoStyledDocument.Key |
createKey(java.lang.String _match,
java.lang.String _style)
|
BuAutoStyledDocument.Key |
createKey(java.lang.String _match,
java.lang.String _replace,
java.lang.String _style)
|
BuAutoStyledDocument.Key |
createKeyword(java.lang.String _word)
|
BuAutoStyledDocument.Key |
createKeyword(java.lang.String _word,
java.lang.String _style)
|
javax.swing.text.Style |
createStyle(java.lang.String _name,
java.awt.Color _fg,
boolean _bold,
boolean _italic)
|
private int |
getLineCount()
|
private int |
getLineEndOffset(int _offset)
|
private int |
getLineStartOffset(int _offset)
|
java.lang.String |
getSyntax()
|
BuTextPane |
getTextPane()
|
void |
insertString(int _offset,
java.lang.String _string,
javax.swing.text.AttributeSet _attr)
Inserts a piece of text with an AttributeSet at the specified
offset. |
boolean |
isColorized()
|
void |
loadSyntax(java.lang.String _language)
|
void |
remove(int _start,
int _len)
Removes a piece of content. |
void |
setColorized(boolean _b)
|
void |
setSyntax(java.lang.String _syntax)
|
void |
setTextPane(BuTextPane _ta)
|
void |
uncolorize()
|
| Methods inherited from class javax.swing.text.DefaultStyledDocument |
addStyle, create, createDefaultRoot, getBackground, getCharacterElement, getDefaultRootElement, getFont, getForeground, getLogicalStyle, getParagraphElement, getStyle, getStyleNames, insert, insertUpdate, removeStyle, removeUpdate, setCharacterAttributes, setLogicalStyle, setParagraphAttributes, styleChanged |
| Methods inherited from class javax.swing.text.AbstractDocument |
addDocumentListener, addUndoableEditListener, createBranchElement, createLeafElement, createPosition, dump, fireChangedUpdate, fireInsertUpdate, fireRemoveUpdate, fireUndoableEditUpdate, getAsynchronousLoadPriority, getAttributeContext, getBidiRootElement, getContent, getCurrentWriter, getDocumentFilter, getDocumentListeners, getDocumentProperties, getEndPosition, getLength, getListeners, getProperty, getRootElements, getStartPosition, getText, getText, getUndoableEditListeners, postRemoveUpdate, putProperty, readLock, readUnlock, removeDocumentListener, removeUndoableEditListener, render, replace, setAsynchronousLoadPriority, setDocumentFilter, setDocumentProperties, writeLock, writeUnlock |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.swing.text.Document |
addDocumentListener, addUndoableEditListener, createPosition, getEndPosition, getLength, getProperty, getRootElements, getStartPosition, getText, getText, putProperty, removeDocumentListener, removeUndoableEditListener, render |
KEYWORD
public static final java.lang.String KEYWORD
- See Also:
- Constant Field Values
MODIFIER
public static final java.lang.String MODIFIER
- See Also:
- Constant Field Values
TYPE
public static final java.lang.String TYPE
- See Also:
- Constant Field Values
SPECIAL
public static final java.lang.String SPECIAL
- See Also:
- Constant Field Values
OPERATOR
public static final java.lang.String OPERATOR
- See Also:
- Constant Field Values
BLOCK
public static final java.lang.String BLOCK
- See Also:
- Constant Field Values
NUMBER
public static final java.lang.String NUMBER
- See Also:
- Constant Field Values
COMMENT
public static final java.lang.String COMMENT
- See Also:
- Constant Field Values
PRAGMA
public static final java.lang.String PRAGMA
- See Also:
- Constant Field Values
STRING
public static final java.lang.String STRING
- See Also:
- Constant Field Values
IS_KEYWORD
public static final byte IS_KEYWORD
- See Also:
- Constant Field Values
IS_SIMPLE_STRING
public static final byte IS_SIMPLE_STRING
- See Also:
- Constant Field Values
IS_SIMPLE_CHAR
public static final byte IS_SIMPLE_CHAR
- See Also:
- Constant Field Values
IS_ONELINE_REGEXP
public static final byte IS_ONELINE_REGEXP
- See Also:
- Constant Field Values
IS_MULTILINE_REGEXP
public static final byte IS_MULTILINE_REGEXP
- See Also:
- Constant Field Values
keys_
private java.util.Vector keys_
ta_
private BuTextPane ta_
colorized_
private boolean colorized_
syntax_
private java.lang.String syntax_
BuAutoStyledDocument
public BuAutoStyledDocument(java.lang.String _text)
BuAutoStyledDocument
public BuAutoStyledDocument(java.lang.String _text,
java.lang.String _syntax)
BuAutoStyledDocument
public BuAutoStyledDocument()
createKey
public BuAutoStyledDocument.Key createKey(java.lang.String _match,
java.lang.String _replace,
java.lang.String _style)
createKey
public BuAutoStyledDocument.Key createKey(java.lang.String _match,
java.lang.String _style)
createKeyword
public BuAutoStyledDocument.Key createKeyword(java.lang.String _word,
java.lang.String _style)
createKeyword
public BuAutoStyledDocument.Key createKeyword(java.lang.String _word)
createStyle
public javax.swing.text.Style createStyle(java.lang.String _name,
java.awt.Color _fg,
boolean _bold,
boolean _italic)
loadSyntax
public void loadSyntax(java.lang.String _language)
throws java.io.IOException
getTextPane
public BuTextPane getTextPane()
setTextPane
public void setTextPane(BuTextPane _ta)
isColorized
public boolean isColorized()
setColorized
public void setColorized(boolean _b)
getSyntax
public java.lang.String getSyntax()
setSyntax
public void setSyntax(java.lang.String _syntax)
getLineCount
private int getLineCount()
getLineStartOffset
private int getLineStartOffset(int _offset)
getLineEndOffset
private int getLineEndOffset(int _offset)
insertString
public void insertString(int _offset,
java.lang.String _string,
javax.swing.text.AttributeSet _attr)
throws javax.swing.text.BadLocationException
- Description copied from interface:
javax.swing.text.Document
- Inserts a piece of text with an AttributeSet at the specified
offset.
uncolorize
public void uncolorize()
colorize
public void colorize()
colorize
public void colorize(int _start,
int _len)
colorize
public void colorize(BuCommonInterface _app)
__colorize
private void __colorize(int _start,
int _len)
remove
public void remove(int _start,
int _len)
throws javax.swing.text.BadLocationException
- Description copied from interface:
javax.swing.text.Document
- Removes a piece of content.