private boolean checkNoDifferenceAndNotify( DiffPanel diffPanel, DiffRequest data, final Window window, final boolean showMessage) { if (!diffPanel.hasDifferences() && !data.getHints().contains(HINT_ALLOW_NO_DIFFERENCES)) { DiffManagerImpl manager = (DiffManagerImpl) DiffManager.getInstance(); if (!Comparing.equal(manager.getComparisonPolicy(), ComparisonPolicy.DEFAULT)) { ComparisonPolicy oldPolicy = manager.getComparisonPolicy(); manager.setComparisonPolicy(ComparisonPolicy.DEFAULT); Disposable parentDisposable = Disposer.newDisposable(); DiffPanel maybeDiffPanel = DiffManagerImpl.createDiffPanel(data, window, parentDisposable, this); manager.setComparisonPolicy(oldPolicy); boolean hasDiffs = maybeDiffPanel.hasDifferences(); Disposer.dispose(parentDisposable); if (hasDiffs) return false; } if (!showMessage) { return true; } return !askForceOpenDiff(data); } return false; }
public void showDifferences(DiffView diffView) { Frame window = WindowManager.getDefault().getMainWindow(); if (dialog == null) { DialogDescriptor descriptor = dialogDescriptor(diffPanel); dialog = org.openide.DialogDisplayer.getDefault().createDialog(descriptor); dialog.setSize(640, 480); } diffPanel.setDiffView(diffView); dialog.setLocationRelativeTo(window); dialog.setVisible(true); }