public PluginRegistry getPluginRegistry(){ if (pluginRegistry == null){ pluginRegistry = new PluginRegistryImpl(getPluginRegistryLocation(), PLUGIN_DOWNLOAD_REGISTRY); } return pluginRegistry; }
public PluginRegistry getPluginRegistry(){ if (pluginRegistry == null){ pluginRegistry = new PluginRegistryImpl(getPluginRegistryLocation(), PLUGIN_DOWNLOAD_REGISTRY); } return pluginRegistry; }
public void performAutoUpdate() { final BackgroundTask autoUpdateTask = ProtegeApplication.getBackgroundTaskManager().startTask("autoupdate"); Runnable runnable = new Runnable() { PluginRegistry updatesProvider; List<PluginInfo> updates; public void run() { try { updatesProvider = new PluginRegistryImpl(getPluginRegistryLocation(), PLUGIN_UPDATE_REGISTRY); updates = updatesProvider.getAvailableDownloads(); } finally { ProtegeApplication.getBackgroundTaskManager().endTask(autoUpdateTask); } if (!updates.isEmpty()) { Map<String, PluginRegistry> map = new LinkedHashMap<String, PluginRegistry>(); map.put(PLUGIN_UPDATE_REGISTRY.getLabel(), updatesProvider); map.put(PLUGIN_DOWNLOAD_REGISTRY.getLabel(), new PluginRegistryImpl(getPluginRegistryLocation(), PLUGIN_DOWNLOAD_REGISTRY)); showUpdatesDialog(map); } } }; Thread t = new Thread(runnable, "Auto-update"); t.setPriority(Thread.MIN_PRIORITY); t.start(); }
public void performAutoUpdate() { final BackgroundTask autoUpdateTask = ProtegeApplication.getBackgroundTaskManager().startTask("autoupdate"); Runnable runnable = new Runnable() { PluginRegistry updatesProvider; List<PluginInfo> updates; public void run() { try { updatesProvider = new PluginRegistryImpl(getPluginRegistryLocation(), PLUGIN_UPDATE_REGISTRY); updates = updatesProvider.getAvailableDownloads(); } finally { ProtegeApplication.getBackgroundTaskManager().endTask(autoUpdateTask); } if (!updates.isEmpty()) { Map<String, PluginRegistry> map = new LinkedHashMap<String, PluginRegistry>(); map.put(PLUGIN_UPDATE_REGISTRY.getLabel(), updatesProvider); map.put(PLUGIN_DOWNLOAD_REGISTRY.getLabel(), new PluginRegistryImpl(getPluginRegistryLocation(), PLUGIN_DOWNLOAD_REGISTRY)); showUpdatesDialog(map); } } }; Thread t = new Thread(runnable, "Auto-update"); t.setPriority(Thread.MIN_PRIORITY); t.start(); }
Runnable runnable = new Runnable() { public void run() { PluginRegistry updatesProvider = new PluginRegistryImpl(getPluginRegistryLocation(), PLUGIN_UPDATE_REGISTRY); List<PluginInfo> updates = updatesProvider.getAvailableDownloads(); if (!updates.isEmpty()) { Map<String, PluginRegistry> map = new LinkedHashMap<String, PluginRegistry>(); map.put(PLUGIN_UPDATE_REGISTRY.getLabel(), updatesProvider); map.put(PLUGIN_DOWNLOAD_REGISTRY.getLabel(), new PluginRegistryImpl(getPluginRegistryLocation(), PLUGIN_DOWNLOAD_REGISTRY)); showUpdatesDialog(map);
Runnable runnable = new Runnable() { public void run() { PluginRegistry updatesProvider = new PluginRegistryImpl(getPluginRegistryLocation(), PLUGIN_UPDATE_REGISTRY); List<PluginInfo> updates = updatesProvider.getAvailableDownloads(); if (!updates.isEmpty()) { Map<String, PluginRegistry> map = new LinkedHashMap<String, PluginRegistry>(); map.put(PLUGIN_UPDATE_REGISTRY.getLabel(), updatesProvider); map.put(PLUGIN_DOWNLOAD_REGISTRY.getLabel(), new PluginRegistryImpl(getPluginRegistryLocation(), PLUGIN_DOWNLOAD_REGISTRY)); showUpdatesDialog(map);
public void checkForUpdates(){ final BackgroundTask task = ProtegeApplication.getBackgroundTaskManager().startTask("searching for updates"); Runnable runnable = new Runnable() { public void run() { PluginRegistry updatesProvider; java.util.List<PluginInfo> updates; try { updatesProvider = new PluginRegistryImpl(getPluginRegistryLocation(), PLUGIN_UPDATE_REGISTRY); updates = updatesProvider.getAvailableDownloads(); } finally { ProtegeApplication.getBackgroundTaskManager().endTask(task); } if (!updates.isEmpty()) { Map<String, PluginRegistry> map = new LinkedHashMap<String, PluginRegistry>(); map.put("Updates", updatesProvider); showUpdatesDialog(map); } else{ JOptionPane.showMessageDialog(null, "No updates available at this time."); } } }; Thread t = new Thread(runnable, "Check for updates"); t.setPriority(Thread.MIN_PRIORITY); t.start(); }
public void checkForUpdates(){ final BackgroundTask task = ProtegeApplication.getBackgroundTaskManager().startTask("searching for updates"); Runnable runnable = new Runnable() { public void run() { PluginRegistry updatesProvider; java.util.List<PluginInfo> updates; try { updatesProvider = new PluginRegistryImpl(getPluginRegistryLocation(), PLUGIN_UPDATE_REGISTRY); updates = updatesProvider.getAvailableDownloads(); } finally { ProtegeApplication.getBackgroundTaskManager().endTask(task); } if (!updates.isEmpty()) { Map<String, PluginRegistry> map = new LinkedHashMap<String, PluginRegistry>(); map.put("Updates", updatesProvider); showUpdatesDialog(map); } else{ JOptionPane.showMessageDialog(null, "No updates available at this time."); } } }; Thread t = new Thread(runnable, "Check for updates"); t.setPriority(Thread.MIN_PRIORITY); t.start(); }
public void run() { try { updatesProvider = new PluginRegistryImpl(getPluginRegistryLocation(), PLUGIN_UPDATE_REGISTRY); updates = updatesProvider.getAvailableDownloads(); } finally { ProtegeApplication.getBackgroundTaskManager().endTask(autoUpdateTask); } if (!updates.isEmpty()) { Map<String, PluginRegistry> map = new LinkedHashMap<String, PluginRegistry>(); map.put(PLUGIN_UPDATE_REGISTRY.getLabel(), updatesProvider); map.put(PLUGIN_DOWNLOAD_REGISTRY.getLabel(), new PluginRegistryImpl(getPluginRegistryLocation(), PLUGIN_DOWNLOAD_REGISTRY)); showUpdatesDialog(map); } } };
public void run() { try { updatesProvider = new PluginRegistryImpl(getPluginRegistryLocation(), PLUGIN_UPDATE_REGISTRY); updates = updatesProvider.getAvailableDownloads(); } finally { ProtegeApplication.getBackgroundTaskManager().endTask(autoUpdateTask); } if (!updates.isEmpty()) { Map<String, PluginRegistry> map = new LinkedHashMap<String, PluginRegistry>(); map.put(PLUGIN_UPDATE_REGISTRY.getLabel(), updatesProvider); map.put(PLUGIN_DOWNLOAD_REGISTRY.getLabel(), new PluginRegistryImpl(getPluginRegistryLocation(), PLUGIN_DOWNLOAD_REGISTRY)); showUpdatesDialog(map); } } };
public void run() { PluginRegistry updatesProvider; java.util.List<PluginInfo> updates; try { updatesProvider = new PluginRegistryImpl(getPluginRegistryLocation(), PLUGIN_UPDATE_REGISTRY); updates = updatesProvider.getAvailableDownloads(); } finally { ProtegeApplication.getBackgroundTaskManager().endTask(task); } if (!updates.isEmpty()) { Map<String, PluginRegistry> map = new LinkedHashMap<String, PluginRegistry>(); map.put("Updates", updatesProvider); showUpdatesDialog(map); } else{ JOptionPane.showMessageDialog(null, "No updates available at this time."); } } };
public void run() { PluginRegistry updatesProvider; java.util.List<PluginInfo> updates; try { updatesProvider = new PluginRegistryImpl(getPluginRegistryLocation(), PLUGIN_UPDATE_REGISTRY); updates = updatesProvider.getAvailableDownloads(); } finally { ProtegeApplication.getBackgroundTaskManager().endTask(task); } if (!updates.isEmpty()) { Map<String, PluginRegistry> map = new LinkedHashMap<String, PluginRegistry>(); map.put("Updates", updatesProvider); showUpdatesDialog(map); } else{ JOptionPane.showMessageDialog(null, "No updates available at this time."); } } };
public void run() { PluginRegistry updatesProvider = new PluginRegistryImpl(getPluginRegistryLocation(), PLUGIN_UPDATE_REGISTRY); List<PluginInfo> updates = updatesProvider.getAvailableDownloads(); if (!updates.isEmpty()) { ProtegeApplication.getBackgroundTaskManager().endTask(autoUpdateTask); Map<String, PluginRegistry> map = new LinkedHashMap<String, PluginRegistry>(); map.put(PLUGIN_UPDATE_REGISTRY.getLabel(), updatesProvider); map.put(PLUGIN_DOWNLOAD_REGISTRY.getLabel(), new PluginRegistryImpl(getPluginRegistryLocation(), PLUGIN_DOWNLOAD_REGISTRY)); showUpdatesDialog(map); } else{ PluginRegistry registry = getPluginRegistry(); final List<PluginInfo> downloads = registry.getAvailableDownloads(); ProtegeApplication.getBackgroundTaskManager().endTask(autoUpdateTask); if (!downloads.isEmpty()){ Map<String, PluginRegistry> map = new LinkedHashMap<String, PluginRegistry>(); map.put("Downloads", registry); map.put("Updates", updatesProvider); showUpdatesDialog(map); } else { JOptionPane.showMessageDialog(null, "No additional plugins / updates available at this time."); } } } };
public void run() { PluginRegistry updatesProvider = new PluginRegistryImpl(getPluginRegistryLocation(), PLUGIN_UPDATE_REGISTRY); List<PluginInfo> updates = updatesProvider.getAvailableDownloads(); if (!updates.isEmpty()) { ProtegeApplication.getBackgroundTaskManager().endTask(autoUpdateTask); Map<String, PluginRegistry> map = new LinkedHashMap<String, PluginRegistry>(); map.put(PLUGIN_UPDATE_REGISTRY.getLabel(), updatesProvider); map.put(PLUGIN_DOWNLOAD_REGISTRY.getLabel(), new PluginRegistryImpl(getPluginRegistryLocation(), PLUGIN_DOWNLOAD_REGISTRY)); showUpdatesDialog(map); } else{ PluginRegistry registry = getPluginRegistry(); final List<PluginInfo> downloads = registry.getAvailableDownloads(); ProtegeApplication.getBackgroundTaskManager().endTask(autoUpdateTask); if (!downloads.isEmpty()){ Map<String, PluginRegistry> map = new LinkedHashMap<String, PluginRegistry>(); map.put("Downloads", registry); map.put("Updates", updatesProvider); showUpdatesDialog(map); } else { JOptionPane.showMessageDialog(null, "No additional plugins / updates available at this time."); } } } };
private void runSearch(SearchType searchType) { final BackgroundTask autoUpdateTask = ProtegeApplication.getBackgroundTaskManager().startTask("autoupdate"); Runnable runnable = () -> { PluginRegistry registry = new PluginRegistryImpl(getPluginRegistryLocation()); try { registry.reload(); getPrefs().putLong(LAST_RUN_PREFS_KEY, System.currentTimeMillis()); } finally { ProtegeApplication.getBackgroundTaskManager().endTask(autoUpdateTask); List<PluginInfo> availablePlugins = registry.getAvailablePlugins(); if (searchType == SearchType.UPDATES_AND_INSTALLS) { showPluginsDialog(availablePlugins); } else { if (!availablePlugins.isEmpty()) { showPluginsDialog(availablePlugins); } } } }; Thread t = new Thread(runnable, "Auto-Update"); t.setPriority(Thread.MIN_PRIORITY); t.start(); }