nl.gx.webmanager.springmvc.panel
Class PanelTabset

java.lang.Object
  extended by nl.gx.webmanager.springmvc.FormBindableBase
      extended by nl.gx.webmanager.springmvc.panel.PanelTabset
All Implemented Interfaces:
DelegatedController, DelegatedControllerAware

public class PanelTabset
extends FormBindableBase

Set of tabs in a panel, of in a panelTab.

Author:
arjans

Field Summary
static java.lang.String LEVEL1_HORIZONTAL
           
static java.lang.String LEVEL1_VERTICAL
           
static java.lang.String LEVEL2_HORIZONTAL
           
static java.lang.String LEVEL2_VERTICAL
           
 
Fields inherited from class nl.gx.webmanager.springmvc.FormBindableBase
editViews
 
Constructor Summary
PanelTabset()
          default constructor initialises the editviews.
 
Method Summary
 void addPanelTab(PanelTab panelTab)
          Adds a panelTab to the collection of tab this set is holding.
 PanelTab findPanelTab(java.lang.String tabId)
          retuens the panelTab with the provided tabId.
 PanelTabFBO findPanelViewCommand(java.lang.String tabId)
          returns the panelview command for the tab with the givven tabId (f found) if the a tab woth the given Id is found, but doesn;t have a panelCiewCommand the panelViewCommand of the cerruntly selected subTab is returned (if exists).
 PanelTab getFirstTabFromIndex(int index, boolean ascending)
          Returns the first tab that can be found from the given index that can be used, returns null if no tab can be found.
 PanelTab getNextTab()
          Returns the next tab after the current tab that can be used.
 int getNumberOfTabs()
          returns the number of tabs in this tabset.
 PanelTab[] getPanelTabs()
          Returns collection containing all accessible and inaccessible tabs that are shown always of the tabset.
protected  PanelTabFBO getPanelViewCommandForSelectedTab()
          returns the panelViewCommand for the currently active tab if the active (main) tab doesn't have a panelViewCommand, the panelViewCommand of the underlaying currently active subTab is returned.
 java.lang.String getPresentationName()
          set the presentationName from this tabset
 PanelTab getPreviousTab()
          Returns the first tab before the current tab that can be used.
 PanelTab getSelectedTab()
          returns the current active tab within this tabset.
 java.lang.String getSelectedTabId()
          Return the id of the selected (sub)tab.
 boolean isFirstTabSelected()
          return true if the first tab of this tabset is selected (can be by default).
 boolean isLastTabSelected()
          return true if the last tab of this tabset is selected (can be by default).
 PanelTab makePanelTab(java.lang.String tabId, java.lang.String titleKey, java.lang.String viewFileName, java.lang.String titleImage, DelegatedController controller, javax.servlet.http.HttpServletRequest request)
          creates a configured new PanelTab instance.
 void setPresentationName(java.lang.String presentationName)
          set the presentationName for this tabset
 boolean setSelectedTabById(java.lang.String tabId)
          Sets the currently active tab to the given tabId.
 
Methods inherited from class nl.gx.webmanager.springmvc.FormBindableBase
addDisallowedField, addEditView, addValidator, formBackingObject, getControllerDelegationMap, getDelegatedController, getEditView, getEditViewByValue, getParentController, getResourceBaseNames, getValidators, initBinder, initialize, onBind, onBindAndValidate, onSubmit, referenceData, setDelegatedController, setEditViews, setParentController, setValidators, showForm
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LEVEL1_HORIZONTAL

public static final java.lang.String LEVEL1_HORIZONTAL
See Also:
Constant Field Values

LEVEL1_VERTICAL

public static final java.lang.String LEVEL1_VERTICAL
See Also:
Constant Field Values

LEVEL2_HORIZONTAL

public static final java.lang.String LEVEL2_HORIZONTAL
See Also:
Constant Field Values

LEVEL2_VERTICAL

public static final java.lang.String LEVEL2_VERTICAL
See Also:
Constant Field Values
Constructor Detail

PanelTabset

public PanelTabset()
default constructor initialises the editviews.

Method Detail

setPresentationName

public void setPresentationName(java.lang.String presentationName)
set the presentationName for this tabset

Parameters:
presentationName - may be either PanelTabset.LEVEL1_HORIZONTAL, PanelTabset.LEVEL1_VERTICAL, PanelTabset.LEVEL2_HORIZONTAL or PanelTabset.LEVEL2_VERTICAL

