Class AefGridLayoutFactory

java.lang.Object
com._1c.g5.aef2.standard.layout.AefGridLayoutFactory

public class AefGridLayoutFactory extends Object
Aef grid layout factory. Helps to build AefGridLayout objects.
  • Method Details

    • createFrom

      public static AefGridLayoutFactory createFrom(AefGridLayout l)
      Creates a factory that creates copies of the given layout.
      Parameters:
      l - layout to copy
      Returns:
      a new AefGridLayoutFactory instance that creates copies of the given layout
    • copy

      public AefGridLayoutFactory copy()
      Creates a copy of the reciever.
      Returns:
      a copy of the reciever
    • useOptimized

      public AefGridLayoutFactory useOptimized(boolean use)
      Sets the special optimized mode for layouts created with this factory. It works only with two column layouts.
      Parameters:
      use - the value
      Returns:
      this
    • optimizedFirstColumnWidth

      public AefGridLayoutFactory optimizedFirstColumnWidth(int width)
      Sets the width of the first column for special optimized mode for layouts created with this factory. It works only with two column layouts.
      Parameters:
      width - the width
      Returns:
      this
    • fillDefaults

      public static AefGridLayoutFactory fillDefaults()
      Creates a AefGridLayoutFactory that creates AefGridLayouts with no margins and default dialog spacing.

      Initial values are:

      • numColumns(1)
      • margins(0,0)
      • extendedMargins(0,0,0,0)
      • spacing(LayoutConstants.getSpacing())
      • equalWidth(false)
      Returns:
      a AefGridLayoutFactory that creates AefGridLayouts as though created with their default constructor
    • equalWidth

      public AefGridLayoutFactory equalWidth(boolean equal)
      Sets whether the columns should be forced to be equal width
      Parameters:
      equal - true iff the columns should be forced to be equal width
      Returns:
      this
    • spacing

      public AefGridLayoutFactory spacing(int hSpacing, int vSpacing)
      Sets the spacing for layouts created with this factory. The spacing is the distance between cells within the layout.
      Parameters:
      hSpacing - horizontal spacing (pixels)
      vSpacing - vertical spacing (pixels)
      Returns:
      this
    • margins

      public AefGridLayoutFactory margins(int width, int height)
      Sets the margins for layouts created with this factory. The margins specify the number of pixels of horizontal and vertical margin that will be placed along the left/right and top/bottom edges of the layout. Note that thes margins will be added to the ones specified by extendedMargins(int, int, int, int).
      Parameters:
      width - margin width (pixels)
      height - margin height (pixels)
      Returns:
      this
    • extendedMargins

      public AefGridLayoutFactory extendedMargins(int left, int right, int top, int bottom)
      Sets the margins for layouts created with this factory. The margins specify the number of pixels of horizontal and vertical margin that will be placed along the left, right, top, and bottom edges of the layout. Note that thes margins will be added to the ones specified by margins(int, int).
      Parameters:
      left - left margin size (pixels)
      right - right margin size (pixels)
      top - top margin size (pixels)
      bottom - bottom margin size (pixels)
      Returns:
      this
    • numColumns

      public AefGridLayoutFactory numColumns(int numColumns)
      Sets the number of columns in the layout
      Parameters:
      numColumns - number of columns in the layout
      Returns:
      this
    • create

      public AefGridLayout create()
      Creates a new AefGridLayout, and initializes it with values from the factory.
      Returns:
      a new initialized AefGridLayout.
      See Also:
    • applyTo

      public void applyTo(CompositeViewModel c)
      Creates a new AefGridLayout and attaches it to the given composite. Does not create the GridData of any of the controls in the composite.
      Parameters:
      c - composite whose layout will be set
      See Also:
    • copyLayout

      public static AefGridLayout copyLayout(AefGridLayout l)
      Copies the given AefGridLayout instance
      Parameters:
      l - layout to copy
      Returns:
      a new AefGridLayout