Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-03

oracle.ide.cmd
Class RemoveFromDiskCommand

java.lang.Object
  extended by oracle.ide.controller.Command
      extended by oracle.ide.cmd.RemoveFileCommand
          extended by oracle.ide.cmd.RemoveFromDiskCommand

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:
Command, Command

Field Summary
 
Fields inherited from class oracle.ide.controller.Command
CANCEL, context, EXECUTING, MULTI_NODE, NO_CHANGE, NO_UNDO, NORMAL, OK, type
 
Constructor Summary
RemoveFromDiskCommand()
          Constructor.
 
Method Summary
protected  UpdateMessage createUpdateMessage()
          Creates an UpdateMessage whose ID is 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 isNeedConfirmClose()
          Override default behavior to suppress the 'Save Files' dialog when files are about to be removed from disk.
protected  boolean remove(Node node, Folder owner)
          Removes element from owner.
 void setSilently(boolean silently)
           
 
Methods inherited from class oracle.ide.cmd.RemoveFileCommand
buildFileNamesString, canRemove, canRemove, getAffectedNodes, remove, remove
 
Methods inherited from class oracle.ide.controller.Command
getContext, getData, getId, getName, getType, isGlobal, 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

setSilently

public void setSilently(boolean silently)

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().

Overrides:
doit in class RemoveFileCommand
Throws:
java.lang.Exception

remove

protected boolean remove(Node node,
                         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 UpdateMessage.CHILD_REMOVED and stores the command ID as a user property.

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

isNeedConfirmClose

protected boolean isNeedConfirmClose()
Override default behavior to suppress the 'Save Files' dialog when files are about to be removed from disk.

Overrides:
isNeedConfirmClose in class RemoveFileCommand
Returns:
true if the user should be prompted to save dirty nodes prior to removing them. This allows suppression of the 'Save Files' dialog when the files are about to be removed from disk altogether.

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-03

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