com.sun.webui.jsf.component
Class Breadcrumbs

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by com.sun.webui.jsf.component.Breadcrumbs
All Implemented Interfaces:
com.sun.webui.jsf.component.ComplexComponent, javax.faces.component.NamingContainer, javax.faces.component.StateHolder

public class Breadcrumbs
extends javax.faces.component.UIComponentBase
implements com.sun.webui.jsf.component.ComplexComponent, javax.faces.component.NamingContainer

The Breadcrumbs component is used to display a list of hyperlinks, as an aid to navigation.

Breadcrumbs show the user's location within an application, and the physical or logical path to the current page. The user can click hyperlinks in the breadcrumbs to navigate to other, previously visited pages in the application.

A breadcrumb's hyperlinks may be specified in one of two ways:

You should provide either child hyperlinks or bound hyperlinks, but not both. If both are provided, bound hyperlinks are rendered, and any child hyperlinks are ignored. Non-hyperlink children are also ignored.

Bound hyperlinks are treated as child hyperlinks for all phases of request processing, except that they are not asked to save or restore their state.

The breadcrumbs component has an immediate property, the default value of which is true. If the breadcrumbs is immediate, all action events generated by child or bound hyperlinks will be treated as though they too were immediate, whether or not the source hyperlink is immediate. If the breadcrumbs is not immediate, action events will be processed according to whether their source hyperlink is immediate or not.


Field Summary
 
Fields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR
 
Constructor Summary
Breadcrumbs()
           
 
Method Summary
 java.lang.String getFamily()
           
 java.lang.String getFocusElementId(javax.faces.context.FacesContext context)
          Return the absolute identifier of the HTML element suitable to receive the focus.
 javax.faces.component.UIComponent getIndicatorComponent(javax.faces.context.FacesContext context, Label label)
          Return a component instance that can be referenced by a Label component in order to evaluate the required and valid states of the component.
 java.lang.String getLabeledElementId(javax.faces.context.FacesContext context)
          Return the absolute identifier of the HTML element suitable for use as the value of an HTML Label element's for attribute.
 Hyperlink[] getPages()
          Get the array of zero or more Hyperlink components that constitute the current path.
 java.lang.String getPrimaryElementID(javax.faces.context.FacesContext context)
          Deprecated.  
 java.lang.String getStyle()
          Returns the CSS style(s) to be applied to the outermost HTML element when this component is rendered.
 java.lang.String getStyleClass()
          Get the CSS style class(es) to be applied to the outermost HTML element when this component is rendered.
 int getTabIndex()
          Get the position of this element in the tabbing order of the current document.
 boolean isImmediate()
           
 boolean isVisible()
          Returns true if this component and its child components should be viewable by the user in the rendered HTML page.
 void processDecodes(javax.faces.context.FacesContext context)
           
 void processUpdates(javax.faces.context.FacesContext context)
           
 void processValidators(javax.faces.context.FacesContext context)
           
 void queueEvent(javax.faces.event.FacesEvent event)
           
 void restoreState(javax.faces.context.FacesContext _context, java.lang.Object _state)
           
 java.lang.Object saveState(javax.faces.context.FacesContext _context)
           
 void setId(java.lang.String id)
          The component identifier for this component.
 void setImmediate(boolean immediate)
           
 void setPages(Hyperlink[] pages)
          Set the array of zero or more Hyperlink components that constitute the current path.
 void setRendered(boolean rendered)
          Use the rendered attribute to indicate whether the HTML code for the component should be included in the rendered HTML page.
 void setStyle(java.lang.String style)
          Set the CSS style(s) to be applied to the outermost HTML element when this component is rendered.
 void setStyleClass(java.lang.String styleClass)
          Set the CSS style class(es) to be applied to the outermost HTML element when this component is rendered.
 void setTabIndex(int tabIndex)
          Set the position of this element in the tabbing order of the current document.
 void setVisible(boolean visible)
          Returns true if this component and its child components should be viewable by the user in the rendered HTML page.
 
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, 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

Breadcrumbs

public Breadcrumbs()
Method Detail

getFamily

public java.lang.String getFamily()
Specified by:
getFamily in class javax.faces.component.UIComponent

setId

public void setId(java.lang.String id)
The component identifier for this component. This value must be unique within the closest parent component that is a naming container.

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

setRendered

