public class NavigationEvent extends EventObject
source
Constructor and Description |
---|
NavigationEvent(Router router,
Location location,
UI ui,
NavigationTrigger trigger)
Creates a new navigation event.
|
NavigationEvent(Router router,
Location location,
UI ui,
NavigationTrigger trigger,
elemental.json.JsonValue state,
boolean forwardTo)
Creates a new navigation event.
|
Modifier and Type | Method and Description |
---|---|
Location |
getLocation()
Gets the new location.
|
Router |
getSource() |
Optional<elemental.json.JsonValue> |
getState()
Gets navigation state.
|
NavigationTrigger |
getTrigger()
Gets the type of user action that triggered this navigation event.
|
UI |
getUI()
Gets the UI in which the navigation occurs.
|
boolean |
isForwardTo()
Checks whether this event is created as a result of
BeforeEvent.forwardTo(com.vaadin.flow.router.NavigationHandler, com.vaadin.flow.router.NavigationState) or not. |
toString
public NavigationEvent(Router router, Location location, UI ui, NavigationTrigger trigger)
router
- the router handling the navigation, not null
location
- the new location, not null
ui
- the UI in which the navigation occurs, not null
trigger
- the type of user action that triggered this navigation event,
not null
public NavigationEvent(Router router, Location location, UI ui, NavigationTrigger trigger, elemental.json.JsonValue state, boolean forwardTo)
router
- the router handling the navigation, not null
location
- the new location, not null
ui
- the UI in which the navigation occurs, not null
trigger
- the type of user action that triggered this navigation event,
not null
state
- includes navigation state info including for example the
scroll position and the complete href of the RouterLinkforwardTo
- indicates if this event is created as a result of
BeforeEvent.forwardTo(com.vaadin.flow.router.NavigationHandler, com.vaadin.flow.router.NavigationState)
or notpublic Router getSource()
getSource
in class EventObject
public Location getLocation()
null
public UI getUI()
public NavigationTrigger getTrigger()
null
public Optional<elemental.json.JsonValue> getState()
public boolean isForwardTo()
BeforeEvent.forwardTo(com.vaadin.flow.router.NavigationHandler, com.vaadin.flow.router.NavigationState)
or not.true
if this event is created as a result calling
BeforeEvent.forwardTo(com.vaadin.flow.router.NavigationHandler, com.vaadin.flow.router.NavigationState)
, false
otherwiseCopyright © 2023. All rights reserved.