X-Git-Url: http://git.phpeclipse.com diff --git a/net.sourceforge.phpeclipse.phpunit/src/net/sourceforge/phpeclipse/phpunit/ProgressInfoComposite.java b/net.sourceforge.phpeclipse.phpunit/src/net/sourceforge/phpeclipse/phpunit/ProgressInfoComposite.java index 2541c87..f1a80a3 100644 --- a/net.sourceforge.phpeclipse.phpunit/src/net/sourceforge/phpeclipse/phpunit/ProgressInfoComposite.java +++ b/net.sourceforge.phpeclipse.phpunit/src/net/sourceforge/phpeclipse/phpunit/ProgressInfoComposite.java @@ -1,15 +1,16 @@ -/* - * Created on Jul 31, 2004 +/************************************************************************* + * @author Ali Echihabi (ali_echihabi@ieee.org, ali.echihabi@souss.ca) * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ + * Plugin for PHP unit Testing. + * www.phpeclipse.de + * + *************************************************************************/ + package net.sourceforge.phpeclipse.phpunit; import net.sourceforge.phpeclipse.phpunit.testpool.TestPool; import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Image; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; @@ -17,20 +18,14 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.ProgressBar; -/** - * @author Ali Echihabi - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ public class ProgressInfoComposite extends Composite { - private Label labelRuns, labelRunsVal; // Runs: 12 + private Label labelErrors, labelErrorsImage, labelErrorsVal; + private Label labelFailures, labelFailuresImage, labelFailuresVal; - - + private ProgressBar progressBar; /** @@ -38,28 +33,25 @@ public class ProgressInfoComposite extends Composite { * @param arg1 */ public ProgressInfoComposite(Composite parent) { - + super(parent, SWT.NONE); - + GridLayout gridLayout = new GridLayout(); gridLayout.numColumns = 1; - + // set title and layout setLayout(gridLayout); - // set the progress bar progressBar = new ProgressBar(this, SWT.HORIZONTAL); - progressBar.setLayoutData( - new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL)); + progressBar.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL + | GridData.FILL_HORIZONTAL)); progressBar.setMinimum(0); - - Composite labelsComposite = - new Composite(this, SWT.NONE); - - labelsComposite.setLayoutData( - new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL)); + Composite labelsComposite = new Composite(this, SWT.NONE); + + labelsComposite.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL + | GridData.FILL_HORIZONTAL)); labelsComposite.setLayout(new FillLayout(SWT.HORIZONTAL)); @@ -75,43 +67,39 @@ public class ProgressInfoComposite extends Composite { labelFailuresVal = new Label(labelsComposite, SWT.NONE); labelFailuresVal.setText("0"); - labelErrorsImage = new Label(labelsComposite, SWT.NONE); labelErrorsImage.setImage(PHPUnitImages.DESC_ERROR.createImage()); labelErrors = new Label(labelsComposite, SWT.NONE); labelErrors.setText("Errors: "); labelErrorsVal = new Label(labelsComposite, SWT.NONE); - labelErrorsVal.setText("0"); + labelErrorsVal.setText("0"); } public void resetInfo() { - + labelErrorsVal.setText("0"); labelFailuresVal.setText("0"); labelRunsVal.setText("0 / 0"); - progressBar.setSelection(0); - + progressBar.setSelection(0); + } public void updateInfo(TestPool testPool) { - + int numTestsOverall = testPool.getNumTestsOverall(); int numTestsRun = testPool.getNumTestsRun(); - - //update progress bar + + // update progress bar progressBar.setMaximum(numTestsOverall); progressBar.setSelection(numTestsRun); - - - //update labels + + // update labels labelRunsVal.setText(numTestsRun + " / " + numTestsOverall); labelFailuresVal.setText("" + testPool.getNumFailures()); labelErrorsVal.setText("" + testPool.getNumErrors()); - - //TODO: change Failures label to red if some exist. - - - + + // TODO: change Failures label to red if some exist. + } }