# com.bea.ide.core
PreferencesSvc.I Interface

public static interface PreferencesSvc.I

Interface for the preferences svc

Enclosing class
  `PreferencesSvc`

## Method Summary

`public void` | `duplicatePreferences`(`Preferences` oldPrefs, `Preferences` newPrefs) Helper function to create a copy of a preference tree.
`public boolean` | `equals`(`Preferences` p1, `Preferences` p2) Compares two preference trees to see if they are equal
`public `PreferencesSvc.IPreferencePkg`` | `getPreferencesPackage`(`Preferences` prefs, `ResourceSvc.IResourcePkg` res) Constructs a preference package to wrap a preference node.
`public `PreferencesSvc.IPreferencePkg`` | `getSystemPreferences`(`IPreferencesSupport` ps, `Class` c, `String` s) Constructs a preference package to wrap a preference node.
`public `PreferencesSvc.IPreferencePkg`` | `getSystemPreferences`(`IPreferencesSupport` ps, `Class` c) Constructs a preference package to wrap a preference node.
`public `PreferencesSvc.IPreferencePkg`` | `getUserPreferences`(`IPreferencesSupport` ps, `Class` c, `String` s) Constructs a preference package to wrap a preference node.
`public `PreferencesSvc.IPreferencePkg`` | `getUserPreferences`(`IPreferencesSupport` ps, `Class` c) Constructs a preference package to wrap a preference node.
`public `PreferencesSvc.IPreferencePkg`` | `getUserPreferences`(`Preferences` prefs) Constructs a preference package to wrap a preference node.
`public `PreferencesSvc.IPreferencePkg`` | `getUserPreferences`(`IPreferencesSupport` ps, `Preferences` prefs) Constructs a preference package to wrap a preference node.
`public boolean` | `nodeExists`(`Preferences` prefs, `String` key) Helper function that tests whether a node with the given key exists in the supplied preference tree.
`public int` | `parseInt`(`String` value) Helper function to parse integers.

## Method Detail

### duplicatePreferences(Preferences, Preferences) Method

    public void duplicatePreferences(Preferences oldPrefs,
                                     Preferences newPrefs)
         throws BackingStoreException

Helper function to create a copy of a preference tree.

#### Parameters

oldPrefs
  source for the copy

newPrefs
  destination for the copy

#### Exceptions

``BackingStoreException``
  if there is any problem saving the new copy

### equals(Preferences, Preferences) Method

    public boolean equals(Preferences p1,
                          Preferences p2)

Compares two preference trees to see if they are equal

#### Parameters

p1
  first preference tree

p2
  second preference tree

#### Returns

true iff p1 and p2 contain nodes and values that are all equal

### getPreferencesPackage(Preferences, ResourceSvc.IResourcePkg) Method

    public PreferencesSvc.IPreferencePkg getPreferencesPackage(Preferences prefs,
                                                               ResourceSvc.IResourcePkg res)

Constructs a preference package to wrap a preference node.

#### Parameters

prefs
  Preferences node to wrap

res
  object that defines the default values for the preference node

#### Returns

preference package that wraps the specified node

Related Topics

IPreferencePkg

### getSystemPreferences(IPreferencesSupport, Class, String) Method

    public PreferencesSvc.IPreferencePkg getSystemPreferences(IPreferencesSupport ps,
                                                              Class c,
                                                              String s)

Constructs a preference package to wrap a preference node. The preference node will be fetched from the system preferences section of the source using `IPreferencesSupport.systemNodeForPackage(Class)```.

#### Parameters

ps
  Preferences interface that defines the source of preference nodes.

c
  Class whose package defines the key to the preference node to be returned

s
  String used to obtain an `ResourceSvc.IResourcePkg``` object from the `ResourceSvc``` that defines the default values for the preference node.

#### Returns

preference package that wraps the node specified by the given class

Related Topics

IPreferencePkg

### getSystemPreferences(IPreferencesSupport, Class) Method

    public PreferencesSvc.IPreferencePkg getSystemPreferences(IPreferencesSupport ps,
                                                              Class c)

