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

java.lang.Object
  |
  +--org.skunk.dav.client.gui.editor.AbstractDAVEditor
All Implemented Interfaces:
Buffer, DAVEditor
Direct Known Subclasses:
ImageViewer, MessageCatalogEditor, SimpleTextEditor

public abstract class AbstractDAVEditor
extends java.lang.Object
implements DAVEditor


Constructor Summary
AbstractDAVEditor(DAVFile file)
           
 
Method Summary
 void addEditListener(EditListener ed)
          adds an EditListener.
 void docking()
          hook method, called when component is docked
abstract  javax.swing.JComponent getComponent()
           
 DAVFile getDAVFile()
           
 java.lang.String getName()
           
 byte[] getResourceBody()
           
 java.lang.String getResourceName()
           
protected  void handleNulledFile()
           
 boolean isDirty()
           
 boolean isWriteable()
           
abstract  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 setName(java.lang.String name)
          set the buffer's name
 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
 void undocking()
          hook method, called when component is undocked
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.skunk.dav.client.gui.editor.DAVEditor
getUndoManager
 

Constructor Detail

AbstractDAVEditor

public AbstractDAVEditor(DAVFile file)
Method Detail

docking

public void docking()
Description copied from interface: Buffer
hook method, called when component is docked
Specified by:
docking in interface Buffer

undocking

public void undocking()
Description copied from interface: Buffer
hook method, called when component is undocked
Specified by:
undocking in interface Buffer

setDAVFile

public void setDAVFile(DAVFile file)
Description copied from interface: DAVEditor
sets the editor's DAVFile
Specified by:
setDAVFile in interface DAVEditor
Following copied from interface: org.skunk.dav.client.gui.editor.DAVEditor
Parameters:
file - the new file

handleNulledFile

protected void handleNulledFile()

getDAVFile

public DAVFile getDAVFile()
Specified by:
getDAVFile in interface DAVEditor
Following copied from interface: org.skunk.dav.client.gui.editor.DAVEditor
Returns:
the DAVFile upon which this editor is operating.

setName

public void setName(java.lang.String name)
Description copied from interface: Buffer
set the buffer's name
Specified by:
setName in interface Buffer

getName

public java.lang.String getName()
Specified by:
getName in interface Buffer
Following copied from interface: org.skunk.dav.client.gui.Buffer
Returns:
the buffer's name

getResourceBody

public byte[] getResourceBody()
Specified by:
getResourceBody in interface DAVEditor
Following copied from interface: org.skunk.dav.client.gui.editor.DAVEditor
Returns:
the file contents of the editor.

setResourceBody

public void setResourceBody(byte[] resourceBody)
Description copied from interface: DAVEditor
sets the file contents of the editor.
Specified by:
setResourceBody in interface DAVEditor
Following copied from interface: org.skunk.dav.client.gui.editor.DAVEditor
Parameters:
the - new contents

getResourceName

public java.lang.String getResourceName()
Specified by:
getResourceName in interface DAVEditor
Following copied from interface: org.skunk.dav.client.gui.editor.DAVEditor
Returns:
the name of the resource upon which the editor is operating

setResourceName

public void setResourceName(java.lang.String resourceName)
Description copied from interface: DAVEditor
sets the resource name
Specified by:
setResourceName in interface DAVEditor
Following copied from interface: org.skunk.dav.client.gui.editor.DAVEditor
Parameters:
resourceName - the new resource name

isDirty

public boolean isDirty()
Specified by:
isDirty in interface DAVEditor
Following copied from interface: org.skunk.dav.client.gui.editor.DAVEditor
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)
Description copied from interface: DAVEditor
sets the dirty flag on the editor.
Specified by:
setDirty in interface DAVEditor
Following copied from interface: org.skunk.dav.client.gui.editor.DAVEditor
Parameters:
dirty - the new value of the dirty flag

isWriteable

public boolean isWriteable()
Specified by:
isWriteable in interface DAVEditor
Following copied from interface: org.skunk.dav.client.gui.editor.DAVEditor
Returns:
whether the editor will accept input

setWriteable

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

getComponent

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

save

public void save()
Description copied from interface: DAVEditor
saves the file being edited.
Specified by:
save in interface DAVEditor

saveAs

public final void saveAs()
Description copied from interface: DAVEditor
saves the file being edited, prompting the user for a new filename.
Specified by:
saveAs in interface DAVEditor

saveAs

public final void saveAs(java.lang.String filename)
Description copied from interface: DAVEditor
saves the file being edited to the given filename.
Specified by:
saveAs in interface DAVEditor
Following copied from interface: org.skunk.dav.client.gui.editor.DAVEditor
Parameters:
filename - the new filename

load

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

addEditListener

public void addEditListener(EditListener ed)
Description copied from interface: DAVEditor
adds an EditListener.
Specified by:
addEditListener in interface DAVEditor
Following copied from interface: org.skunk.dav.client.gui.editor.DAVEditor
Parameters:
ed - the edit listener

removeEditListener

public void removeEditListener(EditListener ed)
Description copied from interface: DAVEditor
removes an EditListener.
Specified by:
removeEditListener in interface DAVEditor
Following copied from interface: org.skunk.dav.client.gui.editor.DAVEditor
Parameters:
ed - the edit listener