1 /*************************************************************************
2 * @author Ali Echihabi (ali_echihabi@ieee.org, ali.echihabi@souss.ca)
4 * Plugin for PHP unit Testing.
7 *************************************************************************/
9 package net.sourceforge.phpeclipse.phpunit;
11 import net.sourceforge.phpeclipse.phpunit.testpool.TestPool;
13 import org.eclipse.jface.viewers.TreeViewer;
14 import org.eclipse.swt.SWT;
15 import org.eclipse.swt.layout.GridData;
16 import org.eclipse.swt.layout.GridLayout;
17 import org.eclipse.swt.widgets.Composite;
19 public class ResultsInfoComposite extends Composite {
21 private TreeViewer treeViewer;
27 public ResultsInfoComposite(Composite parent) {
29 super(parent, SWT.BORDER);
31 GridLayout layout = new GridLayout();
32 layout.numColumns = 1;
36 treeViewer = new TreeViewer(this, SWT.BORDER | SWT.SHADOW_ETCHED_IN);
38 treeViewer.getControl().setLayoutData(
39 new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.FILL_BOTH
40 | GridData.GRAB_VERTICAL));
42 TestPoolLabelProvider labelProvider = new TestPoolLabelProvider();
43 TestPoolContentProvider contentProvider = new TestPoolContentProvider();
45 treeViewer.setContentProvider(contentProvider);
46 treeViewer.setLabelProvider(labelProvider);
50 public void resetInfo() {
52 treeViewer.setInput(null);
55 public void updateInfo(TestPool testPool) {
57 // take care of the TreeView and its content and label providers.
59 treeViewer.setInput(testPool.getRoot());