GridData is the layout data object associated with
GridLayout. To set a GridData object into a
control, you use the Control.setLayoutData(Object) method.
There are two ways to create a GridData object with certain
fields set. The first is to set the fields directly, like this:
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.
GridDatais the layout data object associated withGridLayout. To set aGridDataobject into a control, you use theControl.setLayoutData(Object)method.There are two ways to create a
The second is to take advantage of convenience style bits defined byGridDataobject with certain fields set. The first is to set the fields directly, like this:GridData:button1.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL));NOTE: Do not reuse
GridDataobjects. Every control in aCompositethat is managed by aGridLayoutmust have a uniqueGridDataobject. If the layout data for a control in aGridLayoutis null at layout time, a uniqueGridDataobject is created for it.