<?xml version='1.0' encoding='UTF-8'?>
<section>
  <sectioninfo>
    <keywordset>
      <keyword>bar</keyword>
      <keyword>rich:toolBar</keyword>
      <keyword>HtmlToolBar</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.ToolBar</entry>
        </row>
        <row>
          <entry>component-class</entry>
          <entry>org.richfaces.component.html.HtmlToolBar</entry>
        </row>
        <row>
          <entry>component-family</entry>
          <entry>org.richfaces.ToolBar</entry>
        </row>
        <row>
          <entry>renderer-type</entry>
          <entry>org.richfaces.ToolBarRenderer</entry>
        </row>
        <row>
          <entry>tag-class</entry>
          <entry>org.richfaces.taglib.ToolBarTag</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:toolBar>
        <!--//...Set of action or other JSF components-->
    </rich:toolBar>
...
]]></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.HtmlToolBar;
...
HtmlToolBar myToolBar = new HtmlToolBar();
...
]]></programlisting>
  </section>
  <section>
    <title>Details of Usage</title>
    <para>A <property>toolBar</property> is a wrapper component that facilitates creation of menu
      and <property>tool bars</property>. All components defined inside are located on a stylized
      bar with possibility to group, arrange on the both bar sides, and place predefined separators
      between them.</para>
    <para>Grouping and an input side definition is described for <property>toolBarGroup</property>
      that defines this functionality.</para>
    <para>Separators are located between components with the help of the <emphasis>
        <property>&quot;itemSeparator&quot;</property>
      </emphasis> attribute with four predefined values:</para>
    <itemizedlist>
      <listitem><para> &quot;none&quot; </para></listitem>
      <listitem><para> &quot;line&quot; </para></listitem>
      <listitem><para> &quot;square&quot; </para></listitem>
      <listitem><para> &quot;disc&quot; </para></listitem>
    </itemizedlist>
    <para>For example, when setting a separator of a disc type, the following result is produced:</para>
    <figure>
      <title><emphasis role="bold"><property>&lt;rich:toolBar&gt;</property></emphasis> with a <emphasis><property>&quot;disc&quot;</property></emphasis> separator</title>

      <mediaobject>
        <imageobject>
          <imagedata fileref="images/toolBar2.png" scalefit="1"/>
        </imageobject>
      </mediaobject>
    </figure>
    <para>Moreover, for <property>toolBar</property> style <emphasis>
        <property>&quot;width&quot;</property>
      </emphasis> and <emphasis>
        <property>&quot;height&quot;</property>
      </emphasis> attributes are placed above all.</para>
    <para>A custom separator can be added with the help of <emphasis><property>&quot;itemSeparator&quot;</property></emphasis> facet.</para>
    <para>
      <emphasis role="bold">Example:</emphasis>
    </para>
    <programlisting role="XML"><![CDATA[...
<f:facet name="itemSeparator"> 
    <rich:separator width="2" height="14" /> 
</f:facet>
...
]]></programlisting>
    <para>Custom separator can be also specified by URL to the separator image in the attribute <emphasis>
      <property>&quot;itemSeparator&quot;</property>
    </emphasis> of the <emphasis role="bold"><property>&lt;rich:toolBar&gt;</property></emphasis>. </para>
    <para>
      <emphasis role="bold">Example:</emphasis>
    </para>
    <programlisting role="XML"><![CDATA[...
<rich:toolBar id="toolBar" width="#{bean.width}" height="#{bean.height}" itemSeparator="/images/separator_img.jpg"/>
...
]]></programlisting>
    <para>This is a result:</para>
    <figure>
      <title><emphasis role="bold">
        <property>&lt;rich:toolBar&gt;</property>
      </emphasis> with <emphasis>
        <property>&quot;itemSeparator&quot;</property>
      </emphasis> attribute.</title>
      
      <mediaobject>
        <imageobject>
          <imagedata fileref="images/toolBar4.png"/>
        </imageobject>
      </mediaobject>
    </figure>
  </section>
  <para>As it could be seen in the picture above, the image for itemSeparator was changed.</para>
  
  <section>
		<title>Facets</title>
		<table>
			<title>Facets</title>
				<tgroup cols="2">
					<thead>
						<row>
							<entry>Facet name</entry>
							<entry>Description</entry>
						</row>
					</thead>
					<tbody>
						<row>
							<entry>itemSeparator</entry>
							<entry>Defines the custom separator. Related attribute is &quot;itemSeparator&quot;</entry>
						</row>
					</tbody>
				</tgroup>
		</table>
	</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:toolBar&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:toolBar&gt;</property>
        </emphasis> component</para>
      </listitem>
    </itemizedlist>
  </section>
  
    <section>
      <title>Skin Parameters Redefinition</title>
    <table>
      <title>Skin parameters redefinition for a component exterior</title>
      <tgroup cols="2">
        <thead>
          <row>
            <entry>Skin parameters</entry>
            <entry>CSS properties</entry>
          </row>
        </thead>
        <tbody>
          <row>
            <entry>panelBorderColor</entry>
            <entry>border-color</entry>
          </row>
          <row>
            <entry>headerBackgroundColor</entry>
            <entry>background-color</entry>
          </row>
        </tbody>
      </tgroup>
    </table>
      
      <table>
        <title>Skin parameters redefinition for a component item</title>
        <tgroup cols="2">
          <thead>
            <row>
              <entry>Skin parameters</entry>
              <entry>CSS properties</entry>
            </row>
          </thead>
          <tbody>
            <row>
              <entry>headerSizeFont</entry>
              <entry>font-size</entry>
            </row>
            <row>
              <entry>headerTextColor</entry>
              <entry>color</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>
    <table id="toolBC">
      <title>Classes names that define a component appearance</title>
      <tgroup cols="2">
        <thead>
          <row>
            <entry>Class name</entry>
            <entry>Description</entry>
          </row>
        </thead>
        <tbody>
          <row>
            <entry>rich-toolbar</entry>
            <entry>Defines styles for a toolbar element</entry>
          </row>
          <row>
            <entry>rich-toolbar-item</entry>
            <entry>Defines styles for a toolbar item</entry>
          </row>
        </tbody>
      </tgroup>
    </table>
    <figure>
      <title>Classes names</title>
      <mediaobject>
        <imageobject>
          <imagedata fileref="images/toolBar_cn.png"/>
        </imageobject>
      </mediaobject>
    </figure>
    <para>In order to redefine styles for all <emphasis role="bold">
      <property>&lt;rich:toolBar&gt;</property>
    </emphasis> components on a page using CSS, it&apos;s enough to create classes with the
      same names (possible classes could be found in the tables <link linkend="toolBC"> above</link>) and define necessary properties in them. </para>
    
    <para>
      <emphasis role="bold">Example:</emphasis>
    </para>
    <programlisting role="CSS"><![CDATA[...
.rich-toolbar-item{
    font-weight:bold;
}
...]]></programlisting>  
    
    <para>This is a result:</para>
    
    <figure>
      <title>Redefinition styles with predefined classes</title>
      <mediaobject>
        <imageobject>
          <imagedata fileref="images/toolBar_pc.png"/>
        </imageobject>
      </mediaobject>
    </figure>
    
    <para>In the example font weight for items was changed.</para>
    
    <para>Also it&apos;s possible to change styles of particular <emphasis role="bold"
      ><property>&lt;rich:toolBar&gt;</property></emphasis> component. In this case you should create own style classes and use them in corresponding <emphasis role="bold"
        ><property>&lt;rich:toolBar&gt;</property></emphasis> <emphasis><property>styleClass</property></emphasis> attributes. An example is placed below:</para>
    
    <para>
      <emphasis role="bold">Example:</emphasis>
    </para>
    <programlisting role="CSS"><![CDATA[...
.myClass{
    font-style:italic;
    font-weight:bold;
}
...]]></programlisting>  
    <para>The <emphasis><property>&quot;styleClass&quot;</property></emphasis> attribute for <emphasis role="bold"
      ><property>&lt;rich:toolBar&gt;</property></emphasis> is defined as it&apos;s shown in the example below:</para>
    
    <para>
      <emphasis role="bold">Example:</emphasis>
    </para>
    <programlisting role="XML"><![CDATA[<rich:toolBar ... styleClass="myClass"/>
]]></programlisting>    
    
    <para>This is a result:</para>
    
    <figure>
      <title>Redefinition styles with own classes and <emphasis><property>styleClass</property></emphasis> attributes</title>
      <mediaobject>
        <imageobject>
          <imagedata fileref="images/toolBar_oc.png"/>
        </imageobject>
      </mediaobject>
    </figure>  
    
    <para>As it could be seen on the picture above,the font style and the font weight for items was changed.</para>
    
    
    
    <para>The component also has the standard attributes <emphasis>
        <property>&quot;style&quot;</property>
      </emphasis> and <emphasis>
        <property>&quot;styleClass&quot;</property>
      </emphasis> that could redefine an appearance of a particular component variants.</para>
  </section>
  <section>
    <title>Relevant Resources Links</title>
    <para>
      <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/toolBar.jsf?c=toolBar"
      >Here</ulink> you can see the example of <emphasis role="bold"
      ><property>&lt;rich:toolBar&gt;</property></emphasis> usage and sources for the given example. </para>
  </section>

</section>
