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

E13403-03

oracle.ide.cmd
Class SaveAsCommand

java.lang.Object
  extended by oracle.ide.controller.Command
      extended by oracle.ide.cmd.SaveAsCommand
Direct Known Subclasses:
EditorSaveAsCommand, RenameCommand

public class SaveAsCommand
extends Command

The SaveAsCommand class implements the SaveAs command.


Field Summary
protected  Context _context
           
protected  Node _duplicate
           
protected  Folder _elementOwner
           
protected  java.net.URL _newURL
           
protected  java.lang.Class _nodeClass
           
protected  boolean _noPlaceToAdd
           
protected  ContentSet _sourceContentSet
           
protected static int CANCELED
           
protected static int OK_NAME_CHANGED
           
protected static int OK_NAME_UNCHANGED
           
 
Fields inherited from class oracle.ide.controller.Command
CANCEL, context, EXECUTING, MULTI_NODE, NO_CHANGE, NO_UNDO, NORMAL, OK, type
 
Constructor Summary
  SaveAsCommand()
           
protected SaveAsCommand(int cmdId)
           
 
Method Summary
protected  boolean approveNewURL(java.net.URL selectedURL)
           
protected  int convertToDupNode(Node doc)
           
protected  int convertToNewNode(Node doc)
          Rename with node conversion.
 int doit()
          Executes the actions associated with a specific command.
protected  int doSaveAs(java.lang.String dialogTitle)
           
protected  void getOwningContentSet(Node node)
           
protected  int handleNodeOwnership(Node doc, Node node, java.net.URL oldURL)
          This method handles adding/removing/replacing the Node from it's owner Subclasses of the command may need to handle ownership differently (eg, RenameCommand should do something different from SaveAsCommand).
protected  boolean isSameFile(java.net.URL newURL, java.net.URL elementURL)
          Used to determine if the new URL we're going to Save As is the same as the elementURL.
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 saved as a different name in addition to the name it already has.
protected  boolean saveFileDlgOK(Context context, Node doc, java.lang.String dialogTitle)
           
protected  int saveNode(Node doc)
           
protected  java.net.URL validateNewURL(Recognizer recognizer, java.net.URL newURL, java.net.URL oldURL)
           
 
Methods inherited from class oracle.ide.controller.Command
getAffectedNodes, 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
 

Field Detail

OK_NAME_CHANGED

protected static final int OK_NAME_CHANGED
See Also:
Constant Field Values

OK_NAME_UNCHANGED

protected static final int OK_NAME_UNCHANGED
See Also:
Constant Field Values

CANCELED

protected static final int CANCELED
See Also:
Constant Field Values

_context

protected Context _context

_nodeClass

protected java.lang.Class _nodeClass

_elementOwner

protected Folder _elementOwner

_newURL

protected java.net.URL _newURL

_duplicate

protected Node _duplicate

_noPlaceToAdd

protected boolean _noPlaceToAdd

_sourceContentSet

protected ContentSet _sourceContentSet
Constructor Detail

SaveAsCommand

public SaveAsCommand()

SaveAsCommand

protected SaveAsCommand(int cmdId)
Method Detail

doit

public int doit()
         throws java.lang.Exception
Description copied from class: Command
Executes the actions associated with a specific command. When a command executes successfully, implementations should return OK, otherwise, return CANCEL or any other non-zero value.

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

validateNewURL

protected java.net.URL validateNewURL(Recognizer recognizer,
                                      java.net.URL newURL,
                                      java.net.URL oldURL)

saveFileDlgOK

protected boolean saveFileDlgOK(Context context,
                                Node doc,
                                java.lang.String dialogTitle)

doSaveAs

protected int doSaveAs(java.lang.String dialogTitle)

convertToNewNode

protected int convertToNewNode(Node doc)
Rename with node conversion.


handleNodeOwnership

protected int handleNodeOwnership(Node doc,
                                  Node node,
                                  java.net.URL oldURL)
                           throws java.lang.Exception
This method handles adding/removing/replacing the Node from it's owner Subclasses of the command may need to handle ownership differently (eg, RenameCommand should do something different from SaveAsCommand).

Parameters:
doc -
node -
oldURL -
Returns:
Throws:
java.lang.Exception

convertToDupNode

protected int convertToDupNode(Node doc)

saveAsNewNode

protected int saveAsNewNode(Node doc)
The specified doc is being saved as a different name in addition to the name it already has. The doc class has not changed (that is an html Node has not been renamed as a jsp Node).


saveNode

protected int saveNode(Node doc)

saveAsDupNode

protected int saveAsDupNode(Node doc)
There is already a node in the cache with the new url.


isSameFile

protected boolean isSameFile(java.net.URL newURL,
                             java.net.URL elementURL)
Used to determine if the new URL we're going to Save As is the same as the elementURL. For purposes of a Save As we need to use URLFileSystem.equals() so we get the right answer taking into consideration if the file system is case-sensitive or not. For Save As on a case-insensitive file system we can't let Untitled.jsp be saved as untitled.jsp as we need 2 files on disk, but only have 1 name.

Parameters:
newURL -
elementURL -
Returns:
true if the files are the same; false otherwise

approveNewURL

protected boolean approveNewURL(java.net.URL selectedURL)

getOwningContentSet

protected void getOwningContentSet(Node node)

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.