org.eclipse.actf.model.event
Class ModelChangeEvent

java.lang.Object
  extended by java.util.EventObject
      extended by org.eclipse.actf.model.event.ModelChangeEvent
All Implemented Interfaces:
Serializable

public class ModelChangeEvent
extends EventObject

an event object fired by IModel instances

Author:
Mike Squilace
See Also:
org.eclipse.actf.core.model.IModel, Serialized Form

Field Summary
protected  int eventType
           
protected  Object newValue
           
static int NODE_INSERTED
           
static int NODE_MODIFIED
           
static int NODE_REMOVED
           
protected  Object oldValue
           
protected  String propName
           
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
ModelChangeEvent(Object targetElement, int eventType)
          create a new model change event with the targetElement as the event source.
ModelChangeEvent(Object targetElement, int eventType, String propName, Object oldValue, Object newValue)
          create a model change event.
 
Method Summary
 int getEventType()
          get the type of event
 String getModifiedPropertyName()
          get the name of the property that was modified
 Object getNewValue()
          get the new value of the modified property
 Object getOldValue()
          get the former value of the modified property
 
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

NODE_INSERTED

public static final int NODE_INSERTED
See Also:
Constant Field Values

NODE_REMOVED

public static final int NODE_REMOVED
See Also:
Constant Field Values

NODE_MODIFIED

public static final int NODE_MODIFIED
See Also:
Constant Field Values

propName

protected String propName

eventType

protected int eventType

oldValue

protected Object oldValue

newValue

protected Object newValue
Constructor Detail

ModelChangeEvent

public ModelChangeEvent(Object targetElement,
                        int eventType)
create a new model change event with the targetElement as the event source.

Parameters:
targetElement -
eventTYpe - one of the constants in this calss

ModelChangeEvent

public ModelChangeEvent(Object targetElement,
                        int eventType,
                        String propName,
                        Object oldValue,
                        Object newValue)
create a model change event. The final three parameters are only valid if the event type is NODE_MODIFIED.

Parameters:
targetElement - source of event within the model
propName - name of property modified
oldValue -
newValue -
Method Detail

getEventType

public int getEventType()
get the type of event

Returns:
type of event

getModifiedPropertyName

public String getModifiedPropertyName()
get the name of the property that was modified

Returns:
modified property name

getOldValue

public Object getOldValue()
get the former value of the modified property

Returns:
former value of modified property

getNewValue

public Object getNewValue()
get the new value of the modified property

Returns:
new value of modified property