public class FormatterRequest extends Object
A request tells the formatter what and how to format.
When invoking the formatter, the request is passed into IFormatter2.format(FormatterRequest).
A request carries information about:
textRegionAccess which allows to obtain the to-be-formatted semantic model with text regions.Preferences with keys from e.g. FormatterPreferenceKeys.regions that describe how to restrict the text regions for which replacements
are produced.allowIdentityEdits() which will disable automated suppression of text replacements that do
not cause changes.formatUndefinedHiddenRegionsOnly): 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<Exception> |
getExceptionHandler() |
ITypedPreferenceValues |
getPreferences() |
Collection<ITextRegion> |
getRegions() |
ITextRegionAccess |
getTextRegionAccess() |
boolean |
isFormatUndefinedHiddenRegionsOnly() |
FormatterRequest |
setAllowIdentityEdits(boolean allowIdentityEdits) |
FormatterRequest |
setExceptionHandler(IAcceptor<Exception> problemHandler) |
FormatterRequest |
setFormatUndefinedHiddenRegionsOnly(boolean formatUndefinedHiddenRegionsOnly) |
FormatterRequest |
setPreferences(ITypedPreferenceValues preferenceValues) |
FormatterRequest |
setRegions(Collection<ITextRegion> regions) |
FormatterRequest |
setTextRegionAccess(ITextRegionAccess tokens)
Sets the
textRegionAccess. |
public FormatterRequest addRegion(ITextRegion region)
regionspublic FormatterRequest setRegions(Collection<ITextRegion> regions)
regionspublic Collection<ITextRegion> getRegions()
regionspublic ITextRegionAccess getTextRegionAccess()
textRegionAccesspublic 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)
allowIdentityEditspublic boolean allowIdentityEdits()
allowIdentityEditspublic FormatterRequest setPreferences(ITypedPreferenceValues preferenceValues)
preferencespublic ITypedPreferenceValues getPreferences()
preferencespublic boolean isFormatUndefinedHiddenRegionsOnly()
formatUndefinedHiddenRegionsOnlypublic FormatterRequest setFormatUndefinedHiddenRegionsOnly(boolean formatUndefinedHiddenRegionsOnly)
formatUndefinedHiddenRegionsOnlypublic IAcceptor<Exception> getExceptionHandler()
exceptionHandlerpublic FormatterRequest setExceptionHandler(IAcceptor<Exception> problemHandler)
exceptionHandlerCopyright © 2015. All Rights Reserved.