class BundleListRenderer implements ListCellRenderer<BundleItem> {

    public static String getBundleIconPath(String icons) {
        if(icons!=null) {
            List<String> iconList = new ArrayList<>();
            if(icons.contains(ICON_SEPARATOR)) {
                for(String icon_descr : icons.split(ICON_SEPARATOR)) {
                    iconList.add(icon_descr);
                }
            } else {
                iconList.add(icons);
            }
            String best_path = "";
            int best_width = 0;
            for(String icon_descr : iconList) {
                // Take the best icon size
                int size_pos = icon_descr.indexOf(ICON_SIZE_PROP);
                int size_val = 0;
                String iconPath = new String(icon_descr);
                if(size_pos>1) {
                    size_val = Integer.valueOf(icon_descr.substring(size_pos+ICON_SIZE_PROP.length()
                            ,icon_descr.length()).trim());
                    iconPath = icon_descr.substring(0,size_pos-1).trim();
                }
                if(best_width==0 || size_val == bundleIconDimension.width ||
                        (size_val > best_width && best_width != bundleIconDimension.width)) {
                    best_path = iconPath;
                    best_width = size_val;
                }
            }
            if(!best_path.isEmpty()) {
                return best_path;
            }
        }
        return "";
    }

    public  BundleListRenderer(JList list);

}