Package com.storedobject.ui
Class Card.Line
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.HtmlComponent
com.vaadin.flow.component.html.Hr
com.storedobject.ui.Card.Line
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasSize,com.vaadin.flow.component.HasStyle,Serializable
- Enclosing class:
Card
public static class Card.Line
extends com.vaadin.flow.component.html.Hr
The Line class represents a styled horizontal line component with customizable properties.
It extends the
Hr class and is designed to be a simple visual separator in a UI layout.
Features: - By default, it renders as a horizontal line with no border and a top border styled as "1px solid #e0e0e0". - The height of the line is set to 3px. - Margins are applied to create spacing above and below the line, with values of 8px for top and bottom.It also provides a method to set the background color of the line dynamically.
- Author:
- Syam
- See Also:
-
Constructor Summary
Constructors -
Method Summary
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.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods 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, setClassName
-
Constructor Details
-
Line
public Line()Constructs a Line component with predefined styles. This constructor initializes a horizontal line with the following styles: - Removes all borders except for the top border. - Sets the top border style to "1px solid #e0e0e0" to create a visual separator. - Assigns a height of 3px to the line. - Adds margins of 8px above and below the line for spacing.
-
-
Method Details
-
setColor
Sets the background color for this component.- Parameters:
color- The background color to be applied, specified as a CSS color value (e.g., "red", "#FF0000", "rgb(255, 0, 0)").
-