@Override protected void doAction2() { final List<PluginDescriptor> selectedPlugins = getSelectedPlugins(); for (PluginDescriptor plugin : selectedPlugins) { final PluginDescriptor onlinePlugin = PluginUpdater.getUpdate(plugin); // install update if (onlinePlugin != null) PluginInstaller.install(onlinePlugin, true); } // refresh state refreshTableData(); }
@Override protected void doAction2(PluginDescriptor plugin) { switch (getPluginLocalState(plugin)) { case HAS_UPDATE: final PluginDescriptor onlinePlugin = PluginUpdater.getUpdate(plugin); // install udpate PluginInstaller.install(onlinePlugin, true); // refresh state refreshTableData(); updateButtonsState(); break; } }
private PluginLocalState getPluginLocalState(PluginDescriptor plugin) { if (plugin != null) { if (!PluginRepositoryLoader.isBasicLoaded()) return PluginLocalState.CHECKING_UPDATE; // get online version final PluginDescriptor onlinePlugin = PluginUpdater.getUpdate(plugin); // udpate available ? if (onlinePlugin != null) { if (PluginInstaller.isInstallingPlugin(onlinePlugin)) return PluginLocalState.UPDATING; return PluginLocalState.HAS_UPDATE; } return PluginLocalState.NO_UPDATE; } return PluginLocalState.NULL; }
private PluginLocalState getPluginLocalState(PluginDescriptor plugin) { if (plugin != null) { if (!PluginRepositoryLoader.isBasicLoaded()) return PluginLocalState.CHECKING_UPDATE; if ((PluginInstaller.isDesinstallingPlugin(plugin))) return PluginLocalState.REMOVING; // get online version final PluginDescriptor onlinePlugin = PluginUpdater.getUpdate(plugin); // update available ? if (onlinePlugin != null) { if (PluginInstaller.isInstallingPlugin(onlinePlugin)) return PluginLocalState.UPDATING; return PluginLocalState.HAS_UPDATE; } if (plugin.isInstalled()) return PluginLocalState.NO_UPDATE; // here the plugin has just been removed but plugin list is not yet updated return PluginLocalState.REMOVING; } return PluginLocalState.NULL; }