Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.eclipse.swt.layout: Javadoc index of package org.eclipse.swt.layout.


Package Samples:

org.eclipse.swt.layout

Classes:

FormLayout: 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 edge 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 ...
FormAttachment: Instances of this class are used to define the edges of a control within a FormLayout . FormAttachments are set into the top, bottom, left, and right fields of the FormData for a control. For example: FormData data = new FormData(); data.top = new FormAttachment(0,5); data.bottom = new FormAttachment(100,-5); data.left = new FormAttachment(0,5); data.right = new FormAttachment(100,-5); button.setLayoutData(data); A FormAttachment defines where to attach the side of a control by using the equation, y = ax + b. The "a" term represents a fraction of the parent composite's width (from the left) or ...
RowLayout: 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 . RowLayout aligns all controls in one row if the type is set to horizontal, and one column if it is set to vertical. It has the ability to wrap, and provides configurable margins and spacing. RowLayout has a number of configuration fields. In addition, the height and width of each control in a RowLayout can be specified by setting a RowData object into the control using setLayoutData () . The following example code creates ...
FillLayout: FillLayout is the simplest layout class. It lays out controls in a single row or column, forcing them to be the same size. Initially, the controls will all be as tall as the tallest control, and as wide as the widest. FillLayout does not wrap, but you can specify margins and spacing. You might use it to lay out buttons in a task bar or tool bar, or to stack checkboxes in a Group . FillLayout can also be used when a Composite only has one child. For example, if a Shell has a single Group child, FillLayout will cause the Group to completely fill the Shell (if margins are 0). Example code: first a ...
GridData: GridData is the layout data object associated with GridLayout . To set a GridData object into a control, you use the setLayoutData () method. There are two ways to create a GridData object with certain fields set. The first is to set the fields directly, like this: GridData gridData = new GridData(); gridData.horizontalAlignment = GridData.FILL; gridData.grabExcessHorizontalSpace = true; button1.setLayoutData(gridData); The second is to take advantage of convenience style bits defined by GridData : button1.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL)); NOTE: ...
GridLayout: Instances of this class lay out the control children of a Composite in a grid. GridLayout has a number of configuration fields, and the controls it lays out can have an associated layout data object, called GridData . The power of GridLayout lies in the ability to configure GridData for each control in the layout. The following code creates a shell managed by a GridLayout with 3 columns: Display display = new Display(); Shell shell = new Shell(display); GridLayout gridLayout = new GridLayout(); gridLayout.numColumns = 3; shell.setLayout(gridLayout); The numColumns field is the most important field ...
FormData: 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 ...
RowData: Each control controlled by a RowLayout can have its initial width and height specified by setting a RowData object into the control. The following code uses a RowData object to change the initial size of a Button in a Shell : Display display = new Display(); Shell shell = new Shell(display); shell.setLayout(new RowLayout()); Button button1 = new Button(shell, SWT.PUSH); button1.setText("Button 1"); button1.setLayoutData(new RowData(50, 40));

Home | Contact Us | Privacy Policy | Terms of Service