public class StringField extends BasicField implements IStringField
Dialog field containing a label and a text control.
Note |
Parts have been commented (content assist for example). These parts are not needed for the moment, but one day, they could be useful! |
fLabelControl, fLabelText, fUseFormLayout, fWidgetFactory, MAX_WITDH
Constructor and Description |
---|
StringField() |
StringField(int style) |
StringField(int style,
IWidgetFactory widgetFactory) |
StringField(IWidgetFactory widgetFactory) |
StringField(IWidgetFactory widgetFactory,
boolean multiLine) |
Modifier and Type | Method and Description | |||
---|---|---|---|---|
void |
dispose()
Disposes of the operating system resources associated with the field.
|
|||
protected org.eclipse.swt.widgets.Control[] |
doFillIntoGrid(org.eclipse.swt.widgets.Composite parent,
int nColumns)
/!\
| To be re-implemented by platform field implementors.
| /!\
|
|
protected int |
getNumberOfControls()
Returns the number of columns of the dialog field.
|
|||
java.lang.String |
getText()
Gets the text.
|
|||
org.eclipse.swt.widgets.Control |
getTextControl() |
|||
protected org.eclipse.swt.widgets.Text |
getTextControl(org.eclipse.swt.widgets.Composite parent,
int hspan) |
|||
protected boolean |
isEditable() |
|||
void |
refresh()
Brings the UI in sync with the model.
|
|||
void |
setEditable(boolean editable)
Sets the editable state of the field.
|
|||
boolean |
setFocus()
Tries to set the focus to this field.
|
|||
void |
setText(java.lang.String text)
Sets the text.
|
|||
void |
setTextEnabled(boolean b)
/!\
| This method only concerns the encapsulated text control.
| /!\
|
|
void |
setTextWithoutUpdate(java.lang.String text)
Sets the text without triggering a dialog-changed event.
|
|||
protected void |
updateEditableState() |
|||
protected void |
updateEnableState()
Called when the enable state changed.
|
addFieldListener, assertCompositeNotNull, createEmptySpace, createEmptySpace, createLabelControl, createSpecificComposite, dialogFieldChanged, fillIntoGrid, getLabelControl, getLabelControl, getLabelControl, isEnabled, isOkToUse, removeFieldListener, setEnabled, setLabelText, setToolTipText
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addFieldListener, fillIntoGrid, getLabelControl, isEnabled, removeFieldListener, setEnabled, setLabelText, setToolTipText
public StringField()
public StringField(IWidgetFactory widgetFactory)
public StringField(int style)
style
- Default value: SWT.SINGLE | SWT.BORDERpublic StringField(IWidgetFactory widgetFactory, boolean multiLine)
public StringField(int style, IWidgetFactory widgetFactory)
protected org.eclipse.swt.widgets.Control[] doFillIntoGrid(org.eclipse.swt.widgets.Composite parent, int nColumns)
BasicField
/!\ | To be re-implemented by platform field implementors. | /!\ |
doFillIntoGrid
in class BasicField
parent
- The parent composite of this dialog field.nColumns
- The number of columns of this dialog field.protected final org.eclipse.swt.widgets.Text getTextControl(org.eclipse.swt.widgets.Composite parent, int hspan)
parent
- The parent composite (supposed to be not null).hspan
- The number of columns the text widget must span.protected int getNumberOfControls()
BasicField
getNumberOfControls
in class BasicField
public boolean setFocus()
BasicField
true
if the dialog field can take focus. To be
re-implemented by dialog field implementors.setFocus
in class BasicField
protected void updateEnableState()
BasicField
updateEnableState
in class BasicField
public void dispose()
IField
dispose
in interface IField
dispose
in class BasicField
public java.lang.String getText()
IStringField
null
getText
in interface IStringField
public void refresh()
BasicField
refresh
in class BasicField
public void setText(java.lang.String text)
IStringField
setText
in interface IStringField
public void setTextEnabled(boolean b)
/!\ | This method only concerns the encapsulated text control. | /!\ |
Enables the text control if the parameter is true. Otherwise, disables it.
b
- The new enabled state.public void setTextWithoutUpdate(java.lang.String text)
setTextWithoutUpdate
in interface IStringField
public org.eclipse.swt.widgets.Control getTextControl()
getTextControl
in interface IStringField
public void setEditable(boolean editable)
IStringField
setEditable
in interface IStringField
editable
- The new editable state.protected void updateEditableState()
protected final boolean isEditable()