JIDE 3.5.15

com.jidesoft.grid
Class IndexChangeEvent

java.lang.Object
  extended by java.util.EventObject
      extended by com.jidesoft.grid.IndexChangeEvent
All Implemented Interfaces:
Serializable

public class IndexChangeEvent
extends EventObject

Index change event. So far the valid events include INDEX_CHANGING_EVENT and INDEX_CHANGED_EVENT. The event will be fired from SortableTableModel and FilterableTableModel.

See Also:
Serialized Form

Field Summary
static int INDEX_CHANGED_EVENT
          INDEX_CHANGED_EVENT will be fired after sorting or filtering action is finished.
static int INDEX_CHANGING_EVENT
          INDEX_CHANGING_EVENT will be fired before sorting or filtering action is triggered.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
IndexChangeEvent(Object source, int type)
          Deprecated. Please use IndexChangeEvent(Object, int, int) instead.
IndexChangeEvent(Object source, int type, int eventSerialNumber)
          Constructor of this class.
IndexChangeEvent(Object source, int type, int eventSerialNumber, boolean forceProcess, boolean actualTableChanged)
           
 
Method Summary
 int getEventSerialNumber()
          Gets the event serial number.
 int getType()
          Gets the event type.
 boolean isActualTableChanged()
           
 boolean isForceProcess()
           
 String toString()
           
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INDEX_CHANGING_EVENT

public static final int INDEX_CHANGING_EVENT
INDEX_CHANGING_EVENT will be fired before sorting or filtering action is triggered.

See Also:
Constant Field Values

INDEX_CHANGED_EVENT

public static final int INDEX_CHANGED_EVENT
INDEX_CHANGED_EVENT will be fired after sorting or filtering action is finished.

See Also:
Constant Field Values
Constructor Detail

IndexChangeEvent

@Deprecated
public IndexChangeEvent(Object source,
                                   int type)
Deprecated. Please use IndexChangeEvent(Object, int, int) instead.

Parameters:
source - the table model which fired this event in the very beginning
type - the event type

IndexChangeEvent

public IndexChangeEvent(Object source,
                        int type,
                        int eventSerialNumber)
Constructor of this class.

You should always use this constructor to construct a new event.

To improve the performance, you need try your best to make the event serial number unique and paired for INDEX_CHANGING_EVENT and INDEX_CHANGED_EVENT. You could assign it to any positive number. Or you can try random() like the following code example.

 int number = ((Double) (Math.random() * 10000)).intValue();
 IndexChangeEvent e = new IndexChangeEvent(this, INDEX_CHANGING_EVENT, number);
 fireThisEvent(e);
 ....
 IndexChangeEvent e = new IndexChangeEvent(this, INDEX_CHANGED_EVENT, number);
 fireThisEvent(e);
 

Parameters:
source - the table model which fired this event in the very beginning
type - the event type
eventSerialNumber - the event serial number

IndexChangeEvent

public IndexChangeEvent(Object source,
                        int type,
                        int eventSerialNumber,
                        boolean forceProcess,
                        boolean actualTableChanged)
Method Detail

getType

public int getType()
Gets the event type.

Returns:
the event type.

getEventSerialNumber

public int getEventSerialNumber()
Gets the event serial number.

Returns:
the event serial number.

isForceProcess

public boolean isForceProcess()

isActualTableChanged

public boolean isActualTableChanged()

toString

public String toString()
Overrides:
toString in class EventObject

JIDE 3.5.15