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.
source
Constructor and Description |
---|
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. |
Modifier and Type | Method and Description |
---|---|
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.
|
getActivity
getNewValue, getOldValue, isAboutToChangeEvent, isChangedEvent, isVetoed, setNewValue, veto
getSource, toString
public ActivityNameEvent(IlvActivity activity, String oldName, String newName, boolean aboutToChangeEvent)
ActivityNameEvent
generated
by the specified activity and with the specified old and new
name values.activity
- the activity where the event originatedoldName
- the activity's previous namenewName
- the activity's new nameaboutToChangeEvent
- true
if this is an
activityNameAboutToChange
event or false
if this
is an activityNameChanged
event.public String getOldName()
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.String
representing the activity's old name.public String getNewName()
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.String
representing the activity's new name.public void setNewName(String name)
activityNameAboutToChange
event. By using this method, a
listener can constrain changes to the activity's name.name
- the activity's name© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.