public class RenameCommand extends SaveAsCommand
RenameCommand
class implements the Rename command.Command
_context, _duplicate, _elementOwner, _newURL, _nodeClass, _noPlaceToAdd, _sourceContentSet, CANCELED, OK_NAME_CHANGED, OK_NAME_UNCHANGED
Constructor and Description |
---|
RenameCommand()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
doit()
Rename the selected element
|
protected int |
handleNodeOwnership(Node doc,
Node node,
java.net.URL oldURL) |
protected boolean |
isSameFile(java.net.URL newURL,
java.net.URL elementURL)
Used to determine if the new URL we're going to rename the elementURL to
is the same file.
|
protected int |
saveAsDupNode(Node doc)
There is already a node in the cache with the new url.
|
protected int |
saveAsNewNode(Node doc)
The specified
doc is being renamed. |
protected int |
saveNode(Node doc) |
void |
setSilently(boolean silently) |
protected java.net.URL |
validateNewURL(Recognizer recognizer,
java.net.URL newURL,
java.net.URL oldURL)
Validates whether the given recognizer can support rename from the
oldURL to the newURL . |
approveNewURL, convertToDupNode, convertToNewNode, doSaveAs, getOwningContentSet, saveFileDlgOK
enableConfirmation, getAffectedNodes, 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 SaveAsCommand
java.lang.Exception
protected int saveNode(Node doc)
saveNode
in class SaveAsCommand
protected int saveAsNewNode(Node doc)
doc
is being renamed.
The doc
class has not changed (that is an html Node
has not been renamed as a jsp Node).saveAsNewNode
in class SaveAsCommand
protected int saveAsDupNode(Node doc)
saveAsDupNode
in class SaveAsCommand
protected int handleNodeOwnership(Node doc, Node node, java.net.URL oldURL) throws java.lang.Exception
java.lang.Exception
protected boolean isSameFile(java.net.URL newURL, java.net.URL elementURL)
isSameFile
in class SaveAsCommand
newURL
- elementURL
- protected java.net.URL validateNewURL(Recognizer recognizer, java.net.URL newURL, java.net.URL oldURL)
oldURL
to the newURL
. If the oldURL
has an extension and the newURL
does not, a URL
with
the old extension will be returned. If the oldURL
has a
.jws or .jpr extension and the newURL
does not, the URL
returned will contain the .jws or .jpr extension.validateNewURL
in class SaveAsCommand
recognizer
- newURL
- oldURL
-