Home » Eclipse-SWT-3.5.1 » org.eclipse.swt.layout » [javadoc | source]
org.eclipse.swt.layout
public final class: GridData [javadoc | source]
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.

Field Summary
public  int verticalAlignment    verticalAlignment specifies how controls will be positioned vertically within a cell. The default value is CENTER. Possible values are: BEGINNING: Position the control at the top of the cell CENTER: Position the control in the vertical center of the cell END: Position the control at the bottom of the cell FILL: Resize the control to fill the cell vertically 
public  int horizontalAlignment    horizontalAlignment specifies how controls will be positioned horizontally within a cell. The default value is BEGINNING. Possible values are: BEGINNING: Position the control at the left of the cell CENTER: Position the control in the horizontal center of the cell END: Position the control at the right of the cell FILL: Resize the control to fill the cell horizontally 
public  int widthHint    widthHint specifies a minimum width for the column. A value of SWT.DEFAULT indicates that no minimum width is specified. The default value is SWT.DEFAULT. 
public  int heightHint    heightHint specifies a minimum height for the row. A value of SWT.DEFAULT indicates that no minimum height is specified. The default value is SWT.DEFAULT. 
public  int horizontalIndent    horizontalIndent specifies the number of pixels of indentation that will be placed along the left side of the cell. The default value is 0. 
public  int horizontalSpan    horizontalSpan specifies the number of column cells that the control will take up. The default value is 1. 
public  int verticalSpan    verticalSpan specifies the number of row cells that the control will take up. The default value is 1. 
public  boolean grabExcessHorizontalSpace    grabExcessHorizontalSpace specifies whether the cell will be made wide enough to fit the remaining horizontal space. The default value is false. 
public  boolean grabExcessVerticalSpace    grabExcessVerticalSpace specifies whether the cell will be made tall enough to fit the remaining vertical space. 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     
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    FILL_VERTICAL = VERTICAL_ALIGN_FILL | GRAB_VERTICAL 
public static final  int FILL_HORIZONTAL    FILL_HORIZONTAL = HORIZONTAL_ALIGN_FILL | GRAB_HORIZONTAL 
public static final  int FILL_BOTH    FILL_BOTH = FILL_VERTICAL | FILL_HORIZONTAL 
 int childIndex     
 boolean isItemData     
 int hSpan     
Constructor:
 public GridData() 
 public GridData(int style) 
 public GridData(int width,
    int height) 
 public GridData(int horizontalAlignment,
    int verticalAlignment,
    boolean grabExcessHorizontalSpace,
    boolean grabExcessVerticalSpace) 
 public GridData(int horizontalAlignment,
    int verticalAlignment,
    boolean grabExcessHorizontalSpace,
    boolean grabExcessVerticalSpace,
    int horizontalSpan,
    int verticalSpan) 
Method from org.eclipse.swt.layout.GridData Summary:
isItemData,   isSpacerData
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.eclipse.swt.layout.GridData Detail:
 boolean isItemData() 
 boolean isSpacerData()