Extracted methods.
This commit is contained in:
+15
-11
@@ -114,17 +114,7 @@ public class KotlinInlineLocalHandler extends InlineActionHandler {
|
|||||||
EditorColorsManager editorColorsManager = EditorColorsManager.getInstance();
|
EditorColorsManager editorColorsManager = EditorColorsManager.getInstance();
|
||||||
TextAttributes attributes = editorColorsManager.getGlobalScheme().getAttributes(EditorColors.SEARCH_RESULT_ATTRIBUTES);
|
TextAttributes attributes = editorColorsManager.getGlobalScheme().getAttributes(EditorColors.SEARCH_RESULT_ATTRIBUTES);
|
||||||
HighlightManager.getInstance(project).addOccurrenceHighlights(editor, referencesArray, attributes, true, null);
|
HighlightManager.getInstance(project).addOccurrenceHighlights(editor, referencesArray, attributes, true, null);
|
||||||
RefactoringMessageDialog dialog = new RefactoringMessageDialog(
|
if (!showDialog(project, name, references)) {
|
||||||
RefactoringBundle.message("inline.variable.title"),
|
|
||||||
RefactoringBundle.message("inline.local.variable.prompt", name) + " " +
|
|
||||||
RefactoringBundle.message("occurences.string", references.size()),
|
|
||||||
HelpID.INLINE_VARIABLE,
|
|
||||||
"OptionPane.questionIcon",
|
|
||||||
true,
|
|
||||||
project);
|
|
||||||
|
|
||||||
dialog.show();
|
|
||||||
if (!dialog.isOK()){
|
|
||||||
StatusBar statusBar = WindowManager.getInstance().getStatusBar(project);
|
StatusBar statusBar = WindowManager.getInstance().getStatusBar(project);
|
||||||
if (statusBar != null) {
|
if (statusBar != null) {
|
||||||
statusBar.setInfo(RefactoringBundle.message("press.escape.to.remove.the.highlighting"));
|
statusBar.setInfo(RefactoringBundle.message("press.escape.to.remove.the.highlighting"));
|
||||||
@@ -168,6 +158,20 @@ public class KotlinInlineLocalHandler extends InlineActionHandler {
|
|||||||
}, RefactoringBundle.message("inline.command", name), null);
|
}, RefactoringBundle.message("inline.command", name), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static boolean showDialog(Project project, String name, Collection<PsiReference> references) {
|
||||||
|
RefactoringMessageDialog dialog = new RefactoringMessageDialog(
|
||||||
|
RefactoringBundle.message("inline.variable.title"),
|
||||||
|
RefactoringBundle.message("inline.local.variable.prompt", name) + " " +
|
||||||
|
RefactoringBundle.message("occurences.string", references.size()),
|
||||||
|
HelpID.INLINE_VARIABLE,
|
||||||
|
"OptionPane.questionIcon",
|
||||||
|
true,
|
||||||
|
project);
|
||||||
|
|
||||||
|
dialog.show();
|
||||||
|
return dialog.isOK();
|
||||||
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
private static String getParametersForFunctionLiteral(JetExpression initializer) {
|
private static String getParametersForFunctionLiteral(JetExpression initializer) {
|
||||||
JetFunctionLiteralExpression functionLiteralExpression = getFunctionLiteralExpression(initializer);
|
JetFunctionLiteralExpression functionLiteralExpression = getFunctionLiteralExpression(initializer);
|
||||||
|
|||||||
Reference in New Issue
Block a user