Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[mylar-dev] example implementation of IGraphContentProvider interface/ what are relationships

Hi,

I am developing a call graph view using zest. I have got my own
ContentProvider which implements the IGraphContentProvider interface.
I've based it on the GraphContentProvider implementation which is not
up to date anymore, as getElements is now used instead of
getRelationships.

	/**
	 * Returns all the relationships in the graph for the given input.
	 * @input the input model object.
	 * @return all the relationships in the graph for the given input.
	 */
	public Object[] getElements(Object input);


my implementation is:
public Object[] getElements(Object input) {
		Object[] rels = null;
		if (this.fCGModel != null) {
			int size = CGContentProvider.MAX <
this.fCGModel.getConnectionSize() ? CGContentProvider.MAX :
this.fCGModel.getConnectionSize();
			rels = new String[size];
			int length = CGContentProvider.MAX < rels.length ?
CGContentProvider.MAX : rels.length;
			for (int i = 0; i < length; i++) {
				rels[i] = "" + i;
			}
		}
		return rels;
	}

in which I just return an array of strings from 0 to the number of the
connections. But these don't seem to be relationships.

So my question really is: what are relationship objects supposed to be
like? Does anybody have a sample implementation of getElements() where
something different from just an array of numbers is returned?

Raphael


Back to the top