FormData

Instances of this class are used to define the attachments of a control in a <code>FormLayout</code>. <p> To set a <code>FormData</code> object into a control, you use the <code>setLayoutData ()</code> method. To define attachments for the <code>FormData</code>, set the fields directly, like this: <pre> FormData data = new FormData(); data.left = new FormAttachment(0,5); data.right = new FormAttachment(100,-5); button.setLayoutData(formData); </pre> </p> <p> <code>FormData</code> contains the <code>FormAttachments</code> for each edge of the control that the <code>FormLayout</code> uses to determine the size and position of the control. <code>FormData</code> objects also allow you to set the width and height of controls within a <code>FormLayout</code>. </p>

@see FormLayout @see FormAttachment @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>

@since 2.0

final
class FormData {
int cacheWidth;
int cacheHeight;
int defaultWhint;
int defaultHhint;
int defaultWidth;
int defaultHeight;
int currentWhint;
int currentHhint;
int currentWidth;
int currentHeight;
FormAttachment cacheLeft;
FormAttachment cacheRight;
FormAttachment cacheTop;
FormAttachment cacheBottom;
bool isVisited;
bool needed;
}

Constructors

this
this()

Constructs a new instance of FormData using default values.

this
this(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.

Members

Functions

toString
String toString()

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

Variables

bottom
FormAttachment bottom;

bottom specifies the attachment of the bottom of the control.

height
int height;

height specifies the preferred height in pixels. This value is the hHint passed into Control.computeSize(int, int, bool) to determine the preferred size of the control.

left
FormAttachment left;

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

right
FormAttachment right;

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

top
FormAttachment top;

top specifies the attachment of the top of the control.

width
int width;

width specifies the preferred width in pixels. This value is the wHint passed into Control.computeSize(int, int, bool) to determine the preferred size of the control.

Meta