Extension SDK 10.1.2

oracle.ide.cmd
Class RenameMessage

java.lang.Object
  extended byoracle.ide.addin.Message
      extended byoracle.ide.addin.UpdateMessage
          extended byoracle.ide.cmd.RenameMessage

public class RenameMessage
extends UpdateMessage

There are 5 cases to be considered when the OBJECT_RENAMED message is sent. The RenameMessage provides the following information for each case:

Case 1) Simple object rename: getOldURL() retrieves the previous document URL. getRenamedDocument() retrieves the document renamed.

Case 2) Renaming document changes the document's type: getOldURL() retrieves the previous document URL. getRenamedDocument() retrieves the document renamed. getRemovedDocument() retrieves the original node being replaced. getNewDocument() gets the replacing document. This could return null if that document is already in the same container as the original document being replaced.

Case 3) Document being renamed the same as an existing document of the same type: getOldURL() retrieves the previous document URL. getRenamedDocument() retrieves the document renamed. getRemovedDocument() retrieves the original node being renamed. getNewDocument() may contain the existing node instance if that instance is not part of the project containing the original node.

Case 4) Node being renamed the same as an existing node of different type: Not yet supported. There are 5 cases to be considered when the CHILD_RENAMED message is sent. The RenameMessage provides the following information for each case:

Case 0) Pre-rename notification. Case 1) Simple object rename: getOldURL() contains the old URL and the child being renamed. getRenamedDocument() retrieves the document renamed.

Case 2) Renaming node changes the node's type getOldURL() retrieves the previous document URL. getRenamedDocument() retrieves the document renamed. getRemovedDocument() retrieves the original node being replaced. getNewDocument() gets the replacing document. This could return null if that document is already in the same container as the original document being replaced.

Case 3) Node being renamed the same as an existing node of the same type: getOldURL() retrieves the previous document URL. getRenamedDocument() retrieves the document renamed. getRemovedDocument() retrieves the original node being renamed. getNewDocument() get the replacing document.

Case 4) Node being renamed the same as an existing node of different type: Not yet supported.

See Also:
UpdateMessage, Subject

Field Summary
 
Fields inherited from class oracle.ide.addin.UpdateMessage
ATTRIBUTE_CHANGED, CHILD_ADDED, CHILD_REMOVED, CHILD_RENAMED, OBJECT_CLOSED, OBJECT_CLOSING, OBJECT_OPENED, OBJECT_RELOADED, OBJECT_RENAMED, PROPERTY_SET, STRUCTURE_CHANGED
 
Fields inherited from class oracle.ide.addin.Message
add, COMMAND_ID_PROP, container, context, messageID, messageProperties, modify, origin, remove
 
Constructor Summary
RenameMessage(int messageID, java.lang.Object origin)
          Constructs an update message of the specified message id.
 
Method Summary
static void fireChildRenamed(Subject subject, Document doc, java.net.URL oldURL, Document node, Context context)
          Case 3) Child renamed notification.
static void fireChildRenamed(Subject subject, java.net.URL oldURL, Document doc, Context context)
          Case 1) Child rename notification.
static void fireChildRenamed(Subject subject, java.net.URL oldURL, Document doc, Document duplicate, Context context)
          Case 2) Child renamed notification.
static void fireObjectRenamed(Document doc, java.net.URL oldURL, Document node, Context context)
          Case 3) Object renamed notification.
static void fireObjectRenamed(Subject subject, java.net.URL oldURL, Context context)
          Case 1) Object rename notification.
static void fireObjectRenamed(Subject subject, java.net.URL oldURL, Document doc, Document duplicate, Context context)
          Case 2) Object renamed notification.
static void firePreChildRenamed(Subject subject, Context context)
          Call this method before the subject is actually renamed.
 Document getNewDocument()
          Get the new document created when an existing one was renamed.
 java.net.URL getOldURL()
          Get the document's old url.
 Document getRemovedDocument()
          Get the document being removed because the rename caused the creation of a new node.
 Document getRenamedDocument()
          Get the renamed document.
 boolean isPreRenameMessage()
          Check if this notification message is being sent before the actual object rename happened.
 
