org.eclipse.emf.facet.util.ui.utils

## Class UIUtils

- java.lang.Object
- - org.eclipse.emf.facet.util.ui.utils.UIUtils

    public final class UIUtils
    extends java.lang.Object

This util class provides methods for the creation of basics ui components like buttons or text field.

Since:
  0.3

### Method Summary

All Methods Static Methods Concrete Methods
`static Button` `createButton(Composite parent, java.lang.String text, boolean enabled, SelectionListener selectionListener)` Create and return a new button.
`static Button` `createCheckbox(Composite composite, boolean enabled, boolean selected, SelectionListener selectionListener)` Create and return a new checkbox.
`static Combo` `createCombobox(Composite parent, boolean enabled, java.util.List<java.lang.String> elements, java.lang.String label, SelectionListener listener)` Create a combobox with a label.
`static Label` `createLabel(Composite parent, java.lang.String labelName)` Create the label (with the given labelName) in the given composite.
`static Spinner` `createSpinner(Composite parent, int maxValue, int minValue, int increment, boolean changeable, ModifyListener modifyListener)` Create and return a new spinner.
`static Text` `createTextArea(Composite parent, java.lang.String text, boolean enabled, ModifyListener modifyListener)` Create and return a new text field.
`static Text` `createTextField(Composite parent, java.lang.String text, boolean enabled, ModifyListener modifyListener)` Create and return a new text field.
`static GridData` `getLabelGridData()`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### createLabel

    public static Label createLabel(Composite parent,
                                    java.lang.String labelName)

Create the label (with the given labelName) in the given composite. The layoutData of the label is `getLabelGridData()`.

Parameters:
  `parent` - the composite parent.
  `labelName` - the label name.

#### createButton

    public static Button createButton(Composite parent,
                                      java.lang.String text,
                                      boolean enabled,
                                      SelectionListener selectionListener)

Create and return a new button.

Parameters:
  `parent` - the button parent.
  `text` - the text to display on the button.
  `enabled` - set if the button can be pressed or not.
  `selectionListener` - the listener when the button is pressed (can be null).
Returns:
  the new button.

#### createTextField

    public static Text createTextField(Composite parent,
                                       java.lang.String text,
                                       boolean enabled,
                                       ModifyListener modifyListener)

Create and return a new text field.

Parameters:
  `parent` - the text field parent.
  `text` - the text to display on the text field.
  `enabled` - set if the text field can be edit or not.
  `selectListener` - the listener when the text field is edited (can be null).
Returns:
  the new text field.

#### createCombobox

    public static Combo createCombobox(Composite parent,
                                       boolean enabled,
                                       java.util.List<java.lang.String> elements,
                                       java.lang.String label,
                                       SelectionListener listener)

Create a combobox with a label.

Parameters:
  `parent` - the parent of the combobox.
  `enabled` - if the combobox is enabled.
  `elements` - the elements of the combobox
  `listener` - the listener of the combobox (can be null)
Returns:
  the combobox created.

#### createTextArea

    public static Text createTextArea(Composite parent,
                                      java.lang.String text,
                                      boolean enabled,
                                      ModifyListener modifyListener)

Create and return a new text field.

Parameters:
  `parent` - the text field parent.
  `text` - the text to display on the text field.
  `enabled` - set if the text field can be edit or not.
  `selectListener` - the listener when the text field is edited (can be null).
Returns:
  the new text field.

#### getLabelGridData

    public static GridData getLabelGridData()

Returns:
  the labelGridData

#### createCheckbox

    public static Button createCheckbox(Composite composite,
                                        boolean enabled,
                                        boolean selected,
                                        SelectionListener selectionListener)

Create and return a new checkbox.

Parameters:
  `parent` - the checkbox parent.
  `enabled` - set if the checkbox can be checked or not.
  `selected` - set if the checkbox is initially selected or not.
  `selectionListener` - the listener when the checkbox is selected (can be null).
Returns:
  the new checkbox.

#### createSpinner

    public static Spinner createSpinner(Composite parent,
                                        int maxValue,
                                        int minValue,
                                        int increment,
                                        boolean changeable,
                                        ModifyListener modifyListener)

Create and return a new spinner.

Parameters:
  `parent` - the parent of the spinner.
  `maxValue` - the max value the spinner can reach.
  `minValue` - the min value the spinner can reach.
  `increment` - the increment of the spinner.
  `changeable` - if the spinner is changeable or not.
  `modifyListener` - the listener when the spinner is changed (can be null).
Returns:
  the new spinner.
See Also:
  `Spinner`