Class NodeHidden
- java.lang.Object
-
- org.eclipse.xtext.formatting2.regionaccess.internal.AbstractTextSegment
-
- org.eclipse.xtext.formatting2.regionaccess.internal.NodeRegion
-
- org.eclipse.xtext.formatting2.regionaccess.internal.NodeHidden
-
- All Implemented Interfaces:
java.lang.Comparable<ITextSegment>
,IHiddenRegionPart
,ITextSegment
,org.eclipse.xtext.util.ITextRegion
- Direct Known Subclasses:
NodeComment
,NodeWhitespace
public class NodeHidden extends NodeRegion implements IHiddenRegionPart
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
NodeHidden(NodeHiddenRegion hidden, INode node)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HiddenRegionPartAssociation
getAssociation()
AbstractRule
getGrammarElement()
IHiddenRegion
getHiddenRegion()
IHiddenRegionPart
getNextHiddenPart()
IHiddenRegionPart
getPreviousHiddenPart()
protected void
setAssociation(HiddenRegionPartAssociation association)
-
Methods inherited from class org.eclipse.xtext.formatting2.regionaccess.internal.NodeRegion
getLength, getNode, getOffset, getTextRegionAccess, toString
-
Methods inherited from class org.eclipse.xtext.formatting2.regionaccess.internal.AbstractTextSegment
compareTo, contains, contains, equals, getEndOffset, getLineCount, getLineRegions, getText, hashCode, isMultiline, merge, replaceWith
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.xtext.util.ITextRegion
contains, contains, getLength, getOffset
-
Methods inherited from interface org.eclipse.xtext.formatting2.regionaccess.ITextSegment
getEndOffset, getLineCount, getLineRegions, getText, getTextRegionAccess, isMultiline, merge, replaceWith
-
-
-
-
Constructor Detail
-
NodeHidden
protected NodeHidden(NodeHiddenRegion hidden, INode node)
-
-
Method Detail
-
getGrammarElement
public AbstractRule getGrammarElement()
- Specified by:
getGrammarElement
in interfaceIHiddenRegionPart
- Overrides:
getGrammarElement
in classNodeRegion
- Returns:
- The grammar element the parser used to parse this
IWhitespace
orIComment
. This should be anTerminalRule
for tokens the grammar defined as 'hidden'. May be another grammar element if the construction of theITextRegionAccess
has been customized.
-
getHiddenRegion
public IHiddenRegion getHiddenRegion()
- Specified by:
getHiddenRegion
in interfaceIHiddenRegionPart
- Returns:
- the
IHiddenRegion
thisIWhitespace
orIComment
is a member of.
-
getNextHiddenPart
public IHiddenRegionPart getNextHiddenPart()
- Specified by:
getNextHiddenPart
in interfaceIHiddenRegionPart
- Returns:
- The next following
IWhitespace
orIComment
inside the sameIHiddenRegion
. Null if the currentIHiddenRegionPart
is the last element inside itsIHiddenRegion
.
-
getPreviousHiddenPart
public IHiddenRegionPart getPreviousHiddenPart()
- Specified by:
getPreviousHiddenPart
in interfaceIHiddenRegionPart
- Returns:
- The leading
IWhitespace
orIComment
inside the sameIHiddenRegion
. Null if the currentIHiddenRegionPart
is the first element inside itsIHiddenRegion
.
-
setAssociation
protected void setAssociation(HiddenRegionPartAssociation association)
-
getAssociation
public HiddenRegionPartAssociation getAssociation()
- Specified by:
getAssociation
in interfaceIHiddenRegionPart
- Returns:
- A hint whether the whitespace or comment belongs to the previous or next semantic element or neither of them.
- See Also:
for custom behaviour.
-
-