*
*************************************************************************/
-
package net.sourceforge.phpeclipse.phpunit;
import java.util.Vector;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.Viewer;
-
-
public class TestPoolContentProvider implements ITreeContentProvider {
-
-
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
*/
public Object[] getChildren(Object parentElement) {
- if(parentElement instanceof TestSuite) {
+ if (parentElement instanceof TestSuite) {
Vector allChildren = new Vector();
- allChildren.addAll(((TestSuite)parentElement).getTestCases());
- allChildren.addAll(((TestSuite)parentElement).getTestSuites());
-
+ allChildren.addAll(((TestSuite) parentElement).getTestCases());
+ allChildren.addAll(((TestSuite) parentElement).getTestSuites());
+
return allChildren.toArray();
-
+
} else {
return new Object[0];
}
-
-
+
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
*/
public Object getParent(Object element) {
-
- if(element instanceof TestSuite)
- return ((TestSuite)element).getParent();
- else if (element instanceof TestCase)
- return ((TestCase)element).getParentSuite();
+
+ if (element instanceof TestSuite)
+ return ((TestSuite) element).getParent();
+ else if (element instanceof TestCase)
+ return ((TestCase) element).getParentSuite();
else
return null;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
*/
public boolean hasChildren(Object element) {
return getChildren(element).length > 0;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
*/
public Object[] getElements(Object inputElement) {
-
+
return getChildren(inputElement);
-
+
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jface.viewers.IContentProvider#dispose()
*/
public void dispose() {
-
+
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer,
+ * java.lang.Object, java.lang.Object)
*/
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
// TODO Auto-generated method stub