Package org.eclipse.xtext.formatting2
Interface IHiddenRegionFormatter
-
- All Known Implementing Classes:
AbstractHiddenRegionFormatter
,DoubleHiddenRegionFormatter
,SingleHiddenRegionFormatter
public interface IHiddenRegionFormatter
AnIHiddenRegionFormatter
is used to build a formatting setting for a hidden region.- Since:
- 2.7
- See Also:
IHiddenRegionFormatting
- Noextend:
- This interface is not intended to be extended by clients.
- Noimplement:
- This interface is not intended to be implemented by clients.
-
-
Field Summary
Fields Modifier and Type Field Description static int
HIGH_PRIORITY
static int
LOW_PRIORITY
static int
NORMAL_PRIORITY
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
autowrap()
Configure autowrap.void
autowrap(int triggerLength)
Configure autowrap.FormatterRequest
getRequest()
Returns teh current formatter request and allows to read configuration settings.void
highPriority()
When merging, treat this configuration with a high priority.void
indent()
void
lowPriority()
When merging, treat this configuration with a low priority.void
newLine()
Forces a line break in this hidden region.void
noAutowrap()
Suppresses auto wrap in this hidden region.void
noIndentation()
Resets the indentation level to zero.void
noSpace()
Format this hidden region with using no space (zero characters).void
oneSpace()
One space is added at this hidden region.void
setNewLines(int newLines)
Forces the number of newlines in this hidden region.void
setNewLines(int minNewLines, int defaultNewLines, int maxNewLines)
Configures the given new lines for this hidden region.void
setOnAutowrap(IAutowrapFormatter formatter)
Callback if autowrapping was applied.void
setPriority(int priority)
Sets the priority of this formatting configuration.void
setSpace(java.lang.String space)
The given space is used for this hidden region.
-
-
-
Field Detail
-
HIGH_PRIORITY
static final int HIGH_PRIORITY
- See Also:
- Constant Field Values
-
LOW_PRIORITY
static final int LOW_PRIORITY
- See Also:
- Constant Field Values
-
NORMAL_PRIORITY
static final int NORMAL_PRIORITY
- See Also:
- Constant Field Values
-
-
Method Detail
-
autowrap
void autowrap()
Configure autowrap. Same asautowrap(0)
.
-
autowrap
void autowrap(int triggerLength)
Configure autowrap. The triggerLength allows to shift the wrapping point beyond its actual position in the file. If a line has multiple wrapping points it will scan backwards for the first autowrapped region. The triggerLength moves this region logically such it will be found earlier.
-
noAutowrap
void noAutowrap()
Suppresses auto wrap in this hidden region.
-
setOnAutowrap
void setOnAutowrap(IAutowrapFormatter formatter)
Callback if autowrapping was applied.
-
getRequest
FormatterRequest getRequest()
Returns teh current formatter request and allows to read configuration settings.
-
highPriority
void highPriority()
When merging, treat this configuration with a high priority.- See Also:
lowPriority()
,HIGH_PRIORITY
-
lowPriority
void lowPriority()
When merging, treat this configuration with a low priority.- See Also:
highPriority()
,LOW_PRIORITY
-
setPriority
void setPriority(int priority)
Sets the priority of this formatting configuration. Used when two configurations should be merged. The priority of this formatter; the default value isNORMAL_PRIORITY
.
-
noIndentation
void noIndentation()
Resets the indentation level to zero.
-
indent
void indent()
-
newLine
void newLine()
Forces a line break in this hidden region. Same assetNewLines(1)
.
-
setNewLines
void setNewLines(int newLines)
Forces the number of newlines in this hidden region. Same assetNewLines(nl, nl, nl)
-
setNewLines
void setNewLines(int minNewLines, int defaultNewLines, int maxNewLines)
Configures the given new lines for this hidden region. Keeps the current configuration if it is in the valid boundaries ofminNewLines
andmaxNewLines
. AppliesdefaultNewLines
otherwise.
-
noSpace
void noSpace()
Format this hidden region with using no space (zero characters). Same assetSpace("")
.
-
oneSpace
void oneSpace()
One space is added at this hidden region. Same assetSpace(" ")
.
-
setSpace
void setSpace(java.lang.String space)
The given space is used for this hidden region.
-
-