Class FillLayoutFactory

java.lang.Object
org.eclipse.jface.layout.FillLayoutFactory

public final class FillLayoutFactory extends Object
FillLayoutFactory creates and initializes fill layouts. It is used as a shorthand for writing "new FillLayout()" and initializing some fields. In this case the main benefit is a more concise syntax and the ability to create more than one identical FillLayout from the same factory. Changing a property of the factory will affect future layouts created by the factory, but has no effect on layouts that have already been created.
Since:
3.26
  • Method Details

    • fillDefaults

      public static FillLayoutFactory fillDefaults()
      Creates a factory that creates copies of the given layout.
      Returns:
      a new FillLayoutFactory instance with a new FillLayout
    • createFrom

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

      public FillLayoutFactory copy()
      Creates a copy of the receiver.
      Returns:
      a copy of the receiver
    • margins

      public FillLayoutFactory margins(Point margins)
      Sets the margins for layouts created with this factory. The margins are the distance between the outer cells and the edge of the layout.
      Parameters:
      margins - margin size (pixels)
      Returns:
      this
    • margins

      public FillLayoutFactory margins(int width, int height)
      Sets the margins for layouts created with this factory. The margins are the distance between the outer cells and the edge of the layout.
      Parameters:
      width - margin width (pixels)
      height - margin height (pixels)
      Returns:
      this
    • extendedMargins

      public FillLayoutFactory extendedMargins(int width, int height)
      Sets the margins for layouts created with this factory. The margins specify the number of pixels of width and height of the layout. Note that these margins will be added to the ones specified by margins(int, int).
      Parameters:
      width - width margin size (pixels)
      height - height margin size (pixels)
      Returns:
      this
      Since:
      3.3
    • create

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

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

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

      public String toString()
      Overrides:
      toString in class Object