public final class FormData
extends java.lang.Object
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
.
FormLayout
,
FormAttachment
,
Sample code and further informationModifier and Type | Field and Description |
---|---|
FormAttachment |
bottom
bottom specifies the attachment of the bottom of the
control.
|
(package private) FormAttachment |
cacheBottom |
(package private) int |
cacheHeight |
(package private) FormAttachment |
cacheLeft |
(package private) FormAttachment |
cacheRight |
(package private) FormAttachment |
cacheTop |
(package private) int |
cacheWidth |
(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 |
int |
height
height specifies the preferred height in pixels.
|
(package private) boolean |
isVisited |
FormAttachment |
left
left specifies the attachment of the left side of
the control.
|
(package private) boolean |
needed |
FormAttachment |
right
right specifies the attachment of the right side of
the control.
|
FormAttachment |
top
top specifies the attachment of the top of the control.
|
int |
width
width specifies the preferred width in pixels.
|
Constructor and Description |
---|
FormData()
Constructs a new instance of FormData using
default values.
|
FormData(int width,
int height)
Constructs a new instance of FormData 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) FormAttachment |
getBottomAttachment(Control control,
int spacing,
boolean flushCache) |
(package private) int |
getHeight(Control control,
boolean flushCache) |
(package private) FormAttachment |
getLeftAttachment(Control control,
int spacing,
boolean flushCache) |
(package private) java.lang.String |
getName() |
(package private) FormAttachment |
getRightAttachment(Control control,
int spacing,
boolean flushCache) |
(package private) FormAttachment |
getTopAttachment(Control control,
int spacing,
boolean flushCache) |
(package private) int |
getWidth(Control control,
boolean flushCache) |
java.lang.String |
toString()
Returns a string containing a concise, human-readable
description of the receiver.
|
public int width
public int height
public FormAttachment left
public FormAttachment right
public FormAttachment top
public FormAttachment bottom
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
boolean isVisited
boolean needed
public FormData()
public FormData(int width, int height)
width
- a minimum width for the controlheight
- a minimum height for the controlvoid computeSize(Control control, int wHint, int hHint, boolean flushCache)
void flushCache()
int getWidth(Control control, boolean flushCache)
int getHeight(Control control, boolean flushCache)
FormAttachment getBottomAttachment(Control control, int spacing, boolean flushCache)
FormAttachment getLeftAttachment(Control control, int spacing, boolean flushCache)
java.lang.String getName()
FormAttachment getRightAttachment(Control control, int spacing, boolean flushCache)
FormAttachment getTopAttachment(Control control, int spacing, boolean flushCache)
public java.lang.String toString()
toString
in class java.lang.Object