public final class GridData
extends java.lang.Object
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:
 
                GridData gridData = new GridData();
                gridData.horizontalAlignment = GridData.FILL;
                gridData.grabExcessHorizontalSpace = true;
                button1.setLayoutData(gridData);
 
                gridData = new GridData();
                gridData.horizontalAlignment = GridData.FILL;
                gridData.verticalAlignment = GridData.FILL;
                gridData.grabExcessHorizontalSpace = true;
                gridData.grabExcessVerticalSpace = true;
                gridData.horizontalSpan = 2;
                button2.setLayoutData(gridData);
 
 The second is to take advantage of GridData convenience constructors, for example: 
 
      button1.setLayoutData(new GridData (SWT.FILL, SWT.CENTER, true, false));
      button2.setLayoutData(new GridData (SWT.FILL, SWT.FILL, true, true, 2, 1));
 
 
 
 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.
 
| Modifier and Type | Field and Description | 
|---|---|
| static int | BEGINNINGValue for horizontalAlignment or verticalAlignment. | 
| (package private) int | cacheHeight | 
| (package private) int | cacheWidth | 
| static int | CENTERValue for horizontalAlignment or verticalAlignment. | 
| (package private) int | currentHeight | 
| (package private) int | currentHhint | 
| (package private) int | currentWhint | 
| (package private) int | currentWidth | 
| (package private) int | defaultHeight | 
| (package private) int | defaultHhint | 
| (package private) int | defaultWhint | 
| (package private) int | defaultWidth | 
| static int | ENDValue for horizontalAlignment or verticalAlignment. | 
| boolean | excludeexclude informs the layout to ignore this control when sizing
 and positioning controls. | 
| static int | FILLValue for horizontalAlignment or verticalAlignment. | 
| static int | FILL_BOTHStyle bit for  new GridData(int)to resize the 
 control to fill the cell horizontally and vertically and 
 to fit the remaining horizontal and vertical space. | 
| static int | FILL_HORIZONTALStyle bit for  new GridData(int)to resize the 
 control to fill the cell horizontally and to fit the remaining
 horizontal space. | 
| static int | FILL_VERTICALStyle bit for  new GridData(int)to resize the 
 control to fill the cell vertically and to fit the remaining
 vertical space. | 
| static int | GRAB_HORIZONTALStyle bit for  new GridData(int)to resize the 
 control to fit the remaining horizontal space. | 
| static int | GRAB_VERTICALStyle bit for  new GridData(int)to resize the 
 control to fit the remaining vertical space. | 
| boolean | grabExcessHorizontalSpacegrabExcessHorizontalSpace specifies whether the width of the cell 
 changes depending on the size of the parent Composite. | 
| boolean | grabExcessVerticalSpacegrabExcessVerticalSpace specifies whether the height of the cell 
 changes depending on the size of the parent Composite. | 
| int | heightHintheightHint specifies the preferred height in pixels. | 
| static int | HORIZONTAL_ALIGN_BEGINNINGStyle bit for  new GridData(int)to position the 
 control at the left of the cell. | 
| static int | HORIZONTAL_ALIGN_CENTERStyle bit for  new GridData(int)to position the 
 control in the horizontal center of the cell. | 
| static int | HORIZONTAL_ALIGN_ENDStyle bit for  new GridData(int)to position the 
 control at the right of the cell. | 
| static int | HORIZONTAL_ALIGN_FILLStyle bit for  new GridData(int)to resize the 
 control to fill the cell horizontally. | 
| int | horizontalAlignmenthorizontalAlignment specifies how controls will be positioned 
 horizontally within a cell. | 
| int | horizontalIndenthorizontalIndent specifies the number of pixels of indentation
 that will be placed along the left side of the cell. | 
| int | horizontalSpanhorizontalSpan specifies the number of column cells that the control
 will take up. | 
| int | minimumHeightminimumHeight specifies the minimum height in pixels. | 
| int | minimumWidthminimumWidth specifies the minimum width in pixels. | 
| static int | VERTICAL_ALIGN_BEGINNINGStyle bit for  new GridData(int). | 
| static int | VERTICAL_ALIGN_CENTERStyle bit for  new GridData(int)to position the 
 control in the vertical center of the cell. | 
