void (final LwRootContainer rootContainer, final HashMap<LwComponent, String> component2variable, final Object2IntMap<String> class2variableIndex, final HashMap<String, LwComponent> id2component, final PsiClass aClass) { IButtonGroup[] groups = rootContainer.getButtonGroups(); boolean haveGroupDeclaration = false; for(IButtonGroup group: groups) { boolean haveGroupConstructor = false; String[] ids = group.getComponentIds(); for(String id: ids) { LwComponent target = id2component.get(id); if (target != null) { if (!haveGroupConstructor) { if (group.isBound()) { append(group.getName()); } else { if (!haveGroupDeclaration) { append("javax.swing.ButtonGroup buttonGroup;"); haveGroupDeclaration = true; } append("buttonGroup"); } append("= new javax.swing.ButtonGroup();"); haveGroupConstructor = true; } String targetVariable = getVariable(target, component2variable, class2variableIndex, aClass); startMethodCall(group.isBound() ? group.getName() : "buttonGroup", "add"); pushVar(targetVariable); endMethod(); } } } }