Package com.storedobject.vaadin
Class CSSGrid
java.lang.Object
com.vaadin.flow.component.Component
com.storedobject.vaadin.CSSGrid
- All Implemented Interfaces:
HasSize,HasStyle,com.vaadin.flow.component.AttachNotifier,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,Serializable
- Direct Known Subclasses:
Dashboard,GridLayout
@Tag("div")
public class CSSGrid
extends com.vaadin.flow.component.Component
implements com.vaadin.flow.component.HasOrderedComponents, HasStyle, HasSize
Basic implementation of the CSS Grid layout.
- Author:
- Syam
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidalign(com.vaadin.flow.component.Component component, CSSGrid.Position position) Align (vertically) a component within its grid cell.voidcenter(com.vaadin.flow.component.Component component) Center (horizontally and vertically) a component within its grid cell.intgetColumnSpan(com.vaadin.flow.component.Component component) Get number of columns the component takes up.intgetRowSpan(com.vaadin.flow.component.Component component) Get number of rows the component takes up.voidjustify(com.vaadin.flow.component.Component component, CSSGrid.Position position) Justify (horizontally) a component within its grid cell.voidsetColumnGap(int size) Set gap between columns.voidsetColumnGap(String size) Set gap between columns.voidsetColumnSpan(com.vaadin.flow.component.Component component, int columns) Set number of columns to span.voidsetGap(int size) Set gap between components.voidSet gap between components.voidsetRowGap(int size) Set gap between rows.voidSet gap between rows.voidsetRowSpan(com.vaadin.flow.component.Component component, int rows) Set number of rows to span.protected voidSet a style attribute.Methods 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.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, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidthFullMethods inherited from interface com.storedobject.vaadin.HasStyle
getClassName, getClassNames, getInternalElement, getStyle, setClassNameMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, hasClassName, removeClassName, removeClassNames, setClassName
-
Constructor Details
-
CSSGrid
public CSSGrid()Constructor.
-
-
Method Details
-
setGap
-
setGap
public void setGap(int size) Set gap between components.- Parameters:
size- Gap in pixels
-
setColumnGap
-
setColumnGap
public void setColumnGap(int size) Set gap between columns.- Parameters:
size- Gap in pixels
-
setRowGap
-
setRowGap
public void setRowGap(int size) Set gap between rows.- Parameters:
size- Gap in pixels
-
style
-
justify
Justify (horizontally) a component within its grid cell.- Parameters:
component- Componentposition- Position
-
align
Align (vertically) a component within its grid cell.- Parameters:
component- Componentposition- Position
-
center
public void center(com.vaadin.flow.component.Component component) Center (horizontally and vertically) a component within its grid cell.- Parameters:
component- Component
-
setColumnSpan
public void setColumnSpan(com.vaadin.flow.component.Component component, int columns) Set number of columns to span.- Parameters:
component- Componentcolumns- Columns to span
-
getColumnSpan
public int getColumnSpan(com.vaadin.flow.component.Component component) Get number of columns the component takes up.- Parameters:
component- Component- Returns:
- Number of columns.
-
setRowSpan
public void setRowSpan(com.vaadin.flow.component.Component component, int rows) Set number of rows to span.- Parameters:
component- Componentrows- Rows to span
-
getRowSpan
public int getRowSpan(com.vaadin.flow.component.Component component) Get number of rows the component takes up.- Parameters:
component- Component- Returns:
- Number of rows.
-