com.vaadin.flow.router.internal.

Class AbstractNavigationStateRenderer

  • java.lang.Object
    • com.vaadin.flow.router.internal.AbstractNavigationStateRenderer
    • Constructor Detail

      • AbstractNavigationStateRenderer

        public AbstractNavigationStateRenderer(NavigationState navigationState)

        Creates a new renderer for the given navigation state.

        Parameters:

        navigationState - the target navigation state

    • Method Detail

      • getNavigationState

        public NavigationState getNavigationState()

        Gets the targeted navigation state.

        Returns:

        the targeted navigation state

      • handle

        public int handle(NavigationEvent event)

        Description copied from interface: NavigationHandler

        Handles the navigation event.

        Specified by:

        handle in interface NavigationHandler

        Parameters:

        event - the navigation event to handle

        Returns:

        the HTTP status code to return to the client if handling an initial rendering request

      • notifyNavigationTarget

        protected abstract void notifyNavigationTarget(Component componentInstance,
                                                       NavigationEvent navigationEvent,
                                                       BeforeEnterEvent beforeEnterEvent,
                                                       LocationChangeEvent locationChangeEvent)

        Notified the navigation target about the status of the navigation.

        Parameters:

        componentInstance - the navigation target instance

        navigationEvent - the low level navigation event that is being processed

        beforeEnterEvent - the before enter event that will be fired unless navigation is rerouted

        locationChangeEvent - the location change event that will be fired unless navigation is rerouted

      • getRouterLayoutTypes

        protected abstract List<Class<? extends RouterLayout>> getRouterLayoutTypes(Class<? extends Component> routeTargetType)

        Gets the router layout types to show for the given route target type, starting from the parent layout immediately wrapping the route target type.

        Parameters:

        routeTargetType - component type that will be shown

        Returns:

        a list of parent RouterLayout types, not null

      • eventActionsSupported

        protected abstract boolean eventActionsSupported()

        Checks whether this renderer should reroute or postpone navigation based on results from event listeners. Furthermore, the before leave event is not fired at all if event actions are not supported.

        Returns:

        true to support event actions; false otherwise.