org.eclipse.jpt.common.utility.model.event
Class ListMoveEvent

java.lang.Object
  extended by java.util.EventObject
      extended by org.eclipse.jpt.common.utility.model.event.ChangeEvent
          extended by org.eclipse.jpt.common.utility.model.event.ListEvent
              extended by org.eclipse.jpt.common.utility.model.event.ListMoveEvent
All Implemented Interfaces:
java.io.Serializable

public final class ListMoveEvent
extends ListEvent

A "list move" event gets delivered whenever a model moves the elements in a "bound" or "constrained" list. A ListMoveEvent is sent as an argument to the ListChangeListener.

Provisional API: This class is part of an interim API that is still under development and expected to change significantly before reaching stability. It is available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.

See Also:
Serialized Form

Constructor Summary
ListMoveEvent(Model source, java.lang.String listName, int targetIndex, int sourceIndex, int length)
          Construct a new list move event.
 
Method Summary
 ListMoveEvent clone(Model newSource)
          Return a copy of the event with the specified source replacing the current source.
 ListMoveEvent clone(Model newSource, java.lang.String newListName)
          Return a copy of the event with the specified source and list name replacing the current source and list name.
 ListMoveEvent clone(Model newSource, java.lang.String newListName, int offset)
          Return a copy of the event with the specified source and list name replacing the current source and list name and displacing the index by the specified amount.
 int getLength()
          Return the number of items moved.
 int getSourceIndex()
          Return the index from which the items were moved.
 int getTargetIndex()
          Return the index to which the items were moved.
 
Methods inherited from class org.eclipse.jpt.common.utility.model.event.ListEvent
getListName
 
Methods inherited from class org.eclipse.jpt.common.utility.model.event.ChangeEvent
getSource, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ListMoveEvent

public ListMoveEvent(Model source,
                     java.lang.String listName,
                     int targetIndex,
                     int sourceIndex,
                     int length)
Construct a new list move event.

Parameters:
source - The object on which the event initially occurred.
listName - The programmatic name of the list that was changed.
targetIndex - The index to which the items were moved.
sourceIndex - The index from which the items were moved.
length - The number of items moved.
Method Detail

getTargetIndex

public int getTargetIndex()
Return the index to which the items were moved.


getSourceIndex

public int getSourceIndex()
Return the index from which the items were moved.


getLength

public int getLength()
Return the number of items moved.


clone

public ListMoveEvent clone(Model newSource)
Return a copy of the event with the specified source replacing the current source.


clone

public ListMoveEvent clone(Model newSource,
                           java.lang.String newListName)
Return a copy of the event with the specified source and list name replacing the current source and list name.


clone

public ListMoveEvent clone(Model newSource,
                           java.lang.String newListName,
                           int offset)
Return a copy of the event with the specified source and list name replacing the current source and list name and displacing the index by the specified amount.