How do I read values from the formAttachment in Java?
here is my code:
Text one = new Text(composite, SWT.BORDER);
data = new FormData();
data.top = new FormAttachment(0, 0);
data.bottom = new FormAttachment(100, 0);
data.left = new FormAttachment(0, 0);
data.right = new FormAttachment(sash, 0);
one.setLayoutData(data);
result:

FormAttachments are used to position aControl. You can fix the edges of a control by using theFormAttachmentfor left, top, right or bottom. All remaining edges are calculated automatically.The simplest possibility is the percentage positioning relative to the edges of the surrounding composite. Here is an example:
Alternativelyyou can use the contructor
new FormAttachment(control, offset, alignment)to fix an edge of a control relativ to an edge of another control:There is a really good Eclipse RCP manual by Ralf Ebert here. Unfortunately it is in German. However, you can find images explaining my examples above on the pages 56-57.