FileDocCategorySizeDatePackage
UITabLabel.javaAPI DocExample4138Tue Jun 08 11:26:42 BST 2004com.mycompany.jsf.component

UITabLabel

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.
author
Hans Bergsten, Gefion Software
version
1.0

Fields Summary
public static final String
COMPONENT_TYPE
public static final String
COMPONENT_FAMILY
Constructors Summary
public UITabLabel()
Creates an instance and sets the renderer type to "javax.faces.Link".


                   
      
        super();
        setRendererType("javax.faces.Link");
    
Methods Summary
public voidaddActionListener(javax.faces.event.ActionListener listener)
Throws "UnsupportedOperationException" to disable the use of ActionListener instances.

        throw new UnsupportedOperationException();
    
public voidbroadcast(javax.faces.event.FacesEvent event)
Disables all standard UICommand event handling and calls processAction() to process the event if it's an ActionEvent.

        if (event instanceof ActionEvent) {
            processAction((ActionEvent) event);
        }
    
public javax.faces.el.MethodBindinggetAction()
Returns "null", because this component can't be configured with an action method.

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

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

        return new ActionListener[0];
    
public java.lang.StringgetFamily()
Returns the COMPONENT_TYPE value.

        return COMPONENT_FAMILY;
    
private voidprocessAction(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.

        UIComponent parent = getParent();
        UIComponent panelTabbed = parent.getParent();
        Iterator i = panelTabbed.getChildren().iterator();
        while (i.hasNext()) {
            UIComponent tab = (UIComponent) i.next();
            if (tab.equals(parent)) {
                tab.setRendered(true);
            }
            else {
                tab.setRendered(false);
            }
        }
    
public voidremoveActionListener(javax.faces.event.ActionListener listener)
Throws "UnsupportedOperationException" to disable the use of ActionListener instances.

        throw new UnsupportedOperationException();
    
public voidsetAction(javax.faces.el.MethodBinding action)
Throws "UnsupportedOperationException" to disable the use of an action method.

        throw new UnsupportedOperationException();
    
public voidsetActionListener(javax.faces.el.MethodBinding actionListener)
Throws "UnsupportedOperationException" to disable the use of an action listener method.

        throw new UnsupportedOperationException();