Class ViewBreadcrumbs
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.Composite<JmixBreadcrumbs>
io.jmix.tabbedmode.component.breadcrumbs.ViewBreadcrumbs
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier
,com.vaadin.flow.component.DetachNotifier
,com.vaadin.flow.component.HasElement
,com.vaadin.flow.component.HasStyle
,Serializable
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
public class ViewBreadcrumbs
extends com.vaadin.flow.component.Composite<JmixBreadcrumbs>
implements org.springframework.context.ApplicationContextAware
A wrapper component for
JmixBreadcrumbs
that manages a stack of views.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
static final record
static final record
Represents the information about aView
and its associatedLocation
. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Deque<ViewBreadcrumbs.BreadcrumbMappings>
protected UiComponents
protected boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the givenView
to the view stack, registersLocation
mapping and updates visibility state.protected JmixBreadcrumb
createBreadcrumb
(View<?> view) protected Optional<ViewBreadcrumbs.BreadcrumbMappings>
findMappings
(View<?> view) findView
(JmixBreadcrumb breadcrumb) returns the information about the current view and its associated location.getViews()
Returns all views represented by this breadcrumbs component.protected JmixBreadcrumbs
protected void
void
Removes the lastView
from the view stack and updates visibility state.void
setApplicationContext
(org.springframework.context.ApplicationContext applicationContext) void
Sets a handler to be invoked when an individual breadcrumb is clicked.void
setVisible
(boolean visible) protected void
setVisibleInternal
(boolean visible) void
updateViewLocation
(View<?> view, com.vaadin.flow.router.Location location) UpdatesLocation
mapping of the givenView
.protected void
Methods inherited from class com.vaadin.flow.component.Composite
getChildren, getContent, getElement
Methods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListener
Methods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListener
Methods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Field Details
-
uiComponents
-
mappings
-
visibleExplicitly
protected boolean visibleExplicitly
-
-
Constructor Details
-
ViewBreadcrumbs
public ViewBreadcrumbs()
-
-
Method Details
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
- Throws:
org.springframework.beans.BeansException
-
initContent
- Overrides:
initContent
in classcom.vaadin.flow.component.Composite<JmixBreadcrumbs>
-
getViews
Returns all views represented by this breadcrumbs component.- Returns:
- a collection containing all
View
instances
-
getCurrentViewInfo
returns the information about the current view and its associated location. If no views are present in the stack, returnsnull
.- Returns:
- an instance of
ViewBreadcrumbs.ViewInfo
containing the current view and its location, ornull
if no views are available.
-
addView
Adds the givenView
to the view stack, registersLocation
mapping and updates visibility state.- Parameters:
view
- a view to addlocation
- associated location
-
createBreadcrumb
-
removeView
public void removeView()Removes the lastView
from the view stack and updates visibility state. -
updateViewLocation
UpdatesLocation
mapping of the givenView
.- Parameters:
view
- view to update the location mapping forlocation
- a new location
-
findMappings
-
findView
-
setVisible
public void setVisible(boolean visible) - Overrides:
setVisible
in classcom.vaadin.flow.component.Component
-
setVisibleInternal
protected void setVisibleInternal(boolean visible) -
updateVisibility
protected void updateVisibility()
-