Commit c86b6632 authored by Sabine Teufl's avatar Sabine Teufl
Browse files

bug in sorting of requirements removed

refs 1400
parent 978ee355
......@@ -17,7 +17,7 @@ $Id$
+--------------------------------------------------------------------------*/
package org.fortiss.af3.mira.ui.editor.overview;
import static org.fortiss.af3.mira.utils.MiraUtils.getAdditionallyInformationFor;
import static org.fortiss.af3.mira.utils.MiraUtils.getAdditionalInformationFor;
import static org.fortiss.af3.mira.utils.MiraUtils.getContextElementName;
import static org.fortiss.af3.mira.utils.MiraUtils.getRequirementName;
import static org.fortiss.af3.mira.utils.MiraUtils.getTypeRankingFor;
......@@ -118,9 +118,9 @@ public class OverviewComparator extends ViewerComparator {
case 2:
rc =
getAdditionallyInformationFor((INamedCommentedElement)e1)
getAdditionalInformationFor((INamedCommentedElement)e1)
.compareToIgnoreCase(
getAdditionallyInformationFor((INamedCommentedElement)e2));
getAdditionalInformationFor((INamedCommentedElement)e2));
break;
case 3:
......
......@@ -261,21 +261,36 @@ public class MiraUtils {
* the {@link EObject}
* @return the additional information
*/
public static String getAdditionallyInformationFor(EObject object) {
public static String getAdditionalInformationFor(EObject object) {
if(object instanceof Analysis || object instanceof RequirementsContainer ||
object instanceof RequirementsPackage || object instanceof Glossary ||
object instanceof RequirementSource) {
return "-";
}
if(object instanceof Requirement) {
return ((Requirement)object).getDescription();
return stringNotNull(((Requirement)object).getDescription(), "");
}
if(object instanceof ContextElement) {
return ((ContextElement)object).getDefinition();
return stringNotNull(((ContextElement)object).getDefinition(), "");
}
return "Not an object for requirements analysis";
}
/**
* Replace string when it is null
*
* @param input
* String to check
* @param replaceWith
* String that is used, when input is null
* @return replaced string
*/
private static String stringNotNull(String input, String replaceWith) {
return input != null ? input : replaceWith;
}
/**
* Get a human readable name according to the type of the given requirements analysis object.
*
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment