com.sun.webui.jsf.component
Class TabContainer

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by com.sun.webui.jsf.component.WebuiComponent
              extended by com.sun.webui.jsf.component.TabContainer
All Implemented Interfaces:
javax.faces.component.NamingContainer, javax.faces.component.StateHolder
Direct Known Subclasses:
Accordion

public class TabContainer
extends WebuiComponent
implements javax.faces.component.NamingContainer

A container for one or more tabs, accordion tabs or menu item components. The currently selected element is specified via the selected property, which may be bound to a model value. Action listeners may be registered individually with a contained element; or, an action listener may be registered with the containing TabContainer, in which case it is notified of all tab selection actions. Each tab in the container can have arbitrary HTML elements or components or a combination of both. Typically a single tab or the entire container would go through the JSF lifecycle during an XHR request. However, in cases where a form with a contianer component is submitted the container and all its child components will go through the JSF lifecycle as usual. It is up to the application to decide what should be done in this scenario.


Field Summary
 
Fields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR
 
Constructor Summary
TabContainer()
          Create a new instance of the TabContainer.
 
Method Summary
static TabContent findChildTab(TabContent tab, java.lang.String tabId)
          Returns the tab with the id specified that is a child of the tab specified.
 java.lang.String getFamily()
          Return the family for this component.
 java.lang.String getHtmlTemplate()
          Get alternative HTML template to be used by this component.
 TabContent[] getSelectedTabs()
          Return an array of selected tab content.
 java.lang.String getStyle()
          CSS style or styles to be applied to the outermost HTML element when this component is rendered.
 java.lang.String getStyleClass()
          CSS style class(es) to be applied to the outermost HTML element when this component is rendered.
 int getTabIndex()
          Position of this element in the tabbing order of the current document.
 boolean isLoadOnSelect()
          Returns true if the tab should be loaded on select, false otherwise.
 boolean isVisible()
          Indicates whether the accordion component should be viewable by the user in the rendered HTML page.
 void restoreState(javax.faces.context.FacesContext _context, java.lang.Object _state)
          Restore the state of this component.
 java.lang.Object saveState(javax.faces.context.FacesContext _context)
          Save the state of this component.
 void setHtmlTemplate(java.lang.String htmlTemplate)
          Set alternative HTML template to be used by this component.
 void setLoadOnSelect(boolean loadOnSelect)
          Set to true if tabs should be loaded when selected.
 void setSelectedTab(TabContent selectedTab)
          Set the selected flag on the tab that is currently selected and unselect the previously selected tab.
 void setSelectedTabs(TabContent[] selectedTabs)
          Set the array of selected tabs.
 void setStyle(java.lang.String style)
          CSS style(s) to be applied to the outermost HTML element when this component is rendered.
 void setStyleClass(java.lang.String styleClass)
          CSS style class(es) to be applied to the outermost HTML element when this component is rendered.
 void setTabIndex(int tabIndex)
          Position of this element in the tabbing order of the current document.
 void setVisible(boolean visible)
          Set the visible attribute.
 
Methods inherited from class com.sun.webui.jsf.component.WebuiComponent
processDecodes, processUpdates, processValidators, setId, setRendered
 
Methods inherited from class javax.faces.component.UIComponentBase
broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRendererType, getRendersChildren, getValueBinding, getValueExpression, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, restoreAttachedState, saveAttachedState, setParent, setRendererType, setTransient, setValueBinding, setValueExpression
 
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TabContainer

public TabContainer()
Create a new instance of the TabContainer.

Method Detail

getFamily

public java.lang.String getFamily()

Return the family for this component.

Specified by:
getFamily in class javax.faces.component.UIComponent

getTabIndex

public int getTabIndex()

Position of this element in the tabbing order of the current document. Tabbing order determines the sequence in which elements receive focus when the tab key is pressed. The value must be an integer between 0 and 32767.


setTabIndex

public void setTabIndex(int tabIndex)

Position of this element in the tabbing order of the current document. Tabbing order determines the sequence in which elements receive focus when the tab key is pressed. The value must be an integer between 0 and 32767.

See Also:
getTabIndex()

getHtmlTemplate

public java.lang.String getHtmlTemplate()
Get alternative HTML template to be used by this component.


setHtmlTemplate

public void setHtmlTemplate(java.lang.String htmlTemplate)
Set alternative HTML template to be used by this component.


isLoadOnSelect

public boolean isLoadOnSelect()
Returns true if the tab should be loaded on select, false otherwise. This value is false by default.


setLoadOnSelect

public void setLoadOnSelect(boolean loadOnSelect)
Set to true if tabs should be loaded when selected.


getStyle

public java.lang.String getStyle()
CSS style or styles to be applied to the outermost HTML element when this component is rendered.


setStyle

public void setStyle(java.lang.String style)
CSS style(s) to be applied to the outermost HTML element when this component is rendered.

See Also:
getStyle()

getStyleClass

public java.lang.String getStyleClass()
CSS style class(es) to be applied to the outermost HTML element when this component is rendered.


setStyleClass

public void setStyleClass(java.lang.String styleClass)
CSS style class(es) to be applied to the outermost HTML element when this component is rendered.

See Also:
getStyleClass()

isVisible

public boolean isVisible()

Indicates whether the accordion component should be viewable by the user in the rendered HTML page. If set to false, the HTML code for the component is present in the page, but the component is hidden with style attributes. By default, this setting is true, so HTML for the component is included and visible to the user. If the accordion component is not visible, it can still be processed on subsequent form submissions because the HTML is present.


setVisible

public void setVisible(boolean visible)

Set the visible attribute.

See Also:
isVisible()

getSelectedTabs

public TabContent[] getSelectedTabs()
Return an array of selected tab content. If no tabs are selected an empty array is returned.


setSelectedTabs

public void setSelectedTabs(TabContent[] selectedTabs)
Set the array of selected tabs.


setSelectedTab

public void setSelectedTab(TabContent selectedTab)
Set the selected flag on the tab that is currently selected and unselect the previously selected tab. This is being done to maintain the same selected state on the client and server side. This method should only be called in the case of tab containers configured for single selection.


findChildTab

public static TabContent findChildTab(TabContent tab,
                                      java.lang.String tabId)
Returns the tab with the id specified that is a child of the tab specified. If no such descendant tab exists, returns null. If the tab specified contains more than one tab with the same id, the tab returned will be the first encountered in document order.


restoreState

public void restoreState(javax.faces.context.FacesContext _context,
                         java.lang.Object _state)
Restore the state of this component.

Specified by:
restoreState in interface javax.faces.component.StateHolder
Overrides:
restoreState in class javax.faces.component.UIComponentBase

saveState

public java.lang.Object saveState(javax.faces.context.FacesContext _context)
Save the state of this component.

Specified by:
saveState in interface javax.faces.component.StateHolder
Overrides:
saveState in class javax.faces.component.UIComponentBase


Copyright © 2008 Sun Microsystems, Inc. All Rights Reserved.