1 16 package org.apache.cocoon.portal.layout; 17 18 19 26 public class Item extends AbstractParameters { 27 28 private Layout layout; 29 30 private CompositeLayout parentLayout; 31 32 36 public final Layout getLayout() { 37 return layout; 38 } 39 40 44 public final void setLayout(Layout layout) { 45 this.layout = layout; 46 if(layout != null) { 47 layout.setParent(this); 48 } 49 } 50 51 public final CompositeLayout getParent() { 52 return this.parentLayout; 53 } 54 55 public final void setParent(CompositeLayout layout) { 56 this.parentLayout = layout; 57 } 58 59 62 protected Object clone() throws CloneNotSupportedException { 63 Item clone = (Item)super.clone(); 64 65 clone.layout = null; 66 clone.parentLayout = null; 67 68 return clone; 69 } 70 71 public Item copy(CompositeLayout parent) { 72 try { 73 Item clone = (Item)this.clone(); 74 if ( this.layout != null ) { 75 clone.layout = this.layout.copy(); 76 clone.layout.setParent(clone); 77 } 78 clone.parentLayout = parent; 79 return clone; 80 } catch (CloneNotSupportedException cnse) { 81 } 83 return null; 84 } 85 86 } 87 | Popular Tags |