Class FormLayout

    • Method Detail

      • setColspan

        public void setColspan​(Component component,
                               int colspan)
        Sets the colspan of the given component's element. Will default to 1 if an integer lower than 1 is supplied. You can directly add components with the wanted colspan with add(Component, int).
        Parameters:
        component - the component to set the colspan for, not null
        colspan - the desired colspan for the component
      • add

        public void add​(Component component,
                        int colspan)
        Adds a component with the desired colspan. This method is a shorthand for calling #add(Component) and setColspan(Component, int)
        Parameters:
        component - the component to add
        colspan - the desired colspan for the component
      • getColspan

        public int getColspan​(Component component)
        Gets the colspan of the given component. If none is set, returns 1.
        Parameters:
        component - the component whose colspan is retrieved
      • addFormItem

        public FormLayout.FormItem addFormItem​(Component field,
                                               String label)
        Convenience method for creating and adding a new FormItem to this layout that wraps the given field with a label. Shorthand for addFormItem(field, new Label(label)).
        Parameters:
        field - the field component to wrap
        label - the label text to set
        Returns:
        the created form item
        See Also:
        addFormItem(Component, Component)
      • addFormItem

        public FormLayout.FormItem addFormItem​(Component field,
                                               Component label)
        Convenience method for creating and adding a new FormItem to this layout that wraps the given field with a component as its label.
        Parameters:
        field - the field component to wrap
        label - the label component to set
        Returns:
        the created form item