Extension SDK 10.1.2

oracle.ide.cmd
Class RemoveFromDiskCommand

java.lang.Object
  extended byoracle.ide.addin.AbstractCommand
      extended byoracle.ide.cmd.RemoveFileCommand
          extended byoracle.ide.cmd.RemoveFromDiskCommand
All Implemented Interfaces:
Command

public class RemoveFromDiskCommand
extends RemoveFileCommand

The RemoveFileCommand class implements the command to delete the file(s) on disk that are associated with the selected element(s).

See Also:
oracle.ide.Command, oracle.ide.AbstractCommand

Field Summary
 
Fields inherited from class oracle.ide.addin.AbstractCommand
cmdId, context, name, type
 
Fields inherited from interface oracle.ide.addin.Command
CANCEL, EXECUTING, NO_CHANGE, NO_UNDO, NORMAL, OK
 
Constructor Summary
RemoveFromDiskCommand()
          Constructor.
 
Method Summary
protected  UpdateMessage createUpdateMessage()
          Creates an UpdateMessage whose ID is oracle.ide.addin.UpdateMessage.CHILD_REMOVED and stores the command ID as a user property.
 int doit()
          Presents the user with the selected list of element files to delete from disk using SelectFilesPanel.showDialog().
protected  boolean remove(Document document, Folder owner)
          Removes element from owner.
 
Methods inherited from class oracle.ide.cmd.RemoveFileCommand
buildFileNamesString, canRemove, canRemove, findOwner, findOwner, getAffectedDocuments, remove, remove
 
Methods inherited from class oracle.ide.addin.AbstractCommand
getContext, getData, getId, getName, getType, setContext, setData, undo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoveFromDiskCommand

public RemoveFromDiskCommand()
Constructor.

Method Detail

doit

public int doit()
         throws java.lang.Exception
Presents the user with the selected list of element files to delete from disk using SelectFilesPanel.showDialog(). Any files selected by the user are then removed from their containing folders and deleted from disk. Note that although the Action associated with this command is enabled (otherwise we should never get here), it has been enabled with a quick check version of canRemove() called on each selected element's folder. A more thorough version of canRemove() check is performed here prior to actually performing the remove().

Specified by:
doit in interface Command
Overrides:
doit in class RemoveFileCommand
Throws:
java.lang.Exception

remove

protected boolean remove(Document document,
                         Folder owner)
Description copied from class: RemoveFileCommand
Removes element from owner.

Overrides:
remove in class RemoveFileCommand
Returns:
false if the element could not be removed.

createUpdateMessage

protected UpdateMessage createUpdateMessage()
Description copied from class: RemoveFileCommand
Creates an UpdateMessage whose ID is oracle.ide.addin.UpdateMessage.CHILD_REMOVED and stores the command ID as a user property.

Overrides:
createUpdateMessage in class RemoveFileCommand
Returns:
an UpdateMessage whose ID is oracle.ide.addin.UpdateMessage.CHILD_REMOVED.
See Also:
UpdateMessage.CHILD_REMOVED

Extension SDK

 

Copyright © 1997, 2004, Oracle. All rights reserved.