public class PreferenceManager extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
POST_ORDER
Post-order means visit the children, and then the root.
|
static int |
PRE_ORDER
Pre-order traversal means visit the root first,
then the children.
|
| Constructor and Description |
|---|
PreferenceManager()
Creates a new preference manager.
|
PreferenceManager(char separatorChar)
Creates a new preference manager with the given
path separator.
|
PreferenceManager(char separatorChar,
PreferenceNode rootNode)
Creates a new preference manager with the given
path separator and root node.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addTo(String path,
IPreferenceNode node)
Adds the given preference node as a subnode of the
node at the given path.
|
void |
addToRoot(IPreferenceNode node)
Adds the given preference node as a subnode of the
root.
|
protected void |
buildSequence(IPreferenceNode node,
List<IPreferenceNode> sequence,
int order)
Recursively enumerates all nodes at or below the given node
and adds them to the given list in the given order.
|
IPreferenceNode |
find(String path)
Finds and returns the contribution node at the given path.
|
protected IPreferenceNode |
find(String path,
IPreferenceNode top)
Finds and returns the preference node directly
below the top at the given path.
|
List<IPreferenceNode> |
getElements(int order)
Returns all preference nodes managed by this
manager.
|
protected IPreferenceNode |
getRoot()
Returns the root node.
|
IPreferenceNode[] |
getRootSubNodes()
Returns the root level nodes of this preference manager.
|
boolean |
remove(IPreferenceNode node)
Removes the given prefreence node if it is managed by
this contribution manager.
|
IPreferenceNode |
remove(String path)
Removes the preference node at the given path.
|
void |
removeAll()
Removes all contribution nodes known to this manager.
|
public static final int PRE_ORDER
public static final int POST_ORDER
public PreferenceManager()
public PreferenceManager(char separatorChar)
separatorChar - public PreferenceManager(char separatorChar,
PreferenceNode rootNode)
separatorChar - the separator characterrootNode - the root node.public boolean addTo(String path, IPreferenceNode node)
path - the pathnode - the node to addtrue if the add was successful,
and false if there is no contribution at
the given pathpublic void addToRoot(IPreferenceNode node)
node - the node to add, which must implement
IPreferenceNodeprotected void buildSequence(IPreferenceNode node, List<IPreferenceNode> sequence, int order)
node - the starting nodesequence - a read-write list of preference nodes
(element type: IPreferenceNode)
in the given orderorder - the traversal order, one of
PRE_ORDER and POST_ORDERpublic IPreferenceNode find(String path)
path - the pathnull if noneprotected IPreferenceNode find(String path, IPreferenceNode top)
path - the pathtop - top at the given pathnull if nonepublic List<IPreferenceNode> getElements(int order)
order - the traversal order, one of
PRE_ORDER and POST_ORDERIPreferenceNode)
in the given orderprotected IPreferenceNode getRoot()
public final IPreferenceNode[] getRootSubNodes()
public IPreferenceNode remove(String path)
path - the pathnull if there was no
node at the given pathpublic boolean remove(IPreferenceNode node)
node - the node to removetrue if the node was removed,
and false otherwisepublic void removeAll()
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.