public class ReservedResourceEvent extends ReservationPropertyEvent
ReservedResourceEvent
is fired by an IlvReservation
both before and after the activity's reserved resource is modified.
Immediately before the resource is modified, an IlvReservation
fires an aboutToChange ReservedResourceEvent
in all
listeners registered with the Gantt data model. Listeners can modify or
constrain the proposed resource by invoking setNewResource()
.
Alternatively, a listener can veto the proposed change by invoking
veto()
.
After the activity's reserved resource is modified, an
IlvReservation
will fire a changed
ReservedResourceEvent
in all listeners
registered with the Gantt data model. Listeners can access the old and new
resources, but cannot modify them via the event mechanism.
source
Constructor and Description |
---|
ReservedResourceEvent(IlvReservation reservation,
IlvResource oldResource,
IlvResource newResource,
boolean aboutToChangeEvent)
Constructs a new
ReservedResourceEvent generated by the
specified reservation and with the specified old and new resources. |
Modifier and Type | Method and Description |
---|---|
IlvResource |
getNewResource()
Returns the activity's newly reserved resource.
|
IlvResource |
getOldResource()
Returns the activity's previously reserved resource.
|
void |
setNewResource(IlvResource resource)
Sets the activity's proposed new reservation.
|
getReservation
getNewValue, getOldValue, isAboutToChangeEvent, isChangedEvent, isVetoed, setNewValue, veto
getSource, toString
public ReservedResourceEvent(IlvReservation reservation, IlvResource oldResource, IlvResource newResource, boolean aboutToChangeEvent)
ReservedResourceEvent
generated by the
specified reservation and with the specified old and new resources.reservation
- the reservation where the event originatedoldResource
- the activity's previously reserved resourcenewResource
- the activity's newly reserved resourceaboutToChangeEvent
- true
if this is an
aboutToChange event or false
if this
is a changed event.public IlvResource getOldResource()
IlvResource
.public IlvResource getNewResource()
IlvResource
.public void setNewResource(IlvResource resource)
resource
- the reserved resource© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.