Package devplugin

Examples of devplugin.ActionMenu


    searchAction.putValue(Action.SMALL_ICON, TVBrowserIcons
        .search(TVBrowserIcons.SIZE_SMALL));
    searchAction.putValue(Action.ACTION_COMMAND_KEY, "action");
    searchAction.putValue(Action.NAME, mLocalizer.msg("search", "Search Text"));

    mSearchMenu = new ActionMenu(searchAction);

    mFindAsYouType.installKeyListener(scrollPane);
    mFindAsYouType.installKeyListener(mMainPanel);
    mFindAsYouType.installKeyListener(mConfigBtn);
    mFindAsYouType.installKeyListener(mCloseBtn);
View Full Code Here


        action.putValue(Action.SMALL_ICON, TVBrowserIcons
            .preferences(TVBrowserIcons.SIZE_SMALL));
        action.putValue(Action.NAME, ConfigMenuItem.getInstance().toString());

        ActionMenu configure = new ActionMenu(action);
        new TaskMenuAction(mFunctionGroup, mProgram, configure, this,
            "id_configure", mFindAsYouType);
        lastEntry = contextMenuIf;
      } else if (contextMenuIf.getId().compareTo(
          ProgramInfo.getProgramInfoPluginId()) == 0) {
        // don't show the program info action in the program info dialog
      } else {
        ActionMenu menu = contextMenuIf.getContextMenuActions(mProgram);
        if (menu != null) {
          new TaskMenuAction(mFunctionGroup, mProgram, menu, this,
              contextMenuIf.getId(), mFindAsYouType);
          lastEntry = contextMenuIf;
        }
View Full Code Here

    return createSortedArrayFromList(list);
  }

  private void fillButtonActionList(ArrayList<JMenuItem> list,
      ButtonActionIf buttonActionIf) {
    ActionMenu actionMenu = buttonActionIf.getButtonAction();
    if (actionMenu != null) {
      JMenuItem item = createMenuItem(actionMenu);
      setMnemonic(item);
      list.add(item);
      new MenuHelpTextAdapter(item,
View Full Code Here

    InternalPluginProxyIf[] internalPlugins = InternalPluginProxyList.getInstance().getAvailableProxys();

    for (InternalPluginProxyIf internalPlugin : internalPlugins) {
      if (internalPlugin instanceof ButtonActionIf) {
        ActionMenu action = ((ButtonActionIf) internalPlugin).getButtonAction();

        if (action != null) {
          pluginsMenu.add(MenuUtil.createMenuItem(action, false));
        }
      }
    }

    pluginsMenu.addSeparator();

    for (PluginProxy plugin : plugins) {
      ActionMenu action = plugin.getButtonAction();
      if (action != null) {
        pluginsMenu.add(MenuUtil.createMenuItem(action, false));
      }
    }
  }
View Full Code Here

    if(menu.getAction() == null || menu.getAction().getValue(Plugin.DISABLED_ON_TASK_MENU) == null || !((Boolean)menu.getAction().getValue(Plugin.DISABLED_ON_TASK_MENU))) {
      if (!menu.hasSubItems()) {
        addAction(parent, menu);
      } else {
        final ActionMenu childMenu = getSingleActiveChild(menu);
        if (childMenu != null) {
          if (id.contains("WebPlugin")) {
            childMenu.getAction().putValue(Action.NAME,
                menu.getAction().getValue(Action.NAME));
          }
          childMenu.getAction().putValue(Action.SMALL_ICON, menu.getAction().getValue(Action.SMALL_ICON));
          addAction(parent, childMenu);
        }
        else {
          addTaskPaneGroup(parent, program, menu, info, id);
        }
View Full Code Here

    }
  }

  private ActionMenu getSingleActiveChild(final ActionMenu menu) {
    int count = 0;
    ActionMenu result = null;
    for (int i = 0; i < menu.getSubItems().length; i++) {
      final ActionMenu subItem = menu.getSubItems()[i];
      if (subItem.getAction().getValue(Plugin.DISABLED_ON_TASK_MENU) == null) {
        count++;
        result = subItem;
      }
    }
    if (count == 1) {
View Full Code Here

    };
    action.putValue(Action.NAME, mLocalizer.msg("name", "Important programs"));
    action.putValue(Action.SMALL_ICON, createImageIcon("emblems", "emblem-important", 16));
    action.putValue(Plugin.BIG_ICON, createImageIcon("emblems", "emblem-important", 22));

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

            }
          });
        }
      }

      return new ActionMenu(mLocalizer.ellipsisMsg("contextMenuText", "Create a new Blog-Entry"), icon,
          list.toArray(new AbstractAction[list.size()]));
    } else {
      AbstractAction blog = new AbstractAction(mLocalizer.msg("contextMenuText", "Create a new Blog-Entry")) {
        public void actionPerformed(ActionEvent evt) {
          blogThis(program, mConfigs.length != 1 ? DEFAULT_CONFIG : mConfigs[0]);
        }
      };

      blog.putValue(Action.SMALL_ICON, icon);

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

        actions[i] = action;
      }

      if (actions.length == 1) {
        return new ActionMenu(actions[0]);
      }

      return new ActionMenu(menuLabel, menuIcon, actions);
    } else {
      ActionMenu[] exporters = new ActionMenu[activeExporter.length];

      for (int i = 0; i < exporters.length; i++) {
        Action[] actions = new Action[mConfigs.length];

        for (int j = 0; j < actions.length; j++) {
          final ExporterIf export = activeExporter[i];
          final int count = j;

          final PluginTreeNode node = getNodeForExporter(export);

          if(node.contains(program)) {
            actions[j] = new AbstractAction() {
              public void actionPerformed(ActionEvent e) {
                node.removeProgram(program);
                getRootNode().update();

                if(getRootNode().contains(program,true)) {
                  program.mark(CalendarExportPlugin.getInstance());
                }
              }
            };

            actions[j].putValue(Action.NAME, new StringBuilder(mLocalizer.msg("contextMenuDeleteText","Remove marking for ")).append(mConfigs[j].getName()).toString());
            actions[j].putValue(Action.SMALL_ICON, TVBrowserIcons.delete(TVBrowserIcons.SIZE_SMALL));
          }
          else {
            actions[j] = new AbstractAction() {
              public void actionPerformed(final ActionEvent e) {
                new Thread(new Runnable() {
                  public void run() {
                    Program[] programArr = {program};
                    if (export.exportPrograms(programArr, mSettings, mConfigs[count])) {
                      markProgram(program, export);
                      getRootNode().update();
                    }
                  }
                }, "Export to calendar").start();
              }
            };
            actions[j].putValue(Action.NAME, mConfigs[j].getName());
          }
        }

        exporters[i] = new ActionMenu(activeExporter[i].getName(), menuIcon, actions);
      }

      return new ActionMenu(menuLabel, menuIcon, exporters);
    }
  }
View Full Code Here

  }

  private void addPluginContextMenuItems(final Channel ch) {
    boolean separator = false;
    for (PluginProxy plugin : PluginProxyManager.getInstance().getActivatedPlugins()) {
      ActionMenu context = plugin.getContextMenuActions(ch);
      if (context != null) {
        if (!separator) {
          mMenu.addSeparator();
          separator = true;
        }
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.