IDEA-170909 Sync with Deployed Forgets Last Used "Compare By" Method

This commit is contained in:
Shaverdova Elena
2017-04-04 16:22:45 +02:00
parent 452cd87293
commit d5d053b41f
2 changed files with 8 additions and 8 deletions
@@ -31,7 +31,7 @@ public abstract class DirDiffManager {
return ServiceManager.getService(project, DirDiffManager.class);
}
public abstract void showDiff(@NotNull DiffElement dir1, @NotNull DiffElement dir2, DirDiffSettings settings, @Nullable Runnable onWindowClose);
public abstract void showDiff(@NotNull DiffElement dir1, @NotNull DiffElement dir2, DirDiffSettings settings, @Nullable Runnable onWindowClosing);
public abstract void showDiff(@NotNull DiffElement dir1, @NotNull DiffElement dir2, DirDiffSettings settings);
@@ -43,18 +43,18 @@ public class DirDiffManagerImpl extends DirDiffManager {
public void showDiff(@NotNull final DiffElement dir1,
@NotNull final DiffElement dir2,
final DirDiffSettings settings,
@Nullable final Runnable onWindowClose) {
@Nullable final Runnable onWindowClosing) {
final DirDiffTableModel model = new DirDiffTableModel(myProject, dir1, dir2, settings);
if (settings.showInFrame) {
DirDiffFrame frame = new DirDiffFrame(myProject, model);
setWindowListener(onWindowClose, frame.getFrame());
setWindowListener(onWindowClosing, frame.getFrame());
frame.show();
} else {
DirDiffDialog dirDiffDialog = new DirDiffDialog(myProject, model);
if (myProject == null || myProject.isDefault()/* || isFromModalDialog(myProject)*/) {
dirDiffDialog.setModal(true);
}
setWindowListener(onWindowClose, dirDiffDialog.getOwner());
setWindowListener(onWindowClosing, dirDiffDialog.getOwner());
dirDiffDialog.show();
}
}
@@ -68,12 +68,12 @@ public class DirDiffManagerImpl extends DirDiffManager {
return false;
}
private void setWindowListener(final Runnable onWindowClose, final Window window) {
if (onWindowClose != null) {
private void setWindowListener(final Runnable onWindowClosing, final Window window) {
if (onWindowClosing != null) {
window.addWindowListener(new WindowAdapter() {
@Override
public void windowClosed(WindowEvent e) {
onWindowClose.run();
public void windowClosing(WindowEvent e) {
onWindowClosing.run();
window.removeWindowListener(this);
}
});