Package devplugin

Examples of devplugin.ActionMenu


        "internet-news-reader", 16));
    action.putValue(BIG_ICON, createImageIcon("apps", "internet-news-reader",
        22));
    action.putValue(Action.SHORT_DESCRIPTION, getInfo().getDescription());

    return new ActionMenu(action);
  }
View Full Code Here


            }
          });
        }
        }

      return new ActionMenu(mLocalizer.ellipsisMsg("contextMenuText", "Send via email"), icon, list.toArray(new AbstractAction[list.size()]));
    }
    else {
      AbstractAction mail = new AbstractAction(mLocalizer.msg("contextMenuText", "Send via email")) {
        public void actionPerformed(ActionEvent evt) {
          Program[] programArr = { program };
          new MailCreator(EMailPlugin.this, mSettings, mConfigs.length != 1 ? DEFAULT_CONFIG : mConfigs[0]).createMail(getParentFrame(), programArr);
        }
      };

      mail.putValue(Action.NAME, mLocalizer.msg("contextMenuText", "Send via email"));
      mail.putValue(Action.SMALL_ICON, icon);

      return new ActionMenu(mail);
    }
  }
View Full Code Here

      }
    };
    action.putValue(Action.NAME, mLocalizer.msg("buttonName", "Open Translation Tool"));
    action.putValue(Action.SMALL_ICON, createImageIcon("apps", "preferences-desktop-locale", 16));
    action.putValue(BIG_ICON, createImageIcon("apps", "preferences-desktop-locale", 22));
    return new ActionMenu(action);
  }
View Full Code Here

    };
    action.putValue(Action.NAME, mLocalizer.msg("pluginName", "TV Rater"));
    action.putValue(Action.SMALL_ICON, getSmallIcon());
    action.putValue(BIG_ICON, getLargeIcon());

    return new ActionMenu(action);
  }
View Full Code Here

      action.putValue(Action.NAME, mLocalizer.msg("contextNoRating",
          "Rate program"));
    }
    action.putValue(Action.SMALL_ICON, getSmallIcon());

    return new ActionMenu(action);
  }
View Full Code Here

  /**
   * @return The ActionMenu for this Plugin.
   */
  public ActionMenu getContextMenuActions(final Program program) {
    if(program == null || program.equals(getPluginManager().getExampleProgram()) || getPluginManager().getFilterManager() == null) {
      return new ActionMenu(new ContextMenuAction(mLocalizer.msg("mark", "Mark"),createImageIcon("status", "mail-attachment", 16)));
    }

    if (mMarkListVector.size() == 1) {
      // Create context menu entry
      return new ActionMenu(mMarkListVector.getListAt(0).getContextMenuAction(program, true));
    } else {
      Object[] submenu = new Object[mMarkListVector.size()];

      for (int i = 0; i < mMarkListVector.size(); i++) {
        submenu[i] = mMarkListVector.getListAt(i).getContextMenuAction(program, false);
      }
      return new ActionMenu(mLocalizer.msg("mark", "Mark"), createImageIcon("status", "mail-attachment", 16), submenu);
    }

  }
View Full Code Here

    // small icon
    action.putValue(Action.SMALL_ICON, createImageIcon("status", "mail-attachment",
        16));
    // big icon
    action.putValue(BIG_ICON, createImageIcon("status", "mail-attachment", 22));
    return new ActionMenu(action);
  }
