|
WebObjects 5.2.3 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.webobjects.eoapplication.EODefaults
EODefaults objects are used to collect user defaults like window sizes and positions.
The EOApplication object of the application has a defaults
method which returns
the shared instance used by all controllers to register values.
Field Summary | |
static String |
DefaultsKey
The key through which you can access the (mutable) dictionary of default values to be loaded or saved in the userInfo of the
LoadUserDefaultsNotification and SaveUserDefaultsNotification
notifications. |
static String |
LoadUserDefaultsNotification
The name of the notification sent by default managers which rely on other objects to load default values (default implementation of EODefaults, but commonly overridden by subclasses). |
static String |
SaveUserDefaultsNotification
The name of the notification sent by default managers which rely on other objects to store default values (default implementation of EODefaults, but commonly overridden by subclasses). |
Constructor Summary | |
EODefaults()
Creates a new defaults manager object. |
Method Summary | |
NSDictionary |
allValues()
Returns a dictionary with all key/value pairs stored in the defaults manager (both transient and persistent values). |
void |
clearAllValues()
Clears out all default values collected so far. |
void |
dispose()
Prepares the receiver so it is disposed when Java performs garbage collection. |
void |
flushDefaultsToPersistentStore()
Saves the persistent user defaults, but only if there have been any changes that would require saving. |
protected NSDictionary |
loadPersistentValues()
Loads the persistent user defaults. |
protected void |
savePersistentValues(NSDictionary values)
Saves the persistent user defaults. |
void |
setPersistentValueForKey(Object value,
String key)
Stores a value with the key key as persistent in the
defaults manager. |
void |
setTransientValueForKey(Object value,
String key)
Stores a value with the key key as transient in the
defaults manager. |
Object |
valueForKey(String key)
Returns the value stored in the defaults manager with the key key or null if no value is stored with
that key. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String DefaultsKey
userInfo
of the
LoadUserDefaultsNotification
and SaveUserDefaultsNotification
notifications.
public static final String LoadUserDefaultsNotification
DefaultsKey
key in the userInfo
of the notification.
public static final String SaveUserDefaultsNotification
DefaultsKey
key in
the userInfo
of the notification.
Constructor Detail |
public EODefaults()
Method Detail |
public NSDictionary allValues()
public void clearAllValues()
public void dispose()
dispose
in interface NSDisposable
public void flushDefaultsToPersistentStore()
savePersistentValues(NSDictionary values)
protected NSDictionary loadPersistentValues()
LoadUserDefaultsNotification
notification
to give other objects an opportunity to fill in values.
savePersistentValues(NSDictionary values)
protected void savePersistentValues(NSDictionary values)
SaveUserDefaultsNotification
notification
to give other objects an opportunity to store the values.
values
- the persistent values to saveloadPersistentValues()
public void setPersistentValueForKey(Object value, String key)
key
as persistent in the
defaults manager. The receiver attempts to save the values with
the help of the server when the client application terminates. If
you just want to collect temporary values which should not be stored,
use the setTransientValueForKey
method.
value
- the defaults valuekey
- the key with which to store the valuesetTransientValueForKey(Object, String)
,
savePersistentValues(NSDictionary values)
public void setTransientValueForKey(Object value, String key)
key
as transient in the
defaults manager. Transient values will be forgotten completely when
the client application terminates. If you want to store a value for
the next time the application is started, use the
setPersistentValueForKey
method.
value
- the defaults valuekey
- the key with which to store the valuesetPersistentValueForKey(Object, String)
public Object valueForKey(String key)
key
or null
if no value is stored with
that key. First checks in the persistent values and then in the
transient values.
key
- the key to look up
null
if no value is stored with the key
|
Last updated Thu Oct 21 15:04:16 PDT 2004. | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |