public class LocationChangeRequestedEvent extends Object implements info.magnolia.event.Event<LocationChangeRequestedEvent.Handler>
setWarning(String)
to request that the user be prompted to confirm the change.Modifier and Type | Class and Description |
---|---|
static interface |
LocationChangeRequestedEvent.Handler
Handler interface for
LocationChangeRequestedEvent . |
Constructor and Description |
---|
LocationChangeRequestedEvent(Location newLocation) |
Modifier and Type | Method and Description |
---|---|
void |
dispatch(LocationChangeRequestedEvent.Handler handler) |
Location |
getNewLocation()
Returns the location we may navigate to, or null on window close.
|
String |
getWarning()
Returns the warning message to show the user before allowing the location change, or null if
none has been set.
|
void |
setWarning(String warning)
Set a message to warn the user that it might be unwise to navigate away from the current
location, i.e. due to unsaved changes.
|
public LocationChangeRequestedEvent(Location newLocation)
public Location getNewLocation()
public String getWarning()
public void setWarning(String warning)
Calling with a null warning is the same as not calling the method at all -- the user will not be prompted.
Only the first non-null call to setWarning has any effect. That is, once the warning message has been set it cannot be cleared.
public void dispatch(LocationChangeRequestedEvent.Handler handler)
dispatch
in interface info.magnolia.event.Event<LocationChangeRequestedEvent.Handler>
Copyright © 2016 Magnolia International Ltd.. All rights reserved.