# RSE Widgets API

Whether coding dialogs, property pages, preference pages or wizard pages we need to write the code to display and process the widgets in the client area. The RSE offers some help in this area in two ways:

1. A `SystemWidgetHelpers` class full of static methods to make it easier to create SWT widgets.
2. A few re-usable widgets that extend SWT.

## SystemWidgetHelpers Class

The `SystemWidgetHelpers` class in `org.eclipse.rse.ui` is chock full of static methods to simplify the work in populating a GridLayout composite with widgets. The GridLayout composite is the most flexible and useful of the layouts, yet the most work to code to. These methods will help with that. The methods include:

- Methods for creating a GridLayout composite. You typically call this at the start of your code that populates the client area.
- Methods for creating all the common SWT controls, with the GridData values specified for you.
- Methods for creating readonly flavours of input controls, such as a Text field or Combo box.
- Methods for creating labeled entry fields that have a prompting label in front of an input widget.
- Methods for automatically assigning unique mnemonics to all input widgets on a given composite or page.
- Methods for setting composite, widget, action and menu item contextual help.
- Methods for creating RSE-supplied widgets.
- Methods for creating populated combo boxes for connections, remote folders, system types and host names.

## RSE-Supplied Widgets

The `org.eclipse.rse.ui.widgets` package contains some specialized widgets you may find a use for:

Widget Class | Description
--- | ---

`SystemHistoryCombo`

A entry field that remembers its previous values and shows them in a dropdown so the user can easily re-select a previously typed value. The history is maintained for you, and is indexed by a key. This allows the combos to share history across numerous dialogs, property pages or wizard pages. The history can be bounded and pre-filled, and the user can clear the history at any time. This handy widget is used extensively within the RSE.

`InheritableEntryField` | An entry field with an left-right arrow beside it. When toggled left, the entry field is not editable and displays a supplied value. When toggled right, the entry field is editable. Useful in cases where the user can choose between an inherited or default value, or enter their own value.
`SystemPortPrompt` | Uses the InheritableEntryField to prompt for a TCP/IP port, where toggling to the left means port 0, or let the "first available port".
`SystemHostCombo` | This is a combo box that displays the currently defined RSE system connections. The list can be subset by system type or types. Further, you can optionally display a New button beside the combo that allows the user to create a new connection.

There are also many useful widgets related to the selection of remote files or folders, in package `org.eclipse.rse.files.ui.widgets`