public interface IElementImplExtension extends IElementImpl
IElementImpl
that introduces the notion of element's
cached body. IElement
s may implement this interface.Modifier and Type | Interface and Description |
---|---|
static class |
IElementImplExtension.CloseHint
Indicates reason for element closing.
|
Modifier and Type | Field and Description |
---|---|
static Property<IElementImplExtension.CloseHint> |
CLOSE_HINT
Closing hint.
|
static Property<java.lang.Boolean> |
FORCE_OPEN
Indicates whether to forcibly reopen this element if it is already open
(i.e., already present in the body cache).
|
Modifier and Type | Method and Description |
---|---|
default void |
close_()
Closes this element if, and only if, the current state of this element
permits closing.
|
void |
close_(IContext context)
Closes this element if, and only if, the current state of this element
permits closing according to options specified in the given context.
|
java.lang.Object |
findBody_()
Returns the cached body for this element, or
null
if none. |
default java.lang.Object |
getBody_()
Returns the cached body for this element.
|
default java.lang.Object |
getBody_(IContext context,
org.eclipse.core.runtime.IProgressMonitor monitor)
Returns the cached body for this element.
|
default IElement[] |
getChildren_(IContext context,
org.eclipse.core.runtime.IProgressMonitor monitor)
Returns the immediate children of this element.
|
IElement[] |
getChildrenFromBody_(java.lang.Object body)
Given a body for this element, returns the immediate children.
|
java.lang.Object |
open_(IContext context,
org.eclipse.core.runtime.IProgressMonitor monitor)
Ensures that this element is open, i.e., it exists and is present in the
body cache.
|
java.lang.Object |
peekAtBody_()
Returns the cached body for this element without disturbing
cache ordering, or
null if none. |
equalsAndSameParentChain_, exists_, getChildrenOfType_, getHandleMemento_, getLocationUri_, getModel_, getName_, getParent_, getResource_, getRoot_, toDisplayString_, toString_
static final Property<java.lang.Boolean> FORCE_OPEN
false
.
This property is for implementation purposes; it is not intended for use by general clients.
open_(IContext, IProgressMonitor)
static final Property<IElementImplExtension.CloseHint> CLOSE_HINT
This property is for implementation purposes; it is not intended for use by general clients.
close_(IContext)
default IElement[] getChildren_(IContext context, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
IElementImpl
getChildren_
in interface IElementImpl
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
).
Clients must not modify the returned array.org.eclipse.core.runtime.CoreException
- if this element does not exist or if an
exception occurs while accessing its corresponding resourceIElement[] getChildrenFromBody_(java.lang.Object body)
body
- a body for this element (not null
)null
).
Clients must not modify the returned array.java.lang.Object findBody_()
null
if none.null
if nonejava.lang.Object peekAtBody_()
null
if none.null
if nonedefault java.lang.Object getBody_() throws org.eclipse.core.runtime.CoreException
open
it. Shortcut to getBody_(EMPTY_CONTEXT, null)
.null
)org.eclipse.core.runtime.CoreException
- if this element does not exist or if an
exception occurs while accessing its corresponding resourcedefault java.lang.Object getBody_(IContext context, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
open
it propagating the given context.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
)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 canceledjava.lang.Object open_(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:
FORCE_OPEN
- Indicates whether to forcibly reopen this element
if it is already open (i.e., already present in the body cache).
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
)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 void close_()
Closing of an element removes its body from the body cache. In general, closing of a parent element also closes its children. If the current state of an open child element does not permit closing, the child element remains open, which generally does not prevent its parent from closing. Closing of an element which is not open has no effect.
Shortcut to close_(EMPTY_CONTEXT)
.
close_(IContext)
void close_(IContext context)
Closing of an element removes its body from the body cache. In general, closing of a parent element also closes its children. If the current state of an open child element does not permit closing, the child element remains open, which generally does not prevent its parent from closing. Closing of an element which is not open has no effect.
Implementations are encouraged to support the following standard options, which may be specified in the given context:
CLOSE_HINT
- Closing hint.
context
- the operation context (not null
)Copyright (c) 2014, 2019 1C-Soft LLC and others. Made available under the Eclipse Public License 2.0