| static int | VERTICAL_ALIGN_ENDStyle bit for  new GridData(int)to position the 
 control at the bottom of the cell. | 
| static int | VERTICAL_ALIGN_FILLStyle bit for  new GridData(int)to resize the 
 control to fill the cell vertically. | 
| int | verticalAlignmentverticalAlignment specifies how controls will be positioned 
 vertically within a cell. | 
| int | verticalIndentverticalIndent specifies the number of pixels of indentation
 that will be placed along the top side of the cell. | 
| int | verticalSpanverticalSpan specifies the number of row cells that the control
 will take up. | 
| int | widthHintwidthHint specifies the preferred width in pixels. | 
| Constructor and Description | 
|---|
| GridData()Constructs a new instance of GridData using
 default values. | 
| GridData(int style)Constructs a new instance based on the GridData style. | 
| GridData(int width,
        int height)Constructs a new instance of GridData according to the parameters. | 
| GridData(int horizontalAlignment,
        int verticalAlignment,
        boolean grabExcessHorizontalSpace,
        boolean grabExcessVerticalSpace)Constructs a new instance of GridData according to the parameters. | 
| GridData(int horizontalAlignment,
        int verticalAlignment,
        boolean grabExcessHorizontalSpace,
        boolean grabExcessVerticalSpace,
        int horizontalSpan,
        int verticalSpan)Constructs a new instance of GridData according to the parameters. | 
| Modifier and Type | Method and Description | 
|---|---|
| (package private) void | computeSize(Control control,
           int wHint,
           int hHint,
           boolean flushCache) | 
| (package private) void | flushCache() | 
| (package private) java.lang.String | getName() | 
| java.lang.String | toString()Returns a string containing a concise, human-readable
 description of the receiver. | 
public int verticalAlignment
public int horizontalAlignment
public int widthHint
public int heightHint
public int horizontalIndent
public int verticalIndent
public int horizontalSpan
public int verticalSpan
public boolean grabExcessHorizontalSpace
grabExcessHorizontalSpace specifies whether the width of the cell 
 changes depending on the size of the parent Composite.  If 
 grabExcessHorizontalSpace is true, the following rules
 apply to the width of the cell:
The default value is false.
minimumWidth, 
widthHintpublic boolean grabExcessVerticalSpace
grabExcessVerticalSpace specifies whether the height of the cell 
 changes depending on the size of the parent Composite.  If 
 grabExcessVerticalSpace is true, the following rules
 apply to the height of the cell:
The default value is false.
minimumHeight, 
heightHintpublic int minimumWidth
Control.computeSize(int, int, boolean), 
widthHintpublic int minimumHeight
Control.computeSize(int, int, boolean), 
heightHintpublic boolean exclude
true,
 the size and position of the control will not be managed by the
 layout.  If this       value is false, the size and 
 position of the control will be computed and assigned.
 
 The default value is false.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
new GridData(int).
 Position the control at the top of the cell.
 Not recommended. Use 
 new GridData(int, SWT.BEGINNING, boolean, boolean)
 instead.public static final int VERTICAL_ALIGN_CENTER
new GridData(int) to position the 
 control in the vertical center of the cell.
 Not recommended. Use
 new GridData(int, SWT.CENTER, boolean, boolean)
 instead.public static final int VERTICAL_ALIGN_END
new GridData(int) to position the 
 control at the bottom of the cell.
 Not recommended. Use
 new GridData(int, SWT.END, boolean, boolean)
 instead.public static final int VERTICAL_ALIGN_FILL
new GridData(int) to resize the 
 control to fill the cell vertically.
 Not recommended. Use
 new GridData(int, SWT.FILL, boolean, boolean)
 insteadpublic static final int HORIZONTAL_ALIGN_BEGINNING
new GridData(int) to position the 
 control at the left of the cell.
 Not recommended. Use
 new GridData(SWT.BEGINNING, int, boolean, boolean)
 instead.public static final int HORIZONTAL_ALIGN_CENTER
