Java 类com.intellij.uiDesigner.lw.LwContainer 实例源码

项目:intellij-ce-playground    文件:FormLayoutCodeGenerator.java   
public void generateContainerLayout(final LwContainer lwContainer, final GeneratorAdapter generator, final int componentLocal) {
  FormLayout formLayout = (FormLayout) lwContainer.getLayout();

  generator.loadLocal(componentLocal);

  generator.newInstance(ourFormLayoutType);
  generator.dup();
  generator.push(FormLayoutUtils.getEncodedColumnSpecs(formLayout));
  generator.push(FormLayoutUtils.getEncodedRowSpecs(formLayout));

  generator.invokeConstructor(ourFormLayoutType, ourFormLayoutConstructor);

  generateGroups(generator, formLayout.getRowGroups(), ourSetRowGroupsMethod);
  generateGroups(generator, formLayout.getColumnGroups(), ourSetColumnGroupsMethod);

  generator.invokeVirtual(ourContainerType, ourSetLayoutMethod);
}
项目:intellij-ce-playground    文件:GridLayoutCodeGenerator.java   
public void generateContainerLayout(final LwContainer lwContainer, final GeneratorAdapter generator, final int componentLocal) {
  if (lwContainer.isGrid()) {
    // arg 0: object
    generator.loadLocal(componentLocal);

    // arg 1: layout
    final GridLayoutManager layout = (GridLayoutManager)lwContainer.getLayout();

    generator.newInstance(myGridLayoutManagerType);
    generator.dup();
    generator.push(layout.getRowCount());
    generator.push(layout.getColumnCount());
    AsmCodeGenerator.pushPropValue(generator, "java.awt.Insets", layout.getMargin());
    generator.push(layout.getHGap());
    generator.push(layout.getVGap());
    generator.push(layout.isSameSizeHorizontally());
    generator.push(layout.isSameSizeVertically());
    generator.invokeConstructor(myGridLayoutManagerType, ourGridLayoutManagerConstructor);

    generator.invokeVirtual(ourContainerType, ourSetLayoutMethod);
  }
}
项目:intellij-ce-playground    文件:DataBindingWizardAction.java   
private static boolean hasBinding(final LwComponent component) {
  if (component.getBinding() != null) {
    return true;
  }

  if (component instanceof LwContainer) {
    final LwContainer container = (LwContainer)component;
    for (int i=0; i < container.getComponentCount(); i++) {
      if (hasBinding((LwComponent)container.getComponent(i))) {
        return true;
      }
    }
  }

  return false;
}
项目:tools-idea    文件:FormLayoutCodeGenerator.java   
public void generateContainerLayout(final LwContainer lwContainer, final GeneratorAdapter generator, final int componentLocal) {
  FormLayout formLayout = (FormLayout) lwContainer.getLayout();

  generator.loadLocal(componentLocal);

  generator.newInstance(ourFormLayoutType);
  generator.dup();
  generator.push(FormLayoutUtils.getEncodedColumnSpecs(formLayout));
  generator.push(FormLayoutUtils.getEncodedRowSpecs(formLayout));

  generator.invokeConstructor(ourFormLayoutType, ourFormLayoutConstructor);

  generateGroups(generator, formLayout.getRowGroups(), ourSetRowGroupsMethod);
  generateGroups(generator, formLayout.getColumnGroups(), ourSetColumnGroupsMethod);

  generator.invokeVirtual(ourContainerType, ourSetLayoutMethod);
}
项目:tools-idea    文件:GridLayoutCodeGenerator.java   
public void generateContainerLayout(final LwContainer lwContainer, final GeneratorAdapter generator, final int componentLocal) {
  if (lwContainer.isGrid()) {
    // arg 0: object
    generator.loadLocal(componentLocal);

    // arg 1: layout
    final GridLayoutManager layout = (GridLayoutManager)lwContainer.getLayout();

    generator.newInstance(myGridLayoutManagerType);
    generator.dup();
    generator.push(layout.getRowCount());
    generator.push(layout.getColumnCount());
    AsmCodeGenerator.pushPropValue(generator, "java.awt.Insets", layout.getMargin());
    generator.push(layout.getHGap());
    generator.push(layout.getVGap());
    generator.push(layout.isSameSizeHorizontally());
    generator.push(layout.isSameSizeVertically());
    generator.invokeConstructor(myGridLayoutManagerType, ourGridLayoutManagerConstructor);

    generator.invokeVirtual(ourContainerType, ourSetLayoutMethod);
  }
}
项目:tools-idea    文件:DataBindingWizardAction.java   
private static boolean hasBinding(final LwComponent component) {
  if (component.getBinding() != null) {
    return true;
  }

  if (component instanceof LwContainer) {
    final LwContainer container = (LwContainer)component;
    for (int i=0; i < container.getComponentCount(); i++) {
      if (hasBinding((LwComponent)container.getComponent(i))) {
        return true;
      }
    }
  }

  return false;
}
项目:consulo-ui-designer    文件:DataBindingWizardAction.java   
private static boolean hasBinding(final LwComponent component) {
  if (component.getBinding() != null) {
    return true;
  }

  if (component instanceof LwContainer) {
    final LwContainer container = (LwContainer)component;
    for (int i=0; i < container.getComponentCount(); i++) {
      if (hasBinding((LwComponent)container.getComponent(i))) {
        return true;
      }
    }
  }

  return false;
}
项目:intellij-ce-playground    文件:FlowLayoutCodeGenerator.java   
public void generateContainerLayout(final LwContainer lwContainer, final GeneratorAdapter generator, final int componentLocal) {
  generator.loadLocal(componentLocal);

  FlowLayout flowLayout = (FlowLayout) lwContainer.getLayout();
  generator.newInstance(ourFlowLayoutType);
  generator.dup();
  generator.push(flowLayout.getAlignment());
  generator.push(flowLayout.getHgap());
  generator.push(flowLayout.getVgap());
  generator.invokeConstructor(ourFlowLayoutType, ourConstructor);

  generator.invokeVirtual(ourContainerType, ourSetLayoutMethod);
}
项目:intellij-ce-playground    文件:SimpleLayoutCodeGenerator.java   
public void generateContainerLayout(final LwContainer lwContainer, final GeneratorAdapter generator, final int componentLocal) {
  generator.loadLocal(componentLocal);

  generator.newInstance(myLayoutType);
  generator.dup();
  generator.push(Utils.getHGap(lwContainer.getLayout()));
  generator.push(Utils.getVGap(lwContainer.getLayout()));

  generator.invokeConstructor(myLayoutType, ourConstructor);

  generator.invokeVirtual(ourContainerType, ourSetLayoutMethod);
}
项目:intellij-ce-playground    文件:GridBagLayoutCodeGenerator.java   
public void generateContainerLayout(final LwContainer lwContainer, final GeneratorAdapter generator, final int componentLocal) {
  generator.loadLocal(componentLocal);

  generator.newInstance(ourGridBagLayoutType);
  generator.dup();
  generator.invokeConstructor(ourGridBagLayoutType, ourDefaultConstructor);

  generator.invokeVirtual(ourContainerType, ourSetLayoutMethod);
}
项目:intellij-ce-playground    文件:FlowLayoutSourceGenerator.java   
@Override public void generateContainerLayout(final LwContainer component,
                                              final FormSourceCodeGenerator generator,
                                              final String variable) {
  generator.startMethodCall(variable, "setLayout");

  FlowLayout layout = (FlowLayout) component.getLayout();

  generator.startConstructor(FlowLayout.class.getName());
  generator.push(layout.getAlignment(), myAlignMap);
  generator.push(layout.getHgap());
  generator.push(layout.getVgap());
  generator.endConstructor();

  generator.endMethod();
}
项目:intellij-ce-playground    文件:GridBagLayoutSourceGenerator.java   
@Override
public void generateContainerLayout(final LwContainer container,
                                    final FormSourceCodeGenerator generator,
                                    final String variable) {
  generator.startMethodCall(variable, "setLayout");

  generator.startConstructor(GridBagLayout.class.getName());
  generator.endConstructor();

  generator.endMethod();
}
项目:intellij-ce-playground    文件:LayoutSourceGenerator.java   
protected void generateLayoutWithGaps(final LwContainer component,
                                      final FormSourceCodeGenerator generator,
                                      final String variable,
                                      final Class<? extends LayoutManager> layoutClass) {
  generator.startMethodCall(variable, "setLayout");

  generator.startConstructor(layoutClass.getName());
  generator.push(Utils.getHGap(component.getLayout()));
  generator.push(Utils.getVGap(component.getLayout()));
  generator.endConstructor();

  generator.endMethod();
}
项目:intellij-ce-playground    文件:FormLayoutSourceGenerator.java   
@Override
public void generateContainerLayout(final LwContainer component, final FormSourceCodeGenerator generator, final String variable) {
  FormLayout layout = (FormLayout) component.getLayout();
  generator.startMethodCall(variable, "setLayout");

  generator.startConstructor(FormLayout.class.getName());
  generator.push(FormLayoutUtils.getEncodedColumnSpecs(layout));
  generator.push(FormLayoutUtils.getEncodedRowSpecs(layout));
  generator.endConstructor();

  generator.endMethod();

  generateGroups(generator, variable, "setRowGroups", layout.getRowGroups());
  generateGroups(generator, variable, "setColumnGroups", layout.getColumnGroups());
}
项目:tools-idea    文件:FlowLayoutCodeGenerator.java   
public void generateContainerLayout(final LwContainer lwContainer, final GeneratorAdapter generator, final int componentLocal) {
  generator.loadLocal(componentLocal);

  FlowLayout flowLayout = (FlowLayout) lwContainer.getLayout();
  generator.newInstance(ourFlowLayoutType);
  generator.dup();
  generator.push(flowLayout.getAlignment());
  generator.push(flowLayout.getHgap());
  generator.push(flowLayout.getVgap());
  generator.invokeConstructor(ourFlowLayoutType, ourConstructor);

  generator.invokeVirtual(ourContainerType, ourSetLayoutMethod);
}
项目:tools-idea    文件:SimpleLayoutCodeGenerator.java   
public void generateContainerLayout(final LwContainer lwContainer, final GeneratorAdapter generator, final int componentLocal) {
  generator.loadLocal(componentLocal);

  generator.newInstance(myLayoutType);
  generator.dup();
  generator.push(Utils.getHGap(lwContainer.getLayout()));
  generator.push(Utils.getVGap(lwContainer.getLayout()));

  generator.invokeConstructor(myLayoutType, ourConstructor);

  generator.invokeVirtual(ourContainerType, ourSetLayoutMethod);
}
项目:tools-idea    文件:GridBagLayoutCodeGenerator.java   
public void generateContainerLayout(final LwContainer lwContainer, final GeneratorAdapter generator, final int componentLocal) {
  generator.loadLocal(componentLocal);

  generator.newInstance(ourGridBagLayoutType);
  generator.dup();
  generator.invokeConstructor(ourGridBagLayoutType, ourDefaultConstructor);

  generator.invokeVirtual(ourContainerType, ourSetLayoutMethod);
}
项目:tools-idea    文件:FlowLayoutSourceGenerator.java   
@Override public void generateContainerLayout(final LwContainer component,
                                              final FormSourceCodeGenerator generator,
                                              final String variable) {
  generator.startMethodCall(variable, "setLayout");

  FlowLayout layout = (FlowLayout) component.getLayout();

  generator.startConstructor(FlowLayout.class.getName());
  generator.push(layout.getAlignment(), myAlignMap);
  generator.push(layout.getHgap());
  generator.push(layout.getVgap());
  generator.endConstructor();

  generator.endMethod();
}
项目:tools-idea    文件:GridBagLayoutSourceGenerator.java   
@Override
public void generateContainerLayout(final LwContainer container,
                                    final FormSourceCodeGenerator generator,
                                    final String variable) {
  generator.startMethodCall(variable, "setLayout");

  generator.startConstructor(GridBagLayout.class.getName());
  generator.endConstructor();

  generator.endMethod();
}
项目:tools-idea    文件:LayoutSourceGenerator.java   
protected void generateLayoutWithGaps(final LwContainer component,
                                      final FormSourceCodeGenerator generator,
                                      final String variable,
                                      final Class<? extends LayoutManager> layoutClass) {
  generator.startMethodCall(variable, "setLayout");

  generator.startConstructor(layoutClass.getName());
  generator.push(Utils.getHGap(component.getLayout()));
  generator.push(Utils.getVGap(component.getLayout()));
  generator.endConstructor();

  generator.endMethod();
}
项目:tools-idea    文件:FormLayoutSourceGenerator.java   
@Override
public void generateContainerLayout(final LwContainer component, final FormSourceCodeGenerator generator, final String variable) {
  FormLayout layout = (FormLayout) component.getLayout();
  generator.startMethodCall(variable, "setLayout");

  generator.startConstructor(FormLayout.class.getName());
  generator.push(FormLayoutUtils.getEncodedColumnSpecs(layout));
  generator.push(FormLayoutUtils.getEncodedRowSpecs(layout));
  generator.endConstructor();

  generator.endMethod();

  generateGroups(generator, variable, "setRowGroups", layout.getRowGroups());
  generateGroups(generator, variable, "setColumnGroups", layout.getColumnGroups());
}
项目:consulo-ui-designer    文件:FlowLayoutSourceGenerator.java   
@Override public void generateContainerLayout(final LwContainer component,
                                              final FormSourceCodeGenerator generator,
                                              final String variable) {
  generator.startMethodCall(variable, "setLayout");

  FlowLayout layout = (FlowLayout) component.getLayout();

  generator.startConstructor(FlowLayout.class.getName());
  generator.push(layout.getAlignment(), myAlignMap);
  generator.push(layout.getHgap());
  generator.push(layout.getVgap());
  generator.endConstructor();

  generator.endMethod();
}
项目:consulo-ui-designer    文件:GridBagLayoutSourceGenerator.java   
@Override
public void generateContainerLayout(final LwContainer container,
                                    final FormSourceCodeGenerator generator,
                                    final String variable) {
  generator.startMethodCall(variable, "setLayout");

  generator.startConstructor(GridBagLayout.class.getName());
  generator.endConstructor();

  generator.endMethod();
}
项目:consulo-ui-designer    文件:LayoutSourceGenerator.java   
protected void generateLayoutWithGaps(final LwContainer component,
                                      final FormSourceCodeGenerator generator,
                                      final String variable,
                                      final Class<? extends LayoutManager> layoutClass) {
  generator.startMethodCall(variable, "setLayout");

  generator.startConstructor(layoutClass.getName());
  generator.push(Utils.getHGap(component.getLayout()));
  generator.push(Utils.getVGap(component.getLayout()));
  generator.endConstructor();

  generator.endMethod();
}
项目:consulo-ui-designer    文件:FormLayoutSourceGenerator.java   
@Override
public void generateContainerLayout(final LwContainer component, final FormSourceCodeGenerator generator, final String variable) {
  FormLayout layout = (FormLayout) component.getLayout();
  generator.startMethodCall(variable, "setLayout");

  generator.startConstructor(FormLayout.class.getName());
  generator.push(FormLayoutUtils.getEncodedColumnSpecs(layout));
  generator.push(FormLayoutUtils.getEncodedRowSpecs(layout));
  generator.endConstructor();

  generator.endMethod();

  generateGroups(generator, variable, "setRowGroups", layout.getRowGroups());
  generateGroups(generator, variable, "setColumnGroups", layout.getColumnGroups());
}
项目:intellij-ce-playground    文件:LayoutCodeGenerator.java   
public void generateContainerLayout(final LwContainer lwContainer, final GeneratorAdapter generator, final int componentLocal) {
}
项目:intellij-ce-playground    文件:CardLayoutSourceGenerator.java   
@Override
public void generateContainerLayout(final LwContainer component, final FormSourceCodeGenerator generator, final String variable) {
  generateLayoutWithGaps(component, generator, variable, CardLayout.class);
}
项目:intellij-ce-playground    文件:LayoutSourceGenerator.java   
public void generateContainerLayout(final LwContainer component,
                                    final FormSourceCodeGenerator generator,
                                    final String variable) {
}
项目:intellij-ce-playground    文件:BorderLayoutSourceGenerator.java   
@Override public void generateContainerLayout(final LwContainer component, final FormSourceCodeGenerator generator, final String variable) {
  generateLayoutWithGaps(component, generator, variable, BorderLayout.class);
}
项目:intellij-ce-playground    文件:GridLayoutSourceGenerator.java   
@Override
public void generateContainerLayout(final LwContainer container, final FormSourceCodeGenerator generator,
                                    final String variable) {
  if (container.isXY()) {
    if (container.getComponentCount() != 0) {
      throw new IllegalStateException("only empty xys are accepted");
    }
    // no layout needed
  }
  else {
    if (container.isGrid()) {
      final GridLayoutManager layout = (GridLayoutManager)container.getLayout();

      generator.startMethodCall(variable, "setLayout");

      generator.startConstructor(GridLayoutManager.class.getName());

      generator.push(layout.getRowCount());
      generator.push(layout.getColumnCount());

      generator.newInsets(layout.getMargin());

      generator.push(layout.getHGap());
      generator.push(layout.getVGap());

      if (layout.isSameSizeHorizontally() || layout.isSameSizeVertically()) {
        // values differ from the defaults - use appropriate constructor
        generator.push(layout.isSameSizeHorizontally());
        generator.push(layout.isSameSizeVertically());
      }

      generator.endConstructor(); // GridLayoutManager

      generator.endMethod();
    }
    else if (container.isXY()) {
      throw new IllegalArgumentException("XY is not supported");
    }
    else {
      throw new IllegalArgumentException("unknown layout: " + container.getLayout());
    }
  }
}
项目:intellij-ce-playground    文件:RadLayoutManager.java   
public void readLayout(LwContainer lwContainer, RadContainer radContainer) throws Exception {
}
项目:intellij-ce-playground    文件:RadCardLayoutManager.java   
@Override
public void readLayout(LwContainer lwContainer, RadContainer radContainer) throws Exception {
  String defaultCard = (String)lwContainer.getClientProperty(UIFormXmlConstants.LAYOUT_CARD);
  DefaultCardProperty.INSTANCE.setValue(radContainer, defaultCard);
}
项目:tools-idea    文件:LayoutCodeGenerator.java   
public void generateContainerLayout(final LwContainer lwContainer, final GeneratorAdapter generator, final int componentLocal) {
}
项目:tools-idea    文件:CardLayoutSourceGenerator.java   
@Override
public void generateContainerLayout(final LwContainer component, final FormSourceCodeGenerator generator, final String variable) {
  generateLayoutWithGaps(component, generator, variable, CardLayout.class);
}
项目:tools-idea    文件:LayoutSourceGenerator.java   
public void generateContainerLayout(final LwContainer component,
                                    final FormSourceCodeGenerator generator,
                                    final String variable) {
}
项目:tools-idea    文件:BorderLayoutSourceGenerator.java   
@Override public void generateContainerLayout(final LwContainer component, final FormSourceCodeGenerator generator, final String variable) {
  generateLayoutWithGaps(component, generator, variable, BorderLayout.class);
}
项目:tools-idea    文件:GridLayoutSourceGenerator.java   
@Override
public void generateContainerLayout(final LwContainer container, final FormSourceCodeGenerator generator,
                                    final String variable) {
  if (container.isXY()) {
    if (container.getComponentCount() != 0) {
      throw new IllegalStateException("only empty xys are accepted");
    }
    // no layout needed
  }
  else {
    if (container.isGrid()) {
      final GridLayoutManager layout = (GridLayoutManager)container.getLayout();

      generator.startMethodCall(variable, "setLayout");

      generator.startConstructor(GridLayoutManager.class.getName());

      generator.push(layout.getRowCount());
      generator.push(layout.getColumnCount());

      generator.newInsets(layout.getMargin());

      generator.push(layout.getHGap());
      generator.push(layout.getVGap());

      if (layout.isSameSizeHorizontally() || layout.isSameSizeVertically()) {
        // values differ from the defaults - use appropriate constructor
        generator.push(layout.isSameSizeHorizontally());
        generator.push(layout.isSameSizeVertically());
      }

      generator.endConstructor(); // GridLayoutManager

      generator.endMethod();
    }
    else if (container.isXY()) {
      throw new IllegalArgumentException("XY is not supported");
    }
    else {
      throw new IllegalArgumentException("unknown layout: " + container.getLayout());
    }
  }
}
项目:tools-idea    文件:RadLayoutManager.java   
public void readLayout(LwContainer lwContainer, RadContainer radContainer) throws Exception {
}
项目:tools-idea    文件:RadCardLayoutManager.java   
@Override
public void readLayout(LwContainer lwContainer, RadContainer radContainer) throws Exception {
  String defaultCard = (String)lwContainer.getClientProperty(UIFormXmlConstants.LAYOUT_CARD);
  DefaultCardProperty.INSTANCE.setValue(radContainer, defaultCard);
}
项目:consulo-ui-designer    文件:CardLayoutSourceGenerator.java   
@Override
public void generateContainerLayout(final LwContainer component, final FormSourceCodeGenerator generator, final String variable) {
  generateLayoutWithGaps(component, generator, variable, CardLayout.class);
}