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; }
private void ensurePresentation() { if (myCurrentHorizontal != myConfiguration.SHORT_DIFF_HORISONTALLY) { final DiffPanel panel = getCurrentPanel(); myPanel.removeAll(); myPanel.add(myTopPanel, BorderLayout.NORTH); myPanel.add(panel.getComponent(), BorderLayout.CENTER); myPanel.revalidate(); myPanel.repaint(); myCurrentHorizontal = myConfiguration.SHORT_DIFF_HORISONTALLY; } }
private DiffPanel createPanel(final boolean horizontal) { final DiffPanel diffPanel = new DiffPanelImpl(null, myProject, false, horizontal) { @Override protected DiffPanelState createDiffPanelState(@NotNull Disposable parentDisposable) { return new FragmentedDiffPanelState(this, myProject, !horizontal, parentDisposable); } }; diffPanel.enableToolbar(false); diffPanel.removeStatusBar(); DiffPanelOptions o = ((DiffPanelEx) diffPanel).getOptions(); o.setRequestFocusOnNewContent(false); Disposer.register(this, diffPanel); return diffPanel; }