introduce parameter: clean selection later to avoid focus troubles (IDEA-134272)

This commit is contained in:
Anna Kozlova
2014-12-17 09:57:42 +01:00
parent ed1e39e78c
commit e0ba38fed0
@@ -490,9 +490,16 @@ public class IntroduceParameterHandler extends IntroduceHandlerBase {
createTypeSelectorManager(occurences, initializerType), methodToSearchFor, method, getParamsToRemove(method, occurences), mustBeFinal);
dialog.setReplaceAllOccurrences(replaceAllOccurrences);
dialog.setGenerateDelegate(delegate);
dialog.show();
if (myEditor != null) {
myEditor.getSelectionModel().removeSelection();
if (dialog.showAndGet()) {
final Runnable cleanSelectionRunnable = new Runnable() {
@Override
public void run() {
if (myEditor != null && !myEditor.isDisposed()) {
myEditor.getSelectionModel().removeSelection();
}
}
};
SwingUtilities.invokeLater(cleanSelectionRunnable);
}
}
}