ilog.views.gantt.event
Class ActivityNameEvent

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.ActivityNameEvent
All Implemented Interfaces:
ActivityEvent, Serializable

public class ActivityNameEvent
extends ActivityPropertyEvent

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

After its name is modified, an IlvActivity will fire a changed ActivityNameEvent in all listeners registered with the Gantt data model. Listeners can access the old and new values of the activity's name, 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
ActivityNameEvent(IlvActivity activity, String oldName, String newName, boolean aboutToChangeEvent)
          Constructs a new ActivityNameEvent generated by the specified activity and with the specified old and new name values.
 
Method Summary
 String getNewName()
          Returns the activity's new name.
 String getOldName()
          Returns the activity's old name.
 void setNewName(String name)
          Sets the activity's proposed new name.
 
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

ActivityNameEvent

public ActivityNameEvent(IlvActivity activity,
                         String oldName,
                         String newName,
                         boolean aboutToChangeEvent)
Constructs a new ActivityNameEvent generated by the specified activity and with the specified old and new name values.

Parameters:
activity - the activity where the event originated
oldName - the activity's previous name
newName - the activity's new name
aboutToChangeEvent - true if this is an activityNameAboutToChange event or false if this is an activityNameChanged event.
Method Detail

getOldName

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

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

getNewName

public String getNewName()
Returns the activity's new name. If this is a activityNameAboutToChange event, then this is will be the activity's proposed value. If this is a activityNameChanged event, this will be the activity's new name which is being reported.

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

setNewName

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

Parameters:
name - the activity's name


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