com.starbase.starteam
Interface ItemUpdateListener

All Superinterfaces:
java.util.EventListener
All Known Implementing Classes:
ItemUpdateAdapter

public interface ItemUpdateListener
extends java.util.EventListener

Event-listener interface for Item update events.

Similar to ItemListener, except that events are triggered by explicit operations performed by the client application. For example, calling Folder.refreshItems(), Item.update() or Item.remove() might each trigger update events.

See Also:
ItemListener, ItemUpdateAdapter, View.addItemUpdateListener(com.starbase.starteam.ItemUpdateListener, com.starbase.starteam.Type), Folder.addItemUpdateListener(com.starbase.starteam.ItemUpdateListener, com.starbase.starteam.Type, int), ItemListManager.addItemUpdateListener(com.starbase.starteam.ItemUpdateListener)

Method Summary
 void itemAdded(ItemUpdateEvent e)
          Invoked when an Item is added to a view.
 void itemChanged(ItemUpdateEvent e)
          Invoked when the properties of an Item have changed.
 void itemMoved(ItemUpdateEvent e)
          Invoked when an Item is moved within a view.
 void itemRemoved(ItemUpdateEvent e)
          Invoked when an Item is removed from a view.
 

Method Detail

itemAdded

public void itemAdded(ItemUpdateEvent e)
Invoked when an Item is added to a view.

An itemAdded event is triggered whenever an Item with a new ItemID appears in the view. This might be because a new item was created; because an item was moved or shared in from another view; etc.

If an item is moved from one folder to another folder within the same view, then no new items are created. In this case, an itemMoved event is triggered instead of an itemAdded event.

If the logged-in user does not have access rights to see the item in its new context, then no event is triggered.

For itemAdded events, ItemUpdateEvent.getNewItem() returns the added item in its new context. ItemUpdateEvent.getOldItem() returns null.

Parameters:
e - The corresponding item update event.
See Also:
ItemUpdateEvent

itemMoved

public void itemMoved(ItemUpdateEvent e)
Invoked when an Item is moved within a view.

An itemMoved event is triggered whenever an Item is moved from one folder to another folder within the same view. In this case, no items with new ItemIDs are added to the view, and no items are removed. Thus, when an itemMoved event is triggered, corresponding itemAdded and itemRemoved events will not be triggered.

If an item exists in a security context where it is not accessible to the current user, then, from that user's point of reference, the item does not exist. If the item is then moved to a new parent item in the same view such that it is now accessible, then, from that user's point of view, the item has been added, not moved. Thus, in that case, an itemAdded event will be triggered instead of an itemMoved event.

Similarly, if an item is moved in such a way that it is no longer visible to the current user, an itemRemoved event will be triggered instead of an itemMoved event.

For itemMoved events, ItemUpdateEvent.getOldItem() returns a Item object representing the item before it was moved (that is, attached to the old parent folder). ItemUpdateEvent.getNewItem() returns a Item object representing the item after it was moved (attached to the new parent).

Parameters:
e - The corresponding item update event.
See Also:
ItemUpdateEvent

itemChanged

public void itemChanged(ItemUpdateEvent e)
Invoked when the properties of an Item have changed.

The changed properties may include Item-level properties (such as ConfigurationTime or BranchOnChange) or Object-level properties that are shared across references (such as CreatedUserID or ModifiedTime).

For itemChanged events, ItemUpdateEvent.getOldItem() returns a Item object representing the item in its old state (that is, before its properties were changed). ItemUpdateEvent.getNewItem() returns the item in its new state (after its properties were changed).

Parameters:
e - The corresponding item update event.
See Also:
ItemUpdateEvent

itemRemoved

public void itemRemoved(ItemUpdateEvent e)
Invoked when an Item is removed from a view.

An itemRemoved event is triggered whenever an Item disappears from the view. This might be because an item was deleted; because an item was moved to another view; etc.

If an item is moved from one folder to another folder within the same view, then no Item items are removed. In this case, an itemMoved event is triggered instead of an itemRemoved event.

For itemRemoved events, ItemUpdateEvent.getOldItem() returns the removed item in its old context (that is, prior to being removed). ItemUpdateEvent.getNewItem() returns null.

Parameters:
e - The corresponding item update event.
See Also:
ItemUpdateEvent


StarTeam SDK 10.0, Build 58
Copyright © 2003-2004 Borland Software Corporation. All rights reserved.