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
Modifier and TypeClassDescriptionprotected static class
ResponsiveGridLayoutImpl.AbstractGridElementImpl<T extends JmixResponsiveGridLayout.AbstractGridElement>
protected static class
protected static class
Nested 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.Wrapper
Nested classes/interfaces inherited from interface io.jmix.ui.component.HasContextHelp
HasContextHelp.ContextHelpIconClickEvent
Nested classes/interfaces inherited from interface io.jmix.ui.component.LayoutClickNotifier
LayoutClickNotifier.LayoutClickEvent
Nested 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
Modifier and TypeFieldDescriptionprotected com.vaadin.shared.Registration
protected 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, parent
Fields inherited from interface io.jmix.ui.component.Component
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE
Fields inherited from interface io.jmix.ui.component.ResponsiveGridLayout
NAME
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAdds a listener that is fired when user clicks inside the layout at any place.protected void
addOwnComponent
(Component component) addRow()
Creates a newResponsiveGridLayout.Row
and adds it to this responsive grid layout.addRow
(int index) Creates a newResponsiveGridLayout.Row
and adds it to the given position in responsive grid layout.void
attached()
Notifies all listeners that component has been attached.protected void
protected JmixResponsiveGridLayout
void
detached()
Notifies all listeners that component has been detached.protected Component
findChildComponent
(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()
float
getWidth()
Get component width inComponent.getWidthSizeUnit()
Gets the width property units.protected void
boolean
Is the component responsive?void
Removes all rows from this responsive grid layout.protected void
removeOwnComponent
(Component component) void
Removes the given row from this responsive grid layout.void
setContainerType
(ResponsiveGridLayout.ContainerType containerType) Sets the container type.void
setResponsive
(boolean responsive) Sets component to be responsive by width and height.void
Set 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, withUnwrappedComposition
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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, withUnwrappedComposition
Methods inherited from interface io.jmix.ui.component.Component.BelongToFrame
getFrame, setFrame
Methods inherited from interface io.jmix.ui.component.HasComponents
focusFirstComponent, getComponentNN
Methods 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:ResponsiveGridLayout
Creates a newResponsiveGridLayout.Row
and adds it to this responsive grid layout.- Specified by:
addRow
in interfaceResponsiveGridLayout
- Returns:
- the created row
-
addRow
Description copied from interface:ResponsiveGridLayout
Creates a newResponsiveGridLayout.Row
and adds it to the given position in responsive grid layout.- Specified by:
addRow
in 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:ResponsiveGridLayout
Removes the given row from this responsive grid layout.- Specified by:
removeRow
in interfaceResponsiveGridLayout
- Parameters:
row
- the row to be removed
-
removeAllRows
public void removeAllRows()Description copied from interface:ResponsiveGridLayout
Removes all rows from this responsive grid layout.- Specified by:
removeAllRows
in interfaceResponsiveGridLayout
-
getRows
- Specified by:
getRows
in interfaceResponsiveGridLayout
- Returns:
- a list of contained rows
-
getContainerType
- Specified by:
getContainerType
in interfaceResponsiveGridLayout
- Returns:
- the container type, not
null
-
setContainerType
Description copied from interface:ResponsiveGridLayout
Sets 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-width
changes at each breakpoint.
- Specified by:
setContainerType
in interfaceResponsiveGridLayout
- Parameters:
containerType
- the container type to switch to, notnull
-
getOwnComponent
Description copied from interface:HasComponents
Gets component directly owned by this container.- Specified by:
getOwnComponent
in interfaceHasComponents
- Returns:
- component or null if not found
-
getComponent
Description copied from interface:HasComponents
Gets a component belonging to the whole components tree below this container.- Specified by:
getComponent
in interfaceHasComponents
- Returns:
- component or null if not found
-
getOwnComponents
Description copied from interface:HasComponents
Gets all components directly owned by this container.- Specified by:
getOwnComponents
in interfaceHasComponents
- Returns:
- all components directly owned by this container
-
getOwnComponentsStream
Description copied from interface:HasComponents
Gets stream of all components directly owned by this container.- Specified by:
getOwnComponentsStream
in interfaceHasComponents
- Returns:
- stream of all components directly owned by this container
-
getComponents
Description copied from interface:HasComponents
Gets all components belonging to the whole components tree below this container.- Specified by:
getComponents
in interfaceHasComponents
- Returns:
- all components belonging to the whole components tree below this container
-
addOwnComponent
-
removeOwnComponent
-
addLayoutClickListener
Description copied from interface:LayoutClickNotifier
Adds a listener that is fired when user clicks inside the layout at any place.- Specified by:
addLayoutClickListener
in interfaceLayoutClickNotifier
- Parameters:
listener
- a listener to add
-
findChildComponent
-
internalRemoveLayoutClickListener
protected void internalRemoveLayoutClickListener(Consumer<LayoutClickNotifier.LayoutClickEvent> listener) -
attached
public void attached()Description copied from interface:AttachNotifier
Notifies all listeners that component has been attached.- Specified by:
attached
in interfaceAttachNotifier
- Overrides:
attached
in classAbstractComponent<JmixResponsiveGridLayout>
-
detached
public void detached()Description copied from interface:AttachNotifier
Notifies all listeners that component has been detached.- Specified by:
detached
in interfaceAttachNotifier
- Overrides:
detached
in classAbstractComponent<JmixResponsiveGridLayout>
-
getWidth
public float getWidth()Description copied from interface:Component
Get component width inComponent.getWidthSizeUnit()
- Specified by:
getWidth
in interfaceComponent
- Overrides:
getWidth
in classAbstractComponent<JmixResponsiveGridLayout>
-
getWidthSizeUnit
Description copied from interface:Component
Gets the width property units.- Specified by:
getWidthSizeUnit
in interfaceComponent
- Overrides:
getWidthSizeUnit
in classAbstractComponent<JmixResponsiveGridLayout>
- Returns:
- units used in the width property.
-
setWidth
Description copied from interface:Component
Set component width inComponent.getWidthSizeUnit()
}- Specified by:
setWidth
in interfaceComponent
- Overrides:
setWidth
in classAbstractComponent<JmixResponsiveGridLayout>
-
isResponsive
public boolean isResponsive()Description copied from interface:Component
Is the component responsive?- Specified by:
isResponsive
in interfaceComponent
- Overrides:
isResponsive
in 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:Component
Sets 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:
setResponsive
in interfaceComponent
- Overrides:
setResponsive
in classAbstractComponent<JmixResponsiveGridLayout>
- Parameters:
responsive
- responsive flag
-
checkInitializedState
protected void checkInitializedState()
-