wt.folder
Class FolderServiceEvent

java.lang.Object
  extended bywt.events.KeyedEvent
      extended bywt.folder.FolderServiceEvent

public final class FolderServiceEvent
extends KeyedEvent

Used to represent events occuring within the FolderService.

Supported API: true

Extendable: false


Field Summary
private  Folder destinationFolder
          The folder that the object is being moved to.
private  WTKeyedMap destinationFoldersToTargets
          A mapping of source Folders to WTSets of FolderEntries that are being moved to the folders.
static String POST_CHANGE_FOLDER
          The event used to notify listeners that an object has changed folders.
static String PRE_CHANGE_FOLDER
          The event used to notify listeners that an object is about to change its folder.
private  Folder sourceFolder
          The original folder of the object.
private  WTKeyedMap sourceFoldersToTargets
          A mapping of source Folders to WTSets of FolderEntries that are being moved from the folders.
private  WTValuedMap targetsToDestinationFolders
          A mapping between target entries and their destination folders This mapping is also the event target
private  WTValuedMap targetsToSourceFolders
          A mapping between target entries and their source folders
 
Fields inherited from class wt.events.KeyedEvent
 
Constructor Summary
  FolderServiceEvent(FolderService service, String event_type, FolderEntry target, Folder source_folder, Folder destinationFolder)
          Deprecated. Replaced by FolderServiceEvent(String, FolderEntry, Folder, Folder)
  FolderServiceEvent(String event_type, FolderEntry target, Folder source_folder, Folder destination_folder)
          Construct a FolderServiceEvent with the pertinent information.
(package private) FolderServiceEvent(String event_type, WTValuedMap targets_to_destination_folders, WTValuedMap targets_to_source_folders, WTKeyedMap destinations_to_targets, WTKeyedMap sources_to_targets)
          Construct a FolderServiceEvent
 
Method Summary
static String generateEventKey(String eventType)
          Generate a key based on the class of the event and a user defined type.
 Folder getDestinationFolder()
          Return the destination folder (the one the object is being moved to).
 WTKeyedMap getDestinationFoldersToTargets()
          Valid for use with multi-object FolderServiceEvents.
 FolderService getService()
          Deprecated. Replaced by FolderHelper.service
 Folder getSourceFolder()
          Return the source folder of the target object (the one it's being changed from).
 WTKeyedMap getSourceFoldersToTargets()
          Valid for use with multi-object FolderServiceEvents.
 FolderEntry getTarget()
          Return the target of this event.
 WTValuedMap getTargetsToDestinations()
          Valid for use with multi-object FolderServiceEvents.
 WTValuedMap getTargetsToSources()
          Valid for use with multi-object FolderServiceEvents.
 KeyedEvent toMultiObjectEvent()
          Converts a single object event to a multiple object event
 KeyedEvent[] toSingleObjectEvents()
          Given a multi-object folder event returns an array of single object folder events.
 
Methods inherited from class wt.events.KeyedEvent
generateEventKey, generateEventKey, getConceptualClassname, getEventKey, getEventTarget, getEventType, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PRE_CHANGE_FOLDER

public static final String PRE_CHANGE_FOLDER
The event used to notify listeners that an object is about to change its folder.

See Also:
Constant Field Values

POST_CHANGE_FOLDER

public static final String POST_CHANGE_FOLDER
The event used to notify listeners that an object has changed folders.

See Also:
Constant Field Values

sourceFolder

private final Folder sourceFolder
The original folder of the object.


destinationFolder

private final Folder destinationFolder
The folder that the object is being moved to.


targetsToDestinationFolders

private final WTValuedMap targetsToDestinationFolders
A mapping between target entries and their destination folders This mapping is also the event target


targetsToSourceFolders

private final WTValuedMap targetsToSourceFolders
A mapping between target entries and their source folders


sourceFoldersToTargets

private WTKeyedMap sourceFoldersToTargets
A mapping of source Folders to WTSets of FolderEntries that are being moved from the folders.


destinationFoldersToTargets

private WTKeyedMap destinationFoldersToTargets
A mapping of source Folders to WTSets of FolderEntries that are being moved to the folders.

Constructor Detail

FolderServiceEvent

public FolderServiceEvent(FolderService service,
                          String event_type,
                          FolderEntry target,
                          Folder source_folder,
                          Folder destinationFolder)
Deprecated. Replaced by FolderServiceEvent(String, FolderEntry, Folder, Folder)

Construct a FolderServiceEvent with the pertinent information.


FolderServiceEvent

public FolderServiceEvent(String event_type,
                          FolderEntry target,
                          Folder source_folder,
                          Folder destination_folder)
Construct a FolderServiceEvent with the pertinent information.

Parameters:
event_type -
target -
source_folder -
destination_folder -

FolderServiceEvent

FolderServiceEvent(String event_type,
                   WTValuedMap targets_to_destination_folders,
                   WTValuedMap targets_to_source_folders,
                   WTKeyedMap destinations_to_targets,
                   WTKeyedMap sources_to_targets)
Construct a FolderServiceEvent

Parameters:
event_type -
targets_to_destination_folders - A mapping of target FolderEntrys to destination folders
targets_to_source_folders - A mapping of target FolderEntrys to source folders
destinations_to_targets - A mapping of destination Folders to WTSets of target FolderEntrys
sources_to_targets - A mapping of source Folders to WTSets of target FolderEntrys
Method Detail

getService

public FolderService getService()
Deprecated. Replaced by FolderHelper.service

Return the FolderService which originated this event.

Returns:
FolderService

getTarget

public FolderEntry getTarget()
Return the target of this event.

Returns:
FolderEntry the target of this event.

getSourceFolder

public Folder getSourceFolder()
Return the source folder of the target object (the one it's being changed from).

Returns:
the original folder of the target object

getDestinationFolder

public Folder getDestinationFolder()
Return the destination folder (the one the object is being moved to).

Returns:
the destination folder for the target object

generateEventKey

public static String generateEventKey(String eventType)
Generate a key based on the class of the event and a user defined type.

Parameters:
eventType - the type of the event
Returns:
The key

getTargetsToDestinations

public WTValuedMap getTargetsToDestinations()
Valid for use with multi-object FolderServiceEvents.

Returns:
A WTValuedMap mapping FolderEntrys to destination folders

getTargetsToSources

public WTValuedMap getTargetsToSources()
Valid for use with multi-object FolderServiceEvents.

Returns:
A WTValuedMap mapping FolderEntrys to source folders

getSourceFoldersToTargets

public WTKeyedMap getSourceFoldersToTargets()
Valid for use with multi-object FolderServiceEvents.

Returns:
A WTKeyedMap mapping source Folders to WTSets of target FolderEntrys

getDestinationFoldersToTargets

public WTKeyedMap getDestinationFoldersToTargets()
Valid for use with multi-object FolderServiceEvents.

Returns:
A WTKeyedMap mapping destination Folders to WTSets of target FolderEntrys

toMultiObjectEvent

public KeyedEvent toMultiObjectEvent()
Converts a single object event to a multiple object event

Overrides:
toMultiObjectEvent in class KeyedEvent
Returns:
A multi-object event

toSingleObjectEvents

public KeyedEvent[] toSingleObjectEvents()
                                  throws WTException
Given a multi-object folder event returns an array of single object folder events.

Overrides:
toSingleObjectEvents in class KeyedEvent
Returns:
KeyedEvent[]: the single object events
Throws:
WTException