public class ReadOnlyAccess extends DocumentModelAccess
Modifier and Type | Class and Description |
---|---|
static class |
ReadOnlyAccess.Provider |
DocumentModelAccess.NodeUpdater
Constructor and Description |
---|
ReadOnlyAccess(AbstractDocumentModel model)
Creates a new instance of PlainDOMAccess
|
addQNameValuedAttributes, dirtyIntervalMillis, getCurrentDocumentText, getXmlFragmentInclusive, lookupNamespaceURI, removeChildren, reorderChildren, setDirty, unsetDirty
isAutoSync, prepareSync, setAutoSync
public ReadOnlyAccess(AbstractDocumentModel model)
public AbstractDocumentModel getModel()
DocumentModelAccess
getModel
in class DocumentModelAccess
public void setPrefix(Element node, String prefix)
setPrefix
in class DocumentModelAccess
public List<Element> getPathFromRoot(Document root, Element node)
DocumentModelAccess
getPathFromRoot
in class DocumentModelAccess
public String getXPath(Document root, Element node)
DocumentModelAccess
getXPath
in class DocumentModelAccess
public Map<QName,String> getAttributeMap(Element element)
DocumentModelAccess
getAttributeMap
in class DocumentModelAccess
public static boolean isXmlnsAttribute(Attr attr)
public Element duplicate(Element element)
duplicate
in class DocumentModelAccess
public String getXmlFragment(Element element)
getXmlFragment
in class DocumentModelAccess
public void setXmlFragment(Element element, String text, DocumentModelAccess.NodeUpdater updater) throws IOException
DocumentModelAccess
setXmlFragment
in class DocumentModelAccess
element
- element to set content to.text
- XML fragment text.IOException
- if the fragment text is not well-form.public void setText(Element element, String val, DocumentModelAccess.NodeUpdater updater)
setText
in class DocumentModelAccess
public void removeAttribute(Element element, String name, DocumentModelAccess.NodeUpdater updater)
removeAttribute
in class DocumentModelAccess
public void setAttribute(Element element, String name, String value, DocumentModelAccess.NodeUpdater updater)
setAttribute
in class DocumentModelAccess
public int findPosition(Node node)
findPosition
in class DocumentModelAccess
public int getElementIndexOf(Node parent, Element child)
getElementIndexOf
in class DocumentModelAccess
public List<Node> findNodes(Document root, String xpath)
DocumentModelAccess
findNodes
in class DocumentModelAccess
public Node findNode(Document root, String xpath)
DocumentModelAccess
findNode
in class DocumentModelAccess
public Element getContainingElement(int position)
getContainingElement
in class DocumentModelAccess
public void addUndoableEditListener(UndoableEditListener listener)
addUndoableEditListener
in class ModelAccess
public void removeUndoableEditListener(UndoableEditListener listener)
removeUndoableEditListener
in class ModelAccess
public void appendChild(Node node, Node newChild, DocumentModelAccess.NodeUpdater updater)
appendChild
in class DocumentModelAccess
public void insertBefore(Node node, Node newChild, Node refChild, DocumentModelAccess.NodeUpdater updater)
insertBefore
in class DocumentModelAccess
public void removeChild(Node node, Node child, DocumentModelAccess.NodeUpdater updater)
removeChild
in class DocumentModelAccess
public void replaceChild(Node node, Node child, Node newChild, DocumentModelAccess.NodeUpdater updater)
replaceChild
in class DocumentModelAccess
public Model.State sync() throws IOException
sync
in class ModelAccess
IOException
public ElementIdentity getElementIdentity()
DocumentModelAccess
getElementIdentity
in class DocumentModelAccess
public Document getDocumentRoot()
getDocumentRoot
in class DocumentModelAccess
public void flush()
flush
in class ModelAccess
public void finishUndoRedo()
finishUndoRedo
in class ModelAccess
public boolean areSameNodes(Node n1, Node n2)
areSameNodes
in class DocumentModelAccess
public void prepareForUndoRedo()
prepareForUndoRedo
in class ModelAccess
public void addMergeEventHandler(PropertyChangeListener l)
DocumentModelAccess
addMergeEventHandler
in class DocumentModelAccess
public void removeMergeEventHandler(PropertyChangeListener l)
removeMergeEventHandler
in class DocumentModelAccess
public Node getOldEventParentNode(PropertyChangeEvent evt)
getOldEventParentNode
in class DocumentModelAccess
public Node getOldEventNode(PropertyChangeEvent evt)
getOldEventNode
in class DocumentModelAccess
public Node getNewEventParentNode(PropertyChangeEvent evt)
getNewEventParentNode
in class DocumentModelAccess
public Node getNewEventNode(PropertyChangeEvent evt)
getNewEventNode
in class DocumentModelAccess
public String normalizeUndefinedAttributeValue(String value)
DocumentModelAccess
normalizeUndefinedAttributeValue
in class DocumentModelAccess