org.gerhardb.jibs.viewer.sortscreen
Class UndoableMovingFile

java.lang.Object
  extended byjava.io.File
      extended byorg.gerhardb.jibs.viewer.sortscreen.UndoableMovingFile
All Implemented Interfaces:
java.lang.Comparable, java.io.Serializable, javax.swing.undo.UndoableEdit

public class UndoableMovingFile
extends java.io.File
implements javax.swing.undo.UndoableEdit

Designed to provide undo support for drags from the main picture to the file tree.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.io.File
pathSeparator, pathSeparatorChar, separator, separatorChar
 
Constructor Summary
UndoableMovingFile(DTNPage dtnPage)
           
UndoableMovingFile(java.io.File file)
           
UndoableMovingFile(java.io.File file, DirectoryTreeNode fromDirNode)
           
UndoableMovingFile(java.lang.String fileName)
           
 
Method Summary
 boolean addEdit(javax.swing.undo.UndoableEdit anEdit)
           
 boolean canRedo()
           
 boolean canUndo()
           
 void die()
           
 boolean doIt(DirectoryTreeNode toDirNode, boolean move, SortScreen sortScreen, boolean addToUndoList, boolean updateRepeat)
          Returning true from this will eventually cause the files to be removed from the scrolling list if that's where the drop orginated from.
 boolean equals(java.lang.Object obj)
           
 java.lang.String getPresentationName()
           
 java.lang.String getRedoPresentationName()
           
 java.lang.String getUndoPresentationName()
           
 boolean isSignificant()
           
 void redo()
           
 boolean replaceEdit(javax.swing.undo.UndoableEdit anEdit)
           
 void undo()
           
 
Methods inherited from class java.io.File
canRead, canWrite, compareTo, compareTo, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, exists, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getName, getParent, getParentFile, getPath, hashCode, isAbsolute, isDirectory, isFile, isHidden, lastModified, length, list, list, listFiles, listFiles, listFiles, listRoots, mkdir, mkdirs, renameTo, setLastModified, setReadOnly, toString, toURI, toURL
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UndoableMovingFile

public UndoableMovingFile(java.lang.String fileName)
Parameters:
fileName - File to move.

UndoableMovingFile

public UndoableMovingFile(java.io.File file)
Parameters:
file - File to move.

UndoableMovingFile

public UndoableMovingFile(java.io.File file,
                          DirectoryTreeNode fromDirNode)
Parameters:
file - File to move.
fromDirNode - where it came from

UndoableMovingFile

public UndoableMovingFile(DTNPage dtnPage)
Method Detail

undo

public void undo()
          throws javax.swing.undo.CannotUndoException
Specified by:
undo in interface javax.swing.undo.UndoableEdit
Throws:
javax.swing.undo.CannotUndoException

redo

public void redo()
          throws javax.swing.undo.CannotRedoException
Specified by:
redo in interface javax.swing.undo.UndoableEdit
Throws:
javax.swing.undo.CannotRedoException

canRedo

public boolean canRedo()
Specified by:
canRedo in interface javax.swing.undo.UndoableEdit

canUndo

public boolean canUndo()
Specified by:
canUndo in interface javax.swing.undo.UndoableEdit

die

public void die()
Specified by:
die in interface javax.swing.undo.UndoableEdit

getPresentationName

public java.lang.String getPresentationName()
Specified by:
getPresentationName in interface javax.swing.undo.UndoableEdit

getRedoPresentationName

public java.lang.String getRedoPresentationName()
Specified by:
getRedoPresentationName in interface javax.swing.undo.UndoableEdit

getUndoPresentationName

public java.lang.String getUndoPresentationName()
Specified by:
getUndoPresentationName in interface javax.swing.undo.UndoableEdit

isSignificant

public boolean isSignificant()
Specified by:
isSignificant in interface javax.swing.undo.UndoableEdit

addEdit

public boolean addEdit(javax.swing.undo.UndoableEdit anEdit)
Specified by:
addEdit in interface javax.swing.undo.UndoableEdit

replaceEdit

public boolean replaceEdit(javax.swing.undo.UndoableEdit anEdit)
Specified by:
replaceEdit in interface javax.swing.undo.UndoableEdit

doIt

public boolean doIt(DirectoryTreeNode toDirNode,
                    boolean move,
                    SortScreen sortScreen,
                    boolean addToUndoList,
                    boolean updateRepeat)
             throws java.lang.Exception
Returning true from this will eventually cause the files to be removed from the scrolling list if that's where the drop orginated from.

Parameters:
toDirNode - The node where the file is to be moved to.
move - If true, move. If false, copy.
sortScreen - Component to display any error message on top of.
addToUndoList - add to undo list
updateRepeat - update repeat
Returns:
true if it worked.
Throws:
java.lang.Exception

equals

public boolean equals(java.lang.Object obj)


Copyright © 2002 Gerhard Beck. All rights reserved. Subject to GPL.