T - field value typeCustomField based
on new data binding API@Deprecated public abstract class CustomField<T> extends AbstractField<T> implements HasComponents
Field whose UI content can be constructed by the user, enabling the
creation of e.g. form fields by composing Vaadin components. Customization of
both the visual presentation and the logic of the field is possible.
Subclasses must implement AbstractField.getType() and initContent().
Most custom fields can simply compose a user interface that calls the methods
AbstractField.setInternalValue(Object) and AbstractField.getInternalValue() when
necessary.
It is also possible to override AbstractField.validate(),
AbstractField.setInternalValue(Object), AbstractField.commit(),
AbstractField.setPropertyDataSource(Property), AbstractField.isEmpty() and other logic
of the field. Methods overriding AbstractField.setInternalValue(Object) should
also call the corresponding superclass method.AbstractField.FocusShortcut, AbstractField.ReadOnlyStatusChangeEventHasComponents.ComponentAttachDetachNotifier, HasComponents.ComponentAttachEvent, HasComponents.ComponentAttachListener, HasComponents.ComponentDetachEvent, HasComponents.ComponentDetachListenerComponent.ErrorEvent, Component.Event, Component.Focusable, Component.ListenerClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListenerSizeable.UnitField.ValueChangeEventBuffered.SourceExceptionProperty.Editor, Property.ReadOnlyException, Property.ReadOnlyStatusChangeListener, Property.ReadOnlyStatusChangeNotifier, Property.Transactional<T>, Property.ValueChangeListener, Property.ValueChangeNotifier, Property.ViewerDESIGN_ATTR_PLAIN_TEXTSIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS| Constructor and Description |
|---|
CustomField()
Deprecated.
Constructs a new custom field.
|
| Modifier and Type | Method and Description |
|---|---|
void |
attach()
Deprecated.
Constructs the content and notifies it that the
CustomField is
attached to a window. |
void |
focus()
Deprecated.
|
protected Component |
getContent()
Deprecated.
Returns the content (UI) of the custom component.
|
int |
getTabIndex()
Deprecated.
|
protected abstract Component |
initContent()
Deprecated.
Create the content component or layout for the field.
|
Iterator<Component> |
iterator()
Deprecated.
|
void |
setFocusDelegate(Component.Focusable focusDelegate)
Deprecated.
Sets the component to which all methods from the
Focusable
interface should be delegated. |
void |
setHeight(float height,
Sizeable.Unit unit)
Deprecated.
|
void |
setTabIndex(int tabIndex)
Deprecated.
|
void |
setWidth(float width,
Sizeable.Unit unit)
Deprecated.
|
addListener, addListener, addReadOnlyStatusChangeListener, addValidator, addValueChangeListener, beforeClientResponse, clear, commit, detach, discard, fireReadOnlyStatusChange, fireValueChange, getConversionError, getConversionError, getConvertedValue, getConverter, getCurrentBufferedSourceException, getCustomAttributes, getErrorMessage, getInternalValue, getModelType, getPropertyDataSource, getRequiredError, getState, getState, getType, getValidators, getValue, isBuffered, isEmpty, isInvalidAllowed, isInvalidCommitted, isModified, isReadOnly, isRequired, isValid, isValidationVisible, readDesign, readOnlyStatusChange, removeAllValidators, removeListener, removeListener, removeReadOnlyStatusChangeListener, removeValidator, removeValueChangeListener, setBuffered, setConversionError, setConvertedValue, setConverter, setConverter, setCurrentBufferedSourceException, setInternalValue, setInvalidAllowed, setInvalidCommitted, setLocale, setPropertyDataSource, setReadOnly, setRequired, setRequiredError, setValidationVisible, setValue, setValue, setValue, shouldHideErrors, validate, validate, valueChange, writeDesigngetExplicitImmediateValue, isImmediate, setImmediateaddContextClickListener, addListener, addShortcutListener, addStyleName, findAncestor, fireComponentErrorEvent, fireComponentEvent, getActionManager, getCaption, getComponentError, getData, getDebugId, getDescription, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getWidth, getWidthUnits, isCaptionAsHtml, isConnectorEnabled, isEnabled, isOrHasAncestor, isRequiredIndicatorVisible, isResponsive, isVisible, removeContextClickListener, removeListener, removeShortcutListener, removeStyleName, setCaption, setCaptionAsHtml, setComponentError, setData, setDebugId, setDescription, setDescription, setEnabled, setHeight, setHeightUndefined, setIcon, setId, setParent, setPrimaryStyleName, setRequiredIndicatorVisible, setResponsive, setSizeFull, setSizeUndefined, setStyleName, setVisible, setWidth, setWidthUndefinedaddAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, createState, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, hashCode, hasListeners, isAttached, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource, updateDiffstateclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitaddListener, addStyleName, addStyleNames, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isVisible, readDesign, removeListener, removeStyleName, removeStyleNames, setCaption, setEnabled, setIcon, setId, setParent, setPrimaryStyleName, setStyleName, setStyleName, setVisible, writeDesignaddAttachListener, addDetachListener, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandlergetHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidthUndefinedforEach, spliteratoraddShortcutListener, removeShortcutListenerpublic CustomField()
The component is implemented by wrapping the methods of the composition root component given as parameter. The composition root must be set before the component can be used.
public void attach()
CustomField is
attached to a window.attach in interface ClientConnectorattach in interface Componentattach in class AbstractField<T>Component.attach()protected Component getContent()
protected abstract Component initContent()
CustomField should implement this method.
Note that this method is called when the CustomField is attached to a
layout or when getContent() is called explicitly for the first
time. It is only called once for a CustomField.Component representing the UI of the CustomFieldpublic void setHeight(float height,
Sizeable.Unit unit)
setHeight in interface SizeablesetHeight in class AbstractComponentpublic void setWidth(float width,
Sizeable.Unit unit)
setWidth in interface SizeablesetWidth in class AbstractComponentpublic Iterator<Component> iterator()
iterator in interface HasComponentsiterator in interface Iterable<Component>public void setFocusDelegate(Component.Focusable focusDelegate)
Focusable
interface should be delegated.
Set this to a wrapped field to include that field in the tabbing order,
to make it receive focus when focus() is called and to make it
be correctly focused when used as a Grid editor component.
By default, Focusable events are handled by the super class and
ultimately ignored.
focusDelegate - the focusable component to which focus events are redirectedpublic void focus()
AbstractFieldfocus in interface Component.Focusablefocus in class AbstractField<T>public int getTabIndex()
getTabIndex in interface Component.FocusablegetTabIndex in class AbstractField<T>public void setTabIndex(int tabIndex)
setTabIndex in interface Component.FocusablesetTabIndex in class AbstractField<T>Copyright © 2019 Vaadin Ltd. All rights reserved.