4,10 → 4,10 |
* Coded by: Group 5, software practice summer 2003 |
* University of Bielefeld, Germany |
* |
* $Revision: 1.63 $ |
* $Revision: 1.64 $ |
* |
* Last modification: $Date: 2003/07/19 12:16:42 $ |
* $Id: AdapterDomToTreeModel.java,v 1.63 2003/07/19 12:16:42 mdonner Exp $ |
* Last modification: $Date: 2003/07/24 14:30:28 $ |
* $Id: AdapterDomToTreeModel.java,v 1.64 2003/07/24 14:30:28 smcsporr Exp $ |
*/ |
|
package src.parser; |
40,7 → 40,7 |
* |
* @author Group 5 |
* |
* @version $Revision: 1.63 $ Last modification: $Date: 2003/07/19 12:16:42 $ |
* @version $Revision: 1.64 $ Last modification: $Date: 2003/07/24 14:30:28 $ |
*/ |
public class AdapterDomToTreeModel implements TreeModel, LogInterface { |
|
528,10 → 528,12 |
public void cutChild(TreePath path) { |
modified=true; |
if (XPath) { |
removeFilteredChildren(getDocPath(path),path); //if children of the node which should be deleted are shown, they must be deleted,too |
//removeFilteredChildren(getDocPath(path),path); //if children of the node which should be deleted are shown, they must be deleted,too |
|
|
remchild(path,true,true); //if a XPath filtered nodelist is adapted by this instance, the node must be removed from the virtual XPath root |
|
remchild(getDocPath(path),true,false); //additionally it must be removed in the document |
remchild(getDocPath(path),true,false); //additionally it must be removed in the document |
|
}else{ |
remchild(path,true,true); // if the whole document is adapted by this instance, the node just must be removed in the document |
} |
648,8 → 650,10 |
modified=true; |
if (XPath) { |
// -1 inserts the node at the end of all existing children |
pasChild(path,-1,true); //if a XPath filtered nodelist is adapted by this instance, the node must be added to the virtual XPath root |
pasChild(path,-1,true); //if a XPath filtered nodelist is adapted by this instance, the node must be added to the virtual XPath root |
XPath=false; // temorary set to false so that the node is inserted with its children in the document by paschild |
pasChild(getDocPath(path),-1,false); //Node added to the document |
XPath=true; //reset to true |
}else{ |
pasChild(path,-1,true); |
} |
670,8 → 674,8 |
private void pasChild (TreePath path,int index, boolean fireEvent) { |
AdapterNode parent,child=null; |
parent = (AdapterNode) path.getLastPathComponent(); |
try { |
child=new AdapterNode ( parent.addChild(copynode.cloneNode(true),index) ); // AdapterNode method is called to add the node (-1 so it is appended to the end of the list of children) |
try { // if XPath is set the children are removed before adding |
child=new AdapterNode ( parent.addChild(copynode.cloneNode(!XPath),index) ); // AdapterNode method is called to add the node (-1 so it is appended to the end of the list of children) |
} |
catch (DOMException ex) { |
log(LogInterface.TYPE_ERROR,"Error occured during inserting '"+copynode+"'\n"+ex.getMessage()); |