Eclipse Platform
Release 3.2

org.eclipse.ui.navigator
Interface IPipelinedTreeContentProvider

All Superinterfaces:
ICommonContentProvider, IContentProvider, IMementoAware, IStructuredContentProvider, ITreeContentProvider

public interface IPipelinedTreeContentProvider
extends ICommonContentProvider

A pipelined content provider allows an extension to reshape the contributions of an upstream content extension.

An "upstream" extension is either the extension overridden by this extension using the org.eclipse.ui.navigatorContent/navigatorContent/overrides element or another extension, which overrides the same extension this extension overrides, but with higher priority than this extension. Overridden extensions form a tree where the nodes of the tree represent the content extensions, children represent overridding extensions, and the children are sorted by priority. Pipeline contributions traverse the tree, allowing children to override the contributions of their parent, giving precedence to the children of highest priority.

EXPERIMENTAL. This class or interface has been added as part of a work in progress. There is a guarantee neither that this API will work nor that it will remain the same. Please do not use this API without consulting with the Platform/UI team.

Clients may (but are not required to) implement this interface if there is no cause to do so. ITreeContentProvider is respected by the Common Navigator.

Since:
3.2

Method Summary
 Set getPipelinedChildren(Object aParent, Set theCurrentChildren)
          Intercept the children that would be contributed to the viewer and determine how to change the shape of those children.
 Set getPipelinedElements(Object anInput, Set theCurrentElements)
          Intercept the elements that would be contributed to the root of the viewer and determine how to change the shape of those children.
 Object getPipelinedParent(Object anObject, Object aSuggestedParent)
          Intercept requests for a parent of the given object.
 PipelinedShapeModification interceptAdd(PipelinedShapeModification anAddModification)
          Intercept attempts to add elements directly to the viewer.
 PipelinedViewerUpdate interceptRefresh(PipelinedViewerUpdate aRefreshSynchronization)
          Intercept calls to viewer refresh() methods.
 PipelinedShapeModification interceptRemove(PipelinedShapeModification aRemoveModification)
          Intercept attempts to remove elements directly from the viewer.
 PipelinedViewerUpdate interceptUpdate(PipelinedViewerUpdate anUpdateSynchronization)
          Intercept calls to viewer update() methods.
 
Methods inherited from interface org.eclipse.ui.navigator.ICommonContentProvider
init
 
Methods inherited from interface org.eclipse.jface.viewers.ITreeContentProvider
getChildren, getParent, hasChildren
 
Methods inherited from interface org.eclipse.jface.viewers.IStructuredContentProvider
getElements
 
Methods inherited from interface org.eclipse.jface.viewers.IContentProvider
dispose, inputChanged
 
Methods inherited from interface org.eclipse.ui.navigator.IMementoAware
restoreState, saveState
 

Method Detail

getPipelinedChildren

public Set getPipelinedChildren(Object aParent,
                                Set theCurrentChildren)
Intercept the children that would be contributed to the viewer and determine how to change the shape of those children.

Parameters:
aParent - A parent from the viewer
theCurrentChildren - The set of children contributed thus far from upstream content providers.
Returns:
The set of children to be contributed in place of theCurrentChildren.

getPipelinedElements

public Set getPipelinedElements(Object anInput,
                                Set theCurrentElements)
Intercept the elements that would be contributed to the root of the viewer and determine how to change the shape of those children.

Parameters:
anInput - An input from the viewer
theCurrentElements - The set of children contributed thus far from upstream content providers.
Returns:
The set of elements to be contributed in place of theCurrentElements.

getPipelinedParent

public Object getPipelinedParent(Object anObject,
                                 Object aSuggestedParent)
Intercept requests for a parent of the given object.

Parameters:
anObject - The object being queried for a parent.
aSuggestedParent - The parent already suggested from upstream extensions.
Returns:
The intended parent from this pipelined content provider.

interceptAdd

public PipelinedShapeModification interceptAdd(PipelinedShapeModification anAddModification)
Intercept attempts to add elements directly to the viewer.

For content extensions that reshape the structure of children in a viewer, their overridden extensions may sometimes use optimized refreshes to add elements to the tree. These attempts must be intercepted and mapped to the correct set of model elements in the overridding extension. Clients may add, remove, or modify elements in the given set of added children. Clients should return a set for downstream extensions to massage further.

Clients should not call any of the add, remove, refresh, or update methods on the viewer from this method or any code invoked by the implementation of this method.

Parameters:
anAddModification - The shape modification which contains the current suggested parent and children. Clients may modify this parameter directly and return it as the new shape modification.
Returns:
The new shape modification to use. Clients should never return null from this method.

interceptRemove

public PipelinedShapeModification interceptRemove(PipelinedShapeModification aRemoveModification)
Intercept attempts to remove elements directly from the viewer.

For content extensions that reshape the structure of children in a viewer, their overridden extensions may sometimes use optimized refreshes to remove elements to the tree. These attempts must be intercepted and mapped to the correct set of model elements in the overridding extension. Clients may add, remove, or modify elements in the given set of removed children. Clients should return a set for downstream extensions to massage further.

Clients should not call any of the add, remove, refresh, or update methods on the viewer from this method or any code invoked by the implementation of this method.

Parameters:
aRemoveModification - The shape modification which contains the current suggested parent and children. Clients may modify this parameter directly and return it as the new shape modification.
Returns:
The new shape modification to use. Clients should never return null from this method.

interceptRefresh

public PipelinedViewerUpdate interceptRefresh(PipelinedViewerUpdate aRefreshSynchronization)
Intercept calls to viewer refresh() methods.

Clients may modify the given update to add or remove the elements to be refreshed. Clients may return the same instance that was passed in for the next downstream extension.

Clients should not call any of the add, remove, refresh, or update methods on the viewer from this method or any code invoked by the implementation of this method.

Parameters:
aRefreshSynchronization - The (current) refresh update to execute against the viewer.
Returns:
The (potentially reshaped) refresh to execute against the viewer.

interceptUpdate

public PipelinedViewerUpdate interceptUpdate(PipelinedViewerUpdate anUpdateSynchronization)
Intercept calls to viewer update() methods.

Clients may modify the given update to add or remove the elements to be updated. Clients may also add or remove properties for the given targets to optimize the refresh. Clients may return the same instance that was passed in for the next downstream extension.

Clients should not call any of the add, remove, refresh, or update methods on the viewer from this method or any code invoked by the implementation of this method.

Parameters:
anUpdateSynchronization - The (current) update to execute against the viewer.
Returns:
The (potentially reshaped) update to execute against the viewer.

Eclipse Platform
Release 3.2

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2005. All rights reserved.