|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.partnersoft.io.vfs.UndoableVfs
public class UndoableVfs
A wrapper around an editable VFS that allows transactional undo.
To use, you must start a transaction using startTransaction(), then end it with endTransaction(). The latter returns an Undoable you can store.
The implementation is based on storing changes in a subdirectory of the VFS. This allows efficient moves and copies. By default this subdirectory is archive/vfs.
Copyright 2009 Partner Software, Inc.
| Constructor Summary | |
|---|---|
UndoableVfs(Vfs vfs)
|
|
UndoableVfs(Vfs vfs,
Path archivePath)
|
|
UndoableVfs(Vfs vfs,
java.lang.String archivePath)
|
|
| Method Summary | |
|---|---|
void |
clearTransactions()
|
VfsDirectory |
directoryFor(Path path)
Returns a VfsDirectory for the given path. |
VfsDirectory |
directoryFor(java.lang.String pathString)
Returns a VfsDirectory for the given path. |
java.lang.String |
endTransaction()
Ends a file modification transaction. |
VfsFile |
fileFor(Path path)
Returns a VfsFile for the given path. |
VfsFile |
fileFor(java.lang.String pathString)
Returns a VfsFile for the given path string. |
Path |
getAbsolutePath()
Absolute path to the root of this Vfs. |
boolean |
inTransaction()
|
boolean |
isTransactionNode(VfsNode node)
|
boolean |
isWritable()
True if this module supports writing. |
java.util.List<java.lang.String> |
listRedoTransactions()
Lists the available transaction names in the redo queue, ordered from oldest to newest by original transaction time. |
java.util.List<java.lang.String> |
listUndoTransactions()
Lists the available transaction names in the undo queue, ordered from newest to oldest by original transaction time. |
void |
redo()
|
void |
redo(java.lang.String transactionName)
Redoes the named transaction. |
java.lang.String |
startTransaction()
Starts a file modification transaction. |
void |
undo()
|
void |
undo(java.lang.String transactionName)
Undoes the named transaction. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public UndoableVfs(Vfs vfs)
public UndoableVfs(Vfs vfs,
Path archivePath)
public UndoableVfs(Vfs vfs,
java.lang.String archivePath)
| Method Detail |
|---|
public boolean isTransactionNode(VfsNode node)
public boolean inTransaction()
public java.lang.String startTransaction()
throws java.io.IOException
java.io.IOException
public java.lang.String endTransaction()
throws java.io.IOException
java.io.IOException
public java.util.List<java.lang.String> listUndoTransactions()
throws java.io.IOException
java.io.IOException
public java.util.List<java.lang.String> listRedoTransactions()
throws java.io.IOException
java.io.IOException
public void undo(java.lang.String transactionName)
throws java.io.IOException
java.io.IOException
public void redo(java.lang.String transactionName)
throws java.io.IOException
java.io.IOException
public void redo()
throws java.io.IOException
java.io.IOException
public void undo()
throws java.io.IOException
java.io.IOException
public void clearTransactions()
throws java.io.IOException
java.io.IOExceptionpublic VfsDirectory directoryFor(Path path)
Vfs
directoryFor in interface Vfspath - to directory
public VfsDirectory directoryFor(java.lang.String pathString)
Vfs
directoryFor in interface VfspathString - string-encoded path to directory
public VfsFile fileFor(Path path)
Vfs
fileFor in interface Vfspath - to file
public VfsFile fileFor(java.lang.String pathString)
Vfs
fileFor in interface VfspathString - string-encoded path to file
public Path getAbsolutePath()
Vfs
getAbsolutePath in interface Vfspublic boolean isWritable()
Vfs
isWritable in interface Vfs
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||