Package devplugin

Examples of devplugin.ContextMenuAction


   
    return mInstance;
  }
 
  public ActionMenu getContextMenuActions(Program program) {
    return new ActionMenu(new ContextMenuAction(mLocalizer.msg("doNothing","No action")));
  }
View Full Code Here


    mInitThread.setPriority(Thread.NORM_PRIORITY);
    mInitThread.start();
  }

  protected ActionMenu getContextMenuActions(final Program program) {
    ContextMenuAction action = new ContextMenuAction();
    action.setText(mLocalizer.msg("contextMenuText", "Program information"));
    action.setSmallIcon(IconLoader.getInstance().getIconFromTheme("actions",
        "edit-find", 16));
    action.setActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent event) {
        try {
          UIThreadRunner.invokeAndWait(new Runnable() {

            @Override
View Full Code Here

    return node;
  }

  private void createNodeActionForNode(final PluginTreeNode node) {
    ContextMenuAction action = new ContextMenuAction(mLocalizer.msg("treeNodeDeleteAction",
    "Delete all markings"),TVBrowserIcons.delete(TVBrowserIcons.SIZE_SMALL));

    action.setActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        Program[] programs = node.getPrograms();

        node.removeAllChildren();
        node.update();
View Full Code Here

          .size()]));
    } else if ((program.isExpired() || program.isOnAir())
        && (!program.equals(Plugin.getPluginManager().getExampleProgram()))) {
      return null;
    } else {
      ContextMenuAction action = new ContextMenuAction();
      action.setText(mLocalizer.msg("contextMenuText", "Remind me"));
      action.setSmallIcon(IconLoader.getInstance().getIconFromTheme("actions",
          "appointment-new", 16));
      action.setActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent event) {
          final Window w = UiUtilities.getLastModalChildOf(MainFrame.getInstance());
          try {
            UIThreadRunner.invokeAndWait(new Runnable() {
View Full Code Here

        final WebAddress modifiedAddress = new WebAddress(address.getName(), address.getUrl().replace(WEBSEARCH_ALL, "\"" + subItems.get(index) + "\""), null, false, true);
        subActions[index] = createSearchAction(program, modifiedAddress, subItems.get(index));
        subActions[index].putValue(Plugin.DISABLED_ON_TASK_MENU, true);
      }
      if (subItems.size() > 1) {
        final ContextMenuAction menuAction = new ContextMenuAction(label);
        final ActionMenu menu = new ActionMenu((String)menuAction.getValue(Action.NAME), (Icon)menuAction.getValue(Action.SMALL_ICON), subActions);
        menuAction.putValue(Plugin.DISABLED_ON_TASK_MENU, true);
        categoryList.add(menu);
      }
      else {
        subActions[0].putValue(Action.NAME, subActions[0].getValue(Action.NAME) + " (" + label +")");
        categoryList.add(subActions[0]);
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));
View Full Code Here

  public ImageIcon getIconFromTheme(String category, String icon, int size) {
    return FavoritesPlugin.getIconFromTheme(category, icon, size);
  }

  private ActionMenu createGlobalExclusionMenu(final Program program) {
    ContextMenuAction menu = new ContextMenuAction();
    menu.setSmallIcon(TVBrowserIcons.newIcon(TVBrowserIcons.SIZE_SMALL));
    menu.setText(mLocalizer.ellipsisMsg("createGlobalExclusion", "Create global exclusion"));
    menu.setActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent event) {
        FavoritesPlugin.getInstance().showExcludeProgramsDialog(null,program);
      }
    });
    return new ActionMenu(menu);
View Full Code Here

    });
    return new ActionMenu(menu);
  }

  private ActionMenu createAddToFavoritesActionMenu(final Program program) {
    ContextMenuAction menu = new ContextMenuAction();
      menu.setSmallIcon(FavoritesPlugin.getFavoritesIcon(16));
      menu.setText(mLocalizer.msg("addToFavorites", "Add to favorite programs"));
      menu.setActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent event) {
          FavoritesPlugin.getInstance().showCreateFavoriteWizard(program);
        }
      });
      return new ActionMenu(menu);
View Full Code Here


  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);
          }
View Full Code Here

    }
  }

  private ActionMenu createManageFavoriteMenuAction(final Favorite[] favArr) {
    if (favArr.length == 1) {
      ContextMenuAction action = new ContextMenuAction();
      action.setSmallIcon(FavoritesPlugin.getFavoritesIcon(16));
      action.setText(mLocalizer.ellipsisMsg("manageFavorite","Manage favorite '{0}'", favArr[0].getName()));
      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);
          }
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.