com.starbase.starteam
Class FolderUpdateEvent

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--com.starbase.starteam.FolderUpdateEvent
All Implemented Interfaces:
java.io.Serializable

public class FolderUpdateEvent
extends java.util.EventObject

An event triggered whenever a Folder is added, moved, changed or deleted in a View.

See Also:
FolderUpdateListener, View.addFolderUpdateListener(com.starbase.starteam.FolderUpdateListener), Folder.addFolderUpdateListener(com.starbase.starteam.FolderUpdateListener, int), FolderListManager.addFolderUpdateListener(com.starbase.starteam.FolderUpdateListener), Serialized Form

Constructor Summary
FolderUpdateEvent(Folder oldFolder, Folder newFolder)
           
 
Method Summary
 boolean equals(java.lang.Object source)
          returns true if this object instance is equal to the source
 Folder getNewFolder()
          Gets the Folder in its new state.
 Folder getOldFolder()
          Gets the Folder in its old state.
 java.lang.Object getSource()
          The object on which the Event initially occurred.
 int hashCode()
          returns a unique hash for all instances of this type
 java.lang.String toString()
          Gets a short description of this Event.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FolderUpdateEvent

public FolderUpdateEvent(Folder oldFolder,
                         Folder newFolder)
Method Detail

getNewFolder

public Folder getNewFolder()
Gets the Folder in its new state.

Used in folderAdded(), folderMoved() and folderChanged() events. In folderRemoved() events, getNewFolder() null.

Returns a Folder object that is not a member of any View's folder hierarchy. There may be a Folder in the hierarchy with the same ItemID, but it would be a physically different object that is likely to have different properties.

Folder.getParentFolder() and Folder.getSubFolders() will return values that are correct as of the time the event was triggered. In fact, the entire Folder hierarchy is valid. For performance reasons, these same Folder objects may be modified and re-used in subsequent events. If an application wants to modify one of the Folder objects, or save its state for later use, it should make its own private copy.

If an application wants to refresh the Folders associated with the original View object, it must do so by explicitly calling View.refreshFolders().

Returns:
The Folder in its new state.
See Also:
FolderUpdateEvent.getOldFolder(), Folder, View.refreshFolders()

getOldFolder

public Folder getOldFolder()
Gets the Folder in its old state.

Used in folderChanged(), folderMoved() and folderRemoved() events. In folderAdded() events, getOldFolder() returns null.

Returns a Folder object that is not a member of any View's folder hierarchy. There may be a Folder in the hierarchy with the same ItemID, but it would be a physically different object that is likely to have different properties.

Folder.getParentFolder() and Folder.getSubFolders() will return values that correctly represent the old state of the folder. In fact, the entire Folder hierarchy is valid. For performance reasons, these same Folder objects may be modified and re-used in subsequent events. If an application wants to modify one of the Folder objects, or save its state for later use, it should make its own private copy.

Returns:
The Folder in its old state.
See Also:
FolderUpdateEvent.getNewFolder(), Folder

getSource

public java.lang.Object getSource()
The object on which the Event initially occurred.

Overrides:
getSource in class java.util.EventObject
Returns:
The object on which the Event initially occurred.

toString

public java.lang.String toString()
Gets a short description of this Event.

Overrides:
toString in class java.util.EventObject
Returns:
A short description of this Event.

equals

public boolean equals(java.lang.Object source)
returns true if this object instance is equal to the source

Overrides:
equals in class java.lang.Object
Parameters:
source - Object the source to comapre with
Returns:
boolean true if this object is equal to the source

hashCode

public int hashCode()
returns a unique hash for all instances of this type

Overrides:
hashCode in class java.lang.Object
Returns:
int a unique hash for all instances of this type


StarTeam SDK 10.4, Build 36
Copyright © 2003-2008 Borland Software Corporation. All rights reserved.