ComboBoxVisibilityPanel<String> () { final JavaComboBoxVisibilityPanel panel = new JavaComboBoxVisibilityPanel(); final PsiMethod containingMethod = getContainingMethod(); panel.setVisibility(containingMethod != null && containingMethod.hasModifierProperty(PsiModifier.PUBLIC) ? PropertiesComponent.getInstance(myProject).getValue(EXTRACT_METHOD_DEFAULT_VISIBILITY, PsiModifier.PRIVATE) : PsiModifier.PRIVATE); panel.addListener(e -> { updateSignature(); if (!myChangingVisibility) { myDefaultVisibility = false; } }); return panel; }