| 
 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectviper.api.impl.EventfulNodeHelper
An abstract viper node class.
| Nested Class Summary | 
| Nested classes inherited from class viper.api.extensions.TransactionalNode | 
| TransactionalNode.Transaction | 
| Field Summary | |
| protected  java.lang.String | childNodeType | 
| protected  boolean | notifyingListeners | 
| Constructor Summary | |
| EventfulNodeHelper() | |
| Method Summary | |
|  void | addChild(Node n)(Optional) Adds a child in some arbitrary position. | 
|  void | addChild(Node n,
         boolean undoable)Adds a child node, but returns an undoable or non-undoable event according to the parameter. | 
|  void | addNodeListener(NodeListener nl)Adds a listener for changes to the node or its children. | 
|  TransactionalNode.Transaction | begin(java.lang.String uri)Starts a transaction on this node. | 
|  void | fireMajorNodeChanged(MajorNodeChangeEvent mnce)Fires the given major node change event, combining several other changes into one. | 
|  void | fireMinorNodeChanged(MinorNodeChangeEvent mnce)Fires the given minor node change event, indicating that some aspect of the node has changed. | 
|  void | fireNodeChanged(NodeChangeEvent nce)Fires the given node change event, indicating that some of the children of the node have been added or removed. | 
| protected abstract  java.util.logging.Logger | getLogger() | 
|  ViperData | getRoot()Gets the root of the tree. | 
|  boolean | hasListeners()Tests to see if any listeners are attached to the current node. | 
| protected abstract  void | helpSetChild(int i,
             Node n,
             TransactionalNode.Transaction t,
             boolean insert)Replace the child at index i with the given node. | 
|  boolean | isNotifyingListeners() | 
|  boolean | isWriteLocked()Tests to see if set will work. | 
| protected abstract  void | postHelpSetChild(int i,
                 Node n,
                 TransactionalNode.Transaction t,
                 boolean insert)Invoked after the event has been generated for the corresponding helpSetChild call. | 
|  void | removeChild(int i)(Optional) Remove child at offset i. | 
|  void | removeChild(int i,
            boolean undoable)Removes the specified child, emitting an undoable or non-undoable version of the event as requested. | 
|  void | removeChild(Node n)(Optional) Remove child n. | 
|  void | removeNodeListener(NodeListener nl)Adds a listener for changes to the node or its children. | 
|  void | setChild(int i,
         Node n)(Optional) Sets the child at i to n. | 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Methods inherited from interface viper.api.Node | 
| getChild, getChildren, getNumberOfChildren, getParent, hasChild, indexOf | 
| Field Detail | 
protected java.lang.String childNodeType
protected boolean notifyingListeners
| Constructor Detail | 
public EventfulNodeHelper()
| Method Detail | 
public boolean hasListeners()
false when no listeners are attachedpublic void addNodeListener(NodeListener nl)
EventfulNode
addNodeListener in interface EventfulNodenl - the node listener to addEventfulNode.addNodeListener(viper.api.extensions.NodeListener)public void removeNodeListener(NodeListener nl)
EventfulNode
removeNodeListener in interface EventfulNodenl - the node listener to addEventfulNode.removeNodeListener(viper.api.extensions.NodeListener)public ViperData getRoot()
Node
getRoot in interface NodeNode.getRoot()protected abstract java.util.logging.Logger getLogger()
public void fireNodeChanged(NodeChangeEvent nce)
EventfulNode
fireNodeChanged in interface EventfulNodence - the change eventEventfulNode.fireNodeChanged(viper.api.extensions.NodeChangeEvent)public boolean isWriteLocked()
public void fireMinorNodeChanged(MinorNodeChangeEvent mnce)
EventfulNode
fireMinorNodeChanged in interface EventfulNodemnce - the change eventEventfulNode.fireMinorNodeChanged(viper.api.extensions.MinorNodeChangeEvent)public void fireMajorNodeChanged(MajorNodeChangeEvent mnce)
EventfulNode
fireMajorNodeChanged in interface EventfulNodemnce - the change eventEventfulNode.fireMajorNodeChanged(viper.api.extensions.MajorNodeChangeEvent)
protected abstract void helpSetChild(int i,
                                     Node n,
                                     TransactionalNode.Transaction t,
                                     boolean insert)
i - the index to insert/setn - the node to insertt - the transaction associated with the event, if it exists.
            Otherwise, it is null.insert - true if the node should be inserted,
            false if the current node i should be replaced
protected abstract void postHelpSetChild(int i,
                                         Node n,
                                         TransactionalNode.Transaction t,
                                         boolean insert)
i - the index to insert/setn - the node to insertt - the transaction associated with the event, if it exists.
            Otherwise, it is null.insert - true if the node should be inserted,
            false if the current node i should be replacedpublic void addChild(Node n)
Node
addChild in interface Noden - the node to addNode.addChild(viper.api.Node)
public void setChild(int i,
                     Node n)
Node
setChild in interface Nodei - the index of the child to replacen - the new value of the childNode.setChild(int, viper.api.Node)public void removeChild(int i)
Node
removeChild in interface Nodei - child to removeNode.removeChild(int)public void removeChild(Node n)
Node
removeChild in interface Noden - child to remove.Node.removeChild(viper.api.Node)
public void addChild(Node n,
                     boolean undoable)
n - the node to addundoable - whether to allow undoNode.addChild(viper.api.Node)
public void removeChild(int i,
                        boolean undoable)
i - the index of the child to removeundoable - whether to allow undoing the eventpublic TransactionalNode.Transaction begin(java.lang.String uri)
TransactionalNode
begin in interface TransactionalNodeuri - an identifier to associate with the 
 transaction; useful for logging
TransactionalNode.begin(java.lang.String)public boolean isNotifyingListeners()
isNotifyingListeners in interface EventfulNode| 
 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||