org.eclipse.cdt.internal.ui.preferences.formatter
Class ProfileStore

java.lang.Object
  extended by org.eclipse.cdt.internal.ui.preferences.formatter.ProfileStore
Direct Known Subclasses:
FormatterProfileStore

public class ProfileStore
extends java.lang.Object


Field Summary
static java.lang.String ENCODING
          The default encoding to use
 
Constructor Summary
ProfileStore(java.lang.String profilesKey, IProfileVersioner profileVersioner)
           
 
Method Summary
 java.util.List readProfiles(org.eclipse.core.runtime.preferences.IScopeContext scope)
           
 java.util.List readProfilesFromFile(java.io.File file)
          Read the available profiles from the internal XML file and return them as collection or null if the file is not a profile file.
 java.util.List readProfilesFromString(java.lang.String profiles)
           
 void writeProfiles(java.util.Collection profiles, org.eclipse.core.runtime.preferences.IScopeContext instanceScope)
           
 void writeProfilesToFile(java.util.Collection profiles, java.io.File file, java.lang.String encoding)
          Write the available profiles to the internal XML file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENCODING

public static final java.lang.String ENCODING
The default encoding to use

See Also:
Constant Field Values
Constructor Detail

ProfileStore

public ProfileStore(java.lang.String profilesKey,
                    IProfileVersioner profileVersioner)
Method Detail

readProfiles

public java.util.List readProfiles(org.eclipse.core.runtime.preferences.IScopeContext scope)
                            throws org.eclipse.core.runtime.CoreException
Returns:
Returns the collection of profiles currently stored in the preference store or null if the loading failed. The elements are of type ProfileManager.CustomProfile and are all updated to the latest version.
Throws:
org.eclipse.core.runtime.CoreException

writeProfiles

public void writeProfiles(java.util.Collection profiles,
                          org.eclipse.core.runtime.preferences.IScopeContext instanceScope)
                   throws org.eclipse.core.runtime.CoreException
Throws:
org.eclipse.core.runtime.CoreException

readProfilesFromString

public java.util.List readProfilesFromString(java.lang.String profiles)
                                      throws org.eclipse.core.runtime.CoreException
Throws:
org.eclipse.core.runtime.CoreException

readProfilesFromFile

public java.util.List readProfilesFromFile(java.io.File file)
                                    throws org.eclipse.core.runtime.CoreException
Read the available profiles from the internal XML file and return them as collection or null if the file is not a profile file.

Parameters:
file - The file to read from
Returns:
returns a list of CustomProfile or null
Throws:
org.eclipse.core.runtime.CoreException

writeProfilesToFile

public void writeProfilesToFile(java.util.Collection profiles,
                                java.io.File file,
                                java.lang.String encoding)
                         throws org.eclipse.core.runtime.CoreException
Write the available profiles to the internal XML file.

Parameters:
profiles - List of CustomProfile
file - File to write
encoding - the encoding to use
Throws:
org.eclipse.core.runtime.CoreException