<?xml version='1.0' encoding='UTF-8'?>
<chapter>
  <sectioninfo>
    <keywordset>
      <keyword>horizontal line</keyword>
      <keyword>rich:separator</keyword>
      <keyword>HtmlSeparator</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.separator</entry>
        </row>
        <row>
          <entry>component-class</entry>
          <entry>org.richfaces.component.html.HtmlSeparator</entry>
        </row>
        <row>
          <entry>component-family</entry>
          <entry>org.richfaces.separator</entry>
        </row>
        <row>
          <entry>renderer-type</entry>
          <entry>org.richfaces.SeparatorRenderer</entry>
        </row>
        <row>
          <entry>tag-class</entry>
          <entry>org.richfaces.taglib.SeparatorTag</entry>
        </row>
      </tbody>
    </tgroup>
  </table>

  <section>
    <title>Creating the Component with a Page Tag</title>
    <para>Here is a simple example as it could be used on a page:</para>

    <para>
      <emphasis role="bold">Example:</emphasis>
    </para>
    <programlisting role="XML"><![CDATA[...
<rich:separator/>
...
]]></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.HtmlSeparator;
...
HtmlSeparator mySeparator = new HtmlSeparator();
...
]]></programlisting>
  </section>
  <section>
    <title>Details of Usage</title>
        <para><emphasis role="bold"><property>&lt;rich:separator&gt;</property></emphasis> is a simple layout component, 
          which represents a <property>separator</property> stylized as a skin. 
          Thus, the main attributes that define its style are <emphasis> <property>&quot;style&quot;</property>
      </emphasis> and <emphasis><property>&quot;styleClass&quot;.</property>
      </emphasis> In addition there are <emphasis><property>&quot;width&quot;</property></emphasis> and <emphasis><property>&quot;height&quot;</property>
      </emphasis> attributes that should be specified in pixels.
          On the HTML page the component is transposed into HTML <emphasis role="bold"><property>&lt;div&gt;</property></emphasis> tag.</para>
    
    <para>The line type can be customized with the <code>&quot;lineType&quot;</code> parameter. For example, different line types are shown after rendering with the
      following initial settings <code>lineType=&quot;double&quot;</code>and <code>lineType=&quot;solid&quot;</code>.
    </para>
    <figure>
      <title>Different line types of <emphasis role="bold"><property>&lt;rich:separator&gt;</property></emphasis></title>
      <mediaobject>
        <imageobject>
          <imagedata fileref="images/separator2.png"/>
        </imageobject>
      </mediaobject>
    </figure>

    <para>Except style attributes, there are also event definition attributes:</para>
    <itemizedlist>
      <listitem><para> <emphasis><property>&quot;onmouseover&quot;</property></emphasis> </para></listitem>
      <listitem><para> <emphasis><property>&quot;onclick&quot;</property></emphasis> </para></listitem>
      <listitem><para> <emphasis><property>&quot;onmouseout&quot;</property></emphasis> </para></listitem>
      <listitem><para> etc. </para></listitem>
    </itemizedlist>

  </section>
  
  <section>
    <title>Look-and-Feel Customization</title>
    <para>For skinnability implementation, the components use a <emphasis>
      <property>style class redefinition method.</property>
    </emphasis></para>
    
    <para>To redefine the appearance of all <emphasis role="bold">
      <property>&lt;rich:separator&gt;</property>
    </emphasis> components at once, you should add to your style sheets the <emphasis>
      <property>style class</property>
    </emphasis> used by a <emphasis role="bold">
      <property>&lt;rich:separator&gt;</property>
    </emphasis> component.</para>
  </section>
  
  <section>
    <title>Definition of Custom Style Classes</title>
    <table id="sepC">
      <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-separator</entry>
            
            <entry>Defines styles for a component appearance</entry>
          </row>
          
        </tbody>
      </tgroup>
    </table>
    
    <para>In order to redefine styles for all <emphasis role="bold">
      <property>&lt;rich:separator&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="sepC"> above</link>) and define necessary properties in them. </para>
    
    <para>
      <emphasis role="bold">Example:</emphasis>
    </para>
    <programlisting role="CSS"><![CDATA[...
.rich-separator{
    background-color:#ff7700;
}
...]]></programlisting>  
    
    <para>This is a result:</para>
    
    <figure>
      <title>Redefinition styles with predefined classes</title>
      <mediaobject>
        <imageobject>
          <imagedata fileref="images/separator_pc.png"/>
        </imageobject>
      </mediaobject>
    </figure>
    
    <para>In the example background color for separator was changed.</para>
    
    <para>Also it&apos;s possible to change styles of particular <emphasis role="bold"
      ><property>&lt;rich:separator&gt;</property></emphasis> component. In this case you should create own style classes and use them in corresponding <emphasis role="bold"
        ><property>&lt;rich:separator&gt;</property></emphasis> <property>styleClass</property> attributes. An example is placed below:</para>
    
    <para>
      <emphasis role="bold">Example:</emphasis>
    </para>
    <programlisting role="CSS"><![CDATA[...
.myClass{
    background-color:#ffead9;
}
...]]></programlisting>  
    <para>The <emphasis><property>&quot;styleClass&quot;</property></emphasis> attribute for <emphasis role="bold"
      ><property>&lt;rich:separator&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:separator ... styleClass="myClass"/>
]]></programlisting>    
    
    <para>This is a result:</para>
    
    <figure>
      <title>Redefinition styles with own classes and styleClass attributes</title>
      <mediaobject>
        <imageobject>
          <imagedata fileref="images/separator_oc.png"/>
        </imageobject>
      </mediaobject>
    </figure>  
    
    <para>As it could be seen on the picture above,background color for separator was changed.</para>
        
      </section>
  
  <section>
    <title>Relevant Resources Links</title>
    <para>
      <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/separator.jsf?c=separator"
        >Here</ulink> you can see the example of <emphasis role="bold"
        ><property>&lt;rich:separator&gt;</property></emphasis> usage and sources for the given example. </para>
  </section>

</chapter>
