Package tvbrowser.core.plugin

Examples of tvbrowser.core.plugin.PluginProxy


        // remove already installed plugins
        String pluginId = "java." + className.toLowerCase() + "." + className;
       
        if(baseInfos == null) {
          PluginProxy installedPlugin = PluginProxyManager.getInstance().getPluginForId(pluginId);
 
          if(onlyUpdates) {
            // remove all not installed plugins
            if (installedPlugin == null) {
              TvDataServiceProxy service = TvDataServiceProxyManager.getInstance().findDataServiceById(className.toLowerCase()+"."+className);
 
              if(service == null) {
                it.remove();
                continue;
              }
            }
          }
 
          if (installedPlugin!=null && ((installedPlugin.getInfo().getVersion().compareTo(item.getVersion())>0 ||
              (installedPlugin.getInfo().getVersion().compareTo(item.getVersion())==0 && (!dragNdrop || item.getVersion().isStable()))))) {
            it.remove();
            continue;
          }
 
          // remove already installed dataservices
View Full Code Here


      if(menuIfs[i].getId().compareTo(FavoritesPlugin.getFavoritesPluginId()) == 0) {
        mModel.addCustomNode(FavoritesPlugin.getRootNode());
      } else if(menuIfs[i].getId().compareTo(ReminderPlugin.getReminderPluginId()) == 0) {
        mModel.addCustomNode(ReminderPlugin.getRootNode());
      } else if(pluginList.contains(menuIfs[i].getId())) {
        PluginProxy plugin = PluginProxyManager.getInstance().getPluginForId(menuIfs[i].getId());
        mModel.addPluginTree(plugin);
        pluginList.remove(menuIfs[i].getId());
      }
    }
View Full Code Here

      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]);
        if (proxy != null) {
          return new ProxyBasedPluginContextMenu(mTree, selectedPath[0], proxy, node.getActionMenus());
        }
      }
    }
