greaterOrEqual rule for required plugins
[phpeclipse.git] / net.sourceforge.phpeclipse.phpunit / src / net / sourceforge / phpeclipse / phpunit / ResultsInfoComposite.java
1 /*************************************************************************
2  * @author Ali Echihabi (ali_echihabi@ieee.org, ali.echihabi@souss.ca)
3  *
4  * Plugin for PHP unit Testing.
5  * www.phpeclipse.de
6  * 
7  *************************************************************************/
8
9
10 package net.sourceforge.phpeclipse.phpunit;
11
12 import net.sourceforge.phpeclipse.phpunit.testpool.TestPool;
13
14 import org.eclipse.jface.viewers.TreeViewer;
15 import org.eclipse.swt.SWT;
16 import org.eclipse.swt.layout.GridData;
17 import org.eclipse.swt.layout.GridLayout;
18 import org.eclipse.swt.widgets.Composite;
19
20
21 public class ResultsInfoComposite extends Composite {
22
23
24         
25         private TreeViewer treeViewer;
26         
27         /**
28          * @param arg0
29          * @param arg1
30          */
31         public ResultsInfoComposite(Composite parent) {
32
33                 super(parent, SWT.BORDER);
34
35                 GridLayout layout = new GridLayout();
36                 layout.numColumns = 1;
37                 
38                 setLayout(layout);
39                 
40                 treeViewer = new TreeViewer(this, SWT.BORDER | SWT.SHADOW_ETCHED_IN);
41
42                 treeViewer.getControl().setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.FILL_BOTH | GridData.GRAB_VERTICAL));
43                 
44                 
45                 TestPoolLabelProvider labelProvider = new TestPoolLabelProvider();
46                 TestPoolContentProvider contentProvider= new TestPoolContentProvider();
47                 
48                 treeViewer.setContentProvider(contentProvider);
49                 treeViewer.setLabelProvider(labelProvider);
50                                 
51         }
52
53         
54         public void resetInfo() {
55                 
56                 treeViewer.setInput(null);
57         }
58         
59         public void updateInfo(TestPool testPool) {
60                 
61                 // take care of the TreeView and its content and label providers.
62         
63                 treeViewer.setInput(testPool.getRoot());
64                 
65         }
66
67 }