private MergeRequestImpl(
      @NotNull DiffContent left,
      @NotNull DiffContent base,
      @NotNull DiffContent right,
      @Nullable Project project,
      @Nullable final ActionButtonPresentation okButtonPresentation,
      @Nullable final ActionButtonPresentation cancelButtonPresentation) {
    super(project);
    myOkButtonPresentation = okButtonPresentation;
    myCancelButtonPresentation = cancelButtonPresentation;
    myDiffContents[0] = left;
    myDiffContents[1] = base;
    myDiffContents[2] = right;

    if (MergeTool.LOG.isDebugEnabled()) {
      VirtualFile file = base.getFile();
      MergeTool.LOG.debug(
          new Throwable(
              base.getClass()
                  + " - writable: "
                  + base.getDocument().isWritable()
                  + ", contentType: "
                  + base.getContentType()
                  + ", file: "
                  + (file != null ? "valid - " + file.isValid() : "null")
                  + ", presentation: "
                  + myOkButtonPresentation
                  + "-"
                  + myCancelButtonPresentation));
    }
  }
Ejemplo n.º 2
0
 public static boolean isWritable(DiffContent content) {
   Document document = content.getDocument();
   return document != null && document.isWritable();
 }