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.
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 |
SimpleTextEditor
public SimpleTextEditor(DAVFile file)
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.