@Override
  public void write(final XmlWriter writer) {
    if (isXY()) {
      writer.startElement("xy");
    }
    else {
      writer.startElement("grid");
    }
    try {
      writeId(writer);
      writeClassIfDifferent(writer, JPanel.class.getName());
      writeBinding(writer);

      if (myLayoutManager != null) {
        writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_LAYOUT_MANAGER, myLayoutManager.getName());
      }

      getLayoutManager().writeLayout(writer, this);

      // Constraints and properties
      writeConstraints(writer);
      writeProperties(writer);

      // Border
      writeBorder(writer);

      // Children
      writeChildren(writer);
    }
    finally {
      writer.endElement(); // xy/grid
    }
  }
@Override
  public void write(final XmlWriter writer)