com.starbase.starteam
Interface ItemListener

All Superinterfaces:
java.util.EventListener, IItemListener
All Known Implementing Classes:
ItemAdapter

public interface ItemListener
extends IItemListener

Event-listener interface for Item events.

Note that an application will not receive Item events for items that the logged-in user does not have permission to access.

The ItemListener interface provides very detailed information about changes to the Items in a Folder. An application may find that one of the simpler (and less expensive) ItemIDListener or ItemListListener interfaces is sufficient for its needs.

See Also:
ItemAdapter, ItemIDListener, ItemListListener, View.addItemListener(com.starbase.starteam.IItemListener, com.starbase.starteam.Type), Folder.addItemListener(com.starbase.starteam.IItemListener, com.starbase.starteam.Type, int), ItemListManager.addItemListener(com.starbase.starteam.IItemListener)

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

Method Detail

itemAdded

public void itemAdded(ItemEvent 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, ItemEvent.getNewItem() returns the added item in its new context. ItemEvent.getOldItem() returns null.

Parameters:
e - The corresponding Item event.
See Also:
ItemEvent

itemMoved

public void itemMoved(ItemEvent 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, ItemEvent.getOldItem() returns a Item object representing the item before it was moved (that is, attached to the old parent folder). ItemEvent.getNewItem() returns a Item object representing the item after it was moved (attached to the new parent).

Parameters:
e - The corresponding Item event.
See Also:
ItemEvent

itemChanged

public void itemChanged(ItemEvent 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, ItemEvent.getOldItem() returns a Item object representing the item in its old state (that is, before its properties were changed). ItemEvent.getNewItem() returns the item in its new state (after its properties were changed).

Parameters:
e - The corresponding Item event.
See Also:
ItemEvent

itemRemoved

public void itemRemoved(ItemEvent 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, ItemEvent.getOldItem() returns the removed item in its old context (that is, prior to being removed). ItemEvent.getNewItem() returns null.

Parameters:
e - The corresponding Item event.
See Also:
ItemEvent


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