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

  • Field Details

  • Constructor Details

    • TabSheetImpl

      public TabSheetImpl()
  • Method Details

    • createComponent

      protected JmixTabSheet createComponent()
    • getLazyTabs

      protected Set<com.vaadin.ui.Component> getLazyTabs()
    • add

      public void add(Component component)
      Description copied from interface: ComponentContainer
      Adds a component to this container.
      Specified by:
      add in interface ComponentContainer
      Parameters:
      component - a component to add
    • remove

      public void remove(Component component)
      Description copied from interface: ComponentContainer
      Removes a component from this container.
      Specified by:
      remove in interface ComponentContainer
      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 interface ComponentContainer
    • getOwnComponent

      @Nullable public Component getOwnComponent(String id)
      Description copied from interface: HasComponents
      Gets component directly owned by this container.
      Specified by:
      getOwnComponent in interface HasComponents
      Returns:
      component or null if not found
    • getComponent

      @Nullable public Component getComponent(String id)
      Description copied from interface: HasComponents
      Gets a component belonging to the whole components tree below this container.
      Specified by:
      getComponent in interface HasComponents
      Returns:
      component or null if not found
    • getOwnComponents

      public Collection<Component> getOwnComponents()
      Description copied from interface: HasComponents
      Gets all components directly owned by this container.
      Specified by:
      getOwnComponents in interface HasComponents
      Returns:
      all components directly owned by this container
    • getOwnComponentsStream

      public Stream<Component> getOwnComponentsStream()
      Description copied from interface: HasComponents
      Gets stream of all components directly owned by this container.
      Specified by:
      getOwnComponentsStream in interface HasComponents
      Returns:
      stream of all components directly owned by this container
    • getComponents

      public Collection<Component> getComponents()
      Description copied from interface: HasComponents
      Gets all components belonging to the whole components tree below this container.
      Specified by:
      getComponents in interface HasComponents
      Returns:
      all components belonging to the whole components tree below this container
    • applyPermission

      public void applyPermission(UiPermissionDescriptor permissionDescriptor)
      Description copied from interface: UiPermissionAware
      Change state of subcomponent according to the permissionValue.
      Specified by:
      applyPermission in interface UiPermissionAware
      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 interface Component.Focusable
    • getTabIndex

      public int getTabIndex()
      Description copied from interface: Component.Focusable
      Gets the tabulator index of the HasTabIndex component.
      Specified by:
      getTabIndex in interface Component.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 the Focusable 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 interface Component.Focusable
      Parameters:
      tabIndex - tab index
    • setChildSelected

      public void setChildSelected(Component childComponent)
      Specified by:
      setChildSelected in interface SupportsChildrenSelection
    • isChildSelected

      public boolean isChildSelected(Component component)
      Specified by:
      isChildSelected in interface SupportsChildrenSelection
    • addTab

      public TabSheet.Tab addTab(String name, Component childComponent)
      Description copied from interface: TabSheet
      Adds a new tab to the component.
      Specified by:
      addTab in interface TabSheet
      Parameters:
      name - id of the new tab
      childComponent - a component that will be the content of the new tab
      Returns:
      the new tab
    • setDebugId

      public void setDebugId(@Nullable String id)
      Description copied from interface: HasDebugId
      INTERNAL. Managed by debug Id system.
      Specified by:
      setDebugId in interface HasDebugId
      Overrides:
      setDebugId in class AbstractComponent<JmixTabSheet>
    • addLazyTab

      public TabSheet.Tab addLazyTab(String name, org.dom4j.Element descriptor, ComponentLoader loader)
      Description copied from interface: TabSheet
      INTERNAL. Adds a new lazy tab to the component.
      Specified by:
      addLazyTab in interface TabSheet
      Parameters:
      name - id of the new tab
      descriptor - the element descriptor
      loader - the component loader
      Returns:
      the new tab
    • createLazyTabLayout

      protected CssLayout createLazyTabLayout()
    • removeTab

      public void removeTab(String name)
      Description copied from interface: TabSheet
      Removes a tab.
      Specified by:
      removeTab in interface TabSheet
      Parameters:
      name - id of the tab to remove
    • removeAllTabs

      public void removeAllTabs()
      Description copied from interface: TabSheet
      Removes all tabs.
      Specified by:
      removeAllTabs in interface TabSheet
    • setFrame

      public void setFrame(@Nullable Frame frame)
      Specified by:
      setFrame in interface Component.BelongToFrame
      Overrides:
      setFrame in class AbstractComponent<JmixTabSheet>
    • getSelectedTab

      @Nullable public TabSheetImpl.Tab 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 interface TabSheet
      Returns:
      a selected tab instance
    • setSelectedTab

      public void setSelectedTab(TabSheet.Tab tab)
      Description copied from interface: TabSheet
      Sets selected tab.
      Specified by:
      setSelectedTab in interface TabSheet
      Parameters:
      tab - tab instance
    • setSelectedTab

      public void setSelectedTab(String name)
      Description copied from interface: TabSheet
      Sets selected tab.
      Specified by:
      setSelectedTab in interface TabSheet
      Parameters:
      name - tab id
    • getTab

      @Nullable public TabSheet.Tab getTab(String name)
      Description copied from interface: TabSheet
      Gets tab with the provided id.
      Specified by:
      getTab in interface TabSheet
      Parameters:
      name - tab id
      Returns:
      tab instance
    • getTabComponent

      public Component getTabComponent(String name)
      Description copied from interface: TabSheet
      Gets a component that is a content of the tab.
      Specified by:
      getTabComponent in interface TabSheet
      Parameters:
      name - tab id
      Returns:
      tab content
    • getTabs

      public Collection<TabSheet.Tab> getTabs()
      Description copied from interface: TabSheet
      Gets all tabs.
      Specified by:
      getTabs in interface TabSheet
      Returns:
      the collection of tab instances
    • isTabCaptionsAsHtml

      public boolean isTabCaptionsAsHtml()
      Specified by:
      isTabCaptionsAsHtml in interface TabSheet
      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 interface TabSheet
      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 interface TabSheet
      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 interface TabSheet
      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 interface TabSheet
      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 interface AttachNotifier
      Overrides:
      attached in class AbstractComponent<JmixTabSheet>
    • detached

      public void detached()
      Description copied from interface: AttachNotifier
      Notifies all listeners that component has been detached.
      Specified by:
      detached in interface AttachNotifier
      Overrides:
      detached in class AbstractComponent<JmixTabSheet>
    • fireTabChanged

      protected void fireTabChanged(TabSheet.SelectedTabChangeEvent event)
    • createLazyTabChangeListener

      protected TabSheetImpl.LazyTabChangeListener createLazyTabChangeListener(ComponentContainer tabContent, org.dom4j.Element descriptor, ComponentLoader loader)