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 classstatic final recordstatic final recordRepresents the information about aViewand its associatedLocation. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Deque<ViewBreadcrumbs.BreadcrumbMappings>protected UiComponentsprotected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the givenViewto the view stack, registersLocationmapping and updates visibility state.protected JmixBreadcrumbcreateBreadcrumb(View<?> view) protected Optional<ViewBreadcrumbs.BreadcrumbMappings>findMappings(View<?> view) findView(JmixBreadcrumb breadcrumb) returns the information about the current view and its associated location.protected ViewBreadcrumbs.BreadcrumbMappingsgetMappings(View<?> view) getViews()Returns all views represented by this breadcrumbs component.protected JmixBreadcrumbsprotected voidvoidRemoves the lastViewfrom the view stack and updates visibility state.voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidSets a handler to be invoked when an individual breadcrumb is clicked.voidsetVisible(boolean visible) protected voidsetVisibleInternal(boolean visible) voidupdateBreadcrumbText(View<?> view, String text) Updates the breadcrumb text for the specifiedView.voidupdateViewLocation(View<?> view, com.vaadin.flow.router.Location location) UpdatesLocationmapping of the givenView.protected voidMethods inherited from class com.vaadin.flow.component.Composite
getChildren, getContent, getElementMethods 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, setIdMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods 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:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-
initContent
- Overrides:
initContentin classcom.vaadin.flow.component.Composite<JmixBreadcrumbs>
-
getViews
Returns all views represented by this breadcrumbs component.- Returns:
- a collection containing all
Viewinstances
-
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.ViewInfocontaining the current view and its location, ornullif no views are available.
-
addView
Adds the givenViewto the view stack, registersLocationmapping and updates visibility state.- Parameters:
view- a view to addlocation- associated location
-
createBreadcrumb
-
removeView
public void removeView()Removes the lastViewfrom the view stack and updates visibility state. -
updateViewLocation
UpdatesLocationmapping of the givenView.- Parameters:
view- view to update the location mapping forlocation- a new location
-
updateBreadcrumbText
Updates the breadcrumb text for the specifiedView. This method modifies the text displayed on the breadcrumb associated with the provided view.- Parameters:
view- theViewinstance for which the breadcrumb text needs to be updatedtext- the new text to set for the breadcrumb
-
getMappings
-
findMappings
-
findView
-
setVisible
public void setVisible(boolean visible) - Overrides:
setVisiblein classcom.vaadin.flow.component.Component
-
setVisibleInternal
protected void setVisibleInternal(boolean visible) -
updateVisibility
protected void updateVisibility()
-