ComponentWithBrowseButton<EditorComboBox> () { String name = ""; PsiFile file = mySourceClass.getContainingFile(); if (file instanceof PsiJavaFile) { name = ((PsiJavaFile)file).getPackageName(); } return new PackageNameReferenceEditorCombo(name, myProject, DESTINATION_PACKAGE_RECENT_KEY, RefactoringBundle.message("choose.destination.package")); }