public class FormatterRequest
extends java.lang.Object
IFormatter2.format(FormatterRequest)
.- the to-be-formatted semantic model with text regions.
,
- provide for preferences key from e.g. {@link FormatterPreferenceKeys}.
,
- restrict the text regions for which {@link ITextReplacement}s are produced.
,
- do not suppress text replacements that do not cause changes.
,
- only format regions that have no whitespace information yet.
Constructor and Description |
---|
FormatterRequest() |
Modifier and Type | Method and Description |
---|---|
FormatterRequest |
addRegion(ITextRegion region) |
boolean |
allowIdentityEdits() |
IAcceptor<java.lang.Exception> |
getExceptionHandler() |
ITypedPreferenceValues |
getPreferences() |
java.util.Collection<ITextRegion> |
getRegions() |
ITextRegionAccess |
getTextRegionAccess() |
boolean |
isFormatUndefinedHiddenRegionsOnly()
IHiddenRegion s are considers undefined when their whitespace/comments are unknown. |
FormatterRequest |
setAllowIdentityEdits(boolean allowIdentityEdits) |
FormatterRequest |
setExceptionHandler(IAcceptor<java.lang.Exception> problemHandler) |
FormatterRequest |
setFormatUndenfinedTokensOnly(boolean formatUndenfinedTokensOnly) |
FormatterRequest |
setPreferences(ITypedPreferenceValues preferenceValues) |
FormatterRequest |
setRegions(java.util.Collection<ITextRegion> regions) |
FormatterRequest |
setTextRegionAccess(ITextRegionAccess tokens)
Sets the
textRegionAccess . |
public FormatterRequest addRegion(ITextRegion region)
public FormatterRequest setRegions(java.util.Collection<ITextRegion> regions)
public java.util.Collection<ITextRegion> getRegions()
public ITextRegionAccess getTextRegionAccess()
public FormatterRequest setTextRegionAccess(ITextRegionAccess tokens)
textRegionAccess
. If the region has syntax errors and no explicit
ExceptionAcceptor
is configured yet, the ignoring acceptor
will be configured.public FormatterRequest setAllowIdentityEdits(boolean allowIdentityEdits)
public boolean allowIdentityEdits()
public FormatterRequest setPreferences(ITypedPreferenceValues preferenceValues)
public ITypedPreferenceValues getPreferences()
public boolean isFormatUndefinedHiddenRegionsOnly()
IHiddenRegion
s are considers undefined when their whitespace/comments are unknown. This happens for
HiddenRegions that emerged between programmatically created (not parsed!) model elements.
Enable this options if, for example, you serialize a model after applying a quick fix, refactoring or have it
edited in a graphical editor and you want to keep the whitespace-changes to a minimum.public FormatterRequest setFormatUndenfinedTokensOnly(boolean formatUndenfinedTokensOnly)
public IAcceptor<java.lang.Exception> getExceptionHandler()
public FormatterRequest setExceptionHandler(IAcceptor<java.lang.Exception> problemHandler)