Class ElementChangeListenerContribution
- All Implemented Interfaces:
IOutlineContribution
IElementChangeEvent
s.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
Registers the given element change listener with the underlying model.protected boolean
affects
(IElementChangeEvent event, 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
Notifies that the outline page is affected in some way by the given element change event.protected IContentAdapter
Returns the installed content adapter, or aNullContentAdapter
if none.void
init
(ICommonOutlinePage outlinePage) Initializes this contribution.protected abstract void
Removes the given element change listener from the underlying model.Methods inherited from class org.eclipse.handly.ui.outline.OutlineContribution
getOutlinePage
-
Constructor Details
-
ElementChangeListenerContribution
public ElementChangeListenerContribution()
-
-
Method Details
-
init
Initializes this contribution. This method is called after the outline page's tree viewer has been created.This method may be extended by subclasses. Subclasses must call the superclass implementation.
ElementChangeListenerContribution
extends this method toregister
an element change listener that invokeselementChanged(IElementChangeEvent)
if the element change eventaffects
the outline's input element.- Specified by:
init
in interfaceIOutlineContribution
- Overrides:
init
in classOutlineContribution
- Parameters:
outlinePage
- the contribution's outline page (nevernull
)
-
dispose
public void dispose()Description copied from class:OutlineContribution
Disposes of this contribution. Implementors should clean up any resources associated with this contribution. Note that there is no guarantee thatinit()
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.
- Specified by:
dispose
in interfaceIOutlineContribution
- Overrides:
dispose
in classOutlineContribution
-
affects
Returns whether the given element change event affects the outline's input element.This implementation uses the
content adapter
to adapt the input element to anIElement
. It then delegates toaffects(IElementDelta, IElement)
.- Parameters:
event
- nevernull
inputElement
- may benull
- Returns:
true
if the given element change event affects the outline's input element, andfalse
otherwise
-
affects
Returns whether the given element delta affects the given element.This implementation checks whether the given element delta tree contains a delta that designates a
structural change
to the given element.- Parameters:
delta
- nevernull
element
- nevernull
- Returns:
true
if the given delta affects the given element, andfalse
otherwise
-
addElementChangeListener
Registers the given element change listener with the underlying model.- Parameters:
listener
- nevernull
-
removeElementChangeListener
Removes the given element change listener from the underlying model.- Parameters:
listener
- nevernull
-
elementChanged
Notifies that the outline page is affected in some way by the given element change 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.
- Parameters:
event
- nevernull
-
getContentAdapter
Returns the installed content adapter, or aNullContentAdapter
if none.This implementation returns the content adapter provided by the outline page, if the outline page is an
IContentAdapterProvider
.- Returns:
- an
IContentAdapter
(nevernull
)
-