Fixed: malfunctioned "Remove trailing spaces on editor save"
[phpeclipse.git] / net.sourceforge.phpeclipse.phpunit / src / net / sourceforge / phpeclipse / phpunit / TestPoolLabelProvider.java
index 3e27112..40614c3 100644 (file)
@@ -1,9 +1,11 @@
-/*
- * Created on Aug 8, 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.TestCase;
@@ -13,73 +15,63 @@ import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.jface.viewers.LabelProvider;
 import org.eclipse.swt.graphics.Image;
 
-/**
- * @author Ali Echihabi
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
 public class TestPoolLabelProvider extends LabelProvider {
 
        public String getText(Object element) {
-               
+
                String text = "";
-               
-               if(element instanceof TestSuite) 
-                       return ((TestSuite)element).getName();
-               else if(element instanceof TestCase) {
-               
-                       text = ((TestCase)element).getTestName();
-                       
-                       //has the form: TESTSUITENAME_TESTNAME
-                       
-               }
-               else
+
+               if (element instanceof TestSuite)
+                       return ((TestSuite) element).getName();
+               else if (element instanceof TestCase) {
+
+                       text = ((TestCase) element).getTestName();
+
+                       // has the form: TESTSUITENAME_TESTNAME
+
+               } else
                        text = "UNKNOWN ELEMENT TYPE";
-               
+
                return text;
-               
+
        }
 
        public Image getImage(Object element) {
-               
+
                Image image = null;
                ImageDescriptor descriptor = null;
-                       
-               if(element instanceof TestSuite) {
-                       
-                       TestSuite suite = (TestSuite)element;
-                       descriptor = PHPUnitImages.DESC_TEST_SUITE_PASS;
 
+               if (element instanceof TestSuite) {
+
+                       TestSuite suite = (TestSuite) element;
+                       descriptor = PHPUnitImages.DESC_TEST_SUITE_PASS;
 
-                       if(suite.hasError())
+                       if (suite.hasError())
                                descriptor = PHPUnitImages.DESC_TEST_SUITE_ERROR;
-                       else if(suite.hasFailure())
+                       else if (suite.hasFailure())
                                descriptor = PHPUnitImages.DESC_TEST_SUITE_FAILURE;
-                       else if(suite.isAllPass())
+                       else if (suite.isAllPass())
                                descriptor = PHPUnitImages.DESC_TEST_SUITE_PASS;
-                                       
-                                                               
-               } else if(element instanceof TestCase) {
-                       
-                       TestCase test = (TestCase)element;
-                       
+
+               } else if (element instanceof TestCase) {
+
+                       TestCase test = (TestCase) element;
+
                        descriptor = PHPUnitImages.DESC_TEST_PASS;
-                       
-                       if(test.isError())
+
+                       if (test.isError())
                                descriptor = PHPUnitImages.DESC_TEST_ERROR;
-                       else if(test.isFailure())
+                       else if (test.isFailure())
                                descriptor = PHPUnitImages.DESC_TEST_FAILURE;
-                       else if(test.isPass())
+                       else if (test.isPass())
                                descriptor = PHPUnitImages.DESC_TEST_PASS;
-                                       
+
                }
-               
+
                image = descriptor.createImage();
-       
-               
+
                return image;
-               
+
        }
 
 }