Interface Form

All Superinterfaces:
ChildEditableController, Component, Component.BelongToFrame, Component.Editable, Component.HasCaption, Component.HasDescription, Component.HasIcon, ComponentContainer, EditableChangeNotifier, HasComponents, HasContextHelp, HasHtmlCaption, HasHtmlDescription, HasHtmlSanitizer, HasValueSourceProvider, SupportsCaptionPosition
All Known Implementing Classes:
FormImpl

A multi-column form component.
  • Field Details

  • Method Details

    • add

      void add(Component childComponent)
      Adds a component to the first column.
      Specified by:
      add in interface ComponentContainer
      Parameters:
      childComponent - a component to add
    • add

      default void add(Component... childComponents)
      Sequentially adds components to the first column.
      Specified by:
      add in interface ComponentContainer
      Parameters:
      childComponents - components to add
    • add

      void add(Component childComponent, int column)
      Adds a component to the column with the given index.
      Parameters:
      childComponent - a component to add
      column - a columns index
    • add

      void add(Component childComponent, int column, int colSpan, int rowSpan)
      Adds a component to a column with the given index with the given span.
      Parameters:
      childComponent - a component to add
      column - a columns index
      colSpan - a number of columns a component should span
      rowSpan - a number of rows a component should span
    • add

      void add(Component childComponent, int column, int row)
      Adds a component to a column with the given index to the given position.
      Parameters:
      childComponent - a component to add
      column - a columns index
      row - a row index
    • add

      void add(Component childComponent, int column, int row, int colSpan, int rowSpan)
      Adds a component to a column with the given index to the given position with the given span.
      Parameters:
      childComponent - a component to add
      column - a columns index
      row - a row index
      colSpan - a number of columns a component should span
      rowSpan - a number of rows a component should span
    • getComponents

      Collection<Component> getComponents(int column)
      Parameters:
      column - a column index
      Returns:
      a collection of components directly owned by a column with a given index
    • getComponent

      Component getComponent(int column, int row)
      Parameters:
      column - a columns index
      row - a row index
      Returns:
      a component placed in a column with a given index in a given position
    • getCaptionPosition

      Specified by:
      getCaptionPosition in interface SupportsCaptionPosition
      Returns:
      caption position of form child components
    • setCaptionPosition

      void setCaptionPosition(SupportsCaptionPosition.CaptionPosition position)
      Sets caption position of form child components.
      Specified by:
      setCaptionPosition in interface SupportsCaptionPosition
      Parameters:
      position - component caption position
    • getChildrenCaptionWidth

      int getChildrenCaptionWidth()
      Returns:
      columns fixed caption width
    • setChildrenCaptionWidth

      void setChildrenCaptionWidth(int width)
      Sets fixed captions width for all columns. Set -1 to use auto size.
      Parameters:
      width - fixed caption width
    • getChildrenCaptionAlignment

      Form.CaptionAlignment getChildrenCaptionAlignment()
      Returns:
      alignment of child component captions
    • setChildrenCaptionAlignment

      @StudioProperty(type=ENUMERATION, defaultValue="LEFT", options={"LEFT","RIGHT"}) void setChildrenCaptionAlignment(Form.CaptionAlignment alignment)
      Sets alignment of child component captions in all columns.

      Applicable only when captions position is SupportsCaptionPosition.CaptionPosition.LEFT.

      Parameters:
      alignment - captions alignment
    • getChildrenCaptionAlignment

      Form.CaptionAlignment getChildrenCaptionAlignment(int column)
      Returns alignment of child component captions for a column with the given index.
      Parameters:
      column - a column index to get caption
      Returns:
      alignment of child component captions for a column with the given index
    • setChildrenCaptionAlignment

      void setChildrenCaptionAlignment(int column, Form.CaptionAlignment alignment)
      Sets alignment of child component captions for a column with the given index.
      Parameters:
      column - a column index to set caption
      alignment - alignment of child component captions for a column with the given index
    • getChildrenCaptionWidth

      int getChildrenCaptionWidth(int column)
      Returns fixed caption width for column with a given index.
      Parameters:
      column - a column index
      Returns:
      fixed caption width for column with a given index
    • setChildrenCaptionWidth

      @StudioProperty(name="childrenCaptionWidth", type=SIZE, defaultValue="-1px") void setChildrenCaptionWidth(int column, int width)
      Set fixed captions width for column with a given index. Set -1 to use auto size.
      Parameters:
      column - a column index
      width - fixed caption width for column with a given index
    • getColumns

      int getColumns()
      Returns:
      number of columns in the Form
    • setColumns

      void setColumns(int columns)
      Sets the number of columns in the Form. The column count can not be reduced if there are any components that would be outside of the shrunk Form.
      Parameters:
      columns - the new number of columns in the Form
    • getColumnFlex

      float getColumnFlex(int column)
      Returns the flex layout ratio for column with a given index.
      Parameters:
      column - a column index
      Returns:
      flex layout ratio for column with a given index
    • setColumnFlex

      void setColumnFlex(int column, float flex)
      Sets flex layout ratio for column with a given index.
      Parameters:
      column - a column index
      flex - the flex ration for the column