void () { myClassNameField.setText(myInnerClass.getName()); myClassNameField.selectAll(); if (!myInnerClass.hasModifierProperty(PsiModifier.STATIC)) { myCbPassOuterClass.setSelected(true); myCbPassOuterClass.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { myParameterField.setEnabled(myCbPassOuterClass.isSelected()); } }); } else { myCbPassOuterClass.setSelected(false); myCbPassOuterClass.setEnabled(false); myParameterField.setEnabled(false); } if (myCbPassOuterClass.isEnabled()) { boolean thisNeeded = isThisNeeded(myInnerClass, myOuterClass); myCbPassOuterClass.setSelected(thisNeeded); myParameterField.setEnabled(thisNeeded); } myCbPassOuterClass.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { boolean selected = myCbPassOuterClass.isSelected(); myParameterField.getComponent().setEnabled(selected); } }); if (!(myTargetContainer instanceof PsiDirectory)) { myPackageNameField.setVisible(false); myPackageNameLabel.setVisible(false); } super.init(); }