public class DeferredTreeContentManager extends Object
IDeferredWorkbenchAdapter
Constructor and Description |
---|
DeferredTreeContentManager(AbstractTreeViewer viewer)
Create a new instance of the receiver using the supplied content provider
and viewer.
|
DeferredTreeContentManager(AbstractTreeViewer viewer,
IWorkbenchPartSite site)
Create a new instance of the receiver using the supplied content provider
and viewer.
|
DeferredTreeContentManager(ITreeContentProvider provider,
AbstractTreeViewer viewer)
Deprecated.
in 3.4. provider is not used by this class
|
DeferredTreeContentManager(ITreeContentProvider provider,
AbstractTreeViewer viewer,
IWorkbenchPartSite site)
Deprecated.
in 3.4. provider is not used by this class
|
Modifier and Type | Method and Description |
---|---|
protected void |
addChildren(Object parent,
Object[] children,
IProgressMonitor monitor)
Create a UIJob to add the children to the parent in the tree viewer.
|
void |
addUpdateCompleteListener(IJobChangeListener listener)
Add a listener to list of update complete listeners.
|
void |
cancel(Object parent)
Cancel all jobs that are fetching content for the given parent or any of
its children.
|
protected IElementCollector |
createElementCollector(Object parent,
PendingUpdateAdapter placeholder)
Create the element collector for the receiver.
|
protected PendingUpdateAdapter |
createPendingUpdateAdapter()
Factory method for creating the pending update adapter representing the
placeholder node.
|
protected IDeferredWorkbenchAdapter |
getAdapter(Object element)
Return the IDeferredWorkbenchAdapter for element or the element if it is
an instance of IDeferredWorkbenchAdapter.
|
Object[] |
getChildren(Object parent)
Returns the child elements of the given element, or in the case of a
deferred element, returns a placeholder.
|
protected String |
getFetchJobName(Object parent,
IDeferredWorkbenchAdapter adapter)
Returns a name to use for the job that fetches children of the given
parent.
|
boolean |
isDeferredAdapter(Object element)
Return whether or not the element is or adapts to an
IDeferredWorkbenchAdapter.
|
boolean |
mayHaveChildren(Object element)
Provides an optimized lookup for determining if an element has children.
|
void |
removeUpdateCompleteListener(IJobChangeListener listener)
Removes the listener from the list of update listeners that are attached
to the job that updates the viewer content (clears the pending entry,
etc.) after all deferred content has been retrieved.
|
protected void |
runClearPlaceholderJob(PendingUpdateAdapter placeholder)
Run a job to clear the placeholder.
|
protected void |
startFetchingDeferredChildren(Object parent,
IDeferredWorkbenchAdapter adapter,
PendingUpdateAdapter placeholder)
Starts a job and creates a collector for fetching the children of this
deferred adapter.
|
@Deprecated public DeferredTreeContentManager(ITreeContentProvider provider, AbstractTreeViewer viewer, IWorkbenchPartSite site)
provider
- viewer
- site
- @Deprecated public DeferredTreeContentManager(ITreeContentProvider provider, AbstractTreeViewer viewer)
provider
- The content provider that will be updatedviewer
- The tree viewer that the results are added topublic DeferredTreeContentManager(AbstractTreeViewer viewer, IWorkbenchPartSite site)
viewer
- site
- public DeferredTreeContentManager(AbstractTreeViewer viewer)
viewer
- The tree viewer that the results are added topublic boolean mayHaveChildren(Object element)
getChildren
just to determine the potential for children.
Throw an AssertionFailedException if element is null.element
- The Object being tested. This should not be null
.true
if there are potentially children.RuntimeException
- if the element is null.public Object[] getChildren(Object parent)
parent
- The parent object.null
if parent is not an instance of
IDeferredWorkbenchAdapter.protected PendingUpdateAdapter createPendingUpdateAdapter()
protected IDeferredWorkbenchAdapter getAdapter(Object element)
element
- null
protected void startFetchingDeferredChildren(Object parent, IDeferredWorkbenchAdapter adapter, PendingUpdateAdapter placeholder)
parent
- The parent object being filled in,adapter
- The adapter being used to fetch the children.placeholder
- The adapter that will be used to indicate that results are
pending.protected String getFetchJobName(Object parent, IDeferredWorkbenchAdapter adapter)
parent
- parent that children are to be fetched foradapter
- parent's deferred adapterprotected void addChildren(Object parent, Object[] children, IProgressMonitor monitor)
parent
- children
- monitor
- public boolean isDeferredAdapter(Object element)
element
- true
if the element is an
IDeferredWorkbenchAdapterprotected void runClearPlaceholderJob(PendingUpdateAdapter placeholder)
placeholder
- public void cancel(Object parent)
parent
- protected IElementCollector createElementCollector(Object parent, PendingUpdateAdapter placeholder)
parent
- The parent object being filled in,placeholder
- The adapter that will be used to indicate that results are
pending.public void addUpdateCompleteListener(IJobChangeListener listener)
listener
- the listener to add to the list of update listenerspublic void removeUpdateCompleteListener(IJobChangeListener listener)
listener
- the listener to be removed
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.