Package org.eclipse.jface.dialogs
Interface IDialogSettings
- All Known Implementing Classes:
DialogSettings
public interface IDialogSettings
An interface to a storage mechanism for making dialog settings persistent.
The store manages a collection of key/value pairs. The keys must be strings
and the values can be either, strings or array of strings. Convenience API to
convert primitive types to strings is provided.
To load/store/cache dialog settings without the assumption of how they should
be stored, clients should implement IDialogSettingsProvider.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionaddNewSection(String name) Create a new section in the receiver and return it.voidaddSection(IDialogSettings section) Add a section in the receiver.Returns the value of the given key in this dialog settings.String[]Returns the value, an array of strings, of the given key in this dialog settings.booleangetBoolean(String key) Convenience API.doubleConvenience API.floatConvenience API.intConvenience API.longConvenience API.getName()Returns the IDialogSettings name.getSection(String sectionName) Returns the section with the given name in this dialog settings.Returns all the sections in this dialog settings.voidLoad a dialog settings from a stream and fill the receiver with its content.voidLoad a dialog settings from a file and fill the receiver with its content.voidConvenience API.voidConvenience API.voidConvenience API.voidConvenience API.voidConvenience API.voidAdds the pairkey/valueto this dialog settings.voidAdds the pairkey/valueto this dialog settings.voidSave a dialog settings to a streamvoidSave a dialog settings to a file.
-
Method Details
-
addNewSection
Create a new section in the receiver and return it.- Parameters:
name- the name of the new section- Returns:
- the new section
- See Also:
-
addSection
Add a section in the receiver.- Parameters:
section- the section to be added
-
get
Returns the value of the given key in this dialog settings.- Parameters:
key- the key- Returns:
- the value, or
nullif none
-
getArray
Returns the value, an array of strings, of the given key in this dialog settings.- Parameters:
key- the key- Returns:
- the array of string, or
nullif none
-
getBoolean
Convenience API. Convert the value of the given key in this dialog settings to a boolean and return it.- Parameters:
key- the key- Returns:
- the boolean value, or
falseif none
-
getDouble
Convenience API. Convert the value of the given key in this dialog settings to a double and return it.- Parameters:
key- the key- Returns:
- the value coverted to double, or throws
NumberFormatExceptionif none - Throws:
NumberFormatException- if the string value does not contain a parsable number.- See Also:
-
getFloat
Convenience API. Convert the value of the given key in this dialog settings to a float and return it.- Parameters:
key- the key- Returns:
- the value coverted to float, or throws
NumberFormatExceptionif none - Throws:
NumberFormatException- if the string value does not contain a parsable number.- See Also:
-
getInt
Convenience API. Convert the value of the given key in this dialog settings to a int and return it.- Parameters:
key- the key- Returns:
- the value coverted to int, or throws
NumberFormatExceptionif none - Throws:
NumberFormatException- if the string value does not contain a parsable number.- See Also:
-
getLong
Convenience API. Convert the value of the given key in this dialog settings to a long and return it.- Parameters:
key- the key- Returns:
- the value coverted to long, or throws
NumberFormatExceptionif none - Throws:
NumberFormatException- if the string value does not contain a parsable number.- See Also:
-
getName
String getName()Returns the IDialogSettings name.- Returns:
- the name
-
getSection
Returns the section with the given name in this dialog settings.- Parameters:
sectionName- the key- Returns:
- IDialogSettings (the section), or
nullif none - See Also:
-
getSections
IDialogSettings[] getSections()Returns all the sections in this dialog settings.- Returns:
- the section, or
nullif none
-
load
Load a dialog settings from a stream and fill the receiver with its content.- Parameters:
reader- a Reader specifying the stream where the settings are read from.- Throws:
IOException- on IO problem while loading
-
load
Load a dialog settings from a file and fill the receiver with its content.- Parameters:
fileName- the name of the file the settings are read from.- Throws:
IOException- on IO problem while loading
-
put
Adds the pairkey/valueto this dialog settings.- Parameters:
key- the key.value- the value to be associated with thekey
-
put
Convenience API. Converts the doublevalueto a string and adds the pairkey/valueto this dialog settings.- Parameters:
key- the key.value- the value to be associated with thekey
-
put
Convenience API. Converts the floatvalueto a string and adds the pairkey/valueto this dialog settings.- Parameters:
key- the key.value- the value to be associated with thekey
-
put
Convenience API. Converts the intvalueto a string and adds the pairkey/valueto this dialog settings.- Parameters:
key- the key.value- the value to be associated with thekey
-
put
Convenience API. Converts the longvalueto a string and adds the pairkey/valueto this dialog settings.- Parameters:
key- the key.value- the value to be associated with thekey
-
put
Adds the pairkey/valueto this dialog settings.- Parameters:
key- the key.value- the value to be associated with thekey
-
put
Convenience API. Converts the booleanvalueto a string and adds the pairkey/valueto this dialog settings.- Parameters:
key- the key.value- the value to be associated with thekey
-
save
Save a dialog settings to a stream- Parameters:
writer- a Writer specifying the stream the settings are written in.- Throws:
IOException- on IO problem while saving
-
save
Save a dialog settings to a file.- Parameters:
fileName- the name of the file the settings are written in.- Throws:
IOException- on IO problem while saving
-