nl.gx.webmanager.springmvc.panel
Class PanelTab

java.lang.Object
  extended by nl.gx.webmanager.springmvc.panel.PanelTab

public class PanelTab
extends java.lang.Object

Properties for a tab in a tabset on a panel.

Author:
arjans

Constructor Summary
PanelTab(PanelTabset parentTabset, java.lang.String tabId, java.lang.String titleKey, java.lang.String titleImage, PanelTabFBO tabPanelViewCommand, DelegatedController controller)
          Constructor for a PanelTab with sets the PanelViewCommand and title of the tab.
 
Method Summary
 PanelTab addSubTab(java.lang.String tabId, java.lang.String titleKey, java.lang.String viewFileName, DelegatedController controller, javax.servlet.http.HttpServletRequest request)
          Adds a subtab to this tab.
 PanelTab addSubTab(java.lang.String tabId, java.lang.String titleKey, java.lang.String titleImage, java.lang.String viewFileName, DelegatedController controller, java.lang.String presentationName, javax.servlet.http.HttpServletRequest request)
          Adds a subtab to this tab.
 boolean checkAccess()
          Returns true if the current user has access to this tab.
 DelegatedController getController()
          Returns the controller for this panel tab
 PanelTabFBO getPanelViewCommand()
          Returns the PanelViewCommand exposed by the tab.
 PanelTabset getParentTabset()
           
 java.lang.String getRequiredPermission()
          Returns the value of the permission required to use this tab.
 PanelTabset getSubTabset()
          returns the tabset holding the subtabs for this tab.
 java.lang.String getTabId()
          Returns the unique ID of the tab (within this tabset).
 java.lang.String getTitle()
          Returns the title of the tab, independent of locale
 java.lang.String getTitleImage()
          Returns the titleImage of the tab.
 java.lang.String getTitleKey()
          Returns the title of the tab.
 boolean isShowAllways()
          Returns true if the tab may be shown disabled when its not available for usage.
 void setController(DelegatedController controller)
          Sets the controller for this panel tab
 void setParentTabset(PanelTabset parentTabset)
           
 void setRequiredPermission(java.lang.String permission)
          Sets the permission that is required to use this tab.
 void setRequiredPermission(java.lang.String permission, boolean showAllways)
          Sets the permission that is required to use this tab.
 void setSubTabset(PanelTabset panelTabset)
          sets the tabset holding the subtabs for this tab.
 void setTitle(java.lang.String title)
          Sets the title of the tab, independent of locale
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PanelTab

public PanelTab(PanelTabset parentTabset,
                java.lang.String tabId,
                java.lang.String titleKey,
                java.lang.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 java.lang.String getTitleKey()
Returns the title of the tab.

Returns:
the title of the tab.

setTitle

public void setTitle(java.lang.String title)
Sets the title of the tab, independent of locale

Parameters:
title - Title of the tab

getTitle

public java.lang.String getTitle()
Returns the title of the tab, independent of locale

Returns:
Title of the tab

getTitleImage

public java.lang.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 java.lang.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(java.lang.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(java.lang.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 java.lang.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(java.lang.String tabId,
                          java.lang.String titleKey,
                          java.lang.String titleImage,
                          java.lang.String viewFileName,
                          DelegatedController controller,
                          java.lang.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(java.lang.String tabId,
                          java.lang.String titleKey,
                          java.lang.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()
Returns:
the parentTabset

setParentTabset

public void setParentTabset(PanelTabset parentTabset)
Parameters:
parentTabset - the parentTabset to set


Copyright © 2007-2011 GX Software BV. All Rights Reserved.