Package io.jmix.ui.component.impl
Class ResponsiveGridLayoutImpl
java.lang.Object
io.jmix.ui.component.impl.AbstractComponent<JmixResponsiveGridLayout>
io.jmix.ui.component.impl.ResponsiveGridLayoutImpl
- All Implemented Interfaces:
AttachNotifier,Component,Component.BelongToFrame,Component.HasCaption,Component.HasDescription,Component.HasIcon,Component.HasXmlDescriptor,Component.Wrapper,HasComponents,HasContextHelp,HasDebugId,HasHtmlCaption,HasHtmlDescription,HasHtmlSanitizer,LayoutClickNotifier,ResponsiveGridLayout
public class ResponsiveGridLayoutImpl
extends AbstractComponent<JmixResponsiveGridLayout>
implements ResponsiveGridLayout
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classResponsiveGridLayoutImpl.AbstractGridElementImpl<T extends JmixResponsiveGridLayout.AbstractGridElement>protected static classprotected static classNested classes/interfaces inherited from interface io.jmix.ui.component.Component
Component.Alignment, Component.BelongToFrame, Component.Disposable, Component.Editable, Component.Focusable, Component.HasCaption, Component.HasDescription, Component.HasIcon, Component.HasXmlDescriptor, Component.WrapperNested classes/interfaces inherited from interface io.jmix.ui.component.HasContextHelp
HasContextHelp.ContextHelpIconClickEventNested classes/interfaces inherited from interface io.jmix.ui.component.LayoutClickNotifier
LayoutClickNotifier.LayoutClickEventNested classes/interfaces inherited from interface io.jmix.ui.component.ResponsiveGridLayout
ResponsiveGridLayout.AlignItems, ResponsiveGridLayout.AlignSelf, ResponsiveGridLayout.Breakpoint, ResponsiveGridLayout.Column, ResponsiveGridLayout.ColumnsValue, ResponsiveGridLayout.ContainerType, ResponsiveGridLayout.GridElement, ResponsiveGridLayout.JustifyContent, ResponsiveGridLayout.OffsetValue, ResponsiveGridLayout.OrderValue, ResponsiveGridLayout.Row, ResponsiveGridLayout.RowColumnsValue -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.vaadin.shared.Registrationprotected List<ResponsiveGridLayout.Row>Fields inherited from class io.jmix.ui.component.impl.AbstractComponent
alignment, applicationContext, component, contextHelpIconClickHandler, contextHelpIconClickListener, descriptionAsHtml, element, frame, htmlSanitizerEnabled, icon, ICON_STYLE, id, parentFields inherited from interface io.jmix.ui.component.Component
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZEFields inherited from interface io.jmix.ui.component.ResponsiveGridLayout
NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds a listener that is fired when user clicks inside the layout at any place.protected voidaddOwnComponent(Component component) addRow()Creates a newResponsiveGridLayout.Rowand adds it to this responsive grid layout.addRow(int index) Creates a newResponsiveGridLayout.Rowand adds it to the given position in responsive grid layout.voidattached()Notifies all listeners that component has been attached.protected voidprotected JmixResponsiveGridLayoutvoiddetached()Notifies all listeners that component has been detached.protected ComponentfindChildComponent(com.vaadin.ui.Component clickedComponent) getComponent(String id) Gets a component belonging to the whole components tree below this container.Gets all components belonging to the whole components tree below this container.Gets component directly owned by this container.Gets all components directly owned by this container.Gets stream of all components directly owned by this container.getRows()floatgetWidth()Get component width inComponent.getWidthSizeUnit()Gets the width property units.protected voidbooleanIs the component responsive?voidRemoves all rows from this responsive grid layout.protected voidremoveOwnComponent(Component component) voidRemoves the given row from this responsive grid layout.voidsetContainerType(ResponsiveGridLayout.ContainerType containerType) Sets the container type.voidsetResponsive(boolean responsive) Sets component to be responsive by width and height.voidSet component width inComponent.getWidthSizeUnit()}Methods inherited from class io.jmix.ui.component.impl.AbstractComponent
addAttachListener, addDetachListener, addStyleName, assignDebugId, getAlignment, getCaption, getComponent, getComposition, getContextHelpIconClickHandler, getContextHelpText, getDebugId, getDescription, getEventHub, getFrame, getHeight, getHeightSizeUnit, getHtmlSanitizer, getIcon, getIconName, getIconResource, getId, getParent, getStyleName, getUiComponentProperties, getUiProperties, getXmlDescriptor, hasSubscriptions, hasValidationError, isAttached, isCaptionAsHtml, isContextHelpTextHtmlEnabled, isDescriptionAsHtml, isEnabled, isEnabledRecursive, isHtmlSanitizerEnabled, isVisible, isVisibleRecursive, onContextHelpIconClick, publish, removeStyleName, sanitize, setAlignment, setApplicationContext, setCaption, setCaptionAsHtml, setContextHelpIconClickHandler, setContextHelpText, setContextHelpTextHtmlEnabled, setDebugId, setDescription, setDescriptionAsHtml, setEnabled, setFrame, setHeight, setHtmlSanitizerEnabled, setIcon, setIconFromSet, setId, setParent, setStyleName, setValidationError, setVisible, setXmlDescriptor, unsubscribe, unwrap, unwrapComposition, unwrapCompositionOrNull, unwrapOrNull, withUnwrapped, withUnwrappedCompositionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.jmix.ui.component.Component
addStyleName, getAlignment, getHeight, getHeightSizeUnit, getId, getParent, getStyleName, isEnabled, isEnabledRecursive, isVisible, isVisibleRecursive, removeStyleName, setAlignment, setEnabled, setHeight, setHeightAuto, setHeightFull, setId, setParent, setSizeAuto, setSizeFull, setStyleName, setVisible, setWidthAuto, setWidthFull, unwrap, unwrapComposition, unwrapCompositionOrNull, unwrapOrNull, withUnwrapped, withUnwrappedCompositionMethods inherited from interface io.jmix.ui.component.Component.BelongToFrame
getFrame, setFrameMethods inherited from interface io.jmix.ui.component.HasComponents
focusFirstComponent, getComponentNNMethods inherited from interface io.jmix.ui.component.HasHtmlSanitizer
isHtmlSanitizerEnabled, setHtmlSanitizerEnabled
-
Field Details
-
rowOrder
-
ownComponents
-
layoutClickRegistration
protected com.vaadin.shared.Registration layoutClickRegistration
-
-
Constructor Details
-
ResponsiveGridLayoutImpl
public ResponsiveGridLayoutImpl()
-
-
Method Details
-
createComponent
-
addRow
Description copied from interface:ResponsiveGridLayoutCreates a newResponsiveGridLayout.Rowand adds it to this responsive grid layout.- Specified by:
addRowin interfaceResponsiveGridLayout- Returns:
- the created row
-
addRow
Description copied from interface:ResponsiveGridLayoutCreates a newResponsiveGridLayout.Rowand adds it to the given position in responsive grid layout.- Specified by:
addRowin interfaceResponsiveGridLayout- Parameters:
index- the position of the new row. The rows that are currently in and after the position are shifted forwards- Returns:
- the created row
-
removeRow
Description copied from interface:ResponsiveGridLayoutRemoves the given row from this responsive grid layout.- Specified by:
removeRowin interfaceResponsiveGridLayout- Parameters:
row- the row to be removed
-
removeAllRows
public void removeAllRows()Description copied from interface:ResponsiveGridLayoutRemoves all rows from this responsive grid layout.- Specified by:
removeAllRowsin interfaceResponsiveGridLayout
-
getRows
- Specified by:
getRowsin interfaceResponsiveGridLayout- Returns:
- a list of contained rows
-
getContainerType
- Specified by:
getContainerTypein interfaceResponsiveGridLayout- Returns:
- the container type, not
null
-
setContainerType
Description copied from interface:ResponsiveGridLayoutSets the container type.The built-in container types are:
ResponsiveGridLayout.ContainerType.FLUID- a full width container, spanning the entire width of the viewport. Used by default.ResponsiveGridLayout.ContainerType.FIXED- a fixed-width container, meaning itsmax-widthchanges at each breakpoint.
- Specified by:
setContainerTypein interfaceResponsiveGridLayout- Parameters:
containerType- the container type to switch to, notnull
-
getOwnComponent
Description copied from interface:HasComponentsGets component directly owned by this container.- Specified by:
getOwnComponentin interfaceHasComponents- Returns:
- component or null if not found
-
getComponent
Description copied from interface:HasComponentsGets a component belonging to the whole components tree below this container.- Specified by:
getComponentin interfaceHasComponents- Returns:
- component or null if not found
-
getOwnComponents
Description copied from interface:HasComponentsGets all components directly owned by this container.- Specified by:
getOwnComponentsin interfaceHasComponents- Returns:
- all components directly owned by this container
-
getOwnComponentsStream
Description copied from interface:HasComponentsGets stream of all components directly owned by this container.- Specified by:
getOwnComponentsStreamin interfaceHasComponents- Returns:
- stream of all components directly owned by this container
-
getComponents
Description copied from interface:HasComponentsGets all components belonging to the whole components tree below this container.- Specified by:
getComponentsin interfaceHasComponents- Returns:
- all components belonging to the whole components tree below this container
-
addOwnComponent
-
removeOwnComponent
-
addLayoutClickListener
Description copied from interface:LayoutClickNotifierAdds a listener that is fired when user clicks inside the layout at any place.- Specified by:
addLayoutClickListenerin interfaceLayoutClickNotifier- Parameters:
listener- a listener to add
-
findChildComponent
-
internalRemoveLayoutClickListener
protected void internalRemoveLayoutClickListener(Consumer<LayoutClickNotifier.LayoutClickEvent> listener) -
attached
public void attached()Description copied from interface:AttachNotifierNotifies all listeners that component has been attached.- Specified by:
attachedin interfaceAttachNotifier- Overrides:
attachedin classAbstractComponent<JmixResponsiveGridLayout>
-
detached
public void detached()Description copied from interface:AttachNotifierNotifies all listeners that component has been detached.- Specified by:
detachedin interfaceAttachNotifier- Overrides:
detachedin classAbstractComponent<JmixResponsiveGridLayout>
-
getWidth
public float getWidth()Description copied from interface:ComponentGet component width inComponent.getWidthSizeUnit()- Specified by:
getWidthin interfaceComponent- Overrides:
getWidthin classAbstractComponent<JmixResponsiveGridLayout>
-
getWidthSizeUnit
Description copied from interface:ComponentGets the width property units.- Specified by:
getWidthSizeUnitin interfaceComponent- Overrides:
getWidthSizeUnitin classAbstractComponent<JmixResponsiveGridLayout>- Returns:
- units used in the width property.
-
setWidth
Description copied from interface:ComponentSet component width inComponent.getWidthSizeUnit()}- Specified by:
setWidthin interfaceComponent- Overrides:
setWidthin classAbstractComponent<JmixResponsiveGridLayout>
-
isResponsive
public boolean isResponsive()Description copied from interface:ComponentIs the component responsive?- Specified by:
isResponsivein interfaceComponent- Overrides:
isResponsivein classAbstractComponent<JmixResponsiveGridLayout>- Returns:
- true if the component applies conditional CSS rules for width / height sizes.
-
setResponsive
public void setResponsive(boolean responsive) Description copied from interface:ComponentSets component to be responsive by width and height.
If responsive flag is true then you can use conditional CSS rules that respond to size changes in the browser. You can set specific rules using "width-range" or "height-range" properties in CSS files.- Specified by:
setResponsivein interfaceComponent- Overrides:
setResponsivein classAbstractComponent<JmixResponsiveGridLayout>- Parameters:
responsive- responsive flag
-
checkInitializedState
protected void checkInitializedState()
-