Package io.jmix.flowui.component.main
Class JmixListMenu.ViewMenuItem
java.lang.Object
io.jmix.flowui.kit.component.main.ListMenu.MenuItem
io.jmix.flowui.component.main.JmixListMenu.ViewMenuItem
- All Implemented Interfaces:
MenuItem
- Enclosing class:
JmixListMenu
Describes menu item that should navigate to the view.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.vaadin.flow.router.RouteParametersprotected com.vaadin.flow.router.QueryParametersFields inherited from class io.jmix.flowui.kit.component.main.ListMenu.MenuItem
classNames, clickHandler, description, id, MENU_ITEM_CLASS_NAME, MENU_ITEM_PREFIX_COMPONENT, MENU_ITEM_SUFFIX_COMPONENT, menuComponent, openedChangeHandler, prefixComponent, propertyChangeSupport, shortcutCombination, suffixComponent, title, visible -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ListMenu.MenuItemstatic JmixListMenu.ViewMenuItemCreates menu item that should navigate to the view with provided ID.boolean@Nullable com.vaadin.flow.router.RouteParameters@Nullable com.vaadin.flow.router.QueryParametersinthashCode()withClassNames(List<String> classNames) Sets class names that should be added to the menu item.withControllerClass(@Nullable Class<? extends View<?>> controllerClass) Sets view class that should be shown when the user clicks on the menu item.withDescription(@Nullable String description) Sets menu item description that should be shown when the user moves cursor on item.withPrefixComponent(com.vaadin.flow.component.Component prefixComponent) Sets prefix component of the item.withRouteParameters(List<MenuItem.MenuItemParameter> routeParameters) withShortcutCombination(@Nullable KeyCombination shortcutCombination) withSuffixComponent(com.vaadin.flow.component.Component suffixComponent) Sets suffix component of the item.Sets displayed menu item text.withUrlQueryParameters(List<MenuItem.MenuItemParameter> queryParameters) withVisible(boolean visible) Sets whether a menu item should be visible.Methods inherited from class io.jmix.flowui.kit.component.main.ListMenu.MenuItem
addClassNames, addPropertyChangeListener, createMenuBar, getClassNames, getClickHandler, getDescription, getId, getMenuComponent, getOpenedChangeHandler, getPrefixComponent, getShortcutCombination, getSuffixComponent, getTitle, isAttachedToMenu, isMenu, isSeparator, isVisible, removePropertyChangeListener, setMenuComponent, setPrefixComponent, setSuffixComponent, setVisible, toString, withClickHandler, withOpenedChangeHandler
-
Field Details
-
controllerClass
-
urlQueryParameters
protected com.vaadin.flow.router.QueryParameters urlQueryParameters -
routeParameters
protected com.vaadin.flow.router.RouteParameters routeParameters
-
-
Constructor Details
-
ViewMenuItem
-
-
Method Details
-
create
Creates menu item that should navigate to the view with provided ID.- Parameters:
viewId- view ID- Returns:
- menu item
-
create
-
withTitle
Description copied from class:ListMenu.MenuItemSets displayed menu item text.- Overrides:
withTitlein classListMenu.MenuItem- Parameters:
title- displayed text- Returns:
- current menu instance
-
withVisible
Description copied from class:ListMenu.MenuItemSets whether a menu item should be visible.- Overrides:
withVisiblein classListMenu.MenuItem- Parameters:
visible-trueif menu item should be visible,falseotherwise- Returns:
- current menu item instance
-
withDescription
Description copied from class:ListMenu.MenuItemSets menu item description that should be shown when the user moves cursor on item.- Overrides:
withDescriptionin classListMenu.MenuItem- Parameters:
description- description to set- Returns:
- current menu instance
-
withClassNames
Description copied from class:ListMenu.MenuItemSets class names that should be added to the menu item.- Overrides:
withClassNamesin classListMenu.MenuItem- Parameters:
classNames- class names to add- Returns:
- current menu instance
-
withSuffixComponent
public JmixListMenu.ViewMenuItem withSuffixComponent(com.vaadin.flow.component.Component suffixComponent) Description copied from class:ListMenu.MenuItemSets suffix component of the item.- Overrides:
withSuffixComponentin classListMenu.MenuItem- Parameters:
suffixComponent- component to set- Returns:
- current menu item instance
-
withPrefixComponent
public JmixListMenu.ViewMenuItem withPrefixComponent(com.vaadin.flow.component.Component prefixComponent) Description copied from class:ListMenu.MenuItemSets prefix component of the item.- Overrides:
withPrefixComponentin classListMenu.MenuItem- Parameters:
prefixComponent- component to set- Returns:
- current menu item instance
-
withShortcutCombination
public JmixListMenu.ViewMenuItem withShortcutCombination(@Nullable KeyCombination shortcutCombination) - Overrides:
withShortcutCombinationin classListMenu.MenuItem
-
getUrlQueryParameters
public @Nullable com.vaadin.flow.router.QueryParameters getUrlQueryParameters() -
withUrlQueryParameters
public JmixListMenu.ViewMenuItem withUrlQueryParameters(List<MenuItem.MenuItemParameter> queryParameters) -
getRouteParameters
public @Nullable com.vaadin.flow.router.RouteParameters getRouteParameters() -
withRouteParameters
public JmixListMenu.ViewMenuItem withRouteParameters(List<MenuItem.MenuItemParameter> routeParameters) -
getControllerClass
- Returns:
- view class or
nullif not set
-
withControllerClass
public JmixListMenu.ViewMenuItem withControllerClass(@Nullable Class<? extends View<?>> controllerClass) Sets view class that should be shown when the user clicks on the menu item. If not set,ListMenu.MenuItem.getId()will be used as view id to navigate.- Parameters:
controllerClass- view class to set- Returns:
- current menu instance
-
equals
- Overrides:
equalsin classListMenu.MenuItem
-
hashCode
public int hashCode()- Overrides:
hashCodein classListMenu.MenuItem
-