Package devplugin

Examples of devplugin.Plugin


      }

      return new ProgramContextMenu(mTree, selectedPath, PluginTreeModel.getPlugin(selectedPath[0]), selectedPrograms);
    }
    else if (node.getType() == Node.PLUGIN_ROOT) {
      Plugin plugin = PluginTreeModel.getPlugin(selectedPath[0]);
      if (plugin != null) {
        return new PluginBasedPluginContextMenu(mTree, selectedPath[0], plugin, node.getActionMenus());
      }
      else {
        PluginProxy proxy = PluginTreeModel.getPluginProxy(selectedPath[0]);
View Full Code Here


      while (e.hasMoreElements() && !mDisableUpdate) {
        DefaultMutableTreeNode n = e.nextElement();

        Object o = n.getUserObject();
        if (o instanceof Plugin) {
          Plugin p = (Plugin) o;
          p.getRootNode().update();
        }
        else if(n.equals(FavoritesPlugin.getRootNode().getMutableTreeNode())) {
          FavoritesPlugin.getRootNode().update();
        } else if(n.equals(ReminderPlugin.getRootNode().getMutableTreeNode())) {
          ReminderPlugin.getRootNode().update();
View Full Code Here

    if (path.getPathCount() > 1) {
      Object o = path.getPathComponent(1);
      DefaultMutableTreeNode node = (DefaultMutableTreeNode) o;
      o = node.getUserObject();
      if (o instanceof Plugin) {
        Plugin plugin = (Plugin) o;
        return plugin;
      }
    }
    return null;
  }
View Full Code Here

      menu.setEnabled(false);
      return menu;
    }

    Object o = getObjectForNode(node);
    Plugin currentPlugin = null;

    if(o instanceof Plugin) {
      currentPlugin = (Plugin)o;
    }

    for (InternalPluginProxyIf internalProxy : InternalPluginProxyList.getInstance().getAvailableProxys()) {
      if (internalProxy instanceof ProgramReceiveIf) {
        final ProgramReceiveIf receiveProxy = (ProgramReceiveIf) internalProxy;
        if(receiveProxy.canReceiveProgramsWithTarget() && o != internalProxy) {
          final ProgramReceiveTarget target = receiveProxy.getProgramReceiveTargets()[0];
          JMenuItem item = new JMenuItem(target.getTargetName());
          item.setFont(MenuUtil.CONTEXT_MENU_PLAINFONT);
          item.setIcon(internalProxy.getIcon());
          menu.add(item);
          item.addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent e) {
              Program[] programs = collectProgramsFromNode(node);
              if ((programs != null) &&(programs.length > 0)) {
                receiveProxy.receivePrograms(programs, target);
              }
            }
          });
        }
      }
    }

    PluginProxy[] plugins = PluginProxyManager.getInstance().getActivatedPlugins();
    for (final PluginProxy plugin : plugins) {
     if ((plugin.canReceiveProgramsWithTarget())
          && plugin.getProgramReceiveTargets() != null
          && plugin.getProgramReceiveTargets().length > 0) {
        if ((currentPlugin == null) || (!currentPlugin.getId().equals(plugin.getId()))) {
          ProgramReceiveTarget[] targets = plugin.getProgramReceiveTargets();
          if (!plugin.canReceiveProgramsWithTarget()) {
            JMenuItem item = new JMenuItem(plugin.getInfo().getName());
            item.setFont(MenuUtil.CONTEXT_MENU_PLAINFONT);
View Full Code Here

      program.validateMarking();
    }
  }

  public ActionMenu getContextMenuActions(final Program program) {
    final Plugin thisPlugin = this;
    ImageIcon icon = createImageIcon("devices", "printer", 16);

    ArrayList<AbstractAction> actions = new ArrayList<AbstractAction>();

    if (getRootNode().contains(program)) {
View Full Code Here

TOP

Related Classes of devplugin.Plugin

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.