JComponent (ItemListener itemListener, ItemListener finalUpdater) { JPanel mainPanel = new JPanel(); mainPanel.setLayout(new BorderLayout()); JPanel initializationPanel = new JPanel(); initializationPanel.setBorder(IdeBorderFactory.createTitledBorder(RefactoringBundle.message("initialize.in.border.title"))); initializationPanel.setLayout(new BoxLayout(initializationPanel, BoxLayout.Y_AXIS)); myRbInCurrentMethod = new JRadioButton(); myRbInCurrentMethod.setFocusable(false); myRbInCurrentMethod.setText(RefactoringBundle.message("current.method.radio")); myRbInCurrentMethod.setEnabled(myAllowInitInMethod); myRbInFieldDeclaration = new JRadioButton(); myRbInFieldDeclaration.setFocusable(false); myRbInFieldDeclaration.setText(JavaRefactoringBundle.message("field.declaration.radio")); myRbInConstructor = new JRadioButton(); myRbInConstructor.setFocusable(false); myRbInConstructor.setText(RefactoringBundle.message("class.constructors.radio")); initializationPanel.add(myRbInCurrentMethod); initializationPanel.add(myRbInFieldDeclaration); initializationPanel.add(myRbInConstructor); if (TestFrameworks.getInstance().isTestClass(myParentClass)) { myRbInSetUp = new JRadioButton(); myRbInSetUp.setFocusable(false); myRbInSetUp.setText(RefactoringBundle.message("setup.method.radio")); initializationPanel.add(myRbInSetUp); } ButtonGroup bg = new ButtonGroup(); bg.add(myRbInCurrentMethod); bg.add(myRbInFieldDeclaration); bg.add(myRbInConstructor); if (myRbInSetUp != null) bg.add(myRbInSetUp); myRbInConstructor.addItemListener(itemListener); myRbInCurrentMethod.addItemListener(itemListener); myRbInFieldDeclaration.addItemListener(itemListener); myRbInConstructor.addItemListener(finalUpdater); myRbInCurrentMethod.addItemListener(finalUpdater); myRbInFieldDeclaration.addItemListener(finalUpdater); if (myRbInSetUp != null) myRbInSetUp.addItemListener(finalUpdater); // modifiersPanel.add(myCbFinal); // modifiersPanel.add(myCbStatic); JPanel groupPanel = new JPanel(new GridLayout(1, 2)); groupPanel.add(initializationPanel); myVisibilityPanel = new JavaVisibilityPanel(false, false); groupPanel.add(myVisibilityPanel); mainPanel.add(groupPanel, BorderLayout.CENTER); return mainPanel; }