Package com._1c.g5.lwt.layouts
Class LightTwoColumnLayout
- java.lang.Object
-
- com._1c.g5.lwt.layouts.LightTwoColumnLayout
-
- All Implemented Interfaces:
ILightLayout
public class LightTwoColumnLayout extends Object implements ILightLayout
A special version ofGridLayout
with enhanced two-column support.Copy-pasted from
GridLayout
-
-
Field Summary
Fields Modifier and Type Field Description static String
CHILDREN_KEY
Key to override the default children.static String
COLLAPSED_KEY
Key to mark the control as collapsed.int
horizontalSpacing
horizontalSpacing specifies the number of pixels between the right edge of one cell and the left edge of its neighbouring cell to the right.boolean
makeColumnsEqualWidth
makeColumnsEqualWidth specifies whether all columns in the layout will be forced to have the same width.int
marginBottom
marginBottom specifies the number of pixels of vertical margin that will be placed along the bottom edge of the layout.int
marginHeight
marginHeight specifies the number of pixels of vertical margin that will be placed along the top and bottom edges of the layout.int
marginLeft
marginLeft specifies the number of pixels of horizontal margin that will be placed along the left edge of the layout.int
marginRight
marginRight specifies the number of pixels of horizontal margin that will be placed along the right edge of the layout.int
marginTop
marginTop specifies the number of pixels of vertical margin that will be placed along the top edge of the layout.int
marginWidth
marginWidth specifies the number of pixels of horizontal margin that will be placed along the left and right edges of the layout.int
numColumns
numColumns specifies the number of cell columns in the layout.static String
SPLITTER_KEY
Key to mark the control as splitter.boolean
useOptimized
useOptimized specifies the layout behaviour for grids with two columns.int
verticalSpacing
verticalSpacing specifies the number of pixels between the bottom edge of one cell and the top edge of its neighbouring cell underneath.
-
Constructor Summary
Constructors Constructor Description LightTwoColumnLayout(int minWidth)
Constructs a new instance of this class with a single column.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.eclipse.swt.graphics.Point
computeSize(ILightComposite composite, org.eclipse.swt.graphics.GC gc, int wHint, int hHint, boolean flushCache)
Computes the size of the given composite.boolean
flushCache(ILightControl control)
Flushes the layout cache for the given control.void
layout(ILightComposite composite, org.eclipse.swt.graphics.GC gc, boolean flushCache)
Layouts the given composite.String
toString()
Returns a string containing a concise, human-readable description of the receiver.
-
-
-
Field Detail
-
CHILDREN_KEY
public static final String CHILDREN_KEY
Key to override the default children.- See Also:
- Constant Field Values
-
SPLITTER_KEY
public static final String SPLITTER_KEY
Key to mark the control as splitter.- See Also:
- Constant Field Values
-
COLLAPSED_KEY
public static final String COLLAPSED_KEY
Key to mark the control as collapsed.- See Also:
- Constant Field Values
-
useOptimized
public boolean useOptimized
useOptimized specifies the layout behaviour for grids with two columns. If value istrue
then the layout will optimize columns width assuming that the first column is for label. The default value istrue
.
-
numColumns
public int numColumns
numColumns specifies the number of cell columns in the layout. If numColumns has a value less than 1, the layout will not set the size and position of any controls. The default value is 1.
-
makeColumnsEqualWidth
public boolean makeColumnsEqualWidth
makeColumnsEqualWidth specifies whether all columns in the layout will be forced to have the same width. The default value is false.
-
marginWidth
public int marginWidth
marginWidth specifies the number of pixels of horizontal margin that will be placed along the left and right edges of the layout. The default value is 5.
-
marginHeight
public int marginHeight
marginHeight specifies the number of pixels of vertical margin that will be placed along the top and bottom edges of the layout. The default value is 5.
-
marginLeft
public int marginLeft
marginLeft specifies the number of pixels of horizontal margin that will be placed along the left edge of the layout. The default value is 0.- Since:
- 3.1
-
marginTop
public int marginTop
marginTop specifies the number of pixels of vertical margin that will be placed along the top edge of the layout. The default value is 0.- Since:
- 3.1
-
marginRight
public int marginRight
marginRight specifies the number of pixels of horizontal margin that will be placed along the right edge of the layout. The default value is 0.- Since:
- 3.1
-
marginBottom
public int marginBottom
marginBottom specifies the number of pixels of vertical margin that will be placed along the bottom edge of the layout. The default value is 0.- Since:
- 3.1
-
horizontalSpacing
public int horizontalSpacing
horizontalSpacing specifies the number of pixels between the right edge of one cell and the left edge of its neighbouring cell to the right. The default value is 5.
-
verticalSpacing
public int verticalSpacing
verticalSpacing specifies the number of pixels between the bottom edge of one cell and the top edge of its neighbouring cell underneath. The default value is 5.
-
-
Method Detail
-
computeSize
public org.eclipse.swt.graphics.Point computeSize(ILightComposite composite, org.eclipse.swt.graphics.GC gc, int wHint, int hHint, boolean flushCache)
Description copied from interface:ILightLayout
Computes the size of the given composite.- Specified by:
computeSize
in interfaceILightLayout
- Parameters:
composite
- the composite to compute the size of.gc
- theGC
to do the measurements with.wHint
- the width hint.hHint
- the height hint.flushCache
- the flush cache flag, instructs the layout to reset all its caches, if any.- Returns:
-
flushCache
public boolean flushCache(ILightControl control)
Description copied from interface:ILightLayout
Flushes the layout cache for the given control.- Specified by:
flushCache
in interfaceILightLayout
- Parameters:
control
- the control to flush the cache for.- Returns:
true
if the layout has flushed the cache,false
otherwise.
-
layout
public void layout(ILightComposite composite, org.eclipse.swt.graphics.GC gc, boolean flushCache)
Description copied from interface:ILightLayout
Layouts the given composite.- Specified by:
layout
in interfaceILightLayout
- Parameters:
composite
- the composite to layout.gc
- theGC
to do the measurements with.flushCache
- the flush cache flag, instructs the layout to reset all its caches, if any.
-
-