View Full Code Here

        if(newlyBlocked != null && newlyBlocked.length > 0) {
          StringBuilder message = new StringBuilder();

          for(BlockedPlugin blockedPlugin : newlyBlocked) {
            PluginProxy plugin = PluginProxyManager.getInstance().getPluginForId(blockedPlugin.getPluginId());

            if(plugin == null) {
              TvDataServiceProxy dataService = TvDataServiceProxyManager.getInstance().findDataServiceById(blockedPlugin.getPluginId());

              if(dataService != null && blockedPlugin.isBlockedVersion(dataService.getId(),dataService.getInfo().getVersion())) {
                message.append("\n").append(dataService.getInfo().getName()).append(" (").append(blockedPlugin.getBlockStart()).append(" - ").append(blockedPlugin.getBlockEnd()).append(")");
              }
            }
            else if(blockedPlugin.isBlockedVersion(plugin)){
              message.append("\n").append(plugin.getInfo().getName()).append(" (").append(blockedPlugin.getBlockStart()).append(" - ").append(blockedPlugin.getBlockEnd()).append(")");
            }
          }

          if(message.length() > 0) {
            message.insert(0,mLocalizer.msg("update.blockedInfo","The following Plugins were blocked and cannot be used in their current version:\n"));
View Full Code Here

          pluginName = pluginName.substring(0, pluginName.length() - 4);

          try {
            String pluginId = "java." + pluginName.toLowerCase() + "." + pluginName;

            PluginProxy installedPlugin = PluginProxyManager.getInstance().getPluginForId(pluginId);
            TvDataServiceProxy service = TvDataServiceProxyManager.getInstance().findDataServiceById(
                pluginName.toLowerCase() + '.' + pluginName);

            Class<?> pluginClass = classLoader.loadClass(pluginName.toLowerCase() + '.' + pluginName);

            Method getVersion = pluginClass.getMethod("getVersion", new Class[0]);

            Version version1 = null;
            try {
              version1 = (Version) getVersion.invoke(pluginClass, new Object[0]);
            } catch (Throwable t1) {
              t1.printStackTrace();
            }

            if (installedPlugin != null && (installedPlugin.getInfo().getVersion().compareTo(version1) > 0 || (installedPlugin.getInfo().getVersion().compareTo(version1) == 0 && version1.isStable()))) {
              alreadyInstalled.append(installedPlugin.getInfo().getName()).append('\n');
            } else if (service != null && (service.getInfo().getVersion().compareTo(version1) > 0 || (service.getInfo().getVersion().compareTo(version1) == 0 && version1.isStable()))) {
              alreadyInstalled.append(service.getInfo().getName()).append('\n');
            } else {
              RandomAccessFile write = new RandomAccessFile(tmpFile, "rw");
View Full Code Here

        .getActivatedPlugins();
    Arrays.sort(plugins, new PluginProxy.Comparator());

    mBox = new JComboBox(plugins);
    if (mPluginId != null) {
      PluginProxy plugin = PluginProxyManager.getInstance().getPluginForId(mPluginId);
      if (plugin != null) {
        mBox.setSelectedItem(plugin);
      }
    }
    content.add(mBox, BorderLayout.CENTER);
View Full Code Here

      String nameValue = null;
      String descValue = null;
      boolean isActivated = true;

      if (value instanceof PluginProxy) {
        PluginProxy plugin = (PluginProxy) value;

        iconValue = plugin.getPluginIcon();
        if (iconValue != null) {
          iconValue = new FixedSizeIcon(16, 16, iconValue);
        }
        descValue = plugin.getInfo().getDescription().replace('\n', ' ');

        isActivated = plugin.isActivated();

        nameValue = plugin.getInfo().getName() + " " + plugin.getInfo().getVersion();
      } else if (value instanceof InternalPluginProxyIf) {
        InternalPluginProxyIf plugin = (InternalPluginProxyIf) value;

        nameValue = plugin.getName();
        descValue = plugin.getButtonActionDescription().replace('\n', ' ');
        iconValue = plugin.getIcon();
      } else if (value instanceof TvDataServiceProxy) {
        TvDataServiceProxy service = (TvDataServiceProxy) value;
        nameValue = service.getInfo().getName() + " " + service.getInfo().getVersion();
        descValue = HTMLTextHelper.convertHtmlToText(service.getInfo().getDescription()).replace('\n', ' ');
      }
View Full Code Here

              iconList.add(infoIcons[index]);
            }
          }
        } else {
          // plugin icons
          PluginProxy plugin = mng.getPluginForId(iconPluginArr[pluginIdx]);

          // Check whether this entry still uses the old class name
          if (plugin == null) {
            String asId = "java." + iconPluginArr[pluginIdx];
            plugin = mng.getPluginForId(asId);

            if (plugin != null) {
              // It was the old class name, not an ID
              // -> Change the class name to an ID and save it
              iconPluginArr[pluginIdx] = asId;
              Settings.propProgramTableIconPlugins
                  .setStringArray(iconPluginArr);
            }
          }

          // Now add the icons
          if ((plugin != null) && plugin.isActivated()) {
            Icon[] iconArr = plugin.getProgramTableIcons(program);
            if (iconArr != null) {
              // Add the icons
              for (Icon icon : iconArr) {
                iconList.add(icon);
              }
View Full Code Here

      else if(name.startsWith("#scrollToChannel")) {
        configItemEnabled = true;
        label = ChannelContextMenu.mLocalizer.ellipsisMsg("addChannels", "Add/Remove channels");
      }
      else if (name.indexOf("##") != -1) {
        PluginProxy plugin = PluginProxyManager.getInstance().getActivatedPluginForId(name.substring(0,name.indexOf("##")));
        configItemEnabled = plugin != null && plugin.getSettingsTab() != null;
      }
      else if (PluginProxyManager.getInstance().getActivatedPluginForId(name) != null) {
        configItemEnabled = PluginProxyManager.getInstance().getActivatedPluginForId(name).getSettingsTab() != null;
      }
      else if (InternalPluginProxyList.getInstance().getProxyForId(name) != null) {
View Full Code Here

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

TOP

Related Classes of tvbrowser.core.plugin.PluginProxy

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.