public abstract class FormattableDocument extends java.lang.Object implements IFormattableDocument
| Modifier | Constructor and Description |
|---|---|
protected |
FormattableDocument() |
| Modifier and Type | Method and Description |
|---|---|
void |
addReplacer(ITextReplacer replacer)
Add a new replacer to the document.
|
ISemanticRegion |
append(ISemanticRegion token,
org.eclipse.xtext.xbase.lib.Procedures.Procedure1<? super IHiddenRegionFormatter> after)
Create a new
IHiddenRegionFormatting, initialize it, and add it behind the given semanticRegion. |
<T extends org.eclipse.emf.ecore.EObject> |
append(T owner,
org.eclipse.xtext.xbase.lib.Procedures.Procedure1<? super IHiddenRegionFormatter> after)
Create a new
IHiddenRegionFormatting, initialize it, and add it behind the given semantic object. |
protected java.lang.String |
applyTextReplacements(java.lang.Iterable<ITextReplacement> replacements) |
protected ITextReplacerContext |
createReplacements(ITextReplacerContext previous) |
protected TextSegmentSet<ITextReplacer> |
createTextReplacerSet() |
<T> T |
format(T obj) |
void |
formatConditionally(org.eclipse.emf.ecore.EObject owner,
ISubFormatter... formatters)
Apply the formatting of the first sub formatter that can successfully format the given owner's region.
|
void |
formatConditionally(int offset,
int length,
ISubFormatter... formatters)
Apply the formatting of the first sub formatter that can successfully format the given region.
|
ITypedPreferenceValues |
getPreferences() |
protected TextSegmentSet<ITextReplacer> |
getReplacers() |
ITextRegionAccess |
getTextRegionAccess() |
<T1 extends ISemanticRegion,T2 extends ISemanticRegion> |
interior(org.eclipse.xtext.xbase.lib.Pair<T1,T2> pair,
org.eclipse.xtext.xbase.lib.Procedures.Procedure1<? super IHiddenRegionFormatter> init) |
<T1 extends ISemanticRegion,T2 extends ISemanticRegion> |
interior(T1 first,
T2 second,
org.eclipse.xtext.xbase.lib.Procedures.Procedure1<? super IHiddenRegionFormatter> init) |
<T extends org.eclipse.emf.ecore.EObject> |
interior(T object,
org.eclipse.xtext.xbase.lib.Procedures.Procedure1<? super IHiddenRegionFormatter> init) |
protected boolean |
needsAutowrap(ITextReplacerContext wrappable,
ITextReplacerContext context,
int maxLineWidth) |
ISemanticRegion |
prepend(ISemanticRegion token,
org.eclipse.xtext.xbase.lib.Procedures.Procedure1<? super IHiddenRegionFormatter> before)
Create a new
IHiddenRegionFormatting, initialize it, and add it before the given semanticRegion. |
<T extends org.eclipse.emf.ecore.EObject> |
prepend(T owner,
org.eclipse.xtext.xbase.lib.Procedures.Procedure1<? super IHiddenRegionFormatter> before)
Create a new
IHiddenRegionFormatting, initialize it, and add it before the given semantic object. |
java.util.List<ITextReplacement> |
renderToTextReplacements()
Render the document.
|
org.eclipse.xtext.xbase.lib.Pair<IHiddenRegion,IHiddenRegion> |
set(IHiddenRegion first,
IHiddenRegion second,
org.eclipse.xtext.xbase.lib.Procedures.Procedure1<? super IHiddenRegionFormatter> init) |
IHiddenRegion |
set(IHiddenRegion hiddenRegion,
org.eclipse.xtext.xbase.lib.Procedures.Procedure1<? super IHiddenRegionFormatter> init)
Create a new
IHiddenRegionFormatting, initialize it, and add it for the given hidden region. |
ISemanticRegion |
surround(ISemanticRegion token,
org.eclipse.xtext.xbase.lib.Procedures.Procedure1<? super IHiddenRegionFormatter> beforeAndAfter)
Create a new
IHiddenRegionFormatting, initialize it, and add it before and after the given semantic
region. |
<T extends org.eclipse.emf.ecore.EObject> |
surround(T owner,
org.eclipse.xtext.xbase.lib.Procedures.Procedure1<? super IHiddenRegionFormatter> beforeAndAfter)
Create a new
IHiddenRegionFormatting, initialize it, and add it before and after the given semantic
object. |
java.lang.String |
toString() |
IFormattableSubDocument |
withReplacerFilter(com.google.common.base.Predicate<? super ITextReplacer> filter)
Creates a new formattable document to which only replacers can be added for which the provided predicate yields
true. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetFormatter, getRegion, getRequestprotected TextSegmentSet<ITextReplacer> getReplacers()
public void addReplacer(ITextReplacer replacer)
IFormattableDocumentaddReplacer in interface IFormattableDocumentpublic ISemanticRegion append(ISemanticRegion token, org.eclipse.xtext.xbase.lib.Procedures.Procedure1<? super IHiddenRegionFormatter> after)
IFormattableDocumentIHiddenRegionFormatting, initialize it, and add it behind the given semanticRegion.
Returns the given semantic region.append in interface IFormattableDocumentpublic <T extends org.eclipse.emf.ecore.EObject> T append(T owner,
org.eclipse.xtext.xbase.lib.Procedures.Procedure1<? super IHiddenRegionFormatter> after)
IFormattableDocumentIHiddenRegionFormatting, initialize it, and add it behind the given semantic object.
Returns the given semantic object.append in interface IFormattableDocumentprotected java.lang.String applyTextReplacements(java.lang.Iterable<ITextReplacement> replacements)
protected ITextReplacerContext createReplacements(ITextReplacerContext previous)
protected TextSegmentSet<ITextReplacer> createTextReplacerSet()
public <T> T format(T obj)
format in interface IFormattableDocumentpublic void formatConditionally(org.eclipse.emf.ecore.EObject owner,
ISubFormatter... formatters)
IFormattableDocumentFormattingNotApplicableException.formatConditionally in interface IFormattableDocumentpublic void formatConditionally(int offset,
int length,
ISubFormatter... formatters)
throws FormattingNotApplicableException
IFormattableDocumentFormattingNotApplicableException.formatConditionally in interface IFormattableDocumentFormattingNotApplicableExceptionpublic ITypedPreferenceValues getPreferences()
public ITextRegionAccess getTextRegionAccess()
public <T1 extends ISemanticRegion,T2 extends ISemanticRegion> org.eclipse.xtext.xbase.lib.Pair<T1,T2> interior(org.eclipse.xtext.xbase.lib.Pair<T1,T2> pair, org.eclipse.xtext.xbase.lib.Procedures.Procedure1<? super IHiddenRegionFormatter> init)
interior in interface IFormattableDocumentpublic <T extends org.eclipse.emf.ecore.EObject> T interior(T object,
org.eclipse.xtext.xbase.lib.Procedures.Procedure1<? super IHiddenRegionFormatter> init)
interior in interface IFormattableDocumentpublic <T1 extends ISemanticRegion,T2 extends ISemanticRegion> org.eclipse.xtext.xbase.lib.Pair<T1,T2> interior(T1 first, T2 second, org.eclipse.xtext.xbase.lib.Procedures.Procedure1<? super IHiddenRegionFormatter> init)
interior in interface IFormattableDocumentprotected boolean needsAutowrap(ITextReplacerContext wrappable, ITextReplacerContext context, int maxLineWidth)
public ISemanticRegion prepend(ISemanticRegion token, org.eclipse.xtext.xbase.lib.Procedures.Procedure1<? super IHiddenRegionFormatter> before)
IFormattableDocumentIHiddenRegionFormatting, initialize it, and add it before the given semanticRegion.
Returns the given semantic region.prepend in interface IFormattableDocumentpublic <T extends org.eclipse.emf.ecore.EObject> T prepend(T owner,
org.eclipse.xtext.xbase.lib.Procedures.Procedure1<? super IHiddenRegionFormatter> before)
IFormattableDocumentIHiddenRegionFormatting, initialize it, and add it before the given semantic object.
Returns the given semantic object.prepend in interface IFormattableDocumentpublic java.util.List<ITextReplacement> renderToTextReplacements()
IFormattableDocumentrenderToTextReplacements in interface IFormattableDocumentpublic org.eclipse.xtext.xbase.lib.Pair<IHiddenRegion,IHiddenRegion> set(IHiddenRegion first, IHiddenRegion second, org.eclipse.xtext.xbase.lib.Procedures.Procedure1<? super IHiddenRegionFormatter> init)
set in interface IFormattableDocumentpublic IHiddenRegion set(IHiddenRegion hiddenRegion, org.eclipse.xtext.xbase.lib.Procedures.Procedure1<? super IHiddenRegionFormatter> init)
IFormattableDocumentIHiddenRegionFormatting, initialize it, and add it for the given hidden region.
Returns the given hidden region.set in interface IFormattableDocumentpublic ISemanticRegion surround(ISemanticRegion token, org.eclipse.xtext.xbase.lib.Procedures.Procedure1<? super IHiddenRegionFormatter> beforeAndAfter)
IFormattableDocumentIHiddenRegionFormatting, initialize it, and add it before and after the given semantic
region.
Returns the given semantic region.surround in interface IFormattableDocumentpublic <T extends org.eclipse.emf.ecore.EObject> T surround(T owner,
org.eclipse.xtext.xbase.lib.Procedures.Procedure1<? super IHiddenRegionFormatter> beforeAndAfter)
IFormattableDocumentIHiddenRegionFormatting, initialize it, and add it before and after the given semantic
object.
Returns the given semantic object.surround in interface IFormattableDocumentpublic java.lang.String toString()
toString in class java.lang.Objectpublic IFormattableSubDocument withReplacerFilter(com.google.common.base.Predicate<? super ITextReplacer> filter)
IFormattableDocumenttrue.withReplacerFilter in interface IFormattableDocument