com.sun.webui.jsf.component
Class TabContent

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.TabContent
All Implemented Interfaces:
javax.faces.component.NamingContainer, javax.faces.component.StateHolder
Direct Known Subclasses:
AccordionTab

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

The TabContent component represents one tab in a TabContainer. TabContent must be a child of a TabContainer, or of another TabContent. Each TabContent has a title and content. The content can be an aribitrary set of components or some HTML markup or both. The component traverses the JSF lifecycle when the container is refreshed, the component itself is refreshed or the page containing the cotainer (hence, the component) is submitted.


Field Summary
 
Fields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR
 
Constructor Summary
TabContent()
          Create a new instance of TabContent.
TabContent(java.lang.String title)
          Create a new instance of TabContent with the text property set to the value specified.
 
Method Summary
 java.lang.String getFamily()
          Return the family for this component.
 java.lang.String getHtmlTemplate()
          Get alternative HTML template to be used by this component.
 java.lang.String getRendererType()
          Return the renderer type associated with this component.
 java.lang.String getStyle()
          CSS style(s) to be applied to the outermost div tag of the Tab's title.
 java.lang.String getStyleClass()
          Returns the CSS style class(es) that have been applied to the outermost HTML element of the Tab title.
 int getTabChildCount()
          Returns the number of children of this tab that are themselves tabs.
 java.util.List<TabContent> getTabChildren()
          Returns a list of all children of this tab that are themselves tabs.
 TabContainer getTabContainer(TabContent tab)
          Utility method that returns the tabContainer instance that contains the tab specified.
 java.lang.String getTitle()
          Return the title for this tab.
 boolean isSelected()
          Returns true if the tab is selected.
 boolean isVisible()
          Use the visible attribute to indicate whether the 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 setSelected(boolean selected)
          Set to true if this tab should be selected.
 void setSelectedTab(TabContent selectedTab)
          Set the selected flag on the tab that is currently selected and unselect the previously selected tab.
 void setStyle(java.lang.String style)
          CSS style or styles to be applied to the outermost div tag of the Tab title
 void setStyleClass(java.lang.String styleClass)
          CSS style class(es) to be applied to the outermost HTML element of the TabContent.
 void setTitle(java.lang.String title)
          Set the title for this tab.
 void setVisible(boolean visible)
          Use the visible attribute to indicate whether the component should be viewable by the user in the rendered HTML page.
 
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, 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

TabContent

public TabContent()
Create a new instance of TabContent.


TabContent

public TabContent(java.lang.String title)
Create a new instance of TabContent with the text property set to the value specified.

Method Detail

getFamily

public java.lang.String getFamily()

Return the family for this component.

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

getRendererType

public java.lang.String getRendererType()

Return the renderer type associated with this component.

Overrides:
getRendererType in class javax.faces.component.UIComponentBase

getTitle

public java.lang.String getTitle()
Return the title for this tab.


setTitle

public void setTitle(java.lang.String title)
Set the title for this tab.


isSelected

public boolean isSelected()
Returns true if the tab is selected.


setSelected

public void setSelected(boolean selected)
Set to true if this tab should be selected.


getTabChildCount

public int getTabChildCount()
Returns the number of children of this tab that are themselves tabs.


getTabChildren

public java.util.List<TabContent> getTabChildren()
Returns a list of all children of this tab that are themselves 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.


getStyle

public java.lang.String getStyle()
CSS style(s) to be applied to the outermost div tag of the Tab's title.


setStyle

public void setStyle(java.lang.String style)
CSS style or styles to be applied to the outermost div tag of the Tab title


getStyleClass

public java.lang.String getStyleClass()
Returns the CSS style class(es) that have been applied to the outermost HTML element of the Tab title.


setStyleClass

public void setStyleClass(java.lang.String styleClass)
CSS style class(es) to be applied to the outermost HTML element of the TabContent.

See Also:
getStyleClass()

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.


isVisible

public boolean isVisible()

Use the visible attribute to indicate whether the 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, visible is set to true, so HTML for the component HTML is included and visible to the user. If the component is not visible, it can still be processed on subsequent form submissions because the HTML is present.


setVisible

public void setVisible(boolean visible)

Use the visible attribute to indicate whether the 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, visible is set to true, so HTML for the component HTML is included and visible to the user. If the component is not visible, it can still be processed on subsequent form submissions because the HTML is present.

See Also:
isVisible()

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

getTabContainer

public TabContainer getTabContainer(TabContent tab)
Utility method that returns the tabContainer instance that contains the tab specified.



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