|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ibm.commons.swt.SWTLayoutUtils
public class SWTLayoutUtils
Utilities for laying out SWT controls and composites.
Field Summary | |
---|---|
static int |
COMPUTED_EXTRA_WIDTH
The default amount of width a computed field takes up more than a normal field. |
static int |
CONTROL_BIG_WHINT
The width hint for an extra-large control |
static int |
CONTROL_INDENT_AMT
The amount of pixels (10px) to indent a control from the text field. |
static int |
CONTROL_SMALL_WHINT
The default width hint for an extra-small control |
static int |
CONTROL_WHINT
The default width hint for a control (a large text, or combo box, for instance). |
static int |
EXTRA_INDENT_AMT
The amount of pixels (20px) to indent something when it should be indented below a radio or other label. |
static int |
H_SPACING
The amount of space (10px) between child columns horizontally. |
static int |
PARENT_H_MARGIN
The amount of pixels (14px) to use for the horizontal margin of the entire composite. |
static int |
PARENT_H_SPACING
The amount of space between parent columns. |
static int |
PARENT_V_MARGIN
The amount of pixels (14px) to use for the vertical margin of the entire composite. |
static int |
TEXT_COLS
The default amount of columns for a computed text field. |
static int |
TEXT_WIDTH_HINT
The default width for a value (100, 300) pixels text field. |
static int |
UNITS_COMBO_WIDTH_HINT
The default width for a units (pixels, auto, percent) combo. |
static int |
V_SPACING
The amount of space (7px) between child cells vertically. |
Constructor Summary | |
---|---|
SWTLayoutUtils()
|
Method Summary | |
---|---|
static void |
alignControls(java.util.List<org.eclipse.swt.widgets.Control> controls)
Aligns controls who are to appear in the same column across multiple composites. |
static void |
alignControlsWithIndent(java.util.List<org.eclipse.swt.widgets.Control> controls)
Aligns controls who are to appear in the same column across multiple composites. |
static org.eclipse.swt.layout.FillLayout |
createFillLayoutDefaultMarginDefaultSpacing(boolean verticalLayout)
Creates a FillLayout layout object. |
static org.eclipse.swt.layout.FillLayout |
createFillLayoutNoMargin(boolean verticalLayout)
Creates a FillLayout layout object. |
static org.eclipse.swt.layout.FillLayout |
createFillLayoutNoMarginNoSpacing(boolean verticalLayout)
Creates a FillLayout layout object. |
static org.eclipse.swt.layout.GridData |
createGDControlIndent()
Creates a new GridData object. |
static org.eclipse.swt.layout.GridData |
createGDExtraIndent()
Creates a new GridData object. |
static org.eclipse.swt.layout.GridData |
createGDFill()
Creates a new GridData object. |
static org.eclipse.swt.layout.GridData |
createGDFillHorizontal()
Creates a new GridData object. |
static org.eclipse.swt.layout.GridData |
createGDFillHorizontalNoGrab()
Creates a new GridData object. |
static org.eclipse.swt.layout.GridData |
createGDFillNoGrab()
Creates a new GridData object. |
static org.eclipse.swt.layout.GridData |
createGDFillVertical()
Creates a new GridData object. |
static org.eclipse.swt.layout.GridData |
createGDFillVerticalNoGrab()
Creates a new GridData object. |
static org.eclipse.swt.layout.GridLayout |
createLayoutDefaultSpacing(int numColumns)
Creates a new GridLayout layout object. |
static org.eclipse.swt.layout.GridLayout |
createLayoutNoHeight(int numColumns)
Creates a new GridLayout layout object. |
static org.eclipse.swt.layout.GridLayout |
createLayoutNoMarginDefaultSpacing(int numColumns)
Creates a new GridLayout layout object. |
static org.eclipse.swt.layout.GridLayout |
createLayoutNoMarginNoSpacing(int numColumns)
Creates a new GridLayout layout object. |
static org.eclipse.swt.layout.GridLayout |
createLayoutNoWidth(int numColumns)
Creates a new GridLayout layout object. |
static org.eclipse.swt.layout.GridLayout |
createLayoutTopMarginVerticalSpacing(int numColumns)
Creates a new GridLayout layout object. |
static org.eclipse.swt.widgets.Text |
createTextForWrappingInADialog(org.eclipse.swt.widgets.Composite parent,
int style)
Creates a specialized SWT text widget that is intended to never demand space. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int PARENT_H_SPACING
public static final int TEXT_COLS
public static final int TEXT_WIDTH_HINT
public static final int UNITS_COMBO_WIDTH_HINT
public static final int COMPUTED_EXTRA_WIDTH
public static final int CONTROL_BIG_WHINT
public static final int CONTROL_SMALL_WHINT
public static final int CONTROL_WHINT
public static final int CONTROL_INDENT_AMT
public static final int EXTRA_INDENT_AMT
public static final int V_SPACING
public static final int H_SPACING
public static final int PARENT_V_MARGIN
public static final int PARENT_H_MARGIN
Constructor Detail |
---|
public SWTLayoutUtils()
Method Detail |
---|
public static org.eclipse.swt.layout.GridData createGDFill()
SWT.DEFAULT
)
GridData
public static org.eclipse.swt.layout.GridData createGDFillNoGrab()
SWT.DEFAULT
)
GridData
public static org.eclipse.swt.layout.GridData createGDControlIndent()
horizontalIndent
is set to be the value of SWTLayoutUtils.CONTROL_INDENT_AMT
.
This GridData would typically be used when laying out a label and input control. This GridData would be used
for the input control, it creates a 'natural' spacing between the controls.
GridData
public static org.eclipse.swt.layout.GridData createGDExtraIndent()
horizontalIndent
is set to be the value of SWTLayoutUtils.EXTRA_INDENT_AMT
.
This GridData would typically be used where a control needs to be indented a significant amount for extra emphasis.
GridData
public static org.eclipse.swt.layout.GridData createGDFillHorizontal()
GridData
public static org.eclipse.swt.layout.GridData createGDFillVertical()
GridData
public static org.eclipse.swt.layout.GridData createGDFillHorizontalNoGrab()
GridData
public static org.eclipse.swt.layout.GridData createGDFillVerticalNoGrab()
GridData
public static org.eclipse.swt.layout.GridLayout createLayoutDefaultSpacing(int numColumns)
com.ibm.commons.swt.SWTLayoutUtils.H_SPACING
and
com.ibm.commons.swt.SWTLayoutUtils.V_SPACING
respectively. All other margins and spacings are the
GridLayout detaults. The columns are NOT of equal width.
numColumns
- - int
GridLayout
public static org.eclipse.swt.layout.GridLayout createLayoutNoHeight(int numColumns)
numColumns
- - int
GridLayout
public static org.eclipse.swt.layout.GridLayout createLayoutNoMarginDefaultSpacing(int numColumns)
com.ibm.commons.swt.SWTLayoutUtils.H_SPACING
and
com.ibm.commons.swt.SWTLayoutUtils.V_SPACING
respectively. The marginHeight and marginWidth properties are both
zero. All other margins and spacings are the GridLayout detaults. The columns are NOT of equal width.
numColumns
- - int
GridLayout
public static org.eclipse.swt.layout.GridLayout createLayoutNoMarginNoSpacing(int numColumns)
numColumns
- - int
GridLayout
public static org.eclipse.swt.layout.GridLayout createLayoutTopMarginVerticalSpacing(int numColumns)
numColumns
- - int
GridLayout
public static org.eclipse.swt.layout.GridLayout createLayoutNoWidth(int numColumns)
numColumns
- - int
GridLayout
public static org.eclipse.swt.widgets.Text createTextForWrappingInADialog(org.eclipse.swt.widgets.Composite parent, int style)
public static org.eclipse.swt.layout.FillLayout createFillLayoutNoMarginNoSpacing(boolean verticalLayout)
verticalLayout
- - boolean
true if the controls are to be laid out vertically
FillLayout
public static org.eclipse.swt.layout.FillLayout createFillLayoutNoMargin(boolean verticalLayout)
verticalLayout
- - boolean
true if the controls are to be laid out vertically
FillLayout
public static org.eclipse.swt.layout.FillLayout createFillLayoutDefaultMarginDefaultSpacing(boolean verticalLayout)
FillLayout
.
Depending on whether the layout lays controls out vertically or horizontally, the spacing between
controls will be com.ibm.commons.swt.SWTLayoutUtils.V_SPACING or com.ibm.commons.swt.SWTLayoutUtils.H_SPACING.
verticalLayout
- - boolean
true if the controls are to be laid out vertically
FillLayout
public static void alignControls(java.util.List<org.eclipse.swt.widgets.Control> controls)
controls
- - java.util.Listpublic static void alignControlsWithIndent(java.util.List<org.eclipse.swt.widgets.Control> controls)
controls
- - java.util.List
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |