public class RemoveFromDiskCommand extends RemoveFileCommand
RemoveFileCommand
class implements the command to delete
the file(s) on disk that are associated with the selected element(s).Constructor and Description |
---|
RemoveFromDiskCommand()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
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) |
buildFileNamesString, canRemove, canRemove, getAffectedNodes, remove, remove
enableConfirmation, getContext, getData, getId, getName, getProgressHandle, getType, isGlobal, setContext, setData, setTaskInfo, undo
public void setSilently(boolean silently)
public int doit() throws java.lang.Exception
doit
in class RemoveFileCommand
java.lang.Exception
protected boolean remove(Node node, Folder owner)
RemoveFileCommand
element
from owner
.remove
in class RemoveFileCommand
false
if the element could not be removed.protected UpdateMessage createUpdateMessage()
RemoveFileCommand
UpdateMessage
whose ID is
UpdateMessage.CHILD_REMOVED
and stores the
command ID as a user property.createUpdateMessage
in class RemoveFileCommand
UpdateMessage
whose ID is
UpdateMessage.CHILD_REMOVED
.UpdateMessage.CHILD_REMOVED
protected boolean isNeedConfirmClose()
isNeedConfirmClose
in class RemoveFileCommand
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.