Top Description Fields Constructors Methods
org.eclipse.swt.layout

public final Class FormData

extends Object
Class Inheritance
Imports
org.eclipse.swt.*, org.eclipse.swt.graphics.*, org.eclipse.swt.widgets.*

Instances of this class are used to define the attachments of a control in a FormLayout.

To set a FormData object into a control, you use the setLayoutData () method. To define attachments for the FormData, set the fields directly, like this:

		FormData data = new FormData();
		data.left = new FormAttachment(0,5);
		data.right = new FormAttachment(100,-5);
		button.setLayoutData(formData);

FormData contains the FormAttachments for each edge of the control that the FormLayout uses to determine the size and position of the control. FormData objects also allow you to set the width and height of controls within a FormLayout.

Since
2.0
See Also
FormLayout, FormAttachment, Sample code and further information

Field Summary

Modifier and TypeField and Description
public FormAttachment
bottom

bottom specifies the attachment of the bottom of the control.

pack-priv FormAttachment
pack-priv int
pack-priv FormAttachment
pack-priv FormAttachment
pack-priv FormAttachment
pack-priv int
pack-priv int
pack-priv int
pack-priv int
pack-priv int
pack-priv int
pack-priv int
pack-priv int
pack-priv int
public int
height

height specifies the preferred height in points.

pack-priv boolean
public FormAttachment
left

left specifies the attachment of the left side of the control.

pack-priv boolean
public FormAttachment
right

right specifies the attachment of the right side of the control.

public FormAttachment
top

top specifies the attachment of the top of the control.

public int
width

width specifies the preferred width in points.

Constructor Summary

AccessConstructor and Description
public
FormData()

Constructs a new instance of FormData using default values.

public
FormData(int
a minimum width for the control
width
,
int
a minimum height for the control
height
)

Constructs a new instance of FormData according to the parameters.

Method Summary

Modifier and TypeMethod and Description
pack-priv void
computeSize(Control control, int wHint, int hHint, boolean flushCache)

pack-priv void
pack-priv FormAttachment
getBottomAttachment(Control control, int spacing, boolean flushCache)

pack-priv int
getHeight(Control control, boolean flushCache)

pack-priv FormAttachment
getLeftAttachment(Control control, int spacing, boolean flushCache)

pack-priv String
pack-priv FormAttachment
getRightAttachment(Control control, int spacing, boolean flushCache)

pack-priv FormAttachment
getTopAttachment(Control control, int spacing, boolean flushCache)

pack-priv int
getWidth(Control control, boolean flushCache)

public String

Returns:

a string representation of the FormData object
toString
()

Overrides java.lang.Object.toString.

Returns a string containing a concise, human-readable description of the receiver.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

bottomback to summary
public FormAttachment bottom

bottom specifies the attachment of the bottom of the control.

cacheBottomback to summary
pack-priv FormAttachment cacheBottom
cacheHeightback to summary
pack-priv int cacheHeight
cacheLeftback to summary
pack-priv FormAttachment cacheLeft
cacheRightback to summary
pack-priv FormAttachment cacheRight
cacheTopback to summary
pack-priv FormAttachment cacheTop
cacheWidthback to summary
pack-priv int cacheWidth
currentHeightback to summary
pack-priv int currentHeight
currentHhintback to summary
pack-priv int currentHhint
currentWhintback to summary
pack-priv int currentWhint
currentWidthback to summary
pack-priv int currentWidth
defaultHeightback to summary
pack-priv int defaultHeight
defaultHhintback to summary
pack-priv int defaultHhint
defaultWhintback to summary
pack-priv int defaultWhint
defaultWidthback to summary
pack-priv int defaultWidth
heightback to summary
public int height

height specifies the preferred height in points. This value is the hHint passed into Control.computeSize(int, int, boolean) to determine the preferred size of the control. The default value is SWT.DEFAULT.

See Also
Control#computeSize(int, int, boolean)
isVisitedback to summary
pack-priv boolean isVisited
leftback to summary
public FormAttachment left

left specifies the attachment of the left side of the control.

neededback to summary
pack-priv boolean needed
topback to summary
public FormAttachment top

top specifies the attachment of the top of the control.

widthback to summary
public int width

width specifies the preferred width in points. This value is the wHint passed into Control.computeSize(int, int, boolean) to determine the preferred size of the control. The default value is SWT.DEFAULT.

See Also
Control#computeSize(int, int, boolean)

Constructor Detail

FormDataback to summary
public FormData()

Constructs a new instance of FormData using default values.

FormDataback to summary
public FormData(int width, int height)

Constructs a new instance of FormData according to the parameters. A value of SWT.DEFAULT indicates that no minimum width or no minimum height is specified.

Parameters
width:int

a minimum width for the control

height:int

a minimum height for the control

Method Detail

computeSizeback to summary
pack-priv void computeSize(Control control, int wHint, int hHint, boolean flushCache)
flushCacheback to summary
pack-priv void flushCache()
getBottomAttachmentback to summary
pack-priv FormAttachment getBottomAttachment(Control control, int spacing, boolean flushCache)
getHeightback to summary
pack-priv int getHeight(Control control, boolean flushCache)
getLeftAttachmentback to summary
pack-priv FormAttachment getLeftAttachment(Control control, int spacing, boolean flushCache)
getNameback to summary
pack-priv String getName()
getRightAttachmentback to summary
pack-priv FormAttachment getRightAttachment(Control control, int spacing, boolean flushCache)
getTopAttachmentback to summary
pack-priv FormAttachment getTopAttachment(Control control, int spacing, boolean flushCache)
getWidthback to summary
pack-priv int getWidth(Control control, boolean flushCache)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a string containing a concise, human-readable description of the receiver.

Returns:String

a string representation of the FormData object

Annotations
@Override