public void setLang(String lang) { if (general == null || general.size() == 0) { loadConfig(); } ConfigItem item = general.getInstance(0); item.setProperty("language", lang); }
public void setGeneralValue(String name, String value) { if (general == null || general.size() == 0) { loadConfig(); } ConfigItem item = general.getInstance(0); item.setProperty(name, value); }
public String getLang() { String lang = "default"; if (general == null || general.size() == 0) { loadConfig(); } ConfigItem item = general.getInstance(0); lang = item.getString("language", lang); item.setProperty("language", lang); return lang; }
public String getGeneralValue(String name, String defaultValue) { String value = defaultValue; if (general == null || general.size() == 0) { loadConfig(); } ConfigItem item = general.getInstance(0); value = item.getString(name, value); item.setProperty(name, value); return value; }
public int getGeneralValue(String name, int defaultValue) { int value = defaultValue; if (general == null || general.size() == 0) { loadConfig(); } ConfigItem item = general.getInstance(0); value = item.getInt(name, value); item.setProperty(name, String.valueOf(value)); return value; }
public void addBookmark(String word) { assertBook(); for (int i = 0; i < bookmarks.size(); ++i) { String oldWord = (String) bookmarks.getInstance(i).getProperty("word"); oldWord = oldWord.toLowerCase(); if (oldWord != null && oldWord.equals(word.toLowerCase())) { return; } } ConfigItem newItem = new ConfigItem(null, null); newItem.setProperty("word", word); bookmarks.addInstance(newItem); }