svn commit: r638709 - in /ofbiz/trunk/framework/webtools: src/org/ofbiz/webtools/artifactinfo/ArtifactInfoBase.java webapp/webtools/WEB-INF/actions/artifactinfo/ArtifactInfo.bsh

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r638709 - in /ofbiz/trunk/framework/webtools: src/org/ofbiz/webtools/artifactinfo/ArtifactInfoBase.java webapp/webtools/WEB-INF/actions/artifactinfo/ArtifactInfo.bsh

jonesde
Author: jonesde
Date: Tue Mar 18 22:17:45 2008
New Revision: 638709

URL: http://svn.apache.org/viewvc?rev=638709&view=rev
Log:
Improved sorting on search results, can now do sorting elsewhere with TreeSet too

Modified:
    ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ArtifactInfoBase.java
    ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/artifactinfo/ArtifactInfo.bsh

Modified: ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ArtifactInfoBase.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ArtifactInfoBase.java?rev=638709&r1=638708&r2=638709&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ArtifactInfoBase.java (original)
+++ ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ArtifactInfoBase.java Tue Mar 18 22:17:45 2008
@@ -38,9 +38,11 @@
         }
     }
     
-    public int compareTo(ArtifactInfoBase aib) {
-        if (aib == null) return -1;
-        return this.getDisplayName().compareTo(aib.getDisplayName());
+    public int compareTo(ArtifactInfoBase that) {
+        if (that == null) return -1;
+        String thisName = this.getDisplayType() + ":" + this.getDisplayName();
+        String thatName = that.getDisplayType() + ":" + that.getDisplayName();
+        return thisName.compareTo(thatName);
     }
     
     abstract public String getDisplayName();

Modified: ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/artifactinfo/ArtifactInfo.bsh
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/artifactinfo/ArtifactInfo.bsh?rev=638709&r1=638708&r2=638709&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/artifactinfo/ArtifactInfo.bsh (original)
+++ ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/artifactinfo/ArtifactInfo.bsh Tue Mar 18 22:17:45 2008
@@ -40,6 +40,6 @@
     if (artifactInfoSet.size() == 1) {
         context.put("artifactInfo", artifactInfoSet.iterator().next());
     } else {
-        context.put("artifactInfoSet", artifactInfoSet);
+        context.put("artifactInfoSet", new TreeSet(artifactInfoSet));
     }
 }