fr.inria.ketuk
Class BeanEditEvent

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--fr.inria.ketuk.BeanEditEvent
All Implemented Interfaces:
java.io.Serializable

public class BeanEditEvent
extends java.util.EventObject

An Event representing an editing operation that must be performed on a bean

Author:
Claude Pasquier
See Also:
Serialized Form

Field Summary
static int ADD_CHILD
          Indicates that a child has to be added
static int CHANGE_PROPERTY
          Indicates that a property has to be changed
static int END
          Indicates that a end is requested
static int REMOVE_CHILD
          Indicates that a child has to be removed
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
BeanEditEvent(java.lang.Object o, int eventType)
          Constuctor used to create a 'END' event
BeanEditEvent(java.lang.Object o, int eventType, java.lang.Object child)
          Constuctor used to create a 'ADD_CHILD' or 'REMOVE_CHILD' event
BeanEditEvent(java.lang.Object o, int eventType, java.lang.Object child, int childIndex)
          Constuctor used to create a 'ADD_CHILD' event
BeanEditEvent(java.lang.Object o, int eventType, java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
          Constuctor used to create a 'CHANGE_PROPERTY' event
 
Method Summary
static BeanEditEvent createAddChildEvent(java.lang.Object o, java.lang.Object child)
          Constructor used to create a 'ADD_CHILD' event
static BeanEditEvent createAddChildEvent(java.lang.Object o, java.lang.Object child, int childIndex)
          Constructor used to create a 'ADD_CHILD' event
static BeanEditEvent createAddChildEvent(java.lang.Object o, java.lang.String childName)
          Constructor used to create a 'ADD_CHILD' event
static BeanEditEvent createChangePropertyEvent(java.lang.Object o, java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
          Constructor used to create a 'CHANGE_PROPERTY' event
static BeanEditEvent createRemoveBeanEvent(java.lang.Object o, java.lang.Object child)
          Constuctor used to create a 'REMOVE_CHILD' event
 java.lang.Object getChild()
          Gets the added child
 int getChildIndex()
          Gets the added child's index
 java.lang.String getChildName()
          Gets the name of the added child
 int getEventType()
          Gets the event type
 java.lang.Object getNewProperty()
          Gets the property's new value
 java.lang.Object getOldProperty()
          Gets the property's old value
 java.lang.String getPropertyName()
          Gets the property name
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CHANGE_PROPERTY

public static int CHANGE_PROPERTY
Indicates that a property has to be changed

REMOVE_CHILD

public static int REMOVE_CHILD
Indicates that a child has to be removed

ADD_CHILD

public static int ADD_CHILD
Indicates that a child has to be added

END

public static int END
Indicates that a end is requested
Constructor Detail

BeanEditEvent

public BeanEditEvent(java.lang.Object o,
                     int eventType,
                     java.lang.String propertyName,
                     java.lang.Object oldValue,
                     java.lang.Object newValue)
Constuctor used to create a 'CHANGE_PROPERTY' event
Parameters:
o - the event's source
eventType - the event's type (should be 'CHANGE_PROPERTY')
propertyName - the name of the updated property
oldValue - the previous value of the property
newValue - the new value of the property

BeanEditEvent

public BeanEditEvent(java.lang.Object o,
                     int eventType)
Constuctor used to create a 'END' event
Parameters:
o - the event's source
eventType - the event's type (should be 'END')

BeanEditEvent

public BeanEditEvent(java.lang.Object o,
                     int eventType,
                     java.lang.Object child,
                     int childIndex)
Constuctor used to create a 'ADD_CHILD' event
Parameters:
o - the event source
eventType - the event type (should be 'ADD_CHILD')
child - the added child
childIndex - the position of the added child

BeanEditEvent

public BeanEditEvent(java.lang.Object o,
                     int eventType,
                     java.lang.Object child)
Constuctor used to create a 'ADD_CHILD' or 'REMOVE_CHILD' event
Parameters:
o - the event source
eventType - the event type
child - the added or removed child
Method Detail

createRemoveBeanEvent

public static BeanEditEvent createRemoveBeanEvent(java.lang.Object o,
                                                  java.lang.Object child)
Constuctor used to create a 'REMOVE_CHILD' event
Parameters:
o - the event source
child - the removed child
Returns:
the created object

createChangePropertyEvent

public static BeanEditEvent createChangePropertyEvent(java.lang.Object o,
                                                      java.lang.String propertyName,
                                                      java.lang.Object oldValue,
                                                      java.lang.Object newValue)
Constructor used to create a 'CHANGE_PROPERTY' event
Parameters:
o - the event source
propertyName - the name of the updated property
oldValue - the previous value of the property
newValue - the new value of the property
Returns:
the created object

createAddChildEvent

public static BeanEditEvent createAddChildEvent(java.lang.Object o,
                                                java.lang.Object child,
                                                int childIndex)
Constructor used to create a 'ADD_CHILD' event
Parameters:
o - the event source
child - the added child
childIndex - the position of the added child
Returns:
the created object

createAddChildEvent

public static BeanEditEvent createAddChildEvent(java.lang.Object o,
                                                java.lang.Object child)
Constructor used to create a 'ADD_CHILD' event
Parameters:
o - the event source
child - the added child
Returns:
the created object

createAddChildEvent

public static BeanEditEvent createAddChildEvent(java.lang.Object o,
                                                java.lang.String childName)
Constructor used to create a 'ADD_CHILD' event
Parameters:
o - the event source
childName - the name of the child to add
Returns:
the created object

getEventType

public int getEventType()
Gets the event type

getPropertyName

public java.lang.String getPropertyName()
Gets the property name

getOldProperty

public java.lang.Object getOldProperty()
Gets the property's old value

getNewProperty

public java.lang.Object getNewProperty()
Gets the property's new value

getChild

public java.lang.Object getChild()
Gets the added child

getChildIndex

public int getChildIndex()
Gets the added child's index

getChildName

public java.lang.String getChildName()
Gets the name of the added child