Class ComponentUtils

java.lang.Object
io.jmix.flowui.kit.component.ComponentUtils

public final class ComponentUtils extends Object
  • Method Summary

    Modifier and Type
    Method
    Description
    static com.vaadin.flow.component.ShortcutRegistration
    addClickShortcut(com.vaadin.flow.component.ClickNotifier<?> component, KeyCombination shortcutCombination)
    Adds a shortcut which 'clicks' the Component which implements ClickNotifier interface.
    static void
    addComponentsToSlot(com.vaadin.flow.dom.Element element, String slot, com.vaadin.flow.component.Component... components)
    Deprecated, for removal: This API element is subject to removal in a future version.
    SlotUtils.addToSlot(HasElement, String, Component...) instead
    static void
    clearSlot(com.vaadin.flow.dom.Element element, String slot)
    Deprecated, for removal: This API element is subject to removal in a future version.
    use SlotUtils.clearSlot(HasElement, String) instead
    static com.vaadin.flow.component.icon.Icon
    convertToIcon(com.vaadin.flow.component.icon.VaadinIcon icon)
     
    static com.vaadin.flow.component.icon.FontIcon
    copyFontIcon(com.vaadin.flow.component.icon.FontIcon fontIcon)
    Creates a copy of font icon component.
    static com.vaadin.flow.component.Component
    copyIcon(com.vaadin.flow.component.Component icon)
    Creates a copy of icon component.
    static com.vaadin.flow.component.icon.Icon
    copyIconComponent(com.vaadin.flow.component.icon.Icon icon)
    Creates a copy of icon component.
    static com.vaadin.flow.component.icon.SvgIcon
    copySvgIcon(com.vaadin.flow.component.icon.SvgIcon svgIcon)
    Creates a copy of svg icon component.
    static int
    findActionIndexById(List<Action> actions, String actionId)
     
    static boolean
     
    static boolean
    isVisible(Object component)
     
    static com.vaadin.flow.component.icon.Icon
    parseIcon(String iconString)
     
    static void
    setEnabled(com.vaadin.flow.component.HasEnabled hasEnabled, boolean enabled)
     
    static <T> void
    setItemsMap(com.vaadin.flow.component.checkbox.CheckboxGroup<T> component, Map<T,String> items)
     
    static <T> void
    setItemsMap(com.vaadin.flow.component.combobox.ComboBox<T> component, Map<T,String> items)
     
    static <T> void
    setItemsMap(com.vaadin.flow.component.listbox.ListBox<T> component, Map<T,String> items)
     
    static <T> void
    setItemsMap(com.vaadin.flow.component.listbox.MultiSelectListBox<T> component, Map<T,String> items)
     
    static <T> void
    setItemsMap(com.vaadin.flow.component.radiobutton.RadioButtonGroup<T> component, Map<T,String> items)
     
    static <T> void
    setItemsMap(com.vaadin.flow.component.select.Select<T> component, Map<T,String> items)
     
    static void
     
    static void
    setVisible(com.vaadin.flow.component.Component component, boolean visible)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • parseIcon

      public static com.vaadin.flow.component.icon.Icon parseIcon(String iconString)
    • convertToIcon

      @Nullable public static com.vaadin.flow.component.icon.Icon convertToIcon(@Nullable com.vaadin.flow.component.icon.VaadinIcon icon)
    • copyIcon

      public static com.vaadin.flow.component.Component copyIcon(com.vaadin.flow.component.Component icon)
      Creates a copy of icon component. For the moment only Icon, SvgIcon and FontIcon types are supported.
      Parameters:
      icon - icon component to copy
      Returns:
      icon component copy
    • copyIconComponent

      public static com.vaadin.flow.component.icon.Icon copyIconComponent(com.vaadin.flow.component.icon.Icon icon)
      Creates a copy of icon component.
      Parameters:
      icon - icon component to copy
      Returns:
      icon component copy
    • copySvgIcon

      public static com.vaadin.flow.component.icon.SvgIcon copySvgIcon(com.vaadin.flow.component.icon.SvgIcon svgIcon)
      Creates a copy of svg icon component.
      Parameters:
      svgIcon - svg icon component to copy
      Returns:
      svg icon component copy
    • copyFontIcon

      public static com.vaadin.flow.component.icon.FontIcon copyFontIcon(com.vaadin.flow.component.icon.FontIcon fontIcon)
      Creates a copy of font icon component.
      Parameters:
      fontIcon - font icon component to copy
      Returns:
      font icon component copy
    • addComponentsToSlot

      @Deprecated(since="2.1", forRemoval=true) public static void addComponentsToSlot(com.vaadin.flow.dom.Element element, String slot, com.vaadin.flow.component.Component... components)
      Deprecated, for removal: This API element is subject to removal in a future version.
      SlotUtils.addToSlot(HasElement, String, Component...) instead
      Parameters:
      element - the parent component element to add the components to
      slot - the name of the slot inside the parent
      components - components to add to the specified slot.
    • clearSlot

      @Deprecated(since="2.1", forRemoval=true) public static void clearSlot(com.vaadin.flow.dom.Element element, String slot)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use SlotUtils.clearSlot(HasElement, String) instead
      Parameters:
      element - the component element to get children from
      slot - the name of the slot inside the parent
    • findActionIndexById

      public static int findActionIndexById(List<Action> actions, String actionId)
    • setItemsMap

      public static <T> void setItemsMap(com.vaadin.flow.component.checkbox.CheckboxGroup<T> component, Map<T,String> items)
    • setItemsMap

      public static <T> void setItemsMap(com.vaadin.flow.component.radiobutton.RadioButtonGroup<T> component, Map<T,String> items)
    • setItemsMap

      public static <T> void setItemsMap(com.vaadin.flow.component.listbox.ListBox<T> component, Map<T,String> items)
    • setItemsMap

      public static <T> void setItemsMap(com.vaadin.flow.component.listbox.MultiSelectListBox<T> component, Map<T,String> items)
    • setItemsMap

      public static <T> void setItemsMap(com.vaadin.flow.component.combobox.ComboBox<T> component, Map<T,String> items)
    • setItemsMap

      public static <T> void setItemsMap(com.vaadin.flow.component.select.Select<T> component, Map<T,String> items)
    • setItemsMap

      public static void setItemsMap(EnhancedLoginForm component, Map<Locale,String> items)
    • isAutoSize

      public static boolean isAutoSize(@Nullable String size)
    • setVisible

      public static void setVisible(com.vaadin.flow.component.Component component, boolean visible)
    • setEnabled

      public static void setEnabled(com.vaadin.flow.component.HasEnabled hasEnabled, boolean enabled)
    • isVisible

      public static boolean isVisible(Object component)
    • addClickShortcut

      public static com.vaadin.flow.component.ShortcutRegistration addClickShortcut(com.vaadin.flow.component.ClickNotifier<?> component, KeyCombination shortcutCombination)
      Adds a shortcut which 'clicks' the Component which implements ClickNotifier interface.
      Parameters:
      component - a component to add shortcut
      shortcutCombination - an object that stores information about key, modifiers and additional settings
      Returns:
      ShortcutRegistration for configuring the shortcut and removing