private static void addNewGridConstraints(final GeneratorAdapter generator, final LwComponent lwComponent) {
    final GridConstraints constraints = lwComponent.getConstraints();

    generator.newInstance(myGridConstraintsType);
    generator.dup();
    generator.push(constraints.getRow());
    generator.push(constraints.getColumn());
    generator.push(constraints.getRowSpan());
    generator.push(constraints.getColSpan());
    generator.push(constraints.getAnchor());
    generator.push(constraints.getFill());
    generator.push(constraints.getHSizePolicy());
    generator.push(constraints.getVSizePolicy());
    newDimensionOrNull(generator, constraints.myMinimumSize);
    newDimensionOrNull(generator, constraints.myPreferredSize);
    newDimensionOrNull(generator, constraints.myMaximumSize);

    if (constraints.isUseParentLayout()) {
      generator.push(constraints.getIndent());
      generator.push(constraints.isUseParentLayout());
      generator.invokeConstructor(myGridConstraintsType, myInitConstraintsIndentParentMethod);
    }
    else if (constraints.getIndent() != 0) {
      generator.push(constraints.getIndent());
      generator.invokeConstructor(myGridConstraintsType, myInitConstraintsIndentMethod);
    }
    else {
      generator.invokeConstructor(myGridConstraintsType, myInitConstraintsMethod);
    }
  }
private static void addNewGridConstraints(final GeneratorAdapter generator, final LwComponent lwComponent)