private static void generateGroups(final FormSourceCodeGenerator generator, final String variable,
                                     final @NonNls String methodName, final int[][] groups) {
    if (groups.length == 0) return;
    generator.startMethodCall("((com.jgoodies.forms.layout.FormLayout) " + variable + ".getLayout())",
                              methodName);

    @NonNls StringBuilder groupBuilder = new StringBuilder("new int[][] {");
    for(int i=0; i<groups.length; i++) {
      if (i > 0) groupBuilder.append(", ");
      groupBuilder.append("new int[] { ");
      for(int j=0; j<groups [i].length; j++) {
        if (j > 0) groupBuilder.append(", ");
        groupBuilder.append(groups [i] [j]);
      }
      groupBuilder.append(" }");
    }
    groupBuilder.append(" }");

    generator.pushVar(groupBuilder.toString());
    generator.endMethod();
  }
private static void generateGroups(final FormSourceCodeGenerator generator, final String variable,
                                     final @NonNls String methodName, final int[][] groups)