<?xml version="1.0" encoding="UTF-8"?>
<section>
  <sectioninfo>
    <keywordset>
      <keyword>rich:insert</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.ui.Insert</entry>
        </row>

        <row>
          <entry>component-class</entry>

          <entry>org.richfaces.ui.component.html.HtmlInsert</entry>
        </row>

        <row>
          <entry>component-family</entry>

          <entry>org.richfaces.ui.Insert</entry>
        </row>

        <row>
          <entry>renderer-type</entry>

          <entry>org.richfaces.ui.InsertRenderer</entry>
        </row>

        <row>
          <entry>tag-class</entry>

          <entry>org.richfaces.ui.taglib.InsertTag</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:insert  src="/pages/sourcePage.xhtml" highlight="xhtml"/>
...]]></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.ui.component.html.HtmlInsert; 	
...
HtmlInsert myInsert = new HtmlInsert();
...
]]></programlisting>
  </section>

  <section>
    <title>Details of Usage</title>
    <para>The are two basic attributes. The <emphasis>
        <property>&quot;src&quot;</property>
      </emphasis> attribute defines the path to the file with source code. The <emphasis>
        <property>&quot;highlight&quot;</property>
      </emphasis> attribute defines the type of a syntax highlighting.</para>
    <para>If <emphasis>
        <property>&quot;highlight&quot;</property>
      </emphasis> attribute is defined and <ulink url="https://jhighlight.dev.java.net/">
      JHighlight</ulink> open source library is in the classpath, the text from the file is
      formated and colorized.</para>
    <para>An example is placed below.</para>
    <para>
      <emphasis role="bold">Example:</emphasis>
    </para>
    <programlisting role="XML"><![CDATA[...
      <rich:insert  src="/pages/sourcePage.xhtml" highlight="xhtml"/>
...]]></programlisting>
    
      <para>The result of using <emphasis role="bold">
          <property>&lt;rich:insert&gt;</property>
      </emphasis> component is shown on the picture:</para>
    <figure>
      <title>Source code highlighting</title>
      <mediaobject>
        <imageobject>
          <imagedata fileref="images/insert_init.png"/>
        </imageobject>
      </mediaobject>
    </figure>
    <para>The <emphasis role="bold">
        <property>&lt;rich:insert&gt;</property>
      </emphasis> component provides the same functionality as <ulink
        url="https://jhighlight.dev.java.net/">JHighlight</ulink>. Thus, all names of highlight
      style classes for source code of particular language could be changed to your names, which are
      used by the <ulink url="https://jhighlight.dev.java.net/">JHighlight</ulink> library.</para>
  </section>
  
  <section>
    <title>Look-and-Feel Customization</title>
    
    <para><emphasis role="bold">
      <property>&lt;rich:insert&gt;</property>
    </emphasis> has no skin parameters and custom <property>style classes</property>, as the
      component doesn&apos;t have own visual representation.</para>
  </section>
  
  <section>
    <title>Relevant Resources Links</title>
    <para><ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/insert.jsf?c=insert"
      >On RichFaces LiveDemo page </ulink> you can found some additional information for <emphasis role="bold"
        ><property>&lt;rich:insert&gt;</property></emphasis> component usage. </para>
  </section>          
</section>
