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 Combo |
createCombo(Composite parent,
int style,
int hspan,
int fill,
String[] items)
This method is used to make a combo box
|
static Combo |
createCombo(Composite parent,
int style,
int hspan,
String[] items)
This method is used to make a combo box with a default fill style of GridData.FILL_HORIZONTAL
|
static Composite |
createComposite(Composite parent,
Font font,
int columns,
int hspan,
int fill)
Creates a Composite widget
|
static Composite |
createComposite(Composite parent,
Font font,
int columns,
int hspan,
int fill,
int marginwidth,
int marginheight)
Creates a Composite widget
|
static Composite |
createComposite(Composite parent,
int columns,
int hspan,
int fill)
Creates a composite that uses the parents' font and has a grid layout
|
static Group |
createGroup(Composite parent,
String text,
int columns,
int hspan,
int fill)
Creates a Group widget
|
static void |
createHorizontalSpacer(Composite comp,
int numlines)
creates a horizontal spacer for separating components
|
static Label |
createLabel(Composite parent,
String text,
Font font,
int hspan)
Creates a new label widget
|
static Label |
createLabel(Composite parent,
String text,
int hspan)
Creates a new label widget
|
static Button |
createPushButton(Composite parent,
String label,
Image image)
Creates and returns a new push button with the given
label and/or image.
|
static Button |
createRadioButton(Composite parent,
String label)
Creates and returns a new radio button with the given
label.
|
static Text |
createSingleText(Composite parent,
int hspan)
Creates a new text widget
|
static Text |
createText(Composite parent,
int style,
int hspan)
Creates a new text widget
|
static Text |
createText(Composite parent,
int style,
int hspan,
int fill)
Creates a new text widget
|
static Text |
createText(Composite parent,
int style,
int hspan,
int width,
int height,
int fill)
Creates a new text widget
|
static void |
createVerticalSpacer(Composite parent,
int numlines)
Creates a vertical spacer for separating components.
|
static CLabel |
createWrapCLabel(Composite parent,
String text,
Image image,
int hspan,
int wrapwidth)
Creates a new
CLabel that will wrap at the specified width and has the specified image |
static Label |
createWrapLabel(Composite parent,
String text,
int hspan)
Creates a wrapping label
|
static Label |
createWrapLabel(Composite parent,
String text,
int hspan,
int wrapwidth)
Creates a wrapping label
|
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 int getButtonWidthHint(Button button)
public static void setButtonDimensionHint(Button button)
GridData
.the
- button for which to set the dimension hintpublic 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 Button createPushButton(Composite parent, String label, Image image)
parent
- parent controllabel
- button label or null
image
- image of null
public static Button createRadioButton(Composite parent, String label)
parent
- parent controllabel
- button label or null
public 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 Label createLabel(Composite parent, String text, Font font, int hspan)
parent
- the parent composite to add this label widget totext
- the text for the labelfont
- the font for the labelhspan
- the horizontal span to take up in the parent compositepublic static Label createWrapLabel(Composite parent, String text, int hspan, int wrapwidth)
parent
- the parent composite to add this label totext
- the text to be displayed in the labelhspan
- the horizontal span that label should take up in the parent compositewrapwidth
- the width hint that the label should wrap atpublic static CLabel createWrapCLabel(Composite parent, String text, Image image, int hspan, int wrapwidth)
CLabel
that will wrap at the specified width and has the specified imageparent
- the parent to add this label totext
- the text for the labelimage
- the image for the labelhspan
- the h span to take up in the parentwrapwidth
- the with to wrap atCLabel
public static Label createWrapLabel(Composite parent, String text, int hspan)
parent
- the parent composite to add this label totext
- the text to be displayed in the labelhspan
- the horizontal span that label should take up in the parent compositepublic static Text createSingleText(Composite parent, int hspan)
parent
- the parent composite to add this text widget tohspan
- the horizontal span to take up on the parent compositepublic static Text createText(Composite parent, int style, int hspan, int fill)
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 compositefill
- the fill for the grid layoutpublic static Text createText(Composite parent, int style, int hspan)
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 compositepublic static Text createText(Composite parent, int style, int hspan, int width, int height, int fill)
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 compositewidth
- the desired width of the text widgetheight
- the desired height of the text widgetfill
- the fill style for the widgetpublic 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 parentpublic static Composite createComposite(Composite parent, Font font, int columns, int hspan, int fill)
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 parentpublic static Composite createComposite(Composite parent, int columns, int hspan, int fill)
parent
- the parent to add the composite tocolumns
- the number of columns the composite should havehspan
- the horizontal span the new composite should take up in the parentfill
- the fill style of the composite GridData
public static void createVerticalSpacer(Composite parent, int numlines)
GridLayout
, this method will automatically span all of the columns of the parent
to make vertical spaceparent
- the parent composite to add this spacer tonumlines
- the number of vertical lines to make as spacepublic static void createHorizontalSpacer(Composite comp, int numlines)
comp
- numlines
- 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 parentmarginwidth
- the width of the margin to place around the composite (default is 5, specified by GridLayout)public static Combo createCombo(Composite parent, int style, int hspan, int fill, String[] items)
parent
- the parent composite to add the new combo tostyle
- the style for the Combohspan
- the horizontal span to take up on the parent compositefill
- how the combo will fill into the composite
Can be one of GridData.FILL_HORIZONAL
, GridData.FILL_BOTH
or GridData.FILL_VERTICAL
items
- the item to put into the combopublic static Combo createCombo(Composite parent, int style, int hspan, String[] items)
parent
- the parent composite to add the new combo tostyle
- the style for the Combohspan
- the horizontal span to take up on the parent compositeitems
- the item to put into the combo