@Tag(value="div") public class FlexLayout extends Component implements FlexComponent<FlexLayout>, 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. |
static class |
FlexLayout.WrapMode
Deprecated.
Use
FlexLayout.FlexWrap instead
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.
|
FlexLayout.WrapMode |
getWrapMode()
Deprecated.
Use
getFlexWrap() instead
Gets the current flex wrap mode of the layout.
The default flex wrap mode is |
void |
setAlignContent(FlexLayout.ContentAlignment alignment)
Sets how the lines within the layout are aligned when there is extra space,
similar to how
FlexComponent.setJustifyContentMode(JustifyContentMode)
aligns individual items. |
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.
|
void |
setWrapMode(FlexLayout.WrapMode wrapMode)
Deprecated.
Use
setFlexWrap(FlexWrap) instead
Gets the FlexLayout.WrapMode used by this layout.
The default flex wrap mode is |
addListener, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getUI, hasListener, 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
getHeight, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, setHeight, setHeightFull, setMaxHeight, setMaxWidth, setMinHeight, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidthFull
addClickListener, addClickShortcut
addAttachListener
addDetachListener
public FlexLayout()
public FlexLayout(Component... children)
children
- the items to add to this layoutHasComponents.add(Component...)
@Deprecated public void setWrapMode(FlexLayout.WrapMode wrapMode)
setFlexWrap(FlexWrap)
instead
Gets the FlexLayout.WrapMode
used by this layout.
The default flex wrap mode is FlexLayout.WrapMode.NOWRAP
.
wrapMode
- the flex wrap mode of the layout, never
null
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
@Deprecated public FlexLayout.WrapMode getWrapMode()
getFlexWrap()
instead
Gets the current flex wrap mode of the layout.
The default flex wrap mode is FlexLayout.WrapMode.NOWRAP
.
null
public FlexLayout.FlexWrap getFlexWrap()
The default flex wrap is FlexLayout.FlexWrap.NOWRAP
.
null
public void setAlignContent(FlexLayout.ContentAlignment alignment)
FlexComponent.setJustifyContentMode(JustifyContentMode)
aligns individual items.
Has no effect if getWrapMode()
is FlexLayout.WrapMode.NOWRAP
,
since, in that case, there is only one line.
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 © 2020. All rights reserved.