mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-67217 Introduce parameter should specify its type explicitly by default
This commit is contained in:
+1
-1
@@ -180,7 +180,7 @@ public class GrIntroduceParameterDialog extends RefactoringDialog implements GrI
|
||||
}
|
||||
|
||||
private void createUIComponents() {
|
||||
myTypeComboBox = new GrTypeComboBox(myContext.var != null ? myContext.var.getDeclaredType() : myContext.expression.getType());
|
||||
myTypeComboBox = new GrTypeComboBox(myContext.var != null ? myContext.var.getDeclaredType() : myContext.expression.getType(), true);
|
||||
|
||||
String[] possibleNames = GroovyNameSuggestionUtil.suggestVariableNames(myContext.expression, new GroovyFieldValidator(myContext), true);
|
||||
if (myContext.var != null) {
|
||||
|
||||
@@ -29,9 +29,16 @@ public class GrTypeComboBox extends JComboBox {
|
||||
private final PsiType myType;
|
||||
|
||||
public GrTypeComboBox(PsiType type) {
|
||||
this(type, false);
|
||||
}
|
||||
|
||||
public GrTypeComboBox(PsiType type, boolean selectType) {
|
||||
super();
|
||||
myType = type;
|
||||
initialize();
|
||||
if (selectType && getItemCount() > 1) {
|
||||
setSelectedIndex(1);
|
||||
}
|
||||
}
|
||||
|
||||
private void initialize() {
|
||||
|
||||
Reference in New Issue
Block a user