ilog.views.gantt.event
Class ActivityIDEvent

java.lang.Object
  extended by java.util.EventObject
      extended by ilog.views.gantt.util.event.IlvPropertyEvent
          extended by ilog.views.gantt.event.ActivityPropertyEvent
              extended by ilog.views.gantt.event.ActivityIDEvent
All Implemented Interfaces:
ActivityEvent, Serializable

public class ActivityIDEvent
extends ActivityPropertyEvent

ActivityIDEvent is fired by an IlvActivity both before and after its id is modified. Immediately before its id is modified, an IlvActivity fires an aboutToChange ActivityIDEvent in all listeners registered with the Gantt data model. Listeners can modify or constrain the proposed id by invoking setNewID(). Alternatively, a listener can veto the proposed change by invoking veto().

After its id is modified, an IlvActivity will fire a changed ActivityIDEvent in all listeners registered with the Gantt data model. Listeners can access the old and new values of the activity's id, but cannot modify them via the event mechanism.

See Also:
IlvActivity, IlvGanttModel.addActivityListener(ilog.views.gantt.event.ActivityListener), Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
ActivityIDEvent(IlvActivity activity, String oldID, String newID, boolean aboutToChangeEvent)
          Constructs a new ActivityIDEvent generated by the specified activity and with the specified old and new id values.
 
Method Summary
 String getNewID()
          Returns the activity's new id.
 String getOldID()
          Returns the activity's old id.
 void setNewID(String id)
          Sets the activity's proposed new id.
 
Methods inherited from class ilog.views.gantt.event.ActivityPropertyEvent
getActivity
 
Methods inherited from class ilog.views.gantt.util.event.IlvPropertyEvent
getNewValue, getOldValue, isAboutToChangeEvent, isChangedEvent, isVetoed, setNewValue, veto
 
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

ActivityIDEvent

public ActivityIDEvent(IlvActivity activity,
                       String oldID,
                       String newID,
                       boolean aboutToChangeEvent)
Constructs a new ActivityIDEvent generated by the specified activity and with the specified old and new id values.

Parameters:
activity - the activity where the event originated
oldID - the activity's previous id
newID - the activity's new id
aboutToChangeEvent - true if this is an activityIDAboutToChange event or false if this is an activityIDChanged event.
Method Detail

getOldID

public String getOldID()
Returns the activity's old id. If this is a activityIDAboutToChange event, then this will be the same as the activity's current id since the change has not actually occurred yet. If this is a activityIDChanged event, this will be the activity's id prior to the current modification being reported.

Returns:
The String representing the activity's old id.

getNewID

public String getNewID()
Returns the activity's new id. If this is a activityIDAboutToChange event, then this is will be the activity's proposed value. If this is a activityIDChanged event, this will be the activity's new id which is being reported.

Returns:
The String representing the activity's new id.

setNewID

public void setNewID(String id)
Sets the activity's proposed new id. This method only has meaning if this is a activityIDAboutToChange event. By using this method, a listener can constrain changes to the activity's id.

Parameters:
id - the activity's id


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.