<?xml version='1.0' encoding='UTF-8'?>
<section>
  <sectioninfo>
    <keywordset>
      <keyword>rectangle</keyword>
      <keyword>rich:panel</keyword>
      <keyword>HtmlPanel</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.panel</entry>
        </row>
        <row>
          <entry>component-class</entry>
          <entry>org.richfaces.component.html.HtmlPanel</entry>
        </row>
        <row>
          <entry>component-family</entry>
          <entry>org.richfaces.panel</entry>
        </row>
        <row>
          <entry>renderer-type</entry>
          <entry>org.richfaces.PanelRenderer</entry>
        </row>
        <row>
          <entry>tag-class</entry>
          <entry>org.richfaces.taglib.PanelTag</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:panel header="Panel Header">
        ...
        <!--Any Content inside-->
        ...
    </rich:panel>
...
]]></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.HtmlPanel;
...
HtmlPanel myPanel = new HtmlPanel();
...
]]></programlisting>
  </section>
  <section>
    <title>Details of Usage</title>
    <para>The <emphasis ><property>&quot;header&quot;</property></emphasis > attribute defines text to be represented. If you can use the
      <emphasis ><property>&quot;header&quot;</property></emphasis > facet, you can even not use the <emphasis ><property>&quot;header&quot;</property></emphasis > attribute.</para>
    <emphasis role="bold">Example:</emphasis>
    <programlisting role="XML"><![CDATA[...
    <rich:panel>
        <f:facet name="header">  
            <h:graphicImage value="/images/img1.gif"/>
        </f:facet>
        ...
        <!--Any Content inside-->
        ...
    </rich:panel>
...
]]></programlisting>
    
    <para><emphasis role="bold">
        <property>&lt;rich:panel&gt;</property>
      </emphasis> components are used to group page content pieces on similarly formatted
      rectangular <property>panels</property>. </para>
    <para>
      <emphasis role="bold">Example:</emphasis>
    </para>
    <programlisting role="XML"><![CDATA[...
    <rich:panel>
        ...
    </rich:panel>
...
]]></programlisting>
    <para>It&apos;s generating on a page in the following way:</para>
    <figure>
      <title>Generated panel without header</title>

      <mediaobject>
        <imageobject>
          <imagedata fileref="images/panel.gif"/>
        </imageobject>
      </mediaobject>
    </figure>
  </section>
  <section>
    <para>The example shows that similar rectangular areas are formed with a particular style.</para>
    <para>When creating a <property>panel</property> with a header element, one more <emphasis
        role="bold">
        <property>&lt;div&gt;</property>
      </emphasis> element is added with content defined for a header.</para>
    <para>
      <emphasis role="bold">Example:</emphasis>
    </para>
    <programlisting role="XML"><![CDATA[...
    <rich:panel>
        <f:facet name="header">
            <h:outputText value="Olympus EVOLT E-500 "/>
        </f:facet>
        ...
    </rich:panel>
...
]]></programlisting>
    <para>It&apos;s displayed on a page in the following way:</para>
    <figure>
      <title>Panel with header</title>

      <mediaobject>
        <imageobject>
          <imagedata fileref="images/panel2.gif"/>
        </imageobject>
      </mediaobject>
    </figure>
    <para>As it has been mentioned <link linkend="panel">above</link>, the component is mostly used for a page style definition,
      hence the main attributes are style ones.</para>
    <itemizedlist>
      <listitem><emphasis><property> &quot;styleClass&quot; </property></emphasis>and &quot;style&quot; </listitem>
      <listitem><emphasis><property> &quot;headerClass&quot; </property></emphasis>and<emphasis><property> &quot;headerStyle&quot; </property></emphasis></listitem>
      <listitem><emphasis><property> &quot;bodyClass&quot; </property></emphasis>and<emphasis><property> &quot;bodyStyle&quot; </property></emphasis></listitem>
    </itemizedlist>
    <para>Moreover, to add e.g. some JavaScript effects, events defined on it are used.</para>
    <itemizedlist>
      <listitem> &quot;onmouseover&quot; </listitem>
      <listitem> &quot;onclick&quot; </listitem>
      <listitem> &quot;onmouseout&quot; </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>Default style classes are mapped on <emphasis><property>skin
      parameters</property>.</emphasis></para>
    <para>To redefine appearance of all panels at once, there are two ways:</para>
    <itemizedlist>
      <listitem>to redefine corresponding skin parameters</listitem>
      <listitem>to add <emphasis>
          <property>style classes</property>
        </emphasis> used by the panel to your page style sheets</listitem>
    </itemizedlist>
  </section>
  <section>
    <title>Skin Parameters Redefinition</title>
    <table>
      <title>Skin parameters for the panel</title>
      <tgroup cols="2">
        <thead>
          <row>
            <entry>Skin parameters</entry>
            <entry>CSS properties</entry>
          </row>
        </thead>
        <tbody>
          <row>
            <entry>generalBackgroundColor</entry>
            <entry>background-color</entry>
          </row>
          <row>
            <entry>panelBorderColor</entry>
            <entry>border-color</entry>
          </row>
        </tbody>
      </tgroup>
    </table>
    <table>
      <title>Parameters for a header element</title>
      <tgroup cols="2">
        <thead>
          <row>
            <entry>Skin parameters</entry>
            <entry>CSS properties</entry>
          </row>
        </thead>
        <tbody>
          <row>
            <entry>headerBackgroundColor</entry>
            <entry>background-color</entry>
          </row>
          <row>
            <entry>headerBackgroundColor</entry>
            <entry>border-color</entry>
          </row>
          <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>
    <table>
      <title>Parameters for a body element</title>
      <tgroup cols="2">
        <thead>
          <row>
            <entry>Skin parameters</entry>
            <entry>CSS properties</entry>
          </row>
        </thead>
        <tbody>
          <row>
            <entry>generalSizeFont</entry>
            <entry>font-size</entry>
          </row>
          <row>
            <entry>generalTextColor</entry>
            <entry>color</entry>
          </row>
          <row>
            <entry>generalFamilyFont</entry>
            <entry>font-family</entry>
          </row>
        </tbody>
      </tgroup>
    </table>
  </section>
  <section>
    <title>Definition of Custom Style Classes</title>
    <figure>
      <title>Style classes of panel</title>

      <mediaobject>
        <imageobject>
          <imagedata fileref="images/panel3.png"/>
        </imageobject>
      </mediaobject>
    </figure>
    <para>On the screenshot, there are classes names that define specified elements.</para>
    <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-panel</entry>
            <entry>Defines styles for a wrapper  &lt;div&gt; element of a panel</entry>
          </row>
          <row>
            <entry>rich-panel-header</entry>
            <entry>Defines styles for header element of a panel</entry>
          </row>
          <row>
            <entry>rich-panel-body</entry>
            <entry>Defines styles for a panel body</entry>
          </row>
        </tbody>
      </tgroup>
    </table>
    <para>In order to redefine styles for all <emphasis role="bold">
      <property>&lt;rich:panel&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:panel&gt;</property>
    </emphasis> components, define your own style classes in the corresponding <emphasis
      role="bold">
      <property>&lt;rich:panel&gt;</property>
    </emphasis>attribute.</para>
    <para>CSS code piece used on a page:</para>

    <para>
      <emphasis role="bold">Example:</emphasis>
    </para>
    <programlisting role="XML"><![CDATA[...
    .rich-panel-header{
        background-color:#F99;
    }
    .myClass{
        font-style:italic;
    }
...
]]></programlisting>
    <para>Hence, a header class is redefined for all <property>panels</property> (its color changed)
      of this page and body class is extended with the custom style properties (font-style) for this
      particular <property>panel</property>. As a result, the <property>panel</property> with a
      header redefined color and a text style in body is got.</para>
    <figure>
      <title>Panel with redefined header and body text style</title>

      <mediaobject>
        <imageobject>
          <imagedata fileref="images/panel4.gif"/>
        </imageobject>
      </mediaobject>
    </figure>
  </section>
  <section>
    <title>Relevant Resources Links</title>
    <para>
      <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/panel.jsf?c=panel"
      >Here</ulink> you can see the example of <emphasis role="bold"
      ><property>&lt;rich:panel&gt;</property></emphasis> usage and sources for the given example. </para>
  </section>

</section>
