public interface IFormattableDocument
ITextReplacer
s. Each TextReplacer is
responsible for a text region inside this document. The document can be populated with TextReplacers in any order.
However, it is not possible and not intended to register two or more TextReplacers for the same or overlapping
TextRegion.
Eventually, all TextReplacers are invoked from the beginning of the document to the end of the document. Each
TextReplacer produces ITextReplacement
s for their region. A ITextReplacerContext
is passed on from
Replacer to Replacer and holds state such as the current indentation level.
Besides this, a FormattableDocument
ITextRegionAccess
for a definition of
HiddenRegions and IHiddenRegionFormatter
for how they can be formatted.IFormattableDocument withReplacerFilter(com.google.common.base.Predicate<ITextReplacer> filter)
ITextSegment getRegion()
void addReplacer(ITextReplacer replacer)
ISemanticRegion append(ISemanticRegion semanticRegion, Procedures.Procedure1<IHiddenRegionFormatter> after)
<T extends org.eclipse.emf.ecore.EObject> T append(T semanticRegion, Procedures.Procedure1<IHiddenRegionFormatter> after)
void formatConditionally(org.eclipse.emf.ecore.EObject owner, ISubFormatter... formatters) throws FormattingNotApplicableException
FormattingNotApplicableException
void formatConditionally(int offset, int length, ISubFormatter... formatters) throws FormattingNotApplicableException
FormattingNotApplicableException
AbstractFormatter2 getFormatter()
FormatterRequest getRequest()
ISemanticRegion prepend(ISemanticRegion semanticRegion, Procedures.Procedure1<IHiddenRegionFormatter> before)
<T extends org.eclipse.emf.ecore.EObject> T prepend(T semanticRegion, Procedures.Procedure1<IHiddenRegionFormatter> before)
IHiddenRegion set(IHiddenRegion hiddenRegion, Procedures.Procedure1<IHiddenRegionFormatter> init)
ISemanticRegion surround(ISemanticRegion semanticRegion, Procedures.Procedure1<IHiddenRegionFormatter> beforeAndAfter)
<T extends org.eclipse.emf.ecore.EObject> T surround(T owner, Procedures.Procedure1<IHiddenRegionFormatter> beforeAndAfter)