|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectwt.prefs.Preferences
wt.prefs.WTPreferences
public class WTPreferences
Concrete implementation of javax.prefs.Preferences using Windchill for the backing store.
Features beyond the javax.prefs specification are available using this implementation, but typical preference operations should be invoked from the abstract Preferences class to insure compatibility with other Preferences implementation which may become available in the future.
The main additional feature of WTPreferences is the inclusion of contexts.
A context defines a grouping of preference entries. An instance of
WTPreference has a contextMask and an editContext attribute which define
the contexts used in reading and writing preference entries. contextMask
is actually an array of contexts which are searched in order for each
get request. The default contextMask is {USER_CONTEXT, DEFAULT_CONTEXT}
and the default editContext is the first element of the contextMask.
These default settings allow a user to "hide" a system-wide default.
If no entries are found within the contextMask's contexts, then the
programmatic default will be returned.
Supported API: true
Extendable: false
| Field Summary | |
|---|---|
static String |
CONTAINER_CONTEXT
Deprecated. |
static String |
CONTAINER_POLICY_CONTEXT
Deprecated. |
static String |
DEFAULT_CONTEXT
Deprecated. |
static String |
DIVISION_CONTEXT
Deprecated. |
static String |
DIVISION_POLICY_CONTEXT
Deprecated. |
static String |
USER_CONTEXT
Deprecated. |
| Method Summary | |
|---|---|
protected Preferences |
child(String name)
Deprecated. |
Preferences[] |
children()
Deprecated. |
void |
flush()
Deprecated. |
String |
get(String key,
String def)
Deprecated. |
String |
getContext(String key)
Deprecated. |
String[] |
getContextMask()
Deprecated. |
String |
getEditContext()
Deprecated. |
boolean |
isContext(String key,
String context)
Deprecated. |
String[] |
keys()
Deprecated. |
void |
preload()
Deprecated. |
void |
preload(String[] keys)
Deprecated. |
String |
put(String key,
String value)
Deprecated. |
void |
putAll(HashMap map)
Deprecated. |
void |
putAll(String context,
HashMap map)
Deprecated. |
void |
refresh()
Deprecated. |
void |
refresh(String key)
Deprecated. |
void |
refresh(String[] keys)
Deprecated. |
String |
remove(String key)
Deprecated. |
protected boolean |
removeChild(String name)
Deprecated. |
boolean |
removeNode(String pathName)
Deprecated. |
void |
setContextMask(String[] a_ContextMask)
Deprecated. |
void |
setEditContext(String a_EditContext)
Deprecated. |
| Methods inherited from class wt.prefs.Preferences |
|---|
forClass, forPackage, fullName, getBoolean, getInt, init, name, node, nodeExists, parent, putBoolean, putInt |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String DIVISION_CONTEXT
public static final String DIVISION_POLICY_CONTEXT
public static final String USER_CONTEXT
public static final String DEFAULT_CONTEXT
public static final String CONTAINER_CONTEXT
public static final String CONTAINER_POLICY_CONTEXT
| Method Detail |
|---|
public String[] getContextMask()
get(String,String)public void setContextMask(String[] a_ContextMask)
a_ContextMask - get(String,String)public String getEditContext()
put(String,String),
remove(String)public void setEditContext(String a_EditContext)
a_EditContext - put(String,String),
remove(String)public void preload()
public void preload(String[] keys)
keys - public String getContext(String key)
key - key whose associated value's context is returned.
isContext(String,String)
public boolean isContext(String key,
String context)
To check if the returned value is from the user's context:
boolean fromUser = pref.isContext("foo", WTPreferences.USER_CONTEXT);
Supported API: true
key - key whose associated value's context is being compared.context - context which is being compared with key's context. This may be any context, predefined context's are USER_CONTEXT and DEFAULT_CONTEXT.
getContext(String),
USER_CONTEXT,
DEFAULT_CONTEXT
public void putAll(String context,
HashMap map)
throws WTException
context - The edit contextmap - The map of key/value pairs
WTException
public void putAll(HashMap map)
throws WTException
map - The map of key/value pairs
WTExceptionpublic void refresh(String key)
key - flush()public void refresh(String[] keys)
keys - flush()protected Preferences child(String name)
If this call causes a node to be created, this node is not guaranteed
to be persistent until the flush method is called on
this node or one of its ancestors (or descendants).
Supported API: true
child in class Preferencesname - the name of the child node to return, relative to this preference node
IllegalArgumentException - if child's name is invalid.public Preferences[] children()
children in class Preferences
public void flush()
throws WTException
flush, it and all
its ancestors and descendants are made permanent by this operation.
Note that this call is not guaranteed to flush any preference
values in ancestor nodes; merely the nodes' existence.
Once this method returns successfully, it is safe to assume that all changes made prior to the call have become permanent.
flush in class PreferencesWTException
public String get(String key,
String def)
Some implementations may store default values in their backing
stores. If there is no value associated with the specified key, but
there is such a persistent default, it is returned in preference
to the specified default.
Supported API: true
get in class Preferenceskey - key whose associated value is to be returned.def - the value to be returned in the event that this preference node has no value associated with key.
key, or def
if no value is associated with key.public String[] keys()
keys in class Preferences
public String put(String key,
String value)
throws WTException
put in class Preferenceskey - key with which the specified value is to be associated.value - value to be associated with the specified key.
null
if there was no mapping for the key.
WTExceptionpublic void refresh()
refresh in class Preferencesflush()
public String remove(String key)
throws WTException
If this implementation supports stored defaults, and there
is such a default for the specified property, the stored default will
be "exposed" by this call, in the sense that it will be returned by
a succeeding call to get.
Supported API: true
remove in class Preferenceskey - key whose mapping is to be removed from the preference node.
WTExceptionget(String, String)
protected boolean removeChild(String name)
throws WTException
The removal of the specified node is not guaranteed to be persistent
until the flush method is called on an ancestor of the
specified node.
Supported API: true
removeChild in class Preferencesname - the name of the child node to remove, relative to this preference node.
WTException
public boolean removeNode(String pathName)
throws WTException
flushmethod is called on an ancestor of the
specified node. (It is illegal to remove the root node.)
The context of the node which is being removed will be the same edit
and search context defined for the current node. Thus a context can
delete a node and all of their subnodes, but not another context's
nodes.
removeNode in class PreferencespathName - the path name of the preference node to remove.
WTExceptionflush()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||