Package io.jmix.ui.component.impl
Class GridLayoutImpl
java.lang.Object
io.jmix.ui.component.impl.AbstractComponent<JmixGridLayout>
io.jmix.ui.component.impl.GridLayoutImpl
- All Implemented Interfaces:
AttachNotifier
,Component
,Component.BelongToFrame
,Component.HasCaption
,Component.HasDescription
,Component.HasIcon
,Component.HasXmlDescriptor
,Component.Wrapper
,ComponentContainer
,GridLayout
,HasComponents
,HasContextHelp
,HasDebugId
,HasHtmlCaption
,HasHtmlDescription
,HasHtmlSanitizer
,HasMargin
,HasRequiredIndicator
,HasSpacing
,LayoutClickNotifier
,ShortcutNotifier
-
Nested Class Summary
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.GridLayout
GridLayout.Area
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
-
Field Summary
Modifier and TypeFieldDescriptionprotected com.vaadin.shared.Registration
protected Map<ShortcutAction,
com.vaadin.event.ShortcutListener> 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.GridLayout
NAME
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a component to this container.void
void
Adds a listener that is fired when user clicks inside the layout at any place.void
addShortcutAction
(ShortcutAction action) void
attached()
Notifies all listeners that component has been attached.protected JmixGridLayout
void
detached()
Notifies all listeners that component has been detached.protected Component
findChildComponent
(com.vaadin.ui.Component vComponent) float
getColumnExpandRatio
(int col) int
getComponent
(int columnIndex, int rowIndex) Gets the Component at given row and column.getComponent
(String id) Gets a component belonging to the whole components tree below this container.getComponentArea
(Component childComponent) Returns information about the area where given component is laid in the GridLayout.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.float
getRowExpandRatio
(int row) int
getRows()
boolean
protected void
boolean
Returns whether a required indicator should be shown.void
Removes a component from this container.void
Removes all components from this container.void
removeShortcutAction
(ShortcutAction action) void
setColumnExpandRatio
(int col, float ratio) void
setColumns
(int columns) void
void
setMargin
(MarginInfo marginInfo) void
setRequiredIndicatorVisible
(boolean visible) Sets whether a required indicator should be shown.void
setRowExpandRatio
(int row, float ratio) void
setRows
(int rows) void
setSpacing
(boolean enabled) 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, getWidth, getWidthSizeUnit, getXmlDescriptor, hasSubscriptions, hasValidationError, isAttached, isCaptionAsHtml, isContextHelpTextHtmlEnabled, isDescriptionAsHtml, isEnabled, isEnabledRecursive, isHtmlSanitizerEnabled, isResponsive, isVisible, isVisibleRecursive, onContextHelpIconClick, publish, removeStyleName, sanitize, setAlignment, setApplicationContext, setCaption, setCaptionAsHtml, setContextHelpIconClickHandler, setContextHelpText, setContextHelpTextHtmlEnabled, setDebugId, setDescription, setDescriptionAsHtml, setEnabled, setHeight, setHtmlSanitizerEnabled, setIcon, setIconFromSet, setId, setParent, setResponsive, setStyleName, setValidationError, setVisible, setWidth, 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, getWidth, getWidthSizeUnit, isEnabled, isEnabledRecursive, isResponsive, isVisible, isVisibleRecursive, removeStyleName, setAlignment, setEnabled, setHeight, setHeightAuto, setHeightFull, setId, setParent, setResponsive, setSizeAuto, setSizeFull, setStyleName, setVisible, setWidth, setWidthAuto, setWidthFull, unwrap, unwrapComposition, unwrapCompositionOrNull, unwrapOrNull, withUnwrapped, withUnwrappedComposition
Methods inherited from interface io.jmix.ui.component.Component.BelongToFrame
getFrame
Methods inherited from interface io.jmix.ui.component.Component.HasCaption
getCaption, setCaption
Methods inherited from interface io.jmix.ui.component.Component.HasDescription
getDescription, setDescription
Methods inherited from interface io.jmix.ui.component.Component.HasIcon
getIcon, setIcon, setIconFromSet
Methods inherited from interface io.jmix.ui.component.ComponentContainer
add, remove
Methods inherited from interface io.jmix.ui.component.GridLayout
getComponentNN
Methods inherited from interface io.jmix.ui.component.HasComponents
focusFirstComponent, getComponentNN
Methods inherited from interface io.jmix.ui.component.HasContextHelp
getContextHelpIconClickHandler, getContextHelpText, isContextHelpTextHtmlEnabled, setContextHelpIconClickHandler, setContextHelpText, setContextHelpTextHtmlEnabled
Methods inherited from interface io.jmix.ui.component.HasHtmlCaption
isCaptionAsHtml, setCaptionAsHtml
Methods inherited from interface io.jmix.ui.component.HasHtmlDescription
isDescriptionAsHtml, setDescriptionAsHtml
Methods inherited from interface io.jmix.ui.component.HasHtmlSanitizer
isHtmlSanitizerEnabled, setHtmlSanitizerEnabled
-
Field Details
-
ownComponents
-
layoutClickRegistration
protected com.vaadin.shared.Registration layoutClickRegistration -
shortcuts
-
-
Constructor Details
-
GridLayoutImpl
public GridLayoutImpl()
-
-
Method Details
-
createComponent
-
add
Description copied from interface:ComponentContainer
Adds a component to this container.- Specified by:
add
in interfaceComponentContainer
- Parameters:
childComponent
- a component to add
-
getColumnExpandRatio
public float getColumnExpandRatio(int col) - Specified by:
getColumnExpandRatio
in interfaceGridLayout
-
setColumnExpandRatio
public void setColumnExpandRatio(int col, float ratio) - Specified by:
setColumnExpandRatio
in interfaceGridLayout
-
getRowExpandRatio
public float getRowExpandRatio(int row) - Specified by:
getRowExpandRatio
in interfaceGridLayout
-
setRowExpandRatio
public void setRowExpandRatio(int row, float ratio) - Specified by:
setRowExpandRatio
in interfaceGridLayout
-
add
- Specified by:
add
in interfaceGridLayout
-
add
- Specified by:
add
in interfaceGridLayout
-
getRows
public int getRows()- Specified by:
getRows
in interfaceGridLayout
-
setRows
public void setRows(int rows) - Specified by:
setRows
in interfaceGridLayout
-
getColumns
public int getColumns()- Specified by:
getColumns
in interfaceGridLayout
-
setColumns
public void setColumns(int columns) - Specified by:
setColumns
in interfaceGridLayout
-
getComponent
Description copied from interface:GridLayout
Gets the Component at given row and column.- Specified by:
getComponent
in interfaceGridLayout
- Parameters:
columnIndex
- the column index, starting from 0 for the leftmost column.rowIndex
- the row index, starting from 0 for the topmost row.- Returns:
- Component in given cell or null if empty
-
getComponentArea
Description copied from interface:GridLayout
Returns information about the area where given component is laid in the GridLayout.- Specified by:
getComponentArea
in interfaceGridLayout
- Parameters:
childComponent
- the component whose area information is requested.- Returns:
- an Area object that contains information how component is laid in the grid
-
remove
Description copied from interface:ComponentContainer
Removes a component from this container.- Specified by:
remove
in interfaceComponentContainer
- Parameters:
childComponent
- a component to remove
-
removeAll
public void removeAll()Description copied from interface:ComponentContainer
Removes all components from this container.- Specified by:
removeAll
in interfaceComponentContainer
-
setFrame
- Specified by:
setFrame
in interfaceComponent.BelongToFrame
- Overrides:
setFrame
in classAbstractComponent<JmixGridLayout>
-
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
-
setMargin
-
getMargin
-
setSpacing
public void setSpacing(boolean enabled) - Specified by:
setSpacing
in interfaceHasSpacing
-
getSpacing
public boolean getSpacing()- Specified by:
getSpacing
in interfaceHasSpacing
-
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) -
addShortcutAction
- Specified by:
addShortcutAction
in interfaceShortcutNotifier
-
removeShortcutAction
- Specified by:
removeShortcutAction
in interfaceShortcutNotifier
-
isRequiredIndicatorVisible
public boolean isRequiredIndicatorVisible()Description copied from interface:HasRequiredIndicator
Returns whether a required indicator should be shown.- Specified by:
isRequiredIndicatorVisible
in interfaceHasRequiredIndicator
- Returns:
true
if a required indicator should be shown,false
otherwise
-
setRequiredIndicatorVisible
public void setRequiredIndicatorVisible(boolean visible) Description copied from interface:HasRequiredIndicator
Sets whether a required indicator should be shown.- Specified by:
setRequiredIndicatorVisible
in interfaceHasRequiredIndicator
- Parameters:
visible
-true
if a required indicator should be shown,false
otherwise
-
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<JmixGridLayout>
-
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<JmixGridLayout>
-