@Tag(value="vaadin-board") @NpmPackage(value="@vaadin/vaadin-board", version="2.2.1") @JsModule(value="@vaadin/vaadin-board/vaadin-board.js") @HtmlImport(value="frontend://bower_components/vaadin-board/vaadin-board.html") public class Board extends Component implements HasSize, HasStyle, HasOrderedComponents<Board>
A Board consists of Row
s where you can add any Vaadin component. 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.
Here is a simple usage example:
Board board = new Board(); Label lbl1 = new Label("LABEL1"); Label lbl2 = new Label("LABEL2"); Label lbl3 = new Label("LABEL3"); Label lbl4 = new Label("LABEL4"); board.addRow(lbl1, lbl2, lbl3, lbl4);
Constructor and Description |
---|
Board()
Creates an empty board.
|
Modifier and Type | Method and Description |
---|---|
Row |
addRow(Component... components)
Creates a new row and adds the given components to the row.
|
void |
redraw()
Forces the board to be redrawn.
|
void |
removeRow(Row row)
Removes the given row from the board.
|
addListener, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, 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
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
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
getChildren, getComponentAt, getComponentCount, indexOf, replace
add, add, addComponentAsFirst, addComponentAtIndex, remove, removeAll
isEnabled, setEnabled
getElement
addAttachListener
addDetachListener
public Board()
Use addRow(Component...)
to add content to the board.
public Row addRow(Component... components)
All the added components have cols set to 1, i.e. use one slot in the row. The number of slots in the row is the number of added components.
components
- components to add, no more than 4IllegalArgumentException
- if there are more than 4 componentspublic void removeRow(Row row)
row
- the row to be removedpublic void redraw()
This method typically only needs to be called if you change CSS (through a variable or otherwise) which affects the size of the board or the breakpoints used. Otherwise, the component will be redrawn automatically when needed.
Copyright © 2023. All rights reserved.