com.partnersoft.codex
Class CodexEdit

java.lang.Object
  extended by com.partnersoft.codex.CodexEdit
Direct Known Subclasses:
CodexResourceEdit, CodexStructuralEdit

public abstract class CodexEdit
extends java.lang.Object

An undoable edit to something in the system.

Author:
Russell Cagle Copyright 2006 Partner Software, Inc.

Field Summary
protected  boolean applied
           
protected  int id
           
 
Constructor Summary
protected CodexEdit()
           
 
Method Summary
protected abstract  void apply()
          For CodexResources, this sets the bytes in memory without writing them to disk.
protected abstract  void dispose()
          For CodexStructuralEdits, deletes the backup from the filesystem.
abstract  CodexNode getEditedNode()
          The edited object.
 int getId()
           
 boolean isApplied()
           
protected abstract  void rollback()
          For CodexResources, this sets the bytes in memory without writing them to disk.
protected  void setApplied(boolean applied)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

applied

protected boolean applied

id

protected int id
Constructor Detail

CodexEdit

protected CodexEdit()
Method Detail

apply

protected abstract void apply()
                       throws java.io.IOException
For CodexResources, this sets the bytes in memory without writing them to disk. The EditManager will periodically flush the changes to disk. For Codices and CodexSections, this creates directories and moves files around.

Throws:
java.io.IOException

dispose

protected abstract void dispose()
                         throws java.io.IOException
For CodexStructuralEdits, deletes the backup from the filesystem. Note that dispose() is always called on undone edits.

Throws:
java.io.IOException

rollback

protected abstract void rollback()
                          throws java.io.IOException
For CodexResources, this sets the bytes in memory without writing them to disk. The EditManager will periodically flush the changes to disk. For Codices and CodexSections, this creates directories and moves files around.

Throws:
java.io.IOException

setApplied

protected void setApplied(boolean applied)

getEditedNode

public abstract CodexNode getEditedNode()
The edited object. Mainly to help the GUI highlight the appropriate stuff.

Returns:

getId

public int getId()

isApplied

public boolean isApplied()