org.skunk.dav.client.gui.editor
Class SimpleTextEditor

java.lang.Object
  |
  +--org.skunk.dav.client.gui.editor.AbstractDAVEditor
        |
        +--org.skunk.dav.client.gui.editor.SimpleTextEditor
All Implemented Interfaces:
Buffer, ConfigurableEditor, DAVEditor

public class SimpleTextEditor
extends AbstractDAVEditor
implements ConfigurableEditor

text editor supporting search, navigation, and syntax highlighting.


Fields inherited from interface org.skunk.dav.client.gui.editor.ConfigurableEditor
BACKGROUND_PROPERTY, CARET_COLOR_PROPERTY, DEFAULT_CARET_COLOR, DEFAULT_TAB_SIZE, FONT_PROPERTY, FOREGROUND_PROPERTY, MARGIN_PROPERTY, TAB_SIZE_PROPERTY
 
Constructor Summary
SimpleTextEditor(DAVFile file)
           
 
Method Summary
 void copy()
           
 void cut()
           
 java.awt.Color getBackground()
           
 javax.swing.text.Caret getCaret()
           
 java.awt.Color getCaretColor()
           
 javax.swing.JComponent getComponent()
           
 javax.swing.text.Document getDocument()
           
 FileMode getFileMode()
           
 java.awt.Color getForeground()
           
 java.awt.Insets getMargin()
           
 SyntaxDocument getSyntaxDocument()
           
 int getTabSize()
           
 DAVEditorUndoManager getUndoManager()
           
 void gotoLine(int line)
           
 boolean isTokenizing()
           
 boolean isWordWrap()
           
 void load()
          loads the contents of the editor's DAVFile into the editor.
 void paste()
           
 void replaceSelection(java.lang.String content)
           
 void save()
          saves the file being edited.
 void scrollTo(int offset)
           
 void select(int dot, int mark)
           
 void selectAll()
           
 void setBackground(java.awt.Color background)
           
 void setCaretColor(java.awt.Color caretColor)
           
 void setDirty(boolean dirty)
          sets the dirty flag on the editor.
 void setEditorInFocus(boolean focussed)
           
 void setFileMode(FileMode mode)
           
 void setFont(java.awt.Font defaultFont)
           
 void setForeground(java.awt.Color foreground)
           
 void setMargin(java.awt.Insets margin)
           
 void setTabSize(int tabSize)
           
 void setTokenizing(boolean tokenize)
           
 void setWordWrap(boolean wordWrap)
           
 void setWriteable(boolean writeable)
          sets the writeable flag on the editor
 
Methods inherited from class org.skunk.dav.client.gui.editor.AbstractDAVEditor
addEditListener, docking, getDAVFile, getName, getResourceBody, getResourceName, handleNulledFile, isDirty, isWriteable, removeEditListener, saveAs, saveAs, setDAVFile, setName, setResourceBody, setResourceName, undocking
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleTextEditor

public SimpleTextEditor(DAVFile file)
Method Detail

getMargin

public java.awt.Insets getMargin()
Specified by:
getMargin in interface ConfigurableEditor

setMargin

public void setMargin(java.awt.Insets margin)
Specified by:
setMargin in interface ConfigurableEditor

getBackground

public java.awt.Color getBackground()
Specified by:
getBackground in interface ConfigurableEditor

setBackground

public void setBackground(java.awt.Color background)
Specified by:
setBackground in interface ConfigurableEditor

getForeground

public java.awt.Color getForeground()
Specified by:
getForeground in interface ConfigurableEditor

setForeground

public void setForeground(java.awt.Color foreground)
Specified by:
setForeground in interface ConfigurableEditor

getCaretColor

public java.awt.Color getCaretColor()
Specified by:
getCaretColor in interface ConfigurableEditor

setCaretColor

public void setCaretColor(java.awt.Color caretColor)
Specified by:
setCaretColor in interface ConfigurableEditor

setFont

public void setFont(java.awt.Font defaultFont)
Specified by:
setFont in interface ConfigurableEditor

getTabSize

public int getTabSize()
Specified by:
getTabSize in interface ConfigurableEditor

setTabSize

public void setTabSize(int tabSize)
Specified by:
setTabSize in interface ConfigurableEditor

isTokenizing

public boolean isTokenizing()

setTokenizing

public void setTokenizing(boolean tokenize)

getFileMode

public FileMode getFileMode()

setFileMode

public void setFileMode(FileMode mode)

isWordWrap

public boolean isWordWrap()

setWordWrap

public void setWordWrap(boolean wordWrap)

setDirty

public void setDirty(boolean dirty)
Description copied from interface: DAVEditor
sets the dirty flag on the editor.
Overrides:
setDirty in class AbstractDAVEditor
Following copied from interface: org.skunk.dav.client.gui.editor.DAVEditor
Parameters:
dirty - the new value of the dirty flag

getUndoManager

public DAVEditorUndoManager getUndoManager()
Following copied from interface: org.skunk.dav.client.gui.editor.DAVEditor
Returns:
the undo manager for this editor. May be null.

setEditorInFocus

public void setEditorInFocus(boolean focussed)

copy

public void copy()

cut

public void cut()

paste

public void paste()

replaceSelection

public void replaceSelection(java.lang.String content)

select

public void select(int dot,
                   int mark)

selectAll

public void selectAll()

gotoLine

public void gotoLine(int line)

scrollTo

public void scrollTo(int offset)

getSyntaxDocument

public SyntaxDocument getSyntaxDocument()

getDocument

public javax.swing.text.Document getDocument()

getCaret

public javax.swing.text.Caret getCaret()

getComponent

public javax.swing.JComponent getComponent()
Overrides:
getComponent in class AbstractDAVEditor
Following copied from interface: org.skunk.dav.client.gui.Buffer
Returns:
the buffer's visual component

setWriteable

public void setWriteable(boolean writeable)
Description copied from interface: DAVEditor
sets the writeable flag on the editor
Overrides:
setWriteable in class AbstractDAVEditor
Following copied from interface: org.skunk.dav.client.gui.editor.DAVEditor
Parameters:
writeable - the new value of the writeable flag

save

public void save()
Description copied from interface: DAVEditor
saves the file being edited.
Overrides:
save in class AbstractDAVEditor

load

public void load()
Description copied from interface: DAVEditor
loads the contents of the editor's DAVFile into the editor.
Overrides:
load in class AbstractDAVEditor
Following copied from interface: org.skunk.dav.client.gui.editor.DAVEditor
Throws:
CannotLoadException - if it cannot load the file.