コード例 #1
0
  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;
  }
コード例 #2
0
 protected DiffPanelImpl createDiffPanelImpl(
     @NotNull DiffRequest request, @Nullable Window window, @NotNull Disposable parentDisposable) {
   return (DiffPanelImpl) DiffManagerImpl.createDiffPanel(request, window, parentDisposable, this);
 }