Class NodeModelBasedRegionAccess
- java.lang.Object
-
- org.eclipse.xtext.formatting2.regionaccess.internal.AbstractRegionAccess
-
- org.eclipse.xtext.formatting2.regionaccess.internal.NodeModelBasedRegionAccess
-
- All Implemented Interfaces:
ITextRegionAccess
,ITextRegionExtensions
public class NodeModelBasedRegionAccess extends AbstractRegionAccess
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
NodeModelBasedRegionAccess(NodeModelBasedRegionAccessBuilder builder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description XtextResource
getResource()
protected java.lang.String
getText()
boolean
hasSyntaxError()
ITextSegment
regionForDocument()
AbstractEObjectRegion
regionForEObject(org.eclipse.emf.ecore.EObject obj)
Returns a the text region for a semantic element (i.e.IEObjectRegion
regionForRootEObject()
java.lang.String
textForOffset(int offset, int length)
-
Methods inherited from class org.eclipse.xtext.formatting2.regionaccess.internal.AbstractRegionAccess
allRegionsFor, allSemanticRegions, getExtensions, getRewriter, getTextRegionAccess, grammarElement, immediatelyFollowing, immediatelyPreceding, initMap, isMultiline, nextHiddenRegion, previousHiddenRegion, regionFor, regionForLineAtOffset, regionForOffset, semanticRegions, toString
-
-
-
-
Constructor Detail
-
NodeModelBasedRegionAccess
protected NodeModelBasedRegionAccess(NodeModelBasedRegionAccessBuilder builder)
-
-
Method Detail
-
getResource
public XtextResource getResource()
- Returns:
- The
XtextResource
that backs the document this class provides access to.
-
getText
protected java.lang.String getText()
- Specified by:
getText
in classAbstractRegionAccess
-
textForOffset
public java.lang.String textForOffset(int offset, int length)
-
regionForEObject
public AbstractEObjectRegion regionForEObject(org.eclipse.emf.ecore.EObject obj)
Description copied from interface:ITextRegionAccess
Returns a the text region for a semantic element (i.e. and EObject from the AST).- Specified by:
regionForEObject
in interfaceITextRegionAccess
- Specified by:
regionForEObject
in interfaceITextRegionExtensions
- Specified by:
regionForEObject
in classAbstractRegionAccess
- Returns:
- a text region that reaches from the beginning of its first semantic region to the end of its last semantic region.
-
regionForRootEObject
public IEObjectRegion regionForRootEObject()
-
regionForDocument
public ITextSegment regionForDocument()
-
hasSyntaxError
public boolean hasSyntaxError()
-
-