Package org.eclipse.jface.layout
Class FillLayoutFactory
- java.lang.Object
-
- org.eclipse.jface.layout.FillLayoutFactory
-
public final class FillLayoutFactory extends Object
FillLayoutFactory creates and initializesfill 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 identicalFillLayoutfrom 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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapplyTo(Composite c)Creates a newFillLayoutand attaches it to the given composite.FillLayoutFactorycopy()Creates a copy of the receiver.static FillLayoutcopyLayout(FillLayout l)Copies the givenFillLayoutinstanceFillLayoutcreate()Creates a newFillLayout, and initializes it with values from the factory.static FillLayoutFactorycreateFrom(FillLayout l)Creates a factory that creates copies of the given layout.FillLayoutFactoryextendedMargins(int width, int height)Sets the margins for layouts created with this factory.static FillLayoutFactoryfillDefaults()Creates a factory that creates copies of the given layout.FillLayoutFactorymargins(int width, int height)Sets the margins for layouts created with this factory.FillLayoutFactorymargins(Point margins)Sets the margins for layouts created with this factory.StringtoString()
-
-
-
Method Detail
-
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 bymargins(int, int).- Parameters:
width- width margin size (pixels)height- height margin size (pixels)- Returns:
- this
- Since:
- 3.3
-
create
public FillLayout create()
Creates a newFillLayout, and initializes it with values from the factory.- Returns:
- a new initialized
FillLayout. - See Also:
applyTo(org.eclipse.swt.widgets.Composite)
-
applyTo
public void applyTo(Composite c)
Creates a newFillLayoutand 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:
create(),FillLayoutFactory
-
copyLayout
public static FillLayout copyLayout(FillLayout l)
Copies the givenFillLayoutinstance- Parameters:
l- layout to copy- Returns:
- a new FillLayout
-
-