Class ComponentFactory


  • public class ComponentFactory
    extends Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static com.vaadin.flow.component.button.Button newButton()  
      static com.vaadin.flow.component.button.Button newButton​(com.vaadin.flow.component.icon.Icon icon, Collection<String> styleNames)  
      static LinkkiCheckBox newCheckbox()  
      static <T> com.vaadin.flow.component.combobox.ComboBox<T> newComboBox()  
      static com.vaadin.flow.component.datepicker.DatePicker newDateField()
      Creates a new default DatePicker with DatePicker.setAutoOpen(boolean) set to false and autoselect feature to true
      static com.vaadin.flow.component.datepicker.DatePicker newDateField​(boolean autoOpen, boolean autoselect)
      Creates a DatePicker with the given options
      static com.vaadin.flow.component.datetimepicker.DateTimePicker newDateTimeField​(long step)
      Creates a new default DateTimePicker with the given step, DateTimePicker.setAutoOpen(boolean) set to false and the autoselect feature to true
      static com.vaadin.flow.component.datetimepicker.DateTimePicker newDateTimeField​(long step, boolean autoOpen, boolean autoselect)
      Creates a DateTimePicker with the given options
      static com.vaadin.flow.component.Component newHorizontalLine()
      Creates a new horizontal line.
      static LinkkiAnchor newLink​(String caption)
      Creates a new Anchor with undefined width.
      static <T> com.vaadin.flow.component.combobox.MultiSelectComboBox<T> newMultiSelect()  
      static com.vaadin.flow.component.textfield.TextField newNumberField​(int maxLength, String width, String pattern)
      Creates a new TextField to display numbers.
      static com.vaadin.flow.component.textfield.TextField newNumberFieldWithFormattingPattern​(int maxLength, String width, String pattern)
      Creates a new TextField to display numbers with the specified formatting pattern.
      static com.vaadin.flow.component.orderedlayout.VerticalLayout newPlainVerticalLayout()
      Creates a plain VerticalLayout without spacing or margin.
      static com.vaadin.flow.component.textfield.TextArea newTextArea()  
      static com.vaadin.flow.component.textfield.TextArea newTextArea​(int maxLength, String width, String height)
      Returns a new TextArea with the given max length, width and number of rows.
      static com.vaadin.flow.component.textfield.TextField newTextField()
      Creates a new TextField with an unlimited maximal character count and an undefined width.
      static com.vaadin.flow.component.textfield.TextField newTextField​(int maxLength, String width)
      Returns a new TextField with the given max length and width.
    • Method Detail

      • newHorizontalLine

        public static com.vaadin.flow.component.Component newHorizontalLine()
        Creates a new horizontal line.
      • newLink

        public static LinkkiAnchor newLink​(String caption)
        Creates a new Anchor with undefined width.
      • newTextField

        public static com.vaadin.flow.component.textfield.TextField newTextField()
        Creates a new TextField with an unlimited maximal character count and an undefined width.
      • newTextField

        public static com.vaadin.flow.component.textfield.TextField newTextField​(int maxLength,
                                                                                 String width)
        Returns a new TextField with the given max length and width.

        If the given maxLength is less than or equal to 0, the maximal character count is unlimited.

        If the given width is not specified and maxLength is greater than 0, the width of the field is inferred by maxLength.

      • newNumberField

        public static com.vaadin.flow.component.textfield.TextField newNumberField​(int maxLength,
                                                                                   String width,
                                                                                   String pattern)
        Creates a new TextField to display numbers.
      • newNumberFieldWithFormattingPattern

        public static com.vaadin.flow.component.textfield.TextField newNumberFieldWithFormattingPattern​(int maxLength,
                                                                                                        String width,
                                                                                                        String pattern)
        Creates a new TextField to display numbers with the specified formatting pattern. The pattern is converted to a regex by using it to format a test number and checking the result to see which characters are allowed.
      • newTextArea

        public static com.vaadin.flow.component.textfield.TextArea newTextArea()
      • newTextArea

        public static com.vaadin.flow.component.textfield.TextArea newTextArea​(int maxLength,
                                                                               String width,
                                                                               String height)
        Returns a new TextArea with the given max length, width and number of rows.

        If the given maxLength is less than or equal to 0, the maximal character count is unlimited.

        If the given width is an empty String and maxLength is greater than 0, the width of the field is inferred by maxLength.

        The height is only set if the given String is not empty.

      • newComboBox

        public static <T> com.vaadin.flow.component.combobox.ComboBox<T> newComboBox()
      • newMultiSelect

        public static <T> com.vaadin.flow.component.combobox.MultiSelectComboBox<T> newMultiSelect()
      • newButton

        public static com.vaadin.flow.component.button.Button newButton()
      • newDateField

        public static com.vaadin.flow.component.datepicker.DatePicker newDateField()
        Creates a new default DatePicker with DatePicker.setAutoOpen(boolean) set to false and autoselect feature to true
      • newDateField

        public static com.vaadin.flow.component.datepicker.DatePicker newDateField​(boolean autoOpen,
                                                                                   boolean autoselect)
        Creates a DatePicker with the given options
        Parameters:
        autoOpen - If true, the dropdown will open when the field is clicked.
        autoselect - If true, the date value will be selected when the field is focused.
      • newDateTimeField

        public static com.vaadin.flow.component.datetimepicker.DateTimePicker newDateTimeField​(long step)
        Creates a new default DateTimePicker with the given step, DateTimePicker.setAutoOpen(boolean) set to false and the autoselect feature to true
        Parameters:
        step - the time interval, in minutes, between the items displayed in the time picker overlay
      • newDateTimeField

        public static com.vaadin.flow.component.datetimepicker.DateTimePicker newDateTimeField​(long step,
                                                                                               boolean autoOpen,
                                                                                               boolean autoselect)
        Creates a DateTimePicker with the given options
        Parameters:
        step - The time interval, in minutes, between the items displayed in the time picker overlay
        autoOpen - If true, the dropdown will open when the field is clicked.
        autoselect - If true, the date value will be selected when the field is focused.
      • newButton

        public static com.vaadin.flow.component.button.Button newButton​(com.vaadin.flow.component.icon.Icon icon,
                                                                        Collection<String> styleNames)
      • newPlainVerticalLayout

        public static com.vaadin.flow.component.orderedlayout.VerticalLayout newPlainVerticalLayout()
        Creates a plain VerticalLayout without spacing or margin.