Community
Participate
Working Groups
a clone of such a class can be found in so many places in eclipse that it seems resonable for jface to provide it as a default implementation (called maybe ObjectArrayContentProvider or something) everybody seems to be copying it so we might just write it once and let people use it class MyContentProvider implements IStructuredContentProvider { public Object[] getElements(Object inputElement) { return (Object[])inputElement; } public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { } public void dispose() { } }
The name and spec for such a class would have to clearly indicate that it was purely for showing static arrays. I'd also consider marking it final so that people don't treat it as a default implementation for general content providers. In general, all implementors need to implement inputChanged appropriately, and should consider implementing dispose.
Added ArrayContentProvider to org.eclipse.jface.viewers. It handles both arrays and collections.