public void setRendered(boolean rendered)
Use the rendered attribute to indicate whether the HTML code for the component should be included in the rendered HTML page. If set to false, the rendered HTML page does not include the HTML for the component. If the component is not rendered, it is also not processed on any subsequent form submission.

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

getPages

public Hyperlink[] getPages()
Get the array of zero or more Hyperlink components that constitute the current path.


setPages

public void setPages(Hyperlink[] pages)
Set the array of zero or more Hyperlink components that constitute the current path.


getStyle

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

See Also:
setStyle(java.lang.String)

setStyle

public void setStyle(java.lang.String style)
Set the 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()
Get the CSS style class(es) to be applied to the outermost HTML element when this component is rendered.

See Also:
setStyleClass(java.lang.String)

setStyleClass

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

See Also:
getStyleClass()

getTabIndex

public int getTabIndex()
Get the 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:
setTabIndex(int)

setTabIndex

public void setTabIndex(int tabIndex)
Set the 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()

isImmediate

public boolean isImmediate()

setImmediate

public void setImmediate(boolean immediate)

isVisible

public boolean isVisible()
Returns true if this component and its child components should be viewable by the user in the rendered HTML page.

See Also:
setVisible(boolean)

setVisible

public void setVisible(boolean visible)
Returns true if this component and its child components should be viewable by the user in the rendered HTML page.

See Also:
isVisible()

processDecodes

public void processDecodes(javax.faces.context.FacesContext context)
Overrides:
processDecodes in class javax.faces.component.UIComponentBase

processValidators

public void processValidators(javax.faces.context.FacesContext context)
Overrides:
processValidators in class javax.faces.component.UIComponentBase

processUpdates

public void processUpdates(javax.faces.context.FacesContext context)
Overrides:
processUpdates in class javax.faces.component.UIComponentBase

queueEvent

public void queueEvent(javax.faces.event.FacesEvent event)
Overrides:
queueEvent in class javax.faces.component.UIComponentBase

getPrimaryElementID

public java.lang.String getPrimaryElementID(javax.faces.context.FacesContext context)
Deprecated. 

Method to return the DOM identifier of the HTML element which should receive the focus and to which a component label for attribute should apply.

Specified by:
getPrimaryElementID in interface com.sun.webui.jsf.component.ComplexComponent
Parameters:
context - The FacesContext for the request
Returns:
An absolute identifier of a DOM element
See Also:
getLabeledElementId(javax.faces.context.FacesContext), getFocusElementId(javax.faces.context.FacesContext)

getLabeledElementId

public java.lang.String getLabeledElementId(javax.faces.context.FacesContext context)
Return the absolute identifier of the HTML element suitable for use as the value of an HTML Label element's for attribute. For a breadcrumb component, delegate to the first hyperlink child component or first hyperlink component in the pages list. If there is a single hyperlink component, it will be rendered as HTML static text within a span, so a null is returned.

Specified by:
getLabeledElementId in interface com.sun.webui.jsf.component.ComplexComponent
Parameters:
context - The FacesContext used for the request
Returns:
An absolute identifier of a DOM element for an HTML LABEL element's for attribute.

getFocusElementId

public java.lang.String getFocusElementId(javax.faces.context.FacesContext context)
Return the absolute identifier of the HTML element suitable to receive the focus. For a breadcrumb component, delegate to the first hyperlink child component or first hyperlink component in the pages list. If there is a single hyperlink component, it will be rendered as HTML static text within a span, so a null is returned.

Specified by:
getFocusElementId in interface com.sun.webui.jsf.component.ComplexComponent
Parameters:
context - The FacesContext used for the request
Returns:
An absolute identifier of a DOM element to receive the focus

getIndicatorComponent

public javax.faces.component.UIComponent getIndicatorComponent(javax.faces.context.FacesContext context,
                                                               Label label)
Return a component instance that can be referenced by a Label component in order to evaluate the required and valid states of the component. For a breadcrumb, there are no such components, since it currently restricts its children to be Hyperlink components. However, we delegate to the first hyperlink component, since its a child component implementing the ComplexComponent interface.

Specified by:
getIndicatorComponent in interface com.sun.webui.jsf.component.ComplexComponent
Parameters:
context - The FacesContext used for the request
label - The Label component that labels this breadcrumb.
Returns:
A UIComponent used to evaluate the required and valid states.

restoreState

public void restoreState(javax.faces.context.FacesContext _context,
                         java.lang.Object _state)
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)
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.