void () { boolean isEnabled = true; String text = myOldNameField.getText(); text = text.trim(); PsiManager manager = PsiManager.getInstance(myProject); if (!PsiNameHelper.getInstance(manager.getProject()).isQualifiedName(text)){ isEnabled = false; } text = myNewNameField.getText(); text = text.trim(); if (!PsiNameHelper.getInstance(manager.getProject()).isQualifiedName(text)){ isEnabled = false; } setOKActionEnabled(isEnabled); }