getPresentationName

public java.lang.String getPresentationName()
set the presentationName from this tabset

Returns:
presentationName

getPanelTabs

public PanelTab[] getPanelTabs()
Returns collection containing all accessible and inaccessible tabs that are shown always of the tabset.

Returns:
collection containing all accessible and inaccessible tabs that are shown always of the tabset

getNumberOfTabs

public int getNumberOfTabs()
returns the number of tabs in this tabset.

Returns:
the number of tabs in this tabset

addPanelTab

public void addPanelTab(PanelTab panelTab)
Adds a panelTab to the collection of tab this set is holding.

Parameters:
panelTab - panelTab to add

getPanelViewCommandForSelectedTab

protected PanelTabFBO getPanelViewCommandForSelectedTab()
returns the panelViewCommand for the currently active tab if the active (main) tab doesn't have a panelViewCommand, the panelViewCommand of the underlaying currently active subTab is returned.

Returns:
panelViewCommand for the requested tabid

setSelectedTabById

public boolean setSelectedTabById(java.lang.String tabId)
Sets the currently active tab to the given tabId. incase a tabId of a subtab is provided, the maintab of the active subTab is also set to active

Parameters:
tabId - tabId of the tab to be set active (main or sub-tab)
Returns:
true if the provided tabId was in this tabset (or underliying tabsets)

getSelectedTabId

public java.lang.String getSelectedTabId()
Return the id of the selected (sub)tab.

Returns:
the id of the selected (sub)tab

getSelectedTab

public PanelTab getSelectedTab()
returns the current active tab within this tabset. if no tabId was set active, the first tab of this set is assumed to be active

Returns:
the current active tab in this tabset null is tis set is empty

findPanelTab

public PanelTab findPanelTab(java.lang.String tabId)
retuens the panelTab with the provided tabId. seach is performen within this tabset and the sub-tabsets

Parameters:
tabId - tabId
Returns:
panelTab with the provided tabId null if not found

findPanelViewCommand

public PanelTabFBO findPanelViewCommand(java.lang.String tabId)
returns the panelview command for the tab with the givven tabId (f found) if the a tab woth the given Id is found, but doesn;t have a panelCiewCommand the panelViewCommand of the cerruntly selected subTab is returned (if exists).

Parameters:
tabId - tabId
Returns:
PanelViewCommand for the panelTab with the provided tabId (if null for the tab with the given id, panelViewCommand for of the subTab is returned) null if tabId is not found

getNextTab

public PanelTab getNextTab()
Returns the next tab after the current tab that can be used. If no tab after the current tab can be used the current tab is returned.

Returns:
the next tab after the current tab that can be used. If no tab after the current tab can be used the current tab is returned

getFirstTabFromIndex

public PanelTab getFirstTabFromIndex(int index,
                                     boolean ascending)
Returns the first tab that can be found from the given index that can be used, returns null if no tab can be found.

Parameters:
index - Index from which is searched
ascending - Search direction
Returns:
the first tab that can be found from the given index that can be used, returns null if no tab can be found

getPreviousTab

public PanelTab getPreviousTab()
Returns the first tab before the current tab that can be used. If no tab before the current tab can be used the current tab is returned.

Returns:
the first tab before the current tab that can be used. If no tab before the current tab can be used the current tab is returned

isFirstTabSelected

public boolean isFirstTabSelected()
return true if the first tab of this tabset is selected (can be by default).

Returns:
true if the first tab of this tabset is selected

isLastTabSelected

public boolean isLastTabSelected()
return true if the last tab of this tabset is selected (can be by default).

Returns:
true if the last tab of this tabset is selected

makePanelTab

public PanelTab makePanelTab(java.lang.String tabId,
                             java.lang.String titleKey,
                             java.lang.String viewFileName,
                             java.lang.String titleImage,
                             DelegatedController controller,
                             javax.servlet.http.HttpServletRequest request)
creates a configured new PanelTab instance.

Parameters:
tabId - unique tabId in this panale configuration
titleKey - resourcebundle key for the tab title
viewFileName - viewname for this tab, may be null
titleImage - TitleImage of the tab, not shown if null
panelViewCommandClass - command for this tab, may be null
Returns:
the configured PanelTab instance null in case of configuration errors


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