corrected the number of tests expected in progress view. Added toolbar actions to...
[phpeclipse.git] / net.sourceforge.phpeclipse.phpunit / src / net / sourceforge / phpeclipse / phpunit / ResultsInfoComposite.java
1 /*
2  * Created on Jul 31, 2004
3  *
4  * To change the template for this generated file go to
5  * Window>Preferences>Java>Code Generation>Code and Comments
6  */
7 package net.sourceforge.phpeclipse.phpunit;
8
9 import net.sourceforge.phpeclipse.phpunit.testpool.TestPool;
10
11 import org.eclipse.jface.viewers.TreeViewer;
12 import org.eclipse.swt.SWT;
13 import org.eclipse.swt.layout.GridData;
14 import org.eclipse.swt.layout.GridLayout;
15 import org.eclipse.swt.widgets.Composite;
16
17 /**
18  * @author Ali Echihabi
19  *
20  * To change the template for this generated type comment go to
21  * Window>Preferences>Java>Code Generation>Code and Comments
22  */
23 public class ResultsInfoComposite extends Composite {
24
25
26         
27         private TreeViewer treeViewer;
28         
29         /**
30          * @param arg0
31          * @param arg1
32          */
33         public ResultsInfoComposite(Composite parent) {
34
35                 super(parent, SWT.BORDER);
36
37                 GridLayout layout = new GridLayout();
38                 layout.numColumns = 1;
39                 
40                 setLayout(layout);
41                 
42                 treeViewer = new TreeViewer(this, SWT.BORDER | SWT.SHADOW_ETCHED_IN);
43
44                 treeViewer.getControl().setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.FILL_BOTH | GridData.GRAB_VERTICAL));
45                 
46                 
47                 TestPoolLabelProvider labelProvider = new TestPoolLabelProvider();
48                 TestPoolContentProvider contentProvider= new TestPoolContentProvider();
49                 
50                 treeViewer.setContentProvider(contentProvider);
51                 treeViewer.setLabelProvider(labelProvider);
52                                 
53         }
54
55         
56         public void resetInfo() {
57                 
58                 treeViewer.setInput(null);
59         }
60         
61         public void updateInfo(TestPool testPool) {
62                 
63                 // take care of the TreeView and its content and label providers.
64         
65                 treeViewer.setInput(testPool.getRoot());
66                 
67         }
68
69 }