Class AbstractRegionAccess
- java.lang.Object
-
- org.eclipse.xtext.formatting2.regionaccess.internal.AbstractRegionAccess
-
- All Implemented Interfaces:
ITextRegionAccess,ITextRegionExtensions
- Direct Known Subclasses:
NodeModelBasedRegionAccess,StringBasedRegionAccess
public abstract class AbstractRegionAccess extends java.lang.Object implements ITextRegionAccess, ITextRegionExtensions
-
-
Constructor Summary
Constructors Constructor Description AbstractRegionAccess()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ISemanticRegionsFinderallRegionsFor(org.eclipse.emf.ecore.EObject object)java.lang.Iterable<ISemanticRegion>allSemanticRegions(org.eclipse.emf.ecore.EObject object)ITextRegionExtensionsgetExtensions()TextRegionRewritergetRewriter()protected abstract java.lang.StringgetText()ITextRegionAccessgetTextRegionAccess()org.eclipse.emf.ecore.EObjectgrammarElement(org.eclipse.emf.ecore.EObject obj)ISemanticRegionFinderimmediatelyFollowing(org.eclipse.emf.ecore.EObject owner)ISemanticRegionFinderimmediatelyPreceding(org.eclipse.emf.ecore.EObject owner)protected java.util.Map<? extends org.eclipse.emf.ecore.EObject,? extends AbstractEObjectRegion>initMap()booleanisMultiline(org.eclipse.emf.ecore.EObject object)IHiddenRegionnextHiddenRegion(org.eclipse.emf.ecore.EObject owner)IHiddenRegionpreviousHiddenRegion(org.eclipse.emf.ecore.EObject owner)ISemanticRegionsFinderregionFor(org.eclipse.emf.ecore.EObject object)abstract AbstractEObjectRegionregionForEObject(org.eclipse.emf.ecore.EObject object)Returns a the text region for a semantic element (i.e.ILineRegionregionForLineAtOffset(int offset)ITextSegmentregionForOffset(int offset, int length)java.lang.Iterable<ISemanticRegion>semanticRegions(org.eclipse.emf.ecore.EObject object)java.lang.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.xtext.formatting2.regionaccess.ITextRegionAccess
getResource, hasSyntaxError, regionForDocument, regionForRootEObject, textForOffset
-
-
-
-
Method Detail
-
getExtensions
public ITextRegionExtensions getExtensions()
- Specified by:
getExtensionsin interfaceITextRegionAccess
-
allSemanticRegions
public java.lang.Iterable<ISemanticRegion> allSemanticRegions(org.eclipse.emf.ecore.EObject object)
- Specified by:
allSemanticRegionsin interfaceITextRegionExtensions
-
semanticRegions
public java.lang.Iterable<ISemanticRegion> semanticRegions(org.eclipse.emf.ecore.EObject object)
- Specified by:
semanticRegionsin interfaceITextRegionExtensions
-
allRegionsFor
public ISemanticRegionsFinder allRegionsFor(org.eclipse.emf.ecore.EObject object)
- Specified by:
allRegionsForin interfaceITextRegionExtensions
-
grammarElement
public org.eclipse.emf.ecore.EObject grammarElement(org.eclipse.emf.ecore.EObject obj)
- Specified by:
grammarElementin interfaceITextRegionExtensions- Returns:
- the
RuleCallor the assignedActionthat led to the construction of this EObject. For the model's root element, theParserRuleis returned.
-
getRewriter
public TextRegionRewriter getRewriter()
- Specified by:
getRewriterin interfaceITextRegionAccess
-
getText
protected abstract java.lang.String getText()
-
getTextRegionAccess
public ITextRegionAccess getTextRegionAccess()
- Specified by:
getTextRegionAccessin interfaceITextRegionExtensions
-
immediatelyFollowing
public ISemanticRegionFinder immediatelyFollowing(org.eclipse.emf.ecore.EObject owner)
- Specified by:
immediatelyFollowingin interfaceITextRegionExtensions
-
immediatelyPreceding
public ISemanticRegionFinder immediatelyPreceding(org.eclipse.emf.ecore.EObject owner)
- Specified by:
immediatelyPrecedingin interfaceITextRegionExtensions
-
initMap
protected java.util.Map<? extends org.eclipse.emf.ecore.EObject,? extends AbstractEObjectRegion> initMap()
-
isMultiline
public boolean isMultiline(org.eclipse.emf.ecore.EObject object)
- Specified by:
isMultilinein interfaceITextRegionExtensions- Returns:
- true, if the EObject's text range contains a line-wrap ("\n"). The EObject's text range reaches from the beginning of its first semantic region to the end of its last semantic region.
-
previousHiddenRegion
public IHiddenRegion previousHiddenRegion(org.eclipse.emf.ecore.EObject owner)
- Specified by:
previousHiddenRegionin interfaceITextRegionExtensions- Returns:
- the
IHiddenRegionthat precedes the EObject's firstISemanticRegion. - See Also:
ITextRegionExtensions.nextHiddenRegion(EObject)
-
regionFor
public ISemanticRegionsFinder regionFor(org.eclipse.emf.ecore.EObject object)
- Specified by:
regionForin interfaceITextRegionExtensions
-
regionForEObject
public abstract AbstractEObjectRegion regionForEObject(org.eclipse.emf.ecore.EObject object)
Description copied from interface:ITextRegionAccessReturns a the text region for a semantic element (i.e. and EObject from the AST).- Specified by:
regionForEObjectin interfaceITextRegionAccess- Specified by:
regionForEObjectin interfaceITextRegionExtensions- Returns:
- a text region that reaches from the beginning of its first semantic region to the end of its last semantic region.
-
regionForLineAtOffset
public ILineRegion regionForLineAtOffset(int offset)
- Specified by:
regionForLineAtOffsetin interfaceITextRegionAccess
-
regionForOffset
public ITextSegment regionForOffset(int offset, int length)
- Specified by:
regionForOffsetin interfaceITextRegionAccess
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
nextHiddenRegion
public IHiddenRegion nextHiddenRegion(org.eclipse.emf.ecore.EObject owner)
- Specified by:
nextHiddenRegionin interfaceITextRegionExtensions- Returns:
- the
IHiddenRegionthat follows after the EObject's lastISemanticRegion. - See Also:
ITextRegionExtensions.previousHiddenRegion(EObject)
-
-