private ActionMenu createExcludeFromFavoritesMenuAction(final Favorite[] favArr, final Program program) {
if (favArr.length == 1) {
ContextMenuAction action = new ContextMenuAction();
action.setSmallIcon(TVBrowserIcons.filter(TVBrowserIcons.SIZE_SMALL));
action.setText(mLocalizer.ellipsisMsg("excludeFromFavorite","Exclude from '{0}'", favArr[0].getName()));
action.setActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
FavoritesPlugin.getInstance().showExcludeProgramsDialog(favArr[0], program);
}
});
return new ActionMenu(action);
}
else {
ContextMenuAction[] subItems = new ContextMenuAction[favArr.length];
for (int i=0; i<subItems.length; i++) {
final Favorite fav = favArr[i];
subItems[i] = new ContextMenuAction(favArr[i].getName());
subItems[i].setSmallIcon(FavoritesPlugin.getFavoritesIcon(16));
subItems[i].setActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
FavoritesPlugin.getInstance().showExcludeProgramsDialog(fav, program);
}