public void setFileContentsAreIdentical() {
    if (myTopMessageDiffPanel == null
        || myTopMessageDiffPanel instanceof FileContentsAreIdenticalDiffPanel) {
      LineSeparator sep1 =
          myData.getContent1() == null ? null : myData.getContent1().getLineSeparator();
      LineSeparator sep2 =
          myData.getContent2() == null ? null : myData.getContent2().getLineSeparator();

      if (LineSeparator.knownAndDifferent(sep1, sep2)) {
        myTopMessageDiffPanel = new LineSeparatorsOnlyDiffPanel();
      } else {
        myTopMessageDiffPanel = new FileContentsAreIdenticalDiffPanel();
      }
      myPanel.insertTopComponent(myTopMessageDiffPanel);
    }
  }
 void rediff() {
   try {
     if (myTopMessageDiffPanel != null) {
       myPanel.removeTopComponent(myTopMessageDiffPanel);
     }
     LineBlocks blocks = myData.updateEditors();
     setLineBlocks(blocks != null ? blocks : LineBlocks.EMPTY);
     if (blocks != null && blocks.getCount() == 0) {
       if (myData.isContentsEqual()) {
         setFileContentsAreIdentical();
       }
     }
   } catch (FilesTooBigForDiffException e) {
     setTooBigFileErrorContents();
   }
 }
  public void setHighlightMode(@NotNull HighlightMode mode, boolean notifyManager) {
    myData.setHighlightMode(mode);
    rediff();

    if (notifyManager) {
      DiffManagerImpl.getInstanceEx().setHighlightMode(mode);
    }
  }
  private void setComparisonPolicy(@NotNull ComparisonPolicy policy, boolean notifyManager) {
    myData.setComparisonPolicy(policy);
    rediff();

    if (notifyManager) {
      DiffManagerImpl.getInstanceEx().setComparisonPolicy(policy);
    }
  }
 @Nullable
 public Editor getEditor2() {
   if (myDisposed) LOG.error("Disposed");
   Editor editor = myRightSide.getEditor();
   if (editor != null) return editor;
   if (myData.getContent2() == null) LOG.error("No content 2");
   return editor;
 }
 public void setContents(DiffContent content1, DiffContent content2) {
   LOG.assertTrue(content1 != null && content2 != null);
   LOG.assertTrue(!myDisposed);
   myData.setContents(content1, content2);
   Project project = myData.getProject();
   FileType[] types = DiffUtil.chooseContentTypes(new DiffContent[] {content1, content2});
   VirtualFile beforeFile = content1.getFile();
   VirtualFile afterFile = content2.getFile();
   String path = myDiffRequest == null ? null : myDiffRequest.getWindowTitle();
   myLeftSide.setHighlighterFactory(
       createHighlighter(types[0], beforeFile, afterFile, path, project));
   myRightSide.setHighlighterFactory(
       createHighlighter(types[1], afterFile, beforeFile, path, project));
   setSplitterProportion(content1, content2);
   rediff();
   if (myIsRequestFocus) {
     myPanel.requestScrollEditors();
   }
 }
  public void setDiffRequest(DiffRequest data) {
    myDiffRequest = data;
    if (data.getHints().contains(DiffTool.HINT_DO_NOT_IGNORE_WHITESPACES)) {
      setComparisonPolicy(ComparisonPolicy.DEFAULT, false);
    }
    myDataProvider.putData(myDiffRequest.getGenericData());

    DiffContent content1 = data.getContents()[0];
    DiffContent content2 = data.getContents()[1];

    setContents(content1, content2);
    setTitles(data);

    setWindowTitle(myOwnerWindow, data.getWindowTitle());
    myPanel.setToolbarActions(createToolbar());
    data.customizeToolbar(myPanel.resetToolbar());
    myPanel.registerToolbarActions();
    initEditorSettings(getEditor1());
    initEditorSettings(getEditor2());

    final JComponent oldBottomComponent = myPanel.getBottomComponent();
    if (oldBottomComponent instanceof Disposable) {
      Disposer.dispose((Disposable) oldBottomComponent);
    }
    final JComponent newBottomComponent = data.getBottomComponent();
    myPanel.setBottomComponent(newBottomComponent);

    if (myIsRequestFocus) {
      IdeFocusManager fm = IdeFocusManager.getInstance(myProject);
      boolean isEditor1Focused =
          getEditor1() != null && fm.getFocusedDescendantFor(getEditor1().getComponent()) != null;

      boolean isEditor2Focused =
          myData.getContent2() != null
              && getEditor2() != null
              && fm.getFocusedDescendantFor(getEditor2().getComponent()) != null;

      if (isEditor1Focused || isEditor2Focused) {
        Editor e = isEditor2Focused ? getEditor2() : getEditor1();
        if (e != null) {
          fm.requestFocus(e.getContentComponent(), true);
        }
      }

      myPanel.requestScrollEditors();
    }
  }
 public Project getProject() {
   return myData.getProject();
 }
 @NotNull
 public HighlightMode getHighlightMode() {
   return myData.getHighlightMode();
 }
 public ComparisonPolicy getComparisonPolicy() {
   return myData.getComparisonPolicy();
 }
 public FragmentList getFragments() {
   return myData.getFragmentList();
 }
 public void invalidateDiff() {
   setLineBlocks(LineBlocks.EMPTY);
   myData.removeActions();
 }