void (TestType testType) { setSelectedIfNeeded(testType == TestType.TEST_FOLDER, myAllInFolderRB); setSelectedIfNeeded(testType == TestType.TEST_SCRIPT, myTestScriptRB); setSelectedIfNeeded(testType == TestType.TEST_CLASS, myTestClassRB); setSelectedIfNeeded(testType == TestType.TEST_METHOD, myTestMethodRB); setSelectedIfNeeded(testType == TestType.TEST_FUNCTION, myTestFunctionRB); myTestFolderComponent.setVisible(testType == TestType.TEST_FOLDER); myTestFolderTextField.setVisible(testType == TestType.TEST_FOLDER); myTestScriptComponent.setVisible(testType != TestType.TEST_FOLDER); myTestScriptTextField.setVisible(testType != TestType.TEST_FOLDER); myTestClassComponent.setVisible(testType == TestType.TEST_CLASS || testType == TestType.TEST_METHOD); myTestClassTextField.setVisible(testType == TestType.TEST_CLASS || testType == TestType.TEST_METHOD); myTestMethodComponent.setVisible(testType == TestType.TEST_METHOD || testType == TestType.TEST_FUNCTION); myTestMethodTextField.setVisible(testType == TestType.TEST_METHOD || testType == TestType.TEST_FUNCTION); myPatternTextField.setEnabled(myPatternCheckBox.isSelected()); myParamTextField.setEnabled(myParamCheckBox.isSelected()); myTestMethodComponent.getLabel().setText(testType == TestType.TEST_METHOD? PyBundle.message("runcfg.unittest.dlg.method_label") : PyBundle.message("runcfg.unittest.dlg.function_label")); if (myPatternIsVisible) { myPatternTextField.setVisible(getTestType() == AbstractPythonLegacyTestRunConfiguration.TestType.TEST_FOLDER); myPatternCheckBox.setVisible(getTestType() == AbstractPythonLegacyTestRunConfiguration.TestType.TEST_FOLDER); } }