|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sk.uniba.euromath.document.DocumentModifyHelper
public final class DocumentModifyHelper
Provides basic editing features, document modification driven by schema.
Constructor Summary | |
---|---|
DocumentModifyHelper(XMLAccess xmlAccess)
Constuctor. |
Method Summary | |
---|---|
boolean |
checkInEntity(Shell shell,
Node node)
Checks if given node is in entity. |
void |
decloseNodes(Shell parent,
Element e)
Manages the process of declosing the nodes - replaces given element with its contents. |
void |
deleteAttribute(Shell parent,
Attr attr)
Manages the process of deleting the attribute. |
void |
deleteElements(Shell shell,
Set<Element> elements)
Manages the process of deleting the elements. |
void |
deleteNode(Shell shell,
Node node)
Tries to delete a single node. |
void |
deleteTextNode(Shell shell,
Node node)
Deletes given text node. |
void |
encloseNodes(Shell parent,
sk.baka.ikslibs.ptr.DomPointer start,
sk.baka.ikslibs.ptr.DomPointer end)
Manages the process of enclosing the nodes. |
List<QName> |
getDomQnames(DisplayableNameList dnl)
Computes QNames of elements from DisplayableNameList. |
DisplayableNameList |
getInsertableElements(sk.baka.ikslibs.ptr.DomPointer pointer)
Deprecated. use getInsertableElementsQNames(DomPointer) instead. To display qname use DomTools#printQName(QName) . |
List<QName> |
getInsertableElementsQNames(sk.baka.ikslibs.ptr.DomPointer pointer)
Computes list of names of elements, insertable at given pointer. |
List<String> |
getInsertableEntities(Shell parent,
sk.baka.ikslibs.ptr.DomPointer ptr)
Computes insertable entities. |
sk.baka.ikslibs.ptr.DomPointer |
getPointer(String nodeID,
String prevText)
Returns DomPointer which points to place in node tree to textual node with id nodeID and after text prevText. |
void |
insertEntity(Shell parent,
sk.baka.ikslibs.ptr.DomPointer ptr)
Manages the process of inserting an entity into selected position by dialog. |
void |
insertEntity(String entityName,
sk.baka.ikslibs.ptr.DomPointer ptr)
Inserts entity to given position. |
void |
insertNewAttribute(Shell parent,
Element e)
Manages the process of inserting a new attribute into given element. |
void |
insertTextNode(Shell shell,
Element element)
Inserts text to end of element by dialog. |
void |
modifyAttribute(Shell parent,
Attr attr)
Manages the process of modifying the attribute value. |
void |
modifyTextNode(Shell shell,
Node node)
Modifies text of node by dialog. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DocumentModifyHelper(XMLAccess xmlAccess)
xmlAccess
- the document instance.Method Detail |
---|
public void insertNewAttribute(Shell parent, Element e) throws sk.baka.xml.gene.ExportException
parent
- parent window. Should not be null
.e
- the element where to insert new attribute.
sk.baka.xml.gene.ExportException
- when document modification finalization fails.public void modifyAttribute(Shell parent, Attr attr) throws sk.baka.xml.gene.ExportException
parent
- parent window. Should not be null
.attr
- the attribute whose value has to be modified.
sk.baka.xml.gene.ExportException
- when document modification finalization fails.public void deleteAttribute(Shell parent, Attr attr) throws sk.baka.xml.gene.ExportException
parent
- parent window. Should not be null
.attr
- the attribute which has to be deleted.
sk.baka.xml.gene.ExportException
- when document modification finalization fails.public void deleteElements(Shell shell, Set<Element> elements) throws sk.baka.xml.gene.ExportException
shell
- parent window. Should not be null
.elements
- set of Element
s that must be deleted.
sk.baka.xml.gene.ExportException
- when document modification finalization fails.public void encloseNodes(Shell parent, sk.baka.ikslibs.ptr.DomPointer start, sk.baka.ikslibs.ptr.DomPointer end) throws sk.baka.xml.gene.ExportException
start
- start of the interval. Must point before the end
parameter.end
- end of the interval.parent
- parent window. Should not be null
.
sk.baka.xml.gene.ExportException
- when document modification finalization fails.public void decloseNodes(Shell parent, Element e) throws sk.baka.xml.gene.ExportException
parent
- parent window. Should not be null
.e
- the element, that shall be replaced by its children if the
declosing is allowed.
sk.baka.xml.gene.ExportException
- when document modification finalization fails.public void insertEntity(Shell parent, sk.baka.ikslibs.ptr.DomPointer ptr) throws sk.baka.xml.gene.ExportException
ptr
- the desired place.parent
- parent window. Should not be null
.
sk.baka.xml.gene.ExportException
- when document modification finalization fails.public void insertEntity(String entityName, sk.baka.ikslibs.ptr.DomPointer ptr) throws sk.baka.xml.gene.ExportException
entityName
- the entity name.ptr
- the insert point.
sk.baka.xml.gene.ExportException
- if document modification finalization fails.public List<String> getInsertableEntities(Shell parent, sk.baka.ikslibs.ptr.DomPointer ptr)
ptr
- the desired place.parent
- parent window. Can be null
.
null
if no entities are suitable.@Deprecated public DisplayableNameList getInsertableElements(sk.baka.ikslibs.ptr.DomPointer pointer)
DomTools#printQName(QName)
.
pointer
- to place where elements should be able to insert.public List<QName> getInsertableElementsQNames(sk.baka.ikslibs.ptr.DomPointer pointer)
pointer
-
public List<QName> getDomQnames(DisplayableNameList dnl)
public sk.baka.ikslibs.ptr.DomPointer getPointer(String nodeID, String prevText)
nodeID
- id of textual node in which returned pointer pointsprevText
- text after which returned pointer pointspublic void insertTextNode(Shell shell, Element element) throws DocumentException, sk.baka.xml.gene.ExportException
element
- where to insert text node as childshell
- parent window. !!! Cannot be null
.
DocumentException
sk.baka.xml.gene.ExportException
public void modifyTextNode(Shell shell, Node node) throws sk.baka.xml.gene.ExportException
node
- must be text nodeshell
- parent window. !!!Cannot be null
.
sk.baka.xml.gene.ExportException
- if document fails to transform.public boolean checkInEntity(Shell shell, Node node)
shell
- parent, should not be null
.node
- node to check
true
if node is in entity, false
otherwise.public void deleteTextNode(Shell shell, Node node) throws sk.baka.xml.gene.ExportException
shell
- parent window, should not be null
.node
- node to delete, must not be null
. May be text,
cdata or pure-text entity only.
sk.baka.xml.gene.ExportException
- if shit happens.public void deleteNode(Shell shell, Node node) throws sk.baka.xml.gene.ExportException
shell
- parent shell, should not be null
.node
- node to delete.
sk.baka.xml.gene.ExportException
- if shit happens.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |