private String getCauseRecursively(Throwable t) {
if(t == null){
- return null;
+ return "";
}
if(t.getCause() != null){
*
* @param operation
* a
- * {@link eu.etaxonomy.taxeditor.operation.AbstractPostOperation}
+ * {@link eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation}
* object.
* @return a {@link org.eclipse.core.runtime.IStatus} object.
*/
/**
* Orders a Collection of {@link IEnumTerm}s according to the term
- * hierarchy. The hierarchy will be reduced to two layers: one layer being
- * the root elements (that have no parents) and the other being their
- * children and children's children recursively.<br>
- * The returned map will be be ordered primarily by root elements and
- * secondarily by the child elements, both ascending alphabetically. <br>
+ * hierarchy. <br>
* <br>
- * The reduced hierarchy could look like this:<br>
- * <ul>
- * <li>Root1
- * <ul>
- * <li>child1
- * <li>child2
- * <li>childOfChild2
- * </ul>
- * <li>root2
- * <ul><li>child4</ul>
- * </ul>
- *
+ * The returned map will be be ordered primarily by root elements,
+ * secondarily by the child elements and their children resp., both ascending alphabetically. <br>
* @param terms
* A {@link Collection} of {@link IEnumTerm}s for which the term
* hierarchy should be created
* representation via {@link IEnumTerm#getMessage()} as values
*/
public static <T extends IEnumTerm<T>> LinkedHashMap<T, String> orderTerms(Collection<T> terms) {
-// Comparator<TermNode<T>> comparator = new Comparator<TermNode<T>>() {
-// @Override
-// public int compare(TermNode<T> t1, TermNode<T> t2) {
-// return t1.getTerm().getMessage().compareTo(t2.getTerm().getMessage());
-// }
-// };
-
TreeSet<TermNode<T>> parentElements = new TreeSet<TermNode<T>>();
parentElements.addAll(getTermHierarchy(terms));
for(int i=0;i<depth;i++){
indentString += " ";
}
+ if(depth>0){
+ indentString += "- ";
+ }
result.put(node.term, indentString + node.term.getMessage());
parseTermTree(node.children, result, depth);
}