+ protected List<TextPart> getLabel(int index, int width, boolean selected,
+ boolean focused) {
+ // TODO: from ini file?
+ int SIZE_COL_1 = 3;
+
+ Element el = (focused && selected) ? Element.CONTACT_LINE_SELECTED
+ : Element.CONTACT_LINE;
+ Element elSep = (focused && selected) ? Element.CONTACT_LINE_SEPARATOR_SELECTED
+ : Element.CONTACT_LINE_SEPARATOR;
+
+ List<TextPart> parts = new LinkedList<TextPart>();
+
+ String count = "";
+ if (cards.get(index) != null)
+ count += cards.get(index).size();
+
+ String name = files.get(index).getName();
+
+ name = StringUtils.sanitize(name, UiColors.getInstance().isUnicode());
+
+ count = " " + StringUtils.padString(count, SIZE_COL_1) + " ";
+ name = " "
+ + StringUtils.padString(name, width - SIZE_COL_1
+ - getSeparator().length()) + " ";
+
+ parts.add(new TextPart(count, el));
+ parts.add(new TextPart(getSeparator(), elSep));
+ parts.add(new TextPart(name, el));
+
+ return parts;
+ };