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 :-)
Aug 13, 2008
ArrayContentProvider - A default implementation for IStructuredContentProvider
This blog has moved. Click here for an updated version of this blog entry
Posted by
Prakash G. R.
at
12:01 PM
Labels: guidelines, jface
Subscribe to:
Post Comments (Atom)

0 comments:
Post a Comment