2 * Created on Jul 31, 2004
4 * To change the template for this generated file go to
5 * Window>Preferences>Java>Code Generation>Code and Comments
7 package net.sourceforge.phpeclipse.phpunit;
9 import org.eclipse.swt.SWT;
10 import org.eclipse.swt.layout.FillLayout;
11 import org.eclipse.swt.layout.GridData;
12 import org.eclipse.swt.layout.GridLayout;
13 import org.eclipse.swt.widgets.Composite;
14 import org.eclipse.swt.widgets.Label;
15 import org.eclipse.swt.widgets.ProgressBar;
18 * @author Ali Echihabi
20 * To change the template for this generated type comment go to
21 * Window>Preferences>Java>Code Generation>Code and Comments
23 public class ProgressInfoComposite extends Composite {
26 private Label labelRuns, labelRunsVal; // Runs: 12
27 private Label labelErrors, labelErrorsVal;
28 private Label labelFailures, labelFailuresVal;
30 private ProgressBar progressBar;
36 public ProgressInfoComposite(Composite parent) {
38 super(parent, SWT.NONE);
40 GridLayout gridLayout = new GridLayout();
41 gridLayout.numColumns = 1;
43 // set title and layout
44 setLayout(gridLayout);
47 // set the progress bar
48 progressBar = new ProgressBar(this, SWT.HORIZONTAL);
49 progressBar.setLayoutData(
50 new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL));
51 progressBar.setMinimum(0);
54 Composite labelsComposite =
55 new Composite(this, SWT.NONE);
56 labelsComposite.setLayoutData(
57 new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL));
59 labelsComposite.setLayout(new FillLayout(SWT.HORIZONTAL));
61 labelRuns = new Label(labelsComposite, SWT.NONE);
62 labelRuns.setText("Runs: ");
63 labelRunsVal = new Label(labelsComposite, SWT.NONE);
64 labelRunsVal.setText("0 / 0");
66 labelFailures = new Label(labelsComposite, SWT.NONE);
67 labelFailures.setText("Failures: ");
68 labelFailuresVal = new Label(labelsComposite, SWT.NONE);
69 labelFailuresVal.setText("0");
71 labelErrors = new Label(labelsComposite, SWT.NONE);
72 labelErrors.setText("Errors: ");
73 labelErrorsVal = new Label(labelsComposite, SWT.NONE);
74 labelErrorsVal.setText("0");
77 public void updateInfo(int numTests, int numTestsRun, int numFailures, int numErrors) {
80 progressBar.setMaximum(numTests);
81 progressBar.setSelection(numTestsRun);
83 System.out.println("numTestsRun: " + numTestsRun);
86 labelRunsVal.setText(numTestsRun + " / " + numTests);
87 labelFailuresVal.setText("" + numFailures);
88 labelErrorsVal.setText("" + numErrors);
90 //TODO: change Failures label to red if some exist.