| java.lang.Object org.eclipse.ui.internal.layout.CellData
CellData | final public class CellData (Code) | | CellData is the layout data object associated with
CellLayout . You can attach a CellData object to a
control by using the setLayoutData method. CellData
objects are optional. If you do not attach any layout data to a control,
it will behave just like attaching a CellData created using its default
constructor.
since: 3.0 |
Field Summary | |
final public static int | MAXIMUM hintType flag (value = 3) indicating that the width of the control should be no more than
widthHint (if provided) and the height of the control should be no more
than heightHint (if provided). | final public static int | MINIMUM hintType(value = 2) indicating that the width of the control should be no less than
widthHint (if provided) and the height of the control should be no less
than heightHint (if provided).
This flag is useful for buttons. | final public static int | NONE hintType flag (value = 0) indicating that the control's computeSize method should be used
to determine the control size. | final public static int | OVERRIDE hintType flag (value = 1) indicating that the widthHint and heightHint should be used
as the control's size instead of the result of computeSize
This flag is useful for list boxes, text boxes, tree controls, and other controls
whose contents can change dynamically. | public int | heightHint Height hint. | public int | hintType This flag controls how the width and height hints are to be treated. | public int | horizontalAlignment Horizontal alignment of the control within the cell. | public int | horizontalIndent Horizontal indentation (pixels). | public int | horizontalSpan | public int | verticalAlignment Vertical alignment of the control within the cell. | public int | verticalIndent Vertical indentation (pixels). | public int | verticalSpan | public int | widthHint Width hint. |
Constructor Summary | |
public | CellData() | public | CellData(GridData data) Creates a new CellData that with properties that are as close as possible to
the given GridData. | public | CellData(CellData newData) |
Method Summary | |
public CellData | align(int horizontalAlignment, int verticalAlignment) | public Point | computeSize(SizeCache toCompute, int cellWidth, int cellHeight) Returns the preferred size of the given control, given the known dimensions of
its cell. | public CellData | indent(Point indent) Sets the indentation for this control. | public CellData | indent(int horizontalIndent, int verticalIndent) | public void | positionControl(SizeCache cache, Rectangle cellBounds) Arranges the given control within the given rectangle using the
criteria described by this CellData. | public CellData | setHint(int hintType, Point hint) Sets the size hint for this control. | public CellData | setHint(int hintType, int horizontal, int vertical) Sets the size hint for this control. | public CellData | span(int horizontalSpan, int verticalSpan) Sets the number of rows and columns spanned by this control. |
MAXIMUM | final public static int MAXIMUM(Code) | | hintType flag (value = 3) indicating that the width of the control should be no more than
widthHint (if provided) and the height of the control should be no more
than heightHint (if provided).
This flag is useful for wrapping text. For example, set heightHint to SWT.DEFAULT
and set widthHint to the desired number of pixels after which text should wrap. This
will cause the text to wrap after the given number of pixels, but will not allocate
extra space in the column if the text widget does not fill an entire line.
|
MINIMUM | final public static int MINIMUM(Code) | | hintType(value = 2) indicating that the width of the control should be no less than
widthHint (if provided) and the height of the control should be no less
than heightHint (if provided).
This flag is useful for buttons. For example, set the width and height hints to
the default button size. This will use the default button size unless the button
label is too large to fit on the button.
|
NONE | final public static int NONE(Code) | | hintType flag (value = 0) indicating that the control's computeSize method should be used
to determine the control size. If modifierType is set to NONE, then the widthHint
and heightHint fields will be ignored.
|
OVERRIDE | final public static int OVERRIDE(Code) | | hintType flag (value = 1) indicating that the widthHint and heightHint should be used
as the control's size instead of the result of computeSize
This flag is useful for list boxes, text boxes, tree controls, and other controls
whose contents can change dynamically. For example, create a tree control and set
its width and height hints to the default size for that control. This will cause
the hints to be used instead of the preferred size of the tree control.
|
heightHint | public int heightHint(Code) | | Height hint. This modifies the height of the control, in pixels. If set to SWT.DEFAULT,
this dimension will not be constrained. Depending on the value of modifierType,
this will be a minimum size, a maximum size, or a replacement for the control's preferred
size.
|
hintType | public int hintType(Code) | | This flag controls how the width and height hints are to be treated. See the constants
above.
|
horizontalAlignment | public int horizontalAlignment(Code) | | Horizontal alignment of the control within the cell. May be one
of SWT.LEFT, SWT.RIGHT, SWT.CENTER, or SWT.NORMAL. SWT.NORMAL indicates
that the control should be made as wide as the cell.
|
horizontalIndent | public int horizontalIndent(Code) | | Horizontal indentation (pixels). Positive values move the control
to the right, negative to the left.
|
horizontalSpan | public int horizontalSpan(Code) | | Number of columns spanned by this cell (default = 1)
|
verticalAlignment | public int verticalAlignment(Code) | | Vertical alignment of the control within the cell. May be one of
SWT.TOP, SWT.BOTTOM, SWT.CENTER, or SWT.NORMAL. SWT.NORMAL indicates
that the control should be made as wide as the cell.
|
verticalIndent | public int verticalIndent(Code) | | Vertical indentation (pixels). Positive values move the control
down, negative values move the control up.
|
verticalSpan | public int verticalSpan(Code) | | Number of rows spanned by this cell (default = 1)
|
widthHint | public int widthHint(Code) | | Width hint. This modifies the width of the control, in pixels. If set to SWT.DEFAULT,
this dimension will not be constrained. Depending on the value of modifierType,
this may be a minimum size, a maximum size, or simply replace the preferred control
size.
|
CellData | public CellData()(Code) | | Constructs a CellData with default properties
|
CellData | public CellData(GridData data)(Code) | | Creates a new CellData that with properties that are as close as possible to
the given GridData. This is used for converting GridLayouts into CellLayouts.
Parameters: data - |
CellData | public CellData(CellData newData)(Code) | | Copies the given CellData
Parameters: newData - |
align | public CellData align(int horizontalAlignment, int verticalAlignment)(Code) | | Sets the alignment for this control
Parameters: horizontalAlignment - one of SWT.LEFT, SWT.RIGHT, SWT.FILL, or SWT.CENTER Parameters: verticalAlignment - one of SWT.TOP, SWT.BOTTOM, SWT.FILL, or SWT.CENTER this |
computeSize | public Point computeSize(SizeCache toCompute, int cellWidth, int cellHeight)(Code) | | Returns the preferred size of the given control, given the known dimensions of
its cell.
Parameters: toCompute - the control whose size is to be computed Parameters: cellWidth - width of the cell, in pixels (or SWT.DEFAULT if unknown) Parameters: cellHeight - height of the cell, in pixels (or SWT.DEFAULT if unknown) the preferred size of the given control, in pixels |
indent | public CellData indent(Point indent)(Code) | | Sets the indentation for this control. The indentation is added to
the control's position within the cell. For example, indentation of
(10,4) will move the control right by 10 pixels and down by 4 pixels.
Parameters: indent - indentation (pixels) this |
indent | public CellData indent(int horizontalIndent, int verticalIndent)(Code) | | Sets the indentation for this cell
Parameters: horizontalIndent - distance (pixels) to move the control to the right Parameters: verticalIndent - distance (pixels) to move the control down this |
positionControl | public void positionControl(SizeCache cache, Rectangle cellBounds)(Code) | | Arranges the given control within the given rectangle using the
criteria described by this CellData.
Parameters: control - Parameters: cellBounds - since: 3.0 |
setHint | public CellData setHint(int hintType, Point hint)(Code) | | Sets the size hint for this control. This is used to modify the control's
preferred size. If one dimension should remain unmodified, that hint can be
set to SWT.DEFAULT. Using a size hint of CellData.MINIMUM ensures that the preferred
control size is larger than the hint. Using a size hint of CellData.MAXIMUM ensures
that the preferred size is smaller than the hint. Using a size hint of CellData.OVERRIDE
ensures that the preferred size is always equal to the hint.
Parameters: hintType - one of CellData.MINIMUM, CellData.MAXIMUM, or CellData.OVERRIDE Parameters: hint - size hint (in pixels). If either dimension is set to SWT.DEFAULT, thehint will not affect that dimension this |
setHint | public CellData setHint(int hintType, int horizontal, int vertical)(Code) | | Sets the size hint for this control. This is used to modify the control's
preferred size. If one dimension should remain unmodified, that hint can be
set to SWT.DEFAULT. Using a size hint of CellData.MINIMUM ensures that the preferred
control size is larger than the hint. Using a size hint of CellData.MAXIMUM ensures
that the preferred size is smaller than the hint. Using a size hint of CellData.OVERRIDE
ensures that the preferred size is always equal to the hint. If both hints are equal
to SWT.DEFAULT, then the control's preferred size is unmodified.
Parameters: hintType - one of CellData.MINIMUM, CellData.MAXIMUM, or CellData.OVERRIDE Parameters: horizontal - horizontal hint (pixels). A value of SWT.DEFAULT will leave the resultof the control's computeSize method unmodified. Parameters: vertical - vertical hint (pixels). A value of SWT.DEFAULT will leave the result of the control's computeSize method unmodified. this |
span | public CellData span(int horizontalSpan, int verticalSpan)(Code) | | Sets the number of rows and columns spanned by this control.
Parameters: horizontalSpan - number of columns spanned by the control (> 0) Parameters: verticalSpan - number of rows spanned by the control (> 0) this |
|
|