Changeset 1371
- Timestamp:
- 05/24/11 14:39:05 (13 years ago)
- Location:
- ComponentRegistry/trunk/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
ComponentRegistry/trunk/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry/frontend/AdminHomePage.java
r1369 r1371 2 2 3 3 import java.security.Principal; 4 import java.util.Collections; 4 5 import java.util.List; 5 6 … … 286 287 287 288 private void add(DefaultMutableTreeNode parent, List<? extends AbstractDescription> descs, boolean isDeleted, boolean isPublic) { 289 Collections.sort(descs, AbstractDescription.COMPARE_ON_NAME); 288 290 for (AbstractDescription desc : descs) { 289 291 DefaultMutableTreeNode child = new DefaultMutableTreeNode(new DisplayDataNode(desc.getName(), isDeleted, desc, isPublic)); -
ComponentRegistry/trunk/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry/impl/filesystem/ComponentRegistryImpl.java
r1364 r1371 230 230 List<ProfileDescription> result = new ArrayList<ProfileDescription>(profileDescriptions. 231 231 values()); 232 Collections.sort(result, ProfileDescription.COMPARE_ON_NAME);232 Collections.sort(result, AbstractDescription.COMPARE_ON_NAME); 233 233 return result; 234 234 } -
ComponentRegistry/trunk/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry/model/AbstractDescription.java
r1300 r1371 2 2 3 3 import java.text.ParseException; 4 import java.util.Comparator; 4 5 import java.util.Date; 5 6 … … 145 146 } 146 147 148 public static final Comparator<? super AbstractDescription> COMPARE_ON_NAME = new Comparator<AbstractDescription>() { 149 public int compare(AbstractDescription o1, AbstractDescription o2) { 150 int result = 0; 151 if (o1.getName() != null && o2.getName() != null) { 152 result = o1.getName().compareToIgnoreCase(o2.getName()); 153 } else { 154 result = o1.getId().compareTo(o2.getId()); 155 } 156 return result; 157 } 158 }; 147 159 } -
ComponentRegistry/trunk/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry/model/ComponentDescription.java
r1357 r1371 18 18 int result = 0; 19 19 if (o1.getGroupName() != null && o2.getGroupName() != null) 20 result = o1.getGroupName().compareTo (o2.getGroupName());20 result = o1.getGroupName().compareToIgnoreCase(o2.getGroupName()); 21 21 if (result == 0) { 22 22 if (o1.getName() != null && o2.getName() != null) { 23 result = o1.getName().compareTo (o2.getName());23 result = o1.getName().compareToIgnoreCase(o2.getName()); 24 24 } else { 25 25 result = o1.getId().compareTo(o2.getId()); -
ComponentRegistry/trunk/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry/model/ProfileDescription.java
r1357 r1371 2 2 3 3 import java.io.Serializable; 4 import java.util.Comparator;5 4 6 5 import javax.xml.bind.annotation.XmlRootElement; … … 14 13 private static final long serialVersionUID = 1L; 15 14 16 public static final Comparator<? super ProfileDescription> COMPARE_ON_NAME = new Comparator<ProfileDescription>() {17 public int compare(ProfileDescription o1, ProfileDescription o2) {18 int result = 0;19 if (o1.getName() != null && o2.getName() != null) {20 result = o1.getName().compareTo(o2.getName());21 } else {22 result = o1.getId().compareTo(o2.getId());23 }24 return result;25 }26 };27 28 15 public static ProfileDescription createNewDescription() { 29 16 String id = ComponentRegistry.REGISTRY_ID + "p_" + IdSequence.get();
Note: See TracChangeset
for help on using the changeset viewer.