private static void read(ProjectPreferences node, IFile file) throws BackingStoreException, CoreException { if (file == null || !file.exists()) { if (Policy.DEBUG_PREFERENCES) Policy.debug("Unable to determine preference file or file does not exist for node: " + node.absolutePath()); //$NON-NLS-1$ return; } Properties fromDisk = loadProperties(file); // no work to do if (fromDisk.isEmpty()) return; // create a new node to store the preferences in. IExportedPreferences myNode = (IExportedPreferences) ExportedPreferences.newRoot().node(node.absolutePath()); convertFromProperties((EclipsePreferences) myNode, fromDisk, false); //flag that we are currently reading, to avoid unnecessary writing boolean oldIsReading = node.isReading; node.isReading = true; try { Platform.getPreferencesService().applyPreferences(myNode); } finally { node.isReading = oldIsReading; } }
private static void read(ProjectPreferences node, IFile file) throws BackingStoreException, CoreException { if (file == null || !file.exists()) { if (Policy.DEBUG_PREFERENCES) Policy.debug("Unable to determine preference file or file does not exist for node: " + node.absolutePath()); //$NON-NLS-1$ return; } Properties fromDisk = loadProperties(file); // no work to do if (fromDisk.isEmpty()) return; // create a new node to store the preferences in. IExportedPreferences myNode = (IExportedPreferences) ExportedPreferences.newRoot().node(node.absolutePath()); convertFromProperties((EclipsePreferences) myNode, fromDisk, false); //flag that we are currently reading, to avoid unnecessary writing boolean oldIsReading = node.isReading; node.isReading = true; try { Platform.getPreferencesService().applyPreferences(myNode); } finally { node.isReading = oldIsReading; } }
private static void read(ProjectPreferences node, IFile file) throws BackingStoreException, CoreException { if (file == null || !file.exists()) { if (Policy.DEBUG_PREFERENCES) Policy.debug("Unable to determine preference file or file does not exist for node: " + node.absolutePath()); //$NON-NLS-1$ return; } Properties fromDisk = loadProperties(file); // no work to do if (fromDisk.isEmpty()) return; // create a new node to store the preferences in. IExportedPreferences myNode = (IExportedPreferences) ExportedPreferences.newRoot().node(node.absolutePath()); convertFromProperties((EclipsePreferences) myNode, fromDisk, false); //flag that we are currently reading, to avoid unnecessary writing boolean oldIsReading = node.isReading; node.isReading = true; try { Platform.getPreferencesService().applyPreferences(myNode); } finally { node.isReading = oldIsReading; } }
IExportedPreferences prefs = service.readPreferences(fis); service.applyPreferences(prefs, filters); } catch (CoreException e) { WorkbenchPlugin.log(e.getMessage(), e);