insert

Component identification parameters

Name | Value
--- | ---
component-type | org.richfaces.ui.Insert
component-class | org.richfaces.ui.component.html.HtmlInsert
component-family | org.richfaces.ui.Insert
renderer-type | org.richfaces.ui.InsertRenderer
tag-class | org.richfaces.ui.taglib.InsertTag

## Creating the Component with a Page Tag

To create the simplest variant on a page use the following syntax:

Example:

    ...
          <rich:insert  src="/pages/sourcePage.xhtml" highlight="xhtml"/>
    ...

## Creating the Component Dynamically Using Java

Example:

    import org.richfaces.ui.component.html.HtmlInsert;
    ...
    HtmlInsert myInsert = new HtmlInsert();
    ...

## Details of Usage

The are two basic attributes. The "src" attribute defines the path to the file with source code. The "highlight" attribute defines the type of a syntax highlighting.

If "highlight" attribute is defined and JHighlight open source library is in the classpath, the text from the file will be formated and colorized.

An example is placed below.

Example:

    ...
          <rich:insert  src="/pages/sourcePage.xhtml" highlight="xhtml"/>
    ...

The result of using <rich:insert> component is shown on the picture:

Source code highlighting

The <rich:insert> component provides the same functionalitity as JHighlight. Thus, all names of highlight style classes for source code of particular language could be changed to your names, wich are used by the JHighlight library.

## Look-and-Feel Customization

<rich:insert> has no skin parameters and custom style classes, as the component doesn't have own visual representation.

## Relevant Resources Links

Here you can see the example of <rich:insert> usage and sources for the given example.