Package io.jmix.ui.component.impl
Class GroupBoxImpl
- All Implemented Interfaces:
AttachNotifier
,Collapsable
,Component
,Component.BelongToFrame
,Component.HasCaption
,Component.HasDescription
,Component.HasIcon
,Component.HasXmlDescriptor
,Component.Wrapper
,ComponentContainer
,ExpandingLayout
,GroupBoxLayout
,HasBorder
,HasComponents
,HasContextHelp
,HasDebugId
,HasHtmlCaption
,HasHtmlDescription
,HasHtmlSanitizer
,HasOrientation
,HasOuterMargin
,HasRequiredIndicator
,HasSpacing
,OrderedContainer
,ShortcutNotifier
,SupportsExpandRatio
,org.springframework.beans.factory.InitializingBean
public class GroupBoxImpl
extends AbstractComponent<JmixGroupBox>
implements GroupBoxLayout, org.springframework.beans.factory.InitializingBean
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.jmix.ui.component.Collapsable
Collapsable.ExpandedStateChangeEvent
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.ExpandingLayout
ExpandingLayout.ExpandDirection
Nested classes/interfaces inherited from interface io.jmix.ui.component.HasContextHelp
HasContextHelp.ContextHelpIconClickEvent
Nested classes/interfaces inherited from interface io.jmix.ui.component.HasOrientation
HasOrientation.Orientation
-
Field Summary
Modifier and TypeFieldDescriptionprotected HasOrientation.Orientation
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.GroupBoxLayout
NAME
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a component to this container.void
void
addShortcutAction
(ShortcutAction action) void
void
attached()
Notifies all listeners that component has been attached.protected JmixGroupBox
void
detached()
Notifies all listeners that component has been detached.void
Specifies the component that will be given maximum available space.protected void
fireExpandStateChange
(boolean expanded, boolean invokedByUser) getComponent
(int index) Returns the component at the given position.getComponent
(String id) Gets a component belonging to the whole components tree below this container.protected com.vaadin.ui.AbstractOrderedLayout
Gets all components belonging to the whole components tree below this container.float
getExpandRatio
(Component component) 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.boolean
Styles implementation is client-type-specific.int
protected void
initComponent
(JmixGroupBox component) boolean
boolean
boolean
boolean
isExpanded
(Component component) Returns true if the component occupies the maximum available space.boolean
Returns whether a required indicator should be shown.boolean
void
Removes a component from this container.void
Removes all components from this container.void
removeShortcutAction
(ShortcutAction action) void
Resets the expanded component and provides equal space for all nested components.void
setBorderVisible
(boolean borderVisible) void
setCollapsable
(boolean collapsable) void
setExpanded
(boolean expanded) void
setExpandRatio
(Component component, float ratio) Sets expand ratio for the component.void
void
setOrientation
(HasOrientation.Orientation orientation) void
setOuterMargin
(MarginInfo marginInfo) Sets margins on all sides according to the passedMarginInfo
object.void
setRequiredIndicatorVisible
(boolean visible) Sets whether a required indicator should be shown.void
setShowAsPanel
(boolean showAsPanel) Sets layout style as a Vaadin Panelvoid
setSpacing
(boolean enabled) void
setStyleName
(String name) Sets one or more style names of the component, replacing any previous styles.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, 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, 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, getWidth, getWidthSizeUnit, isEnabled, isEnabledRecursive, isResponsive, isVisible, isVisibleRecursive, removeStyleName, setAlignment, setEnabled, setHeight, setHeightAuto, setHeightFull, setId, setParent, setResponsive, setSizeAuto, setSizeFull, 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.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
Methods inherited from interface io.jmix.ui.component.HasOuterMargin
setOuterMargin, setOuterMargin
Methods inherited from interface io.jmix.ui.component.OrderedContainer
getComponentNN
-
Field Details
-
ownComponents
-
orientation
-
shortcuts
-
-
Constructor Details
-
GroupBoxImpl
public GroupBoxImpl()
-
-
Method Details
-
createComponent
-
initComponent
-
afterPropertiesSet
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
Exception
-
add
Description copied from interface:ComponentContainer
Adds a component to this container.- Specified by:
add
in interfaceComponentContainer
- Parameters:
childComponent
- a component to add
-
add
- Specified by:
add
in interfaceOrderedContainer
-
indexOf
- Specified by:
indexOf
in interfaceOrderedContainer
-
getComponent
Description copied from interface:OrderedContainer
Returns the component at the given position.- Specified by:
getComponent
in interfaceOrderedContainer
- Parameters:
index
- component index- Returns:
- the component at the given index or null.
-
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<JmixGroupBox>
-
getComponentContent
protected com.vaadin.ui.AbstractOrderedLayout getComponentContent() -
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
-
expand
Description copied from interface:ExpandingLayout
Specifies the component that will be given maximum available space.- Specified by:
expand
in interfaceExpandingLayout
- Parameters:
childComponent
- the component
-
resetExpanded
public void resetExpanded()Description copied from interface:ExpandingLayout
Resets the expanded component and provides equal space for all nested components.- Specified by:
resetExpanded
in interfaceExpandingLayout
-
isExpanded
Description copied from interface:ExpandingLayout
Returns true if the component occupies the maximum available space.- Specified by:
isExpanded
in interfaceExpandingLayout
- Parameters:
component
- component to check- Returns:
- true if the component occupies the maximum available space
-
isExpanded
public boolean isExpanded()- Specified by:
isExpanded
in interfaceCollapsable
-
getExpandDirection
- Specified by:
getExpandDirection
in interfaceExpandingLayout
- Returns:
- expand direction
- See Also:
-
setExpanded
public void setExpanded(boolean expanded) - Specified by:
setExpanded
in interfaceCollapsable
-
isCollapsable
public boolean isCollapsable()- Specified by:
isCollapsable
in interfaceCollapsable
-
setCollapsable
public void setCollapsable(boolean collapsable) - Specified by:
setCollapsable
in interfaceCollapsable
-
addExpandedStateChangeListener
public Subscription addExpandedStateChangeListener(Consumer<Collapsable.ExpandedStateChangeEvent> listener) - Specified by:
addExpandedStateChangeListener
in interfaceCollapsable
-
fireExpandStateChange
protected void fireExpandStateChange(boolean expanded, boolean invokedByUser) -
isBorderVisible
public boolean isBorderVisible()- Specified by:
isBorderVisible
in interfaceHasBorder
-
setBorderVisible
public void setBorderVisible(boolean borderVisible) - Specified by:
setBorderVisible
in interfaceHasBorder
-
setSpacing
public void setSpacing(boolean enabled) - Specified by:
setSpacing
in interfaceHasSpacing
-
getSpacing
public boolean getSpacing()- Specified by:
getSpacing
in interfaceHasSpacing
-
getOrientation
- Specified by:
getOrientation
in interfaceHasOrientation
-
setOrientation
- Specified by:
setOrientation
in interfaceHasOrientation
-
setShowAsPanel
public void setShowAsPanel(boolean showAsPanel) Description copied from interface:GroupBoxLayout
Sets layout style as a Vaadin Panel- Specified by:
setShowAsPanel
in interfaceGroupBoxLayout
- Parameters:
showAsPanel
- whether the layout should appear as a Vaadin Panel
-
isShowAsPanel
public boolean isShowAsPanel()- Specified by:
isShowAsPanel
in interfaceGroupBoxLayout
- Returns:
- true if layout looks like Vaadin Panel
-
setStyleName
Description copied from interface:Component
Sets one or more style names of the component, replacing any previous styles. Multiple styles can be specified as a space-separated list of style names. Styles implementation is client-type-specific.- Specified by:
setStyleName
in interfaceComponent
- Overrides:
setStyleName
in classAbstractComponent<JmixGroupBox>
- Parameters:
name
- one or more style names separated by space.
-
getStyleName
Description copied from interface:Component
Styles implementation is client-type-specific.- Specified by:
getStyleName
in interfaceComponent
- Overrides:
getStyleName
in classAbstractComponent<JmixGroupBox>
- Returns:
- current style name.
-
addShortcutAction
- Specified by:
addShortcutAction
in interfaceShortcutNotifier
-
removeShortcutAction
- Specified by:
removeShortcutAction
in interfaceShortcutNotifier
-
setOuterMargin
Description copied from interface:HasOuterMargin
Sets margins on all sides according to the passedMarginInfo
object.- Specified by:
setOuterMargin
in interfaceHasOuterMargin
- Parameters:
marginInfo
- theMarginInfo
object that describes the margin settings for each side of a Component.
-
getOuterMargin
- Specified by:
getOuterMargin
in interfaceHasOuterMargin
- Returns:
- the
MarginInfo
object that describes the margin settings for each side of a Component.
-
setExpandRatio
Description copied from interface:SupportsExpandRatio
Sets expand ratio for the component. The ratio must be greater than or equal to 0.- Specified by:
setExpandRatio
in interfaceSupportsExpandRatio
- Parameters:
component
- component to expand with ratioratio
- ratio
-
getExpandRatio
- Specified by:
getExpandRatio
in interfaceSupportsExpandRatio
- Parameters:
component
- component for which returns ratio- Returns:
- ratio for the component, 0.0f by default
-
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<JmixGroupBox>
-
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<JmixGroupBox>
-