Package io.jmix.ui.component.impl
Class TabSheetImpl
- All Implemented Interfaces:
AttachNotifier
,Component
,Component.BelongToFrame
,Component.Focusable
,Component.HasCaption
,Component.HasDescription
,Component.HasIcon
,Component.HasXmlDescriptor
,Component.Wrapper
,ComponentContainer
,HasComponents
,HasContextHelp
,HasDebugId
,HasHtmlCaption
,HasHtmlDescription
,HasHtmlSanitizer
,SupportsChildrenSelection
,TabSheet
,UiPermissionAware
public class TabSheetImpl
extends AbstractComponent<JmixTabSheet>
implements TabSheet, UiPermissionAware, SupportsChildrenSelection
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
protected class
protected class
protected 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.TabSheet
TabSheet.SelectedTabChangeEvent, TabSheet.TabCloseHandler
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
protected ComponentLoader.Context
protected IconResolver
protected Icons
protected Set<com.vaadin.ui.Component>
protected boolean
protected ScreenSettingsFacetResolver
protected Map<com.vaadin.ui.Component,
TabSheetImpl.ComponentDescriptor> protected Map<String,
TabSheetImpl.Tab> protected UiComponents
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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a component to this container.addLazyTab
(String name, org.dom4j.Element descriptor, ComponentLoader loader) INTERNAL.Adds a listener that will be notified when a selected tab is changed.Adds a new tab to the component.void
applyPermission
(UiPermissionDescriptor permissionDescriptor) Change state of subcomponent according to thepermissionValue
.void
attached()
Notifies all listeners that component has been attached.protected void
protected JmixTabSheet
protected TabSheetImpl.LazyTabChangeListener
createLazyTabChangeListener
(ComponentContainer tabContent, org.dom4j.Element descriptor, ComponentLoader loader) protected CssLayout
void
detached()
Notifies all listeners that component has been detached.protected void
void
focus()
Sets focus to this componentgetComponent
(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.protected Set<com.vaadin.ui.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.Gets selected tab.Gets tab with the provided id.getTabComponent
(String name) Gets a component that is a content of the tab.int
Gets the tabulator index of theHasTabIndex
component.getTabs()
Gets all tabs.boolean
isChildSelected
(Component component) boolean
boolean
void
Removes a component from this container.void
Removes all components from this container.void
Removes all tabs.void
Removes a tab.void
setChildSelected
(Component childComponent) void
setDebugId
(String id) INTERNAL.void
void
Sets selected tab.void
setSelectedTab
(String name) Sets selected tab.void
setTabCaptionsAsHtml
(boolean tabCaptionsAsHtml) Sets whether HTML is allowed in the tab captions.void
setTabIndex
(int tabIndex) Sets the tabulator index of theFocusable
component.void
setTabsVisible
(boolean tabsVisible) Sets whether the tab selection part should be shown in the UI.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, 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.Focusable
isFocusable, setFocusable
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
-
Field Details
-
settingsFacetResolver
-
uiComponents
-
iconResolver
-
icons
-
postInitTaskAdded
protected boolean postInitTaskAdded -
componentTabChangeListenerInitialized
protected boolean componentTabChangeListenerInitialized -
context
-
tabs
-
tabMapping
-
lazyTabs
-
-
Constructor Details
-
TabSheetImpl
public TabSheetImpl()
-
-
Method Details
-
createComponent
-
getLazyTabs
-
add
Description copied from interface:ComponentContainer
Adds a component to this container.- Specified by:
add
in interfaceComponentContainer
- Parameters:
component
- a component to add
-
remove
Description copied from interface:ComponentContainer
Removes a component from this container.- Specified by:
remove
in interfaceComponentContainer
- Parameters:
component
- a component to remove
-
removeAll
public void removeAll()Description copied from interface:ComponentContainer
Removes all components from this container.- Specified by:
removeAll
in interfaceComponentContainer
-
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
-
applyPermission
Description copied from interface:UiPermissionAware
Change state of subcomponent according to thepermissionValue
.- Specified by:
applyPermission
in interfaceUiPermissionAware
- Parameters:
permissionDescriptor
- descriptor which contains id of subcomponent and UI permission value which will be applied to this subcomponent or ids of subcomponent and its action and UI permission value which will be applied to subcomponent's action
-
focus
public void focus()Description copied from interface:Component.Focusable
Sets focus to this component- Specified by:
focus
in interfaceComponent.Focusable
-
getTabIndex
public int getTabIndex()Description copied from interface:Component.Focusable
Gets the tabulator index of theHasTabIndex
component.- Specified by:
getTabIndex
in interfaceComponent.Focusable
- Returns:
- tab index set for the
HasTabIndex
component
-
setTabIndex
public void setTabIndex(int tabIndex) Description copied from interface:Component.Focusable
Sets the tabulator index of theFocusable
component. The tab index property is used to specify the order in which the fields are focused when the user presses the Tab key. Components with a defined tab index are focused sequentially first, and then the components with no tab index.- Specified by:
setTabIndex
in interfaceComponent.Focusable
- Parameters:
tabIndex
- tab index
-
setChildSelected
- Specified by:
setChildSelected
in interfaceSupportsChildrenSelection
-
isChildSelected
- Specified by:
isChildSelected
in interfaceSupportsChildrenSelection
-
addTab
Description copied from interface:TabSheet
Adds a new tab to the component. -
setDebugId
Description copied from interface:HasDebugId
INTERNAL. Managed by debug Id system.- Specified by:
setDebugId
in interfaceHasDebugId
- Overrides:
setDebugId
in classAbstractComponent<JmixTabSheet>
-
addLazyTab
Description copied from interface:TabSheet
INTERNAL. Adds a new lazy tab to the component.- Specified by:
addLazyTab
in interfaceTabSheet
- Parameters:
name
- id of the new tabdescriptor
- the element descriptorloader
- the component loader- Returns:
- the new tab
-
createLazyTabLayout
-
removeTab
Description copied from interface:TabSheet
Removes a tab. -
removeAllTabs
public void removeAllTabs()Description copied from interface:TabSheet
Removes all tabs.- Specified by:
removeAllTabs
in interfaceTabSheet
-
setFrame
- Specified by:
setFrame
in interfaceComponent.BelongToFrame
- Overrides:
setFrame
in classAbstractComponent<JmixTabSheet>
-
getSelectedTab
Description copied from interface:TabSheet
Gets selected tab. May be null if the tabsheet does not contain tabs at all.- Specified by:
getSelectedTab
in interfaceTabSheet
- Returns:
- a selected tab instance
-
setSelectedTab
Description copied from interface:TabSheet
Sets selected tab.- Specified by:
setSelectedTab
in interfaceTabSheet
- Parameters:
tab
- tab instance
-
setSelectedTab
Description copied from interface:TabSheet
Sets selected tab.- Specified by:
setSelectedTab
in interfaceTabSheet
- Parameters:
name
- tab id
-
getTab
Description copied from interface:TabSheet
Gets tab with the provided id. -
getTabComponent
Description copied from interface:TabSheet
Gets a component that is a content of the tab.- Specified by:
getTabComponent
in interfaceTabSheet
- Parameters:
name
- tab id- Returns:
- tab content
-
getTabs
Description copied from interface:TabSheet
Gets all tabs. -
isTabCaptionsAsHtml
public boolean isTabCaptionsAsHtml()- Specified by:
isTabCaptionsAsHtml
in interfaceTabSheet
- Returns:
- true if the tab captions are rendered as HTML, false if rendered as plain text
-
setTabCaptionsAsHtml
public void setTabCaptionsAsHtml(boolean tabCaptionsAsHtml) Description copied from interface:TabSheet
Sets whether HTML is allowed in the tab captions.- Specified by:
setTabCaptionsAsHtml
in interfaceTabSheet
- Parameters:
tabCaptionsAsHtml
- true if the tab captions are rendered as HTML, false if rendered as plain text
-
isTabsVisible
public boolean isTabsVisible()- Specified by:
isTabsVisible
in interfaceTabSheet
- Returns:
- true if the tabs are shown in the UI, false otherwise
-
setTabsVisible
public void setTabsVisible(boolean tabsVisible) Description copied from interface:TabSheet
Sets whether the tab selection part should be shown in the UI.- Specified by:
setTabsVisible
in interfaceTabSheet
- Parameters:
tabsVisible
- true if the tabs should be shown in the UI, false otherwise
-
checkFrameInitialization
protected void checkFrameInitialization() -
addSelectedTabChangeListener
public Subscription addSelectedTabChangeListener(Consumer<TabSheet.SelectedTabChangeEvent> listener) Description copied from interface:TabSheet
Adds a listener that will be notified when a selected tab is changed.- Specified by:
addSelectedTabChangeListener
in interfaceTabSheet
- Parameters:
listener
- a listener to add- Returns:
- a registration object for removing an event 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<JmixTabSheet>
-
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<JmixTabSheet>
-
fireTabChanged
-
createLazyTabChangeListener
protected TabSheetImpl.LazyTabChangeListener createLazyTabChangeListener(ComponentContainer tabContent, org.dom4j.Element descriptor, ComponentLoader loader)
-