org.browsecode.helpers.reorderablelistpanel
Class ReorderableEvent<T>

java.lang.Object
  extended by org.browsecode.helpers.reorderablelistpanel.ReorderableEvent<T>

public class ReorderableEvent<T>
extends java.lang.Object

Note that there is only a slight distinction between a DELETED event and a REORDERED event where the newIndex is null, and only a slight distinction between an INSERTED event and a REORDERED event where the oldIndex is null -- this may matter only to the implementation of the GUI.


Field Summary
static java.lang.String DELETED
           
static java.lang.String INSERTED
           
static java.lang.String REORDERED
           
 
Constructor Summary
ReorderableEvent(java.lang.String type, T item, java.lang.Integer oldIndex, java.lang.Integer newIndex, ReorderableListModel source)
           
ReorderableEvent(java.lang.String type, T item, java.lang.Integer newIndex, ReorderableListModel source)
           
 
Method Summary
 T getItem()
          Get the item that was reordered, deleted, or created.
 java.lang.Integer getNewIndex()
           
 java.lang.Integer getOldIndex()
           
 ReorderableListModel getSource()
           
 java.lang.String getType()
          One of REORDERED, DELETED, or CREATED.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REORDERED

public static final java.lang.String REORDERED
See Also:
Constant Field Values

DELETED

public static final java.lang.String DELETED
See Also:
Constant Field Values

INSERTED

public static final java.lang.String INSERTED
See Also:
Constant Field Values
Constructor Detail

ReorderableEvent

public ReorderableEvent(java.lang.String type,
                        T item,
                        java.lang.Integer oldIndex,
                        java.lang.Integer newIndex,
                        ReorderableListModel source)

ReorderableEvent

public ReorderableEvent(java.lang.String type,
                        T item,
                        java.lang.Integer newIndex,
                        ReorderableListModel source)
Parameters:
type - must equal INSERTED
item -
newIndex -
source -
Method Detail

getType

public java.lang.String getType()
One of REORDERED, DELETED, or CREATED.

Returns:

getItem

public T getItem()
Get the item that was reordered, deleted, or created.

Returns:

getSource

public ReorderableListModel getSource()
Returns:
Returns the source that generated the event.

getNewIndex

public java.lang.Integer getNewIndex()
Returns:
Returns the newIndex. If this is null, the item was moved to another location.

getOldIndex

public java.lang.Integer getOldIndex()
Returns:
Returns the oldIndex. If this is null, the item was just created or just came from another source.