From: Mark G. <mg...@us...> - 2005-05-25 15:29:58
|
Update of /cvsroot/gmod/apollo/src/java/apollo/editor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2085/src/java/apollo/editor Modified Files: CompoundTransaction.java Transaction.java Log Message: Transactions now have back pointers to their parent compound transaction, if in fact they have one, null otherwise. This trick will allow one to look at compound trans even when all the transactions are flattened out by coalesce. this is crucial for tair, as they want to see the compound merge & split transactions, and the flattening was preventing that. Index: CompoundTransaction.java =================================================================== RCS file: /cvsroot/gmod/apollo/src/java/apollo/editor/CompoundTransaction.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** CompoundTransaction.java 24 May 2005 00:25:51 -0000 1.8 --- CompoundTransaction.java 25 May 2005 15:29:49 -0000 1.9 *************** *** 66,69 **** --- 66,70 ---- childTransactions = new ArrayList(); // Do a lazy initialization childTransactions.add(childTrans); + childTrans.setParentTransaction(this); if (getSource() != null) childTrans.setSource(getSource()); Index: Transaction.java =================================================================== RCS file: /cvsroot/gmod/apollo/src/java/apollo/editor/Transaction.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** Transaction.java 9 May 2005 22:05:51 -0000 1.35 --- Transaction.java 25 May 2005 15:29:49 -0000 1.36 *************** *** 59,62 **** --- 59,66 ---- protected Hashtable newProperties = new Hashtable(1, 1.0F); + /** If this is a child of a compound transactions, parentTransaction is a ref to + that parent, null if no parent. */ + private CompoundTransaction parentTransaction; + /** transient - no need to serialize the cur state */ //private transient CurationState curState; *************** *** 330,333 **** --- 334,347 ---- public Transaction getTransaction(int i) { return null; } + void setParentTransaction(CompoundTransaction parent) { + this.parentTransaction = parent; + } + + /** If this is a child of a compound transactions, return compound transaction parent + return null if have no parent. */ + public CompoundTransaction getParentTransaction() { + return parentTransaction; + } + /** toString with no args uses a default indent of two spaces */ public String toString() { |