コード例 #1
0
  @CalledInAwt
  private void reopenWithTool(@NotNull MergeTool tool) {
    if (myConflictResolved) {
      LOG.warn("Can't reopen with " + tool + " - conflict already resolved");
      return;
    }

    if (!tool.canShow(myContext, myRequest)) {
      LOG.warn("Can't reopen with " + tool + " - " + myRequest);
      return;
    }

    MergeTool.MergeViewer newViewer;
    try {
      newViewer = tool.createComponent(myContext, myRequest);
    } catch (Throwable e) {
      LOG.error(e);
      return;
    }

    boolean wasFocused = isFocused();

    destroyViewer();
    myViewer = newViewer;
    updateBottomActions();
    rebuildSouthPanel();
    initViewer();

    if (wasFocused) requestFocusInternal();
  }
コード例 #2
0
  @NotNull
  private MergeTool getFittedTool() {
    for (MergeTool tool : myAvailableTools) {
      try {
        if (tool.canShow(myContext, myRequest)) return tool;
      } catch (Throwable e) {
        LOG.error(e);
      }
    }

    return ErrorMergeTool.INSTANCE;
  }