public void setPluginRegistryLocation(URL url) { String oldPluginRegistryLoc = getPrefs().getString(PLUGIN_REGISTRY_KEY, DEFAULT_REGISTRY); String newPluginRegistryLoc = url.toString(); if (!newPluginRegistryLoc.equals(oldPluginRegistryLoc)) { getPrefs().putString(PLUGIN_REGISTRY_KEY, newPluginRegistryLoc); } }
public void setPluginRegistryLocation(URL url) { String oldPluginRegistryLoc = getPrefs().getString(PLUGIN_REGISTRY_KEY, DEFAULT_REGISTRY); String newPluginRegistryLoc = url.toString(); if (!newPluginRegistryLoc.equals(oldPluginRegistryLoc)) { getPrefs().putString(PLUGIN_REGISTRY_KEY, newPluginRegistryLoc); pluginRegistry = null; } }
public URL getPluginRegistryLocation() { String pluginRegistryLoc = getPrefs().getString(PLUGIN_REGISTRY_KEY, DEFAULT_REGISTRY); try { return new URL(pluginRegistryLoc); } catch (MalformedURLException e) { throw new RuntimeException(e); } }
public URL getPluginRegistryLocation() { String pluginRegistryLoc = getPrefs().getString(PLUGIN_REGISTRY_KEY, DEFAULT_REGISTRY); try { return new URL(pluginRegistryLoc); } catch (MalformedURLException e) { throw new RuntimeException(e); } }
/** * Gets the date that auto-update was last run. * * @return The date which auto-update was last run. Not {@code null}. */ public Date getLastAutoUpdateDate() { long lastRun = getPrefs().getLong(LAST_RUN_PREFS_KEY, 0); return new Date(lastRun); }
public URL getPluginRegistryLocation() { String pluginRegistryLoc = getPrefs().getString(PLUGIN_REGISTRY_KEY, DEFAULT_REGISTRY); try { return new URL(pluginRegistryLoc); } catch (MalformedURLException e) { throw new RuntimeException(e); } }
public void setPluginRegistryLocation(URL url) { String oldPluginRegistryLoc = getPrefs().getString(PLUGIN_REGISTRY_KEY, DEFAULT_REGISTRY); String newPluginRegistryLoc = url.toString(); if (!newPluginRegistryLoc.equals(oldPluginRegistryLoc)) { getPrefs().putString(PLUGIN_REGISTRY_KEY, newPluginRegistryLoc); pluginRegistry = null; } }
public boolean isAutoUpdateEnabled() { return getPrefs().getBoolean(AUTO_UPDATE_KEY, true); }
public boolean isAutoUpdateEnabled() { return getPrefs().getBoolean(AUTO_UPDATE_KEY, true); }
public void setAutoUpdateEnabled(boolean b) { getPrefs().putBoolean(AUTO_UPDATE_KEY, b); }
public void setAutoUpdateEnabled(boolean b) { getPrefs().putBoolean(AUTO_UPDATE_KEY, b); }
public void setAutoUpdateEnabled(boolean b) { getPrefs().putBoolean(AUTO_UPDATE_KEY, b); }
public boolean isAutoUpdateEnabled() { return getPrefs().getBoolean(AUTO_UPDATE_KEY, true); }
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(); }