<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | |
<html> | |
<head> | |
<title>Using EMF models with Epsilon programs</title> | |
<link rel="stylesheet" href="../../../book.css" charset="utf-8" type="text/css"> | |
</head> | |
<body> | |
<div id="banner"> | |
<img src="../../../help_banner.jpg"></img> | |
</div> | |
<div id="content"> | |
<h1> | |
Configuring Default Formatters for EGL programs | |
</h1> | |
<p> | |
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. | |
</p> | |
<p> | |
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: | |
<pre><code>template.setFormatter(new Native('org.eclipse.epsilon.egl.formatter.language.JavaFormatter'))</code></pre> | |
<p> | |
To add a default formatter, select the Add.. button under the "Default Formatters" group of the | |
"Generated Text" tab. | |
</p> | |
<p> | |
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. | |
</p> | |
<p> | |
You can define custom formatters by providing a plug-in that contributes to the | |
following extension point. | |
<pre><code>org.eclipse.epsilon.egl.dt.formatter</code></pre> | |
</p> | |
</body> | |
</html> |