@Tag(value="div") public class FlexLayout extends Component implements FlexComponent, ClickNotifier<FlexLayout>
This component can be used as a base class for more advanced layouts.
Modifier and Type | Class and Description |
---|---|
static class |
FlexLayout.ContentAlignment
Enum with the possible values for the component alignment inside the
layout.
|
static class |
FlexLayout.FlexDirection
Possible values for the
flex-direction CSS property, which
determines how the elements are placed inside the layout. |
static class |
FlexLayout.FlexWrap
Possible values for the
flex-wrap CSS property, which determines
how the elements inside the layout should behave when they don't fit
inside the layout. |
FlexComponent.Alignment, FlexComponent.JustifyContentMode
Constructor and Description |
---|
FlexLayout()
Default constructor.
|
FlexLayout(Component... children)
Convenience constructor to create a layout with the children already
inside it.
|
Modifier and Type | Method and Description |
---|---|
FlexLayout.ContentAlignment |
getAlignContent()
Gets the current align content property of the layout.
|
String |
getFlexBasis(HasElement elementContainer)
Gets the flex basis property of a given element container.
|
FlexLayout.FlexDirection |
getFlexDirection(HasElement elementContainer)
Gets the flex direction property of a given element container.
|
double |
getFlexShrink(HasElement elementContainer)
Gets the flex shrink property of a given element container.
|
FlexLayout.FlexWrap |
getFlexWrap()
Gets the current flex wrap of the layout.
|
int |
getOrder(HasElement elementContainer)
Gets the order property of a given element container.
|
void |
setAlignContent(FlexLayout.ContentAlignment alignment)
Similar to
FlexComponent.setAlignItems(Alignment) , but instead of aligning
components, it aligns flex lines. |
void |
setFlexBasis(String width,
HasElement... elementContainers)
Sets the flex basis property of the components inside the layout.
|
void |
setFlexDirection(FlexLayout.FlexDirection flexDirection)
Sets the flex direction property of the layout.
|
void |
setFlexShrink(double flexShrink,
HasElement... elementContainers)
Sets the flex shrink property of the components inside the layout.
|
void |
setFlexWrap(FlexLayout.FlexWrap flexWrap)
Gets the
FlexLayout.FlexWrap used by this layout. |
void |
setOrder(int order,
HasElement elementContainer)
Sets the order property of the component inside the layout.
|
addListener, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getLocale, getParent, 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
expand, getAlignItems, getAlignSelf, getFlexGrow, getJustifyContentMode, replace, setAlignItems, setAlignSelf, 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 FlexLayout()
public FlexLayout(Component... children)
children
- the items to add to this layoutHasComponents.add(Component...)
public void setFlexWrap(FlexLayout.FlexWrap flexWrap)
FlexLayout.FlexWrap
used by this layout.
The default flex wrap is FlexLayout.FlexWrap.NOWRAP
.
flexWrap
- the flex wrap of the layout, never null
public FlexLayout.FlexWrap getFlexWrap()
The default flex wrap is FlexLayout.FlexWrap.NOWRAP
.
null
public void setAlignContent(FlexLayout.ContentAlignment alignment)
FlexComponent.setAlignItems(Alignment)
, but instead of aligning
components, it aligns flex lines.
It effectively sets the "alignContent"
style value.
The default alignment is FlexLayout.ContentAlignment.STRETCH
.
alignment
- the alignment to apply to the components. Setting
null
will reset the alignment to its defaultpublic FlexLayout.ContentAlignment getAlignContent()
FlexLayout.ContentAlignment.STRETCH
if none was setpublic void setFlexBasis(String width, HasElement... elementContainers)
width
- the width for the components. Setting null
will
remove the flex basis propertyelementContainers
- the containers (components) to apply the flex basis propertypublic String getFlexBasis(HasElement elementContainer)
elementContainer
- the element container to read the flex basis property frompublic void setFlexDirection(FlexLayout.FlexDirection flexDirection)
FlexLayout.FlexDirection.ROW
.flexDirection
- the direction for the components. Setting null
will remove the flex direction propertypublic FlexLayout.FlexDirection getFlexDirection(HasElement elementContainer)
elementContainer
- the element container to read the flex direction property fromFlexLayout.FlexDirection.ROW
if none
was setpublic void setFlexShrink(double flexShrink, HasElement... elementContainers)
flexShrink
- how much the component will shrink relative to the rest of the
componentselementContainers
- the containers (components) to apply the flex shrink propertypublic double getFlexShrink(HasElement elementContainer)
elementContainer
- the element container to read the flex shrink property frompublic void setOrder(int order, HasElement elementContainer)
order
- the order for the componentelementContainer
- the container (component) to apply the order propertypublic int getOrder(HasElement elementContainer)
elementContainer
- the element container to read the order property fromCopyright © 2022. All rights reserved.