Enumeration e = subObjectsV.elements(); EPICSLink field; Object obj; while (e.hasMoreElements()) { obj = e.nextElement(); if (obj instanceof EPICSLink) { field = (EPICSLink) obj;  EPICSLink fieldCopy = (EPICSLink) theTemplateCopy.getSubObject(field.getFieldData().getName()); if (fieldCopy != null) { fieldCopy.setColor(field.getColor()); fieldCopy.setRight(field.isRight()); fieldCopy.getFieldData().setVisibility(field.getFieldData().getVisibility()); } } }
public boolean copyToGroup(java.lang.String group) {	String newName;	if (group.equals(nullString))		newName = Group.substractObjectName(templateData.getName());	else		newName = group+Constants.GROUP_SEPARATOR+				  Group.substractObjectName(templateData.getName());	// object with new name already exists, add suffix ///!!!	//Object obj;	while (Group.getRoot().findObject(newName, true)!=null)//		newName += Constants.COPY_SUFFIX;			newName = StringUtils.incrementName(newName, Constants.COPY_SUFFIX);		ViewState view = ViewState.getInstance();	VDBTemplateInstance theDataCopy = VDBData.copyVDBTemplateInstance(templateData);	theDataCopy.setName(newName);	Template theTemplateCopy = new Template(null, theDataCopy);	Group.getRoot().addSubObject(theDataCopy.getName(), theTemplateCopy, true);	//theTemplateCopy.setDescription(getTemplateData().getTemplate().getDescription());	theTemplateCopy.setX(getX()); theTemplateCopy.setY(getY());	theTemplateCopy.move(20-view.getRx(), 20-view.getRy());	theTemplateCopy.updateTemplateFields();	unconditionalValidation();	return true;}