com.vaadin.flow.router.
Class NavigationEvent
All Implemented Interfaces:
Direct Known Subclasses:
Event object with data related to navigation.
Since:
1.0
Author:
Vaadin Ltd
See Also:
-
Field Summary
Fields inherited from class java.util.EventObject
source
-
Constructor Summary
ConstructorsConstructorDescriptionNavigationEvent
(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.
NavigationEvent
(Router router, Location location, UI ui, NavigationTrigger trigger, elemental.json.JsonValue state, boolean forwardTo, boolean forceInstantiation, boolean recreateLayoutChain) Creates a new navigation event.
-
Method Summary
Modifier and TypeMethodDescriptionGets the new location.
Optional<elemental.json.JsonValue>
getState()
Gets navigation state.
Gets the type of user action that triggered this navigation event.
getUI()
Gets the UI in which the navigation occurs.
boolean
When set to true, the navigation target should be instantiated regardless of it being already available.
boolean
Checks whether this event is created as a result of
BeforeEvent.forwardTo(com.vaadin.flow.router.NavigationHandler, com.vaadin.flow.router.NavigationState)
or not.boolean
When set to true, the complete layout chain up to the navigation target should be re-instantiated regardless of it being already available.
Methods inherited from class java.util.EventObject
toString
-
Constructor Details
-
Method Details
-
getSource
Overrides:
getSource
in classEventObject
-
getLocation
Gets the new location.
Returns:
the new location, not
null
-
getUI
Gets the UI in which the navigation occurs.
Returns:
the UI of the navigation
-
getTrigger
Gets the type of user action that triggered this navigation event.
Returns:
the type of user action that triggered this navigation event, not
null
-
getState
Gets navigation state. It contains for example the scroll position and the complete href of the RouterLink that triggers this navigation.
Returns:
the navigation state
-
isForwardTo
public 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.Returns:
true
if this event is created as a result callingBeforeEvent.forwardTo(com.vaadin.flow.router.NavigationHandler, com.vaadin.flow.router.NavigationState)
,false
otherwise -
isForceInstantiation
public boolean isForceInstantiation()When set to true, the navigation target should be instantiated regardless of it being already available.
Returns:
true
if navigation target should be instantiated in any case -
isRecreateLayoutChain
public boolean isRecreateLayoutChain()When set to true, the complete layout chain up to the navigation target should be re-instantiated regardless of it being already available.
Returns:
true
if layout chain up to the navigation target should be instantiated in any case
-