Package devplugin

Examples of devplugin.ProgramReceiveIf


  private static String getForwardPluginsLabelString(ProgramReceiveTarget[] receiveTargetArr) {
    ArrayList<ProgramReceiveIf> plugins = new ArrayList<ProgramReceiveIf>();

    for(int i = 0; i < receiveTargetArr.length; i++) {
      if(!plugins.contains(receiveTargetArr[i].getReceifeIfForIdOfTarget())) {
        ProgramReceiveIf target = receiveTargetArr[i].getReceifeIfForIdOfTarget();

        if(target != null) {
          plugins.add(target);
        }
      }
View Full Code Here


  }

  protected ProgramReceiveTarget[] getClientPluginsTargets() {
    ArrayList<ProgramReceiveTarget> list = new ArrayList<ProgramReceiveTarget>();
    for (ProgramReceiveTarget target : mClientPluginTargets) {
      ProgramReceiveIf plugin = target.getReceifeIfForIdOfTarget();
      if (plugin != null && plugin.canReceiveProgramsWithTarget()) {
        list.add(target);
      }
    }
    return list.toArray(new ProgramReceiveTarget[list.size()]);
  }
View Full Code Here

    for (ReminderListItem reminder : reminders) {
      programs.add(reminder.getProgram());
    }

    for (ProgramReceiveTarget target : targets) {
      ProgramReceiveIf plugin = target.getReceifeIfForIdOfTarget();
      if (plugin != null && plugin.canReceiveProgramsWithTarget()) {
        plugin.receivePrograms(programs.toArray(new Program[programs.size()]),
            target);
      }
    }

    SwingUtilities.invokeLater(new Runnable() {
View Full Code Here

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

   * Sends the Data to the selected Plugin
   */
  protected void send() {

    int result = JOptionPane.YES_OPTION;
    ProgramReceiveIf plug = (ProgramReceiveIf) mPluginList.getSelectedItem();

    if (mPrograms.length > 5) {
      result = JOptionPane.showConfirmDialog(this, mLocalizer.msg("AskBeforeSend",
          "Are you really sure to send {0} programs\nto \"{1}\"?",
          mPrograms.length, plug.toString()),
          mLocalizer.msg("Attention", "Attention"), JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
    }

    if (result == JOptionPane.YES_OPTION) {
      ProgramReceiveTarget target = (ProgramReceiveTarget)mTargetList.getSelectedItem();
      plug.receivePrograms(mPrograms, target);
      Settings.propLastUsedReceivePlugin.setString(plug.getId());
      Settings.propLastUsedReceiveTarget.setString(target.getTargetId());
    }
  }
View Full Code Here

            if (!e.getValueIsAdjusting()) {
              targetPanel.removeAll();
              SelectableItem pluginItem = (SelectableItem) mPluginItemList
                  .getSelectedValue();

              final ProgramReceiveIf plugin = (ProgramReceiveIf) pluginItem
                  .getItem();
              mCurrentTargets = plugin.getProgramReceiveTargets();

              if (mCurrentTargets != null) {
                Arrays.sort(mCurrentTargets);
                ArrayList<ProgramReceiveTarget> targets = mReceiveTargetTable
                    .get(plugin);
                if (targets == null || !pluginItem.isSelected()) {
                  targets = new ArrayList<ProgramReceiveTarget>();
                }
                if (pluginItem.isSelected() && targets.isEmpty()) {
                  targets.add(mCurrentTargets[0]);
                }
                mReceiveTargetTable.put(plugin, targets);
                final SelectableItemList targetList = new SelectableItemList(
                    targets.toArray(), mCurrentTargets, disabledReceiveTargets);
                targetPanel.add(targetList, BorderLayout.CENTER);
                targetList
                    .addListSelectionListener(new ListSelectionListener() {

                      @Override
                      public void valueChanged(ListSelectionEvent listEvent) {
                        if (!listEvent.getValueIsAdjusting()) {
                          SelectableItem currPluginItem = (SelectableItem) mPluginItemList
                              .getSelectedValue();
                          ProgramReceiveIf currPlugin = (ProgramReceiveIf) currPluginItem
                              .getItem();
                          Object[] sel = targetList.getSelection();
                          ArrayList<ProgramReceiveTarget> selTargets = new ArrayList<ProgramReceiveTarget>(
                              sel.length);
                          for (Object obj : sel) {
View Full Code Here

  public ProgramReceiveTarget[] getReceiveTargets() {
    if(mOkWasPressed) {
      ArrayList<ProgramReceiveTarget> targetList = new ArrayList<ProgramReceiveTarget>();
      Enumeration<ProgramReceiveIf> keyEnum = mReceiveTargetTable.keys();
      while (keyEnum.hasMoreElements()) {
        ProgramReceiveIf plugin = keyEnum.nextElement();
        for (ProgramReceiveIf selectedPlugin : mResultPluginArr) {
          if (selectedPlugin == plugin) {
            targetList.addAll(mReceiveTargetTable.get(plugin));
          }
        }
View Full Code Here

    = FavoritesPlugin.getInstance().getClientPluginTargetIds();

    ArrayList<ProgramReceiveTarget> clientPlugins = new ArrayList<ProgramReceiveTarget>();

    for (ProgramReceiveTarget target : targetsArr) {
      ProgramReceiveIf plugin = target.getReceifeIfForIdOfTarget();
      if(plugin != null) {
        clientPlugins.add(target);
      }
    }
View Full Code Here

  }

  public ProgramReceiveTarget[] getDefaultClientPluginsTargets() {
    ArrayList<ProgramReceiveTarget> list = new ArrayList<ProgramReceiveTarget>(0);
    for (ProgramReceiveTarget target : mClientPluginTargets) {
      ProgramReceiveIf plugin = target.getReceifeIfForIdOfTarget();
      if (plugin != null && plugin.canReceiveProgramsWithTarget()) {
        list.add(target);
      }
    }
    return list.toArray(new ProgramReceiveTarget[list.size()]);
  }
View Full Code Here

TOP

Related Classes of devplugin.ProgramReceiveIf

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.