new GridData(int) to position the 
 control in the horizontal center of the cell.
 Not recommended. Use
 new GridData(SWT.CENTER, int, boolean, boolean)
 instead.public static final int HORIZONTAL_ALIGN_END
new GridData(int) to position the 
 control at the right of the cell.
 Not recommended. Use
 new GridData(SWT.END, int, boolean, boolean)
 instead.public static final int HORIZONTAL_ALIGN_FILL
new GridData(int) to resize the 
 control to fill the cell horizontally.
 Not recommended. Use
 new GridData(SWT.FILL, int, boolean, boolean)
 instead.public static final int GRAB_HORIZONTAL
new GridData(int) to resize the 
 control to fit the remaining horizontal space.
 Not recommended. Use
 new GridData(int, int, true, boolean)
 instead.public static final int GRAB_VERTICAL
new GridData(int) to resize the 
 control to fit the remaining vertical space.
 Not recommended. Use
 new GridData(int, int, boolean, true)
 instead.public static final int FILL_VERTICAL
new GridData(int) to resize the 
 control to fill the cell vertically and to fit the remaining
 vertical space.
 FILL_VERTICAL = VERTICAL_ALIGN_FILL | GRAB_VERTICAL
 Not recommended. Use
 new GridData(int, SWT.FILL, boolean, true)
 instead.public static final int FILL_HORIZONTAL
new GridData(int) to resize the 
 control to fill the cell horizontally and to fit the remaining
 horizontal space.
 FILL_HORIZONTAL = HORIZONTAL_ALIGN_FILL | GRAB_HORIZONTAL
 Not recommended. Use
 new GridData(SWT.FILL, int, true, boolean)
 instead.public static final int FILL_BOTH
new GridData(int) to resize the 
 control to fill the cell horizontally and vertically and 
 to fit the remaining horizontal and vertical space.
 FILL_BOTH = FILL_VERTICAL | FILL_HORIZONTAL
 Not recommended. Use
 new GridData(SWT.FILL, SWT.FILL, true, true)
 instead.int cacheWidth
int cacheHeight
int defaultWhint
int defaultHhint
int defaultWidth
int defaultHeight
int currentWhint
int currentHhint
int currentWidth
int currentHeight
public GridData()
public GridData(int style)
style - the GridData stylepublic GridData(int horizontalAlignment,
        int verticalAlignment,
        boolean grabExcessHorizontalSpace,
        boolean grabExcessVerticalSpace)
horizontalAlignment - how control will be positioned horizontally within a cell,
                one of: SWT.BEGINNING (or SWT.LEFT), SWT.CENTER, SWT.END (or SWT.RIGHT), or SWT.FILLverticalAlignment - how control will be positioned vertically within a cell,
                one of: SWT.BEGINNING (or SWT.TOP), SWT.CENTER, SWT.END (or SWT.BOTTOM), or SWT.FILLgrabExcessHorizontalSpace - whether cell will be made wide enough to fit the remaining horizontal spacegrabExcessVerticalSpace - whether cell will be made high enough to fit the remaining vertical spacepublic GridData(int horizontalAlignment,
        int verticalAlignment,
        boolean grabExcessHorizontalSpace,
        boolean grabExcessVerticalSpace,
        int horizontalSpan,
        int verticalSpan)
horizontalAlignment - how control will be positioned horizontally within a cell,
                one of: SWT.BEGINNING (or SWT.LEFT), SWT.CENTER, SWT.END (or SWT.RIGHT), or SWT.FILLverticalAlignment - how control will be positioned vertically within a cell,
                one of: SWT.BEGINNING (or SWT.TOP), SWT.CENTER, SWT.END (or SWT.BOTTOM), or SWT.FILLgrabExcessHorizontalSpace - whether cell will be made wide enough to fit the remaining horizontal spacegrabExcessVerticalSpace - whether cell will be made high enough to fit the remaining vertical spacehorizontalSpan - the number of column cells that the control will take upverticalSpan - the number of row cells that the control will take uppublic GridData(int width,
        int height)
width - a minimum width for the columnheight - a minimum height for the rowvoid computeSize(Control control, int wHint, int hHint, boolean flushCache)
void flushCache()
java.lang.String getName()
public java.lang.String toString()
toString in class java.lang.Object