Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Intellij Community
Commits
c9affb3b
Commit
c9affb3b
authored
7 years ago
by
Pavel Dolgov
Browse files
Options
Download
Email Patches
Plain Diff
Java: Show "Extract Method" dialog in transaction (IDEA-186521)
parent
2db810c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
java/java-impl/src/com/intellij/refactoring/extractMethod/ExtractMethodProcessor.java
+12
-9
...lij/refactoring/extractMethod/ExtractMethodProcessor.java
with
12 additions
and
9 deletions
+12
-9
java/java-impl/src/com/intellij/refactoring/extractMethod/ExtractMethodProcessor.java
+
12
-
9
View file @
c9affb3b
...
...
@@ -16,6 +16,7 @@ import com.intellij.ide.DataManager;
import
com.intellij.ide.util.PropertiesComponent
;
import
com.intellij.ide.util.PsiClassListCellRenderer
;
import
com.intellij.openapi.application.ApplicationManager
;
import
com.intellij.openapi.application.TransactionGuard
;
import
com.intellij.openapi.command.WriteCommandAction
;
import
com.intellij.openapi.diagnostic.Logger
;
import
com.intellij.openapi.editor.Editor
;
...
...
@@ -26,10 +27,7 @@ import com.intellij.openapi.editor.colors.EditorColorsManager;
import
com.intellij.openapi.editor.markup.TextAttributes
;
import
com.intellij.openapi.progress.ProgressManager
;
import
com.intellij.openapi.project.Project
;
import
com.intellij.openapi.util.Comparing
;
import
com.intellij.openapi.util.Pair
;
import
com.intellij.openapi.util.Pass
;
import
com.intellij.openapi.util.TextRange
;
import
com.intellij.openapi.util.*
;
import
com.intellij.openapi.util.text.StringUtil
;
import
com.intellij.openapi.vfs.VirtualFile
;
import
com.intellij.openapi.wm.WindowManager
;
...
...
@@ -576,11 +574,16 @@ public class ExtractMethodProcessor implements MatchProvider {
}
public
boolean
showDialog
(
final
boolean
direct
)
{
AbstractExtractDialog
dialog
=
createExtractMethodDialog
(
direct
);
dialog
.
show
();
if
(!
dialog
.
isOK
())
return
false
;
apply
(
dialog
);
return
true
;
Ref
<
Boolean
>
result
=
Ref
.
create
(
Boolean
.
FALSE
);
TransactionGuard
.
getInstance
().
submitTransactionAndWait
(()
->
{
AbstractExtractDialog
dialog
=
createExtractMethodDialog
(
direct
);
dialog
.
show
();
if
(
dialog
.
isOK
())
{
apply
(
dialog
);
result
.
set
(
Boolean
.
TRUE
);
}
});
return
result
.
get
();
}
protected
void
apply
(
final
AbstractExtractDialog
dialog
)
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help