<?xml version='1.0' encoding='UTF-8'?>
<section>
  <sectioninfo>
    <keywordset>
      <keyword>item</keyword>
      <keyword>rich:panelbaritem</keyword>
      <keyword>HtmlPanelBar</keyword>
    </keywordset>
  </sectioninfo>

  <table>
    <title>Component identification parameters </title>
    <tgroup cols="2">
      <thead>
        <row>
          <entry>Name</entry>
          <entry>Value</entry>
        </row>
      </thead>
      <tbody>
        <row>
          <entry>component-type</entry>
          <entry>org.richfaces.PanelBarItem</entry>
        </row>
        <row>
          <entry>component-class</entry>
          <entry>org.richfaces.component.html.HtmlPanelBarItem</entry>
        </row>
        <row>
          <entry>component-family</entry>
          <entry>org.richfaces.PanelBarItem</entry>
        </row>
        <row>
          <entry>renderer-type</entry>
          <entry>org.richfaces.PanelBarItemRenderer</entry>
        </row>
        <row>
          <entry>tag-class</entry>
          <entry>org.richfaces.taglib.PanelBarItemTag</entry>
        </row>
      </tbody>
    </tgroup>
  </table>

  <section>
    <title>Creating the Component with a Page Tag</title>
    <para>To create the simplest variant on a page use the following syntax:</para>

    <para>
      <emphasis role="bold">Example:</emphasis>
    </para>
    <programlisting role="XML"><![CDATA[...
    <rich:panelBar>
        <rich:panelBarItem label="Canon">
            ...
        </rich:panelBarItem>
        <rich:panelBarItem label="Nikon">
            ...
        </rich:panelBarItem>
    </rich:panelBar>
...
]]></programlisting>
  </section>
  <section>
    <title>Creating the Component Dynamically Using Java</title>

    <para>
      <emphasis role="bold">Example:</emphasis>
    </para>
    <programlisting role="JAVA"><![CDATA[import org.richfaces.component.html.HtmlPanelBarItem;
...
HtmlPanelBarItem myBarItem = new HtmlPanelBarItem();
...
]]></programlisting>
  </section>
  <section>
    <title>Details of Usage</title>
    <para>The <emphasis>
        <property> &quot;label&quot;</property>
      </emphasis> attribute defines text to be represented. If you can use the <emphasis>
        <property>&quot;label&quot;</property>
      </emphasis> facet, you can even not use the <emphasis>
        <property>&quot;label&quot;</property>
      </emphasis> attribute.</para>
    <emphasis role="bold">Example:</emphasis>
    <programlisting role="XML"><![CDATA[...
    <rich:panelBarItem...>
        <f:facet name="label">  
            <h:graphicImage value="/images/img1.png"/>
        </f:facet>
        ...
        <!--Any Content inside-->
        ...
    </rich:panelBarItem>
...
]]></programlisting>
    <para>As it was mentioned <link linkend="panelBarItem">above</link>,
      <property>panelBarItem</property> is used for grouping any content inside within one
        <property>panelBar</property>, thus its customization deals only with specification of sizes
      and styles for rendering.</para>
    <para><property>panelBar</property> could contain any number of child
      <property>panelBarItem</property> components inside, which content is uploaded onto the client
      and headers are controls to open the corresponding child element.</para>
  </section>
  
  <section>
    <title>Look-and-Feel Customization</title>
    
    <para>For skinnability implementation, the components use a <emphasis>
      <property>style class redefinition method.</property>
    </emphasis> Default style classes are mapped on <emphasis>
      <property>skin parameters.</property>
    </emphasis></para>
    
    <para>There are two ways to redefine the appearance of all <emphasis role="bold">
      <property>&lt;rich:panelBarItem&gt;</property>
    </emphasis> components at once:</para>
    
    <itemizedlist>
      <listitem>
        <para>Redefine the corresponding skin parameters</para>
      </listitem>
      
      <listitem>
        <para>Add to your style sheets <emphasis>
          <property>style classes</property>
        </emphasis> used by a <emphasis role="bold">
          <property>&lt;rich:panelBarItem&gt;</property>
        </emphasis> component</para>
      </listitem>
    </itemizedlist>
  </section>
  
  <section>
    <title>Skin Parameters Redefinition</title>
    <table>
      <title>Skin parameters redefinition for a content </title>
      <tgroup cols="2">
        <thead>
          <row>
            <entry>Skin parameters</entry>
            <entry>CSS properties</entry>
          </row>
        </thead>
        <tbody>
          <row>
            <entry>generalTextColor</entry>
            <entry>color</entry>
          </row>
          <row>
            <entry>preferableDataSizeFont</entry>
            <entry>font-size</entry>
          </row>
          <row>
            <entry>preferableDataFamilyFont</entry>
            <entry>font-family</entry>
          </row>
        </tbody>
      </tgroup>
    </table>
    <table>
      <title>Skin parameters redefinition for a header element (active or inactive)</title>
      <tgroup cols="2">
        <thead>
          <row>
            <entry>Skin parameters</entry>
            <entry>CSS properties</entry>
          </row>
        </thead>
        <tbody>
          <row>
            <entry>headerTextColor</entry>
            <entry>color</entry>
          </row>
          <row>
            <entry>headerBackgroundColor</entry>
            <entry>background-color</entry>
          </row>
          <row>
            <entry>headerSizeFont</entry>
            <entry>font-size</entry>
          </row>
          <row>
            <entry>headerWeightFont</entry>
            <entry>font-weight</entry>
          </row>
          <row>
            <entry>headerFamilyFont</entry>
            <entry>font-family</entry>
          </row>
        </tbody>
      </tgroup>
    </table>
  </section>
  <section>
    <title>Definition of Custom Style Classes</title>
    <para>On the screenshot there are classes names that define styles for component elements.</para>
    <figure>
      <title>Style classes</title>
      <mediaobject>
        <imageobject>
          <imagedata fileref="images/panelBar3.png" scalefit="1"/>
        </imageobject>
      </mediaobject>
    </figure>

    <table>
      <title>Classes names that define a component appearance</title>
      <tgroup cols="2">
        <thead>
          <row>
            <entry>Class name</entry>
            <entry>Class description</entry>
          </row>
        </thead>
        <tbody>
          <row>
            <entry>rich-panelbar-header</entry>
            <entry>Defines styles for a wrapper &lt;div&gt; element of a header
            element</entry>
          </row>

          <row>
            <entry>rich-panelbar-header-act</entry>
            <entry>Defines styles for a wrapper &lt;div&gt; element of an active header
              element</entry>
          </row>

          <row>
            <entry>rich-panelbar-content</entry>
            <entry>Defines styles for a content</entry>
          </row>
        </tbody>
      </tgroup>
    </table>

    <table>
      <title>Style component classes</title>
      <tgroup cols="2">
        <thead>
          <row>
            <entry>A class attribute</entry>
            <entry>A component element defined by an attribute</entry>
          </row>
        </thead>
        <tbody>
          <row>
            <entry>headerClass</entry>
            <entry>Applicable to a header element</entry>
          </row>
          <row>
            <entry>contentClass</entry>
            <entry>Applicable to a content</entry>
          </row>
        </tbody>
      </tgroup>
    </table>

    <para>In order to redefine styles for all <emphasis role="bold">
        <property>&lt;rich:panelBarItem&gt;</property>
      </emphasis> components on a page using CSS, it&apos;s enough to create classes with the
      same names and define necessary properties in them.</para>

    <para>To change styles of particular <emphasis role="bold">
        <property>&lt;rich:panelBarItem&gt;</property>
      </emphasis> components, define your own style classes in the corresponding <emphasis
        role="bold">
        <property>&lt;rich:panelBarItem&gt;</property>
      </emphasis>attributes.</para>
    <para>CSS code piece used on a page:</para>

    <para>
      <emphasis role="bold">Example:</emphasis>
    </para>
    <programlisting role="CSS"><![CDATA[...
    .rich-panelbar-header{
        font-size:14px;
    }
    .myClass{
        font-style:italic;
    }
...
]]></programlisting>
    <para>The component is defined in the following way:</para>

    <para>
      <emphasis role="bold">Example:</emphasis>
    </para>
    <programlisting role="XML"><![CDATA[...
    <rich:panelBar>
        <rich:panelBarItem contentClass="myClass">
            ...
        </rich:panelBarItem>
    </rich:panelBar>
...
]]></programlisting>
    <para>Hence, a font size of all <emphasis role="bold">
        <property>&lt;rich:panelBarItem&gt;</property>
      </emphasis> headers is changed on a page as well as a font for the particular <emphasis
        role="bold">
        <property>&lt;rich:panelBarItem&gt;</property>
      </emphasis> content.</para>
  </section>
</section>
