Package com.storedobject.ui
Class Card.Cell
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.HtmlComponent
com.vaadin.flow.component.HtmlContainer
com.vaadin.flow.component.html.Div
com.storedobject.ui.Card.Cell
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.ClickNotifier<com.vaadin.flow.component.html.Div>,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.HasComponents,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasEnabled,com.vaadin.flow.component.HasOrderedComponents,com.vaadin.flow.component.HasSize,com.vaadin.flow.component.HasStyle,com.vaadin.flow.component.HasText,Serializable
- Direct Known Subclasses:
Card.Column,Card.Row
- Enclosing class:
Card
public static class Card.Cell
extends com.vaadin.flow.component.html.Div
Represents a flex container that manages its child components with a customizable layout.
The Cell class extends the Div component and provides specialized alignment and layout
capabilities, enabling components to be organized either in a column or row direction,
with adjustable gaps and alignment options.
- Author:
- Syam
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.vaadin.flow.component.HasText
com.vaadin.flow.component.HasText.WhiteSpace -
Constructor Summary
ConstructorsConstructorDescriptionCell(int gap, com.vaadin.flow.component.Component... components) Constructs aCellinstance with the specified gap between components and an array of child components.Cell(com.vaadin.flow.component.Component... components) Creates a newCellinstance with the specified child components arranged in a flexible container layout. -
Method Summary
Modifier and TypeMethodDescriptionvoidAligns the component to the bottom in its container.voidAligns the content of the current component or cell to the center.voidalignTop()Aligns the content or component placement to the top of the layout.voidAligns the content of a cell or container to the horizontal center.voidAligns the content of the cell or container to the left.voidAligns the justification of this component or cell to the right.voidsetGap(int gap) Sets the gap between elements in the layout.Methods inherited from class com.vaadin.flow.component.HtmlComponent
getTitle, setTitleMethods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.ClickNotifier
addClickListener, addClickShortcut, addDoubleClickListener, addSingleClickListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasComponents
add, add, add, addComponentAsFirst, addComponentAtIndex, remove, remove, removeAllMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabledMethods inherited from interface com.vaadin.flow.component.HasOrderedComponents
getChildren, getComponentAt, getComponentCount, indexOf, replaceMethods inherited from interface com.vaadin.flow.component.HasSize
getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFullMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface com.vaadin.flow.component.HasText
getText, getWhiteSpace, setText, setWhiteSpace
-
Constructor Details
-
Cell
public Cell(com.vaadin.flow.component.Component... components) Creates a newCellinstance with the specified child components arranged in a flexible container layout. The layout defaults to a column direction with a standard gap between elements.- Parameters:
components- The child components to be added to thisCell. These components will be arranged within the flexible container.
-
Cell
public Cell(int gap, com.vaadin.flow.component.Component... components) Constructs aCellinstance with the specified gap between components and an array of child components. The gap is used to define the spacing between components in the layout.- Parameters:
gap- The gap (in pixels) to be applied between components. If the value is negative, a default gap is used.components- The components to be added to thisCell.
-
-
Method Details
-
setGap
public void setGap(int gap) Sets the gap between elements in the layout. If the specified gap value is negative, a default gap of 4 pixels will be applied.- Parameters:
gap- The amount of the gap (in pixels) to set between elements. If provided as a negative value, it defaults to 4 pixels.
-
alignTop
public void alignTop()Aligns the content or component placement to the top of the layout. If the invoking instance is of typeCell, this method sets the CSS propertyalign-selftostart, positioning the content of the cell at the top. For other component types, it sets the CSS propertyalign-itemstostart, aligning child components of the layout container towards the top edge. -
alignBottom
public void alignBottom()Aligns the component to the bottom in its container. For instances of theCellclass, this method sets the CSS propertyalign-selftoend, which aligns the component to the bottom edge of its parent container. For other classes, this method sets the CSS propertyalign-itemstoend, aligning child elements of the container to the bottom edge. -
alignCenter
public void alignCenter()Aligns the content of the current component or cell to the center. In the case where this method is called on an instance of theCellclass, it sets the "align-self" CSS property to "center". For other components, it sets the "align-items" CSS property to "center". -
justifyLeft
public void justifyLeft()Aligns the content of the cell or container to the left. This method applies the "justify-self" or "justify-items" style property with the value "start" depending on whether the current instance is of typeCell. For instances ofCell, the "justify-self" property is set, and for other container types, the "justify-items" property is set. -
justifyRight
public void justifyRight()Aligns the justification of this component or cell to the right. If the current instance belongs to theCellclass, this method sets the CSS style property "justify-self" to "end". For other types of components, it sets the CSS style property "justify-items" to "end". -
justifyCenter
public void justifyCenter()Aligns the content of a cell or container to the horizontal center. When invoked on an instance ofCell, it sets thejustify-selfstyle property tocenter. For other container types, it sets thejustify-itemsstyle property tocenter. This method ensures that the alignment behavior is specific to the type of container it is applied on.
-