public abstract class DocumentModelAccess extends ModelAccess
Modifier and Type | Class and Description |
---|---|
static interface |
DocumentModelAccess.NodeUpdater |
Constructor and Description |
---|
DocumentModelAccess() |
Modifier and Type | Method and Description |
---|---|
abstract void |
addMergeEventHandler(PropertyChangeListener l)
Add/remove merge property change listener.
|
void |
addQNameValuedAttributes(Map<QName,List<QName>> attributesMap)
A chance for extensible model to register attributes from extension that have
QName values.
|
abstract void |
appendChild(Node node,
Node newChild,
DocumentModelAccess.NodeUpdater updater) |
abstract boolean |
areSameNodes(Node n1,
Node n2) |
long |
dirtyIntervalMillis()
Returns length in milliseconds since last edit if the model source buffer
is dirty, or 0 if the model source is not dirty.
|
abstract Element |
duplicate(Element element) |
abstract Node |
findNode(Document root,
String xpath)
Returns node from given xpath expression
|
abstract List<Node> |
findNodes(Document root,
String xpath)
Returns nodes from given xpath expression
|
abstract int |
findPosition(Node node) |
abstract Map<QName,String> |
getAttributeMap(Element element)
Returns map of attribute names and string values.
|
abstract Element |
getContainingElement(int position) |
String |
getCurrentDocumentText() |
abstract Document |
getDocumentRoot() |
abstract ElementIdentity |
getElementIdentity()
Returns element identity helper.
|
abstract int |
getElementIndexOf(Node parent,
Element child) |
AbstractDocumentModel |
getModel()
Returns the associated document model.
|
abstract Node |
getNewEventNode(PropertyChangeEvent evt) |
abstract Node |
getNewEventParentNode(PropertyChangeEvent evt) |
abstract Node |
getOldEventNode(PropertyChangeEvent evt) |
abstract Node |
getOldEventParentNode(PropertyChangeEvent evt) |
abstract List<Element> |
getPathFromRoot(Document root,
Element node)
Returns path from given element to given root; or null if the node is not in tree.
|
abstract String |
getXmlFragment(Element element) |
String |
getXmlFragmentInclusive(Element element) |
abstract String |
getXPath(Document root,
Element node)
Returns xpath expression of given element.
|
abstract void |
insertBefore(Node node,
Node newChild,
Node refChild,
DocumentModelAccess.NodeUpdater updater) |
String |
lookupNamespaceURI(Node node,
List<? extends Node> pathToRoot) |
String |
normalizeUndefinedAttributeValue(String value)
Provide a uniform return value for undefined attribute values.
|
abstract void |
removeAttribute(Element element,
String name,
DocumentModelAccess.NodeUpdater updater) |
abstract void |
removeChild(Node node,
Node child,
DocumentModelAccess.NodeUpdater updater) |
void |
removeChildren(Node node,
Collection<Node> children,
DocumentModelAccess.NodeUpdater updater) |
abstract void |
removeMergeEventHandler(PropertyChangeListener l) |
void |
reorderChildren(Element element,
int[] newIndexes,
DocumentModelAccess.NodeUpdater updater)
Reorder children list of an element.
|
abstract void |
replaceChild(Node node,
Node child,
Node newChild,
DocumentModelAccess.NodeUpdater updater) |
abstract void |
setAttribute(Element element,
String name,
String value,
DocumentModelAccess.NodeUpdater updater) |
void |
setDirty() |
abstract void |
setPrefix(Element node,
String prefix) |
abstract void |
setText(Element element,
String val,
DocumentModelAccess.NodeUpdater updater) |
abstract void |
setXmlFragment(Element element,
String text,
DocumentModelAccess.NodeUpdater updater)
Sets the XML fragment text for given element content.
|
void |
unsetDirty()
Unset mark for dirty source buffer.
|
addUndoableEditListener, finishUndoRedo, flush, isAutoSync, prepareForUndoRedo, prepareSync, removeUndoableEditListener, setAutoSync, sync
public abstract Document getDocumentRoot()
public AbstractDocumentModel getModel()
public abstract int getElementIndexOf(Node parent, Element child)
public abstract void setAttribute(Element element, String name, String value, DocumentModelAccess.NodeUpdater updater)
public abstract void removeAttribute(Element element, String name, DocumentModelAccess.NodeUpdater updater)
public abstract void appendChild(Node node, Node newChild, DocumentModelAccess.NodeUpdater updater)
public abstract void insertBefore(Node node, Node newChild, Node refChild, DocumentModelAccess.NodeUpdater updater)
public abstract void removeChild(Node node, Node child, DocumentModelAccess.NodeUpdater updater)
public void removeChildren(Node node, Collection<Node> children, DocumentModelAccess.NodeUpdater updater)
public abstract void replaceChild(Node node, Node child, Node newChild, DocumentModelAccess.NodeUpdater updater)
public abstract void setText(Element element, String val, DocumentModelAccess.NodeUpdater updater)
public abstract int findPosition(Node node)
public abstract Element getContainingElement(int position)
public void reorderChildren(Element element, int[] newIndexes, DocumentModelAccess.NodeUpdater updater)
element
- the parent element with children to be reorderednewIndexes
- array indexed by existing indexes, with values representing reordered indexesupdater
- the component wrapper of the given element.public abstract String getXmlFragment(Element element)
public String getCurrentDocumentText()
public abstract void setXmlFragment(Element element, String text, DocumentModelAccess.NodeUpdater updater) throws IOException
element
- element to set content to.text
- XML fragment text.IOException
- if the fragment text is not well-form.public abstract Map<QName,String> getAttributeMap(Element element)
public abstract List<Element> getPathFromRoot(Document root, Element node)
public abstract String getXPath(Document root, Element node)
public String normalizeUndefinedAttributeValue(String value)
public abstract Node findNode(Document root, String xpath)
public abstract List<Node> findNodes(Document root, String xpath)
public abstract ElementIdentity getElementIdentity()
public abstract void addMergeEventHandler(PropertyChangeListener l)
public abstract void removeMergeEventHandler(PropertyChangeListener l)
public abstract Node getOldEventNode(PropertyChangeEvent evt)
public abstract Node getOldEventParentNode(PropertyChangeEvent evt)
public abstract Node getNewEventNode(PropertyChangeEvent evt)
public abstract Node getNewEventParentNode(PropertyChangeEvent evt)
public long dirtyIntervalMillis()
ModelAccess
dirtyIntervalMillis
in class ModelAccess
public void setDirty()
public void unsetDirty()
ModelAccess
unsetDirty
in class ModelAccess
public void addQNameValuedAttributes(Map<QName,List<QName>> attributesMap)