FilterParser fp = new FilterParser();
String filterStr = requirement.getDirectives().get("filter");
if (filterStr == null) {
label.append("<no filter>", UIConstants.ERROR_STYLER);
} else {
Expression exp = fp.parse(filter);
if (exp instanceof WithRangeExpression) {
label.append(((WithRangeExpression) exp).printExcludingRange(), UIConstants.BOLD_STYLER);
RangeExpression range = ((WithRangeExpression) exp).getRangeExpression();
if (range != null)
label.append(" ").append(formatRangeString(range), StyledString.COUNTER_STYLER);
} else {
label.append(exp.toString());
}
}
} catch (Exception e) {
throw new RuntimeException(e);
}