}
public static void cloneComponentArrayParts(JComponent origComponent, JComponent newComponent) {
setUpCellRenderer(origComponent, newComponent);
if (ArrayFieldCellHelper.getArrayField(origComponent)!= null) {
BindingManager origBindingMgr = ArrayFieldCellHelper.getArrayColumnBindingManager(origComponent);
if (origBindingMgr != null) {
// This is the top level binder, we need to make a new binding manager here
BindingManager newBindingMgr = new BindingManager(origBindingMgr.getMappedObject());
ArrayFieldCellHelper.setArrayColumnBindingManager(newComponent, newBindingMgr);
}
else {
// This is a component inside an array field, but either not a top level component, or not
// bound. Scan up the hierarchy to find a parent that has a binding manager
BindingManager topLevelManager = null;
Container c = Parent.get(newComponent);
while (c != null) {
BindingManager thisMgr = getArrayColumnBindingManager(c);
if (thisMgr != null) {
topLevelManager = thisMgr;
}
c = Parent.get(c);
}