|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.starteam.ViewConfigurationDiffer
public final class ViewConfigurationDiffer
Used to compare two configurations of a given view, triggering FolderUpdateEvents, ItemUpdateEvents and ViewMemberUpdateEvents describing the changes detected between the two.
Events are triggered only for differences detectable by comparing the two view configurations. For example, if an item was added sometime after the time represented by the first configuration, and then removed sometime before the time represented by the second configuration, then no events would be triggered for that item.
Events are triggered in an order that reflects the times the change actually occurred, when possible. For some older server versions, and for some types of view configurations, it is not currently possible to determine when a move has occurred. It is also not currently possible to determine when a folder or item was removed. Such events are triggered last.
| Constructor Summary | |
|---|---|
ViewConfigurationDiffer(View view)
Constructs a new ViewCOnfigurationDiffer. |
|
| Method Summary | |
|---|---|
void |
addFolderUpdateListener(FolderUpdateListener listener)
Registers a FolderUpdateListener, whose methods will be invoked during a compare() whenever changes to the folder tree are detected. |
void |
addItemUpdateListener(ItemUpdateListener listener,
Item.Type type)
Registers an ItemUpdateListener, whose methods will be invoked during a compare() whenever changes to the items of the given type are detected. |
void |
addRequiredProperties(ViewMember.Type type,
PropertyCollection pc)
Marks a list of properties as required for a given type. |
void |
addRequiredProperty(ViewMember.Type type,
Property property)
Marks a given property as required for a given type. |
void |
addViewMemberUpdateListener(ViewMemberUpdateListener listener,
ViewMember.Type type)
Registers a ViewMemberUpdateListener, whose methods will be invoked during a compare() whenever changes to the view members of the given type are detected. |
void |
close()
Frees all cached resources associated with this ViewConfigurationDiffer, and closes the associated view. |
void |
compare(ViewConfiguration config1,
ViewConfiguration config2)
Comnpares the two given configurations of this view, triggering FolderUpdateEvents and ItemUpdateEvents for all changes detected between the two. |
void |
removeFolderUpdateListener(FolderUpdateListener listener)
Unregisters a previously registered FolderUpdateListener. |
void |
removeItemUpdateListener(ItemUpdateListener listener,
Item.Type type)
Unregisters a previously registered ItemUpdateListener. |
void |
removeViewMemberUpdateListener(ViewMemberUpdateListener listener,
ViewMember.Type type)
Unregisters a previously registered ViewMemberUpdateListener. |
void |
setAllPropertiesRequired(ViewMember.Type type)
Marks all properties as required for a given type. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ViewConfigurationDiffer(View view)
view - The view whose configurations are to be compared.| Method Detail |
|---|
public void addFolderUpdateListener(FolderUpdateListener listener)
listener - The listener to be registered.FolderUpdateListener,
ViewConfigurationDiffer.compare(com.starteam.ViewConfiguration, com.starteam.ViewConfiguration),
ViewConfigurationDiffer.removeFolderUpdateListener(com.starteam.events.FolderUpdateListener)public void removeFolderUpdateListener(FolderUpdateListener listener)
listener - The listener to be unregistered.ViewConfigurationDiffer.addFolderUpdateListener(com.starteam.events.FolderUpdateListener)
public void addItemUpdateListener(ItemUpdateListener listener,
Item.Type type)
listener - The listener to be registered.type - The item type.ItemUpdateListener,
ViewConfigurationDiffer.compare(com.starteam.ViewConfiguration, com.starteam.ViewConfiguration),
ViewConfigurationDiffer.removeItemUpdateListener(com.starteam.events.ItemUpdateListener, com.starteam.Item.Type)
public void removeItemUpdateListener(ItemUpdateListener listener,
Item.Type type)
listener - The listener to be unregistered.type - The item type.ViewConfigurationDiffer.addItemUpdateListener(com.starteam.events.ItemUpdateListener, com.starteam.Item.Type)
public void addViewMemberUpdateListener(ViewMemberUpdateListener listener,
ViewMember.Type type)
listener - The listener to be registered.type - The view member type.ViewMemberUpdateListener,
ViewConfigurationDiffer.compare(com.starteam.ViewConfiguration, com.starteam.ViewConfiguration),
ViewConfigurationDiffer.removeViewMemberUpdateListener(com.starteam.events.ViewMemberUpdateListener, com.starteam.ViewMember.Type)
public void removeViewMemberUpdateListener(ViewMemberUpdateListener listener,
ViewMember.Type type)
listener - The listener to be unregistered.type - The viewMember type.ViewConfigurationDiffer.addViewMemberUpdateListener(com.starteam.events.ViewMemberUpdateListener, com.starteam.ViewMember.Type)
public void addRequiredProperty(ViewMember.Type type,
Property property)
If addPropertyName() or any of its variations is never called for a given type, then a default set of properties (including the type's descriptors) is assumed. In fact, if neither addPropertyName() nor addItemUpdateListener() is called, then that item type is not even compared.
type - An item type.property - A property.ViewConfigurationDiffer.compare(com.starteam.ViewConfiguration, com.starteam.ViewConfiguration),
ViewConfigurationDiffer.addRequiredProperties(com.starteam.ViewMember.Type, com.starteam.PropertyCollection),
ViewConfigurationDiffer.setAllPropertiesRequired(com.starteam.ViewMember.Type)
public void addRequiredProperties(ViewMember.Type type,
PropertyCollection pc)
type - An item type.pc - A list of properties.ViewConfigurationDiffer.addRequiredProperty(com.starteam.ViewMember.Type, com.starteam.Property)public void setAllPropertiesRequired(ViewMember.Type type)
type - An item type.ViewConfigurationDiffer.addRequiredProperty(com.starteam.ViewMember.Type, com.starteam.Property)
public void compare(ViewConfiguration config1,
ViewConfiguration config2)
The folder tree is always compared. In addition, the items are compared for each item type that the application has shown an interest in, either by adding an ItemUpdateListener for that item type, or by calling addRequiredPropertyName() with that item type.
config1 - The first (earlier) view configuration.config2 - The second (later) view configuration.public void close()
View.close()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||