@Tag(value="vaadin-vertical-layout") @NpmPackage(value="@vaadin/vaadin-ordered-layout", version="1.4.0") @JsModule(value="@vaadin/vaadin-ordered-layout/src/vaadin-vertical-layout.js") @HtmlImport(value="frontend://bower_components/vaadin-ordered-layout/src/vaadin-vertical-layout.html") public class VerticalLayout extends Component implements ThemableLayout, FlexComponent<VerticalLayout>, ClickNotifier<VerticalLayout>
FlexComponent.Alignment, FlexComponent.JustifyContentMode
Constructor and Description |
---|
VerticalLayout()
Constructs an empty layout with spacing and padding on by default.
|
VerticalLayout(Component... children)
Convenience constructor to create a layout with the children already
inside it.
|
Modifier and Type | Method and Description |
---|---|
void |
addAndExpand(Component... components)
Adds the given components to this layout and sets them as expanded.
|
FlexComponent.Alignment |
getAlignItems()
This is the same as
getDefaultHorizontalComponentAlignment() . |
FlexComponent.Alignment |
getAlignSelf(HasElement container)
This is the same as
getHorizontalComponentAlignment(Component) . |
FlexComponent.Alignment |
getDefaultHorizontalComponentAlignment()
Gets the default horizontal alignment used by all components without
individual alignments inside the layout.
|
FlexComponent.Alignment |
getHorizontalComponentAlignment(Component component)
Gets the individual horizontal alignment of a given component.
|
void |
setAlignItems(FlexComponent.Alignment alignment)
This is the same as
#setDefaultHorizontalComponentAlignment(Alignment) . |
void |
setAlignSelf(FlexComponent.Alignment alignment,
HasElement... elementContainers)
This is the same as
#setHorizontalComponentAlignment(Alignment, Component...) . |
void |
setDefaultHorizontalComponentAlignment(FlexComponent.Alignment alignment)
Sets the default horizontal alignment to be used by all components
without individual alignments inside the layout.
|
void |
setHorizontalComponentAlignment(FlexComponent.Alignment alignment,
Component... componentsToAlign)
Sets a horizontal alignment for individual components inside the layout.
|
void |
setPadding(boolean padding)
Toggles
padding theme setting for the element. |
void |
setSpacing(boolean spacing)
Toggles
spacing theme setting for the element. |
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
getBoxSizing, getThemeList, isMargin, isPadding, isSpacing, setBoxSizing, setMargin
expand, getFlexGrow, getJustifyContentMode, replace, setFlexGrow, setJustifyContentMode
getChildren, getComponentAt, getComponentCount, indexOf
add, add, addComponentAsFirst, addComponentAtIndex, remove, removeAll
isEnabled, setEnabled
getElement
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
addClickListener, addClickShortcut
addAttachListener
addDetachListener
public VerticalLayout()
public VerticalLayout(Component... children)
children
- the items to add to this layoutHasComponents.add(Component...)
public void setSpacing(boolean spacing)
spacing
theme setting for the element. If a theme
supports this attribute, it will apply or remove spacing to the element.
This method adds medium spacing to the component theme, to set other
options, use ThemableLayout.getThemeList()
. List of options
possible:
Spacing is enabled by default for vertical layout.
setSpacing
in interface ThemableLayout
spacing
- adds spacing
theme setting if true
or removes
it if false
public void setPadding(boolean padding)
padding
theme setting for the element. If a theme
supports this attribute, it will apply or remove padding to the element.
Padding is enabled by default for vertical layout.
setPadding
in interface ThemableLayout
padding
- adds padding
theme setting if true
or removes
it if false
public void setHorizontalComponentAlignment(FlexComponent.Alignment alignment, Component... componentsToAlign)
#setDefaultHorizontalComponentAlignment(Alignment)
.
The default alignment for individual components is
Alignment#AUTO
.
It's the same as the FlexComponent.setAlignSelf(Alignment, HasElement...)
method.
alignment
- the individual alignment for the children components. Setting
null
will reset the alignment to its defaultcomponentsToAlign
- The components to which the individual alignment should be setpublic FlexComponent.Alignment getHorizontalComponentAlignment(Component component)
The default alignment for individual components is
Alignment#AUTO
.
It's the same as the getAlignSelf(HasElement)
method
component
- The component which individual layout should be readnull
getAlignSelf(HasElement)
public void setDefaultHorizontalComponentAlignment(FlexComponent.Alignment alignment)
#setHorizontalComponentAlignment(Alignment, Component...)
method.
The default alignment is Alignment#STRETCH
.
It's the same as the FlexComponent.setAlignItems(Alignment)
method.
alignment
- the alignment to apply to the components. Setting
null
will reset the alignment to its defaultpublic FlexComponent.Alignment getDefaultHorizontalComponentAlignment()
The default alignment is Alignment#STRETCH
.
It's the same as the getAlignItems()
method.
null
public void setAlignItems(FlexComponent.Alignment alignment)
#setDefaultHorizontalComponentAlignment(Alignment)
.setAlignItems
in interface FlexComponent<VerticalLayout>
alignment
- the alignment to apply to the components. Setting
null
will reset the alignment to its default#setDefaultHorizontalComponentAlignment(Alignment)
public FlexComponent.Alignment getAlignItems()
getDefaultHorizontalComponentAlignment()
.getAlignItems
in interface FlexComponent<VerticalLayout>
null
public void setAlignSelf(FlexComponent.Alignment alignment, HasElement... elementContainers)
#setHorizontalComponentAlignment(Alignment, Component...)
.setAlignSelf
in interface FlexComponent<VerticalLayout>
alignment
- the individual alignment for the children components. Setting
null
will reset the alignment to its defaultelementContainers
- The element containers (components) to which the individual
alignment should be set#setHorizontalComponentAlignment(Alignment, Component...)
public FlexComponent.Alignment getAlignSelf(HasElement container)
getHorizontalComponentAlignment(Component)
.getAlignSelf
in interface FlexComponent<VerticalLayout>
container
- The element container (component) which individual layout
should be readnull
getHorizontalComponentAlignment(Component)
public void addAndExpand(Component... components)
components
- the components to set, not null
Copyright © 2023. All rights reserved.