View Full Code Here

  public boolean canUseProgramTree() {
    return true;
  }

  protected void addGroupingActions(PluginTreeNode node) {
    ActionMenu displayBoth = new ActionMenu(new AbstractAction(mLocalizer.msg(
        "grouping.both", "By title and date")) {
      public void actionPerformed(ActionEvent e) {
        mSettings.setNodeGroupingByBoth();
        updateTree();
      }
    }, mSettings.isGroupingByBoth());
    ActionMenu displayTitle = new ActionMenu(new AbstractAction(mLocalizer.msg(
        "grouping.title", "By title")) {
      public void actionPerformed(ActionEvent e) {
        mSettings.setNodeGroupingByTitle();
        updateTree();
      }
    }, mSettings.isGroupingByTitle());
    ActionMenu displayDate = new ActionMenu(new AbstractAction(mLocalizer.msg(
        "grouping.date", "By date")) {
      public void actionPerformed(ActionEvent e) {
        mSettings.setNodeGroupingByDate();
        updateTree();
      }
    }, mSettings.isGroupingByDate());
    ActionMenu[] groupActions = new ActionMenu[] { displayBoth, displayTitle,
        displayDate };
    node.addActionMenu(new ActionMenu(mLocalizer
        .msg("grouping.grouping", "Grouping"), groupActions));
  }
View Full Code Here

          copyAction.setEnabled(text == null || StringUtils.isNotEmpty(text));
          list.add(copyAction);
        }
      }

      return new ActionMenu(mLocalizer.ellipsisMsg("copyToSystem", "Copy to system clipboard"), icon, list.toArray(new AbstractAction[list.size()]));
    }
    else {
      AbstractAction copyToSystem = new AbstractAction(mLocalizer.msg("copyToSystem", "Copy to system clipboard")) {
        public void actionPerformed(ActionEvent evt) {
          Program[] list = { program };
          copyProgramsToSystem(list,mConfigs.length != 1 ? DEFAULT_CONFIG : mConfigs[0]);
        }
      };

      copyToSystem.putValue(Action.SMALL_ICON, icon);

      return new ActionMenu(copyToSystem);
    }
  }
View Full Code Here

      Favorite[] favArr = favorites.toArray(new Favorite[favorites.size()]);

      if(ManageFavoritesDialog.getInstance() != null && ManageFavoritesDialog.getInstance().isVisible()) {
        if(!favorites.isEmpty()) {
          ActionMenu blackListAction = createBlackListFavoriteMenuAction(favArr, program);

          ArrayList<Object> subItems = new ArrayList<Object>(2);
          subItems.add(createExcludeFromFavoritesMenuAction(favArr, program));

          if(blackListAction != null) {
            subItems.add(0,blackListAction);
          }

          return new ActionMenu(mLocalizer.msg("favorites", "Favorites"),FavoritesPlugin.getFavoritesIcon(16),subItems.toArray());
        }
        else {
          return null;
        }
      }
      else {
        if (favorites.isEmpty()) {
          return new ActionMenu(mLocalizer.msg("favorites", "Favorites"), FavoritesPlugin.getFavoritesIcon(16), new ActionMenu[] {
            createAddToFavoritesActionMenu(program),
              createGlobalExclusionMenu(program)
              });
        }
        else {
          ActionMenu blackListAction = createBlackListFavoriteMenuAction(favArr, program);
          ActionMenu repetitions = FavoritesPlugin.getInstance().isShowingRepetitions() ? createRepetitionsMenuAction(favArr, program) : null;

          ArrayList<Object> subItems = new ArrayList<Object>(8);
          subItems.add(createManageFavoriteMenuAction(favArr));
          subItems.add(createEditFavoriteMenuAction(favArr));
          subItems.add(createExcludeFromFavoritesMenuAction(favArr, program));
          subItems.add(createDeleteFavoriteMenuAction(favArr));
          subItems.add(ContextMenuSeparatorAction.getInstance());
          subItems.add(createGlobalExclusionMenu(program));
          subItems.add(createAddToFavoritesActionMenu(program));
          if (repetitions != null) {
            subItems.add(3, repetitions);
          }
          if(blackListAction != null) {
            subItems.add(1, blackListAction);
          }
          return new ActionMenu(mLocalizer.msg("favorites", "Favorites"), FavoritesPlugin.getFavoritesIcon(16), subItems.toArray());
        }
      }
    }
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.