Package org.eclipse.zest.core.viewers

# Interface IGraphContentProvider

All Superinterfaces:
  `IContentProvider`, `IStructuredContentProvider`

public interface IGraphContentProvider extends IStructuredContentProvider
A graph content provider.

## Method Summary

Modifier and Type
Method
Description
`Object`
`getDestination(Object rel)`
Gets the target Object for the given relationship.
`Object[]`
`getElements(Object input)`
Returns all the relationships in the graph for the given input.
`Object`
`getSource(Object rel)`
Gets the source Object for the given relationship.

### Methods inherited from interface org.eclipse.jface.viewers.IContentProvider

`dispose, inputChanged`

## Method Details

### getSource

Object getSource(Object rel)
Gets the source Object for the given relationship. Note, at least one of the source or destination must not be null. If both are null, then nothing can be displayed in the graph (a relationship cannot exist without nodes to be connected to). However, if one of getSource() or getDestination() returns null, then the resulting graph will contain an unconnected node for the non-null object returned from the other method.

Parameters:
  `rel` - the relationship.
Returns:
  the source, or null for an unconnected destination.

### getDestination

Object getDestination(Object rel)
Gets the target Object for the given relationship. Note, at least one of the source or destination must not be null. If both are null, then nothing can be displayed in the graph (a relationship cannot exist without nodes to be connected to). However, if one of getSource() or getDestination() returns null, then the resulting graph will contain an unconnected node for the non-null object returned from the other method.

Parameters:
  `rel` - the relationship.
Returns:
  the destination, or null for an unconnected source.

### getElements

Object[] getElements(Object input)
Returns all the relationships in the graph for the given input.

Specified by:
  `getElements` in interface `IStructuredContentProvider`
Parameters:
  `input` - the input model object.
Returns:
  all the relationships in the graph for the given input.