public interface ISourceElementImplSupport extends IElementImplSupport, ISourceElementImpl
ISourceElementImpl
to minimize the effort required to implement that
interface.
In general, the members first defined in this interface are not intended to be referenced outside the subtype hierarchy.
IElementImplExtension.CloseHint
NEW_ELEMENTS, NO_BODY
CLOSE_HINT, FORCE_OPEN
Modifier and Type | Method and Description |
---|---|
static boolean |
checkInRange(int position,
ISourceElementInfo info,
IContext context)
Checks whether the given position is within the element's range
in the source snapshot as recorded by the given element info.
|
default ISourceElement |
getSourceElementAt_(int position,
IContext context,
org.eclipse.core.runtime.IProgressMonitor monitor)
Returns the smallest element within this element that includes
the given source position, or
null if the given position
is not within the source range of this element. |
default ISourceElement |
getSourceElementAt_(int position,
ISourceElementInfo info,
IContext context,
org.eclipse.core.runtime.IProgressMonitor monitor)
Returns the smallest element within this element that includes the
given source position, which is known to be within the source range of
this element as recorded by the given element info.
|
default ISourceElementInfo |
getSourceElementInfo_(IContext context,
org.eclipse.core.runtime.IProgressMonitor monitor)
Returns an object holding cached structure and properties for this element.
|
buildStructure_, canEqual_, close_, defaultEquals_, defaultHashCode_, exists_, findBody_, getChildrenFromBody_, getElementManager_, getModel_, isOpenable_, newDoesNotExistException_, open_, openParent_, peekAtBody_, remove_, removing_, toString_, toStringAncestors_, toStringBody_, toStringChildren_, toStringName_, validateExistence_
close_, getBody_, getBody_, getChildren_
equalsAndSameParentChain_, getChildrenOfType_, getHandleMemento_, getLocationUri_, getName_, getParent_, getResource_, getRoot_, toDisplayString_
getModelManager_
default ISourceElementInfo getSourceElementInfo_(IContext context, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
This implementation delegates to IElementImplExtension.getBody_(IContext,
IProgressMonitor)
; it is assumed that the body implements
ISourceElementInfo
.
getSourceElementInfo_
in interface ISourceElementImpl
context
- the operation context (not null
)monitor
- a progress monitor, or null
if progress reporting is not desired. The caller must not rely on
IProgressMonitor.done()
having been called by the receiverISourceElementInfo
for this element
(never null
)org.eclipse.core.runtime.CoreException
- if this element does not exist or if an
exception occurs while accessing its corresponding resourceorg.eclipse.core.runtime.OperationCanceledException
- if this method is canceleddefault ISourceElement getSourceElementAt_(int position, IContext context, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
null
if the given position
is not within the source range of this element. If no finer grained
element is found at the position, this element itself is returned.
Implementations are encouraged to support the following standard options, which may be specified in the given context:
BASE_SNAPSHOT
-
A snapshot on which the given position is based, or null
if the snapshot is unknown or does not matter.
This implementation obtains the source element info for this element and
delegates to getSourceElementAt_(int, ISourceElementInfo, IContext,
IProgressMonitor)
if the given position is within the source range of
this element as reported by checkInRange(int, ISourceElementInfo,
IContext)
; otherwise, null
is returned.
getSourceElementAt_
in interface ISourceElementImpl
position
- a source position (0-based)context
- the operation context (not null
)monitor
- a progress monitor, or null
if progress reporting is not desired. The caller must not rely on
IProgressMonitor.done()
having been called by the receivernull
if none (including this element itself)org.eclipse.core.runtime.CoreException
- if this element does not exist or if an
exception occurs while accessing its corresponding resourceStaleSnapshotException
- if snapshot inconsistency is detected,
i.e., this element's current structure and properties are based on
a different snapshotorg.eclipse.core.runtime.OperationCanceledException
- if this method is canceleddefault ISourceElement getSourceElementAt_(int position, ISourceElementInfo info, IContext context, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
Implementations are encouraged to support the following standard options, which may be specified in the given context:
BASE_SNAPSHOT
-
A snapshot on which the given position is based, or null
if the snapshot is unknown or does not matter.
position
- a source position (0-based)info
- an ISourceElementInfo
for this element
(not null
)context
- the operation context (not null
)monitor
- a progress monitor (not null
).
The caller must not rely on IProgressMonitor.done()
having been called by the receivernull
)org.eclipse.core.runtime.CoreException
- if an exception occurs while accessing
the element's corresponding resourceStaleSnapshotException
- if snapshot inconsistency is detectedorg.eclipse.core.runtime.OperationCanceledException
- if this method is canceledstatic boolean checkInRange(int position, ISourceElementInfo info, IContext context)
Supports the following standard options, which may be specified in the given context:
BASE_SNAPSHOT
-
A snapshot on which the given position is based, or null
if the snapshot is unknown or does not matter.
position
- a source position (0-based)info
- an ISourceElementInfo
(not null
)context
- the operation context (not null
)true
if the given position is within the element's
source range, and false
otherwiseStaleSnapshotException
- if snapshot inconsistency is detectedCopyright (c) 2014, 2019 1C-Soft LLC and others. Made available under the Eclipse Public License 2.0