org.skunk.dav.client.gui.editor
Interface DAVEditor

All Superinterfaces:
Buffer
All Known Implementing Classes:
AbstractDAVEditor

public interface DAVEditor
extends Buffer

an extension of the Buffer interface for buffers that enable the user to modify the contents of a DAVFile.


Method Summary
 void addEditListener(EditListener ed)
          adds an EditListener.
 DAVFile getDAVFile()
           
 byte[] getResourceBody()
           
 java.lang.String getResourceName()
           
 DAVEditorUndoManager getUndoManager()
           
 boolean isDirty()
           
 boolean isWriteable()
           
 void load()
          loads the contents of the editor's DAVFile into the editor.
 void removeEditListener(EditListener ed)
          removes an EditListener.
 void save()
          saves the file being edited.
 void saveAs()
          saves the file being edited, prompting the user for a new filename.
 void saveAs(java.lang.String filename)
          saves the file being edited to the given filename.
 void setDAVFile(DAVFile file)
          sets the editor's DAVFile
 void setDirty(boolean dirty)
          sets the dirty flag on the editor.
 void setResourceBody(byte[] resourceBody)
          sets the file contents of the editor.
 void setResourceName(java.lang.String resourceName)
          sets the resource name
 void setWriteable(boolean writeable)
          sets the writeable flag on the editor
 
Methods inherited from interface org.skunk.dav.client.gui.Buffer
docking, getComponent, getName, setName, undocking
 

Method Detail

getResourceBody

public byte[] getResourceBody()
Returns:
the file contents of the editor.

setResourceBody

public void setResourceBody(byte[] resourceBody)
sets the file contents of the editor.
Parameters:
the - new contents

getDAVFile

public DAVFile getDAVFile()
Returns:
the DAVFile upon which this editor is operating.

setDAVFile

public void setDAVFile(DAVFile file)
sets the editor's DAVFile
Parameters:
file - the new file

getResourceName

public java.lang.String getResourceName()
Returns:
the name of the resource upon which the editor is operating

setResourceName

public void setResourceName(java.lang.String resourceName)
sets the resource name
Parameters:
resourceName - the new resource name

isDirty

public boolean isDirty()
Returns:
whether the contents of the file have been changed in the editor since the last load or save.

setDirty

public void setDirty(boolean dirty)
sets the dirty flag on the editor.
Parameters:
dirty - the new value of the dirty flag

isWriteable

public boolean isWriteable()
Returns:
whether the editor will accept input

setWriteable

public void setWriteable(boolean writeable)
sets the writeable flag on the editor
Parameters:
writeable - the new value of the writeable flag

save

public void save()
saves the file being edited.

saveAs

public void saveAs()
saves the file being edited, prompting the user for a new filename.

saveAs

public void saveAs(java.lang.String filename)
saves the file being edited to the given filename.
Parameters:
filename - the new filename

load

public void load()
          throws CannotLoadException
loads the contents of the editor's DAVFile into the editor.
Throws:
CannotLoadException - if it cannot load the file.

addEditListener

public void addEditListener(EditListener ed)
adds an EditListener.
Parameters:
ed - the edit listener

removeEditListener

public void removeEditListener(EditListener ed)
removes an EditListener.
Parameters:
ed - the edit listener

getUndoManager

public DAVEditorUndoManager getUndoManager()
Returns:
the undo manager for this editor. May be null.