public abstract class ElementChangeListenerContribution extends OutlineContribution
IElementChangeEvents.| Constructor and Description |
|---|
ElementChangeListenerContribution() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
addElementChangeListener(IElementChangeListener listener)
Registers the given element change listener with the underlying model.
|
protected boolean |
affects(IElementChangeEvent event,
java.lang.Object inputElement)
Returns whether the given element change event affects the outline's
input element.
|
protected boolean |
affects(IElementDelta delta,
IElement element)
Returns whether the given element delta affects the given element.
|
void |
dispose()
Disposes of this contribution.
|
protected abstract void |
elementChanged(IElementChangeEvent event)
Notifies that the outline page is affected in some way
by the given element change event.
|
protected IContentAdapter |
getContentAdapter()
Returns the installed content adapter, or a
NullContentAdapter
if none. |
void |
init(ICommonOutlinePage outlinePage)
Initializes this contribution.
|
protected abstract void |
removeElementChangeListener(IElementChangeListener listener)
Removes the given element change listener from the underlying model.
|
getOutlinePagepublic void init(ICommonOutlinePage outlinePage)
This method may be extended by subclasses. Subclasses must call the superclass implementation.
ElementChangeListenerContribution extends this method to register an element
change listener that invokes elementChanged(IElementChangeEvent)
if the element change event affects the outline's input element.
init in interface IOutlineContributioninit in class OutlineContributionoutlinePage - the contribution's outline page
(never null)public void dispose()
OutlineContributioninit() has been called.
This method has no effect if this contribution has already
been disposed.
This method may be extended by subclasses. Subclasses must call the superclass implementation.
dispose in interface IOutlineContributiondispose in class OutlineContributionprotected boolean affects(IElementChangeEvent event, java.lang.Object inputElement)
This implementation uses the content adapter
to adapt the input element to an IElement. It then delegates
to affects(IElementDelta, IElement).
event - never nullinputElement - may be nulltrue if the given element change event affects
the outline's input element, and false otherwiseprotected boolean affects(IElementDelta delta, IElement element)
This implementation checks whether the given element delta tree contains
a delta that designates a structural change to the given element.
delta - never nullelement - never nulltrue if the given delta affects the given element,
and false otherwiseprotected abstract void addElementChangeListener(IElementChangeListener listener)
listener - never nullprotected abstract void removeElementChangeListener(IElementChangeListener listener)
listener - never nullprotected abstract void elementChanged(IElementChangeEvent event)
Note: This method may be called in any thread. The event object (and the deltas within it) is valid only for the duration of the invocation of this method.
event - never nullprotected IContentAdapter getContentAdapter()
NullContentAdapter
if none.
This implementation returns the content adapter provided by the
outline page, if the outline page is an IContentAdapterProvider.
IContentAdapter (never null)Copyright (c) 2014, 2020 1C-Soft LLC and others. Made available under the Eclipse Public License 2.0