Package com._1c.g5.aef2.standard.layout
Class AefGridLayoutDataFactory
java.lang.Object
com._1c.g5.aef2.standard.layout.AefGridLayoutDataFactory
Aef grid layout data factory. Helps to build
AefGridLayoutData
objects.-
Method Summary
Modifier and TypeMethodDescriptionalign
(int hAlign, int vAlign) Sets the alignment of the control within its cell.applyTo
(StandardComponent<?, ?>... components) Creates a new AefGridLayoutData instance and assigns it to the specified components.void
applyTo
(ControlViewModel viewModel) Sets the layout data on the given control.copy()
Creates a copy of the receiver.create()
Creates a new AefGridLayoutData instance.static AefGridLayoutDataFactory
createFrom
(AefGridLayoutData data) Creates a new AefGridLayoutDataFactory that creates copies of the given AefGridLayoutData by default.exclude
(boolean shouldExclude) Instructs the AefGridLayout to ignore this control when performing layouts.static AefGridLayoutDataFactory
Creates a AefGridLayoutDataFactory initialized with default values.grab
(boolean horizontal, boolean vertical) Determines whether extra horizontal or vertical space should be allocated to this control's column when the layout resizes.hint
(int xHint, int yHint) Sets the width and height hints.indent
(int hIndent, int vIndent) Sets the indent of the control within the cell.minSize
(int minX, int minY) Sets the minimum size for the control.span
(int hSpan, int vSpan) Sets the AefGridLayoutData span.
-
Method Details
-
createFrom
Creates a new AefGridLayoutDataFactory that creates copies of the given AefGridLayoutData by default.- Parameters:
data
- AefGridLayoutData to copy- Returns:
- a new AefGridLayoutDataFactory that creates copies of the argument by default
-
fillDefaults
Creates a AefGridLayoutDataFactory initialized with default values.- Returns:
- a AefGridLayoutDataFactory that makes controls fill their grid by default
-
span
Sets the AefGridLayoutData span. The span controls how many cells are filled by the control.- Parameters:
hSpan
- number of columns spanned by the controlvSpan
- number of rows spanned by the control- Returns:
- this
-
hint
Sets the width and height hints. The width and height hints override the control's preferred size. If either hint is set to SWT.DEFAULT, the control's preferred size is used.- Parameters:
xHint
- horizontal hint (pixels), or SWT.DEFAULT to use the control's preferred sizeyHint
- vertical hint (pixels), or SWT.DEFAULT to use the control's preferred size- Returns:
- this
-
align
Sets the alignment of the control within its cell.- Parameters:
hAlign
- horizontal alignment. One of SWT.BEGINNING, SWT.CENTER, SWT.END, or SWT.FILL.vAlign
- vertical alignment. One of SWT.BEGINNING, SWT.CENTER, SWT.END, or SWT.FILL.- Returns:
- this
-
indent
Sets the indent of the control within the cell. Moves the position of the control by the given number of pixels. Positive values move toward the lower-right, negative values move toward the upper-left.- Parameters:
hIndent
- distance to move to the right (negative values move left)vIndent
- distance to move down (negative values move up)- Returns:
- this
-
grab
Determines whether extra horizontal or vertical space should be allocated to this control's column when the layout resizes. If any control in the column is set to grab horizontal then the whole column will grab horizontal space. If any control in the row is set to grab vertical then the whole row will grab vertical space.- Parameters:
horizontal
- true if the control's column should grow horizontallyvertical
- true if the control's row should grow vertically- Returns:
- this
-
minSize
Sets the minimum size for the control. The control will not be permitted to shrink below this size. Note: AefGridLayout treats a minimum size of 0 as an undocumented special value, so the smallest possible minimum size is a size of 1. A minimum size of SWT.DEFAULT indicates that the result of computeSize(int, int, boolean) should be used as the control's minimum size.- Parameters:
minX
- minimum a value of 1 or more is a horizontal size of the control (pixels). SWT.DEFAULT indicates that the control's preferred size should be used. A size of 0 has special semantics defined by AefGridLayout.minY
- minimum a value of 1 or more is a vertical size of the control (pixels). SWT.DEFAULT indicates that the control's preferred size should be used. A size of 0 has special semantics defined by AefGridLayout.- Returns:
- this
-
exclude
Instructs the AefGridLayout to ignore this control when performing layouts.- Parameters:
shouldExclude
- true iff the control should be excluded from layouts- Returns:
- this
-
create
Creates a new AefGridLayoutData instance. All attributes of the AefGridLayoutData instance will be initialized by the factory.- Returns:
- a new AefGridLayoutData instance
-
copy
Creates a copy of the receiver.- Returns:
- a copy of the receiver
-
applyTo
Sets the layout data on the given control. Creates a new AefGridLayoutData instance and assigns it to the control view model.- Parameters:
viewModel
- control view model whose layout data will be initialized
-
applyTo
Creates a new AefGridLayoutData instance and assigns it to the specified components.- Parameters:
components
- the components to set layout data to- Returns:
- this for chaining
-