Constructs a preference package to wrap a preference node. The preference node will be fetched from the system preferences section of the source using `IPreferencesSupport.systemNodeForPackage(Class)```.

#### Parameters

ps
  Preferences interface that defines the source of preference nodes.

c
  Class whose package defines the key to the preference node to be returned. This package for this class is also used to obtain the `ResourceSvc.IResourcePkg``` object for the default values. The class name will be prepended with "default." to obtain the string to pass to `ResourceSvc.I```

#### Returns

preference package that wraps the node specified by the given class

Related Topics

IPreferencePkg
``IPreferencesSupport``

### getUserPreferences(IPreferencesSupport, Class, String) Method

    public PreferencesSvc.IPreferencePkg getUserPreferences(IPreferencesSupport ps,
                                                            Class c,
                                                            String s)

Constructs a preference package to wrap a preference node. The preference node will be fetched from the user preferences section of the source using `IPreferencesSupport.userNodeForPackage(Class)```.

#### Parameters

ps
  Preferences interface that defines the source of preference nodes.

c
  Class whose package defines the key to the preference node to be returned

s
  String used to obtain an `ResourceSvc.IResourcePkg``` object from the `ResourceSvc``` that defines the default values for the preference node.

#### Returns

preference package that wraps the node specified by the given class

Related Topics

IPreferencePkg

### getUserPreferences(IPreferencesSupport, Class) Method

    public PreferencesSvc.IPreferencePkg getUserPreferences(IPreferencesSupport ps,
                                                            Class c)

Constructs a preference package to wrap a preference node. The preference node will be fetched from the user preferences section of the source using `IPreferencesSupport.userNodeForPackage(Class)```.

#### Parameters

ps
  Preferences interface that defines the source of preference nodes.

c
  Class whose package defines the key to the preference node to be returned. This package for this class is also used to obtain the `ResourceSvc.IResourcePkg``` object for the default values. The class name will be prepended with "default." to obtain the string to pass to `ResourceSvc.I```

#### Returns

preference package that wraps the node specified by the given class

Related Topics

IPreferencePkg
``IPreferencesSupport``

### getUserPreferences(Preferences) Method

DEPRECATED

    public PreferencesSvc.IPreferencePkg getUserPreferences(Preferences prefs)

Constructs a preference package to wrap a preference node. This version provides no defaults support. This version is deprecated, please use `PreferencesSvc.I.getPreferencesPackage(Preferences, ResourceSvc.IResourcePkg)``` and pass null for the res parameter.

#### Parameters

prefs
  Preferences node to wrap

#### Returns

preference package that wraps the specified node

Related Topics

IPreferencePkg

### getUserPreferences(IPreferencesSupport, Preferences) Method

DEPRECATED

    public PreferencesSvc.IPreferencePkg getUserPreferences(IPreferencesSupport ps,
                                                            Preferences prefs)

Constructs a preference package to wrap a preference node. This version provides no defaults support. This version is deprecated, please use `PreferencesSvc.I.getPreferencesPackage(Preferences, ResourceSvc.IResourcePkg)``` and pass null for the res parameter.

#### Parameters

ps
  Preferences node to wrap

#### Returns

preference package that wraps the specified node

Related Topics

IPreferencePkg

### nodeExists(Preferences, String) Method

    public boolean nodeExists(Preferences prefs,
                              String key)

Helper function that tests whether a node with the given key exists in the supplied preference tree.

#### Parameters

prefs
  Preference tree to check

key
  Key to node

#### Returns

true if a node with the given key exists in the preference tree, false otherwise

### parseInt(String) Method

    public int parseInt(String value)

Helper function to parse integers. This takes care of looking for 0x or # to indicate a hexadecimal number. Strings beginning with any other characters are considered to be decimal

#### Parameters

value
  string to parse into an integer

#### Returns

integer value of the string. error values are returned as per `Integer.parseInt(String)```