public class ResourceNameEvent extends ResourcePropertyEvent
ResourceNameEvent
is fired by an IlvResource
both
before and after its name is modified. Immediately before its name is
modified, an IlvResource
fires an aboutToChange
ResourceNameEvent
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 IlvResource
will fire a
changed ResourceNameEvent
in all listeners registered
with the Gantt data model. Listeners can access the old and new values of the
resource's name, but cannot modify them via the event mechanism.
source
Constructor and Description |
---|
ResourceNameEvent(IlvResource resource,
String oldName,
String newName,
boolean aboutToChangeEvent)
Constructs a new
ResourceNameEvent generated
by the specified resource and with the specified old and new
name values. |
Modifier and Type | Method and Description |
---|---|
String |
getNewName()
Returns the resource's new name.
|
String |
getOldName()
Returns the resource's old name.
|
void |
setNewName(String name)
Sets the resource's proposed new name.
|
getResource
getNewValue, getOldValue, isAboutToChangeEvent, isChangedEvent, isVetoed, setNewValue, veto
getSource, toString
public ResourceNameEvent(IlvResource resource, String oldName, String newName, boolean aboutToChangeEvent)
ResourceNameEvent
generated
by the specified resource and with the specified old and new
name values.resource
- the resource where the event originatedoldName
- the resource's previous namenewName
- the resource's new nameaboutToChangeEvent
- true
if this is a
resourceNameAboutToChange
event or false
if this
is a resourceNameChanged
event.public String getOldName()
resourceNameAboutToChange
event, then this will be the
same as the resource's current name since the change has not actually
occurred yet. If this is a resourceNameChanged
event, this
will be the resource's name prior to the current modification being
reported.String
representing the old name.public String getNewName()
resourceNameAboutToChange
event, then this is will be
the resource's proposed value.
If this is a resourceNameChanged
event, this will be the resource's new name which is being reported.String
representing the new name.public void setNewName(String name)
resourceNameAboutToChange
event. By using this method, a
listener can constrain changes to the resource's name.name
- the resource's name© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.