com.virtualweaver.xotics.datamodel.event
Class XoUndoableEvent

java.lang.Object
  extended byjava.util.EventObject
      extended bycom.virtualweaver.xotics.datamodel.event.XoUndoableEvent
All Implemented Interfaces:
java.io.Serializable

public final class XoUndoableEvent
extends java.util.EventObject

An event fired by XoDMInstance each time an undoable modification has been performed on DM instance, i.e XoObject adding or removal and property change.

Version:
4.1
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
XoUndoableEvent(XoDMInstance source, byte undoablekind, XoContainer parent, XoObject child, int index)
          Constructor used to create an undoable event of type add or remove child
XoUndoableEvent(XoDMInstance source, XoObject xo, java.lang.String pname, java.lang.Object oldvalue, java.lang.Object newvalue)
          Constructor used to create an undoable event of type set property.
 
Method Summary
 XoObject getChild()
          Child object involved in an add or remove change
 int getIndex()
          Child index for an add or remove change
 java.lang.Object getNewPropertyValue()
          Returns new property value in case of property change.
 java.lang.Object getOldPropertyValue()
          Returns old property value in case of property change.
 XoContainer getParent()
          Parent container involved in an add or remove change.
 java.lang.String getPropertyName()
          Returns property name in case of property change
 XoObject getPropertyOwner()
          Owner object of property changed
 byte getUndoableKind()
          This property represents the kind of undoable event, one of these values : XoConstants.UNDOABLE_ADD_OBJECT XoConstants.UNDOABLE_REMOVE_OBJECT XoConstants.UNDOABLE_SET_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
 

Constructor Detail

XoUndoableEvent

public XoUndoableEvent(XoDMInstance source,
                       byte undoablekind,
                       XoContainer parent,
                       XoObject child,
                       int index)
Constructor used to create an undoable event of type add or remove child

Parameters:
source - the source of event, which is allways a DM instance
undoablekind - event kind, to choose among :
parent - parent container involved in add/remove process
child - child object added/removed
index - child index

XoUndoableEvent

public XoUndoableEvent(XoDMInstance source,
                       XoObject xo,
                       java.lang.String pname,
                       java.lang.Object oldvalue,
                       java.lang.Object newvalue)
Constructor used to create an undoable event of type set property.

Parameters:
source - the source of event, which is allways a DM instance
xo - object whose property is changed
pname - property name involved
oldvalue - property value before change
newvalue - property value after change
Method Detail

getUndoableKind

public byte getUndoableKind()
This property represents the kind of undoable event, one of these values :

Returns:
the type of undoable action this event represents

getParent

public XoContainer getParent()
Parent container involved in an add or remove change.

Returns:
parent container or null for a property change

getChild

public XoObject getChild()
Child object involved in an add or remove change

Returns:
child object or property owner in case of property change

getPropertyOwner

public XoObject getPropertyOwner()
Owner object of property changed

Returns:
property owner in case of property change

getIndex

public int getIndex()
Child index for an add or remove change

Returns:
child index or -1 for a property change

getOldPropertyValue

public java.lang.Object getOldPropertyValue()
Returns old property value in case of property change.

Returns:
old value or null if change is not a property change

getNewPropertyValue

public java.lang.Object getNewPropertyValue()
Returns new property value in case of property change.

Returns:
new value or null if change is not a property change

getPropertyName

public java.lang.String getPropertyName()
Returns property name in case of property change

Returns:
property pname or null if change is not a property change.