forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject svn commit: rev 9916 - in xml/forrest/trunk/scratchpad/forrestbot2/webapp/src/java/org/apache/forrest/forrestbot/webapp: dto util
Date Wed, 07 Apr 2004 20:24:49 GMT
Author: brondsem
Date: Wed Apr  7 13:24:48 2004
New Revision: 9916

Modified:
   xml/forrest/trunk/scratchpad/forrestbot2/webapp/src/java/org/apache/forrest/forrestbot/webapp/dto/ProjectDTO.java
   xml/forrest/trunk/scratchpad/forrestbot2/webapp/src/java/org/apache/forrest/forrestbot/webapp/util/Project.java
Log:
sort projects

Modified: xml/forrest/trunk/scratchpad/forrestbot2/webapp/src/java/org/apache/forrest/forrestbot/webapp/dto/ProjectDTO.java
==============================================================================
--- xml/forrest/trunk/scratchpad/forrestbot2/webapp/src/java/org/apache/forrest/forrestbot/webapp/dto/ProjectDTO.java
(original)
+++ xml/forrest/trunk/scratchpad/forrestbot2/webapp/src/java/org/apache/forrest/forrestbot/webapp/dto/ProjectDTO.java
Wed Apr  7 13:24:48 2004
@@ -20,7 +20,7 @@
 
 import java.util.Date;
 
-public class ProjectDTO {
+public class ProjectDTO implements Comparable {
 	String name;
 	int status;
 	Date lastBuilt;
@@ -140,6 +140,16 @@
 	 */
 	public void setDeployable(boolean b) {
 		deployable = b;
+	}
+
+	/* (non-Javadoc)
+	 * @see java.lang.Comparable#compareTo(java.lang.Object)
+	 */
+	public int compareTo(Object arg0) {
+		// TODO Auto-generated method stub
+		if (arg0 instanceof ProjectDTO)
+			return getName().compareTo(((ProjectDTO)arg0).getName());
+		return 0;
 	}
 
 }

Modified: xml/forrest/trunk/scratchpad/forrestbot2/webapp/src/java/org/apache/forrest/forrestbot/webapp/util/Project.java
==============================================================================
--- xml/forrest/trunk/scratchpad/forrestbot2/webapp/src/java/org/apache/forrest/forrestbot/webapp/util/Project.java
(original)
+++ xml/forrest/trunk/scratchpad/forrestbot2/webapp/src/java/org/apache/forrest/forrestbot/webapp/util/Project.java
Wed Apr  7 13:24:48 2004
@@ -24,6 +24,7 @@
 import java.io.RandomAccessFile;
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.Date;
 import java.util.Iterator;
 
@@ -158,7 +159,7 @@
 	public static Collection getAllProjects() {
 
 		/* based on config files */
-		Collection sites = new ArrayList();
+		ArrayList sites = new ArrayList();
 		File f = new File(Config.getProperty("config-dir"));
 		File[] possibleSites = f.listFiles();
 		for (int i = 0; i < possibleSites.length; i++) {
@@ -172,6 +173,7 @@
 				}
 			}
 		}
+		Collections.sort(sites);
 		return sites;
 	}
 

Mime
View raw message