public abstract class ElementChangeListenerContribution extends OutlineContribution
IElementChangeEvent
s.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.
|
getOutlinePage
public 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 IOutlineContribution
init
in class OutlineContribution
outlinePage
- the contribution's outline page
(never null
)public void dispose()
OutlineContribution
init()
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 IOutlineContribution
dispose
in class OutlineContribution
protected 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 null
inputElement
- may be null
true
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 null
element
- never null
true
if the given delta affects the given element,
and false
otherwiseprotected abstract void addElementChangeListener(IElementChangeListener listener)
listener
- never null
protected abstract void removeElementChangeListener(IElementChangeListener listener)
listener
- never null
protected 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 null
protected 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, 2019 1C-Soft LLC and others. Made available under the Eclipse Public License 2.0