mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-170909 Sync with Deployed Forgets Last Used "Compare By" Method
This commit is contained in:
@@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user