public class WGridLayout extends WComponentGroup
form, INTERNAL_STATE_RECORD_PROPERTY
Constructor and Description |
---|
WGridLayout() |
Modifier and Type | Method and Description |
---|---|
void |
addComponentToGrid(RecordHolder child,
Decimal column,
Decimal row,
Decimal columnSpan,
Decimal rowSpan)
Adds a component to the grid.
|
protected com.vaadin.ui.AbstractComponentContainer |
createWidget()
Called once, to create the actual Vaadin component.
|
Decimal |
getColumnExpandRatio(Decimal columnIndex)
Gets expand ratio of a given column
|
Decimal |
getColumns()
Gets the number of columns in the grid layout.
|
RecordHolder |
getComponent(Decimal column,
Decimal row)
Gets a component which occupies the given position in the grid.
|
Decimal |
getRowExpandRatio(Decimal rowIndex)
Gets expand ratio of a given row.
|
Decimal |
getRows()
Gets the number of rows in the grid.
|
com.vaadin.ui.GridLayout |
getWidget()
Gets the Vaadin representation of this component.
|
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 |
setColumnExpandRatio(Decimal columnIndex,
Decimal ratio)
Sets expand ratio of a given column.
|
void |
setColumns(Decimal columns)
Sets the number of columns of the grid.
|
void |
setRowExpandRatio(Decimal rowIndex,
Decimal ratio)
Sets expand ratio of a given row.
|
void |
setRows(Decimal rows)
Sets the number of rows of the grid.
|
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.
|
addComponent, addComponentInt, getChildren, getComponentAt, getComponentCount, getComponents, getExpandRatio, getHasChildrenAdapter, isMargin, isSpacing, removeAllComponents, removeComponent, setExpandRatio, setMargin, setSpacing
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 com.vaadin.ui.AbstractComponentContainer createWidget()
FormComponent
createWidget
in class WComponentGroup
public void addComponentToGrid(RecordHolder child, Decimal column, Decimal row, Decimal columnSpan, Decimal rowSpan)
child
- the component to addcolumn
- the column indexrow
- the row indexcolumnSpan
- column spanrowSpan
- row spanpublic com.vaadin.ui.GridLayout getWidget()
FormComponent
getWidget
in class WComponentGroup
public Decimal getColumns()
public void setColumns(Decimal columns)
columns
- public Decimal getRows()
public void setRows(Decimal rows)
rows
- public void setColumnExpandRatio(Decimal columnIndex, Decimal ratio)
columnIndex
- the column indexratio
- the ratiopublic Decimal getColumnExpandRatio(Decimal columnIndex)
columnIndex
- the column indexpublic void setRowExpandRatio(Decimal rowIndex, Decimal ratio)
rowIndex
- the row indexratio
- the expand ratiopublic Decimal getRowExpandRatio(Decimal rowIndex)
rowIndex
- public RecordHolder getComponent(Decimal column, Decimal row)
column
- the column indexrow
- the row indexprotected 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 WComponentGroup
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 WComponentGroup
state
- a map of attributes and their valuesFormComponent.writeInternalState(Map)
protected void writeChildComponents(Map<String,Object> state)
WComponentGroup
WComponentGroup.writeInternalState(Map)
.
Subclasses overriding this method should also override WComponentGroup.restoreChildComponents(Map)
.
writeChildComponents
in class WComponentGroup
state
- the map where to store the stateprotected void restoreChildComponents(Map<String,Object> state)
WComponentGroup
restoreChildComponents
in class WComponentGroup
state
- the internal UI stateWComponentGroup.writeChildComponents(Map)
Copyright © 2007-2018 Whitestein Technologies. All Rights Reserved.