コード例 #1
0
  @SuppressWarnings("unchecked")
  @Override
  protected void saveEntry(String key, Object value) {
    final XMLPreferences pref = preferences.node(key);

    // remove all children
    pref.removeChildren();

    // then save
    if (value != null) {
      final ArrayList<String> filenames = (ArrayList<String>) value;
      final int numFile = filenames.size();

      // save size
      pref.putInt(ID_NB_FILE, numFile);

      // save filenames
      for (int i = 0; i < numFile; i++) pref.put(ID_FILE + i, filenames.get(i));
    } else {
      // save size
      pref.putInt(ID_NB_FILE, 0);
    }

    // then clean
    pref.clean();
  }
コード例 #2
0
 public void savePrefs() {
   // prefs.putBoolean(PREF_VAR_INTERPRET, isVarInterpretationEnabled());
   // prefs.putBoolean(PREF_OVERRIDE, isOverrideEnabled());
   // prefs.putBoolean(PREF_VERIF, isAutoBuildEnabled());
   // prefs.putBoolean(PREF_STRICT, isStrictModeEnabled());
   prefs.putBoolean(PREF_INDENT_SPACES, isIndentSpacesEnabled());
   prefs.putBoolean(PREF_FULL_AUTOCOMPLETE, isFullAutoCompleteEnabled());
   prefs.putBoolean(PREF_AUTOCLEAR_OUTPUT, isAutoClearOutputEnabled());
   prefs.putInt(PREF_INDENT_SPACES_VALUE, indentSpacesCount());
 }