public class ComboDialogField extends DialogField
fLabelText
Constructor and Description |
---|
ComboDialogField(int flags) |
Modifier and Type | Method and Description |
---|---|
org.eclipse.swt.widgets.Control[] |
doFillIntoGrid(org.eclipse.swt.widgets.Composite parent,
int nColumns)
Creates all controls of the dialog field and fills it to a composite.
|
org.eclipse.swt.widgets.Combo |
getComboControl(org.eclipse.swt.widgets.Composite parent)
Creates or returns the created combo control.
|
java.lang.String[] |
getItems()
Gets the combo items.
|
int |
getNumberOfControls()
Returns the number of columns of the dialog field.
|
int |
getSelectionIndex() |
java.lang.String |
getText()
Gets the text.
|
protected static org.eclipse.swt.layout.GridData |
gridDataForCombo(int span) |
void |
refresh()
Brings the UI in sync with the model.
|
boolean |
selectItem(int index)
Selects an item.
|
boolean |
selectItem(java.lang.String name)
Selects an item.
|
boolean |
setFocus()
Tries to set the focus to the dialog field.
|
void |
setItems(java.lang.String[] items)
Sets the combo items.
|
void |
setText(java.lang.String text)
Sets the text.
|
void |
setTextWithoutUpdate(java.lang.String text)
Sets the text without triggering a dialog-changed event.
|
protected void |
updateEnableState()
Called when the enable state changed.
|
assertCompositeNotNull, assertEnoughColumns, createEmptySpace, createEmptySpace, dialogFieldChanged, getLabelControl, gridDataForLabel, isEnabled, isOkToUse, postSetFocusOnDialogField, setDialogFieldListener, setEnabled, setLabelText
public org.eclipse.swt.widgets.Control[] doFillIntoGrid(org.eclipse.swt.widgets.Composite parent, int nColumns)
DialogField
MGridLayout
as layout. The
dialog field will adjust its controls' spans to the number of columns
given. To be reimplemented by dialog field implementors.doFillIntoGrid
in class DialogField
public int getNumberOfControls()
DialogField
getNumberOfControls
in class DialogField
protected static org.eclipse.swt.layout.GridData gridDataForCombo(int span)
public boolean setFocus()
DialogField
true
if
the dialog field can take focus. To be reimplemented by dialog field
implementors.setFocus
in class DialogField
public org.eclipse.swt.widgets.Combo getComboControl(org.eclipse.swt.widgets.Composite parent)
parent
- The parent composite or null
when the widget has
already been created.protected void updateEnableState()
DialogField
updateEnableState
in class DialogField
public java.lang.String[] getItems()
public void setItems(java.lang.String[] items)
public java.lang.String getText()
public void setText(java.lang.String text)
public boolean selectItem(int index)
public boolean selectItem(java.lang.String name)
public int getSelectionIndex()
public void setTextWithoutUpdate(java.lang.String text)
public void refresh()
DialogField
refresh
in class DialogField