TableViewer and TreeViewer are JFace viewers. In eclipse, Problems view and Properties view are mainly implemented by TabelViewer. Outline view and Navigator view are implemented by TreeViewer.
In working with JFace viewers, it's really import to understand the concept of content provider and label provider. Briefly speaking, content provider provides what to show, label provider provides how to show. Now, I'll introduce them respectively.
TableViewer
For TabelViewer, the content provider should implement IStructuredContentProvider. This interface has three method need to be implemented. They are
Then, the label provider should inherite ITableLabelProvider. It provides two APIs.
TreeViewer
Content provider should use ITreeContentProvider. It provides two more methods than ITableContentProvider. They are getParent() and getChildren(). They tell the relationship between different elements. As the lazy spirit, it only shows what need to be shown. When a parent is folded, its children are still unknown. The time you click on the "+" sign, getChildren() is invoked.
Label provider should implement ILabelProvider. Obviously, a label in the tree doesn't have columns. So the getText(Object) doesn't have the second parameter.
Link : Eclipse JFace TableViewer - Tutorial