@Tag(value="vaadin-board-row") @NpmPackage(value="@vaadin/vaadin-board", version="20.0.0") @JsModule(value="@vaadin/vaadin-board/vaadin-board-row.js") public class Row extends Component implements HasStyle, HasSize, HasOrderedComponents
Board
instance.
Each Row consists of four columns, and can contain up to four components taking one column each, or fewer components with multiple columns each as long as sum of columns stays less than or equal to four.
One row might also contain a nested row as shown in the following example:
Board board = new Board(); Label lbl1 = createLabel("Label 1"); Label lbl2 = createLabel("Label 2"); Label lbl3 = createLabel("Label 3"); Label inner1 = createLabel("Inner 1"); Label inner3 = createLabel("Inner 3"); Label inner4 = createLabel("Inner 4"); Label inner2 = createLabel("Inner 2"); Row innerRow = new Row(inner1, inner2, inner3, inner4); Row outerRow = board.add(lbl1, lbl2, lbl3, innerRow);
Constructor and Description |
---|
Row()
Creates an empty row.
|
Row(Component... components)
Creates an new row with the given components.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Component... components)
Adds the given component(s) to the row.
|
void |
add(Component component,
int cols)
Adds the given component to the row using the given number of columns.
|
void |
addNestedRow(Row row)
Adds the given row as a nested row to the current row.
|
int |
getComponentSpan(Component component)
Gets the number of columns the given component spans.
|
void |
setComponentSpan(Component component,
int columns)
Sets the number of columns the given component spans.
|
addListener, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, set, setElement, setId, setVisible
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
getCssSize, getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull
getChildren, getComponentAt, getComponentCount, indexOf, replace
add, addComponentAsFirst, addComponentAtIndex, remove, removeAll
isEnabled, setEnabled
getElement
addAttachListener
addDetachListener
public Row()
Use add(Component...)
or add(Component, int)
to add
content to the row.
public Row(Component... components)
components
- initial content of the rowpublic void add(Component... components)
All added components are set to use 1 column. Use
setComponentSpan(Component, int)
to make a component span
multiple columns.
add
in interface HasComponents
components
- the components to addpublic void add(Component component, int cols)
component
- the component to addcols
- the number of columns the component should usepublic void addNestedRow(Row row)
row
- the row to add as a nested rowpublic int getComponentSpan(Component component)
component
- the child component to get columns forpublic void setComponentSpan(Component component, int columns)
component
- the child component to set columns forcolumns
- the number of columns the component spansCopyright © 2021. All rights reserved.