/** * Loads this preference store from the file established in the constructor * <code>PreferenceStore(java.lang.String)</code> (or by * <code>setFileName</code>). Default preference values are not affected. * * @exception java.io.IOException * if there is a problem loading this store */ public void load() throws IOException { if (filename == null) { throw new IOException("File name not specified");//$NON-NLS-1$ } FileInputStream in = new FileInputStream(filename); load(in); in.close(); }
/** * Loads this preference store from the file established in the constructor * <code>PreferenceStore(java.lang.String)</code> (or by * <code>setFileName</code>). Default preference values are not affected. * * @exception java.io.IOException * if there is a problem loading this store */ public void load() throws IOException { if (filename == null) { throw new IOException("File name not specified");//$NON-NLS-1$ } FileInputStream in = new FileInputStream(filename); load(in); in.close(); }
/** * Loads this preference store from the file established in the constructor * <code>PreferenceStore(java.lang.String)</code> (or by * <code>setFileName</code>). Default preference values are not affected. * * @exception java.io.IOException * if there is a problem loading this store */ public void load() throws IOException { if (filename == null) { throw new IOException("File name not specified");//$NON-NLS-1$ } FileInputStream in = new FileInputStream(filename); load(in); in.close(); }
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) { } } /**
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; }