Package devplugin

Examples of devplugin.ContextMenuAction


    }
  }

  private ActionMenu createEditFavoriteMenuAction(final Favorite[] favArr) {
    if (favArr.length == 1) {
      ContextMenuAction action = new ContextMenuAction();
      action.setSmallIcon(TVBrowserIcons.edit(TVBrowserIcons.SIZE_SMALL));
      action.setText(mLocalizer.ellipsisMsg("editFavorite","Edit favorite '{0}'", favArr[0].getName()));
      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);
          }
View Full Code Here


    ArrayList<ContextMenuAction> subItems = new ArrayList<ContextMenuAction>();

    for (final Program program : programs) {
      if(!program.isExpired() && !program.equals(p)) {
        ContextMenuAction subItem = new ContextMenuAction(FavoriteTreeModel.getFavoriteLabel(favorite, program, p.getChannel()));
        subItem.setActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            MainFrame.getInstance().scrollToProgram(program);
            if (ProgramInfo.isShowing()) {
              ProgramInfo.getInstance().showProgramInformation(program);
            }
View Full Code Here

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

  private ActionMenu createDeleteFavoriteMenuAction(final Favorite[] favArr) {
      if (favArr.length == 1) {
        ContextMenuAction action = new ContextMenuAction();
        action.setSmallIcon(TVBrowserIcons.delete(TVBrowserIcons.SIZE_SMALL));
        action.setText(mLocalizer.ellipsisMsg("deleteFavorite","Delete Favorite '{0}'", favArr[0].getName()));
        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);
            }
View Full Code Here

    }


  private ActionMenu createBlackListFavoriteMenuAction(final Favorite[] favArr, final Program program) {
    if (favArr.length == 1) {
      ContextMenuAction action = new ContextMenuAction();

      if(favArr[0].isOnBlackList(program)) {
        action.setSmallIcon(TVBrowserIcons.refresh(TVBrowserIcons.SIZE_SMALL));
        action.setText(mLocalizer.msg("removeFavoriteFromBlackList","Put this program back into '{0}'", favArr[0].getName()));
        action.setActionListener(new ActionListener(){
          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);
          }
View Full Code Here

    return new ActionMenu(action);
  }

  protected static ActionMenu getContextMenuActions(final Program program) {
    ContextMenuAction action = new ContextMenuAction();
    action.setText(mLocalizer.msg("searchRepetion", "Search repetition"));
    action.setSmallIcon(TVBrowserIcons.search(TVBrowserIcons.SIZE_SMALL));
    action.setActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent event) {
        searchRepetitions(program);
      }
    });
    return new ActionMenu(action);
View Full Code Here

TOP

Related Classes of devplugin.ContextMenuAction

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.