Java Doc for TabSetBase.java in  » IDE-Netbeans » visualweb.api.designer » com » sun » rave » web » ui » component » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Netbeans » visualweb.api.designer » com.sun.rave.web.ui.component 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.sun.rave.web.ui.component.TabSetBase

All known Subclasses:   com.sun.rave.web.ui.component.TabSet,
TabSetBase
abstract public class TabSetBase extends javax.faces.component.UINamingContainer (Code)

About This Tag

The TabSet renders a set of Tab children. It keeps track of the currently selected child Tab as well as applying any specified ActionListener.

Configuring the TabSet Tag

The TabSet can currently be used in one of two ways: via a component binding to a TabSet and group of child Tab components (defined in a backing bean); or by specifying the TabSet and child Tabs directly in your JSP.

Examples of both are shown in the Examples section below. It is anticipated that the component binding method will be more common as this allows a single set of Tabs to be easily shared among many pages. In either case, the initial selection for the TabSet component can be specified using the "selected" property. Note that if an ActionListener is applied to the TabSet component, it adds the specified ActionListener to each of its child Tab components action listener lists.

Facets

None at this time

Client Side Javascript Functions

None at this time

Examples

Example 1: Define the TabSet via a component binding
One way a TabSet component can be specified is via a JSF component binding to an instance defined in a backing bean. The contents of the JSP in this case will simply be something like:

<ui:tabSet binding="#{TabSetBean.sportsTabSet}" />

The code in the corresponding backing bean instance would look something like:

import java.util.List;
import java.lang.Class;
import javax.faces.FactoryFinder;
import javax.faces.el.MethodBinding;
import javax.faces.event.ActionEvent;
import javax.faces.application.Application;
import javax.faces.application.ApplicationFactory;
import com.sun.rave.web.ui.component.Tab;
import com.sun.rave.web.ui.component.TabSet;

public class TabSetBean {
    private TabSet sportsTabSet = null;

    // Creates a new instance of TabSetBean //
    public TabSetBean() {
        sportsTabSet = new TabSet();
        List kids = sportsTabSet.getChildren();

        Tab level1Tab = new Tab("Baseball");
        level1Tab.setId("Baseball");
        Tab level2Tab = addTab(level1Tab, "National");
        addTab(level2Tab, "Mets");
        addTab(level2Tab, "Pirates");
        addTab(level2Tab, "Cubs");

        level2Tab = addTab(level1Tab, "American");
        addTab(level2Tab, "Yankees");
        addTab(level2Tab, "Tigers");
        addTab(level2Tab, "Mariners");

        level2Tab = addTab(level1Tab, "AAA");
        addTab(level2Tab, "Spinners");
        addTab(level2Tab, "Renegades");
        addTab(level2Tab, "Clippers");

        kids.add(level1Tab);

        level1Tab = new Tab("Football");
        level1Tab.setId("Football");
        level2Tab = addTab(level1Tab, "NFC");
        addTab(level2Tab, "Giants");
        addTab(level2Tab, "Bears");
        addTab(level2Tab, "Falcons");

        level2Tab = addTab(level1Tab, "AFC");
        addTab(level2Tab, "Jets");
        addTab(level2Tab, "Patriots");
        addTab(level2Tab, "Colts");

        level2Tab = addTab(level1Tab, "College");
        addTab(level2Tab, "Wolverines");
        addTab(level2Tab, "Hurricanes");
        addTab(level2Tab, "Buckeyes");

        kids.add(level1Tab);

        Class[] args = new Class[] { ActionEvent.class };
        MethodBinding binding = createBinding("#{TabSetBean.tabClicked}", args);

        sportsTabSet.setActionListener(binding);

        sportsTabSet.setSelected("Jets");

    }

    private MethodBinding createBinding(String expr, Class[] args) {
        ApplicationFactory factory = (ApplicationFactory)
        FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY);
        Application app = factory.getApplication();

        return app.createMethodBinding(expr, args);
    }

    private Tab addTab(Tab parent, String newTabLabel) {
        Tab tab = new Tab(newTabLabel);
        tab.setId(newTabLabel);
        parent.getChildren().add(tab);
        return tab;
    }

    public void tabClicked(ActionEvent event) {
        String clickedTabId = event.getComponent().getId():
        String selectedTabId = sportsTabSet.getSelected();
        // ... do sometehing based upon the clicked or selected tab id ...
    }

    public TabSet getSportsTabSet() {
        return sportsTabSet;
    }

    public void setSportsTabSet(TabSet tabs) {
        sportsTabSet = tabs;
    }
}