Methods inherited from class oracle.ide.addin.UpdateMessage
fireAttributeChanged, fireChildAdded, fireChildAdded, fireChildRemoved, fireChildRemoved, fireChildrenAdded, fireChildrenAdded, fireChildrenRemoved, fireChildrenRemoved, fireObjectClosed, fireObjectOpened, fireObjectReloaded, firePropertiesChanged, fireStructureChanged, fireStructureChanged, fromNewOrigin, getContainer, getMessageMap, getPropertyMap, getUniqueMessageID, notifyObserversOnEventThread, setPropertyMap
 
Methods inherited from class oracle.ide.addin.Message
getAddObjects, getContext, getExtraData, getMessageID, getModifyObjects, getOrigin, getProperty, getRemoveObjects, setContext, setExtraData, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RenameMessage

public RenameMessage(int messageID,
                     java.lang.Object origin)
Constructs an update message of the specified message id.

Parameters:
origin - the Object which originated this message. Usually an Observer.
messageID - the message identifier.
Method Detail

isPreRenameMessage

public boolean isPreRenameMessage()
Check if this notification message is being sent before the actual object rename happened.


getOldURL

public java.net.URL getOldURL()
Get the document's old url.


getRenamedDocument

public Document getRenamedDocument()
Get the renamed document. Returns null when isPreDocumentRename() returns true.


getRemovedDocument

public Document getRemovedDocument()
Get the document being removed because the rename caused the creation of a new node.


getNewDocument

public Document getNewDocument()
Get the new document created when an existing one was renamed.


fireObjectRenamed

public static void fireObjectRenamed(Subject subject,
                                     java.net.URL oldURL,
                                     Context context)
Case 1) Object rename notification. The subject is the document being renamed, The oldURL is the previous document URL. Observers should use the methods: getOldURL() to get at the old URL.


fireChildRenamed

public static void fireChildRenamed(Subject subject,
                                    java.net.URL oldURL,
                                    Document doc,
                                    Context context)
Case 1) Child rename notification. The subject is the owner of the document. The oldURL is the previous document URL. Observers should use the methods: getOldURL() to get at the old URL. getRenamedDocument to get at the document renamed.


fireObjectRenamed

public static void fireObjectRenamed(Subject subject,
                                     java.net.URL oldURL,
                                     Document doc,
                                     Document duplicate,
                                     Context context)
Case 2) Object renamed notification. The subject is the document being renamed. The doc is the original document that after being renamed, should be removed from its owner. The duplicate is the new document created with the new URL. The duplicate parameter may be null if the original doc object was renamed to an existing node. Observers should use the methods: getOldURL() to get at the old URL getRemovedDocument() to get at the original document being replaced. getNewDocument() to get the replacing document. This could return null if that document is already in the same container as the original document.


fireChildRenamed

public static void fireChildRenamed(Subject subject,
                                    java.net.URL oldURL,
                                    Document doc,
                                    Document duplicate,
                                    Context context)
Case 2) Child renamed notification. The subject is the owner of the document being renamed. The doc is the original document that after being renamed, should be removed from its owner. The duplicate is the new document created with the new URL. The duplicate parameter may be null if the original doc object was renamed to an existing node. Observers should use the methods: getOldURL() to get at the old URL getRemovedDocument() to get at the original document being replaced. getNewDocument() to get the replacing document. This could return null if that document is already in the same container as the original document.


fireObjectRenamed

public static void fireObjectRenamed(Document doc,
                                     java.net.URL oldURL,
                                     Document node,
                                     Context context)
Case 3) Object renamed notification. The subject is the document being renamed. The doc is the original document that after being renamed, should be removed from its owner. The node is the new document created with the new URL. Observers should use the methods: getOldURL() to get at the old URL getRemovedDocument() to get at the original document being replaced. getNewDocument() to get the replacing document.


fireChildRenamed

public static void fireChildRenamed(Subject subject,
                                    Document doc,
                                    java.net.URL oldURL,
                                    Document node,
                                    Context context)
Case 3) Child renamed notification. The subject is the owner of the document being renamed. The doc is the original document that after being renamed, should be removed from its owner. The node is the new document created with the new URL. Observers should use the methods: getOldURL() to get at the old URL getRemovedDocument() to get at the original document being replaced. getNewDocument() to get the replacing document.


firePreChildRenamed

public static void firePreChildRenamed(Subject subject,
                                       Context context)
Call this method before the subject is actually renamed.


Extension SDK

 

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