public class HtmlTextField extends AbstractField
changeSupport
PROP_VALUE
Constructor and Description |
---|
HtmlTextField(FormToolkit toolkit,
Composite parent,
IFormFieldData model) |
HtmlTextField(FormToolkit toolkit,
Composite parent,
IFormFieldData model,
int heightHint) |
Modifier and Type | Method and Description |
---|---|
void |
apply()
Store the field value in the model.
|
Control |
createControl(FormToolkit toolkit,
Composite parent)
Create the edition control.
|
void |
layout(Label label,
Control control,
ImageHyperlink helpButton)
Layouts the label, edition control and help button in their container (
IField.getComposite() ) |
void |
refresh()
Refresh the value displayed by the field.
|
addPropertyChangeListener, fireValueChanged, getComposite, getControl, getHelpText, getLabel, getModel, getValidationError, isVertical, removePropertyChangeListener, setEditable, setHelpText, setModel, setVertical
public HtmlTextField(FormToolkit toolkit, Composite parent, IFormFieldData model)
public HtmlTextField(FormToolkit toolkit, Composite parent, IFormFieldData model, int heightHint)
public void apply()
IField
May throw a runtime exception if the field value is not valid.
apply
in interface IField
apply
in class AbstractField
public Control createControl(FormToolkit toolkit, Composite parent)
createControl
in class AbstractField
toolkit
- the FormToolkit
parent
- the parent compositepublic void layout(Label label, Control control, ImageHyperlink helpButton)
IField.getComposite()
)
This method can be redefined by subclasses who need to change the standard layout for label, control and help button.
When it is called default LayoutData have already been applied to the widgets so that this method can typically either modify
or replace the existing LayoutData of the widgets.
The container layout is a FormLayout, therefore widget LayoutData must be FormData.
Note the the helpText will always be layouted so that it appears under the control (same width and X position). Specializes the initial layout so that several lines of the text can be displayed.
layout
in interface IField
layout
in class AbstractField
public void refresh()
The field will typically query its IFormFieldData
model and refresh its contents.