org.eclipse.cdt.internal.corext.template.c
Class CFormatter

java.lang.Object
  extended by org.eclipse.cdt.internal.corext.template.c.CFormatter

public class CFormatter
extends java.lang.Object

A template editor using the C/C++ formatter to format a template buffer.


Constructor Summary
CFormatter(java.lang.String lineDelimiter, int initialIndentLevel, boolean useCodeFormatter, org.eclipse.cdt.core.model.ICProject project)
          Creates a CFormatter with the target line delimiter.
 
Method Summary
 void format(org.eclipse.jface.text.templates.TemplateBuffer buffer, org.eclipse.jface.text.templates.TemplateContext context)
          Formats the template buffer.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CFormatter

public CFormatter(java.lang.String lineDelimiter,
                  int initialIndentLevel,
                  boolean useCodeFormatter,
                  org.eclipse.cdt.core.model.ICProject project)
Creates a CFormatter with the target line delimiter.

Parameters:
lineDelimiter - the line delimiter to use
initialIndentLevel - the initial indentation level
useCodeFormatter - true if the core code formatter should be used
project - the C/C++ project from which to get the preferences, or null for workbench settings
Method Detail

format

public void format(org.eclipse.jface.text.templates.TemplateBuffer buffer,
                   org.eclipse.jface.text.templates.TemplateContext context)
            throws org.eclipse.jface.text.BadLocationException
Formats the template buffer.

Parameters:
buffer -
context -
Throws:
org.eclipse.jface.text.BadLocationException