|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.eclipse.swt.layout.GridData
GridData
is the layout data object associated with
GridLayout
. To set a GridData
object into a
control, you use the setLayoutData ()
method.
There are two ways to create a GridData
object with certain
fields set. The first is to set the fields directly, like this:
GridData gridData = new GridData(); gridData.horizontalAlignment = GridData.FILL; gridData.grabExcessHorizontalSpace = true; button1.setLayoutData(gridData);The second is to take advantage of convenience style bits defined by
GridData
:
button1.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL));
NOTE: Do not reuse GridData
objects. Every control in a
Composite
that is managed by a GridLayout
must have a unique GridData
object. If the layout data
for a control in a GridLayout
is null at layout time,
a unique GridData
object is created for it.
GridLayout
Field Summary | |
static int |
BEGINNING
|
static int |
CENTER
|
static int |
END
|
static int |
FILL
|
static int |
FILL_BOTH
FILL_BOTH = FILL_VERTICAL | FILL_HORIZONTAL |
static int |
FILL_HORIZONTAL
FILL_HORIZONTAL = HORIZONTAL_ALIGN_FILL | GRAB_HORIZONTAL |
static int |
FILL_VERTICAL
FILL_VERTICAL = VERTICAL_ALIGN_FILL | GRAB_VERTICAL |
static int |
GRAB_HORIZONTAL
|
static int |
GRAB_VERTICAL
|
boolean |
grabExcessHorizontalSpace
grabExcessHorizontalSpace specifies whether the cell will be made wide enough to fit the remaining horizontal space. |
boolean |
grabExcessVerticalSpace
grabExcessVerticalSpace specifies whether the cell will be made tall enough to fit the remaining vertical space. |
int |
heightHint
heightHint specifies a minimum height for the row. |
static int |
HORIZONTAL_ALIGN_BEGINNING
|
static int |
HORIZONTAL_ALIGN_CENTER
|
static int |
HORIZONTAL_ALIGN_END
|
static int |
HORIZONTAL_ALIGN_FILL
|
int |
horizontalAlignment
horizontalAlignment specifies how controls will be positioned horizontally within a cell. |
int |
horizontalIndent
horizontalIndent specifies the number of pixels of indentation that will be placed along the left side of the cell. |
int |
horizontalSpan
horizontalSpan specifies the number of column cells that the control will take up. |
static int |
VERTICAL_ALIGN_BEGINNING
|
static int |
VERTICAL_ALIGN_CENTER
|
static int |
VERTICAL_ALIGN_END
|
static int |
VERTICAL_ALIGN_FILL
|
int |
verticalAlignment
verticalAlignment specifies how controls will be positioned vertically within a cell. |
int |
verticalSpan
verticalSpan specifies the number of row cells that the control will take up. |
int |
widthHint
widthHint specifies a minimum width for the column. |
Constructor Summary | |
GridData()
|
|
GridData(int style)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public int verticalAlignment
public int horizontalAlignment
public int widthHint
public int heightHint
public int horizontalIndent
public int horizontalSpan
public int verticalSpan
public boolean grabExcessHorizontalSpace
public boolean grabExcessVerticalSpace
public static final int BEGINNING
public static final int CENTER
public static final int END
public static final int FILL
public static final int VERTICAL_ALIGN_BEGINNING
public static final int VERTICAL_ALIGN_CENTER
public static final int VERTICAL_ALIGN_END
public static final int VERTICAL_ALIGN_FILL
public static final int HORIZONTAL_ALIGN_BEGINNING
public static final int HORIZONTAL_ALIGN_CENTER
public static final int HORIZONTAL_ALIGN_END
public static final int HORIZONTAL_ALIGN_FILL
public static final int GRAB_HORIZONTAL
public static final int GRAB_VERTICAL
public static final int FILL_VERTICAL
public static final int FILL_HORIZONTAL
public static final int FILL_BOTH
Constructor Detail |
public GridData()
public GridData(int style)
|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |