com.sun.webui.jsf.component
Class TabSet

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by javax.faces.component.UIOutput
              extended by javax.faces.component.UIInput
                  extended by com.sun.webui.jsf.component.WebuiInput
                      extended by com.sun.webui.jsf.component.TabSet
All Implemented Interfaces:
javax.faces.component.EditableValueHolder, javax.faces.component.NamingContainer, javax.faces.component.StateHolder, javax.faces.component.ValueHolder

public class TabSet
extends WebuiInput
implements javax.faces.component.NamingContainer

A set of one or more tabs. A TabSet is a naming container which should contain only Tab components. The currently selected tab is specified via the selected property, which may be bound to a model value. Action listeners may be registered individually with a Tab; or, an action listener may be registered with the containing tabSet, in which case it is notified of all tab selection actions.

TabSet implements EditableValueHolder, but it diverges significantly from the behavior of a typical editable value holder. Note that the selected property is an alias for the value property.


Field Summary
 
Fields inherited from class javax.faces.component.UIInput
COMPONENT_FAMILY, COMPONENT_TYPE, CONVERSION_MESSAGE_ID, REQUIRED_MESSAGE_ID, UPDATE_MESSAGE_ID
 
Fields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR
 
Constructor Summary
TabSet()
          Create a new TabSet.
 
Method Summary
 Tab findChildTab(java.lang.String tabId)
          Returns the tab with the id specified that is a child of this tabSet.
static Tab findChildTab(Tab tab, java.lang.String tabId)
          Returns the tab with the id specified that is a child of the tab specified.
 javax.el.MethodExpression getActionListenerExpression()
          Get the method expression that identifies a method that handles the action event fired when one of this tab set's tabs is used to submit the page.
 javax.faces.convert.Converter getConverter()
           
 java.lang.String getFamily()
           
 java.lang.String getSelected()
          The id of the selected tab.
 Tab getSelectedTab()
          Returns this tab set's tab descendant with id equal to the value of the selected property.
 java.lang.String getStyle()
          CSS style(s) 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.
 javax.el.MethodExpression getValidatorExpression()
          Get the validatorExpression.
 java.lang.Object getValue()
          The current value of this component.
 javax.el.ValueExpression getValueExpression(java.lang.String name)
           
 boolean isLastSelectedChildSaved()
          Returns true if the tabs in this tab set should remember which of their tab children was last selected.
 boolean isLite()
          Returns true if the tabs should render in a visually lighter style, with reduced shading and bolding.
 boolean isMini()
          Set this attribute to true in a first level tab set, to create tabs that have the smaller "mini" tab style.
 boolean isRequired()
           
 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 setActionListenerExpression(javax.el.MethodExpression actionListenerExpression)
          Set the method expression that identifies a method that handles the action event fired when one of this tab set's tabs is used to submit the page.
 void setLastSelectedChildSaved(boolean lastSelectedChildSaved)
          Set to true if the tabs in this tab set should remember which of their tab children was last selected.
 void setLite(boolean lite)
          Set to true to render the tabs in a visually lighter style, with reduced shading and bolding.
 void setMini(boolean mini)
          Set this attribute to true in a first level tab set, to create tabs that have the smaller "mini" tab style.
 void setSelected(java.lang.String selected)
          The id of the selected tab.
 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 setValueExpression(java.lang.String name, javax.el.ValueExpression binding)
           
 void setVisible(boolean visible)
          Use the visible attribute to indicate whether the component should be viewable by the user in the rendered HTML page.
 void validate(javax.faces.context.FacesContext context)
          Marks this tab set as valid only if all input component children of the currently selected tab are valid.
 
Methods inherited from class com.sun.webui.jsf.component.WebuiInput
broadcast, getValidator, getValueChangeListener, getValueChangeListenerExpression, processDecodes, processUpdates, processValidators, setConverter, setId, setImmediate, setRendered, setRequired, setValidatorExpression, setValueChangeListenerExpression
 
Methods inherited from class javax.faces.component.UIInput
addValidator, addValueChangeListener, decode, getConverterMessage, getRequiredMessage, getSubmittedValue, getValidatorMessage, getValidators, getValueChangeListeners, isImmediate, isLocalValueSet, isValid, removeValidator, removeValueChangeListener, resetValue, setConverterMessage, setLocalValueSet, setRequiredMessage, setSubmittedValue, setValid, setValidator, setValidatorMessage, setValue, setValueChangeListener, updateModel
 
