コード例 #1
0
 public void save() {
   getPreferenceStore();
   if (preferenceStore.needsSaving() || needsSaving) {
     try {
       if (defaultSet != -1) preferenceStore.setValue(KEY_DEFAULT, defaultSet > 0);
       preferenceStore.save();
       needsSaving = false;
     } catch (IOException e) {
       String message = Messages.bind(Messages.ScopeSet_errorSaving, name);
       HelpUIPlugin.logError(message, e);
     }
   }
 }
コード例 #2
0
 private void copy(PreferenceStore store) {
   try {
     File file = File.createTempFile("sset", null); // $NON-NLS-1$
     FileOutputStream fos = new FileOutputStream(file);
     store.save(fos, ""); // $NON-NLS-1$
     fos.close();
     FileInputStream fis = new FileInputStream(file);
     getPreferenceStore();
     preferenceStore.load(fis);
     // when we clone the defult set, we should
     // clear the default marker
     preferenceStore.setValue(KEY_DEFAULT, false);
     fis.close();
   } catch (IOException e) {
   }
 }