mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Prefer onSuccess() to invokeLater in run()
This commit is contained in:
+20
-20
@@ -17,7 +17,6 @@ package org.jetbrains.idea.svn.actions;
|
||||
|
||||
import com.intellij.diff.DiffManager;
|
||||
import com.intellij.openapi.actionSystem.*;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.progress.PerformInBackgroundOption;
|
||||
import com.intellij.openapi.progress.ProgressIndicator;
|
||||
import com.intellij.openapi.progress.ProgressManager;
|
||||
@@ -141,33 +140,34 @@ public abstract class AbstractShowPropertiesDiffAction extends AnAction implemen
|
||||
// gets exactly WORKING revision property
|
||||
myAfterContent = getPropertyList(vcs, myChange.getAfterRevision(), myAfterRevision);
|
||||
}
|
||||
catch(SVNException exc) {
|
||||
catch (SVNException exc) {
|
||||
myException = exc;
|
||||
}
|
||||
catch (VcsException exc) {
|
||||
myException = exc;
|
||||
}
|
||||
}
|
||||
|
||||
ApplicationManager.getApplication().invokeLater(() -> {
|
||||
if (myException != null) {
|
||||
Messages.showErrorDialog(myException.getMessage(), myErrorTitle);
|
||||
return;
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
if (myException != null) {
|
||||
Messages.showErrorDialog(myException.getMessage(), myErrorTitle);
|
||||
return;
|
||||
}
|
||||
if (myBeforeContent != null && myAfterContent != null && myBeforeRevisionValue != null && myAfterRevision != null) {
|
||||
SvnPropertiesDiffRequest diffRequest;
|
||||
if (compareRevisions(myBeforeRevisionValue, myAfterRevision) > 0) {
|
||||
diffRequest = new SvnPropertiesDiffRequest(getDiffWindowTitle(myChange),
|
||||
new PropertyContent(myAfterContent), new PropertyContent(myBeforeContent),
|
||||
revisionToString(myAfterRevision), revisionToString(myBeforeRevisionValue));
|
||||
}
|
||||
if (myBeforeContent != null && myAfterContent != null && myBeforeRevisionValue != null && myAfterRevision != null) {
|
||||
SvnPropertiesDiffRequest diffRequest;
|
||||
if (compareRevisions(myBeforeRevisionValue, myAfterRevision) > 0) {
|
||||
diffRequest = new SvnPropertiesDiffRequest(getDiffWindowTitle(myChange),
|
||||
new PropertyContent(myAfterContent), new PropertyContent(myBeforeContent),
|
||||
revisionToString(myAfterRevision), revisionToString(myBeforeRevisionValue));
|
||||
}
|
||||
else {
|
||||
diffRequest = new SvnPropertiesDiffRequest(getDiffWindowTitle(myChange),
|
||||
new PropertyContent(myBeforeContent), new PropertyContent(myAfterContent),
|
||||
revisionToString(myBeforeRevisionValue), revisionToString(myAfterRevision));
|
||||
}
|
||||
DiffManager.getInstance().showDiff(myProject, diffRequest);
|
||||
else {
|
||||
diffRequest = new SvnPropertiesDiffRequest(getDiffWindowTitle(myChange),
|
||||
new PropertyContent(myBeforeContent), new PropertyContent(myAfterContent),
|
||||
revisionToString(myBeforeRevisionValue), revisionToString(myAfterRevision));
|
||||
}
|
||||
});
|
||||
DiffManager.getInstance().showDiff(myProject, diffRequest);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user