org.eclipse.swt.layout

Home
Java Source Code / Java Documentation 2
1.2D
2.3D
3.Ajax
4.Algebra
5.App Engine
6.Aspect
7.Assemble
8.Cache
9.Cassandra
10.Chat
11.Cloud
12.CMS
13.CouchDB
14.Crypt
15.Database
16.Distributed
17.Eclipse
18.Facebook
19.File
20.Forum
21.GAE
22.Game
23.Google tech
24.Graph
25.Graphic
26.GWT
27.Hibernate
28.HTML
29.HTTP
30.Image
31.IntelliJ
32.IRC
33.J2EE
34.J2ME
35.JDBC
36.JPA
37.JSON
38.JSR
39.JUnit
40.JVM
41.Language
42.Linux
43.Math
44.Maven
45.Media
46.Messenger
47.MiddleWare
48.Mobile
49.Mock
50.MongoDB
51.Mp3
52.Music
53.MVC
54.Network
55.OpenID
56.OSGi
57.Parse
58.Persist
59.Petri
60.Phone
61.Physics
62.REST
63.Robot
64.RPC
65.RSS
66.Ruby
67.Script
68.Search
69.Spring
70.SQL
71.SSH
72.Sudoku
73.Swing
74.Tapestry
75.Test
76.Text
77.Torrent
78.Twitter
79.UML
80.UnTagged
81.Utilities
82.Web
83.Wiki
84.XML
Java Source Code / Java Documentation 2 » Script » java2script » org.eclipse.swt.layout 
org.eclipse.swt.layout
Java Source File NameTypeComment
FillLayout.javaClass FillLayout is the simplest layout class.
FormAttachment.javaClass Instances of this class are used to define the edges of a control within a FormLayout.
FormData.javaClass Instances of this class are used to define the attachments of a control in a FormLayout.
FormLayout.javaClass Instances of this class control the position and size of the children of a composite control by using FormAttachments to optionally configure the left, top, right and bottom edges of each child.

The following example code creates a FormLayout and then sets it into a Shell:

 Display display = new Display ();
 Shell shell = new Shell(display);
 FormLayout layout = new FormLayout();
 layout.marginWidth = 3;
 layout.marginHeight = 3;
 shell.setLayout(layout);
 

To use a FormLayout, create a FormData with FormAttachment for each child of Composite. The following example code attaches button1 to the top and left edge of the composite and button2 to the right edge of button1 and the top and right edges of the composite:

 FormData data1 = new FormData();
 data1.left = new FormAttachment(0, 0);
 data1.top = new FormAttachment(0, 0);
 button1.setLayoutData(data1);
 FormData data2 = new FormData();
 data2.left = new FormAttachment(button1);
 data2.top = new FormAttachment(0, 0);
 data2.right = new FormAttachment(100, 0);
 button2.setLayoutData(data2);
 

Each side of a child control can be attached to a position in the parent composite, or to other controls within the Composite by creating instances of FormAttachment and setting them into the top, bottom, left, and right fields of the child's FormData.

If a side is not given an attachment, it is defined as not being attached to anything, causing the child to remain at its preferred size.

GridData.javaClass GridData is the layout data object associated with GridLayout.
GridLayout.javaClass Instances of this class lay out the control children of a Composite in a grid.
RowData.javaClass Each control controlled by a RowLayout can have its initial width and height specified by setting a RowData object into the control.
RowLayout.javaClass Instances of this class determine the size and position of the children of a Composite by placing them either in horizontal rows or vertical columns within the parent Composite.
ww_w___.java___2_s.__co__m___ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.