|
Eclipse Rich Ajax Platform | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.rwt.service.FileSettingStore
public final class FileSettingStore
This ISettingStore
implementation persists all settings on the
file system using Java Properties
.
Field Summary | |
---|---|
static java.lang.String |
FILE_SETTING_STORE_DIR
This key (value "org.eclipse.rwt.service.FileSettingStore.dir") can be used to configure the working directory for file settings stores. |
Constructor Summary | |
---|---|
FileSettingStore(java.io.File workDir)
Create a FileSettingStore instance. |
Method Summary | |
---|---|
void |
addSettingStoreListener(SettingStoreListener listener)
Attaches an SettingStoreListener to this ISettingStore . |
java.lang.String |
getAttribute(java.lang.String name)
Returns the attribute stored under the specified name in this ISettingStore , or null if no attribute is stored under
that name. |
java.util.Enumeration |
getAttributeNames()
Returns an Enumeration of String objects with the names
of all attributes in this ISettingStore . |
java.lang.String |
getId()
Returns the unique identifier of this setting store |
void |
loadById(java.lang.String id)
Replace the contents of this setting store with all attributes persisted under the given id . |
void |
removeAttribute(java.lang.String name)
Removes the attribute stored under the specified name from this ISettingStore . |
void |
removeSettingStoreListener(SettingStoreListener listener)
Removes an SettingStoreListener from this ISettingStore . |
void |
setAttribute(java.lang.String name,
java.lang.String value)
Stores an attribute to this ISettingStore , using the name
specified. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String FILE_SETTING_STORE_DIR
RWTFileSettingStoreFactory
and
WorkbenchFileSettingStoreFactory
.
Constructor Detail |
---|
public FileSettingStore(java.io.File workDir)
FileSettingStore
instance. The store will be initialized
with a unique random id and will contain no attributes. Use
loadById(String)
to initialize an existing store with previously
persisted attributes.
workDir
- a non-null File instance denoting an existing directory,
which will be used by this class persist its settings.
java.lang.NullPointerException
- if the argument workDir is null
java.lang.IllegalArgumentException
- if the argument workDir is not a directoryloadById(String)
Method Detail |
---|
public java.lang.String getId()
ISettingStore
getId
in interface ISettingStore
public java.lang.String getAttribute(java.lang.String name)
ISettingStore
ISettingStore
, or null
if no attribute is stored under
that name.
getAttribute
in interface ISettingStore
name
- a non-null String specifying the name of the attribute
null
public void setAttribute(java.lang.String name, java.lang.String value) throws SettingStoreException
ISettingStore
ISettingStore
, using the name
specified. If an attribute with the same name is already stored in that
ISettingStore
the previous value is replaced.
Any attribute stored to this ISettingStore using this method is considered persisted from that point on.
If the value argument is null
, this has the same effect
as calling ISettingStore.removeAttribute(String)
.
SettingStoreListener
s attached to this instance will be notified
after an attribute has been stored.
setAttribute
in interface ISettingStore
name
- the name of the attribute; cannot be null
value
- the String to store; may be null
SettingStoreException
- if the load operation failed to complete
normallypublic java.util.Enumeration getAttributeNames()
ISettingStore
Enumeration
of String objects with the names
of all attributes in this ISettingStore
.
getAttributeNames
in interface ISettingStore
Enumeration
; never null
public void loadById(java.lang.String id) throws SettingStoreException
ISettingStore
id
.
The attributes of this setting store before the load operation will remain
associated with the old id, but will be removed from this store instance.
SettingStoreListener
s attached to this store will receive a
notification for each removed attribute.
During the load operation this store will be filled with the attributes
associated with the new id value. SettingStoreListener
s attached
to this store will receive a notification for each added attribute.
After the load operation this store will only hold attributes associated with the new id value.
It is important to note that this operation does not create a new setting
store, so that listeners still remain associated with the same store
instance. Instead the contents of this setting store are replaced
with the contents associated with the given id
.
loadById
in interface ISettingStore
id
- a non-null; non-empty; non-whitespace-only String
SettingStoreException
- if the load operation failed to complete
normallypublic void removeAttribute(java.lang.String name) throws SettingStoreException
ISettingStore
ISettingStore
. If no attribute is stored under the specified name,
this method does nothing.
SettingStoreListener
s attached to this instance will be notified
after an attribute has been removed.
removeAttribute
in interface ISettingStore
name
- the name of the attribute to remove;
cannot be null
SettingStoreException
- if the remove operation failed to complete
normallypublic void addSettingStoreListener(SettingStoreListener listener)
ISettingStore
SettingStoreListener
to this ISettingStore
.
Listeners attached to this instance will notified of changes in the store.
addSettingStoreListener
in interface ISettingStore
listener
- the SettingStoreListener
to add; non-nullpublic void removeSettingStoreListener(SettingStoreListener listener)
ISettingStore
SettingStoreListener
from this ISettingStore
.
removeSettingStoreListener
in interface ISettingStore
listener
- the SettingStoreListener
to remove; non-null
|
Eclipse Rich Ajax Platform | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (c) EclipseSource and others 2002, 2012. All rights reserved.