Class LayoutsRowLayout

java.lang.Object
com.diffplug.common.swt.LayoutWrapper<RowLayout>
com.diffplug.common.swt.LayoutsRowLayout

public class LayoutsRowLayout extends LayoutWrapper<RowLayout>
A fluent api for setting and modifying a RowLayout, created by Layouts. Inspired by Moritz Post's blog post..
  • Method Details

    • margin

      public LayoutsRowLayout margin(int margin)
      Sets marginWidth and marginHeight to the given value, and left/right/top/bottom to 0.
      Specified by:
      margin in class LayoutWrapper<RowLayout>
    • marginTopBottom

      public LayoutsRowLayout marginTopBottom(int top, int bottom)
      Sets marginHeight to 0, and top / bottom to the given values.
    • marginLeftRight

      public LayoutsRowLayout marginLeftRight(int left, int right)
      Sets marginWidth to 0, and left / right to the given values.
    • spacing

      public LayoutsRowLayout spacing(int spacing)
      Sets the spacing to zero.
      Specified by:
      spacing in class LayoutWrapper<RowLayout>
    • vertical

      public LayoutsRowLayout vertical()
      Makes this a vertical layout.
    • horizontal

      public LayoutsRowLayout horizontal()
      Makes this a horizontal layout.
    • marginWidth

      public LayoutsRowLayout marginWidth(int marginWidth)
    • marginHeight

      public LayoutsRowLayout marginHeight(int marginHeight)
    • marginLeft

      public LayoutsRowLayout marginLeft(int marginLeft)
    • marginTop

      public LayoutsRowLayout marginTop(int marginTop)
    • marginRight

      public LayoutsRowLayout marginRight(int marginRight)
    • marginBottom

      public LayoutsRowLayout marginBottom(int marginBottom)
    • wrap

      public LayoutsRowLayout wrap(boolean wrap)
      wrap specifies whether a control will be wrapped to the next row if there is insufficient space on the current row.

      The default value is true.

    • pack

      public LayoutsRowLayout pack(boolean pack)
      pack specifies whether all controls in the layout take their preferred size. If pack is false, all controls will have the same size which is the size required to accommodate the largest preferred height and the largest preferred width of all the controls in the layout.

      The default value is true.

    • fill

      public LayoutsRowLayout fill(boolean fill)
      fill specifies whether the controls in a row should be all the same height for horizontal layouts, or the same width for vertical layouts.

      The default value is false.

    • center

      public LayoutsRowLayout center(boolean center)
      center specifies whether the controls in a row should be centered vertically in each cell for horizontal layouts, or centered horizontally in each cell for vertical layouts.

      The default value is false.

    • justify

      public LayoutsRowLayout justify(boolean justify)
      justify specifies whether the controls in a row should be fully justified, with any extra space placed between the controls.

      The default value is false.