com.judoscript.studio
Class SourceCodeDocument

java.lang.Object
  extended by javax.swing.text.AbstractDocument
      extended by javax.swing.text.DefaultStyledDocument
          extended by com.judoscript.studio.SourceCodeDocument
All Implemented Interfaces:
java.io.Serializable, javax.swing.text.Document, javax.swing.text.StyledDocument

public final class SourceCodeDocument
extends javax.swing.text.DefaultStyledDocument

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces 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/interfaces 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
 
Field Summary
static int maxBufLen
           
 
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
SourceCodeDocument()
           
SourceCodeDocument(java.io.File file)
           
SourceCodeDocument(java.lang.String fileName)
           
 
Method Summary
 void clear()
           
 java.io.File getFile()
           
 int getLineNumber(int pos)
           
 java.io.Reader getReader(boolean forSave)
           
 javax.swing.Action getRedoAction()
           
 javax.swing.Action getUndoAction()
           
 int gotoLine(int lineNum)
           
 boolean hasFile()
           
 boolean isDirty()
           
 void load(java.io.File f)
           
 void save()
           
 void save(java.io.File file)
           
 void save(java.lang.String path)
           
 void setFile(java.io.File f)
           
 
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, insertString, postRemoveUpdate, putProperty, readLock, readUnlock, remove, 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, insertString, putProperty, remove, removeUndoableEditListener, render
 

Field Detail

maxBufLen

public static final int maxBufLen
See Also:
Constant Field Values
Constructor Detail

SourceCodeDocument

public SourceCodeDocument(java.lang.String fileName)
                   throws java.io.IOException
Throws:
java.io.IOException

SourceCodeDocument

public SourceCodeDocument(java.io.File file)
                   throws java.io.IOException
Throws:
java.io.IOException

SourceCodeDocument

public SourceCodeDocument()
Method Detail

getUndoAction

public javax.swing.Action getUndoAction()

getRedoAction

public javax.swing.Action getRedoAction()

getFile

public java.io.File getFile()

setFile

public void setFile(java.io.File f)

hasFile

public boolean hasFile()

isDirty

public boolean isDirty()

clear

public void clear()

load

public void load(java.io.File f)
          throws java.io.IOException
Throws:
java.io.IOException

save

public void save(java.io.File file)
          throws java.io.IOException
Throws:
java.io.IOException

save

public void save(java.lang.String path)
          throws java.io.IOException
Throws:
java.io.IOException

save

public void save()
          throws java.io.IOException
Throws:
java.io.IOException

getLineNumber

public int getLineNumber(int pos)
                  throws javax.swing.text.BadLocationException
Throws:
javax.swing.text.BadLocationException

gotoLine

public int gotoLine(int lineNum)

getReader

public java.io.Reader getReader(boolean forSave)