public class ElementField extends AbstractField
Element
values.
Uses a TextWrapperForIElement
.changeSupport
PROP_VALUE
Constructor and Description |
---|
ElementField(FormToolkit toolkit,
Composite parent,
IFormFieldData model) |
ElementField(FormToolkit toolkit,
Composite parent,
IFormFieldData model,
java.util.List<java.lang.Class<? extends MObject>> allowedMetaclasses) |
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.
|
java.lang.String |
getValidationError()
Default implementation that always return null.
|
void |
refresh()
Refresh the value displayed by the field.
|
addPropertyChangeListener, fireValueChanged, getComposite, getControl, getHelpText, getLabel, getModel, isVertical, layout, removePropertyChangeListener, setEditable, setHelpText, setModel, setVertical
public ElementField(FormToolkit toolkit, Composite parent, IFormFieldData model, java.util.List<java.lang.Class<? extends MObject>> allowedMetaclasses)
public ElementField(FormToolkit toolkit, Composite parent, IFormFieldData model)
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 java.lang.String getValidationError()
AbstractField
Should be redefined if the implementation widget may contain invalid values.
getValidationError
in interface IField
getValidationError
in class AbstractField
IField.apply()
may be called safely, an error message in other cases.public void refresh()
The field will typically query its IFormFieldData
model and refresh its contents.