Пример #1
0
    // {{{ update() method
    public void update() {
      Set<String> savedChecked = new HashSet<String>();
      Set<String> savedSelection = new HashSet<String>();
      saveSelection(savedChecked, savedSelection);

      PluginList pluginList = window.getPluginList();

      if (pluginList == null) return;

      entries.clear();

      for (int i = 0; i < pluginList.pluginSets.size(); i++) {
        PluginList.PluginSet set = pluginList.pluginSets.get(i);
        for (int j = 0; j < set.plugins.size(); j++) {
          PluginList.Plugin plugin = pluginList.pluginHash.get(set.plugins.get(j));
          PluginList.Branch branch = plugin.getCompatibleBranch();
          String installedVersion = plugin.getInstalledVersion();
          if (updates) {
            if (branch != null
                && branch.canSatisfyDependencies()
                && installedVersion != null
                && StandardUtilities.compareStrings(branch.version, installedVersion, false) > 0) {
              entries.add(new Entry(plugin, set.name));
            }
          } else {
            if (installedVersion == null && plugin.canBeInstalled())
              entries.add(new Entry(plugin, set.name));
          }
        }
      }

      sort(sortType);
      updateFilteredEntries();
      restoreSelection(savedChecked, savedSelection);
    } // }}}
Пример #2
0
    Entry(PluginList.Plugin plugin, String set) {
      PluginList.Branch branch = plugin.getCompatibleBranch();
      boolean downloadSource = jEdit.getBooleanProperty("plugin-manager.downloadSource");
      int size = downloadSource ? branch.downloadSourceSize : branch.downloadSize;

      this.name = plugin.name;
      this.author = plugin.author;
      this.installedVersion = plugin.getInstalledVersion();
      this.version = branch.version;
      this.size = size;
      this.date = branch.date;
      this.description = plugin.description;
      this.set = set;
      this.install = false;
      this.plugin = plugin;
      SimpleDateFormat format = new SimpleDateFormat("d MMMM yyyy", Locale.ENGLISH);
      try {
        timestamp = format.parse(date).getTime();
      } catch (ParseException e) {
        Log.log(Log.ERROR, this, e);
      }
    }