com.mycompany.jsf.component
Class UITabLabel

java.lang.Object
  extended byjavax.faces.component.UIComponent
      extended byjavax.faces.component.UIComponentBase
          extended byjavax.faces.component.UICommand
              extended bycom.mycompany.jsf.component.UITabLabel
All Implemented Interfaces:
javax.faces.component.ActionSource, javax.faces.component.StateHolder

public class UITabLabel
extends javax.faces.component.UICommand

This class is a JSF component that represents a clickable tab control label. It must be used as a facet named "label" of a component representing a tab within a UIPanel with a "com.mycompany.jsf.TabbedRenderer". The component is rendered by the "javax.faces.Link" renderer type by default, using its child components as the link element body. It handles the ActionEvent it fires itself by setting the "rendered" property for its parent "true" and to "false" for the parents siblings.

Version:
1.0
Author:
Hans Bergsten, Gefion Software

Nested Class Summary
 
Nested classes inherited from class javax.faces.component.UIComponentBase
 
Field Summary
static java.lang.String COMPONENT_FAMILY
           
static java.lang.String COMPONENT_TYPE
           
 
Fields inherited from class javax.faces.component.UICommand
 
Fields inherited from class javax.faces.component.UIComponentBase
 
Constructor Summary
UITabLabel()
          Creates an instance and sets the renderer type to "javax.faces.Link".
 
Method Summary
 void addActionListener(javax.faces.event.ActionListener listener)
          Throws "UnsupportedOperationException" to disable the use of ActionListener instances.
 void broadcast(javax.faces.event.FacesEvent event)
          Disables all standard UICommand event handling and calls processAction() to process the event if it's an ActionEvent.
 javax.faces.el.MethodBinding getAction()
          Returns "null", because this component can't be configured with an action method.
 javax.faces.el.MethodBinding getActionListener()
          Returns "null", because this component can't be configured with an action listener method.
 javax.faces.event.ActionListener[] getActionListeners()
          Returns an empty array, because this component can't be configured with ActionListener instances.
 java.lang.String getFamily()
          Returns the COMPONENT_TYPE value.
private  void processAction(javax.faces.event.ActionEvent event)
          Locates the component's grandparent (holding all components acting as tabs), gets all its children (the tab components), and sets the "rendered" property to "true" for this component's parenent and to "false" for all others.
 void removeActionListener(javax.faces.event.ActionListener listener)
          Throws "UnsupportedOperationException" to disable the use of ActionListener instances.
 void setAction(javax.faces.el.MethodBinding action)
          Throws "UnsupportedOperationException" to disable the use of an action method.
 void setActionListener(javax.faces.el.MethodBinding actionListener)
          Throws "UnsupportedOperationException" to disable the use of an action listener method.
 
Methods inherited from class javax.faces.component.UICommand
getValue, isImmediate, queueEvent, restoreState, saveState, setImmediate, setValue
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPONENT_TYPE

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

COMPONENT_FAMILY

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

UITabLabel

public UITabLabel()
Creates an instance and sets the renderer type to "javax.faces.Link".

Method Detail

getFamily

public java.lang.String getFamily()
Returns the COMPONENT_TYPE value.


broadcast

public void broadcast(javax.faces.event.FacesEvent event)
Disables all standard UICommand event handling and calls processAction() to process the event if it's an ActionEvent.


getAction

public javax.faces.el.MethodBinding getAction()
Returns "null", because this component can't be configured with an action method.


setAction

public void setAction(javax.faces.el.MethodBinding action)
Throws "UnsupportedOperationException" to disable the use of an action method.


getActionListener

public javax.faces.el.MethodBinding getActionListener()
Returns "null", because this component can't be configured with an action listener method.


setActionListener

public void setActionListener(javax.faces.el.MethodBinding actionListener)
Throws "UnsupportedOperationException" to disable the use of an action listener method.


addActionListener

public void addActionListener(javax.faces.event.ActionListener listener)
Throws "UnsupportedOperationException" to disable the use of ActionListener instances.


getActionListeners

public javax.faces.event.ActionListener[] getActionListeners()
Returns an empty array, because this component can't be configured with ActionListener instances.


removeActionListener

public void removeActionListener(javax.faces.event.ActionListener listener)
Throws "UnsupportedOperationException" to disable the use of ActionListener instances.


processAction

private void processAction(javax.faces.event.ActionEvent event)
Locates the component's grandparent (holding all components acting as tabs), gets all its children (the tab components), and sets the "rendered" property to "true" for this component's parenent and to "false" for all others.