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
-
Preferences()
- This class has no constructor
-
addGroup(PrefGroup)
- Allows to add a new group in the current preferences environment.
-
cancel(PrefGroup)
- This method is called when the user's modifications for a preferences group
are canceled.
-
delAllGroups()
- Delete all groups in the current environment iff no one is in edition.
-
delGroup(String)
- Allows to delete a group from the current preferences environment.
-
editGroup(String, PrefFrame)
- This is called when interactive edition of the preferences are needed.
-
getGroup(String)
- Allows to get the group object with the corresponding groupname.
-
groupsList()
- Gives an enumeration of all preferences groups currently loaded
in the preferences environment.
-
init(SecureRole)
- This is for Preferences initialisation.
-
isInitialised()
- Returns true if a successfull init() call has been done.
-
loadPreferences()
- Get the state of a the last preferences environment which has been saved.
-
loadPreferences(AccessName)
- Get the state of a previously save state of the preferences environment.
-
numberOfGroups()
- Gives the number of preferences groups in the current preferences
environment.
-
savePreferences()
- Save in the archive the actual state of the preferences environment in the default file.
-
savePreferences(AccessName)
- Save the actual state of the preferences environment.
-
update(PrefGroup)
- This method is called when the user's modifications for a preferences group
are accepted.
Preferences
public Preferences() throws PreferencesException
- This class has no constructor
- Returns:
- none.
- Throws: PreferencesException
- each time this method is called.
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.
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.
groupsList
public static Enumeration groupsList()
- Gives an enumeration of all preferences groups currently loaded
in the preferences environment.
- Returns:
- Enumeration of all groups.
numberOfGroups
public static int numberOfGroups()
- Gives the number of preferences groups in the current preferences
environment.
- Returns:
- the number of preferences groups.
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.
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.
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.
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.
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:
-
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.
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.
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.
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.
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.
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