public class RemoteTreeContentManager
extends java.lang.Object
RemoteTreeViewer
.Constructor and Description |
---|
RemoteTreeContentManager(org.eclipse.jface.viewers.ITreeContentProvider provider,
RemoteTreeViewer viewer,
org.eclipse.ui.IWorkbenchPartSite site)
Contructs a new content manager.
|
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancels any content this provider is currently fetching.
|
protected org.eclipse.ui.progress.IElementCollector |
createElementCollector(java.lang.Object parent,
PendingUpdateAdapter placeholder)
Create the element collector for the receiver.
|
protected org.eclipse.ui.progress.IDeferredWorkbenchAdapter |
getAdapter(java.lang.Object element)
Return the IDeferredWorkbenchAdapter for element or the element if it is an instance of
IDeferredWorkbenchAdapter.
|
java.lang.Object[] |
getChildren(java.lang.Object parent)
Returns the child elements of the given element, or in the case of a deferred element, returns a
placeholder.
|
protected java.lang.String |
getFetchJobName(java.lang.Object parent,
org.eclipse.ui.progress.IDeferredWorkbenchAdapter adapter) |
boolean |
mayHaveChildren(java.lang.Object element)
Provides an optimized lookup for determining if an element has children.
|
protected void |
prune(java.lang.Object parent,
int offset)
Create a UIJob to prune the children of the parent in the tree viewer, starting at the given offset.
|
protected void |
replaceChildren(java.lang.Object parent,
java.lang.Object[] children,
int offset,
org.eclipse.core.runtime.IProgressMonitor monitor)
Create a UIJob to replace the children of the parent in the tree viewer.
|
protected void |
runClearPlaceholderJob(PendingUpdateAdapter placeholder)
Run a job to clear the placeholder.
|
protected void |
startFetchingDeferredChildren(java.lang.Object parent,
org.eclipse.ui.progress.IDeferredWorkbenchAdapter adapter,
PendingUpdateAdapter placeholder) |
public RemoteTreeContentManager(org.eclipse.jface.viewers.ITreeContentProvider provider, RemoteTreeViewer viewer, org.eclipse.ui.IWorkbenchPartSite site)
provider
- content providerviewer
- viewersite
- part siteprotected org.eclipse.ui.progress.IElementCollector createElementCollector(java.lang.Object parent, PendingUpdateAdapter placeholder)
parent
- The parent object being filled in,placeholder
- The adapter that will be used to indicate that results are pending, possibly null
public java.lang.Object[] getChildren(java.lang.Object parent)
parent
- The parent object.null
if parent is not an instance of IDeferredWorkbenchAdapter.protected void replaceChildren(java.lang.Object parent, java.lang.Object[] children, int offset, org.eclipse.core.runtime.IProgressMonitor monitor)
parent
- the parent for which children are to be replacedchildren
- the replacement childrenoffset
- the offset at which to start replacing childrenmonitor
- progress monitorprotected void prune(java.lang.Object parent, int offset)
parent
- the parent for which children should be prunedoffset
- the offset at which children should be pruned. All children at and after this index will be
removed from the tree.protected void runClearPlaceholderJob(PendingUpdateAdapter placeholder)
placeholder
- protected java.lang.String getFetchJobName(java.lang.Object parent, org.eclipse.ui.progress.IDeferredWorkbenchAdapter adapter)
protected org.eclipse.ui.progress.IDeferredWorkbenchAdapter getAdapter(java.lang.Object element)
element
- null
protected void startFetchingDeferredChildren(java.lang.Object parent, org.eclipse.ui.progress.IDeferredWorkbenchAdapter adapter, PendingUpdateAdapter placeholder)
public boolean mayHaveChildren(java.lang.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.java.lang.RuntimeException
- if the element is null.public void cancel()