示例#1
0
 public IPreferenceStore getPreferenceStore() {
   if (preferenceStore == null) {
     preferenceStore = new PreferenceStore(getFileName(this.name));
     try {
       File file = new File(getFileName(this.name));
       if (file.exists()) {
         preferenceStore.load();
       }
     } catch (IOException e) {
       String message = Messages.bind(Messages.ScopeSet_errorLoading, name);
       HelpUIPlugin.logError(message, e);
     }
   }
   return preferenceStore;
 }
示例#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) {
   }
 }