Re: [Sojo-user] ObjectUtil().copy of DefaultMutableTreeNode or TreeTableNode
Brought to you by:
linkemario
From: Mario L. <lin...@we...> - 2008-12-17 18:51:56
|
Hi Joanna, sorry fpr my late answer. It is a bug. I don't know, how can it good solve. But I have a workaround for you: Add: ReflectionHelper.addSimpleType(Object.class); before you call: new ObjectUtil().copy ReflectionHelper.addSimpleType(Object.class); DefaultMutableTreeNode main=new DefaultMutableTreeNode("Main"); DefaultMutableTreeNode sub=new DefaultMutableTreeNode("subMain"); main.add(sub); DefaultMutableTreeNode mainCopy=(DefaultMutableTreeNode)new ObjectUtil().copy(main); This solve only the Exception Problem. The second Problem is, that DefaultMutableTreeNode is not a JavaBean. This mean, you have not for all properties setter and getter method. The result is, you lose the children from the root node. Sojo can only copy JavaBeans. Best regards Mario ____________________________________________________________________ Psssst! Schon vom neuen WEB.DE MultiMessenger gehört? Der kann`s mit allen: http://www.produkte.web.de/messenger/?did=3123 |