Class PanelTab


  • public class PanelTab
    extends Object
    Properties for a tab in a tabset on a panel.
    • Constructor Detail

      • PanelTab

        public PanelTab​(PanelTabset parentTabset,
                        String tabId,
                        String titleKey,
                        String titleImage,
                        PanelTabFBO tabPanelViewCommand,
                        DelegatedController controller)
        Constructor for a PanelTab with sets the PanelViewCommand and title of the tab.
        Parameters:
        tabId - unique ID of thei tab
        titleKey - Title of the tab, not shown if null
        titleImage - TitleImage of the tab, not shown if null
        tabPanelViewCommand - PanelViewCommand object the tab exposes
    • Method Detail

      • getTitleKey

        public String getTitleKey()
        Returns the title of the tab.
        Returns:
        the title of the tab.
      • setTitle

        public void setTitle​(String title)
        Sets the title of the tab, independent of locale
        Parameters:
        title - Title of the tab
      • getTitle

        public String getTitle()
        Returns the title of the tab, independent of locale
        Returns:
        Title of the tab
      • getTitleImage

        public String getTitleImage()
        Returns the titleImage of the tab.
        Returns:
        the titleImage of the tab, null if none.
      • getPanelViewCommand

        public PanelTabFBO getPanelViewCommand()
        Returns the PanelViewCommand exposed by the tab. if the tab has nog PanelViewCommand,typical for a level1 maintab holding subtabs. the PanelViewCommand of the active subtab is returned as default for the level 1 tab.
        Returns:
        the PanelViewCommand exposed by the tab.
      • getController

        public DelegatedController getController()
        Returns the controller for this panel tab.
        Returns:
        Controller for this panel tab
      • setController

        public void setController​(DelegatedController controller)
        Sets the controller for this panel tab.
        Parameters:
        The - controller for this panel tab
      • getTabId

        public String getTabId()
        Returns the unique ID of the tab (within this tabset).
        Returns:
        the Id of the tab.
      • getSubTabset

        public PanelTabset getSubTabset()
        Returns the tabset holding the subtabs for this tab. Null if ths tab has no sub-tabs.
        Returns:
        the tabset holding the subtabs for this tab. Null if ths tab has no sub-tabs
      • setSubTabset

        public void setSubTabset​(PanelTabset panelTabset)
        Sets the tabset holding the subtabs for this tab. Null if ths tab has no sub-tabs.
        Parameters:
        panelTabset - the tabset holding the subtabs for this tab. Null if ths tab has no sub-tabs.
      • setRequiredPermission

        public void setRequiredPermission​(String permission)
        Sets the permission that is required to use this tab. If you have no permission to use the tab the tab isn't shown.
        Parameters:
        permission - The value of the required permission
      • setRequiredPermission

        public void setRequiredPermission​(String permission,
                                          boolean showAllways)
        Sets the permission that is required to use this tab. If you have no permission to use the tab the tab is shown disabled if showAllways is true, otherwise it is not shown at all.
        Parameters:
        permission - The value of the required permission
        showAllways - If true the tab is shown disabled even if you have no permission to use it
      • getRequiredPermission

        public String getRequiredPermission()
        Returns the value of the permission required to use this tab.
        Returns:
        the value of the permission required to use this tab
      • isShowAllways

        public boolean isShowAllways()
        Returns true if the tab may be shown disabled when its not available for usage.
        Returns:
        true if the tab may be shown disabled when its not available for usage
      • checkAccess

        public boolean checkAccess()
        Returns true if the current user has access to this tab.
        Returns:
        true if the current user has access to this tab
      • addSubTab

        public PanelTab addSubTab​(String tabId,
                                  String titleKey,
                                  String titleImage,
                                  String viewFileName,
                                  DelegatedController controller,
                                  String presentationName,
                                  javax.servlet.http.HttpServletRequest request)
        Adds a subtab to this tab.
        Parameters:
        tabId - unique tabId within the panel containing this tab
        titleKey - resourcebundle key for the tab title
        titleImage - image shown as title, not shown if empty
        viewFileName - view file form this tab
        panelViewCommandClass - must be null if the panelViewCommandClass holds a valid command (not null) that the subtabs operate as views on the command of the mainTab may not be null, if the panelViewCommandClass of the maintab is not set (== null)
        presentationName - may be either PanelTabset.LEVEL1_HORIZONTAL, PanelTabset.LEVEL1_VERTICAL, PanelTabset.LEVEL2_HORIZONTAL, PanelTabset.LEVEL2_VERTICAL or null if the presentationName should not changed or the default should be set in case none is set.
        Returns:
        the configured PanelTab instance null in case of configuration errors
      • addSubTab

        public PanelTab addSubTab​(String tabId,
                                  String titleKey,
                                  String viewFileName,
                                  DelegatedController controller,
                                  javax.servlet.http.HttpServletRequest request)
        Adds a subtab to this tab.
        Parameters:
        tabId - unique tabId within the panel containing this tab
        titleKey - resourcebundle key for the tab title
        viewFileName - view file form this tab
        panelViewCommandClass - must be null if the panelViewCommandClass holds a valid command (not null) that the subtabs operate as views on the command of the mainTab may not be null, if the panelViewCommandClass of the maintab is not set (== null)
        Returns:
        the configured PanelTab instance null in case of configuration errors
      • getParentTabset

        public PanelTabset getParentTabset()
      • setParentTabset

        public void setParentTabset​(PanelTabset parentTabset)