Over a million developers have joined DZone.

ArrayContentProvider - A default implementation for IStructuredContentProvider

· Java Zone

Check out this 8-step guide to see how you can increase your productivity by skipping slow application redeploys and by implementing application profiling, as you code! Brought to you in partnership with ZeroTurnaround.

Today I discovered that JFace provides a nice default implementation for the IStructuredContentProvider - the org.eclipse.jface.viewers.ArrayContentProvider class. Most of the time, the input to a ListViewer will be either an array of objects or List of objects. This content provider handles both cases. In fact it handles Collection - so you can even pass a Set or Queue to the viewer.setInput() method.

This might be the shortest tip I've ever written. Couldn't resist myself from blogging this. Hope its useful :-)

This is an extract from http://blog.eclipse-tips.com/2008/08/arraycontentprovider-default.html 

 

The Java Zone is brought to you in partnership with ZeroTurnaround. Check out this 8-step guide to see how you can increase your productivity by skipping slow application redeploys and by implementing application profiling, as you code!

Topics:

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}