com.infoengine.modeler.UI
Class EditorTextComponent.IEStyledDocument

java.lang.Object
  extended byjavax.swing.text.AbstractDocument
      extended byjavax.swing.text.DefaultStyledDocument
          extended bycom.infoengine.modeler.UI.EditorTextComponent.IEStyledDocument
All Implemented Interfaces:
Document, EventListener, KeyListener, Serializable, StyledDocument
Enclosing class:
EditorTextComponent

class EditorTextComponent.IEStyledDocument
extends DefaultStyledDocument
implements KeyListener


Nested Class Summary
 
Nested classes inherited from class javax.swing.text.DefaultStyledDocument
DefaultStyledDocument.AttributeUndoableEdit, DefaultStyledDocument.ElementBuffer, DefaultStyledDocument.ElementSpec, DefaultStyledDocument.SectionElement
 
Nested classes inherited from class javax.swing.text.AbstractDocument
AbstractDocument.AbstractElement, AbstractDocument.AttributeContext, AbstractDocument.BranchElement, AbstractDocument.Content, AbstractDocument.DefaultDocumentEvent, AbstractDocument.ElementEdit, AbstractDocument.LeafElement
 
Field Summary
private  EditorTextComponent.ShortCharStack charStack
           
private  boolean embeddedTag
           
private  JTextPane jtp
           
private  char OPEN_QUOTE
           
private  Style previousStyle
           
private  Stack startStack
           
private  Style STYLE_COMMENT
           
private  Style STYLE_REGULAR
           
private  Style STYLE_SCRIPTLET
           
private  Style STYLE_XMLATTR
           
private  Style STYLE_XMLATTRVAL
           
private  Style STYLE_XMLELEMENTNAME
           
private  Style STYLE_XMLEQUALS
           
private  Stack styleStack
           
private  boolean tagOpened
           
private  Stack tagStyleStack
           
private  boolean testEmbedded
           
private  boolean testQuote
           
(package private)  Timer timer
           
private  Vector undoListeners
           
private  boolean unquotedAttrVal
           
 
Fields inherited from class javax.swing.text.DefaultStyledDocument
buffer, BUFFER_SIZE_DEFAULT
 
Fields inherited from class javax.swing.text.AbstractDocument
BAD_LOCATION, BidiElementName, ContentElementName, ElementNameAttribute, listenerList, ParagraphElementName, SectionElementName
 
Fields inherited from interface javax.swing.text.Document
StreamDescriptionProperty, TitleProperty
 
Constructor Summary
(package private) EditorTextComponent.IEStyledDocument(JTextPane jtp)
           
 
Method Summary
 void addUndoableEditListener(UndoableEditListener listener)
           
private  boolean applyStyle(Style s, int start, int end)
           
(package private)  void doReparse()
           
(package private)  void initStyles()
           
 void insertString(int offset, String string, AttributeSet attributes)
           
 void keyPressed(KeyEvent e)
           
 void keyReleased(KeyEvent e)
           
 void keyTyped(KeyEvent e)
           
private  boolean processChar(char c, int loc)
           
(package private)  void regetStyles()
           
 void removeUndoableEditListener(UndoableEditListener listener)
           
private  void reparse()
           
private  void reset()
           
(package private)  void restyle()
           
(package private)  void restyle(String s, int start)
           
 void setCharacterAttributes(int offset, int length, AttributeSet set, boolean replace)
           
(package private)  void setStyles()
           
private  String whatStyle(Style s)
           
 
Methods inherited from class javax.swing.text.DefaultStyledDocument
addDocumentListener, addStyle, create, createDefaultRoot, getBackground, getCharacterElement, getDefaultRootElement, getFont, getForeground, getLogicalStyle, getParagraphElement, getStyle, getStyleNames, insert, insertUpdate, removeDocumentListener, removeStyle, removeUpdate, setLogicalStyle, setParagraphAttributes, styleChanged
 
Methods inherited from class javax.swing.text.AbstractDocument
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, remove, 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
createPosition, getEndPosition, getLength, getProperty, getRootElements, getStartPosition, getText, getText, putProperty, remove, render
 

Field Detail

STYLE_REGULAR

private Style STYLE_REGULAR

STYLE_COMMENT

private Style STYLE_COMMENT

STYLE_XMLATTR

private Style STYLE_XMLATTR

STYLE_XMLATTRVAL

private Style STYLE_XMLATTRVAL

STYLE_XMLELEMENTNAME

private Style STYLE_XMLELEMENTNAME

STYLE_XMLEQUALS

private Style STYLE_XMLEQUALS

STYLE_SCRIPTLET

private Style STYLE_SCRIPTLET

jtp

private JTextPane jtp

undoListeners

private Vector undoListeners

tagOpened

private boolean tagOpened

embeddedTag

private boolean embeddedTag

testEmbedded

private boolean testEmbedded

styleStack

private Stack styleStack

tagStyleStack

private Stack tagStyleStack

startStack

private Stack startStack

charStack

private EditorTextComponent.ShortCharStack charStack

previousStyle

private Style previousStyle

testQuote

private boolean testQuote

unquotedAttrVal

private boolean unquotedAttrVal

OPEN_QUOTE

private char OPEN_QUOTE

timer

Timer timer
Constructor Detail

EditorTextComponent.IEStyledDocument

EditorTextComponent.IEStyledDocument(JTextPane jtp)
Method Detail

setStyles

void setStyles()

initStyles

void initStyles()

regetStyles

void regetStyles()

restyle

void restyle()

restyle

void restyle(String s,
             int start)

addUndoableEditListener

public void addUndoableEditListener(UndoableEditListener listener)
Specified by:
addUndoableEditListener in interface Document

removeUndoableEditListener

public void removeUndoableEditListener(UndoableEditListener listener)
Specified by:
removeUndoableEditListener in interface Document

setCharacterAttributes

public void setCharacterAttributes(int offset,
                                   int length,
                                   AttributeSet set,
                                   boolean replace)
Specified by:
setCharacterAttributes in interface StyledDocument

insertString

public void insertString(int offset,
                         String string,
                         AttributeSet attributes)
                  throws BadLocationException
Specified by:
insertString in interface Document
Throws:
BadLocationException

reset

private void reset()

whatStyle

private String whatStyle(Style s)

applyStyle

private boolean applyStyle(Style s,
                           int start,
                           int end)

processChar

private boolean processChar(char c,
                            int loc)

reparse

private void reparse()

doReparse

void doReparse()

keyPressed

public void keyPressed(KeyEvent e)
Specified by:
keyPressed in interface KeyListener

keyReleased

public void keyReleased(KeyEvent e)
Specified by:
keyReleased in interface KeyListener

keyTyped

public void keyTyped(KeyEvent e)
Specified by:
keyTyped in interface KeyListener