Class semper.preferences.Preferences
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class semper.preferences.Preferences

java.lang.Object
   |
   +----semper.preferences.Preferences

public class Preferences
extends Object

Constructor Index

 o Preferences()
This class has no constructor

Method Index

 o addGroup(PrefGroup)
Allows to add a new group in the current preferences environment.
 o cancel(PrefGroup)
This method is called when the user's modifications for a preferences group are canceled.
 o delAllGroups()
Delete all groups in the current environment iff no one is in edition.
 o delGroup(String)
Allows to delete a group from the current preferences environment.
 o editGroup(String, PrefFrame)
This is called when interactive edition of the preferences are needed.
 o getGroup(String)
Allows to get the group object with the corresponding groupname.
 o groupsList()
Gives an enumeration of all preferences groups currently loaded in the preferences environment.
 o init(SecureRole)
This is for Preferences initialisation.
 o isInitialised()
Returns true if a successfull init() call has been done.
 o loadPreferences()
Get the state of a the last preferences environment which has been saved.
 o loadPreferences(AccessName)
Get the state of a previously save state of the preferences environment.
 o numberOfGroups()
Gives the number of preferences groups in the current preferences environment.
 o savePreferences()
Save in the archive the actual state of the preferences environment in the default file.
 o savePreferences(AccessName)
Save the actual state of the preferences environment.
 o update(PrefGroup)
This method is called when the user's modifications for a preferences group are accepted.

Constructors

 o Preferences
  public Preferences() throws PreferencesException
This class has no constructor
Returns:
none.
Throws: PreferencesException
each time this method is called.

Methods

 o init
  public static void init(SecureRole role) throws PreferencesException
This is for Preferences initialisation. Configuration must be initialised first. Preferences data are loaded from the standard file in the Archive. Archive and Access control have to be initialised first.
Parameters:
role - is the role where the edition capability is put.
Returns:
none.
Throws: PreferencesException
when Preferences have not been loaded successfully or Archive or Access is not initialised.
 o isInitialised
  public static boolean isInitialised()
Returns true if a successfull init() call has been done.
Returns:
true iff configuration are loaded and Preferences are initiliazed.
 o groupsList
  public static Enumeration groupsList()
Gives an enumeration of all preferences groups currently loaded in the preferences environment.
Returns:
Enumeration of all groups.
 o numberOfGroups
  public static int numberOfGroups()
Gives the number of preferences groups in the current preferences environment.
Returns:
the number of preferences groups.
 o addGroup
  public static boolean addGroup(PrefGroup group)
Allows to add a new group in the current preferences environment.
Parameters:
group - is the group to be added in the preferences environment.
Returns:
False if the group name is already part of the current environment.
 o delGroup
  public static boolean delGroup(String groupName)
Allows to delete a group from the current preferences environment.
Parameters:
groupName - is the group name to delete.
Returns:
False iff the group name to delete was not found.
 o getGroup
  public static PrefGroup getGroup(String groupName) throws PreferencesNoSuchGroupException
Allows to get the group object with the corresponding groupname.
Parameters:
groupName - is the name of the group in which the field is.
Returns:
PrefGroup object with the given group name.
Throws: PreferencesNoSuchGroupException
if the group name has not been found.
 o editGroup
  public static void editGroup(String groupName,
                               PrefFrame p) throws PreferencesNoSuchGroupException, PreferencesException
This is called when interactive edition of the preferences are needed. This method build the frame for interactive edition of a preferences group.
Parameters:
groupName - is the group name to edit.
prefFrame - is the frame in which the components are displayed.
Returns:
none
Throws: PreferencesNoSuchGroupException
when the group is not found.
Throws: PreferencesException
when the capability to edit is not part of an unlock role.
 o update
  public static boolean update(PrefGroup g) throws PreferencesNoSuchGroupException, PreferencesException
This method is called when the user's modifications for a preferences group are accepted. The new fields values are applied to each PrefField object of the group.
Parameters:
g - is the group to update.
Returns:
true if the modifications are correct and performed. Return false otherwise, in that case no modifications are performed.
Throws: PreferencesNoSuchGroupException
when the group to update is not found.
Throws: PreferencesException
when prolems occur during saving preferences.
See Also:
 o cancel
  public static void cancel(PrefGroup g) throws PreferencesNoSuchGroupException
This method is called when the user's modifications for a preferences group are canceled. The fields values before modification are shown back to the user.
Parameters:
g - is the group where the cancelled actions are performed.
Returns:
none.
Throws: PreferencesNoSuchGroupException
when the group to cancel is not in the current environment.
 o savePreferences
  public static void savePreferences(AccessName fileAccess) throws PreferencesException
Save the actual state of the preferences environment. The file is stored encrypted by the key indicated in the preferences. If the input AccessName is the same than the one previously used to load the current environment, the preferences envirnment file is updated.
Parameters:
filename - is an handle for the file to store (to be completed).
Returns:
none
Throws: PreferencesException
when saving cannot be completed.
 o savePreferences
  public static void savePreferences() throws PreferencesException
Save in the archive the actual state of the preferences environment in the default file.
Returns:
none
Throws: PreferencesException
when saving cannot be completed.
 o loadPreferences
  public static void loadPreferences(AccessName fileAccess) throws PreferencesException
Get the state of a previously save state of the preferences environment.
Parameters:
filename - is an handle for the file to retrieve (to be completed) from archive manager.
Returns:
none.
Throws: PreferencesException
when the file is not found.
Throws: PreferencesException
when a group is currently in edition.
 o loadPreferences
  public static void loadPreferences() throws PreferencesException
Get the state of a the last preferences environment which has been saved.
Returns:
none.
Throws: PreferencesException
when the file is not found.
Throws: PreferencesException
when a group is currently in edition.
 o delAllGroups
  protected static void delAllGroups() throws PreferencesException
Delete all groups in the current environment iff no one is in edition.
Returns:
none.
Throws: PreferencesException
when at least one group is currently in edition.

All Packages  Class Hierarchy  This Package  Previous  Next  Index