use of com.intellij.refactoring.ui.PackageNameReferenceEditorCombo in project kotlin by JetBrains.
the class MoveKotlinNestedClassesToUpperLevelDialog method createUIComponents.
private void createUIComponents() {
parameterField = new NameSuggestionsField(project);
packageNameField = new PackageNameReferenceEditorCombo("", project, RECENTS_KEY, RefactoringBundle.message("choose.destination.package"));
}
use of com.intellij.refactoring.ui.PackageNameReferenceEditorCombo in project kotlin by JetBrains.
the class MoveKotlinTopLevelDeclarationsDialog method createPackageChooser.
private ReferenceEditorComboWithBrowseButton createPackageChooser() {
ReferenceEditorComboWithBrowseButton packageChooser = new PackageNameReferenceEditorCombo("", myProject, RECENTS_KEY, RefactoringBundle.message("choose.destination.package"));
Document document = packageChooser.getChildComponent().getDocument();
document.addDocumentListener(new DocumentAdapter() {
@Override
public void documentChanged(DocumentEvent e) {
validateButtons();
}
});
return packageChooser;
}
use of com.intellij.refactoring.ui.PackageNameReferenceEditorCombo in project intellij-community by JetBrains.
the class WrapReturnValueDialog method createUIComponents.
private void createUIComponents() {
final com.intellij.openapi.editor.event.DocumentAdapter adapter = new com.intellij.openapi.editor.event.DocumentAdapter() {
public void documentChanged(com.intellij.openapi.editor.event.DocumentEvent e) {
validateButtons();
}
};
packageTextField = new PackageNameReferenceEditorCombo("", myProject, RECENT_KEYS, RefactoringBundle.message("choose.destination.package"));
packageTextField.getChildComponent().getDocument().addDocumentListener(adapter);
existingClassField = new ReferenceEditorComboWithBrowseButton(new ActionListener() {
public void actionPerformed(ActionEvent e) {
final TreeClassChooser chooser = TreeClassChooserFactory.getInstance(getProject()).createWithInnerClassesScopeChooser(RefactorJBundle.message("select.wrapper.class"), GlobalSearchScope.allScope(myProject), null, null);
final String classText = existingClassField.getText();
final PsiClass currentClass = JavaPsiFacade.getInstance(myProject).findClass(classText, GlobalSearchScope.allScope(myProject));
if (currentClass != null) {
chooser.select(currentClass);
}
chooser.showDialog();
final PsiClass selectedClass = chooser.getSelected();
if (selectedClass != null) {
existingClassField.setText(selectedClass.getQualifiedName());
}
}
}, "", myProject, true, RECENT_KEYS);
existingClassField.getChildComponent().getDocument().addDocumentListener(adapter);
myDestinationCb = new DestinationFolderComboBox() {
@Override
public String getTargetPackage() {
return getPackageName();
}
};
((DestinationFolderComboBox) myDestinationCb).setData(myProject, sourceMethod.getContainingFile().getContainingDirectory(), packageTextField.getChildComponent());
}
use of com.intellij.refactoring.ui.PackageNameReferenceEditorCombo in project intellij-community by JetBrains.
the class MoveInnerDialog method createUIComponents.
private void createUIComponents() {
if (!myInnerClass.hasModifierProperty(PsiModifier.STATIC)) {
final PsiManager manager = myInnerClass.getManager();
PsiType outerType = JavaPsiFacade.getInstance(manager.getProject()).getElementFactory().createType(myInnerClass.getContainingClass());
mySuggestedNameInfo = JavaCodeStyleManager.getInstance(myProject).suggestVariableName(VariableKind.PARAMETER, null, null, outerType);
String[] variants = mySuggestedNameInfo.names;
myParameterField = new NameSuggestionsField(variants, myProject);
} else {
myParameterField = new NameSuggestionsField(new String[] { "" }, myProject);
myParameterField.getComponent().setEnabled(false);
}
myPackageNameField = new PackageNameReferenceEditorCombo("", myProject, RECENTS_KEY, RefactoringBundle.message("choose.destination.package"));
PsiPackage psiPackage = getTargetPackage();
if (psiPackage != null) {
myPackageNameField.prependItem(psiPackage.getQualifiedName());
}
}
use of com.intellij.refactoring.ui.PackageNameReferenceEditorCombo in project intellij-community by JetBrains.
the class MoveClassesOrPackagesDialog method createPackageChooser.
private ReferenceEditorComboWithBrowseButton createPackageChooser() {
final ReferenceEditorComboWithBrowseButton packageChooser = new PackageNameReferenceEditorCombo("", myProject, RECENTS_KEY, RefactoringBundle.message("choose.destination.package"));
final Document document = packageChooser.getChildComponent().getDocument();
document.addDocumentListener(new DocumentAdapter() {
public void documentChanged(DocumentEvent e) {
validateButtons();
}
});
return packageChooser;
}
Aggregations