|
Extension SDK | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectoracle.ide.addin.AbstractCommand
oracle.ide.cmd.RemoveFileCommand
The RemoveFileCommand class implements the command to delete
the file(s) on disk that are associated with the selected element(s).
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 | |
RemoveFileCommand()
Constructor. |
|
RemoveFileCommand(int cmdId,
int type)
|
|
| Method Summary | |
protected java.lang.String |
buildFileNamesString(java.util.List elementList)
Build a list of file names |
protected boolean |
canRemove(Element element,
Folder ownerFolder)
Returns true if the specified ownerFolder allows
the element to be removed. |
protected boolean |
canRemove(TNode[] tnodes,
Folder ownerFolder,
java.util.List removedFiles,
java.util.List unremovedFiles)
Returns true if the ownerFolder allows
the elements encapsulated by the specified tnodes
to be removed. |
int |
doit()
Presents the user with the selected list of element files to delete from disk using SelectFilesPanel.showDialog(). |
protected Folder |
findOwner(TNode[] tnodes,
Context context)
Find the owner of the given tnode. |
protected Folder |
findOwner(TNode tnode,
Context context)
Find the owner of the given tnode. |
Document[] |
getAffectedDocuments()
For commands of the NORMAL and NO_UNDO this method should return an array of documents affected by the execution of this command. |
protected boolean |
remove(Document element,
Folder owner)
Removes element from owner. |
protected int |
remove(java.util.List files,
Folder owner,
boolean close)
|
protected int |
remove(java.util.List files,
Folder owner,
boolean close,
java.util.List output)
Remove the list of files from their folder owner. |
| 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 |
public RemoveFileCommand()
public RemoveFileCommand(int cmdId,
int type)
| Method Detail |
public int doit()
throws java.lang.Exception
java.lang.Exceptionpublic Document[] getAffectedDocuments()
Command
getAffectedDocuments in interface CommandgetAffectedDocuments in class AbstractCommand
protected int remove(java.util.List files,
Folder owner,
boolean close)
protected int remove(java.util.List files,
Folder owner,
boolean close,
java.util.List output)
files from their folder owner.
If the close parameter is true, the files
are closed before they are removed from their owner.
Files that could not be removed are added to the output
list.
protected boolean remove(Document element,
Folder owner)
element from owner.
false if the element could not be removed.protected java.lang.String buildFileNamesString(java.util.List elementList)
protected Folder findOwner(TNode[] tnodes,
Context context)
tnode.
Precondition: tnodes and context
cannot be null. If multiple owners are found, this method
returns null. Removing files owned by mutiple folders is
currently not allowed.
protected Folder findOwner(TNode tnode,
Context context)
tnode.
Precondition: tnode and context
cannot be null.
protected boolean canRemove(Element element,
Folder ownerFolder)
ownerFolder allows
the element to be removed.
Precondition: element and ownerFolder
cannot be null.
protected boolean canRemove(TNode[] tnodes,
Folder ownerFolder,
java.util.List removedFiles,
java.util.List unremovedFiles)
true if the ownerFolder allows
the elements encapsulated by the specified tnodes
to be removed. The elements that can be reomved are listed
in the removeFiles list while the ones that cannot
be removed are listed in the unremovedFiles list.
Precondition: none of the given parameters can be null.
|
Extension SDK | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Copyright ©1997, 2003, Oracle. All rights reserved.