private void searchInLabels(LabelType type, String filter) { for (Label label : getLabelsMap().get(type)) { String name = StringUtils.deleteWhitespace(label.getName().toLowerCase()); if (name.contains(filter)) { addLabel(type, label); if ((filter.length() < 3) && (getListMatching().size() > 9)) { return; } } } }
private void addLabel(LabelType type, Label label) { getListMatching() .add(new FilterPair(TaskElementFilterEnum.Label, label.getFinderPattern(), label)); }