net.refractions.udig.style.sld.editor
Class EditorPageManager

java.lang.Object
  extended by net.refractions.udig.style.sld.editor.EditorPageManager

public class EditorPageManager
extends java.lang.Object


Field Summary
static java.lang.String ATT_CLASS
           
static java.lang.String ATT_ID
           
static java.lang.String ATT_LABEL
           
static java.lang.String ATT_NAME
           
static java.lang.String PL_KEYWORDS
           
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 Summary
EditorPageManager()
          Creates a new preference manager.
EditorPageManager(char separatorChar)
          Create a new instance of the receiver with the specified seperatorChar
 
Method Summary
 void addExtension(IExtensionTracker tracker, IExtension extension)
           
 void addPages(java.util.Collection pageContributions)
          Add the pages and the groups to the receiver.
 boolean addTo(java.lang.String path, EditorNode node)
          Adds the given preference node as a subnode of the node at the given path.
 void addToRoot(EditorNode node)
          Adds the given preference node as a subnode of the root.
protected  void buildSequence(EditorNode node, java.util.List<EditorNode> sequence, int order)
          Recursively enumerates all nodes at or below the given node and adds them to the given list in the given order.
 EditorNode find(java.lang.String path)
          Finds and returns the contribution node at the given path.
protected  EditorNode find(java.lang.String path, EditorNode top)
          Finds and returns the preference node directly below the top at the given path.
 java.lang.String getClassValue(IConfigurationElement configElement, java.lang.String classAttributeName)
           
 java.util.List getElements(int order)
          Returns all preference nodes managed by this manager.
 EditorNode getRoot()
          Returns the root node.
 EditorNode[] getRootSubNodes()
           
 boolean hasNode(java.lang.String nodeId)
          Returns true if the specified node exists in the manager.
 void registerNode(EditorNode node)
          Register a node with the extension tracker.
 boolean remove(EditorNode node)
          Removes the given prefreence node if it is managed by this contribution manager.
 EditorNode remove(java.lang.String path)
          Removes the prefernece node at the given path.
 void removeAll()
          Removes all contribution nodes known to this manager.
 void removeExtension(IExtension extension, java.lang.Object[] objects)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATT_ID

public static final java.lang.String ATT_ID
See Also:
Constant Field Values

ATT_CLASS

public static final java.lang.String ATT_CLASS
See Also:
Constant Field Values

ATT_NAME

public static final java.lang.String ATT_NAME
See Also:
Constant Field Values

ATT_LABEL

public static final java.lang.String ATT_LABEL
See Also:
Constant Field Values

PL_KEYWORDS

public static final java.lang.String PL_KEYWORDS
See Also:
Constant Field Values

PRE_ORDER

public static final int PRE_ORDER
Pre-order traversal means visit the root first, then the children.

See Also:
Constant Field Values

POST_ORDER

public static final int POST_ORDER
Post-order means visit the children, and then the root.

See Also:
Constant Field Values
Constructor Detail

EditorPageManager

public EditorPageManager()
Creates a new preference manager.


EditorPageManager

public EditorPageManager(char separatorChar)
Create a new instance of the receiver with the specified seperatorChar

Parameters:
separatorChar -
Method Detail

addPages

public void addPages(java.util.Collection pageContributions)
Add the pages and the groups to the receiver.

Parameters:
pageContributions -

registerNode

public void registerNode(EditorNode node)
Register a node with the extension tracker.

Parameters:
node - register the given node and its subnodes with the extension tracker

addExtension

public void addExtension(IExtensionTracker tracker,
                         IExtension extension)

getClassValue

public java.lang.String getClassValue(IConfigurationElement configElement,
                                      java.lang.String classAttributeName)

removeExtension

public void removeExtension(IExtension extension,
                            java.lang.Object[] objects)

addTo

public boolean addTo(java.lang.String path,
                     EditorNode node)
Adds the given preference node as a subnode of the node at the given path.

Parameters:
path - the path
node - the node to add
Returns:
true if the add was successful, and false if there is no contribution at the given path

addToRoot

public void addToRoot(EditorNode node)
Adds the given preference node as a subnode of the root.

Parameters:
node - the node to add, which must implement SLDEditorPageNode

buildSequence

protected void buildSequence(EditorNode node,
                             java.util.List<EditorNode> sequence,
                             int order)
Recursively enumerates all nodes at or below the given node and adds them to the given list in the given order.

Parameters:
node - the starting node
sequence - a read-write list of preference nodes (element type: SLDEditorPageNode) in the given order
order - the traversal order, one of PRE_ORDER and POST_ORDER

find

public EditorNode find(java.lang.String path)
Finds and returns the contribution node at the given path.

Parameters:
path - the path
Returns:
the node, or null if none

find

protected EditorNode find(java.lang.String path,
                          EditorNode top)
Finds and returns the preference node directly below the top at the given path.

Parameters:
path - the path
Returns:
the node, or null if none
Since:
3.1

getElements

public java.util.List getElements(int order)
Returns all preference nodes managed by this manager.

Parameters:
order - the traversal order, one of PRE_ORDER and POST_ORDER
Returns:
a list of preference nodes (element type: SLDEditorPageNode) in the given order

getRoot

public EditorNode getRoot()
Returns the root node. Note that the root node is a special internal node that is used to collect together all the nodes that have no parent; it is not given out to clients.

Returns:
the root node

remove

public EditorNode remove(java.lang.String path)
Removes the prefernece node at the given path.

Parameters:
path - the path
Returns:
the node that was removed, or null if there was no node at the given path

remove

public boolean remove(EditorNode node)
Removes the given prefreence node if it is managed by this contribution manager.

Parameters:
node - the node to remove
Returns:
true if the node was removed, and false otherwise

removeAll

public void removeAll()
Removes all contribution nodes known to this manager.


getRootSubNodes

public EditorNode[] getRootSubNodes()

hasNode

public boolean hasNode(java.lang.String nodeId)
Returns true if the specified node exists in the manager.

Parameters:
nodeId - Unique identified for a node
Returns:
boolean