public abstract class WComponentGroup extends FormComponent
form, INTERNAL_STATE_RECORD_PROPERTY
Constructor and Description |
---|
WComponentGroup() |
Modifier and Type | Method and Description |
---|---|
void |
addComponent(RecordHolder child)
Adds a component to this component group.
|
protected FormComponent |
addComponentInt(RecordHolder child)
Internally registers the component but does not call
getWidget() .addComponent() . |
protected abstract com.vaadin.ui.AbstractComponentContainer |
createWidget()
Called once, to create the actual Vaadin component.
|
protected List<FormComponent> |
getChildren() |
RecordHolder |
getComponentAt(Decimal index)
Gets a child component at the specified index.
|
Decimal |
getComponentCount()
Gets the count of child components contained in this component group.
|
ListHolder |
getComponents()
Gets all components from this component group.
|
Decimal |
getExpandRatio(RecordHolder child)
Gets the expand ratio of the child component.
|
IHasChildren |
getHasChildrenAdapter()
Provides an adapter of this component which allows easily invoke methods on
the
forms::HasChildren interface. |
com.vaadin.ui.AbstractComponentContainer |
getWidget()
Gets the Vaadin representation of this component.
|
boolean |
isMargin()
Checks the value of the margin flag.
|
boolean |
isSpacing()
Checks the value of the spacing flag.
|
void |
removeAllComponents()
Removes all components from this component group.
|
void |
removeComponent(RecordHolder child)
Removes the child component from this component group.
|
protected void |
restoreChildComponents(Map<String,Object> state)
Restores the child components from the internal state.
|
protected void |
restoreInternalState(Map<String,Object> state)
Restores the UI state of this component which was previously written
by
FormComponent.writeInternalState(Map) . |
void |
setExpandRatio(RecordHolder child,
Decimal ratio)
Sets the expand ration of the component.
|
void |
setMargin(boolean margin)
Sets the margin flag to the component groups.
|
void |
setSpacing(boolean spacing)
Sets a spacing flag to this component group.
|
protected void |
writeChildComponents(Map<String,Object> state)
Stores the child components to the internal state.
|
protected void |
writeInternalState(Map<String,Object> state)
Writes the UI state of this component to the provided map.
|
addDataErrorMessage, addStyleName, attach, call, clearDataErrorMessages, createEvent, equals, getCaption, getComponentAlignment, getContextClickHandler, getCustomErrorMessage, getDataErrorMessages, getDescription, getExpandRatio, getHeight, getIcon, getModelingId, getNamespace, getStyleName, getTabIndex, getWidth, hashCode, isEnabled, isReadOnly, isVisible, localize, markAsDirty, preventGC, removeStyleName, restoreState, saveState, setCaption, setComponentAlignment, setContextClickHandler, setContextMenuItems, setCustomErrorMessage, setDescription, setEnabled, setExpandRatio, setHeight, setIcon, setReadOnly, setStyleName, setTabIndex, setVisible, setWidth, toString
protected List<FormComponent> getChildren()
protected abstract com.vaadin.ui.AbstractComponentContainer createWidget()
FormComponent
createWidget
in class FormComponent
public com.vaadin.ui.AbstractComponentContainer getWidget()
FormComponent
getWidget
in class FormComponent
protected FormComponent addComponentInt(RecordHolder child)
getWidget()
.addComponent()
.
Use when the component have to be added in a special way.child
- the child, not null.public void addComponent(RecordHolder child)
child
- the child component to addpublic RecordHolder getComponentAt(Decimal index)
index
- the index of the component to get.public Decimal getComponentCount()
public void removeComponent(RecordHolder child)
child
- the component to removepublic void removeAllComponents()
public ListHolder getComponents()
public void setSpacing(boolean spacing)
Layout.SpacingHandler
interface.spacing
- the value of the flag to setpublic boolean isSpacing()
true
if the widget is a Layout.SpacingHandler
and has the spacing flag set.public void setMargin(boolean margin)
Layout.MarginHandler
interface.margin
- public boolean isMargin()
true
if the widget is a Layout.MarginHandler
and has the margin flag set.public void setExpandRatio(RecordHolder child, Decimal ratio)
child
- ratio
- public Decimal getExpandRatio(RecordHolder child)
child
- public IHasChildren getHasChildrenAdapter()
FormComponent
forms::HasChildren
interface. If this component does not implement the interface then
and adapter returning no children is returned.getHasChildrenAdapter
in class FormComponent
IHasChildren
interface, never null
.protected void writeInternalState(Map<String,Object> state)
FormComponent
Many UI attributes such as size, caption, etc. are not held in the records but are stored exclusively in the Vaadin components. In the records the getter/setter methods of such attributes directly delegate to the underlying component. For the purposes of the Save Document/Todo use case the state of such attributes has to be preserved.
Subclasses should override this method. The overriding method should call
super.writeInternalState(state)
to store the state form the super
class as well. The attributes should be written to the provided state
parameter. The type of the values written to the state
can only by
Java representation of LSPS types. That is java.util.Date
,
java.lang.String
, Decimal
, RecordHolder
,
ListHolder
, ... The name of the attributes stored in the map
should be unique and should not collide with the names used by any
of the superclass. It is the responsibility of the overridden method to ensure
that.
Subclasses overriding this method should also override
FormComponent.restoreInternalState(Map)
and restore the state written
by this method.
writeInternalState
in class FormComponent
state
- a map to which this method should write the component's UI state.FormComponent.restoreInternalState(Map)
,
FormComponent.saveState()
protected void restoreInternalState(Map<String,Object> state)
FormComponent
FormComponent.writeInternalState(Map)
.
Subclasses should override and call super.restoreInternalState(state);
restoreInternalState
in class FormComponent
state
- a map of attributes and their valuesFormComponent.writeInternalState(Map)
protected void writeChildComponents(Map<String,Object> state)
writeInternalState(Map)
.
Subclasses overriding this method should also override restoreChildComponents(Map)
.
state
- the map where to store the stateprotected void restoreChildComponents(Map<String,Object> state)
state
- the internal UI statewriteChildComponents(Map)
Copyright © 2007-2018 Whitestein Technologies. All Rights Reserved.