<?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>width</property>
      </emphasis> and <emphasis>
        <property>height</property>
      </emphasis> attributes that should be specified in pixels.</para>
    <para>The line type can be customized with the <emphasis>
        <property>&quot;lineType&quot;</property>
      </emphasis> parameter. For example, different line types are shown after rendering with the
      following initial settings <emphasis>
        <property>lineType=&quot;double&quot;</property>
      </emphasis>and <emphasis>
        <property>&quot;lineType=&quot;solid&quot;.</property>
      </emphasis>
    </para>
    <figure>
      <title>Different line types of <emphasis role="bold"><property>&lt;rich:separator&gt;</property></emphasis></title>
      <mediaobject>
        <imageobject>
          <imagedata fileref="images/separator1.png"/>
        </imageobject>
      </mediaobject>
    </figure>

    <para>Except style attributes, there are also event definition attributes.</para>
    <itemizedlist>
      <listitem> onmouseover </listitem>
      <listitem> onclick </listitem>
      <listitem> onmouseout </listitem>
      <listitem> etc. </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/separatorClass.png"/>
        </imageobject>
      </mediaobject>
    </figure>
    
    <para>In the example background color for separator was changed.</para>
    
    <para>Also it’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’s shown in the example below:</para>
    
    <para>
      <emphasis role="bold">Example:</emphasis>
    </para>
    <programlisting role="CSS"><![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/separatorStyle.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>
