Create UI elements by adding SWT controls via script commands to a dynamic org.eclipse.swt.layout.GridLayout. Each element allows to provide layout data, which accepts a fairly simple syntax: <coordinates> <horizontal align> <vertical align>
Most methods of this module deal with SWT components. To access them the code needs to be run in the UI thread. See ui.executeUI(Object) for more information.
Whenever callback code is registered the executing engine is automatically set to be kept alive after script execution. This is required as callback execution needs a script engine.
| Method | Description |
|---|---|
| addControl() | Add a generic control. |
| createButton() | Create a push button. |
| createCheckBox() | Create a checkbox. |
| createComboViewer() | Create a combo box. |
| createComparator() | Create a comparator (sorter) to be used for combos, lists or tables. |
| createComposite() | Create a new composite. |
| createDialog() | Create a dialog with scripted content. |
| createGroup() | Create a group composite. |
| createImage() | Create an image instance. |
| createLabel() | Create a label. |
| createLabelProvider() | Create a label provider to be used for combos, lists or tables. |
| createListViewer() | Create a list viewer. |
| createProgressBar() | Create a progress bar. |
| createRadioButton() | Create a radio button. |
| createScrolledComposite() | Create a new composite inside of a scrolled composite. |
| createSeparator() | Create a separator. |
| createTableViewer() | Create a table viewer. |
| createText() | Create a single line text input. |
| createTextBox() | Create a multi line text input. |
| createTreeViewer() | Create a tree viewer. |
| createView() | Create a view with scripted content. |
| createViewerColumn() | Create a column for a table viewer. |
| getComposite() | Get the active composite. |
| getProviderElement() | Get the current element for the label/content provider. |
| getUiEvent() | Get the current event in case we are within a UI callback method. |
| popComposite() | Remove the current composite from the composite stack. |
| pushComposite() | Sets the active composite for further commands. |
| removeControl() | Remove a control. |
| setColumnCount() | Set the minimum column count. |
| showGrid() | Display a grid aiding in layouting. |
org.eclipse.swt.widgets.Control addControl(org.eclipse.swt.widgets.Control control, [java.lang.String layout]) java.lang.Throwable
Add a generic control.
control instance
org.eclipse.swt.widgets.Button createButton(java.lang.Object labelOrImage, java.lang.Object callback, [java.lang.String layout]) java.lang.Throwable
Create a push button.
button instance
org.eclipse.swt.widgets.Button createCheckBox(java.lang.String label, [boolean selected], [java.lang.Object callback], [java.lang.String layout]) java.lang.Throwable
Create a checkbox.
checkbox instance
org.eclipse.jface.viewers.ComboViewer createComboViewer( elements, [boolean editable], [java.lang.Object callback], [java.lang.String layout]) java.lang.Throwable
Create a combo box. The first element will automatically be selected.
true to allow users to enter custom entriesOptional: defaults to <false>.combo viewer instance
org.eclipse.jface.viewers.ViewerComparator createComparator(org.eclipse.jface.viewers.StructuredViewer viewer, [java.lang.Object categoryCallback], [java.lang.Object compareCallback]) java.lang.Throwable
Create a comparator (sorter) to be used for combos, lists or tables. The comparator is automatically attached to the provided viewer.
the viewer comparator
org.eclipse.swt.widgets.Composite createComposite([java.lang.String layout]) java.lang.Throwable
Create a new composite. To activate the composite (and create elements inside) use pushComposite(Composite).
composite instance
org.eclipse.ease.modules.platform.uibuilder.ScriptableDialog createDialog(java.lang.Object layoutCode, [java.lang.String title], [java.lang.String message]) java.lang.Throwable
Create a dialog with scripted content. To populate the dialog we need to provide a callback method that creates UI elements for the dialog area. After the setup the dialog can be shown by calling dialog.open(). To retrieve input data after the dialog got closed call dialog.getData(uiComponent).
dialog instance
org.eclipse.swt.widgets.Group createGroup([java.lang.String label], [java.lang.String layout]) java.lang.Throwable
Create a group composite. Further create commands will target this composite. To revert back to the parent use popComposite().
group instance
org.eclipse.swt.graphics.Image createImage(java.lang.String location) java.lang.Throwable
Create an image instance. Images will not directly be displayed. Instead they can be used when creating controls or views. When an image is created, its lifecycle gets bound to the current composite. When the composite gets disposed also all images bound to that composite get disposed.
image instance
org.eclipse.swt.widgets.Label createLabel(java.lang.Object labelOrImage, [java.lang.String layout]) java.lang.Throwable
Create a label.
label instance
org.eclipse.jface.viewers.ColumnLabelProvider createLabelProvider([java.lang.Object textCallback], [java.lang.Object imageCallback])
Create a label provider to be used for combos, lists or tables. While the callback is executed you may call getProviderElement() to get the current element.
label provider instance
org.eclipse.jface.viewers.ListViewer createListViewer( elements, [java.lang.Object callback], [java.lang.String layout]) java.lang.Throwable
Create a list viewer.
list viewer instance
org.eclipse.swt.widgets.ProgressBar createProgressBar([int value], [int maximum], [java.lang.String layout]) java.lang.Throwable
Create a progress bar.
progress bar instance
org.eclipse.swt.widgets.Button createRadioButton(java.lang.String label, [boolean selected], [java.lang.Object callback], [java.lang.String layout]) java.lang.Throwable
Create a radio button.
radio button instance
org.eclipse.swt.widgets.Composite createScrolledComposite([java.lang.String layout]) java.lang.Throwable
Create a new composite inside of a scrolled composite. Scrollbars will be added dynamically in case the content does not fit into the composite area. To activate the composite (and create elements inside) use pushComposite(Composite).
composite instance
org.eclipse.swt.widgets.Label createSeparator([boolean horizontal], [java.lang.String layout]) java.lang.Throwable
Create a separator.
true for horizontal, false for verticalOptional: defaults to <true>.separator instance
org.eclipse.jface.viewers.TableViewer createTableViewer( elements, [java.lang.Object callback], [java.lang.String layout]) java.lang.Throwable
Create a table viewer. To enhance look and feel create columns using createViewerColumn(ColumnViewer, String, BaseLabelProvider, int).
table viewer instance
org.eclipse.swt.widgets.Text createText([java.lang.String layout]) java.lang.Throwable
Create a single line text input.
text instance
org.eclipse.swt.widgets.Text createTextBox([java.lang.String layout]) java.lang.Throwable
Create a multi line text input.
text instance
org.eclipse.jface.viewers.TreeViewer createTreeViewer( rootElements, java.lang.Object getChildrenCallback, [java.lang.Object callback], [java.lang.String layout]) java.lang.Throwable
Create a tree viewer. To enhance look and feel create columns using createViewerColumn(ColumnViewer, String, BaseLabelProvider, int).
tree viewer instance
org.eclipse.e4.ui.model.application.ui.basic.MPart createView([java.lang.String title], [java.lang.String iconUri], [java.lang.String relativeTo], [java.lang.String position]) java.lang.Throwable
Create a view with scripted content. Automatically sets the active composite for further commands. This view will not be stored when the workbench gets closed.
view instance
org.eclipse.jface.viewers.ViewerColumn createViewerColumn(org.eclipse.jface.viewers.ColumnViewer viewer, java.lang.String title, [org.eclipse.jface.viewers.BaseLabelProvider labelProvider], [int weight]) java.lang.Throwable
Create a column for a table viewer. The viewer will automatically use a weighted layout for columns, distributing the horizontal space on all columns depending on their weight.
table viewer column
org.eclipse.swt.widgets.Composite getComposite()
Get the active composite.
active composite or null
java.lang.Object getProviderElement()
Get the current element for the label/content provider. Only valid while a provider callback is evaluated.
the element for the current provider evaluation or null
java.lang.Object getUiEvent()
Get the current event in case we are within a UI callback method.
current UI event or null
org.eclipse.swt.widgets.Composite popComposite()
Remove the current composite from the composite stack. For the topmost composite this method does nothing.
current composite after the removal
void pushComposite(org.eclipse.swt.widgets.Composite composite)
Sets the active composite for further commands. The composite layout will be set to org.eclipse.swt.layout.GridLayout if not already done. When creating multiple composites you may return to a previous one using popComposite().
void removeControl(java.lang.Object controlOrLocation)
Remove a control.
void setColumnCount(int columns)
Set the minimum column count. If the current column count is already equal or higher then this method does nothing.
void showGrid([boolean showGrid])
Display a grid aiding in layouting. When the grid is displayed, empty cells do show a label with their location coordinates.
true to display.Optional: defaults to <true>.