|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.vaadin.server.AbstractClientConnector
com.vaadin.ui.AbstractComponent
com.vaadin.ui.AbstractField<T>
com.vaadin.ui.CustomField<T>
T - field value typepublic abstract class CustomField<T>
A 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.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.vaadin.ui.AbstractField |
|---|
AbstractField.FocusShortcut, AbstractField.ReadOnlyStatusChangeEvent |
| Nested classes/interfaces inherited from class com.vaadin.ui.AbstractComponent |
|---|
AbstractComponent.ComponentErrorEvent, AbstractComponent.ComponentErrorHandler |
| Nested classes/interfaces inherited from interface com.vaadin.ui.ComponentContainer |
|---|
ComponentContainer.ComponentAttachEvent, ComponentContainer.ComponentAttachListener, ComponentContainer.ComponentDetachEvent, ComponentContainer.ComponentDetachListener |
| Nested classes/interfaces inherited from interface com.vaadin.ui.Component |
|---|
Component.ErrorEvent, Component.ErrorListener, Component.Event, Component.Focusable, Component.Listener |
| Nested classes/interfaces inherited from interface com.vaadin.server.Sizeable |
|---|
Sizeable.Unit |
| Nested classes/interfaces inherited from interface com.vaadin.ui.Field |
|---|
Field.ValueChangeEvent |
| Nested classes/interfaces inherited from interface com.vaadin.data.Buffered |
|---|
Buffered.SourceException |
| Nested classes/interfaces inherited from interface com.vaadin.data.Property |
|---|
Property.Editor, Property.ReadOnlyException, Property.ReadOnlyStatusChangeListener, Property.ReadOnlyStatusChangeNotifier, Property.Transactional<T>, Property.ValueChangeListener, Property.ValueChangeNotifier, Property.Viewer |
| Field Summary |
|---|
| Fields inherited from interface com.vaadin.server.Sizeable |
|---|
SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS |
| Constructor Summary | |
|---|---|
CustomField()
Constructs a new custom field. |
|
| Method Summary | |
|---|---|
void |
addComponent(Component c)
Adds the component into this container. |
void |
addComponentAttachListener(ComponentContainer.ComponentAttachListener listener)
Listens the component attach events. |
void |
addComponentDetachListener(ComponentContainer.ComponentDetachListener listener)
Listens the component detach events. |
void |
addListener(ComponentContainer.ComponentAttachListener listener)
Deprecated. Since 7.0, replaced by addComponentAttachListener(com.vaadin.ui.ComponentContainer.ComponentAttachListener) |
void |
addListener(ComponentContainer.ComponentDetachListener listener)
Deprecated. Since 7.0, replaced by addComponentDetachListener(com.vaadin.ui.ComponentContainer.ComponentDetachListener) |
void |
attach()
Constructs the content and notifies it that the CustomField is
attached to a window. |
protected void |
fireComponentAttachEvent(Component component)
Fires the component attached event. |
int |
getComponentCount()
Gets the number of children this ComponentContainer has. |
java.util.Iterator<Component> |
getComponentIterator()
Gets an iterator to the collection of contained components. |
protected Component |
getContent()
Returns the content (UI) of the custom component. |
protected abstract Component |
initContent()
Create the content component or layout for the field. |
boolean |
isComponentVisible(Component childComponent)
Checks if the child component is visible. |
java.util.Iterator<Component> |
iterator()
|
void |
moveComponentsFrom(ComponentContainer source)
Moves all components from an another container into this container. |
void |
removeAllComponents()
Removes all components from this container. |
void |
removeComponent(Component c)
Removes the component from this container. |
void |
removeComponentAttachListener(ComponentContainer.ComponentAttachListener listener)
Stops the listening component attach events. |
void |
removeComponentDetachListener(ComponentContainer.ComponentDetachListener listener)
Stops the listening component detach events. |
void |
removeListener(ComponentContainer.ComponentAttachListener listener)
Deprecated. Since 7.0, replaced by removeComponentAttachListener(com.vaadin.ui.ComponentContainer.ComponentAttachListener) |
void |
removeListener(ComponentContainer.ComponentDetachListener listener)
Deprecated. Since 7.0, replaced by removeComponentDetachListener(com.vaadin.ui.ComponentContainer.ComponentDetachListener) |
void |
replaceComponent(Component oldComponent,
Component newComponent)
Replaces the component in the container with another one without changing position. |
void |
setHeight(float height,
Sizeable.Unit unit)
Sets the height of the object. |
void |
setWidth(float height,
Sizeable.Unit unit)
Sets the width of the object. |
| Methods inherited from class com.vaadin.server.AbstractClientConnector |
|---|
addExtension, addMethodInvocationToQueue, createState, encodeState, getAllChildrenIterable, getConnectorId, getExtensions, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setResource |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.vaadin.ui.Component |
|---|
addListener, addStyleName, getCaption, getIcon, getId, getLocale, getParent, getStyleName, getUI, isEnabled, isReadOnly, isVisible, removeListener, removeStyleName, setCaption, setEnabled, setIcon, setId, setReadOnly, setStyleName, setVisible |
| Methods inherited from interface com.vaadin.server.ClientConnector |
|---|
beforeClientResponse, detach, encodeState, getExtensions, getStateType, handleConnectorRequest, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setParent |
| Methods inherited from interface com.vaadin.shared.Connector |
|---|
getConnectorId |
| Methods inherited from interface com.vaadin.server.RpcTarget |
|---|
getRpcManager |
| Methods inherited from interface com.vaadin.server.Sizeable |
|---|
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setSizeFull, setSizeUndefined, setWidth |
| Methods inherited from interface com.vaadin.event.Action.ShortcutNotifier |
|---|
addShortcutListener, removeShortcutListener |
| Constructor Detail |
|---|
public 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.
| Method Detail |
|---|
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 CustomField
public void setHeight(float height,
Sizeable.Unit unit)
Sizeable
setHeight in interface SizeablesetHeight in class AbstractComponentheight - the height of the object.unit - the unit used for the width.
public void setWidth(float height,
Sizeable.Unit unit)
Sizeable
setWidth in interface SizeablesetWidth in class AbstractComponentheight - the width of the object.unit - the unit used for the width.public java.util.Iterator<Component> getComponentIterator()
HasComponents
getComponentIterator in interface HasComponentspublic java.util.Iterator<Component> iterator()
iterator in interface java.lang.Iterable<Component>public int getComponentCount()
ComponentContainerComponentContainer has. This
must be symmetric with what HasComponents.getComponentIterator() returns.
getComponentCount in interface ComponentContainerprotected void fireComponentAttachEvent(Component component)
component - the component that has been added to this container.public void addComponent(Component c)
ComponentContainer
addComponent in interface ComponentContainerc - the component to be added.public void removeComponent(Component c)
ComponentContainer
removeComponent in interface ComponentContainerc - the component to be removed.public void removeAllComponents()
ComponentContainer
removeAllComponents in interface ComponentContainer
public void replaceComponent(Component oldComponent,
Component newComponent)
ComponentContainerThis method replaces component with another one is such way that the new component overtakes the position of the old component. If the old component is not in the container, the new component is added to the container. If the both component are already in the container, their positions are swapped. Component attach and detach events should be taken care as with add and remove.
replaceComponent in interface ComponentContaineroldComponent - the old component that will be replaced.newComponent - the new component to be replaced.public void moveComponentsFrom(ComponentContainer source)
ComponentContainersource.
moveComponentsFrom in interface ComponentContainersource - the container which contains the components that are to be
moved to this container.public void addComponentAttachListener(ComponentContainer.ComponentAttachListener listener)
ComponentContainer
addComponentAttachListener in interface ComponentContainerlistener - the listener to add.@Deprecated public void addListener(ComponentContainer.ComponentAttachListener listener)
addComponentAttachListener(com.vaadin.ui.ComponentContainer.ComponentAttachListener)
addListener in interface ComponentContainerpublic void removeComponentAttachListener(ComponentContainer.ComponentAttachListener listener)
ComponentContainer
removeComponentAttachListener in interface ComponentContainerlistener - the listener to removed.@Deprecated public void removeListener(ComponentContainer.ComponentAttachListener listener)
removeComponentAttachListener(com.vaadin.ui.ComponentContainer.ComponentAttachListener)
removeListener in interface ComponentContainerpublic void addComponentDetachListener(ComponentContainer.ComponentDetachListener listener)
ComponentContainer
addComponentDetachListener in interface ComponentContainer@Deprecated public void addListener(ComponentContainer.ComponentDetachListener listener)
addComponentDetachListener(com.vaadin.ui.ComponentContainer.ComponentDetachListener)
addListener in interface ComponentContainerpublic void removeComponentDetachListener(ComponentContainer.ComponentDetachListener listener)
ComponentContainer
removeComponentDetachListener in interface ComponentContainer@Deprecated public void removeListener(ComponentContainer.ComponentDetachListener listener)
removeComponentDetachListener(com.vaadin.ui.ComponentContainer.ComponentDetachListener)
removeListener in interface ComponentContainerpublic boolean isComponentVisible(Component childComponent)
HasComponentsNote that this will prevent updates from reaching the child even though the child itself is set to visible. Also if a child is set to invisible this will not force it to be visible.
isComponentVisible in interface HasComponentschildComponent - The child component to check
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||