Methods inherited from class javax.faces.component.UIOutput
getLocalValue
 
Methods inherited from class javax.faces.component.UIComponentBase
encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, restoreAttachedState, saveAttachedState, setParent, setRendererType, setTransient, setValueBinding
 
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
 
Methods inherited from interface javax.faces.component.ValueHolder
getLocalValue
 

Constructor Detail

TabSet

public TabSet()
Create a new TabSet.

Method Detail

getFamily

public java.lang.String getFamily()
Overrides:
getFamily in class javax.faces.component.UIInput

getValueExpression

public javax.el.ValueExpression getValueExpression(java.lang.String name)
Overrides:
getValueExpression in class javax.faces.component.UIComponentBase

setValueExpression

public void setValueExpression(java.lang.String name,
                               javax.el.ValueExpression binding)
Overrides:
setValueExpression in class javax.faces.component.UIComponentBase

getConverter

public javax.faces.convert.Converter getConverter()
Specified by:
getConverter in interface javax.faces.component.ValueHolder
Overrides:
getConverter in class javax.faces.component.UIOutput

isRequired

public boolean isRequired()
Specified by:
isRequired in interface javax.faces.component.EditableValueHolder
Overrides:
isRequired in class javax.faces.component.UIInput

getValidatorExpression

public javax.el.MethodExpression getValidatorExpression()
Description copied from class: WebuiInput

Get the validatorExpression. The corresponding validator will be called from the validateValue method.

Overrides:
getValidatorExpression in class WebuiInput

getValue

public java.lang.Object getValue()
The current value of this component.

Specified by:
getValue in interface javax.faces.component.ValueHolder
Overrides:
getValue in class javax.faces.component.UIOutput

getActionListenerExpression

public javax.el.MethodExpression getActionListenerExpression()
Get the method expression that identifies a method that handles the action event fired when one of this tab set's tabs is used to submit the page.


setActionListenerExpression

public void setActionListenerExpression(javax.el.MethodExpression actionListenerExpression)
Set the method expression that identifies a method that handles the action event fired when one of this tab set's tabs is used to submit the page. The signature of the bound method must correspond to MethodExpressionActionListener.processAction(javax.faces.event.ActionEvent). The class that defines the method must implement the java.io.Serializable interface or javax.faces.component.StateHolder interface.


isLastSelectedChildSaved

public boolean isLastSelectedChildSaved()
Returns true if the tabs in this tab set should remember which of their tab children was last selected. This enables the user to choose other tabs in the set, and have the child tab selection in the original tab be retained when the user returns to the original tab.


setLastSelectedChildSaved

public void setLastSelectedChildSaved(boolean lastSelectedChildSaved)
Set to true if the tabs in this tab set should remember which of their tab children was last selected. This enables the user to choose other tabs in the set, and have the child tab selection in the original tab be retained when the user returns to the original tab.


isLite

public boolean isLite()
Returns true if the tabs should render in a visually lighter style, with reduced shading and bolding. This attribute can only be used with mini tabs, so you must also set the mini attribute to true to render lightweight tabs.


setLite

public void setLite(boolean lite)
Set to true to render the tabs in a visually lighter style, with reduced shading and bolding. This attribute can only be used with mini tabs, so you must also set the mini attribute to true to render lightweight tabs.


isMini

public boolean isMini()
Set this attribute to true in a first level tab set, to create tabs that have the smaller "mini" tab style. Note that mini tab sets will not display properly if more than one level of tabs are specified.


setMini

public void setMini(boolean mini)
Set this attribute to true in a first level tab set, to create tabs that have the smaller "mini" tab style. Note that mini tab sets will not display properly if more than one level of tabs are specified.


getSelected

public java.lang.String getSelected()
The id of the selected tab.


setSelected

public void setSelected(java.lang.String selected)
The id of the selected tab.

See Also:
getSelected()

getSelectedTab

public Tab getSelectedTab()
Returns this tab set's tab descendant with id equal to the value of the selected property. If the value of the selected property is null, returns the first tab child. If there are no tab children, returns null.


getStyle

public java.lang.String getStyle()
CSS style(s) 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()
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()

validate

public void validate(javax.faces.context.FacesContext context)
Marks this tab set as valid only if all input component children of the currently selected tab are valid.

Overrides:
validate in class javax.faces.component.UIInput

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 WebuiInput

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 WebuiInput

findChildTab

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


findChildTab

public static Tab findChildTab(Tab 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.



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