proyecto.undo
Class SyntaxDocument

java.lang.Object
  extended by javax.swing.text.AbstractDocument
      extended by javax.swing.text.DefaultStyledDocument
          extended by proyecto.undo.SyntaxDocument
All Implemented Interfaces:
Serializable, Document, StyledDocument

public class SyntaxDocument
extends DefaultStyledDocument

Class SyntaxDocument.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.text.DefaultStyledDocument
DefaultStyledDocument.AttributeUndoableEdit, DefaultStyledDocument.ElementBuffer, DefaultStyledDocument.ElementSpec, DefaultStyledDocument.SectionElement
 
Nested classes/interfaces inherited from class javax.swing.text.AbstractDocument
AbstractDocument.AbstractElement, AbstractDocument.AttributeContext, AbstractDocument.BranchElement, AbstractDocument.Content, AbstractDocument.DefaultDocumentEvent, AbstractDocument.ElementEdit, AbstractDocument.LeafElement
 
Field Summary
 
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
SyntaxDocument()
          Constructor syntax document.
 
Method Summary
protected  String addMatchingBrace(int offset)
          Aņade matching brace.
protected  String getEndDelimiter()
          Obtener el end delimiter.
protected  String getEscapeString(String quoteDelimiter)
          Obtener el escape string.
protected  String getSingleLineDelimiter()
          Obtener el single line delimiter.
protected  String getStartDelimiter()
          Obtener el start delimiter.
 void insertString(int offset, String str, AttributeSet a)
           
protected  boolean isDelimiter(String character)
          Verificamos si es delimiter.
protected  boolean isKeyword(String token)
          Verificamos si es keyword.
protected  boolean isQuoteDelimiter(String character)
          Verificamos si es quote delimiter.
static void main(String[] a)
          MÊtodo main.
 void processChangedLines(int offset, int length)
          Process changed lines.
 void remove(int offset, int length)
           
 
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, setCharacterAttributes, setLogicalStyle, setParagraphAttributes, styleChanged
 
Methods inherited from class javax.swing.text.AbstractDocument
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, 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
addUndoableEditListener, createPosition, getEndPosition, getLength, getProperty, getRootElements, getStartPosition, getText, getText, putProperty, removeUndoableEditListener, render
 

Constructor Detail

SyntaxDocument

public SyntaxDocument()
Constructor syntax document. Creado : Parras, 07-oct-2009

Method Detail

insertString

public void insertString(int offset,
                         String str,
                         AttributeSet a)
                  throws BadLocationException
Specified by:
insertString in interface Document
Overrides:
insertString in class AbstractDocument
Throws:
BadLocationException

remove

public void remove(int offset,
                   int length)
            throws BadLocationException
Specified by:
remove in interface Document
Overrides:
remove in class AbstractDocument
Throws:
BadLocationException

processChangedLines

public void processChangedLines(int offset,
                                int length)
                         throws BadLocationException
Process changed lines. Creado : Parras, 07-oct-2009

Parameters:
offset - offset
length - length
Throws:
BadLocationException - bad location exception

isDelimiter

protected boolean isDelimiter(String character)
Verificamos si es delimiter.

Parameters:
character - the character
Returns:
true, Si es delimiter Creado : Parras, 07-oct-2009

isQuoteDelimiter

protected boolean isQuoteDelimiter(String character)
Verificamos si es quote delimiter.

Parameters:
character - the character
Returns:
true, Si es quote delimiter Creado : Parras, 07-oct-2009

isKeyword

protected boolean isKeyword(String token)
Verificamos si es keyword.

Parameters:
token - the token
Returns:
true, Si es keyword Creado : Parras, 07-oct-2009

getStartDelimiter

protected String getStartDelimiter()
Obtener el start delimiter.

Returns:
el start delimiter Creado : Parras, 07-oct-2009

getEndDelimiter

protected String getEndDelimiter()
Obtener el end delimiter.

Returns:
el end delimiter Creado : Parras, 07-oct-2009

getSingleLineDelimiter

protected String getSingleLineDelimiter()
Obtener el single line delimiter.

Returns:
el single line delimiter Creado : Parras, 07-oct-2009

getEscapeString

protected String getEscapeString(String quoteDelimiter)
Obtener el escape string.

Parameters:
quoteDelimiter - the quote delimiter
Returns:
el escape string Creado : Parras, 07-oct-2009

addMatchingBrace

protected String addMatchingBrace(int offset)
                           throws BadLocationException
Aņade matching brace.

Parameters:
offset - the offset
Returns:
the string Creado : Parras, 07-oct-2009
Throws:
BadLocationException - the bad location exception

main

public static void main(String[] a)
MÊtodo main.

Parameters:
a - the arguments Creado : Parras, 07-oct-2009