org.merlotxml.merlot
Class MerlotDOMDocument

java.lang.Object
  extended byorg.merlotxml.merlot.MerlotDOMNode
      extended byorg.merlotxml.merlot.MerlotDOMDocument
All Implemented Interfaces:
java.lang.Cloneable, MerlotConstants, java.awt.datatransfer.Transferable

public class MerlotDOMDocument
extends MerlotDOMNode

DOM document container for Merlot. Contains a DOM node, handles getting an icon for a particular node, getting the editor for a node, etc. Also implements transferable so that the node can be drag and dropped, or cut and pasted.


Nested Class Summary
 class MerlotDOMDocument.SearchCriteria
           
 
Field Summary
protected  IDManager _idManager
          The IDManager for this document
protected  java.util.HashMap _nodeDescription
          Node descriptors
 
Fields inherited from class org.merlotxml.merlot.MerlotDOMNode
_children, _clonedFrom, _dtdPluginConfig, _file, _listeners, _parent, _theNode, DOM_TREENODE_FLAVOR
 
Fields inherited from interface org.merlotxml.merlot.MerlotConstants
ACTION_MENU_ACCELERATOR, ACTION_MENU_ICON, ACTION_NAME, ACTION_SHORT_DESCRIPTION, ACTION_SMALL_ICON, AFTER, BEFORE, ERR, INTO, UI, XML
 
Constructor Summary
MerlotDOMDocument(org.w3c.dom.Document data, XMLFile doc)
           
 
Method Summary
 MerlotDOMFragment createDocumentFragment()
           
 java.util.Vector findAllDescendants(MerlotDOMNode startNode, MerlotDOMDocument.SearchCriteria c)
          Visits every node in the tree from the top down, and retrieves all nodes matching the criteria.
 MerlotDOMNode findFirstDescendant(MerlotDOMNode startNode, MerlotDOMDocument.SearchCriteria c)
          Visits nodes in the tree from the top down, but stops as soon as a node is found that matches the criteria.
 MerlotDOMNode findMerlotDOMNode(org.w3c.dom.Node node)
          Finds the corresponding MerlotDOMNode for a Node.
 MerlotDOMNode findNodeById(java.lang.String id)
           
 MerlotDOMNode findNodeByIdSlow(java.lang.String id)
          Finds the first node with the specified ID.
 org.w3c.dom.Document getDocument()
           
 IDManager getIdManager()
          Return THE IDManager specific to the document containing this node.
 MerlotDOMNode getMerlotDOMNode(org.w3c.dom.Node node)
           
 
Methods inherited from class org.merlotxml.merlot.MerlotDOMNode
addMerlotNodeListener, appendChild, array2String, array2String, clone, delete, equals, fireNodeChanged, fireNodeDeleted, fireNodeInserted, fireNodeRemoved, getAppendableElements, getAttributes, getAttributesOfType, getChildElements, getChildIndex, getChildNodes, getChildText, getClonedFrom, getDescriptiveText, getDescriptiveText, getDisplayText, getDTDAttributes, getDTDDocument, getDTDPluginConfig, getEditor, getEditPanel, getFirstAttributeOfType, getFirstChild, getGrammarAttribute, getGrammarAttributes, getGrammarComplexType, getGrammarDocument, getIcon, getIndices, getInsertableElements, getInsertableElements, getMerlotDOMDocument, getMerlotNodeListeners, getNodeName, getNodes, getParentNode, getPreviousSibling, getPreviousSibling, getProperty, getRealNode, getSmallIcon, getTransferData, getTransferDataFlavors, getXMLFile, hashCode, importChild, importChild, importChildAfter, importChildBefore, insertAfter, insertBefore, insertChildAt, isAllowableChild, isAllowableChild, isAllowableChild, isDataFlavorSupported, isElement, isRootElement, isSpecialNode, isValid, locationIsValid, mayBeRemoved, newChild, newChild, newSiblingAfter, newSiblingAfter, newSiblingBefore, newSiblingBefore, printNode, printNode, removeAllMerlotDOMNodeListeners, removeAttributes, removeChild, removeMerlotNodeListener, resetCache, setAttributes, setClonedFrom, setDescriptiveText, setParentNode, setParentNode, toPathString, toString, toXMLShort
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

_idManager

protected IDManager _idManager
The IDManager for this document


_nodeDescription

protected java.util.HashMap _nodeDescription
Node descriptors

Constructor Detail

MerlotDOMDocument

public MerlotDOMDocument(org.w3c.dom.Document data,
                         XMLFile doc)
Method Detail

getDocument

public org.w3c.dom.Document getDocument()
Overrides:
getDocument in class MerlotDOMNode

createDocumentFragment

public MerlotDOMFragment createDocumentFragment()

getIdManager

public IDManager getIdManager()
Description copied from class: MerlotDOMNode
Return THE IDManager specific to the document containing this node.

Overrides:
getIdManager in class MerlotDOMNode

getMerlotDOMNode

public MerlotDOMNode getMerlotDOMNode(org.w3c.dom.Node node)

findMerlotDOMNode

public MerlotDOMNode findMerlotDOMNode(org.w3c.dom.Node node)
Finds the corresponding MerlotDOMNode for a Node.


findNodeById

public MerlotDOMNode findNodeById(java.lang.String id)

findNodeByIdSlow

public MerlotDOMNode findNodeByIdSlow(java.lang.String id)
Finds the first node with the specified ID. If the document is not validated, duplicate IDs might exist and this might return the wrong value.


findFirstDescendant

public MerlotDOMNode findFirstDescendant(MerlotDOMNode startNode,
                                         MerlotDOMDocument.SearchCriteria c)
Visits nodes in the tree from the top down, but stops as soon as a node is found that matches the criteria. Extend SearchCriteria in order to do different searches.


findAllDescendants

public java.util.Vector findAllDescendants(MerlotDOMNode startNode,
                                           MerlotDOMDocument.SearchCriteria c)
Visits every node in the tree from the top down, and retrieves all nodes matching the criteria. Extend SearchCriteria in order to do different searches.