Example 2: Define the TabSet in your JSP
A tabSet can also be defined directly in your JSP. The following example defines a set of tabs with three level one tabs (labelled "One", "Two" and "Three"). Each level one tab also has two level two tab childeren (labelled "XxxA" and "XxxB" where X is the top level tab number. The initially selected Tab for this TabSet will be "TwoA".

<ui:tabSet selected="TwoA">
    <ui:tab id="One" text="One">
        <ui:tab id="OneA" text="One A" />
        <ui:tab id="OneB" text="One B" />
    </ui:tab>
    <ui:tab id="Two" text="Two">
        <ui:tab id="TwoA" text="Two A" />
        <ui:tab id="TwoB" text="Two B" />
    </ui:tab>
    <ui:tab id="Three" text="Three">
        <ui:tab id="ThreeA" text="Three A" />
        <ui:tab id="ThreeB" text="Three B" />
    </ui:tab>
</ui:tabSet>

Auto-generated component class. Do NOT modify; all changes will be lost!




Constructor Summary
public  TabSetBase()
    

Method Summary
public  javax.faces.el.MethodBindinggetActionListener()
    

Use the actionListener attribute to cause the hyperlink to fire an event.

public  StringgetFamily()
    

Return the identifier of the component family to which this component belongs.

public  StringgetSelected()
    
public  StringgetStyle()
    
public  StringgetStyleClass()
    
public  booleanisLite()
    

Render a style of tabs that isn't so visually "heavy".

public  booleanisMini()
    
public  booleanisVisible()
    

Use the visible attribute to indicate whether the component should be viewable by the user in the rendered HTML page.

public  voidrestoreState(FacesContext _context, Object _state)
    
public  ObjectsaveState(FacesContext _context)
    
public  voidsetActionListener(javax.faces.el.MethodBinding actionListener)
    

Use the actionListener attribute to cause the hyperlink to fire an event.

public  voidsetLite(boolean lite)
    

Render a style of tabs that isn't so visually "heavy".

public  voidsetMini(boolean mini)
    
public  voidsetSelected(String selected)
    
public  voidsetStyle(String style)
    
public  voidsetStyleClass(String styleClass)
    
public  voidsetVisible(boolean visible)
    

Use the visible attribute to indicate whether the component should be viewable by the user in the rendered HTML page.



Constructor Detail
TabSetBase
public TabSetBase()(Code)

Construct a new TabSetBase.





Method Detail
getActionListener
public javax.faces.el.MethodBinding getActionListener()(Code)

Use the actionListener attribute to cause the hyperlink to fire an event. The value must be an EL expression and it must evaluate to the name of a public method that takes an ActionEvent parameter and returns void.




getFamily
public String getFamily()(Code)

Return the identifier of the component family to which this component belongs. This identifier, in conjunction with the value of the rendererType property, may be used to select the appropriate Renderer for this component instance.




getSelected
public String getSelected()(Code)

The id of the selected tab




getStyle
public String getStyle()(Code)

CSS style(s) to be applied when this component is rendered.




getStyleClass
public String getStyleClass()(Code)

CSS style class(es) to be applied when this component is rendered.




isLite
public boolean isLite()(Code)

Render a style of tabs that isn't so visually "heavy". This property must be used in conjunction with the "mini" property set to true in order to work.




isMini
public boolean isMini()(Code)

Specify "true" if this TabSet should have the mini style




isVisible
public boolean isVisible()(Code)

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.




restoreState
public void restoreState(FacesContext _context, Object _state)(Code)

Restore the state of this component.




saveState
public Object saveState(FacesContext _context)(Code)

Save the state of this component.




setActionListener
public void setActionListener(javax.faces.el.MethodBinding actionListener)(Code)

Use the actionListener attribute to cause the hyperlink to fire an event. The value must be an EL expression and it must evaluate to the name of a public method that takes an ActionEvent parameter and returns void.


See Also:   TabSetBase.getActionListener()



setLite
public void setLite(boolean lite)(Code)

Render a style of tabs that isn't so visually "heavy". This property must be used in conjunction with the "mini" property set to true in order to work.


See Also:   TabSetBase.isLite()



setMini
public void setMini(boolean mini)(Code)

Specify "true" if this TabSet should have the mini style


See Also:   TabSetBase.isMini()



setSelected
public void setSelected(String selected)(Code)

The id of the selected tab


See Also:   TabSetBase.getSelected()



setStyle
public void setStyle(String style)(Code)

CSS style(s) to be applied when this component is rendered.


See Also:   TabSetBase.getStyle()



setStyleClass
public void setStyleClass(String styleClass)(Code)

CSS style class(es) to be applied when this component is rendered.


See Also:   TabSetBase.getStyleClass()



setVisible
public void setVisible(boolean visible)(Code)

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:   TabSetBase.isVisible()



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.