Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.eclipse.jface.text.formatter
Interface IContentFormatter  view IContentFormatter download IContentFormatter.java

All Known Implementing Classes:
ContentFormatter, MultiPassContentFormatter

public interface IContentFormatter

The interface of a document content formatter. The formatter formats ranges within documents. The documents are modified by the formatter.

The content formatter is assumed to determine the partitioning of the document range to be formatted. For each partition, the formatter determines based on the partition's content type the formatting strategy to be used. Before the first strategy is activated all strategies are informed about the start of the formatting process. After that, the formatting strategies are activated in the sequence defined by the partitioning of the document range to be formatted. It is assumed that a strategy must be finished before the next strategy can be activated. After the last strategy has been finished, all strategies are informed about the termination of the formatting process.

The interface can be implemented by clients. By default, clients use ContentFormatter or MultiPassContentFormatter as the standard implementers of this interface.


Method Summary
 void format(org.eclipse.jface.text.IDocument document, org.eclipse.jface.text.IRegion region)
          Formats the given region of the specified document.The formatter may safely assume that it is the only subject that modifies the document at this point in time.
 IFormattingStrategy getFormattingStrategy(java.lang.String contentType)
          Returns the formatting strategy registered for the given content type.
 

Method Detail

format

public void format(org.eclipse.jface.text.IDocument document,
                   org.eclipse.jface.text.IRegion region)
Formats the given region of the specified document.The formatter may safely assume that it is the only subject that modifies the document at this point in time.


getFormattingStrategy

public IFormattingStrategy getFormattingStrategy(java.lang.String contentType)
Returns the formatting strategy registered for the given content type.