public ElkPreferences load() { Preferences prefs = getPrefs(); numberOfWorkers = prefs.getInt(NUMBER_OF_WORKERS_KEY, defaultNumberOfWorkers_); incrementalMode = prefs.getBoolean(INCREMENTAL_MODE_KEY, defaultIncrementalMode_); autoSynchronization = prefs.getBoolean(AUTO_SYNCRHONIZATION_KEY, defaultAutoSynchronization_); inlineInferences = prefs.getBoolean(INLINE_INFERENCES_KEY, defaultInlineInferences_); return this; }
private void restore() { Preferences p = getPreferences(); baseURI = URI.create(p.getString(BASE_URI_KEY, baseURI.toString())); includeYear = p.getBoolean(INC_YEAR_KEY, true); includeMonth = p.getBoolean(INC_MONTH_KEY, true); includeDay = p.getBoolean(INC_DAY_KEY, false); useCounter = p.getBoolean(INC_DOCUMENT_COUNTER, true); }
private void save() { Preferences p = getPreferences(); p.putString(BASE_URI_KEY, baseURI.toString()); p.putBoolean(INC_YEAR_KEY, includeYear); p.putBoolean(INC_MONTH_KEY, includeMonth); p.putBoolean(INC_DAY_KEY, includeDay); }
private void load() { Preferences prefs = getPreferences(); useRegularExpressions = prefs.getBoolean(USE_REGULAR_EXPRESSIONS_KEY, false); searchDelay = prefs.getLong(SEARCH_DELAY_KEY, 500); caseSensitive = prefs.getBoolean(CASE_SENSITIVE_KEY, DEFAULT_CASE_SENSITIVE_VALUE); wholeWords = prefs.getBoolean(WHOLE_WORDS_KEY, false); ignoreWhiteSpace = prefs.getBoolean(IGNORE_WHITE_SPACE_KEY, true); }
public ElkPreferences save() { Preferences prefs = getPrefs(); prefs.putInt(NUMBER_OF_WORKERS_KEY, numberOfWorkers); prefs.putBoolean(INCREMENTAL_MODE_KEY, incrementalMode); prefs.putBoolean(AUTO_SYNCRHONIZATION_KEY, autoSynchronization); prefs.putBoolean(INLINE_INFERENCES_KEY, inlineInferences); return this; }
public void add(URI bookMarkedURI) { PreferencesManager man = PreferencesManager.getInstance(); Preferences prefs = man.getApplicationPreferences(PREFERENCES_KEY); List<String> bookmarks = prefs.getStringList(PREFERENCES_KEY, getDefaults()); bookmarks.add(bookMarkedURI.toString()); prefs.putStringList(PREFERENCES_KEY, bookmarks); }
public static void setFragmentAutoGenerated(boolean autoGenerateFragment) { Preferences prefs = getPrefs(); prefs.putBoolean(USE_AUTO_ID_FOR_FRAGMENT, autoGenerateFragment); }
/** * Sets the user name. * @param userName The user name. Not {@code null}. * @throws java.lang.NullPointerException if the user name is {@code null}. */ public void setUserName(String userName) { preferences.putString(PREFERENCES_KEY, checkNotNull(userName)); }
private DateFormatter instantiateDateFormatter() { String formatterClass = preferences.getString(DATE_FORMATTER_CLASS_KEY, ISO8601Formatter.class.getName()); try { Class<?> cls = Class.forName(formatterClass); return (DateFormatter) cls.newInstance(); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) { logger.error("Could not create date formatter: {}", e.getMessage(), e); return new ISO8601Formatter(); } }
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 static void setAutoIDDigitCount(int size) { Preferences prefs = getPrefs(); prefs.putInt(AUTO_ID_SIZE, size); }
/** * Determines whether or not the user name provided by Git (given the context of active ontologies that are under * Git version control) should be used as the user name. * @return true if the Git user name should be used when available or false if it should never be used. */ public boolean isUseGitUserNameIfAvailable() { return preferences.getBoolean(USE_GIT_USER_NAME, false); }
public void load() { tabs.clear(); tabs.addAll(getPreferences().getStringList(VISIBLE_TABS_PREFERENCE_KEY, new ArrayList<>())); }
/** * Gets the maximum child count that would allow a branch to be automatically * expanded. * @return The limit. */ public int getAutoExpansionChildLimit() { return getPreferences().getInt( CHILD_COUNT_LIMIT_KEY, 50); }
private void save() { prefs.putStringList(CUSTOM_TABS_PREFERENCES_KEY, customTabs); }
private void setDrivers(List<DriverInfo> drivers) { Preferences prefs = PreferencesManager.getInstance().getPreferencesForSet(PREFERENCES_SET, DRIVER_PREFERENCES_KEY); List<String> prefsStringList = new ArrayList<>(); for (DriverInfo driver : drivers) { prefsStringList.add(driver.getDescription()); prefsStringList.add(driver.getClassName()); prefsStringList.add(driver.getDriverLocation().getPath()); } prefs.clear(); prefs.putStringList(DRIVER_PREFERENCES_KEY, prefsStringList); }
public void setSearchDelay(long searchDelay) { this.searchDelay = searchDelay; getPreferences().putLong(SEARCH_DELAY_KEY, searchDelay); }
/** * 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 void remove(URI bookMarkedURI) { PreferencesManager man = PreferencesManager.getInstance(); Preferences prefs = man.getApplicationPreferences(PREFERENCES_KEY); List<String> bookmarks = prefs.getStringList(PREFERENCES_KEY, getDefaults()); bookmarks.remove(bookMarkedURI.toString()); prefs.putStringList(PREFERENCES_KEY, bookmarks); }