public class SWTFactory extends Object
Constructor and Description |
---|
SWTFactory() |
Modifier and Type | Method and Description |
---|---|
static Button |
createCheckButton(Composite parent,
String label,
Image image,
boolean checked,
int hspan)
Creates a check box button using the parents' font
|
static Composite |
createComposite(Composite parent,
Font font,
int columns,
int hspan,
int fill,
int marginwidth,
int marginheight)
Creates a Composite widget
|
static Group |
createGroup(Composite parent,
String text,
int columns,
int hspan,
int fill)
Creates a Group widget
|
static Label |
createLabel(Composite parent,
String text,
int hspan)
Creates a new label widget
|
static Button |
createRadioButton(Composite parent,
String label,
int hspan)
Creates and returns a new radio button with the given label.
|
static Text |
createText(Composite parent,
int style,
int hspan,
String text)
Creates a new text widget
|
static int |
getButtonWidthHint(Button button)
Returns a width hint for a button control.
|
static void |
setButtonDimensionHint(Button button)
Sets width and height hint for the button control.
|
public static Text createText(Composite parent, int style, int hspan, String text)
parent
- the parent composite to add this text widget tostyle
- the style bits for the text widgethspan
- the horizontal span to take up on the parent compositetext
- the initial text, not null
public static Composite createComposite(Composite parent, Font font, int columns, int hspan, int fill, int marginwidth, int marginheight)
parent
- the parent composite to add this composite tocolumns
- the number of columns within the compositehspan
- the horizontal span the composite should take up on the parentfill
- the style for how this composite should fill into its parent
Can be one of GridData.FILL_HORIZONAL
,
GridData.FILL_BOTH
or
GridData.FILL_VERTICAL
marginwidth
- the width of the margin to place around the composite (default
is 5, specified by GridLayout)marginheight
- the height of the margin to place around the composite
(default is 5, specified by GridLayout)public static Button createCheckButton(Composite parent, String label, Image image, boolean checked, int hspan)
parent
- the parent to add the button tolabel
- the label for the buttonimage
- the image for the buttonchecked
- the initial checked state of the buttonhspan
- the horizontal span to take up in the parent compositepublic static Label createLabel(Composite parent, String text, int hspan)
parent
- the parent composite to add this label widget totext
- the text for the labelhspan
- the horizontal span to take up in the parent compositepublic static Button createRadioButton(Composite parent, String label, int hspan)
parent
- parent controllabel
- button label or null
hspan
- the number of columns to span in the parent compositepublic static Group createGroup(Composite parent, String text, int columns, int hspan, int fill)
parent
- the parent composite to add this group totext
- the text for the heading of the groupcolumns
- the number of columns within the grouphspan
- the horizontal span the group should take up on the parentfill
- the style for how this composite should fill into its parent
Can be one of GridData.FILL_HORIZONAL
,
GridData.FILL_BOTH
or
GridData.FILL_VERTICAL
public static void setButtonDimensionHint(Button button)
GridData
.button
- button for which to set the dimension hintpublic static int getButtonWidthHint(Button button)
Copyright © 2005, 2018 IBM Corporation and others. All Rights Reserved.