void (final XmlWriter writer, final RadComponent child) { writeGridConstraints(writer, child); if (child.getCustomLayoutConstraints() instanceof GridBagConstraints gbc) { writer.startElement(UIFormXmlConstants.ELEMENT_GRIDBAG); try { if (!gbc.insets.equals(new Insets(0, 0, 0, 0))) { writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_TOP, gbc.insets.top); writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_LEFT, gbc.insets.left); writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_BOTTOM, gbc.insets.bottom); writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_RIGHT, gbc.insets.right); } writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_WEIGHTX, gbc.weightx); writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_WEIGHTY, gbc.weighty); if (gbc.ipadx != 0) { writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_IPADX, gbc.ipadx); } if (gbc.ipady != 0) { writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_IPADY, gbc.ipady); } } finally { writer.endElement(); } } }