Package devplugin

Examples of devplugin.ActionMenu


    menu.setActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent event) {
        FavoritesPlugin.getInstance().showExcludeProgramsDialog(null,program);
      }
    });
    return new ActionMenu(menu);
  }
View Full Code Here


      menu.setActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent event) {
          FavoritesPlugin.getInstance().showCreateFavoriteWizard(program);
        }
      });
      return new ActionMenu(menu);
  }
View Full Code Here

      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);
          }
        });
      }

      return new ActionMenu(mLocalizer.msg("excludeFrom","Exclude from"), TVBrowserIcons.filter(TVBrowserIcons.SIZE_SMALL), subItems);
    }
  }
View Full Code Here

      action.setActionListener(new ActionListener(){
        public void actionPerformed(ActionEvent e) {
          FavoritesPlugin.getInstance().showManageFavoritesDialog(favArr[0]);
        }
      });
      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().showManageFavoritesDialog(fav);
          }
        });
      }

      return new ActionMenu(mLocalizer.msg("manage","Manage Favorite"), FavoritesPlugin.getFavoritesIcon(16), subItems);
    }
  }
View Full Code Here

      action.setActionListener(new ActionListener(){
        public void actionPerformed(ActionEvent e) {
          FavoritesPlugin.getInstance().editFavorite(favArr[0]);
        }
      });
      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().editFavorite(fav);
          }
        });
      }

      return new ActionMenu(mLocalizer.msg("edit","Edit Favorite"), TVBrowserIcons.edit(TVBrowserIcons.SIZE_SMALL), subItems);
    }
  }
View Full Code Here

    }
    else {
      ArrayList<ActionMenu> menus = new ArrayList<ActionMenu>();

      for (Favorite favorite : favorites) {
        ActionMenu menu = createFavoriteRepetitionMenu(favorite.getName(), null,favorite, p);

        if(menu != null) {
          menus.add(menu);
        }
      }

      return menus.isEmpty() ? null : new ActionMenu(actionText, icon, menus.toArray(new ActionMenu[menus.size()]));
    }
  }
View Full Code Here

    // maybe all other repetitions were already expired?
    if (subItems.size() == 0) {
      return null;
    }

    return new ActionMenu(title, icon, subItems.toArray(new ContextMenuAction[subItems.size()]));
  }
View Full Code Here

        action.setActionListener(new ActionListener(){
          public void actionPerformed(ActionEvent e) {
            FavoritesPlugin.getInstance().askAndDeleteFavorite(favArr[0]);
          }
        });
        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().askAndDeleteFavorite(fav);
            }
          });
        }

        return new ActionMenu(mLocalizer.msg("delete","Delete Favorite"), TVBrowserIcons.delete(TVBrowserIcons.SIZE_SMALL), subItems);
      }
    }
View Full Code Here

          public void actionPerformed(ActionEvent e) {
            favArr[0].removeFromBlackList(program);
          }
        });

        return (new ActionMenu(action));
      } else {
        return null;
      }
    }
    else {
      ArrayList<Favorite> fromList = new ArrayList<Favorite>();

      for (Favorite favorite : favArr) {
        if(favorite.isOnBlackList(program)) {
          fromList.add(favorite);
        }
      }

      ContextMenuAction[] reactivateAction = new ContextMenuAction[fromList.size()];

      for(int i = 0; i < fromList.size(); i++) {
        final Favorite fav = fromList.get(i);
        reactivateAction[i] = new ContextMenuAction(fav.getName());
        reactivateAction[i].setSmallIcon(FavoritesPlugin.getFavoritesIcon(16));
        reactivateAction[i].setActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            fav.removeFromBlackList(program);
          }
        });
      }

      if(!fromList.isEmpty()) {
        return new ActionMenu(mLocalizer.ellipsisMsg("removeFromBlackList", "Put this program back into"),
            TVBrowserIcons.refresh(TVBrowserIcons.SIZE_SMALL), reactivateAction);
      } else {
        return null;
      }
    }
View Full Code Here

   */
  private void showInfoDialog(PluginProxy plugin) {
    if (plugin == null) {
      return;
    }
    ActionMenu actionMenu = plugin.getButtonAction();
    Action action = null;
    if (actionMenu !=null) {
      action = actionMenu.getAction();
    }
    Icon ico = null;
    if (action != null) {
      ico = (Icon) action.getValue(Action.SMALL_ICON);
    }
View Full Code Here

TOP

Related Classes of devplugin.ActionMenu

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.