# Configuring Default Formatters for EGL programs

Conscientious developers apply various conventions to produce readable code. EGL encourages programmers to prioritise the readability of EGL templates over the readability of the text that is generated, and provides several built-in formatters for improving the readability of generated text. For example, the built-in Java formatter corrects the layout and indentation of generated text that resembles a Java program.

Default formatters are applied to every template invocation in an EGL program. Specify one (or more) default formatters on this tab if you wish to format the text generated by every template in your EGL program. If you wish to have configure formatters in a template-specific manner, do not set default formatters on this tab, and instead configure formatters programmatically. For example:

    template.setFormatter(new Native('org.eclipse.epsilon.egl.formatter.language.JavaFormatter'))

To add a default formatter, select the Add.. button under the "Default Formatters" group of the "Generated Text" tab.

Formatters can be composed. When more than one formatter is added to the table on the "Generated Text" tab, formatters are executed in sequence (from top to bottom) for each template invocation in the EGL program.

You can define custom formatters by providing a plug-in that contributes to the following extension point.

    org.eclipse.epsilon.egl.dt.formatter