Пример #1
0
 public void setLang(String lang) {
   if (general == null || general.size() == 0) {
     loadConfig();
   }
   ConfigItem item = general.getInstance(0);
   item.setProperty("language", lang);
 }
Пример #2
0
 public void setGeneralValue(String name, String value) {
   if (general == null || general.size() == 0) {
     loadConfig();
   }
   ConfigItem item = general.getInstance(0);
   item.setProperty(name, value);
 }
Пример #3
0
 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;
 }
Пример #4
0
 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;
 }
Пример #5
0
 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;
 }
Пример #6
0
  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);
  }