|
WebObjects 5.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | 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.
EODefaults works together with the server side of Java Client applications: When the client starts up, it tries to receive values from the distribution context on the server side, and when the application terminates, it asks the distribution context to store all the persistent values. The distribution context in turn sends out notifications to read or write the default values, so you can register for these notifications on the server side and implement your own storage mechanism (for example to store the user defaults in the database).
EODistributionContext
Constructor Summary | |
EODefaults()
Creates a new defaults manager object. |
Method Summary | |
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 |
loadPersistentValues()
Loads the persistent user defaults. |
void |
savePersistentValues()
Saves the persistent user defaults by asking the server to store them. |
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 |
Constructor Detail |
public EODefaults()
Method Detail |
public void clearAllValues()
public void dispose()
dispose
in interface NSDisposable
public void loadPersistentValues()
savePersistentValues()
,
EODistributionContext
public void savePersistentValues()
loadPersistentValues()
,
EODistributionContext
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()
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 upnull
if no value is stored with the key
|
Last updated Thu Jan 10 18:10:21 PST 2002. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |