Package com.storedobject.ui
Class FoldingLayout
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.Composite<com.vaadin.flow.component.Component>
com.storedobject.ui.FoldingLayout
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasStyle,Serializable
public class FoldingLayout
extends com.vaadin.flow.component.Composite<com.vaadin.flow.component.Component>
A responsive layout that can contain only sizeable components (
HasSize). On a screen with its width less than
its height or its width less than getFoldingPoint(), it displays its components horizontally. Otherwise,
it displays the components vertically.- Author:
- Syam
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionFoldingLayout(int viewWidth, int viewHeight, com.vaadin.flow.component.HasSize... components) Constructor with fixed view-width and view-height.FoldingLayout(com.vaadin.flow.component.HasSize... components) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(com.vaadin.flow.component.HasSize... components) Add components.final intSet the folding point (Point at which folding is initiated).final intgetGap()Get the gap between components.protected com.vaadin.flow.component.Componentprotected voidonAttach(com.vaadin.flow.component.AttachEvent attachEvent) protected voidonDetach(com.vaadin.flow.component.DetachEvent detachEvent) voidremove(com.vaadin.flow.component.HasSize... components) Remove components.voidRemove all components.voidsetFoldingPoint(int foldingPoint) Set the folding point (Point at which folding is initiated).voidsetGap(int gap) Set the gap between components.voidsetProportionalHeight(int... heights) Set proportional widths for the components.voidsetProportionalWidths(int... widths) Set proportional widths for the components.Methods inherited from class com.vaadin.flow.component.Composite
getChildren, getContent, getElementMethods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, 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.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Constructor Details
-
FoldingLayout
public FoldingLayout(com.vaadin.flow.component.HasSize... components) Constructor.- Parameters:
components- Components to add.
-
FoldingLayout
public FoldingLayout(int viewWidth, int viewHeight, com.vaadin.flow.component.HasSize... components) Constructor with fixed view-width and view-height. This is useful only if you are adding this to aViewwithView.setWindowMode(boolean)set to true (For example:DataForm).- Parameters:
viewWidth- View width (typically between 1 and 100).viewHeight- View height (typically between 1 and 100).components- Components to add.
-
-
Method Details
-
initContent
protected com.vaadin.flow.component.Component initContent()- Overrides:
initContentin classcom.vaadin.flow.component.Composite<com.vaadin.flow.component.Component>
-
onAttach
protected void onAttach(com.vaadin.flow.component.AttachEvent attachEvent) - Overrides:
onAttachin classcom.vaadin.flow.component.Component
-
onDetach
protected void onDetach(com.vaadin.flow.component.DetachEvent detachEvent) - Overrides:
onDetachin classcom.vaadin.flow.component.Component
-
setGap
public void setGap(int gap) Set the gap between components. (Default gap is 1%).- Parameters:
gap- Gap in percentage.
-
getGap
public final int getGap()Get the gap between components.- Returns:
- Gap in percentage.
-
setFoldingPoint
public void setFoldingPoint(int foldingPoint) Set the folding point (Point at which folding is initiated).- Parameters:
foldingPoint- Folding point. (Default is 800).
-
getFoldingPoint
public final int getFoldingPoint()Set the folding point (Point at which folding is initiated).- Returns:
- Folding point. (Default is 800).
-
add
public void add(com.vaadin.flow.component.HasSize... components) Add components.- Parameters:
components- Components to add.
-
remove
public void remove(com.vaadin.flow.component.HasSize... components) Remove components.- Parameters:
components- Components to remove.
-
removeAll
public void removeAll()Remove all components. -
setProportionalWidths
public void setProportionalWidths(int... widths) Set proportional widths for the components. These values are used to spread the components horizontally.- Parameters:
widths- Widths.
-
setProportionalHeight
public void setProportionalHeight(int... heights) Set proportional widths for the components. These values are used to spread the components vertically.- Parameters:
heights- Heights.
-