|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.merlotxml.merlot.MerlotDOMNode
DOM node 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.
Field Summary | |
protected java.util.Vector |
_children
cached list of child nodes |
protected MerlotDOMNode[] |
_clonedFrom
The node we were cloned from if any... |
protected DTDPluginConfig |
_dtdPluginConfig
the plugin this node is associated with |
protected XMLFile |
_file
The file this node came from |
protected java.util.Vector |
_listeners
Listeners of for actions on this node |
protected MerlotDOMNode |
_parent
|
protected org.w3c.dom.Node |
_theNode
|
static java.awt.datatransfer.DataFlavor |
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 | |
MerlotDOMNode(org.w3c.dom.Node data,
XMLFile file)
|
Method Summary | |
void |
addMerlotNodeListener(MerlotNodeListener l)
|
void |
appendChild(MerlotDOMNode child)
|
java.lang.String |
array2String(int[] array)
|
java.lang.String |
array2String(java.lang.Object[] array)
|
java.lang.Object |
clone()
provides a deep copy |
void |
delete()
|
boolean |
equals(java.lang.Object o)
|
void |
fireNodeChanged()
|
void |
fireNodeDeleted()
This handles the case of notifying anything editing the node that it is deleted. |
void |
fireNodeInserted(MerlotDOMNode parent,
int[] childindices,
MerlotDOMNode[] newchildren)
|
void |
fireNodeRemoved(MerlotDOMNode parent,
int[] childindices,
MerlotDOMNode[] oldchildren)
This one handles the case of keeping the tree view up to date. |
java.util.Enumeration |
getAppendableElements()
returns an enumeration of DTDElements |
org.w3c.dom.NamedNodeMap |
getAttributes()
|
int |
getChildIndex(MerlotDOMNode child)
Returns the index of the location of the child in the parent |
MerlotDOMNode[] |
getChildNodes()
gets a list of child nodes and creates an array of merlotDOMNodes. |
java.lang.String |
getChildText(boolean suppressWhiteSpace)
|
protected MerlotDOMNode[] |
getClonedFrom()
|
java.lang.String |
getDisplayText()
|
org.w3c.dom.Document |
getDocument()
|
java.util.Enumeration |
getDTDAttributes()
|
DTDPluginConfig |
getDTDPluginConfig()
Returns the dtd plugin config for this node if it exists |
MerlotDOMEditor |
getEditor()
This should return the editor object for this type of element if one is found, otherwise a default one should be returned. |
javax.swing.JPanel |
getEditPanel()
|
MerlotDOMNode |
getFirstChild()
Gets the first child that is non-empty text, or returns null if none |
javax.swing.Icon |
getIcon()
Gets a large icon |
protected int[] |
getIndices()
this gets the index of this child or if it's a fragment, then the indices of all the nodes in the top level of the fragment |
java.util.Enumeration |
getInsertableElements(int index)
returns the nodes that are insertable at the given index. |
MerlotDOMDocument |
getMerlotDOMDocument()
this goes up the tree recursively until it finds the merlot dom document |
protected java.util.Vector |
getMerlotNodeListeners()
|
java.lang.String |
getNodeName()
|
protected MerlotDOMNode[] |
getNodes()
|
MerlotDOMNode |
getParentNode()
|
MerlotDOMNode |
getPreviousSibling()
Returns the previous sibling or null if this is the first sibling |
MerlotDOMNode |
getPreviousSibling(MerlotDOMNode child)
|
org.w3c.dom.Node |
getRealNode()
|
javax.swing.Icon |
getSmallIcon()
Gets a small icon for this node based on its type |
java.lang.Object |
getTransferData(java.awt.datatransfer.DataFlavor flavor)
|
java.awt.datatransfer.DataFlavor[] |
getTransferDataFlavors()
|
XMLFile |
getXMLFile()
returns the XML file object |
int |
hashCode()
|
MerlotDOMNode |
importChild(MerlotDOMNode child)
imports a child node from another document |
MerlotDOMNode |
importChildAfter(MerlotDOMNode child)
imports a node and places it after this one |
MerlotDOMNode |
importChildBefore(MerlotDOMNode child)
imports a node and places it before this one |
void |
insertAfter(MerlotDOMNode sibling)
inserts this after the sibling |
void |
insertBefore(MerlotDOMNode sibling)
inserts this before the sibling |
void |
insertChildAt(MerlotDOMNode child,
int loc)
|
boolean |
isAllowableChild(MerlotDOMNode child)
Returns true if the child is a valid type to be a child of this according to the DTD |
boolean |
isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)
|
boolean |
isElement()
Element nodes should overload this to return true. |
MerlotDOMNode |
newChild(org.w3c.dom.Node nd)
|
MerlotDOMNode |
newChild(java.lang.String nodename)
creates a new child and adds it to the end of the list |
MerlotDOMNode |
newSiblingAfter(org.w3c.dom.Node nd)
creates a new sibling and inserts it after this node |
MerlotDOMNode |
newSiblingAfter(java.lang.String nodename)
|
MerlotDOMNode |
newSiblingBefore(org.w3c.dom.Node nd)
creates a new sibling and inserts it after this node |
MerlotDOMNode |
newSiblingBefore(java.lang.String nodename)
|
void |
printNode()
|
void |
printNode(java.lang.String prepend)
|
void |
removeAllMerlotDOMNodeListeners()
Removes all listeners from this node |
void |
removeChild(MerlotDOMNode nd)
Removes a child node |
void |
removeMerlotNodeListener(MerlotNodeListener l)
|
protected void |
resetCache()
|
void |
setAttributes(java.util.HashMap h)
Sets the attributes according the given hashtable. |
protected void |
setClonedFrom(MerlotDOMNode[] nd)
|
protected void |
setParentNode(MerlotDOMNode nd)
|
protected void |
setParentNode(MerlotDOMNode nd,
boolean updateChildren)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
finalize,
getClass,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected org.w3c.dom.Node _theNode
protected XMLFile _file
protected MerlotDOMNode _parent
protected MerlotDOMNode[] _clonedFrom
protected java.util.Vector _listeners
protected java.util.Vector _children
protected DTDPluginConfig _dtdPluginConfig
public static final java.awt.datatransfer.DataFlavor DOM_TREENODE_FLAVOR
Constructor Detail |
public MerlotDOMNode(org.w3c.dom.Node data, XMLFile file)
Method Detail |
public org.w3c.dom.Document getDocument()
public MerlotDOMDocument getMerlotDOMDocument()
public javax.swing.Icon getSmallIcon()
public javax.swing.Icon getIcon()
public boolean isElement()
public XMLFile getXMLFile()
public DTDPluginConfig getDTDPluginConfig()
public MerlotDOMEditor getEditor()
public java.lang.String getNodeName()
public int getChildIndex(MerlotDOMNode child) throws org.w3c.dom.DOMException
public MerlotDOMNode getFirstChild()
public MerlotDOMNode[] getChildNodes()
protected void resetCache()
public org.w3c.dom.NamedNodeMap getAttributes()
public void setAttributes(java.util.HashMap h)
public java.util.Enumeration getAppendableElements()
public java.util.Enumeration getInsertableElements(int index)
public boolean isAllowableChild(MerlotDOMNode child)
public MerlotDOMNode getPreviousSibling()
public MerlotDOMNode getPreviousSibling(MerlotDOMNode child) throws org.w3c.dom.DOMException
public MerlotDOMNode getParentNode()
protected void setParentNode(MerlotDOMNode nd)
protected void setParentNode(MerlotDOMNode nd, boolean updateChildren)
protected void setClonedFrom(MerlotDOMNode[] nd)
protected MerlotDOMNode[] getClonedFrom()
public MerlotDOMNode newChild(java.lang.String nodename) throws org.w3c.dom.DOMException
public MerlotDOMNode newChild(org.w3c.dom.Node nd)
public MerlotDOMNode newSiblingAfter(org.w3c.dom.Node nd)
public MerlotDOMNode newSiblingAfter(java.lang.String nodename)
public MerlotDOMNode newSiblingBefore(org.w3c.dom.Node nd)
public MerlotDOMNode newSiblingBefore(java.lang.String nodename)
public void insertAfter(MerlotDOMNode sibling)
public void insertBefore(MerlotDOMNode sibling)
public void insertChildAt(MerlotDOMNode child, int loc)
public void appendChild(MerlotDOMNode child)
public MerlotDOMNode importChild(MerlotDOMNode child)
public MerlotDOMNode importChildBefore(MerlotDOMNode child)
public MerlotDOMNode importChildAfter(MerlotDOMNode child)
public void removeChild(MerlotDOMNode nd) throws org.w3c.dom.DOMException
protected int[] getIndices()
protected MerlotDOMNode[] getNodes()
public void delete()
public java.util.Enumeration getDTDAttributes()
public javax.swing.JPanel getEditPanel() throws java.lang.InstantiationException, java.lang.IllegalAccessException
public org.w3c.dom.Node getRealNode()
public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
public java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor flavor) throws java.awt.datatransfer.UnsupportedFlavorException, java.io.IOException
public boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)
public java.lang.Object clone()
public void addMerlotNodeListener(MerlotNodeListener l)
public void removeMerlotNodeListener(MerlotNodeListener l)
public void removeAllMerlotDOMNodeListeners()
protected java.util.Vector getMerlotNodeListeners()
public java.lang.String array2String(int[] array)
public java.lang.String array2String(java.lang.Object[] array)
public void fireNodeInserted(MerlotDOMNode parent, int[] childindices, MerlotDOMNode[] newchildren)
public void fireNodeDeleted()
public void fireNodeRemoved(MerlotDOMNode parent, int[] childindices, MerlotDOMNode[] oldchildren)
public void fireNodeChanged()
public java.lang.String toString()
public boolean equals(java.lang.Object o)
public java.lang.String getDisplayText()
public int hashCode()
public void printNode()
public void printNode(java.lang.String prepend)
public java.lang.String getChildText(boolean suppressWhiteSpace)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |