public abstract class FormattableDocument extends 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,
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,
Procedures.Procedure1<? super IHiddenRegionFormatter> after)
Create a new
IHiddenRegionFormatting, initialize it, and add it behind the given semantic object. |
protected String |
applyTextReplacements(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() |
ITextRegionAccess |
getTextRegionAccess() |
<T1 extends ISemanticRegion,T2 extends ISemanticRegion> |
interior(Pair<T1,T2> pair,
Procedures.Procedure1<? super IHiddenRegionFormatter> init) |
<T1 extends ISemanticRegion,T2 extends ISemanticRegion> |
interior(T1 first,
T2 second,
Procedures.Procedure1<? super IHiddenRegionFormatter> init) |
<T extends org.eclipse.emf.ecore.EObject> |
interior(T object,
Procedures.Procedure1<? super IHiddenRegionFormatter> init) |
protected boolean |
needsAutowrap(ITextReplacerContext wrappable,
ITextReplacerContext context,
int maxLineWidth) |
ISemanticRegion |
prepend(ISemanticRegion token,
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,
Procedures.Procedure1<? super IHiddenRegionFormatter> before)
Create a new
IHiddenRegionFormatting, initialize it, and add it before the given semantic object. |
List<ITextReplacement> |
renderToTextReplacements()
Render the document.
|
Pair<IHiddenRegion,IHiddenRegion> |
set(IHiddenRegion first,
IHiddenRegion second,
Procedures.Procedure1<? super IHiddenRegionFormatter> init) |
IHiddenRegion |
set(IHiddenRegion hiddenRegion,
Procedures.Procedure1<? super IHiddenRegionFormatter> init)
Create a new
IHiddenRegionFormatting, initialize it, and add it for the given hidden region. |
ISemanticRegion |
surround(ISemanticRegion token,
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,
Procedures.Procedure1<? super IHiddenRegionFormatter> beforeAndAfter)
Create a new
IHiddenRegionFormatting, initialize it, and add it before and after the given semantic
object. |
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, getRequestpublic void addReplacer(ITextReplacer replacer)
IFormattableDocumentaddReplacer in interface IFormattableDocumentpublic ISemanticRegion append(ISemanticRegion token, 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,
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 String applyTextReplacements(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> Pair<T1,T2> interior(Pair<T1,T2> pair, Procedures.Procedure1<? super IHiddenRegionFormatter> init)
interior in interface IFormattableDocumentpublic <T extends org.eclipse.emf.ecore.EObject> T interior(T object,
Procedures.Procedure1<? super IHiddenRegionFormatter> init)
interior in interface IFormattableDocumentpublic <T1 extends ISemanticRegion,T2 extends ISemanticRegion> Pair<T1,T2> interior(T1 first, T2 second, Procedures.Procedure1<? super IHiddenRegionFormatter> init)
interior in interface IFormattableDocumentprotected boolean needsAutowrap(ITextReplacerContext wrappable, ITextReplacerContext context, int maxLineWidth)
public ISemanticRegion prepend(ISemanticRegion token, 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,
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 List<ITextReplacement> renderToTextReplacements()
IFormattableDocumentrenderToTextReplacements in interface IFormattableDocumentpublic Pair<IHiddenRegion,IHiddenRegion> set(IHiddenRegion first, IHiddenRegion second, Procedures.Procedure1<? super IHiddenRegionFormatter> init)
set in interface IFormattableDocumentpublic IHiddenRegion set(IHiddenRegion hiddenRegion, 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, 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,
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 IFormattableSubDocument withReplacerFilter(com.google.common.base.Predicate<? super ITextReplacer> filter)
IFormattableDocumenttrue.withReplacerFilter in interface IFormattableDocumentCopyright © 2015. All Rights Reserved.