Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

ArrayContentProvider - A default implementation for IStructuredContentProvider

DZone's Guide to

ArrayContentProvider - A default implementation for IStructuredContentProvider

· Java Zone
Free Resource

Download Microservices for Java Developers: A hands-on introduction to frameworks and containers. Brought to you in partnership with Red Hat.

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 

 

Download Building Reactive Microservices in Java: Asynchronous and Event-Based Application Design. Brought to you in partnership with Red Hat

Topics:

Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}