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 ISemanticRegionsFinder
allRegionsFor(org.eclipse.emf.ecore.EObject object)
java.lang.Iterable<ISemanticRegion>
allSemanticRegions(org.eclipse.emf.ecore.EObject object)
ITextRegionExtensions
getExtensions()
TextRegionRewriter
getRewriter()
protected abstract java.lang.String
getText()
ITextRegionAccess
getTextRegionAccess()
org.eclipse.emf.ecore.EObject
grammarElement(org.eclipse.emf.ecore.EObject obj)
ISemanticRegionFinder
immediatelyFollowing(org.eclipse.emf.ecore.EObject owner)
ISemanticRegionFinder
immediatelyPreceding(org.eclipse.emf.ecore.EObject owner)
protected java.util.Map<? extends org.eclipse.emf.ecore.EObject,? extends AbstractEObjectRegion>
initMap()
boolean
isMultiline(org.eclipse.emf.ecore.EObject object)
IHiddenRegion
nextHiddenRegion(org.eclipse.emf.ecore.EObject owner)
IHiddenRegion
previousHiddenRegion(org.eclipse.emf.ecore.EObject owner)
ISemanticRegionsFinder
regionFor(org.eclipse.emf.ecore.EObject object)
abstract AbstractEObjectRegion
regionForEObject(org.eclipse.emf.ecore.EObject object)
Returns a the text region for a semantic element (i.e.ILineRegion
regionForLineAtOffset(int offset)
ITextSegment
regionForOffset(int offset, int length)
java.lang.Iterable<ISemanticRegion>
semanticRegions(org.eclipse.emf.ecore.EObject object)
java.lang.String
toString()
-
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:
getExtensions
in interfaceITextRegionAccess
-
allSemanticRegions
public java.lang.Iterable<ISemanticRegion> allSemanticRegions(org.eclipse.emf.ecore.EObject object)
- Specified by:
allSemanticRegions
in interfaceITextRegionExtensions
-
semanticRegions
public java.lang.Iterable<ISemanticRegion> semanticRegions(org.eclipse.emf.ecore.EObject object)
- Specified by:
semanticRegions
in interfaceITextRegionExtensions
-
allRegionsFor
public ISemanticRegionsFinder allRegionsFor(org.eclipse.emf.ecore.EObject object)
- Specified by:
allRegionsFor
in interfaceITextRegionExtensions
-
grammarElement
public org.eclipse.emf.ecore.EObject grammarElement(org.eclipse.emf.ecore.EObject obj)
- Specified by:
grammarElement
in interfaceITextRegionExtensions
- Returns:
- the
RuleCall
or the assignedAction
that led to the construction of this EObject. For the model's root element, theParserRule
is returned.
-
getRewriter
public TextRegionRewriter getRewriter()
- Specified by:
getRewriter
in interfaceITextRegionAccess
-
getText
protected abstract java.lang.String getText()
-
getTextRegionAccess
public ITextRegionAccess getTextRegionAccess()
- Specified by:
getTextRegionAccess
in interfaceITextRegionExtensions
-
immediatelyFollowing
public ISemanticRegionFinder immediatelyFollowing(org.eclipse.emf.ecore.EObject owner)
- Specified by:
immediatelyFollowing
in interfaceITextRegionExtensions
-
immediatelyPreceding
public ISemanticRegionFinder immediatelyPreceding(org.eclipse.emf.ecore.EObject owner)
- Specified by:
immediatelyPreceding
in 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:
isMultiline
in 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:
previousHiddenRegion
in interfaceITextRegionExtensions
- Returns:
- the
IHiddenRegion
that precedes the EObject's firstISemanticRegion
. - See Also:
ITextRegionExtensions.nextHiddenRegion(EObject)
-
regionFor
public ISemanticRegionsFinder regionFor(org.eclipse.emf.ecore.EObject object)
- Specified by:
regionFor
in interfaceITextRegionExtensions
-
regionForEObject
public abstract AbstractEObjectRegion regionForEObject(org.eclipse.emf.ecore.EObject object)
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
- 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:
regionForLineAtOffset
in interfaceITextRegionAccess
-
regionForOffset
public ITextSegment regionForOffset(int offset, int length)
- Specified by:
regionForOffset
in interfaceITextRegionAccess
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
nextHiddenRegion
public IHiddenRegion nextHiddenRegion(org.eclipse.emf.ecore.EObject owner)
- Specified by:
nextHiddenRegion
in interfaceITextRegionExtensions
- Returns:
- the
IHiddenRegion
that follows after the EObject's lastISemanticRegion
. - See Also:
ITextRegionExtensions.previousHiddenRegion(EObject)
-
-